From e7050369f91324ba869e7c3ff09ca5cf2f40014d Mon Sep 17 00:00:00 2001 From: Syed Zabiuddin Date: Fri, 7 Feb 2020 11:43:37 +0530 Subject: [PATCH 01/31] #3600 Added in 1.0 deploy --- includes/options/admin-config.php | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/includes/options/admin-config.php b/includes/options/admin-config.php index b24ccd65c..8e6eb1770 100644 --- a/includes/options/admin-config.php +++ b/includes/options/admin-config.php @@ -1986,6 +1986,17 @@ function ampforwp_seo_default() { 'default' => 0, 'required' => array('ampforwp-seo-selection', '=' , 'yoast'), ), + array( + 'id' => 'ampforwp-yoast-bread-crumb', + 'class' => 'child_opt child_opt_arrow', + 'type' => 'switch', + 'default' => false, + 'title' => esc_html__('Breadcrumbs From Yoast', 'accelerated-mobile-pages'), + 'required' => array( + array('ampforwp-bread-crumb', '=' , '1'), + array('ampforwp-seo-selection', '=' , 'yoast') + ), + ), array( 'class' => 'child_opt', 'id' => 'ampforwp-seo-yoast-schema', @@ -5303,17 +5314,6 @@ function ampforwp_get_element_default_color() { ), ) )); -$yoast_breadcrumbs = ''; -if ( defined('WPSEO_FILE') ) { - $yoast_breadcrumbs = array( - 'id' => 'ampforwp-yoast-bread-crumb', - 'type' => 'switch', - 'default' => false, - 'title' => esc_html__('Breadcrumbs From Yoast', 'accelerated-mobile-pages'), - 'required' => array('ampforwp-bread-crumb' , '=' , 1), - 'class' => 'child_opt child_opt_arrow', - ); -} if(!is_plugin_active( 'amp-newspaper-theme/ampforwp-custom-theme.php' ) ){ $single_page_options = array( array( @@ -5451,7 +5451,6 @@ function ampforwp_get_element_default_color() { 'default' => '0', 'required' => array('ampforwp-bread-crumb' , '=' , 1), ), - $yoast_breadcrumbs, //Categories ON/OFF array( 'id' => 'ampforwp-cats-single', From 87632f5e8ad91c63007a98361debdccc46dd858d Mon Sep 17 00:00:00 2001 From: Syed Zabiuddin Date: Fri, 7 Feb 2020 12:09:09 +0530 Subject: [PATCH 02/31] #4096 Added in 1.0 deploy --- templates/design-manager/design-1/style.php | 2 +- templates/design-manager/design-2/style.php | 2 +- templates/design-manager/design-3/style.php | 2 +- templates/design-manager/swift/style.php | 2 +- templates/features.php | 8 ++++++++ 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/templates/design-manager/design-1/style.php b/templates/design-manager/design-1/style.php index 59bf91ddc..9f1a6bf70 100644 --- a/templates/design-manager/design-1/style.php +++ b/templates/design-manager/design-1/style.php @@ -159,7 +159,7 @@ .amp-wp-article {color: ;font-weight: 400;margin: 1.5em auto;max-width: 840px;overflow-wrap: break-word;word-wrap: break-word;} .amp-wp-article-header {align-items: center;align-content: stretch;display: flex;flex-wrap: wrap;justify-content: space-between;margin: 1.5em 16px 1.5em;} .amp-wp-title {color: ;display: block;flex: 1 0 100%;font-weight: 900;font-size:1.5em;margin: 0;width: 100%;}.amp-wp-meta {color: ;display: inline-block;flex: 2 1 50%;font-size: .875em;line-height: 1.7em;margin: 0;padding: 0;}.ampforwp-meta-info{margin-top: 0px;}.amp-wp-article-header .amp-wp-meta:last-of-type {text-align: right;float:right;display:initial}.amp-wp-article-header .amp-wp-meta:first-of-type {text-align: left;}.amp-wp-byline amp-img,.amp-wp-byline .amp-wp-author {display: inline-block;vertical-align: middle;}.amp-wp-byline amp-img {border: 1px solid ;border-radius: 50%;position: relative;margin-right: 6px;}.amp-wp-posted-on {text-align: right;}.hide-meta-info{ display: none; } -.amp-wp-article-featured-image {margin: 1.5em 16px 1.5em;}.amp-wp-article-featured-image amp-img {margin: 0 auto;}.amp-wp-article-featured-image.wp-caption .wp-caption-text, .ampforwp-gallery-item .wp-caption-text {margin: 0 18px;}.amp-wp-frontpage .the_content {padding: 10px;} +.amp-wp-article-featured-image {margin: 1.5em 16px 1.5em;text-align:center;}.amp-wp-article-featured-image amp-img {margin: 0 auto;}.amp-wp-article-featured-image.wp-caption .wp-caption-text, .ampforwp-gallery-item .wp-caption-text {margin: 0 18px;}.amp-wp-frontpage .the_content {padding: 10px;} .ampforwp-gallery-item.amp-carousel-slide { padding-bottom: 20px;} .amp-wp-frontpage .ampforwp-title {margin-left:10px;}.amp-wp-article a{text-decoration:none}.amp-wp-article-content {margin: 0 16px;}.amp-wp-article-content ul,.amp-wp-article-content ol {margin-left: 1em;}.amp-wp-article-content amp-img {margin: 0 auto;}.amp-wp-article-content amp-img.alignright {margin: 0 0 1em 16px;}.amp-wp-article-content amp-img.alignleft {margin: 0 16px 1em 0;} diff --git a/templates/design-manager/design-2/style.php b/templates/design-manager/design-2/style.php index 61e256ebd..3c56142ba 100644 --- a/templates/design-manager/design-2/style.php +++ b/templates/design-manager/design-2/style.php @@ -360,7 +360,7 @@ .the_content p{ margin-top: 5px; color: #333; font-size: 15px; line-height: 26px; margin-bottom: 15px;word-break: break-word; } .the_content small{font-size:11px;line-height:1.2;color:#111;margin-bottom: 5px;display: inline-block;} .amp-wp-tax-tag{ font-size: 13px; border: 0; display: inline-block; margin: 0.5em 0px 0.7em 0px; width: 100%; } -main .amp-wp-content.featured-image-content{ padding: 0px; border: 0; margin-bottom: 0; box-shadow: none } +main .amp-wp-content.featured-image-content{ padding: 0px; border: 0; margin-bottom: 0; box-shadow: none;text-align: center; } .amp-wp-article-featured-image amp-img {margin: 0 auto;} .amp-wp-article-featured-image.wp-caption .wp-caption-text, .ampforwp-gallery-item .wp-caption-text{color: #696969; font-size: 11px; line-height: 15px; background: #eee; margin: 0; padding: .66em .75em; text-align: center;} .ampforwp-gallery-item.amp-carousel-slide { padding-bottom: 20px;} diff --git a/templates/design-manager/design-3/style.php b/templates/design-manager/design-3/style.php index c2c9f8385..c35283fc1 100644 --- a/templates/design-manager/design-3/style.php +++ b/templates/design-manager/design-3/style.php @@ -401,7 +401,7 @@ .the_content p{ margin-top: 0px; margin-bottom: 30px; word-break: break-word; } .the_content small{font-size:11px;line-height:1.2;color:#111;margin-bottom: 5px;display: inline-block;} .amp-wp-tax-tag{ } -main .amp-wp-content.featured-image-content{ padding: 0px; border: 0; margin-bottom: 0; box-shadow: none } +main .amp-wp-content.featured-image-content{ padding: 0px; border: 0; margin-bottom: 0; box-shadow: none; text-align: center; } .amp-wp-content .amp-wp-article-featured-image amp-img {margin: 0 auto;} .single-post .amp-wp-article-content amp-img{ max-width:100% } margin-top: 33px; /i', $post->post_content, $matches); + if(isset($matches[2][0])){ + $image_html = $matches[0][0]; + $image_url = $matches[2][0]; + $image_width = 1366; + $image_height = 600; + } } } // Sanitize it From da84f8e337e750248957a390403a4deaa5d0d25d Mon Sep 17 00:00:00 2001 From: Syed Zabiuddin Date: Fri, 7 Feb 2020 12:12:24 +0530 Subject: [PATCH 03/31] #4133 Added in 1.0 deploy --- components/menu/menu.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/menu/menu.php b/components/menu/menu.php index 6b0d76ef3..04aa0b155 100644 --- a/components/menu/menu.php +++ b/components/menu/menu.php @@ -38,10 +38,10 @@ function amp_menu_html($echo, $menu_args, $type){ $menu_cache = apply_filters('ampforwp_menu_cache',$menu_cache); if ($menu_cache) { if ( 'header' == $type ) { - set_transient('ampforwp_header_menu', $sanitized_menu, 24*HOUR_IN_SECONDS ); + set_transient('ampforwp_header_menu', $sanitized_menu, 14*DAY_IN_SECONDS ); } elseif ('footer' == $type) { - set_transient('ampforwp_footer_menu', $sanitized_menu, 24*HOUR_IN_SECONDS ); + set_transient('ampforwp_footer_menu', $sanitized_menu, 15*DAY_IN_SECONDS ); } } return $sanitized_menu; From 4a66f48be773dbd82b3edeec90e128357cb754e6 Mon Sep 17 00:00:00 2001 From: Syed Zabiuddin Date: Fri, 7 Feb 2020 12:13:51 +0530 Subject: [PATCH 04/31] #4125 Added in 1.0 deploy --- templates/features.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/features.php b/templates/features.php index 6f8315a49..8681b7341 100644 --- a/templates/features.php +++ b/templates/features.php @@ -7394,7 +7394,7 @@ function ampforwp_add_admin_menu_front(){ } function ampforwp_remove_admin_menu_front($wp){ - $node_arr = ['search']; + $node_arr = ['search','admin-bar-likes-widget']; for($i=0;$iremove_node($node_arr[$i]); } From cebd72b0bf0150b8f703b64594da0d07f7824ae4 Mon Sep 17 00:00:00 2001 From: Syed Zabiuddin Date: Fri, 7 Feb 2020 12:15:52 +0530 Subject: [PATCH 05/31] #4137 Added in 1.0 deploy --- components/components-core.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/components-core.php b/components/components-core.php index 3f86b730e..f85f3ee1f 100644 --- a/components/components-core.php +++ b/components/components-core.php @@ -707,6 +707,8 @@ function ampforwp_backtotop_global_css(){?> .rtl amp-carousel {direction: ltr;} .rtl .amp-menu .toggle:after{left:0;right:unset;} .sharedaddy li{display:none} + sub {vertical-align: sub;font-size: small;} + sup {vertical-align: super;font-size: small;} .btt{ position: fixed; From 0212dc0478b2eb1d9af0eb567ba282f72040a7f0 Mon Sep 17 00:00:00 2001 From: Syed Zabiuddin Date: Fri, 7 Feb 2020 12:27:24 +0530 Subject: [PATCH 06/31] #4124 Added in 1.0 deploy --- templates/features.php | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/templates/features.php b/templates/features.php index 8681b7341..58b8a59e1 100644 --- a/templates/features.php +++ b/templates/features.php @@ -7920,4 +7920,41 @@ function ampforwp_ewww_webp_compatibility($content){ } return $content; } +} +add_action( 'admin_notices', 'ampforwp_seo_selection_notice' ); +function ampforwp_seo_selection_notice() { + if('' != ampforwp_get_setting('ampforwp-seo-selection')){ + return; + } + $seo = ''; + if(class_exists('WPSEO_Options')){ + $seo = 'Yoast SEO'; + } + if(class_exists('All_in_One_SEO_Pack')){ + $seo = 'All in One SEO'; + } + if(function_exists( 'the_seo_framework' )){ + $seo = 'The SEO Framework'; + } + if(function_exists('genesis_theme_support')){ + $seo = 'Genesis'; + } + if(function_exists('qode_header_meta')){ + $seo = 'Bridge Qode SEO'; + } + if(defined( 'RANK_MATH_FILE' )){ + $seo = 'Rank Math SEO'; + } + if(defined( 'SQ_ALL_PATTERNS' )){ + $seo = 'Squirrly SEO'; + } + if(class_exists('Smartcrawl_Loader')){ + $seo = 'Smartcrawl SEO'; + } + if(function_exists('seopress_activation')){ + $seo = 'SEO Press'; + } + if(!empty($seo)){ + echo sprintf(('

%s

'), esc_html__('We have detected that you are using '.esc_html($seo).' plugin. Please go to our AMP settings and select '.esc_html($seo).' in SEO section','accelerated-mobile-pages')); + } } \ No newline at end of file From 76d16e8976c1ba7ea5a325bb07a0ec27f3a45746 Mon Sep 17 00:00:00 2001 From: Wasim Akhtar Date: Fri, 7 Feb 2020 12:31:38 +0530 Subject: [PATCH 07/31] #3640-Merged in 1.0-deploy --- includes/options/admin-config.php | 35 ++++++++++++++++++++ templates/design-manager/design-3/single.php | 9 +++++ templates/design-manager/swift/single.php | 6 +++- 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/includes/options/admin-config.php b/includes/options/admin-config.php index 8e6eb1770..b871f19b2 100644 --- a/includes/options/admin-config.php +++ b/includes/options/admin-config.php @@ -5612,6 +5612,19 @@ function ampforwp_get_element_default_color() { 'tooltip-subtitle' => esc_html__('Enable this option to show excerpt for each post of Recent post loop'), 'required' => array('ampforwp-swift-recent-posts' , '=' , '1'), ), + array( + 'id' =>'amp-swift-recentpost-excerpt-len', + 'class' => 'child_opt', + 'type' =>'text', + 'tooltip-subtitle' => esc_html__('Enter the number of words Eg: 15','accelerated-mobile-pages'), + 'title' => esc_html__('Excerpt Length','accelerated-mobile-pages'), + 'required' => array( + array('amp-design-selector', '=' , '4'), + array('amforwp-recentpost-excerpt-switch', '=' , '1'), + ), + 'validate' =>'numeric', + 'default' =>'15', + ), array( 'id' => 'ampforwp-recentpost-posts-link', 'type' => 'switch', @@ -5821,6 +5834,28 @@ function ampforwp_get_element_default_color() { 'tooltip-subtitle' => esc_html__('Enable this option to show image for each post of Recent post loop'), 'required' => array('ampforwp-design3-recent-posts' , '=' , '1'), ), + array( + 'id' => 'amforwp-design3-recentpost-excerpt-switch', + 'type' => 'switch', + 'class' => 'child_opt child_opt_arrow', + 'title' => esc_html__('Excerpt', 'accelerated-mobile-pages'), + 'default' => 1, + 'tooltip-subtitle' => esc_html__('Enable this option to show excerpt for each post of Recent post loop'), + 'required' => array('ampforwp-design3-recent-posts' , '=' , '1'), + ), + array( + 'id' =>'amp-design3-recentpost-excerpt-len', + 'class' => 'child_opt', + 'type' =>'text', + 'tooltip-subtitle' => esc_html__('Enter the number of words Eg: 15','accelerated-mobile-pages'), + 'title' => esc_html__('Excerpt Length','accelerated-mobile-pages'), + 'required' => array( + array('amp-design-selector', '=' , '3'), + array('amforwp-design3-recentpost-excerpt-switch', '=' , '1'), + ), + 'validate' =>'numeric', + 'default' =>'15', + ), array( 'id' => 'ampforwp-design3-number-of-recent-posts', 'type' => 'text', diff --git a/templates/design-manager/design-3/single.php b/templates/design-manager/design-3/single.php index cb8c2ad19..9a1fd4c27 100644 --- a/templates/design-manager/design-3/single.php +++ b/templates/design-manager/design-3/single.php @@ -55,6 +55,15 @@