AMP for WP – Accelerated Mobile Pages - Version 1.0.55

Version Description

(30th June 2020) = * Improvement: Added option to change the Google theme color #4514 * Improvement: Added TravelTour Theme compatibility #4540 * Fixed: Whitelisted

and tags in AMP #4577 * Fixed: amp-embed doesn't include the amp-ad script #4580 * Fixed: Lightbox for images not working in specific scenario #4570 * Fixed: Fatal error on one of the urls. #4438 * Fixed: First priority added to load amp markup when marfeelpress and amp is active #4560 * Fixed: Retina image breaking the layout for Design 2 in homepage #4558 * Fixed: The duplicate text showing after the anchor link #4584 * Fixed: Debug warning #4508

Download this release

Release Info

Developer mohammed_kaludi
Plugin Icon 128x128 AMP for WP – Accelerated Mobile Pages
Version 1.0.55
Comparing to
See all releases

Code changes from version 1.0.53.1 to 1.0.55

Files changed (38) hide show
  1. README.md +34 -33
  2. accelerated-moblie-pages.php +2 -2
  3. changelog.txt +58 -0
  4. classes/class-ampforwp-youtube-embed.php +3 -1
  5. components/author-box/author-box.php +13 -2
  6. components/breadcrumb/breadcrumb.php +2 -1
  7. components/gdpr/gdpr.php +2 -0
  8. components/loop/loop.php +4 -0
  9. images/postviews-for-amp.png +0 -0
  10. includes/features/pagebuilders-support/pagebuilders_support.php +3 -2
  11. includes/features/performance/performance-functions.php +3 -0
  12. includes/options/admin-config.php +40 -2
  13. includes/options/redux-core/core/panel.php +0 -7
  14. includes/redirect.php +6 -0
  15. includes/thirdparty-compatibility.php +56 -7
  16. includes/vendor/amp/includes/amp-post-template-actions.php +0 -1
  17. includes/vendor/amp/includes/lib/fasterimage/FasterImage.php +7 -5
  18. includes/vendor/amp/includes/sanitizers/class-amp-allowed-tags-generated.php +20 -0
  19. includes/vendor/amp/includes/sanitizers/class-amp-blacklist-sanitizer.php +8 -2
  20. pagebuilder/modules/video-module.php +3 -2
  21. readme.txt +35 -34
  22. templates/design-manager/design-1/elements/bread-crumbs.php +2 -1
  23. templates/design-manager/design-1/elements/meta-info.php +1 -0
  24. templates/design-manager/design-1/elements/social-icons.php +8 -3
  25. templates/design-manager/design-2/elements/bread-crumbs.php +2 -1
  26. templates/design-manager/design-2/elements/meta-info.php +1 -0
  27. templates/design-manager/design-2/elements/social-icons.php +8 -3
  28. templates/design-manager/design-3/elements/bread-crumbs.php +2 -1
  29. templates/design-manager/design-3/elements/meta-info.php +2 -1
  30. templates/design-manager/design-3/elements/social-icons.php +8 -3
  31. templates/design-manager/design-3/style.php +4 -3
  32. templates/design-manager/swift/archive.php +3 -0
  33. templates/design-manager/swift/footer.php +7 -2
  34. templates/design-manager/swift/functions.php +7 -2
  35. templates/design-manager/swift/page.php +1 -1
  36. templates/design-manager/swift/single.php +1 -1
  37. templates/design-manager/swift/style.php +33 -1
  38. templates/features.php +314 -41
README.md CHANGED
@@ -4,7 +4,7 @@ Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, go
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.4.2
7
- Stable tag: 1.0.53.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -193,37 +193,38 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
193
 
194
  == Changelog ==
195
 
196
- = 1.0.52 (27th May 2020) =
197
- * Fixed: Reverted the CDN code of WP Rocket plugin which was causing the malformed url issue #4342
198
-
199
- = 1.0.51 (27th May 2020) =
200
- * Improvement: Added option to show instant article post according to updated date #4389
201
- * Improvement: Added Transposh for AMP Extension #4481
202
- * Fixed: Malformed url issue with WPRocket CDN #4342
203
- * Fixed: Call to undefined method WPSEO_Options::get() #4494
204
- * Fixed: Meta description is not working on homepage with yoast #4486
205
- * Fixed: Home Page Meta Description Not Showing in Rankmath SEO #4491
206
- * Fixed: DNS prefetch is disappearing after saving in safari #4470
207
- * Fixed: Robots txt is not working when AMP takeover is enabled #4475
208
- * Fixed: Canonical tag is missing when yoast is activated #4490
209
- * Fixed: Custom taxonomy archive not working LSVR Knowledge Base #4478
210
- * Fixed: Debug Notice trying to access array offset on value of type bool #4469
211
-
212
- = 1.0.50 (20th May 2020) =
213
- * Improvement: Added option to display the GDPR bar at top or bottom #4409
214
- * Improvement: Added option to enable/disable the AMP from the categories or product or any custom taxonomy #4326
215
- * Improvement: Added Hooks in Instant Article #4417
216
- * Improvement: Added Polls for AMP Extension #4451
217
- * Fixed: View Non-AMP link in the footer does not redirect to Non-AMP #3884
218
- * Fixed: Banner notice not looking good in reading settings #4414
219
- * Fixed: Lightbox for images appearing even after disabling #4442
220
- * Fixed: Last modified date showing wrong in header #4456
221
- * Fixed: WPRocket CDN is not working properly in the AMP pages #4342
222
- * Fixed: Lighthouse issues #4443
223
- * Fixed: Thumbnail images in category module not showing in RTL #4459
224
- * Fixed: Blank screen when alt added in images with short pixel plugin #4452
225
- * Fixed: invalid value defer onload with The Business News theme #4465
226
- * Fixed: Text links are not working in mobile #4462
227
- * Fixed: PHP Notice Undefined variable thumb_alt #4460
 
228
 
229
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.4.2
7
+ Stable tag: 1.0.55
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
193
 
194
  == Changelog ==
195
 
196
+ = 1.0.55 (30th June 2020) =
197
+ * Improvement: Added option to change the Google theme color #4514
198
+ * Improvement: Added TravelTour Theme compatibility #4540
199
+ * Fixed: Whitelisted <details> and <summary> tags in AMP #4577
200
+ * Fixed: amp-embed doesn't include the amp-ad script #4580
201
+ * Fixed: Lightbox for images not working in specific scenario #4570
202
+ * Fixed: Fatal error on one of the urls. #4438
203
+ * Fixed: First priority added to load amp markup when marfeelpress and amp is active #4560
204
+ * Fixed: Retina image breaking the layout for Design 2 in homepage #4558
205
+ * Fixed: The duplicate text showing after the anchor link #4584
206
+ * Fixed: Debug warning #4508
207
+
208
+ = 1.0.54.1 (26th June 2020) =
209
+ * Fixed: The duplicate text showing after the anchor link #4584
210
+
211
+ = 1.0.54 (25th June 2020) =
212
+ * Fixed: Odnoklassniki sharing not working properly #4525
213
+ * Fixed: Post title is not appearing when a post is shared through Whatsapp #4513
214
+ * Fixed: Even after activating amp page builder compatibility we are getting this message this feature requires Page Builder For AMP extension. #4530
215
+ * Fixed: RedGIFs embeds break site #4422
216
+ * Fixed: Show notice when user is enabling option "sort related item randomly". #4535
217
+ * Fixed: The mandatory tag 'link rel=canonical' is missing or incorrect due to Yoast SEO premium plugin #4569
218
+ * Fixed: AMP homepage has a wrong canonical link. #4564
219
+ * Fixed: Yoast not working in rare scenario #4562
220
+ * Fixed: Meta title not pulled from YOAST in version 1.0.53.2 #4574
221
+ * Fixed: yoast breadcrumb links not redirecting to amp pages. #4566
222
+ * Fixed: Need to make comatibility with the wordpress embed block in guntenburg editor #4506
223
+ * Fixed: Custom Javascript added with orbital theme and it is showing a validation error on the AMP Pages #4539
224
+ * Fixed: robots.txt file is not generating when AMP takeover beta option is enabled. #4541
225
+ * Fixed: Need to add compatibility of the "Brightcove Video Connect" plugin. #4517
226
+ * Fixed: Debug Warning #4568
227
+ * Fixed: Comments are not displaying on Homepage (only in swift theme) #4571
228
+ * Fixed: The button CSS not appearing in the AMP added with the Gutenberg button module #4572
229
 
230
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
accelerated-moblie-pages.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Accelerated Mobile Pages
4
  Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
5
  Description: AMP for WP - Accelerated Mobile Pages for WordPress
6
- Version: 1.0.53.1
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
@@ -20,7 +20,7 @@ define('AMPFORWP_PLUGIN_DIR_URI', plugin_dir_url(__FILE__));
20
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
21
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
22
  define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
23
- define('AMPFORWP_VERSION','1.0.53.1');
24
  define('AMPFORWP_EXTENSION_DIR',plugin_dir_path(__FILE__).'includes/options/extensions');
25
  if(!defined('AMPFROWP_HOST_NAME')){
26
  $urlinfo = get_bloginfo('url');
3
  Plugin Name: Accelerated Mobile Pages
4
  Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
5
  Description: AMP for WP - Accelerated Mobile Pages for WordPress
6
+ Version: 1.0.55
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
20
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
21
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
22
  define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
23
+ define('AMPFORWP_VERSION','1.0.55');
24
  define('AMPFORWP_EXTENSION_DIR',plugin_dir_path(__FILE__).'includes/options/extensions');
25
  if(!defined('AMPFROWP_HOST_NAME')){
26
  $urlinfo = get_bloginfo('url');
changelog.txt CHANGED
@@ -1,5 +1,63 @@
1
  == Changelog ==
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  = 1.0.52 (27th May 2020) =
4
  * Fixed: Reverted the CDN code of WP Rocket plugin which was causing the malformed url issue #4342
5
 
1
  == Changelog ==
2
 
3
+ = 1.0.55 (30th June 2020) =
4
+ * Improvement: Added option to change the Google theme color #4514
5
+ * Improvement: Added TravelTour Theme compatibility #4540
6
+ * Fixed: Whitelisted <details> and <summary> tags in AMP #4577
7
+ * Fixed: amp-embed doesn't include the amp-ad script #4580
8
+ * Fixed: Lightbox for images not working in specific scenario #4570
9
+ * Fixed: Fatal error on one of the urls. #4438
10
+ * Fixed: First priority added to load amp markup when marfeelpress and amp is active #4560
11
+ * Fixed: Retina image breaking the layout for Design 2 in homepage #4558
12
+ * Fixed: The duplicate text showing after the anchor link #4584
13
+ * Fixed: Debug warning #4508
14
+
15
+ = 1.0.54.1 (26th June 2020) =
16
+ * Fixed: The duplicate text showing after the anchor link #4584
17
+
18
+ = 1.0.54 (25th June 2020) =
19
+ * Fixed: Odnoklassniki sharing not working properly #4525
20
+ * Fixed: Post title is not appearing when a post is shared through Whatsapp #4513
21
+ * Fixed: Even after activating amp page builder compatibility we are getting this message this feature requires Page Builder For AMP extension. #4530
22
+ * Fixed: RedGIFs embeds break site #4422
23
+ * Fixed: Show notice when user is enabling option "sort related item randomly". #4535
24
+ * Fixed: The mandatory tag 'link rel=canonical' is missing or incorrect due to Yoast SEO premium plugin #4569
25
+ * Fixed: AMP homepage has a wrong canonical link. #4564
26
+ * Fixed: Yoast not working in rare scenario #4562
27
+ * Fixed: Meta title not pulled from YOAST in version 1.0.53.2 #4574
28
+ * Fixed: yoast breadcrumb links not redirecting to amp pages. #4566
29
+ * Fixed: Need to make comatibility with the wordpress embed block in guntenburg editor #4506
30
+ * Fixed: Custom Javascript added with orbital theme and it is showing a validation error on the AMP Pages #4539
31
+ * Fixed: robots.txt file is not generating when AMP takeover beta option is enabled. #4541
32
+ * Fixed: Need to add compatibility of the "Brightcove Video Connect" plugin. #4517
33
+ * Fixed: Debug Warning #4568
34
+ * Fixed: Comments are not displaying on Homepage (only in swift theme) #4571
35
+ * Fixed: The button CSS not appearing in the AMP added with the Gutenberg button module #4572
36
+
37
+ = 1.0.53.2 (21st June 2020) =
38
+ * Fixed: Minor Bug
39
+
40
+ = 1.0.53 (19th June 2020) =
41
+ * Improvement: Need to implement YOAST breadcrumb for the category and the tags pages #4493
42
+ * Improvement: Added new set of hooks in all designs #4550
43
+ * Improvement: Added PostViews for AMP Extension #4549
44
+ * Improvement: Created an extra argument to pass for amp_author_box function so author links can be controlled #4466
45
+ * Fixed: Meta description tag is missing in AMP, when custom home page is selected. #4521
46
+ * Fixed: The attribute 'src' in tag 'amp-form extension .js script' is set to the invalid value'. #4515
47
+ * Fixed: The tag 'link rel=canonical' appears more than once in the document due to Yoast SEO premium plugin. #4511
48
+ * Fixed: Getting warnings due to Yoast SEO plugin. #4510
49
+ * Fixed: Issue with Image block of Gutenberg #4507
50
+ * Fixed: Gallery images(Gutenberg editor) are stretched when the Optimize CSS option is enabled. #4502
51
+ * Fixed: If category label has backslash in the name breadcrumbs break #4500
52
+ * Fixed: Vertical scroll Issue in iOS devices when the 'menu overlay' is positioned in right. #4461
53
+ * Fixed: WPRocket CDN is not working properly with the amp pages. #4342
54
+ * Fixed: When gdpr option is enabled the site is becoming unclickable in browser Safari on IOS and MacOS #4542
55
+ * Fixed: Unused HTML was showing in Video Module #4524
56
+ * Fixed: Getting validation error as "The attribute '"_blank"' may not appear in tag 'a' with RankMath #4527
57
+ * Fixed: Anchor tag is stripping in AMP with Sitekit By Google plugin is active #4552
58
+ * Fixed: Date styling not looking good in Design 3 archive pages #4557
59
+ * Fixed: Debug warning #4555
60
+
61
  = 1.0.52 (27th May 2020) =
62
  * Fixed: Reverted the CDN code of WP Rocket plugin which was causing the malformed url issue #4342
63
 
classes/class-ampforwp-youtube-embed.php CHANGED
@@ -117,7 +117,9 @@ class AMPforWP_YouTube_Embed_Handler extends AMP_Base_Embed_Handler {
117
  }
118
  } else {
119
  // ?v={id} or ?list={id}
120
- parse_str( $parsed_url['query'], $query_args );
 
 
121
 
122
  if ( isset( $query_args['v'] ) ) {
123
  $video_id = $this->sanitize_v_arg( $query_args['v'] );
117
  }
118
  } else {
119
  // ?v={id} or ?list={id}
120
+ if(isset($parsed_url['query'])){
121
+ parse_str( $parsed_url['query'], $query_args );
122
+ }
123
 
124
  if ( isset( $query_args['v'] ) ) {
125
  $video_id = $this->sanitize_v_arg( $query_args['v'] );
components/author-box/author-box.php CHANGED
@@ -71,6 +71,10 @@ if ( isset( $args['author_prefix']) ) {
71
  if ( isset( $args['author_link']) ) {
72
  $author_link = $args['author_link'];
73
  }
 
 
 
 
74
  if ( isset( $args['author_wrapper_class']) ) {
75
  $author_wrapper_class = $args['author_wrapper_class'];
76
  }
@@ -100,14 +104,21 @@ if ( isset($args['show_time']) ) {
100
  if ( true == ampforwp_get_setting('ampforwp-author-page-url') ){
101
  if ( function_exists('coauthors_posts_links') ) {
102
  if( $author_pub_name ){
103
- $author_link = (true == ampforwp_get_setting('ampforwp-archive-support'))? esc_url(ampforwp_url_controller($author_link)) : esc_url($author_link);
 
 
 
 
104
  echo '<span class="author-name">' .esc_html($author_prefix) . ' <a href="'. esc_url($author_link).'" title="'. esc_html($author_name).'"> ' .esc_html( $author_name ).'</a></span>';
105
  echo ampforwp_yoast_twitter_handle();
106
  }
107
  }
108
  else {
109
  if( $author_pub_name ){
110
- echo '<span class="author-name">' .esc_html($author_prefix) . ' <a href="'. esc_url(ampforwp_url_controller($author_link)).'" title="'. esc_html($author_name).'"> ' .esc_html( $author_name ).'</a></span>';
 
 
 
111
  echo ampforwp_yoast_twitter_handle();
112
  }
113
  }
71
  if ( isset( $args['author_link']) ) {
72
  $author_link = $args['author_link'];
73
  }
74
+ $is_author_link_amp = true;
75
+ if ( isset( $args['is_author_link_amp']) ) {
76
+ $is_author_link_amp = $args['is_author_link_amp'];
77
+ }
78
  if ( isset( $args['author_wrapper_class']) ) {
79
  $author_wrapper_class = $args['author_wrapper_class'];
80
  }
104
  if ( true == ampforwp_get_setting('ampforwp-author-page-url') ){
105
  if ( function_exists('coauthors_posts_links') ) {
106
  if( $author_pub_name ){
107
+ $auth_link = $author_link;
108
+ if($is_author_link_amp==true){
109
+ $auth_link = ampforwp_url_controller($author_link);
110
+ }
111
+ $author_link = (true == ampforwp_get_setting('ampforwp-archive-support'))? esc_url($auth_link) : esc_url($author_link);
112
  echo '<span class="author-name">' .esc_html($author_prefix) . ' <a href="'. esc_url($author_link).'" title="'. esc_html($author_name).'"> ' .esc_html( $author_name ).'</a></span>';
113
  echo ampforwp_yoast_twitter_handle();
114
  }
115
  }
116
  else {
117
  if( $author_pub_name ){
118
+ if($is_author_link_amp==true){
119
+ $author_link = ampforwp_url_controller($author_link);
120
+ }
121
+ echo '<span class="author-name">' .esc_html($author_prefix) . ' <a href="'. esc_url($author_link).'" title="'. esc_html($author_name).'"> ' .esc_html( $author_name ).'</a></span>';
122
  echo ampforwp_yoast_twitter_handle();
123
  }
124
  }
components/breadcrumb/breadcrumb.php CHANGED
@@ -130,7 +130,8 @@ function amp_breadcrumb_output(){
130
  // Loop through parent categories and store in variable $cat_display
131
  $cat_display = '';
132
  foreach($cat_parents as $parents) {
133
- $cat_id = get_cat_ID( $parents);
 
134
  $cat_link = get_category_link($cat_id);
135
  if(ampforwp_get_setting('ampforwp-archive-support-cat') == true && ampforwp_get_setting('ampforwp-archive-support') == true){
136
  $cat_link = ampforwp_url_controller( $cat_link );
130
  // Loop through parent categories and store in variable $cat_display
131
  $cat_display = '';
132
  foreach($cat_parents as $parents) {
133
+ $categories = get_the_category();
134
+ $cat_id = $categories[0]->cat_ID;
135
  $cat_link = get_category_link($cat_id);
136
  if(ampforwp_get_setting('ampforwp-archive-support-cat') == true && ampforwp_get_setting('ampforwp-archive-support') == true){
137
  $cat_link = ampforwp_url_controller( $cat_link );
components/gdpr/gdpr.php CHANGED
@@ -249,6 +249,8 @@ function ampforwp_gdpr_css(){
249
  z-index:9999;
250
  display: initial;
251
  position: inherit;
 
 
252
  }
253
  <?php }
254
 
249
  z-index:9999;
250
  display: initial;
251
  position: inherit;
252
+ height:20px;
253
+ width:100%;
254
  }
255
  <?php }
256
 
components/loop/loop.php CHANGED
@@ -521,6 +521,10 @@ function amp_loop_image( $data=array() ) {
521
  if(function_exists('ampforwp_check_image_existance')){
522
  $thumb_url = ampforwp_check_image_existance($thumb_url);
523
  }
 
 
 
 
524
  echo '<'.esc_attr($tag).' class="loop-img '.esc_attr($tag_class).'">';
525
  echo '<a href="'.esc_url($imageLink).'" title="'.esc_html(get_the_title()).'">';
526
  $img_content = '<amp-img src="'. esc_url($thumb_url) .'" width="'.esc_attr($thumb_width).'" height="'.esc_attr($thumb_height).'" '. esc_attr($layout_responsive) .' class="'.esc_attr($imageClass).'" alt="'. esc_html(get_the_title()) .'"></amp-img>';
521
  if(function_exists('ampforwp_check_image_existance')){
522
  $thumb_url = ampforwp_check_image_existance($thumb_url);
523
  }
524
+ if(ampforwp_get_setting('ampforwp-retina-images') && (ampforwp_get_setting('amp-design-selector') ==1 || ampforwp_get_setting('amp-design-selector') ==2 ) && (is_home() || is_archive() || is_search()) ){
525
+ $thumb_width = $width / $resolution;
526
+ $thumb_height = $height / $resolution;
527
+ }
528
  echo '<'.esc_attr($tag).' class="loop-img '.esc_attr($tag_class).'">';
529
  echo '<a href="'.esc_url($imageLink).'" title="'.esc_html(get_the_title()).'">';
530
  $img_content = '<amp-img src="'. esc_url($thumb_url) .'" width="'.esc_attr($thumb_width).'" height="'.esc_attr($thumb_height).'" '. esc_attr($layout_responsive) .' class="'.esc_attr($imageClass).'" alt="'. esc_html(get_the_title()) .'"></amp-img>';
images/postviews-for-amp.png ADDED
Binary file
includes/features/pagebuilders-support/pagebuilders_support.php CHANGED
@@ -4,7 +4,8 @@ if ( ! defined( 'ABSPATH' ) ) {
4
  exit;
5
  }
6
  function ampforwp_page_builders_support_options($opt_name){
7
- $divi_pb_for_ampchecker = $elemntr_pb_for_ampchecker = array();
 
8
  $divi_pb_for_ampchecker = array(
9
  'id' => 'divi_pb_for_amp_info_normal',
10
  'type' => 'info',
@@ -41,7 +42,7 @@ function ampforwp_page_builders_support_options($opt_name){
41
  ),
42
  'desc' => sprintf('<div style="background: #FFF9C4;padding: 12px;line-height: 1.6;margin: -45px -14px -18px -17px;"><b>%s</b> %s <a href="https://ampforwp.com/page-builder-compatibility-for-amp/" target="_blank">%s</a> extension.<br /> <div style="margin-top:4px;">(<a href="https://ampforwp.com/page-builder-compatibility-for-amp/" target="_blank">%s</a>)</div></div>',esc_html__( 'ONE LAST STEP REQUIRED:','accelerated-mobile-pages'),esc_html__( 'This feature requires', 'accelerated-mobile-pages' ),esc_html__( 'Page Builder compatibility For AMP', 'accelerated-mobile-pages'),esc_html__( 'Click here for more info', 'accelerated-mobile-pages' )),
43
  );
44
-
45
  $pb_for_amp[] = array(
46
  'id' => 'ampforwp-pagebuilder-accor',
47
  'type' => 'section',
4
  exit;
5
  }
6
  function ampforwp_page_builders_support_options($opt_name){
7
+ $divi_pb_for_ampchecker = $elemntr_pb_for_ampchecker = $avada_pb_for_ampchecker = $avia_pb_for_ampchecker = array();
8
+ if(!function_exists('amp_pagebuilder_compatibility_init')){
9
  $divi_pb_for_ampchecker = array(
10
  'id' => 'divi_pb_for_amp_info_normal',
11
  'type' => 'info',
42
  ),
43
  'desc' => sprintf('<div style="background: #FFF9C4;padding: 12px;line-height: 1.6;margin: -45px -14px -18px -17px;"><b>%s</b> %s <a href="https://ampforwp.com/page-builder-compatibility-for-amp/" target="_blank">%s</a> extension.<br /> <div style="margin-top:4px;">(<a href="https://ampforwp.com/page-builder-compatibility-for-amp/" target="_blank">%s</a>)</div></div>',esc_html__( 'ONE LAST STEP REQUIRED:','accelerated-mobile-pages'),esc_html__( 'This feature requires', 'accelerated-mobile-pages' ),esc_html__( 'Page Builder compatibility For AMP', 'accelerated-mobile-pages'),esc_html__( 'Click here for more info', 'accelerated-mobile-pages' )),
44
  );
45
+ }
46
  $pb_for_amp[] = array(
47
  'id' => 'ampforwp-pagebuilder-accor',
48
  'type' => 'section',
includes/features/performance/performance-functions.php CHANGED
@@ -227,6 +227,9 @@ function ampforwp_white_list_selectors($completeContent){
227
  if(ampforwp_get_setting('ampforwp_css_tree_shaking')==1 && ampforwp_get_setting('content-sneak-peek')==1 ){
228
  $white_list[] = '.hide';
229
  }
 
 
 
230
  $white_list = (array)apply_filters('ampforwp_tree_shaking_white_list_selector',$white_list);
231
  $w_l_str = '';
232
  for($i=0;$i<count($white_list);$i++){
227
  if(ampforwp_get_setting('ampforwp_css_tree_shaking')==1 && ampforwp_get_setting('content-sneak-peek')==1 ){
228
  $white_list[] = '.hide';
229
  }
230
+ if(ampforwp_get_setting('ampforwp_css_tree_shaking')==1){
231
+ $white_list[] = '.amp-carousel-img img';
232
+ }
233
  $white_list = (array)apply_filters('ampforwp_tree_shaking_white_list_selector',$white_list);
234
  $w_l_str = '';
235
  for($i=0;$i<count($white_list);$i++){
includes/options/admin-config.php CHANGED
@@ -675,6 +675,18 @@ $extension_listing_array = array(
675
  'store_url'=>'https://accounts.ampforwp.com',
676
  'is_activated'=>(is_plugin_active('polls-for-amp/polls-for-amp.php')? 1 : 2),
677
  ),
 
 
 
 
 
 
 
 
 
 
 
 
678
  array(
679
  'name'=>'Transposh for AMP',
680
  'class'=>'new-ext',
@@ -3009,7 +3021,7 @@ Redux::setSection( $opt_name, array(
3009
  array(
3010
  'id' => 'ampforwp-duplicate-featured-image',
3011
  'type' => 'switch',
3012
- 'title' => esc_html__('Duplicate Featured Image', 'accelerated-mobile-pages'),
3013
  'tooltip-subtitle' => esc_html__('Turn On the support if you want to show the Featured Image if it already exists in post content.', 'accelerated-mobile-pages'),
3014
  'true' => 'true',
3015
  'false' => 'false',
@@ -3811,7 +3823,26 @@ Redux::setSection( $opt_name, array(
3811
  array('ampforwp-callnow-button', '=' , '1')
3812
  )
3813
  ),
3814
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3815
  array(
3816
  'id' => 'typography-section',
3817
  'type' => 'section',
@@ -6069,6 +6100,13 @@ $single_page_options = array(
6069
  array('ampforwp-single-related-posts-switch', '=' , '1'),
6070
  ),
6071
  ),
 
 
 
 
 
 
 
6072
  array(
6073
  'id' => 'ampforwp-number-of-related-posts',
6074
  'type' => 'text',
675
  'store_url'=>'https://accounts.ampforwp.com',
676
  'is_activated'=>(is_plugin_active('polls-for-amp/polls-for-amp.php')? 1 : 2),
677
  ),
678
+ array(
679
+ 'name'=>'Post Views for AMP',
680
+ 'class'=>'new-ext',
681
+ 'desc'=>'Add Post Views Support in AMP',
682
+ 'img_src'=>AMPFORWP_IMAGE_DIR . '/postviews-for-amp.png',
683
+ 'price'=>'$29',
684
+ 'url_link'=>'https://ampforwp.com/addons/postviews-for-amp/',
685
+ 'plugin_active_path'=> 'postviews-for-amp/postviews-for-amp.php',
686
+ 'item_name'=>'Post Views for AMP',
687
+ 'store_url'=>'https://accounts.ampforwp.com',
688
+ 'is_activated'=>(is_plugin_active('postviews-for-amp/postviews-for-amp.php')? 1 : 2),
689
+ ),
690
  array(
691
  'name'=>'Transposh for AMP',
692
  'class'=>'new-ext',
3021
  array(
3022
  'id' => 'ampforwp-duplicate-featured-image',
3023
  'type' => 'switch',
3024
+ 'title' => esc_html__('Show Featured Image if already preset in content.', 'accelerated-mobile-pages'),
3025
  'tooltip-subtitle' => esc_html__('Turn On the support if you want to show the Featured Image if it already exists in post content.', 'accelerated-mobile-pages'),
3026
  'true' => 'true',
3027
  'false' => 'false',
3823
  array('ampforwp-callnow-button', '=' , '1')
3824
  )
3825
  ),
3826
+ array(
3827
+ 'id' => 'mobile-theme-color',
3828
+ 'type' => 'switch',
3829
+ 'title' => esc_html__('Mobile Theme Color', 'accelerated-mobile-pages'),
3830
+ 'tooltip-subtitle' => esc_html__('Enable this option to Choose mobile theme color','accelerated-mobile-pages'),
3831
+ 'default' => 0,
3832
+ ),
3833
+ array(
3834
+ 'id' => 'mobile-theme-color-picker',
3835
+ 'class' => 'child_opt child_opt_arrow',
3836
+ 'title' => esc_html__('Theme Color', 'accelerated-mobile-pages'),
3837
+ 'tooltip-subtitle' => esc_html__('Choose the Mobile theme color color','accelerated-mobile-pages'),
3838
+ 'type' => 'color_rgba',
3839
+ 'default' => array(
3840
+ 'color' => '#ffffff',
3841
+ ),
3842
+ 'required' => array(
3843
+ array('mobile-theme-color','=',1)
3844
+ )
3845
+ ),
3846
  array(
3847
  'id' => 'typography-section',
3848
  'type' => 'section',
6100
  array('ampforwp-single-related-posts-switch', '=' , '1'),
6101
  ),
6102
  ),
6103
+ array(
6104
+ 'id' => 'ampforwp-sort-related-posts-randomly-notice',
6105
+ 'type' => 'info',
6106
+ 'style' => 'info',
6107
+ 'desc' => esc_html__('Enabling this might have some performance effects for sites who have large number of posts. Please use this with caution.', 'accelerated-mobile-pages'),
6108
+ 'required' => array('ampforwp-single-order-of-related-posts', '=', 1)
6109
+ ),
6110
  array(
6111
  'id' => 'ampforwp-number-of-related-posts',
6112
  'type' => 'text',
includes/options/redux-core/core/panel.php CHANGED
@@ -100,13 +100,6 @@ namespace ReduxCore\ReduxFramework;
100
  echo '</div>';
101
 
102
  if ( $this->parent->args['dev_mode'] == true ) {
103
- if ( current_user_can( 'administrator' ) ) {
104
- global $wpdb;
105
- echo "<br /><pre>";
106
- print_r( esc_sql($wpdb->queries) );
107
- echo "</pre>";
108
- }
109
-
110
  echo '<br /><div class="redux-timer">' . get_num_queries() . ' queries in ' . timer_stop( 0 ) . ' seconds<br/>Redux is currently set to developer mode.</div>';
111
  }
112
 
100
  echo '</div>';
101
 
102
  if ( $this->parent->args['dev_mode'] == true ) {
 
 
 
 
 
 
 
103
  echo '<br /><div class="redux-timer">' . get_num_queries() . ' queries in ' . timer_stop( 0 ) . ' seconds<br/>Redux is currently set to developer mode.</div>';
104
  }
105
 
includes/redirect.php CHANGED
@@ -146,6 +146,12 @@ if(is_search() && 0 == ampforwp_get_setting('amp-redirection-search')){
146
  * If certain conditions does not match then return early and exit from redirection
147
  */
148
 
 
 
 
 
 
 
149
  // return if the current page is Feed page, as we don't need anything on feedpaged
150
  if ( is_feed() ) {
151
  return;
146
  * If certain conditions does not match then return early and exit from redirection
147
  */
148
 
149
+ // #4541
150
+ $this_url = home_url(add_query_arg(array($_GET), $wp->request));
151
+ if(preg_match('/robots\.txt/', $this_url)){
152
+ return;
153
+ }
154
+
155
  // return if the current page is Feed page, as we don't need anything on feedpaged
156
  if ( is_feed() ) {
157
  return;
includes/thirdparty-compatibility.php CHANGED
@@ -59,15 +59,25 @@ function ampforwp_thirdparty_compatibility(){
59
  if(function_exists('heateor_sss_save_default_options') && false == ampforwp_get_setting('ampforwp-sassy_social-switch') ){
60
  add_filter('heateor_sss_disable_sharing','ampforwp_removing_sassy_social_share');
61
  }
62
- if(function_exists('tbn_theme_setup')){
63
  remove_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 );
64
  }
65
- $yoast_noindex = $yoast_noindex_post = '';
66
- $yoast_noindex = get_option( 'wpseo_titles' );
67
- if(isset($yoast_noindex['noindex-post'])){
68
- $yoast_noindex_post = $yoast_noindex['noindex-post'];
69
  }
70
- if (class_exists('WPSEO_Options') && 'yoast' == ampforwp_get_setting('ampforwp-seo-selection') && $yoast_noindex_post && WPSEO_Meta::get_value( 'meta-robots-noindex', ampforwp_get_the_ID()) != 2) {
 
 
 
 
 
 
 
 
 
 
 
 
71
  add_action( 'amp_post_template_head', 'AMPforWP\\AMPVendor\\amp_post_template_add_canonical' );
72
  }elseif (class_exists('WPSEO_Options') && 'yoast' == ampforwp_get_setting('ampforwp-seo-selection') && WPSEO_Meta::get_value( 'meta-robots-noindex', ampforwp_get_the_ID()) == 1) {
73
  add_action( 'amp_post_template_head', 'AMPforWP\\AMPVendor\\amp_post_template_add_canonical' );
@@ -1116,7 +1126,7 @@ if(!function_exists('ampforwp_mistape_plugin_compatibility')){
1116
  }
1117
  }
1118
  function ampforwp_valid_amp_componet_script(){
1119
- $ce_valid_scripts = array('amp-3d-gltf','amp-3q-player','amp-access','amp-analytics','amp-access-laterpay','amp-access-poool','amp-accordion','amp-action-macro','amp-ad-exit','amp-ad','amp-addthis','amp-anim','amp-animation','amp-apester-media','amp-app-banner','amp-audio','amp-auto-ads','amp-autocomplete','amp-base-carousel','amp-beopinion','amp-bind','amp-bodymovin-animation','amp-brid-player','amp-brightcove','amp-byside-content','amp-call-tracking','amp-carousel','amp-connatix-player','amp-consent','amp-dailymotion','amp-date-countdown','amp-date-picker','amp-delight-player','amp-dynamic-css-classes','amp-embedly-card','amp-experiment','amp-facebook-comments','amp-facebook-like','amp-facebook-page','amp-facebook','amp-fit-text','amp-font','amp-form','amp-fx-collection','amp-fx-flying-carpet','amp-geo','amp-gfycat','amp-gist','amp-google-document-embed','amp-google-vrview-image','amp-hulu','amp-iframe','amp-ima-video','amp-image-lightbox','amp-image-slider','amp-imgur','amp-inputmask','amp-instagram','amp-install-serviceworker','amp-izlesene','amp-jwplayer','amp-kaltura-player','amp-lightbox-gallery','amp-lightbox','amp-link-rewriter','amp-list','amp-live-list','amp-mathml','amp-mega-menu','amp-megaphone','amp-minute-media-player','amp-form','amp-mustache','amp-next-page','amp-nexxtv-player','amp-o2-player','amp-ooyala-player','amp-orientation-observer','amp-pan-zoom','amp-pinterest','amp-playbuzz','amp-position-observer','amp-powr-player','amp-reach-player','amp-recaptcha-input','amp-redbull-player','amp-reddit','amp-riddle-quiz','amp-script','amp-selector','amp-sidebar','amp-skimlinks','amp-smartlinks','amp-social-share','amp-soundcloud','amp-springboard-player','amp-sticky-ad','amp-story-auto-ads','amp-story','amp-subscriptions-google','amp-subscriptions','amp-timeago','amp-truncate-text','amp-twitter','amp-user-notification','amp-video-docking','amp-video-iframe','amp-video','amp-vimeo','amp-vine','amp-viqeo-player','amp-viz-vega','amp-vk','amp-web-push','amp-wistia-player','amp-yotpo','amp-youtube');
1120
  $ce_valid_scripts = apply_filters('ampforwp_valid_amp_component_script',$ce_valid_scripts);
1121
  return $ce_valid_scripts;
1122
  }
@@ -1130,4 +1140,43 @@ function ampforwp_wp_optimize_iframe($content){
1130
  unset($content['the_content']);
1131
  }
1132
  return $content;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1133
  }
59
  if(function_exists('heateor_sss_save_default_options') && false == ampforwp_get_setting('ampforwp-sassy_social-switch') ){
60
  add_filter('heateor_sss_disable_sharing','ampforwp_removing_sassy_social_share');
61
  }
62
+ if(function_exists('defer_parsing_of_js')){
63
  remove_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 );
64
  }
65
+ if(class_exists('gdlr_core_page_builder')){
66
+ add_filter('the_content','ampforwp_gdlr_core_page_builder_content',12);
 
 
67
  }
68
+ $yoast_canonical = $yoast_canonical_post = $yoast_canonical_page = '';
69
+ $yoast_canonical = get_option( 'wpseo_titles' );
70
+ if(isset($yoast_canonical['noindex-post'])){
71
+ $yoast_canonical_post = $yoast_canonical['noindex-post'];
72
+ }
73
+ if(isset($yoast_canonical['noindex-page'])){
74
+ $yoast_canonical_page = $yoast_canonical['noindex-page'];
75
+ }
76
+ if (class_exists('WPSEO_Options') && 'yoast' == ampforwp_get_setting('ampforwp-seo-selection') && $yoast_canonical_post && $yoast_canonical_page && WPSEO_Meta::get_value( 'meta-robots-noindex', ampforwp_get_the_ID()) != 2) {
77
+ add_action( 'amp_post_template_head', 'AMPforWP\\AMPVendor\\amp_post_template_add_canonical' );
78
+ }elseif(class_exists('WPSEO_Options') && 'yoast' == ampforwp_get_setting('ampforwp-seo-selection') && is_page() && $yoast_canonical_page ){
79
+ add_action( 'amp_post_template_head', 'AMPforWP\\AMPVendor\\amp_post_template_add_canonical' );
80
+ }elseif(class_exists('WPSEO_Options') && 'yoast' == ampforwp_get_setting('ampforwp-seo-selection') && is_single() && $yoast_canonical_post ){
81
  add_action( 'amp_post_template_head', 'AMPforWP\\AMPVendor\\amp_post_template_add_canonical' );
82
  }elseif (class_exists('WPSEO_Options') && 'yoast' == ampforwp_get_setting('ampforwp-seo-selection') && WPSEO_Meta::get_value( 'meta-robots-noindex', ampforwp_get_the_ID()) == 1) {
83
  add_action( 'amp_post_template_head', 'AMPforWP\\AMPVendor\\amp_post_template_add_canonical' );
1126
  }
1127
  }
1128
  function ampforwp_valid_amp_componet_script(){
1129
+ $ce_valid_scripts = array('amp-3d-gltf','amp-3q-player','amp-access','amp-analytics','amp-access-laterpay','amp-access-poool','amp-accordion','amp-action-macro','amp-ad-exit','amp-ad','amp-embed','amp-addthis','amp-anim','amp-animation','amp-apester-media','amp-app-banner','amp-audio','amp-auto-ads','amp-autocomplete','amp-base-carousel','amp-beopinion','amp-bind','amp-bodymovin-animation','amp-brid-player','amp-brightcove','amp-byside-content','amp-call-tracking','amp-carousel','amp-connatix-player','amp-consent','amp-dailymotion','amp-date-countdown','amp-date-picker','amp-delight-player','amp-dynamic-css-classes','amp-embedly-card','amp-experiment','amp-facebook-comments','amp-facebook-like','amp-facebook-page','amp-facebook','amp-fit-text','amp-font','amp-form','amp-fx-collection','amp-fx-flying-carpet','amp-geo','amp-gfycat','amp-gist','amp-google-document-embed','amp-google-vrview-image','amp-hulu','amp-iframe','amp-ima-video','amp-image-lightbox','amp-image-slider','amp-imgur','amp-inputmask','amp-instagram','amp-install-serviceworker','amp-izlesene','amp-jwplayer','amp-kaltura-player','amp-lightbox-gallery','amp-lightbox','amp-link-rewriter','amp-list','amp-live-list','amp-mathml','amp-mega-menu','amp-megaphone','amp-minute-media-player','amp-form','amp-mustache','amp-next-page','amp-nexxtv-player','amp-o2-player','amp-ooyala-player','amp-orientation-observer','amp-pan-zoom','amp-pinterest','amp-playbuzz','amp-position-observer','amp-powr-player','amp-reach-player','amp-recaptcha-input','amp-redbull-player','amp-reddit','amp-riddle-quiz','amp-script','amp-selector','amp-sidebar','amp-skimlinks','amp-smartlinks','amp-social-share','amp-soundcloud','amp-springboard-player','amp-sticky-ad','amp-story-auto-ads','amp-story','amp-subscriptions-google','amp-subscriptions','amp-timeago','amp-truncate-text','amp-twitter','amp-user-notification','amp-video-docking','amp-video-iframe','amp-video','amp-vimeo','amp-vine','amp-viqeo-player','amp-viz-vega','amp-vk','amp-web-push','amp-wistia-player','amp-yotpo','amp-youtube');
1130
  $ce_valid_scripts = apply_filters('ampforwp_valid_amp_component_script',$ce_valid_scripts);
1131
  return $ce_valid_scripts;
1132
  }
1140
  unset($content['the_content']);
1141
  }
1142
  return $content;
1143
+ }
1144
+ add_action('init','ampforwp_include_required_yoast_files');
1145
+ function ampforwp_include_required_yoast_files(){
1146
+ // Yoast SEO 14+ support helper class #4574
1147
+ $include_file = $include_yoast_files = $include_yoast_premium_files= '';
1148
+ $include_yoast_files = WP_PLUGIN_DIR . '/wordpress-seo/admin/class-meta-columns.php';
1149
+ $include_yoast_premium_files = WP_PLUGIN_DIR . '/wordpress-seo-premium/admin/class-meta-columns.php';
1150
+ if ( file_exists($include_yoast_files) && function_exists('wpseo_init') ) {
1151
+ $include_file = $include_yoast_files;
1152
+ }
1153
+ if ( file_exists($include_yoast_premium_files) && class_exists('WPSEO_Premium')) {
1154
+ $include_file = $include_yoast_premium_files;
1155
+ }
1156
+ if ( file_exists($include_file) ){
1157
+ require_once($include_file);
1158
+ class Ampforwp_Yoast_Data extends WPSEO_Meta_Columns {
1159
+
1160
+ public function get_context_for_post_id($id) {
1161
+ if ( method_exists('WPSEO_Meta_Columns', 'get_context_for_post_id')) {
1162
+ return parent::get_context_for_post_id($id);
1163
+ }
1164
+ return false;
1165
+ }
1166
+ }
1167
+ }
1168
+ }
1169
+ // Load ampforwp markup prior to marfeel amp #4560
1170
+ add_action('plugin_loaded','ampforwp_execute_amp_prior_marfeel', 10);
1171
+ function ampforwp_execute_amp_prior_marfeel(){
1172
+ global $wp_filter;
1173
+ if(function_exists('mrfp_activate_marfeel_press') && isset($wp_filter['plugins_loaded']->callbacks[9])){
1174
+ $current_url = filter_input(INPUT_SERVER, 'REQUEST_URI');
1175
+ $amp_endpoint = explode('/', $current_url);
1176
+ foreach ($wp_filter['plugins_loaded']->callbacks[9] as $key => $value) {
1177
+ if((in_array('amp', $amp_endpoint ) || in_array('?amp', $amp_endpoint) || in_array('?amp=1', $amp_endpoint) ) && isset($value['function']['1']) && $value['function']['1'] == 'marfeel_press_init'){
1178
+ unset($wp_filter['plugins_loaded']->callbacks[9][$key]);
1179
+ }
1180
+ }
1181
+ }
1182
  }
includes/vendor/amp/includes/amp-post-template-actions.php CHANGED
@@ -22,7 +22,6 @@ if( (class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration')) ){
22
  add_action( 'amp_post_template_head', 'AMPforWP\\AMPVendor\\amp_post_template_add_canonical' );
23
  add_action( 'amp_post_template_head', 'AMPforWP\\AMPVendor\\amp_post_template_add_title' );
24
  }
25
-
26
  function amp_post_template_add_canonical( $amp_template ) {
27
  ?>
28
  <link rel="canonical" href="<?php echo esc_url( apply_filters('ampforwp_modify_rel_url',$amp_template->get( 'canonical_url' ) ) ); ?>" />
22
  add_action( 'amp_post_template_head', 'AMPforWP\\AMPVendor\\amp_post_template_add_canonical' );
23
  add_action( 'amp_post_template_head', 'AMPforWP\\AMPVendor\\amp_post_template_add_title' );
24
  }
 
25
  function amp_post_template_add_canonical( $amp_template ) {
26
  ?>
27
  <link rel="canonical" href="<?php echo esc_url( apply_filters('ampforwp_modify_rel_url',$amp_template->get( 'canonical_url' ) ) ); ?>" />
includes/vendor/amp/includes/lib/fasterimage/FasterImage.php CHANGED
@@ -42,11 +42,13 @@ class FasterImage
42
  $results = [];
43
  $request = array();
44
  foreach ( array_values($urls) as $count => $uri ) {
45
- $results[$uri] = array();
46
- $request[$uri] = array(
47
- 'url' => $uri,
48
- 'type' => 'GET',
49
- );
 
 
50
  }
51
  $options= array(
52
  'timeout'=>$this->timeout,
42
  $results = [];
43
  $request = array();
44
  foreach ( array_values($urls) as $count => $uri ) {
45
+ if ( 0 === strpos( $uri, 'http' ) || 0 === strpos( $uri, 'https' )) {
46
+ $results[$uri] = array();
47
+ $request[$uri] = array(
48
+ 'url' => $uri,
49
+ 'type' => 'GET',
50
+ );
51
+ }
52
  }
53
  $options= array(
54
  'timeout'=>$this->timeout,
includes/vendor/amp/includes/sanitizers/class-amp-allowed-tags-generated.php CHANGED
@@ -558,6 +558,10 @@ class AMP_Allowed_Tags_Generated {
558
  array(
559
  'attr_spec_list' => array(
560
  'autoplay' => array(),
 
 
 
 
561
  'data-outstream' => array(
562
  'value_regex' => '[0-9]+',
563
  ),
@@ -604,6 +608,10 @@ class AMP_Allowed_Tags_Generated {
604
  'noloading' => array(
605
  'value' => '',
606
  ),
 
 
 
 
607
  ),
608
  'tag_spec' => array(
609
  'requires_extension' => array(
@@ -10089,6 +10097,18 @@ class AMP_Allowed_Tags_Generated {
10089
  'tag_spec' => array(),
10090
  ),
10091
  ),
 
 
 
 
 
 
 
 
 
 
 
 
10092
  'stop' => array(
10093
  array(
10094
  'attr_spec_list' => array(
558
  array(
559
  'attr_spec_list' => array(
560
  'autoplay' => array(),
561
+ '[dock]' => array(),
562
+ 'dock' => array(
563
+ 'value' => '#dock-slot',
564
+ ),
565
  'data-outstream' => array(
566
  'value_regex' => '[0-9]+',
567
  ),
608
  'noloading' => array(
609
  'value' => '',
610
  ),
611
+ '[dock]' => array(),
612
+ 'dock' => array(
613
+ 'value' => '#dock-slot',
614
+ ),
615
  ),
616
  'tag_spec' => array(
617
  'requires_extension' => array(
10097
  'tag_spec' => array(),
10098
  ),
10099
  ),
10100
+ 'details' => array(
10101
+ array(
10102
+ 'attr_spec_list' => array(),
10103
+ 'tag_spec' => array(),
10104
+ ),
10105
+ ),
10106
+ 'summary' => array(
10107
+ array(
10108
+ 'attr_spec_list' => array(),
10109
+ 'tag_spec' => array(),
10110
+ ),
10111
+ ),
10112
  'stop' => array(
10113
  array(
10114
  'attr_spec_list' => array(
includes/vendor/amp/includes/sanitizers/class-amp-blacklist-sanitizer.php CHANGED
@@ -52,7 +52,13 @@ class AMP_Blacklist_Sanitizer extends AMP_Base_Sanitizer {
52
  }
53
  $node->setAttribute('href',$href);
54
  }
55
- $node->setAttribute('href', \ampforwp_findInternalUrl($href));
 
 
 
 
 
 
56
 
57
  }
58
 
@@ -227,7 +233,7 @@ class AMP_Blacklist_Sanitizer extends AMP_Base_Sanitizer {
227
  * For more info check: https://github.com/ahmedkaludi/accelerated-mobile-pages/issues/2556 and https://github.com/ahmedkaludi/accelerated-mobile-pages/issues/2967
228
  */
229
  if( false === $this->contains_any_multibyte($href) ){
230
- if ( false === filter_var( $href, FILTER_VALIDATE_URL )
231
  && ! in_array( $protocol, $special_protocols, true ) ) {
232
  return false;
233
  }
52
  }
53
  $node->setAttribute('href',$href);
54
  }
55
+ if( function_exists('googlesitekit_activate_plugin') ){
56
+ if(strpos($href,'#') !== 0){
57
+ $node->setAttribute('href', \ampforwp_findInternalUrl($href));
58
+ }
59
+ }else{
60
+ $node->setAttribute('href', \ampforwp_findInternalUrl($href));
61
+ }
62
 
63
  }
64
 
233
  * For more info check: https://github.com/ahmedkaludi/accelerated-mobile-pages/issues/2556 and https://github.com/ahmedkaludi/accelerated-mobile-pages/issues/2967
234
  */
235
  if( false === $this->contains_any_multibyte($href) ){
236
+ if ( false === parse_url( $href,PHP_URL_HOST )
237
  && ! in_array( $protocol, $special_protocols, true ) ) {
238
  return false;
239
  }
pagebuilder/modules/video-module.php CHANGED
@@ -14,8 +14,8 @@ $output = '
14
  controls >
15
  <source src="{{video_upload_link}}"
16
  type="video/mp4" />
17
- <source type="{{video_upload_link}}"
18
- src="/video/tokyo.webm">
19
  </amp-video>
20
  {{ifend_condition_video_option_custom}}
21
 
@@ -87,6 +87,7 @@ return array(
87
  'type' =>'text',
88
  'name' =>"video_upload_link",
89
  'label' =>'Video link',
 
90
  'tab' =>'customizer',
91
  'default' =>'',
92
  'content_type'=>'html',
14
  controls >
15
  <source src="{{video_upload_link}}"
16
  type="video/mp4" />
17
+ <source type="video/webm"
18
+ src="{{video_upload_link}}">
19
  </amp-video>
20
  {{ifend_condition_video_option_custom}}
21
 
87
  'type' =>'text',
88
  'name' =>"video_upload_link",
89
  'label' =>'Video link',
90
+ 'helpmessage' => esc_html__('Please make sure to enter https url link.', 'accelerated-mobile-pages'),
91
  'tab' =>'customizer',
92
  'default' =>'',
93
  'content_type'=>'html',
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
- === AMP for WP - Accelerated Mobile Pages ===
2
  Contributors: mohammed_kaludi, ahmedkaludi, ampforwp
3
  Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, google, plugin, SEO
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.4.2
7
- Stable tag: 1.0.53.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -190,37 +190,38 @@ You can contact us from [here](https://ampforwp.com/contact/)
190
 
191
  == Changelog ==
192
 
193
- = 1.0.52 (27th May 2020) =
194
- * Fixed: Reverted the CDN code of WP Rocket plugin which was causing the malformed url issue #4342
195
-
196
- = 1.0.51 (27th May 2020) =
197
- * Improvement: Added option to show instant article post according to updated date #4389
198
- * Improvement: Added Transposh for AMP Extension #4481
199
- * Fixed: Malformed url issue with WPRocket CDN #4342
200
- * Fixed: Call to undefined method WPSEO_Options::get() #4494
201
- * Fixed: Meta description is not working on homepage with yoast #4486
202
- * Fixed: Home Page Meta Description Not Showing in Rankmath SEO #4491
203
- * Fixed: DNS prefetch is disappearing after saving in safari #4470
204
- * Fixed: Robots txt is not working when AMP takeover is enabled #4475
205
- * Fixed: Canonical tag is missing when yoast is activated #4490
206
- * Fixed: Custom taxonomy archive not working LSVR Knowledge Base #4478
207
- * Fixed: Debug Notice trying to access array offset on value of type bool #4469
208
-
209
- = 1.0.50 (20th May 2020) =
210
- * Improvement: Added option to display the GDPR bar at top or bottom #4409
211
- * Improvement: Added option to enable/disable the AMP from the categories or product or any custom taxonomy #4326
212
- * Improvement: Added Hooks in Instant Article #4417
213
- * Improvement: Added Polls for AMP Extension #4451
214
- * Fixed: View Non-AMP link in the footer does not redirect to Non-AMP #3884
215
- * Fixed: Banner notice not looking good in reading settings #4414
216
- * Fixed: Lightbox for images appearing even after disabling #4442
217
- * Fixed: Last modified date showing wrong in header #4456
218
- * Fixed: WPRocket CDN is not working properly in the AMP pages #4342
219
- * Fixed: Lighthouse issues #4443
220
- * Fixed: Thumbnail images in category module not showing in RTL #4459
221
- * Fixed: Blank screen when alt added in images with short pixel plugin #4452
222
- * Fixed: invalid value defer onload with The Business News theme #4465
223
- * Fixed: Text links are not working in mobile #4462
224
- * Fixed: PHP Notice Undefined variable thumb_alt #4460
 
225
 
226
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
1
+ === AMP for WP - Accelerated Mobile Pages ===
2
  Contributors: mohammed_kaludi, ahmedkaludi, ampforwp
3
  Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, google, plugin, SEO
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.4.2
7
+ Stable tag: 1.0.55
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
190
 
191
  == Changelog ==
192
 
193
+ = 1.0.55 (30th June 2020) =
194
+ * Improvement: Added option to change the Google theme color #4514
195
+ * Improvement: Added TravelTour Theme compatibility #4540
196
+ * Fixed: Whitelisted <details> and <summary> tags in AMP #4577
197
+ * Fixed: amp-embed doesn't include the amp-ad script #4580
198
+ * Fixed: Lightbox for images not working in specific scenario #4570
199
+ * Fixed: Fatal error on one of the urls. #4438
200
+ * Fixed: First priority added to load amp markup when marfeelpress and amp is active #4560
201
+ * Fixed: Retina image breaking the layout for Design 2 in homepage #4558
202
+ * Fixed: The duplicate text showing after the anchor link #4584
203
+ * Fixed: Debug warning #4508
204
+
205
+ = 1.0.54.1 (26th June 2020) =
206
+ * Fixed: The duplicate text showing after the anchor link #4584
207
+
208
+ = 1.0.54 (25th June 2020) =
209
+ * Fixed: Odnoklassniki sharing not working properly #4525
210
+ * Fixed: Post title is not appearing when a post is shared through Whatsapp #4513
211
+ * Fixed: Even after activating amp page builder compatibility we are getting this message this feature requires Page Builder For AMP extension. #4530
212
+ * Fixed: RedGIFs embeds break site #4422
213
+ * Fixed: Show notice when user is enabling option "sort related item randomly". #4535
214
+ * Fixed: The mandatory tag 'link rel=canonical' is missing or incorrect due to Yoast SEO premium plugin #4569
215
+ * Fixed: AMP homepage has a wrong canonical link. #4564
216
+ * Fixed: Yoast not working in rare scenario #4562
217
+ * Fixed: Meta title not pulled from YOAST in version 1.0.53.2 #4574
218
+ * Fixed: yoast breadcrumb links not redirecting to amp pages. #4566
219
+ * Fixed: Need to make comatibility with the wordpress embed block in guntenburg editor #4506
220
+ * Fixed: Custom Javascript added with orbital theme and it is showing a validation error on the AMP Pages #4539
221
+ * Fixed: robots.txt file is not generating when AMP takeover beta option is enabled. #4541
222
+ * Fixed: Need to add compatibility of the "Brightcove Video Connect" plugin. #4517
223
+ * Fixed: Debug Warning #4568
224
+ * Fixed: Comments are not displaying on Homepage (only in swift theme) #4571
225
+ * Fixed: The button CSS not appearing in the AMP added with the Gutenberg button module #4572
226
 
227
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
templates/design-manager/design-1/elements/bread-crumbs.php CHANGED
@@ -130,7 +130,8 @@ if ( ( (is_single() && 1 == ampforwp_get_setting('ampforwp-bread-crumb')) || (is
130
  // Loop through parent categories and store in variable $cat_display
131
  $cat_display = '';
132
  foreach($cat_parents as $parents) {
133
- $cat_id = get_cat_ID( $parents);
 
134
  $cat_link = get_category_link($cat_id);
135
  if(ampforwp_get_setting('ampforwp-archive-support-cat') == true && ampforwp_get_setting('ampforwp-archive-support') == true){
136
  $cat_link = ampforwp_url_controller( $cat_link );
130
  // Loop through parent categories and store in variable $cat_display
131
  $cat_display = '';
132
  foreach($cat_parents as $parents) {
133
+ $categories = get_the_category();
134
+ $cat_id = $categories[0]->cat_ID;
135
  $cat_link = get_category_link($cat_id);
136
  if(ampforwp_get_setting('ampforwp-archive-support-cat') == true && ampforwp_get_setting('ampforwp-archive-support') == true){
137
  $cat_link = ampforwp_url_controller( $cat_link );
templates/design-manager/design-1/elements/meta-info.php CHANGED
@@ -46,6 +46,7 @@ if ( is_single() || (is_page() && $redux_builder_amp['meta_page']) ) : ?>
46
  echo esc_attr(apply_filters('ampforwp_modify_post_date', ampforwp_translation($redux_builder_amp['amp-translator-on-text'], 'On') . ' ' . $date ));
47
  }?>
48
  </time>
 
49
  </div>
50
 
51
  </div>
46
  echo esc_attr(apply_filters('ampforwp_modify_post_date', ampforwp_translation($redux_builder_amp['amp-translator-on-text'], 'On') . ' ' . $date ));
47
  }?>
48
  </time>
49
+ <?php do_action('ampforwp_post_views_ct'); ?>
50
  </div>
51
 
52
  </div>
templates/design-manager/design-1/elements/social-icons.php CHANGED
@@ -79,7 +79,7 @@ if(true == ampforwp_get_setting('ampforwp-social-share')){ ?>
79
  <amp-social-share type="linkedin" width="50" height="28" <?php ampforwp_nofollow_social_links(); ?>></amp-social-share>
80
  <?php } ?>
81
  <?php if($redux_builder_amp['enable-single-whatsapp-share'] == true) { ?>
82
- <a title="whatsapp share" <?php ampforwp_nofollow_social_links(); ?> href="https://api.whatsapp.com/send?text=<?php echo esc_url($amp_permalink); ?>" aria-label="whatsapp share">
83
  <div class="a-so-i">
84
  <amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkd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
- <?php if($redux_builder_amp['enable-single-odnoklassniki-share'] == true) { ?>
103
- <a title="odnoklassniki share" <?php ampforwp_nofollow_social_links(); ?> href="https://ok.ru/dk?st.cmd=addShare&st._surl=<?php echo esc_url($amp_permalink); ?>" target="_blank" aria-label="odnoklassniki share">
 
 
 
 
 
104
  <div class="a-so-i a-so-odnoklassniki">
105
  <amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjY0cHgiIGhlaWdodD0iNjRweCIgdmlld0JveD0iMCAwIDk1LjQ4MSA5NS40ODEiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDk1LjQ4MSA5NS40ODE7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGc+Cgk8Zz4KCQk8cGF0aCBkPSJNNDMuMDQxLDY3LjI1NGMtNy40MDItMC43NzItMTQuMDc2LTIuNTk1LTE5Ljc5LTcuMDY0Yy0wLjcwOS0wLjU1Ni0xLjQ0MS0xLjA5Mi0yLjA4OC0xLjcxMyAgICBjLTIuNTAxLTIuNDAyLTIuNzUzLTUuMTUzLTAuN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U0eiIgZmlsbD0iI0ZGRkZGRiIvPgoJCTxwYXRoIGQ9Ik00Ny41NSw0OC4zMjljLTEzLjIwNS0wLjA0NS0yNC4wMzMtMTAuOTkyLTIzLjk1Ni0yNC4yMThDMjMuNjcsMTAuNzM5LDM0LjUwNS0wLjAzNyw0Ny44NCwwICAgIGMxMy4zNjIsMC4wMzYsMjQuMDg3LDEwLjk2NywyNC4wMiwyNC40NzhDNzEuNzkyLDM3LjY3Nyw2MC44ODksNDguMzc1LDQ3LjU1LDQ4LjMyOXogTTU5LjU1MSwyNC4xNDMgICAgYy0wLjAyMy02LjU2Ny01LjI1My0xMS43OTUtMTEuODA3LTExLjgwMWMtNi42MDktMC4wMDctMTEuODg2LDUuMzE2LTExLjgzNSwxMS45NDNjMC4wNDksNi41NDIsNS4zMjQsMTEuNzMzLDExLjg5NiwxMS43MDkgICAgQzU0LjM1NywzNS45NzEsNTkuNTczLDMwLjcwOSw1OS41NTEsMjQuMTQzeiIgZmlsbD0iI0ZGRkZGRiIvPgoJPC9nPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=" width="50" height="20" />
106
  </div>
79
  <amp-social-share type="linkedin" width="50" height="28" <?php ampforwp_nofollow_social_links(); ?>></amp-social-share>
80
  <?php } ?>
81
  <?php if($redux_builder_amp['enable-single-whatsapp-share'] == true) { ?>
82
+ <a title="whatsapp share" <?php ampforwp_nofollow_social_links(); ?> href="https://api.whatsapp.com/send?text=<?php echo esc_attr(htmlspecialchars(get_the_title()))."\n".esc_url($amp_permalink); ?>" aria-label="whatsapp share">
83
  <div class="a-so-i">
84
  <amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVy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2NC4zMzYsNjAuMTg2LDY0LjE1NmMxLjk4NC0wLjE3OSw2LjQwNi0yLjU5OSw3LjMxMi01LjEwN0M2OC4zOTgsNTYuNTM3LDY4LjM5OCw1NC4zODYsNjguMTI5LDUzLjkzOHoiIGZpbGw9IiNGRkZGRkYiLz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K" width="50" height="20" />
85
  </div>
99
  </div>
100
  </a>
101
  <?php } ?>
102
+ <?php if(ampforwp_get_setting('enable-single-odnoklassniki-share')){
103
+ $feature_img = '';
104
+ if (ampforwp_has_post_thumbnail() ){
105
+ $feature_img = ampforwp_get_post_thumbnail( 'url', 'medium' );
106
+ }
107
+ ?>
108
+ <a title="odnoklassniki share" <?php esc_html(ampforwp_nofollow_social_links()); ?> href="https://connect.ok.ru/offer?url=<?php echo esc_url($amp_permalink); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>&imageUrl=<?php echo esc_url($feature_img); ?>" target="_blank" aria-label="odnoklassniki share">
109
  <div class="a-so-i a-so-odnoklassniki">
110
  <amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1N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41NTEsMjQuMTQzeiIgZmlsbD0iI0ZGRkZGRiIvPgoJPC9nPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=" width="50" height="20" />
111
  </div>
templates/design-manager/design-2/elements/bread-crumbs.php CHANGED
@@ -128,7 +128,8 @@ if ( ( (is_single() && 1 == ampforwp_get_setting('ampforwp-bread-crumb')) || (is
128
  // Loop through parent categories and store in variable $cat_display
129
  $cat_display = '';
130
  foreach($cat_parents as $parents) {
131
- $cat_id = get_cat_ID( $parents);
 
132
  $cat_link = get_category_link($cat_id);
133
  if(ampforwp_get_setting('ampforwp-archive-support-cat') == true && ampforwp_get_setting('ampforwp-archive-support') == true){
134
  $cat_link = ampforwp_url_controller( $cat_link );
128
  // Loop through parent categories and store in variable $cat_display
129
  $cat_display = '';
130
  foreach($cat_parents as $parents) {
131
+ $categories = get_the_category();
132
+ $cat_id = $categories[0]->cat_ID;
133
  $cat_link = get_category_link($cat_id);
134
  if(ampforwp_get_setting('ampforwp-archive-support-cat') == true && ampforwp_get_setting('ampforwp-archive-support') == true){
135
  $cat_link = ampforwp_url_controller( $cat_link );
templates/design-manager/design-2/elements/meta-info.php CHANGED
@@ -29,6 +29,7 @@ if ( is_single() || (is_page() && $redux_builder_amp['meta_page']) ) : ?>
29
  }
30
  echo esc_attr(apply_filters('ampforwp_modify_post_date', ampforwp_translation($redux_builder_amp['amp-translator-on-text'], 'On') . ' ' . $date )) ?></li>
31
  <?php } ?>
 
32
  </div>
33
  <?php endif; ?>
34
 
29
  }
30
  echo esc_attr(apply_filters('ampforwp_modify_post_date', ampforwp_translation($redux_builder_amp['amp-translator-on-text'], 'On') . ' ' . $date )) ?></li>
31
  <?php } ?>
32
+ <?php do_action('ampforwp_post_views'); ?>
33
  </div>
34
  <?php endif; ?>
35
 
templates/design-manager/design-2/elements/social-icons.php CHANGED
@@ -80,7 +80,7 @@ if(true == ampforwp_get_setting('ampforwp-social-share')){ ?>
80
  <amp-social-share type="linkedin" width="50" height="28" <?php ampforwp_nofollow_social_links(); ?>></amp-social-share>
81
  <?php } ?>
82
  <?php if($redux_builder_amp['enable-single-whatsapp-share'] == true) { ?>
83
- <a title="whatsapp share" <?php ampforwp_nofollow_social_links(); ?> href="https://api.whatsapp.com/send?text=<?php echo esc_url($amp_permalink); ?>" aria-label="whatsapp share">
84
  <div class="a-so-i">
85
  <amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjUxMnB4IiBoZWlnaHQ9IjUxMnB4IiB2aWV3Qm94PSIwIDAgOTAgOTAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDkwIDkwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxnPgoJPHBhdGggaWQ9IldoYXRzQXBwIiBkPSJNO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jMC4zNjMtMC43MTcsMC4xODItMS4zNDQtMC4wOS0xLjg4M2MtMC4yNy0wLjUzNy0yLjQzOC01LjgyNS0zLjM0LTcuOTc3ICAgYy0wLjkwMi0yLjE1LTEuODAzLTEuNzkyLTIuNDM2LTEuNzkyYy0wLjYzMSwwLTEuMzU0LTAuMDktMi4wNzYtMC4wOWMtMC43MjIsMC0xLjg5NiwwLjI2OS0yLjg4OSwxLjM0NCAgIGMtMC45OTIsMS4wNzYtMy43ODksMy42NzYtMy43ODksOC45NjNjMCw1LjI4OCwzLjg3OSwxMC4zOTcsNC40MjIsMTEuMTEzYzAuNTQxLDAuNzE2LDcuNDksMTEuOTIsMTguNSwxNi4yMjMgICBDNTguMiw2NS43NzEsNTguMiw2NC4zMzYsNjAuMTg2LDY0LjE1NmMxLjk4NC0wLjE3OSw2LjQwNi0yLjU5OSw3LjMxMi01LjEwN0M2OC4zOTgsNTYuNTM3LDY4LjM5OCw1NC4zODYsNjguMTI5LDUzLjkzOHoiIGZpbGw9IiNGRkZGRkYiLz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K" width="50" height="20" />
86
  </div>
@@ -100,8 +100,13 @@ if(true == ampforwp_get_setting('ampforwp-social-share')){ ?>
100
  </div>
101
  </a>
102
  <?php } ?>
103
- <?php if($redux_builder_amp['enable-single-odnoklassniki-share'] == true) { ?>
104
- <a title="odnoklassniki share" <?php ampforwp_nofollow_social_links(); ?> href="https://ok.ru/dk?st.cmd=addShare&st._surl=<?php echo esc_url($amp_permalink); ?>" target="_blank" aria-label="odnoklassniki share">
 
 
 
 
 
105
  <div class="a-so-i a-so-odnoklassniki">
106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YsMjQuMDg3LDEwLjk2NywyNC4wMiwyNC40NzhDNzEuNzkyLDM3LjY3Nyw2MC44ODksNDguMzc1LDQ3LjU1LDQ4LjMyOXogTTU5LjU1MSwyNC4xNDMgICAgYy0wLjAyMy02LjU2Ny01LjI1My0xMS43OTUtMTEuODA3LTExLjgwMWMtNi42MDktMC4wMDctMTEuODg2LDUuMzE2LTExLjgzNSwxMS45NDNjMC4wNDksNi41NDIsNS4zMjQsMTEuNzMzLDExLjg5NiwxMS43MDkgICAgQzU0LjM1NywzNS45NzEsNTkuNTczLDMwLjcwOSw1OS41NTEsMjQuMTQzeiIgZmlsbD0iI0ZGRkZGRiIvPgoJPC9nPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=" width="50" height="20" />
107
  </div>
80
  <amp-social-share type="linkedin" width="50" height="28" <?php ampforwp_nofollow_social_links(); ?>></amp-social-share>
81
  <?php } ?>
82
  <?php if($redux_builder_amp['enable-single-whatsapp-share'] == true) { ?>
83
+ <a title="whatsapp share" <?php ampforwp_nofollow_social_links(); ?> href="https://api.whatsapp.com/send?text=<?php echo esc_attr(htmlspecialchars(get_the_title()))."\n".esc_url($amp_permalink); ?>" aria-label="whatsapp share">
84
  <div class="a-so-i">
85
  <amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBz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Pgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K" width="50" height="20" />
86
  </div>
100
  </div>
101
  </a>
102
  <?php } ?>
103
+ <?php if(ampforwp_get_setting('enable-single-odnoklassniki-share')){
104
+ $feature_img = '';
105
+ if (ampforwp_has_post_thumbnail() ){
106
+ $feature_img = ampforwp_get_post_thumbnail( 'url', 'medium' );
107
+ }
108
+ ?>
109
+ <a title="odnoklassniki share" <?php esc_html(ampforwp_nofollow_social_links()); ?> href="https://connect.ok.ru/offer?url=<?php echo esc_url($amp_permalink); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>&imageUrl=<?php echo esc_url($feature_img); ?>" target="_blank" aria-label="odnoklassniki share">
110
  <div class="a-so-i a-so-odnoklassniki">
111
  <amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjB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c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=" width="50" height="20" />
112
  </div>
templates/design-manager/design-3/elements/bread-crumbs.php CHANGED
@@ -127,7 +127,8 @@ if ( ( (is_single() && 1 == ampforwp_get_setting('ampforwp-bread-crumb')) || (is
127
  // Loop through parent categories and store in variable $cat_display
128
  $cat_display = '';
129
  foreach($cat_parents as $parents) {
130
- $cat_id = get_cat_ID( $parents);
 
131
  $cat_link = get_category_link($cat_id);
132
  if(ampforwp_get_setting('ampforwp-archive-support-cat') == true && ampforwp_get_setting('ampforwp-archive-support') == true){
133
  $cat_link = ampforwp_url_controller( $cat_link );
127
  // Loop through parent categories and store in variable $cat_display
128
  $cat_display = '';
129
  foreach($cat_parents as $parents) {
130
+ $categories = get_the_category();
131
+ $cat_id = $categories[0]->cat_ID;
132
  $cat_link = get_category_link($cat_id);
133
  if(ampforwp_get_setting('ampforwp-archive-support-cat') == true && ampforwp_get_setting('ampforwp-archive-support') == true){
134
  $cat_link = ampforwp_url_controller( $cat_link );
templates/design-manager/design-3/elements/meta-info.php CHANGED
@@ -33,7 +33,8 @@ if( isset($redux_builder_amp['ampforwp-cats-single']) && $redux_builder_amp['amp
33
  if( true == ampforwp_get_setting('ampforwp-archive-support') && true == ampforwp_get_setting('ampforwp-archive-support-cat')){
34
  $cat_link = ampforwp_url_controller(get_category_link( $cat->term_id ));
35
  }
36
- echo ('<span class="amp-cat-'.esc_attr($cat->term_id).'"><a href="'.esc_url($cat_link). '" >'. esc_html($cat->name) .'</a></span>');
 
37
  }else{
38
  echo '<span class="amp-cat">'. esc_html($cat->name) .'</span>';
39
  }
33
  if( true == ampforwp_get_setting('ampforwp-archive-support') && true == ampforwp_get_setting('ampforwp-archive-support-cat')){
34
  $cat_link = ampforwp_url_controller(get_category_link( $cat->term_id ));
35
  }
36
+ echo ('<span class="amp-cat-'.esc_attr($cat->term_id).'"><a href="'.esc_url($cat_link). '" >'. esc_html($cat->name) .'</a></span>');
37
+ do_action('ampforwp_post_views_ct');
38
  }else{
39
  echo '<span class="amp-cat">'. esc_html($cat->name) .'</span>';
40
  }
templates/design-manager/design-3/elements/social-icons.php CHANGED
@@ -101,7 +101,7 @@ if(true == ampforwp_get_setting('ampforwp-social-share') && false == ampforwp_ge
101
  <?php } ?>
102
  <?php if ( true == $redux_builder_amp['enable-single-whatsapp-share'] ) { ?>
103
  <div class="ampforwp-custom-social">
104
- <a title="whatsapp share" <?php ampforwp_nofollow_social_links(); ?> href="https://api.whatsapp.com/send?text=<?php echo esc_url($amp_permalink);?>" class="a-so-i-rounded a-so-whatsapp" aria-label="whatsapp share">
105
  <amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjUxMnB4IiBoZWlnaHQ9IjUxMnB4IiB2aWV3Qm94PSIwIDAgOTAgOTAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDkwIDkwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxnPgoJPHBhdGggaWQ9IldoYXRzQXBwIiBkPSJNOTA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C4zNjMtMC43MTcsMC4xODItMS4zNDQtMC4wOS0xLjg4M2MtMC4yNy0wLjUzNy0yLjQzOC01LjgyNS0zLjM0LTcuOTc3ICAgYy0wLjkwMi0yLjE1LTEuODAzLTEuNzkyLTIuNDM2LTEuNzkyYy0wLjYzMSwwLTEuMzU0LTAuMDktMi4wNzYtMC4wOWMtMC43MjIsMC0xLjg5NiwwLjI2OS0yLjg4OSwxLjM0NCAgIGMtMC45OTIsMS4wNzYtMy43ODksMy42NzYtMy43ODksOC45NjNjMCw1LjI4OCwzLjg3OSwxMC4zOTcsNC40MjIsMTEuMTEzYzAuNTQxLDAuNzE2LDcuNDksMTEuOTIsMTguNSwxNi4yMjMgICBDNTguMiw2NS43NzEsNTguMiw2NC4zMzYsNjAuMTg2LDY0LjE1NmMxLjk4NC0wLjE3OSw2LjQwNi0yLjU5OSw3LjMxMi01LjEwN0M2OC4zOTgsNTYuNTM3LDY4LjM5OCw1NC4zODYsNjguMTI5LDUzLjkzOHoiIGZpbGw9IiNGRkZGRkYiLz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K" width="16" height="16" />
106
  </a>
107
  </div>
@@ -120,9 +120,14 @@ if(true == ampforwp_get_setting('ampforwp-social-share') && false == ampforwp_ge
120
  </a>
121
  </div>
122
  <?php } ?>
123
- <?php if ( true == $redux_builder_amp['enable-single-odnoklassniki-share'] ) { ?>
 
 
 
 
 
124
  <div class="ampforwp-custom-social">
125
- <a title="odnoklassniki share" <?php ampforwp_nofollow_social_links(); ?> href="https://ok.ru/dk?st.cmd=addShare&st._surl=<?php echo esc_url($amp_permalink); ?>" target="_blank" class="a-so-i-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w0Ny44NCwwICAgIGMxMy4zNjIsMC4wMzYsMjQuMDg3LDEwLjk2NywyNC4wMiwyNC40NzhDNzEuNzkyLDM3LjY3Nyw2MC44ODksNDguMzc1LDQ3LjU1LDQ4LjMyOXogTTU5LjU1MSwyNC4xNDMgICAgYy0wLjAyMy02LjU2Ny01LjI1My0xMS43OTUtMTEuODA3LTExLjgwMWMtNi42MDktMC4wMDctMTEuODg2LDUuMzE2LTExLjgzNSwxMS45NDNjMC4wNDksNi41NDIsNS4zMjQsMTEuNzMzLDExLjg5NiwxMS43MDkgICAgQzU0LjM1NywzNS45NzEsNTkuNTczLDMwLjcwOSw1OS41NTEsMjQuMTQzeiIgZmlsbD0iI0ZGRkZGRiIvPgoJPC9nPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=" width="16" height="16" />
127
  </a>
128
  </div>
101
  <?php } ?>
102
  <?php if ( true == $redux_builder_amp['enable-single-whatsapp-share'] ) { ?>
103
  <div class="ampforwp-custom-social">
104
+ <a title="whatsapp share" <?php ampforwp_nofollow_social_links(); ?> href="https://api.whatsapp.com/send?text=<?php echo esc_attr(htmlspecialchars(get_the_title()))."\n".esc_url($amp_permalink);?>" class="a-so-i-rounded a-so-whatsapp" aria-label="whatsapp share">
105
  <amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE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8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K" width="16" height="16" />
106
  </a>
107
  </div>
120
  </a>
121
  </div>
122
  <?php } ?>
123
+ <?php if(ampforwp_get_setting('enable-single-odnoklassniki-share')){
124
+ $feature_img = '';
125
+ if (ampforwp_has_post_thumbnail() ){
126
+ $feature_img = ampforwp_get_post_thumbnail( 'url', 'medium' );
127
+ }
128
+ ?>
129
  <div class="ampforwp-custom-social">
130
+ <a title="odnoklassniki share" <?php esc_html(ampforwp_nofollow_social_links()); ?> href="https://connect.ok.ru/offer?url=<?php echo esc_url($amp_permalink); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>&imageUrl=<?php echo esc_url($feature_img); ?>" target="_blank" class="a-so-i-rounded a-so-odnoklassniki" aria-label="odnoklassniki share">
131
  <amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIi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CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=" width="16" height="16" />
132
  </a>
133
  </div>
templates/design-manager/design-3/style.php CHANGED
@@ -32,8 +32,9 @@ if ( ! defined( 'ABSPATH' ) ) {
32
  $icon_url = plugin_dir_url('accelerated-mobile-pages/accelerated-moblie-pages.php').'templates/design-manager/'.esc_attr($design).'/';
33
  }
34
  $icon_url = ampforwp_font_url($icon_url);
35
- ?>
36
-
 
37
  /* Global Styling */
38
  body{
39
  font-size: 16px;
@@ -554,6 +555,7 @@ amp-lightbox{ background: rgba(0, 0, 0,0.85); }
554
  .archives_body main{ margin-top:20px }
555
  .taxonomy-description p{margin-top: 5px;font-size: 14px;line-height: 1.5;}
556
  .amp-sub-archives li{width: 50%;} .amp-sub-archives ul{padding: 0;list-style: none;display: flex;font-size: 12px;line-height: 1.2;margin: 5px 0 10px 0px;} .author-img amp-img{border-radius: 50%;margin: 0px 12px 10px 0px;display: block; width:50px;}.author-img{float: left;padding-bottom: 25px;}
 
557
  <?php if ( ampforwp_is_home() || ampforwp_is_blog() ) {?>
558
  /* AMP carousel */
559
  .amp-carousel-button-prev, .amp-carousel-button-next{ top:30px;border-radius:60px; }
@@ -566,7 +568,6 @@ amp-lightbox{ background: rgba(0, 0, 0,0.85); }
566
  .featured_meta{ color:#575757; font-size:12px; margin:0 15px; }
567
  .featured_meta_left{ float:left }
568
  .featured_meta_right{ float:right }
569
- .featured_time{ font-size: 12px; color: #fff; opacity: 0.8; padding-left: 20px;}
570
  <?php }
571
  if( !ampforwp_woocommerce_conditional_check() ) {
572
  if ( is_singular() || is_home() && $redux_builder_amp['amp-frontpage-select-option'] && ampforwp_get_blog_details() == false ) { ?>
32
  $icon_url = plugin_dir_url('accelerated-mobile-pages/accelerated-moblie-pages.php').'templates/design-manager/'.esc_attr($design).'/';
33
  }
34
  $icon_url = ampforwp_font_url($icon_url);
35
+ if ( is_user_logged_in() ) {?>
36
+ #wpadminbar ~ main { margin-top:52px } <?php
37
+ }?>
38
  /* Global Styling */
39
  body{
40
  font-size: 16px;
555
  .archives_body main{ margin-top:20px }
556
  .taxonomy-description p{margin-top: 5px;font-size: 14px;line-height: 1.5;}
557
  .amp-sub-archives li{width: 50%;} .amp-sub-archives ul{padding: 0;list-style: none;display: flex;font-size: 12px;line-height: 1.2;margin: 5px 0 10px 0px;} .author-img amp-img{border-radius: 50%;margin: 0px 12px 10px 0px;display: block; width:50px;}.author-img{float: left;padding-bottom: 25px;}
558
+ .featured_time{ font-size: 12px; color: #fff; opacity: 0.8; padding-left: 20px;}
559
  <?php if ( ampforwp_is_home() || ampforwp_is_blog() ) {?>
560
  /* AMP carousel */
561
  .amp-carousel-button-prev, .amp-carousel-button-next{ top:30px;border-radius:60px; }
568
  .featured_meta{ color:#575757; font-size:12px; margin:0 15px; }
569
  .featured_meta_left{ float:left }
570
  .featured_meta_right{ float:right }
 
571
  <?php }
572
  if( !ampforwp_woocommerce_conditional_check() ) {
573
  if ( is_singular() || is_home() && $redux_builder_amp['amp-frontpage-select-option'] && ampforwp_get_blog_details() == false ) { ?>
templates/design-manager/swift/archive.php CHANGED
@@ -5,6 +5,9 @@ if ( ! defined( 'ABSPATH' ) ) {
5
  global $redux_builder_amp;
6
  amp_header() ?>
7
  <div class="cntr archive">
 
 
 
8
  <div class="arch-tlt">
9
  <?php amp_archive_title(); ?>
10
  </div>
5
  global $redux_builder_amp;
6
  amp_header() ?>
7
  <div class="cntr archive">
8
+ <?php if(true == ampforwp_get_setting('ampforwp-yoast-bread-crumb')){
9
+ echo ampforwp_yoast_breadcrumbs_output();
10
+ }?>
11
  <div class="arch-tlt">
12
  <?php amp_archive_title(); ?>
13
  </div>
templates/design-manager/swift/footer.php CHANGED
@@ -189,7 +189,7 @@ if( (is_single() && $redux_builder_amp['enable-single-social-icons']) || (is_pag
189
  }
190
  ?>
191
  <li>
192
- <a title="whatsapp share" class="s_wp" target="_blank" <?php ampforwp_nofollow_social_links(); ?> href="https://api.whatsapp.com/send?text=<?php echo esc_url($amp_permalink); ?>" data-action="share/whatsapp/share"><?php echo $whatsapp_icon; ?></a>
193
  </li>
194
  <?php } ?>
195
  <?php if(ampforwp_get_setting('enable-single-line-share') == true){
@@ -220,7 +220,12 @@ if( (is_single() && $redux_builder_amp['enable-single-social-icons']) || (is_pag
220
  }
221
  ?>
222
  <li>
223
- <a title="odnoklassniki share" class="s_od" target="_blank" <?php ampforwp_nofollow_social_links(); ?> href="https://ok.ru/dk?st.cmd=addShare&st._surl=<?php echo esc_url($amp_permalink); ?>"><?php echo $odnoklassniki_icon; ?></a>
 
 
 
 
 
224
  </li>
225
  <?php } ?>
226
  <?php if(ampforwp_get_setting('enable-single-reddit-share')){
189
  }
190
  ?>
191
  <li>
192
+ <a title="whatsapp share" class="s_wp" target="_blank" <?php ampforwp_nofollow_social_links(); ?> href="https://api.whatsapp.com/send?text=<?php echo esc_attr(htmlspecialchars(get_the_title()))."\n".esc_url($amp_permalink); ?>" data-action="share/whatsapp/share"><?php echo $whatsapp_icon; ?></a>
193
  </li>
194
  <?php } ?>
195
  <?php if(ampforwp_get_setting('enable-single-line-share') == true){
220
  }
221
  ?>
222
  <li>
223
+ <?php $feature_img = '';
224
+ if (ampforwp_has_post_thumbnail() ){
225
+ $feature_img = ampforwp_get_post_thumbnail( 'url', 'medium' );
226
+ }
227
+ ?>
228
+ <a title="odnoklassniki share" class="s_od" target="_blank" <?php esc_html(ampforwp_nofollow_social_links()); ?> href="https://connect.ok.ru/offer?url=<?php echo esc_url($amp_permalink); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>&imageUrl=<?php echo esc_url($feature_img); ?>"><?php echo $odnoklassniki_icon; ?></a>
229
  </li>
230
  <?php } ?>
231
  <?php if(ampforwp_get_setting('enable-single-reddit-share')){
templates/design-manager/swift/functions.php CHANGED
@@ -181,7 +181,7 @@ function ampforwp_swift_social_icons(){
181
 
182
  ?>
183
  <li>
184
- <a class="s_wp" target="_blank" <?php ampforwp_nofollow_social_links(); ?> href="https://api.whatsapp.com/send?text=<?php echo esc_url($amp_permalink); ?>" data-action="share/whatsapp/share" aria-label="whatsapp share"><?php echo $whatsapp_icon; ?></a>
185
  </li>
186
  <?php } ?>
187
  <?php if(ampforwp_get_setting('enable-single-line-share') == true) {
@@ -214,7 +214,12 @@ function ampforwp_swift_social_icons(){
214
 
215
  ?>
216
  <li>
217
- <a class="s_od" target="_blank" <?php ampforwp_nofollow_social_links(); ?> href="https://ok.ru/dk?st.cmd=addShare&st._surl=<?php echo esc_url($amp_permalink); ?>" aria-label="odnoklassniki share"><?php echo $odnoklassniki_icon; ?></a>
 
 
 
 
 
218
  </li>
219
  <?php } ?>
220
  <?php if(ampforwp_get_setting('enable-single-reddit-share')){
181
 
182
  ?>
183
  <li>
184
+ <a class="s_wp" target="_blank" <?php ampforwp_nofollow_social_links(); ?> href="https://api.whatsapp.com/send?text=<?php echo esc_attr(htmlspecialchars(get_the_title()))."\n".esc_url($amp_permalink); ?>" data-action="share/whatsapp/share" aria-label="whatsapp share"><?php echo $whatsapp_icon; ?></a>
185
  </li>
186
  <?php } ?>
187
  <?php if(ampforwp_get_setting('enable-single-line-share') == true) {
214
 
215
  ?>
216
  <li>
217
+ <?php $feature_img = '';
218
+ if (ampforwp_has_post_thumbnail() ){
219
+ $feature_img = ampforwp_get_post_thumbnail( 'url', 'medium' );
220
+ }
221
+ ?>
222
+ <a class="s_od" target="_blank" <?php esc_html(ampforwp_nofollow_social_links()); ?> href="https://connect.ok.ru/offer?url=<?php echo esc_url($amp_permalink); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>&imageUrl=<?php echo esc_url($feature_img); ?>" aria-label="odnoklassniki share"><?php echo $odnoklassniki_icon; ?></a>
223
  </li>
224
  <?php } ?>
225
  <?php if(ampforwp_get_setting('enable-single-reddit-share')){
templates/design-manager/swift/page.php CHANGED
@@ -44,7 +44,7 @@ amp_header(); ?>
44
  if( !checkAMPforPageBuilderStatus(ampforwp_get_the_ID()) && is_page() && true == ampforwp_get_setting('ampforwp-page-social') && 'above-content' != ampforwp_get_setting('swift-social-position') ) {
45
  echo ampforwp_swift_social_icons();
46
  } ?>
47
- <?php if( !ampforwp_levelup_compatibility('levelup_elementor') && !ampforwp_is_front_page() && !checkAMPforPageBuilderStatus(ampforwp_get_the_ID())){ // Level up Condition starts ?>
48
  <div class="cmts">
49
  <?php amp_comments();?>
50
  </div>
44
  if( !checkAMPforPageBuilderStatus(ampforwp_get_the_ID()) && is_page() && true == ampforwp_get_setting('ampforwp-page-social') && 'above-content' != ampforwp_get_setting('swift-social-position') ) {
45
  echo ampforwp_swift_social_icons();
46
  } ?>
47
+ <?php if( !ampforwp_levelup_compatibility('levelup_elementor') && !checkAMPforPageBuilderStatus(ampforwp_get_the_ID())){ // Level up Condition starts ?>
48
  <div class="cmts">
49
  <?php amp_comments();?>
50
  </div>
templates/design-manager/swift/single.php CHANGED
@@ -102,7 +102,7 @@ global $redux_builder_amp; ?>
102
  <div class="post-date">
103
  <?php amp_date(); ?><?php edit_post_link(); ?>
104
  </div>
105
-
106
  <?php }
107
  if ( ampforwp_get_setting('rp_design_type') == '1' && true == ampforwp_get_setting('ampforwp-single-related-posts-switch')) {
108
  $my_query = ampforwp_related_post_loop_query();
102
  <div class="post-date">
103
  <?php amp_date(); ?><?php edit_post_link(); ?>
104
  </div>
105
+ <?php do_action('ampforwp_post_views_ctr'); ?>
106
  <?php }
107
  if ( ampforwp_get_setting('rp_design_type') == '1' && true == ampforwp_get_setting('ampforwp-single-related-posts-switch')) {
108
  $my_query = ampforwp_related_post_loop_query();
templates/design-manager/swift/style.php CHANGED
@@ -694,6 +694,25 @@ if($redux_builder_amp['swift-social-position'] == 'below-content'){?>
694
  .cntn-wrp small{font-size:11px;line-height:1.2;color:#111;}
695
  .cntn-wrp p, .cntn-wrp ul, .cntn-wrp ol{margin:0px 0px 30px 0px;word-break: break-word;}
696
  .cntn-wrp .wp-block-image,.wp-block-embed{margin:15px 0px;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
697
  .artl-cnt ul li, .artl-cnt ol li{list-style-type: none;position: relative;
698
  <?php if( true == ampforwp_get_setting('amp-rtl-select-option') ) {?>
699
  padding-right:20px;
@@ -2111,7 +2130,7 @@ if (ampforwp_get_setting('enable-amp-ads-resp-6')){?>
2111
  .amp_mod.text-mod p {margin: 0 0 1.5em;}
2112
  <?php } ?>
2113
  <?php //Breadcrumbs
2114
- if( !checkAMPforPageBuilderStatus(ampforwp_get_the_ID()) && ( (is_single() && true == ampforwp_get_setting('ampforwp-bread-crumb')) || (is_page() && ampforwp_get_setting('ampforwp_pages_breadcrumbs')) )) {?>
2115
  .breadcrumbs{padding-bottom: 8px;margin-bottom: 20px;
2116
  <?php if( true == ampforwp_get_setting('breadcrumb-border') ) {?>
2117
  border-bottom: 1px solid #eee;
@@ -2128,6 +2147,7 @@ if ( $ampforwp_font_icon == 'fontawesome-icons' ){ ?>
2128
  <?php } ?>
2129
  display: inline-block;color: #bdbdbd;padding-left: 5px;position: relative;top: 1px;}
2130
  .breadcrumbs li:last-child a:after {display: none;}
 
2131
  <?php } //Breadcrumbs Ends?>
2132
  <?php if(true == ampforwp_get_setting('ampforwp-smooth-scrolling-for-links')){?>
2133
  html {
@@ -2447,4 +2467,16 @@ a.bread-link.bread-home::after {
2447
  border: 1px solid #fff;
2448
  }
2449
  }
 
 
 
 
 
 
 
 
 
 
 
 
2450
  <?php }
694
  .cntn-wrp small{font-size:11px;line-height:1.2;color:#111;}
695
  .cntn-wrp p, .cntn-wrp ul, .cntn-wrp ol{margin:0px 0px 30px 0px;word-break: break-word;}
696
  .cntn-wrp .wp-block-image,.wp-block-embed{margin:15px 0px;}
697
+
698
+ .wp-block-embed{margin-top:45px;}
699
+ .wp-block-embed blockquote a{
700
+ position: absolute;
701
+ height: 285px;
702
+ z-index: 9;
703
+ margin-top: -40px;
704
+ }
705
+ @media(max-width:768px){
706
+ .wp-block-embed blockquote a{
707
+ width: 90%;
708
+ height: 209px;
709
+ margin-top: -95px;
710
+ }
711
+ .wp-block-embed{
712
+ margin-top: 95px;
713
+ }
714
+ }
715
+
716
  .artl-cnt ul li, .artl-cnt ol li{list-style-type: none;position: relative;
717
  <?php if( true == ampforwp_get_setting('amp-rtl-select-option') ) {?>
718
  padding-right:20px;
2130
  .amp_mod.text-mod p {margin: 0 0 1.5em;}
2131
  <?php } ?>
2132
  <?php //Breadcrumbs
2133
+ if( !checkAMPforPageBuilderStatus(ampforwp_get_the_ID()) && ( (is_single() && true == ampforwp_get_setting('ampforwp-bread-crumb')) || (is_page() && ampforwp_get_setting('ampforwp_pages_breadcrumbs'))) || (is_archive() && true == ampforwp_get_setting('ampforwp-yoast-bread-crumb') ) ) {?>
2134
  .breadcrumbs{padding-bottom: 8px;margin-bottom: 20px;
2135
  <?php if( true == ampforwp_get_setting('breadcrumb-border') ) {?>
2136
  border-bottom: 1px solid #eee;
2147
  <?php } ?>
2148
  display: inline-block;color: #bdbdbd;padding-left: 5px;position: relative;top: 1px;}
2149
  .breadcrumbs li:last-child a:after {display: none;}
2150
+ .archive .breadcrumbs {margin-top: 20px;}
2151
  <?php } //Breadcrumbs Ends?>
2152
  <?php if(true == ampforwp_get_setting('ampforwp-smooth-scrolling-for-links')){?>
2153
  html {
2467
  border: 1px solid #fff;
2468
  }
2469
  }
2470
+ <?php }
2471
+ if(ampforwp_get_setting('header-position-type') == '2'){?>
2472
+ @supports (-webkit-touch-callout: none) {
2473
+ .tg + .hamb-mnu {
2474
+ position:relative;
2475
+ overflow:hidden;
2476
+ }
2477
+ .tg:checked + .hamb-mnu {
2478
+ overflow: scroll;
2479
+ position: inherit;
2480
+ }
2481
+ }
2482
  <?php }
templates/features.php CHANGED
@@ -707,6 +707,10 @@ function ampforwp_new_dir( $dir ) {
707
  $content = preg_replace('/<stream[^>]* src="(.*?)"><\/stream>/', '<amp-iframe width="175" height="100" sandbox="allow-scripts allow-same-origin" layout="responsive" allowfullscreen src="https://iframe.cloudflarestream.com/$1"></amp-iframe>', $content);
708
  //Compatibility with amp-connatix-player #3524
709
  $content = preg_replace('/<script id="(.*?)">(.*?)playerId:\s\'(.*?)\'(.*?)mediaId:\s\'(.*?)\'(.*?)<\/script>/s', '<amp-connatix-player data-player-id="$3" data-media-id = "$5" layout="responsive" width="16" height="9"></amp-connatix-player>', $content);
 
 
 
 
710
 
711
  return $content;
712
  }
@@ -748,7 +752,7 @@ function ampforwp_title_custom_meta() {
748
  continue;
749
  }
750
  // Posts
751
- if( $redux_builder_amp['amp-on-off-for-all-posts'] && $post_type == 'post' ) {
752
  add_meta_box( 'ampforwp_title_meta', esc_html__( 'Show AMP for Current Page?','accelerated-mobile-pages' ), 'ampforwp_title_callback', 'post','side' );
753
  }
754
  // Pages
@@ -871,20 +875,20 @@ function ampforwp_mobile_redirection() {
871
  continue;
872
  }
873
  // Posts
874
- if( $redux_builder_amp['amp-on-off-for-all-posts'] && $post_type == 'post' ) {
875
- if ( $redux_builder_amp['amp-mobile-redirection'] ) {
876
  add_meta_box( 'ampforwp_title_meta_redir', esc_html__( 'Mobile Redirection for Current Page?','accelerated-mobile-pages' ), 'ampforwp_title_callback_redirection', 'post','side' );
877
  }
878
  }
879
  // Pages
880
- if( $redux_builder_amp['amp-on-off-for-all-pages'] && $post_type == 'page' ) {
881
- if ( $redux_builder_amp['amp-mobile-redirection'] ) {
882
  add_meta_box( 'ampforwp_title_meta_redir', esc_html__( 'Mobile Redirection for Current Page?' ,'accelerated-mobile-pages'), 'ampforwp_title_callback_redirection','page','side' );
883
  }
884
  }
885
  // Custom Post Types
886
  if( $post_type !== 'page' && $post_type !== 'post' ) {
887
- if ( $redux_builder_amp['amp-mobile-redirection'] ) {
888
  add_meta_box( 'ampforwp_title_meta_redir', esc_html__( 'Mobile Redirection for Current Page?','accelerated-mobile-pages' ), 'ampforwp_title_callback_redirection', $post_type,'side' );
889
  }
890
  }
@@ -1300,7 +1304,7 @@ function ampforwp_sticky_social_icons(){
1300
  <amp-social-share type="linkedin" width="50" height="28" aria-label="linkedin" <?php ampforwp_nofollow_social_links(); ?>></amp-social-share>
1301
  <?php } ?>
1302
  <?php if($redux_builder_amp['enable-single-whatsapp-share'] == true) { ?>
1303
- <a title="whatsapp share" <?php ampforwp_nofollow_social_links(); ?> href="https://api.whatsapp.com/send?text=<?php echo esc_url($amp_permalink);?>">
1304
  <div class="a-so-i">
1305
  <amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjUxMnB4IiBoZWlnaHQ9IjUxMnB4IiB2aWV3Qm94PSIwIDAgOTAgOTAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDkwIDkwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxnPgoJPHBhdGggaWQ9IldoYXRzQXBwIiBkPSJNOTAsNDMuODQxYzAsMjQuMjEzLTE5Ljc3OSw0My44NDEtNDQuMTgyLDQzLjg0MWMtNy43NDcsMC0xNS4wMjUtMS45OC0yMS4zNTctNS40NTVMMCw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yLjE1LTEuODAzLTEuNzkyLTIuNDM2LTEuNzkyYy0wLjYzMSwwLTEuMzU0LTAuMDktMi4wNzYtMC4wOWMtMC43MjIsMC0xLjg5NiwwLjI2OS0yLjg4OSwxLjM0NCAgIGMtMC45OTIsMS4wNzYtMy43ODksMy42NzYtMy43ODksOC45NjNjMCw1LjI4OCwzLjg3OSwxMC4zOTcsNC40MjIsMTEuMTEzYzAuNTQxLDAuNzE2LDcuNDksMTEuOTIsMTguNSwxNi4yMjMgICBDNTguMiw2NS43NzEsNTguMiw2NC4zMzYsNjAuMTg2LDY0LjE1NmMxLjk4NC0wLjE3OSw2LjQwNi0yLjU5OSw3LjMxMi01LjEwN0M2OC4zOTgsNTYuNTM3LDY4LjM5OCw1NC4zODYsNjguMTI5LDUzLjkzOHoiIGZpbGw9IiNGRkZGRkYiLz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K" width="50" height="20" alt="whatsapp" />
1306
  </div>
@@ -1323,8 +1327,13 @@ function ampforwp_sticky_social_icons(){
1323
  </div>
1324
  </a>
1325
  <?php } ?>
1326
- <?php if($redux_builder_amp['enable-single-odnoklassniki-share'] == true) { ?>
1327
- <a title="odnoklassniki share" <?php ampforwp_nofollow_social_links(); ?> href="https://ok.ru/dk?st.cmd=addShare&st._surl=<?php echo esc_url($amp_permalink); ?>" target="_blank">
 
 
 
 
 
1328
  <div class="a-so-i a-so-odnoklassniki">
1329
  <amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgS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AgYy0wLjAyMy02LjU2Ny01LjI1My0xMS43OTUtMTEuODA3LTExLjgwMWMtNi42MDktMC4wMDctMTEuODg2LDUuMzE2LTExLjgzNSwxMS45NDNjMC4wNDksNi41NDIsNS4zMjQsMTEuNzMzLDExLjg5NiwxMS43MDkgICAgQzU0LjM1NywzNS45NzEsNTkuNTczLDMwLjcwOSw1OS41NTEsMjQuMTQzeiIgZmlsbD0iI0ZGRkZGRiIvPgoJPC9nPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=" width="50" height="20" />
1330
  </div>
@@ -1422,7 +1431,9 @@ function ampforwp_add_proper_post_meta(){
1422
  // og url
1423
  add_filter('wpseo_opengraph_url', 'ampforwp_custom_og_url_homepage');
1424
  // This is causing the 2nd debug issue reported in #740
1425
- add_action('wpseo_twitter', 'ampforwp_custom_twitter_image_homepage');
 
 
1426
  add_action('wpseo_add_opengraph_images', 'ampforwp_custom_og_image_homepage');
1427
  }
1428
  }
@@ -1481,7 +1492,7 @@ function ampforwp_yoast_twitter_title($title){
1481
  function ampforwp_yoast_social_title($type) {
1482
  //Added the opengraph for frontpage in AMP #2454
1483
  if(ampforwp_is_front_page() || ampforwp_is_blog() ){
1484
- $title = $page_id = '';
1485
  $page_id = ampforwp_get_the_ID();
1486
  if( 'og' == $type ) {
1487
  $title = WPSEO_Meta::get_value( 'opengraph-title', $page_id );
@@ -1624,6 +1635,16 @@ function ampforwp_replace_title_tags() {
1624
  add_filter( 'pre_get_document_title', 'ampforwp_add_custom_title_tag', 20 );
1625
  add_filter( 'wp_title', 'ampforwp_add_custom_title_tag', 10, 3 );
1626
 
 
 
 
 
 
 
 
 
 
 
1627
  function ampforwp_add_custom_title_tag( $title = '', $sep = '', $seplocation = '' ) {
1628
  global $redux_builder_amp, $post;
1629
  $site_title = '';
@@ -1644,7 +1665,13 @@ function ampforwp_replace_title_tags() {
1644
  //* We can filter this later if needed:
1645
  $sep = ' | ';
1646
  if( class_exists('WPSEO_Options') && method_exists('WPSEO_Options', 'get') && 'yoast' == ampforwp_get_setting('ampforwp-seo-selection') && !class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration')) {
1647
- $sep = WPSEO_Options::get( 'separator' );
 
 
 
 
 
 
1648
  }
1649
  if( defined( 'RANK_MATH_FILE' ) && class_exists('RankMath\\Helper') && 'rank_math' == ampforwp_get_setting('ampforwp-seo-selection') ) {
1650
  $sep = RankMath\Helper::get_settings( 'titles.title_separator' );
@@ -1672,13 +1699,13 @@ function ampforwp_replace_title_tags() {
1672
  else {
1673
  $ID = ampforwp_get_frontpage_id();
1674
  }
1675
- $site_title = get_the_title( $ID ) . $sep . get_option( 'blogname' );
1676
- }
1677
- // Blog page
1678
- if ( ampforwp_is_blog() ) {
1679
- $ID = ampforwp_get_blog_details('id');
1680
- $site_title = get_the_title( $ID ) . $sep . get_option( 'blogname' );
1681
  }
 
 
 
 
 
1682
  }
1683
 
1684
  if ( is_search() ) {
@@ -1693,16 +1720,29 @@ function ampforwp_replace_title_tags() {
1693
  $yoast_instance = new \Yoast\WP\SEO\Presentations\Indexable_Presentation();
1694
  }
1695
 
1696
-
1697
- $WPSEO_Frontend = WPSEO_Frontend::get_instance();
1698
- $yoast_title = $WPSEO_Frontend->title($site_title);
1699
- if ( ampforwp_is_home() ) {
1700
- $yoast_title = $WPSEO_Frontend->get_title_from_options( 'title-home-wpseo' );
 
 
 
 
 
1701
  }
1702
  // Custom Front Page Title From Yoast SEO #1163
1703
- if ( ampforwp_is_front_page() || ampforwp_is_blog() ) {
1704
  $yoast_title = get_post_meta(ampforwp_get_the_ID(), '_yoast_wpseo_title', true);
1705
  $yoast_title = wpseo_replace_vars( $yoast_title,$post );
 
 
 
 
 
 
 
 
1706
  }
1707
  if ( $yoast_title ) {
1708
  $site_title = apply_filters( 'wpseo_title', $yoast_title, $yoast_instance );
@@ -3225,6 +3265,13 @@ function ampforwp_meta_description() {
3225
  echo '<meta name="description" content="'. esc_attr( convert_chars( stripslashes( $desc ) ) ) .'"/>';
3226
  }else if(class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration')){
3227
  $yoast_desc = addslashes( strip_tags( WPSEO_Meta::get_value('metadesc', ampforwp_get_the_ID() ) ) );
 
 
 
 
 
 
 
3228
  if ($yoast_desc && ampforwp_is_front_page()) {
3229
  echo '<meta name="description" content="'. esc_attr( convert_chars( stripslashes( $yoast_desc ) ) ) .'"/>';
3230
  }
@@ -3455,7 +3502,7 @@ function ampforwp_frontpage_comments() {
3455
 
3456
  $post_id = ampforwp_get_frontpage_id();
3457
 
3458
- if ($data['elements'] == '') {
3459
  $data['elements'] = "meta_info:1,title:1,featured_image:1,content:1,meta_taxonomy:1,social_icons:1,comments:1,related_posts:1";
3460
  }
3461
  if( isset( $data['elements'] ) || ! empty( $data['elements'] ) ){
@@ -4117,6 +4164,40 @@ function ampforwp_rel_canonical_paginated_post(){
4117
  }
4118
  add_action('ampforwp_after_post_content','ampforwp_post_pagination');
4119
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4120
 
4121
  // 70. Hide AMP by specific Categories & Tags #872
4122
  function ampforwp_posts_to_remove () {
@@ -4791,6 +4872,7 @@ function ampforwp_inline_related_posts(){
4791
  );
4792
  }
4793
  $args = apply_filters('ampforwp_inlne_related_posts_query_args', $args);
 
4794
  $my_query = new wp_query( $args );
4795
  if( $my_query->have_posts() ) {
4796
  $inline_related_posts_img = '';
@@ -5208,7 +5290,7 @@ if( ! function_exists( 'ampforwp_view_amp_admin_bar' ) ) {
5208
  // Check if current post type is AMPed or not
5209
  if( $supported_amp_post_types && in_array($post->post_type, $supported_amp_post_types) ){
5210
  // If AMP on Posts or Pages is off then do nothing
5211
- if($post->post_type == 'post' && !$redux_builder_amp['amp-on-off-for-all-posts'] || $post->post_type == 'page' && !$redux_builder_amp['amp-on-off-for-all-pages']) {
5212
  return;
5213
  }
5214
  if( is_archive() && is_category() ){
@@ -5844,19 +5926,19 @@ function ampforwp_is_non_amp( $type="" ) {
5844
 
5845
 
5846
  // Check for Posts
5847
- if ( is_single() && false == $redux_builder_amp['amp-on-off-for-all-posts'] ) {
5848
  return false;
5849
  }
5850
  // Archives
5851
- if ( is_archive() && false == $redux_builder_amp['ampforwp-archive-support'] ) {
5852
  return false;
5853
  }
5854
  // Pages
5855
- if ( is_page() && false == $redux_builder_amp['amp-on-off-for-all-pages'] ) {
5856
  return false;
5857
  }
5858
  // Homepage
5859
- if ( is_home() && false == $redux_builder_amp['ampforwp-homepage-on-off-support'] ) {
5860
  return false;
5861
  }
5862
  // Search #2681
@@ -6764,9 +6846,14 @@ add_action('amp_post_template_css', 'ampforwp_gutenberg_css');
6764
  }
6765
  if ( ! function_exists('ampforwp_gutenberg_css') ) {
6766
  function ampforwp_gutenberg_css(){
6767
- $color_data = get_theme_support('editor-color-palette');?>
 
 
 
 
 
6768
  .wp-block-button { color: #fff}
6769
- .wp-block-button a {background-color: #32373c;border-radius: 28px;color: inherit;display: inline-block;padding: 12px 24px;}
6770
  .wp-block-cover{position:relative;background-color: #000;background-size: cover;background-position: center center;min-height: 430px;width: 100%;margin: 1.5em 0 1.5em 0;display: flex;justify-content: center;align-items: center;overflow: hidden;}
6771
  .wp-block-cover-text{color: #fff;font-size: 2em;line-height: 1.25;z-index: 1;}
6772
  .wp-block-cover-image.has-background-dim::before, .wp-block-cover.has-background-dim::before {content: "";position: absolute;top: 0;left: 0;bottom: 0;right: 0;background-color: inherit;opacity: .5;z-index: 1;} <?php
@@ -7204,6 +7291,9 @@ function ampforwp_yoast_breadcrumbs_output(){
7204
  $breadcrumb = '';
7205
  if ( true == ampforwp_get_setting('ampforwp-yoast-bread-crumb') && true === WPSEO_Options::get( 'breadcrumbs-enable' ) && function_exists('yoast_breadcrumb')) {
7206
  $breadcrumb = yoast_breadcrumb('','', false);
 
 
 
7207
  return $breadcrumb;
7208
  }
7209
  }
@@ -7770,6 +7860,18 @@ function ampforwp_nofollow_cta_header_link(){
7770
  return false;
7771
  }
7772
 
 
 
 
 
 
 
 
 
 
 
 
 
7773
  // Font Selector
7774
  if( ! function_exists('ampforwp_font_selector') ) {
7775
  function ampforwp_font_selector( $container ) {
@@ -7790,7 +7892,27 @@ if( ! function_exists('ampforwp_font_selector') ) {
7790
  return sanitize_text_field($fontFamily);
7791
  }
7792
  }
7793
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7794
  // Font URL controller
7795
  if ( ! function_exists('ampforwp_font_url') ) {
7796
  function ampforwp_font_url($font_url){
@@ -7976,9 +8098,14 @@ function ampforwp_remove_unwanted_code($content){
7976
  $content = preg_replace('/<form class="mv-create-print-form">(.*?)<\/form>/s', '', $content);
7977
  }
7978
  // close #4206
 
 
 
 
 
 
7979
  return $content;
7980
  }
7981
-
7982
  add_filter('ampforwp_the_content_last_filter','ampforwp_include_required_scripts',12);
7983
  function ampforwp_include_required_scripts($content){
7984
  $comp_to_remove_arr = array();
@@ -8014,6 +8141,9 @@ function ampforwp_include_required_scripts($content){
8014
  if($comp=='state'){
8015
  $is_script = true;
8016
  }
 
 
 
8017
  if($is_script==false){
8018
  $headers = get_headers($comp_url);
8019
  if(isset($headers[0])){
@@ -8089,7 +8219,7 @@ function ampforwp_include_required_scripts($content){
8089
  }
8090
  }
8091
  //OTHER COMPONENT CHECK
8092
- $other_comp_arr = array('amp-mustache'=>'amp-mustache','form'=>'amp-form','amp-access'=>'amp-access','amp-fx'=>'amp-fx-collection');
8093
  foreach ($other_comp_arr as $key => $value) {
8094
  $ocomp = $value;
8095
  $celem = 'element';
@@ -8143,6 +8273,43 @@ function ampforwp_include_required_scripts($content){
8143
  }
8144
  }
8145
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8146
  // Scripts added from Options panel should have higher priority #4064
8147
  if( ampforwp_get_setting('amp-header-text-area-for-html') && ampforwp_get_setting('amp-header-text-area-for-html')!="") {
8148
  $allscripts = ampforwp_get_setting('amp-header-text-area-for-html');
@@ -8199,6 +8366,7 @@ if(!function_exists('ampforwp_add_fallback_element')){
8199
  $m_content = $matches[1][$i];
8200
  $m_content = ampforwp_imagify_webp_compatibility($m_content);
8201
  $m_content = ampforwp_ewww_webp_compatibility($m_content);
 
8202
  $m1_content = ampforwp_set_default_fallback_image($matches[1][$i]);
8203
  preg_match_all('/src="(.*?)"/', $m1_content,$fimgsrc);
8204
  preg_match_all('/width="(.*?)"/', $m1_content,$fimgwidth);
@@ -8233,6 +8401,7 @@ if(!function_exists('ampforwp_add_fallback_element')){
8233
  $m1_content = str_replace($swidth, $width_rep, $m1_content);
8234
  $m1_content = str_replace($sheight, $height_rep, $m1_content);
8235
  $m1_content = str_replace($salt, $alt_rep, $m1_content);
 
8236
  $fallback_img = "<amp-img ".$m_content."<amp-img fallback ".$m1_content."</amp-img></amp-img>";//$m_content, $m1_content escaped above.
8237
  $content = str_replace("$match", $fallback_img, $content);
8238
  }
@@ -8368,14 +8537,25 @@ if(class_exists('RankMath')){
8368
  function ampforwp_rank_math_external_link_newtab($content){
8369
  $rank_math_external_link = RankMath\Helper::get_settings( 'general.new_window_external_links' );
8370
  if($rank_math_external_link){
8371
- preg_match_all('/<a href="(.*?)">(.*?)<\/a>/', $content, $matches);
8372
- for($i=0;$i<count($matches[1]);$i++){
8373
- $url = $matches[1][$i];
8374
- $is_external = ampforwp_isexternal($url);
 
 
 
 
 
 
 
 
8375
  if($is_external){
8376
- $content = preg_replace('/<a href="(.*?)">(.*?)<\/a>/', '<a href="$1" target="_blank">$2</a>', $content);
 
 
8377
  }
8378
- }
 
8379
  }
8380
  return $content;
8381
  }
@@ -8540,3 +8720,96 @@ function ampforwp_extra_category_fields( $tag ) {
8540
  </tr>
8541
  <?php
8542
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
707
  $content = preg_replace('/<stream[^>]* src="(.*?)"><\/stream>/', '<amp-iframe width="175" height="100" sandbox="allow-scripts allow-same-origin" layout="responsive" allowfullscreen src="https://iframe.cloudflarestream.com/$1"></amp-iframe>', $content);
708
  //Compatibility with amp-connatix-player #3524
709
  $content = preg_replace('/<script id="(.*?)">(.*?)playerId:\s\'(.*?)\'(.*?)mediaId:\s\'(.*?)\'(.*?)<\/script>/s', '<amp-connatix-player data-player-id="$3" data-media-id = "$5" layout="responsive" width="16" height="9"></amp-connatix-player>', $content);
710
+ // Fixed CSS syntax error when redgifs iframe is embedded # 4422
711
+ if(preg_match("/<div\s+style='(.*?)\)'><iframe(.*?)redgifs\.com(.*?)<\/iframe>/", $content)){
712
+ $content = preg_replace("/<div\s+style='(.*?)\)'><iframe(.*?)redgifs\.com(.*?)<\/iframe>/", "<div style='$1'><iframe$2redgifs.com$3</iframe>", $content);
713
+ }
714
 
715
  return $content;
716
  }
752
  continue;
753
  }
754
  // Posts
755
+ if( ampforwp_get_setting('amp-on-off-for-all-posts') && $post_type == 'post' ) {
756
  add_meta_box( 'ampforwp_title_meta', esc_html__( 'Show AMP for Current Page?','accelerated-mobile-pages' ), 'ampforwp_title_callback', 'post','side' );
757
  }
758
  // Pages
875
  continue;
876
  }
877
  // Posts
878
+ if( ampforwp_get_setting('amp-on-off-for-all-posts') && $post_type == 'post' ) {
879
+ if ( ampforwp_get_setting('amp-mobile-redirection') ) {
880
  add_meta_box( 'ampforwp_title_meta_redir', esc_html__( 'Mobile Redirection for Current Page?','accelerated-mobile-pages' ), 'ampforwp_title_callback_redirection', 'post','side' );
881
  }
882
  }
883
  // Pages
884
+ if( ampforwp_get_setting('amp-on-off-for-all-pages') && $post_type == 'page' ) {
885
+ if ( ampforwp_get_setting('amp-mobile-redirection') ) {
886
  add_meta_box( 'ampforwp_title_meta_redir', esc_html__( 'Mobile Redirection for Current Page?' ,'accelerated-mobile-pages'), 'ampforwp_title_callback_redirection','page','side' );
887
  }
888
  }
889
  // Custom Post Types
890
  if( $post_type !== 'page' && $post_type !== 'post' ) {
891
+ if (ampforwp_get_setting('amp-mobile-redirection') ) {
892
  add_meta_box( 'ampforwp_title_meta_redir', esc_html__( 'Mobile Redirection for Current Page?','accelerated-mobile-pages' ), 'ampforwp_title_callback_redirection', $post_type,'side' );
893
  }
894
  }
1304
  <amp-social-share type="linkedin" width="50" height="28" aria-label="linkedin" <?php ampforwp_nofollow_social_links(); ?>></amp-social-share>
1305
  <?php } ?>
1306
  <?php if($redux_builder_amp['enable-single-whatsapp-share'] == true) { ?>
1307
+ <a title="whatsapp share" <?php ampforwp_nofollow_social_links(); ?> href="https://api.whatsapp.com/send?text=<?php echo esc_attr(htmlspecialchars(get_the_title()))."\n".esc_url($amp_permalink);?>">
1308
  <div class="a-so-i">
1309
  <amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93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4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K" width="50" height="20" alt="whatsapp" />
1310
  </div>
1327
  </div>
1328
  </a>
1329
  <?php } ?>
1330
+ <?php if(ampforwp_get_setting('enable-single-odnoklassniki-share')){
1331
+ $feature_img = '';
1332
+ if (ampforwp_has_post_thumbnail() ){
1333
+ $feature_img = ampforwp_get_post_thumbnail( 'url', 'medium' );
1334
+ }
1335
+ ?>
1336
+ <a title="odnoklassniki share" <?php esc_html(ampforwp_nofollow_social_links()); ?> href="https://connect.ok.ru/offer?url=<?php echo esc_url($amp_permalink); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>&imageUrl=<?php echo esc_url($feature_img); ?>" target="_blank">
1337
  <div class="a-so-i a-so-odnoklassniki">
1338
  <amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjY0cHgiIGhlaWdodD0iNjRweCIgdmlld0JveD0iMCAwIDk1LjQ4MSA5NS40ODEiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDk1LjQ4MSA5NS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age');
1433
  // This is causing the 2nd debug issue reported in #740
1434
+ if ( !class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration')) {
1435
+ add_action('wpseo_twitter', 'ampforwp_custom_twitter_image_homepage');
1436
+ }
1437
  add_action('wpseo_add_opengraph_images', 'ampforwp_custom_og_image_homepage');
1438
  }
1439
  }
1492
  function ampforwp_yoast_social_title($type) {
1493
  //Added the opengraph for frontpage in AMP #2454
1494
  if(ampforwp_is_front_page() || ampforwp_is_blog() ){
1495
+ $title = $page_id = $post = '';
1496
  $page_id = ampforwp_get_the_ID();
1497
  if( 'og' == $type ) {
1498
  $title = WPSEO_Meta::get_value( 'opengraph-title', $page_id );
1635
  add_filter( 'pre_get_document_title', 'ampforwp_add_custom_title_tag', 20 );
1636
  add_filter( 'wp_title', 'ampforwp_add_custom_title_tag', 10, 3 );
1637
 
1638
+ if(class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration') && !ampforwp_is_home() && !ampforwp_is_front_page() && !ampforwp_is_blog() ){
1639
+ remove_filter( 'pre_get_document_title', 'ampforwp_add_custom_title_tag', 20 );
1640
+ remove_filter( 'wp_title', 'ampforwp_add_custom_title_tag', 10, 3 );
1641
+ }
1642
+ // For Custom homepage
1643
+ if(class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration') && ampforwp_is_home() && !ampforwp_is_front_page() ){
1644
+ remove_filter( 'pre_get_document_title', 'ampforwp_add_custom_title_tag', 20 );
1645
+ remove_filter( 'wp_title', 'ampforwp_add_custom_title_tag', 10, 3 );
1646
+ }
1647
+
1648
  function ampforwp_add_custom_title_tag( $title = '', $sep = '', $seplocation = '' ) {
1649
  global $redux_builder_amp, $post;
1650
  $site_title = '';
1665
  //* We can filter this later if needed:
1666
  $sep = ' | ';
1667
  if( class_exists('WPSEO_Options') && method_exists('WPSEO_Options', 'get') && 'yoast' == ampforwp_get_setting('ampforwp-seo-selection') && !class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration')) {
1668
+ $separator = WPSEO_Options::get( 'separator' );
1669
+ $seperator_options = WPSEO_Option_Titles::get_instance()->get_separator_options();
1670
+ // This should always be set, but just to be sure.
1671
+ if ( isset( $seperator_options[ $separator ] ) ) {
1672
+ // Set the new replacement.
1673
+ $sep = $seperator_options[ $separator ];
1674
+ }
1675
  }
1676
  if( defined( 'RANK_MATH_FILE' ) && class_exists('RankMath\\Helper') && 'rank_math' == ampforwp_get_setting('ampforwp-seo-selection') ) {
1677
  $sep = RankMath\Helper::get_settings( 'titles.title_separator' );
1699
  else {
1700
  $ID = ampforwp_get_frontpage_id();
1701
  }
1702
+ $site_title = get_the_title( $ID ) .' '. $sep .' '. get_option( 'blogname' );
 
 
 
 
 
1703
  }
1704
+ // // Blog page
1705
+ // if ( ampforwp_is_blog() ) {
1706
+ // $ID = ampforwp_get_blog_details('id');
1707
+ // $site_title = get_the_title( $ID ) . $sep . get_option( 'blogname' );
1708
+ // }
1709
  }
1710
 
1711
  if ( is_search() ) {
1720
  $yoast_instance = new \Yoast\WP\SEO\Presentations\Indexable_Presentation();
1721
  }
1722
 
1723
+ if ( !class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration')) {
1724
+ $WPSEO_Frontend = WPSEO_Frontend::get_instance();
1725
+ $yoast_title = $WPSEO_Frontend->title($site_title);
1726
+ if ( ampforwp_is_home() ) {
1727
+ $yoast_title = $WPSEO_Frontend->get_title_from_options( 'title-home-wpseo' );
1728
+ }
1729
+ // For Blog pages and with Blog sub pages for example: site.com/blog/amp/page/3/
1730
+ if (ampforwp_is_blog()) {
1731
+ $yoast_title = $WPSEO_Frontend->get_content_title();
1732
+ }
1733
  }
1734
  // Custom Front Page Title From Yoast SEO #1163
1735
+ if ( ampforwp_is_front_page() || ampforwp_is_blog() && class_exists('Yoast\WP\SEO\Presentations\Indexable_Presentation') ) {
1736
  $yoast_title = get_post_meta(ampforwp_get_the_ID(), '_yoast_wpseo_title', true);
1737
  $yoast_title = wpseo_replace_vars( $yoast_title,$post );
1738
+ // Get info for custom front page, blog page and blog post paginated pages for v14+ #4574
1739
+ if ( class_exists('Ampforwp_Yoast_Data') ){
1740
+ $yoast_data = new Ampforwp_Yoast_Data;
1741
+ $context = $yoast_data->get_context_for_post_id(ampforwp_get_the_ID());
1742
+ }
1743
+ if ( $context) {
1744
+ $yoast_title = $context->title;
1745
+ }
1746
  }
1747
  if ( $yoast_title ) {
1748
  $site_title = apply_filters( 'wpseo_title', $yoast_title, $yoast_instance );
3265
  echo '<meta name="description" content="'. esc_attr( convert_chars( stripslashes( $desc ) ) ) .'"/>';
3266
  }else if(class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration')){
3267
  $yoast_desc = addslashes( strip_tags( WPSEO_Meta::get_value('metadesc', ampforwp_get_the_ID() ) ) );
3268
+ $yoast_desc_meta = get_option( 'wpseo_titles' );
3269
+ if(isset($yoast_desc_meta['metadesc-page'])){
3270
+ $yoast_desc_meta = $yoast_desc_meta['metadesc-page'];
3271
+ }
3272
+ if(empty($yoast_desc)){
3273
+ $yoast_desc = $yoast_desc_meta;
3274
+ }
3275
  if ($yoast_desc && ampforwp_is_front_page()) {
3276
  echo '<meta name="description" content="'. esc_attr( convert_chars( stripslashes( $yoast_desc ) ) ) .'"/>';
3277
  }
3502
 
3503
  $post_id = ampforwp_get_frontpage_id();
3504
 
3505
+ if (empty($data)) {
3506
  $data['elements'] = "meta_info:1,title:1,featured_image:1,content:1,meta_taxonomy:1,social_icons:1,comments:1,related_posts:1";
3507
  }
3508
  if( isset( $data['elements'] ) || ! empty( $data['elements'] ) ){
4164
  }
4165
  add_action('ampforwp_after_post_content','ampforwp_post_pagination');
4166
 
4167
+ // Generating Canonical Url for Yoast no index pages.
4168
+ add_filter( 'wpseo_robots_array', 'ampforwp_yoast_no_index_condition_check',20,2);
4169
+ function ampforwp_yoast_no_index_condition_check($robots,$object){
4170
+ global $yoast_data;
4171
+ if($robots['index'] == 'noindex'){
4172
+ $yoast_data['canonical'] = $object->model->permalink;
4173
+ add_action( 'amp_post_template_head', 'ampforwp_generate_yoast_no_index_canonical_url' );
4174
+ }
4175
+ return $robots;
4176
+ }
4177
+
4178
+ function ampforwp_generate_yoast_no_index_canonical_url(){
4179
+ global $yoast_data;
4180
+ if(isset($yoast_data['canonical'])){
4181
+ $canonical_url = $yoast_data['canonical'];
4182
+ if(ampforwp_is_home() || ampforwp_is_front_page()){
4183
+ $canonical_url = user_trailingslashit(get_site_url());
4184
+ } ?>
4185
+ <link rel="canonical" href="<?php echo esc_url($canonical_url) ?>"/>
4186
+ <?php }
4187
+ }
4188
+
4189
+ // Modified Homepage wrong canonical url generated by yoast
4190
+ add_action('pre_amp_render_post','ampforwp_modify_yoast_amp_homepage_canonical');
4191
+ function ampforwp_modify_yoast_amp_homepage_canonical(){
4192
+ add_filter('wpseo_canonical','ampforwp_modify_yoast_homepage_canonical_url',20);
4193
+ }
4194
+
4195
+ function ampforwp_modify_yoast_homepage_canonical_url($canonical_url){
4196
+ if(ampforwp_is_home() || ampforwp_is_front_page()){
4197
+ $canonical_url = user_trailingslashit(get_site_url());
4198
+ }
4199
+ return esc_url($canonical_url);
4200
+ }
4201
 
4202
  // 70. Hide AMP by specific Categories & Tags #872
4203
  function ampforwp_posts_to_remove () {
4872
  );
4873
  }
4874
  $args = apply_filters('ampforwp_inlne_related_posts_query_args', $args);
4875
+ $inline_related_posts = '';
4876
  $my_query = new wp_query( $args );
4877
  if( $my_query->have_posts() ) {
4878
  $inline_related_posts_img = '';
5290
  // Check if current post type is AMPed or not
5291
  if( $supported_amp_post_types && in_array($post->post_type, $supported_amp_post_types) ){
5292
  // If AMP on Posts or Pages is off then do nothing
5293
+ if($post->post_type == 'post' && !ampforwp_get_setting('amp-on-off-for-all-posts') || $post->post_type == 'page' && !ampforwp_get_setting('amp-on-off-for-all-pages')) {
5294
  return;
5295
  }
5296
  if( is_archive() && is_category() ){
5926
 
5927
 
5928
  // Check for Posts
5929
+ if ( is_single() && false == ampforwp_get_setting('amp-on-off-for-all-posts') ) {
5930
  return false;
5931
  }
5932
  // Archives
5933
+ if ( is_archive() && false == ampforwp_get_setting('ampforwp-archive-support') ) {
5934
  return false;
5935
  }
5936
  // Pages
5937
+ if ( is_page() && false == ampforwp_get_setting('amp-on-off-for-all-pages') ) {
5938
  return false;
5939
  }
5940
  // Homepage
5941
+ if ( is_home() && false == ampforwp_get_setting('ampforwp-homepage-on-off-support') ) {
5942
  return false;
5943
  }
5944
  // Search #2681
6846
  }
6847
  if ( ! function_exists('ampforwp_gutenberg_css') ) {
6848
  function ampforwp_gutenberg_css(){
6849
+ $color_data = get_theme_support('editor-color-palette');
6850
+ $background = '#32373c';
6851
+ if(isset($color_data[0]) && isset($color_data[0][0]) && isset($color_data[0][0]['color'])){
6852
+ $background = $color_data[0][0]['color'];
6853
+ }
6854
+ ?>
6855
  .wp-block-button { color: #fff}
6856
+ .wp-block-button a {background-color: <?php echo ampforwp_sanitize_color($background);?>;border-radius: 28px;color: inherit;display: inline-block;padding: 12px 24px;}
6857
  .wp-block-cover{position:relative;background-color: #000;background-size: cover;background-position: center center;min-height: 430px;width: 100%;margin: 1.5em 0 1.5em 0;display: flex;justify-content: center;align-items: center;overflow: hidden;}
6858
  .wp-block-cover-text{color: #fff;font-size: 2em;line-height: 1.25;z-index: 1;}
6859
  .wp-block-cover-image.has-background-dim::before, .wp-block-cover.has-background-dim::before {content: "";position: absolute;top: 0;left: 0;bottom: 0;right: 0;background-color: inherit;opacity: .5;z-index: 1;} <?php
7291
  $breadcrumb = '';
7292
  if ( true == ampforwp_get_setting('ampforwp-yoast-bread-crumb') && true === WPSEO_Options::get( 'breadcrumbs-enable' ) && function_exists('yoast_breadcrumb')) {
7293
  $breadcrumb = yoast_breadcrumb('','', false);
7294
+ if( true == ampforwp_get_setting('convert-internal-nonamplinks-to-amp') && preg_match('/<a\s+href="(.*?)">(.*?)<\/a>/', $breadcrumb)){
7295
+ $breadcrumb = preg_replace('/<a\s+href="(.*?)\/">(.*?)<\/a>/', '<a href="'.ampforwp_url_controller("$1").'">$2</a>', $breadcrumb);
7296
+ }
7297
  return $breadcrumb;
7298
  }
7299
  }
7860
  return false;
7861
  }
7862
 
7863
+ // Generating canonical url when FlexMLS plugin is active.
7864
+ if(class_exists('flexmlsConnectPageSearchResults')){
7865
+ add_action('pre_amp_render_post','ampforwp_flexmls_canonical');
7866
+ }
7867
+ function ampforwp_flexmls_canonical(){
7868
+ add_filter('wpseo_canonical','ampforwp_flexmls_generate_canonical_url',99,2);
7869
+ }
7870
+
7871
+ function ampforwp_flexmls_generate_canonical_url($canonical,$object){
7872
+ $canonical = $object->model->permalink;
7873
+ return esc_url($canonical);
7874
+ }
7875
  // Font Selector
7876
  if( ! function_exists('ampforwp_font_selector') ) {
7877
  function ampforwp_font_selector( $container ) {
7892
  return sanitize_text_field($fontFamily);
7893
  }
7894
  }
7895
+ if(class_exists('WPSEO_Options')){
7896
+ add_filter('ampforwp_the_content_last_filter','ampforwp_remove_duplicate_canonical',25);
7897
+ }
7898
+ function ampforwp_remove_duplicate_canonical($content){
7899
+ $comp_dom = new DOMDocument();
7900
+ @$comp_dom->loadHTML($content);
7901
+ $xpath = new DOMXPath( $comp_dom );
7902
+ $count = 0;
7903
+ $nodes = $xpath->query('//link[@rel="canonical"]');
7904
+ $con = '';
7905
+ foreach ($nodes as $node) {
7906
+ $count++;
7907
+ }
7908
+ if($count>1){
7909
+ if(preg_match("/<link\b[^>]*?\brel=[\'\"]canonical[\'\"][^>]*>/", $content, $matches, PREG_OFFSET_CAPTURE)){
7910
+ $content = preg_replace("/<link\b[^>]*?\brel=[\'\"]canonical[\'\"][^>]*>/", "", $content);
7911
+ $content = substr_replace($content, $matches[0][0], $matches[0][1], 0);
7912
+ }
7913
+ }
7914
+ return $content;
7915
+ }
7916
  // Font URL controller
7917
  if ( ! function_exists('ampforwp_font_url') ) {
7918
  function ampforwp_font_url($font_url){
8098
  $content = preg_replace('/<form class="mv-create-print-form">(.*?)<\/form>/s', '', $content);
8099
  }
8100
  // close #4206
8101
+ // Ticket #4539
8102
+ if(function_exists('orbital_setup')){
8103
+ if(preg_match('/<script>function orbital_expand_navbar(.*?)<\/script>/', $content)){
8104
+ $content = preg_replace('/<script>function orbital_expand_navbar(.*?)<\/script>/', '', $content);
8105
+ }
8106
+ }
8107
  return $content;
8108
  }
 
8109
  add_filter('ampforwp_the_content_last_filter','ampforwp_include_required_scripts',12);
8110
  function ampforwp_include_required_scripts($content){
8111
  $comp_to_remove_arr = array();
8141
  if($comp=='state'){
8142
  $is_script = true;
8143
  }
8144
+ if($comp=='embed'){
8145
+ $is_script = false;
8146
+ }
8147
  if($is_script==false){
8148
  $headers = get_headers($comp_url);
8149
  if(isset($headers[0])){
8219
  }
8220
  }
8221
  //OTHER COMPONENT CHECK
8222
+ $other_comp_arr = array('amp-mustache'=>'amp-mustache','amp-embed'=>'amp-ad','form'=>'amp-form','amp-access'=>'amp-access','amp-fx'=>'amp-fx-collection');
8223
  foreach ($other_comp_arr as $key => $value) {
8224
  $ocomp = $value;
8225
  $celem = 'element';
8273
  }
8274
  }
8275
 
8276
+ $amp_brid_player = $xpath->query("//amp-brid-player");
8277
+ foreach($amp_brid_player as $node) {
8278
+ if($node->hasAttribute('dock')){
8279
+ if(ampforwp_get_setting('ampforwp-amp-video-docking')){
8280
+ $celem = 'element';
8281
+ $ocomp = 'amp-video-docking';
8282
+ if(!preg_match('/<script(\s|\sasync\s)custom-'.esc_attr($celem).'="'.esc_attr($ocomp).'"(.*?)>(.*?)<\/script>/s', $content)){
8283
+ $o_comp_url = 'https://cdn.ampproject.org/v0/'.esc_attr($ocomp).'-'.esc_attr($script_ver).'.js';
8284
+ $script_tag = '<head><script custom-'.esc_attr($celem).'="'.esc_attr($ocomp).'" src="'.esc_url($o_comp_url).'" async></script>';
8285
+ $content = str_replace('<head>', $script_tag, $content);
8286
+ }
8287
+ }else{
8288
+ if(preg_match('/<amp-brid-player(.*?) dock|dock=">/', $content)){
8289
+ $content = preg_replace('/<amp-brid-player(.*?) dock|dock=">/','<amp-brid-player $1>', $content);
8290
+ }
8291
+ }
8292
+ }
8293
+ }
8294
+ $amp_brightcove = $xpath->query("//amp-brightcove");
8295
+ foreach($amp_brightcove as $node) {
8296
+ if($node->hasAttribute('dock')){
8297
+ if(ampforwp_get_setting('ampforwp-amp-video-docking')){
8298
+ $celem = 'element';
8299
+ $ocomp = 'amp-video-docking';
8300
+ if(!preg_match('/<script(\s|\sasync\s)custom-'.esc_attr($celem).'="'.esc_attr($ocomp).'"(.*?)>(.*?)<\/script>/s', $content)){
8301
+ $o_comp_url = 'https://cdn.ampproject.org/v0/'.esc_attr($ocomp).'-'.esc_attr($script_ver).'.js';
8302
+ $script_tag = '<head><script custom-'.esc_attr($celem).'="'.esc_attr($ocomp).'" src="'.esc_url($o_comp_url).'" async></script>';
8303
+ $content = str_replace('<head>', $script_tag, $content);
8304
+ }
8305
+ }else{
8306
+ if(preg_match('/<amp-brightcove(.*?) dock|dock=">/', $content)){
8307
+ $content = preg_replace('/<amp-brightcove(.*?) dock|dock=">/','<amp-brightcove $1>', $content);
8308
+ }
8309
+ }
8310
+ }
8311
+ }
8312
+
8313
  // Scripts added from Options panel should have higher priority #4064
8314
  if( ampforwp_get_setting('amp-header-text-area-for-html') && ampforwp_get_setting('amp-header-text-area-for-html')!="") {
8315
  $allscripts = ampforwp_get_setting('amp-header-text-area-for-html');
8366
  $m_content = $matches[1][$i];
8367
  $m_content = ampforwp_imagify_webp_compatibility($m_content);
8368
  $m_content = ampforwp_ewww_webp_compatibility($m_content);
8369
+
8370
  $m1_content = ampforwp_set_default_fallback_image($matches[1][$i]);
8371
  preg_match_all('/src="(.*?)"/', $m1_content,$fimgsrc);
8372
  preg_match_all('/width="(.*?)"/', $m1_content,$fimgwidth);
8401
  $m1_content = str_replace($swidth, $width_rep, $m1_content);
8402
  $m1_content = str_replace($sheight, $height_rep, $m1_content);
8403
  $m1_content = str_replace($salt, $alt_rep, $m1_content);
8404
+ $m1_content = preg_replace('/srcset="(.*?)"/', '', $m1_content);
8405
  $fallback_img = "<amp-img ".$m_content."<amp-img fallback ".$m1_content."</amp-img></amp-img>";//$m_content, $m1_content escaped above.
8406
  $content = str_replace("$match", $fallback_img, $content);
8407
  }
8537
  function ampforwp_rank_math_external_link_newtab($content){
8538
  $rank_math_external_link = RankMath\Helper::get_settings( 'general.new_window_external_links' );
8539
  if($rank_math_external_link){
8540
+ $comp_dom = new DOMDocument();
8541
+ if(function_exists('mb_convert_encoding')){
8542
+ @$comp_dom->loadHTML(mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8'));
8543
+ }else{
8544
+ @$comp_dom->loadHTML($content);
8545
+ }
8546
+ $xpath = new DOMXPath( $comp_dom );
8547
+ $count = 0;
8548
+ $nodes = $xpath->query('//a[@href]');
8549
+ foreach ($nodes as $node) {
8550
+ $url = $node->getAttribute('href');
8551
+ $is_external = ampforwp_isexternal($url);
8552
  if($is_external){
8553
+ if(!$node->hasAttribute('target')){
8554
+ $node->setAttribute('target','_blank');
8555
+ }
8556
  }
8557
+ }
8558
+ $content = $comp_dom->saveHTML();
8559
  }
8560
  return $content;
8561
  }
8720
  </tr>
8721
  <?php
8722
  }
8723
+ if(function_exists('rocket_activation')){
8724
+ add_filter("ampforwp_the_content_last_filter",'ampforwp_wp_rocket_compatibility',25);
8725
+ }
8726
+ function ampforwp_wp_rocket_compatibility($content){
8727
+ $cdn_url = get_option('wp_rocket_settings');
8728
+ if($cdn_url['cdn'] == 1){
8729
+ $img_cdn_url = '';
8730
+ $cnds_arr = array();
8731
+ if(!empty($cdn_url['cdn_zone']) && !empty($cdn_url['cdn_cnames'])){
8732
+ foreach ($cdn_url['cdn_zone'] as $key => $element) {
8733
+ if(isset($cdn_url['cdn_cnames'][$key]) && $cdn_url['cdn_cnames'][$key]!=''){
8734
+ $cnds_arr[$element] = $cdn_url['cdn_cnames'][$key];
8735
+ }
8736
+ }
8737
+ }
8738
+ if(isset($cnds_arr['images'])){
8739
+ $img_cdn_url = $cnds_arr['images'];
8740
+ }else if(isset($cnds_arr['all'])){
8741
+ $img_cdn_url = $cnds_arr['all'];
8742
+ }
8743
+ if($img_cdn_url!=''){
8744
+ $parse_url = parse_url($img_cdn_url);
8745
+ if(!isset($parse_url['scheme'])){
8746
+ if(!preg_match('/\/\//', $img_cdn_url)){
8747
+ $img_cdn_url = '//'.$img_cdn_url;
8748
+ }
8749
+ }
8750
+ $comp_dom = new DOMDocument();
8751
+ @$comp_dom->loadHTML($content);
8752
+ $xpath = new DOMXPath( $comp_dom );
8753
+ $nodes = $xpath->query('//amp-img[@src]');
8754
+ $home_url = home_url();
8755
+ foreach ($nodes as $node) {
8756
+ $url = $node->getAttribute('src');
8757
+ $srcset = $node->getAttribute('srcset');
8758
+ $is_external = ampforwp_isexternal($url);
8759
+ if(!$is_external && !$node->hasAttribute('fallback')){
8760
+ $img_src = str_replace($home_url, $img_cdn_url, $url);
8761
+ $content = str_replace($url, $img_src, $content);
8762
+ $srcset_arr = explode(",", $srcset);
8763
+ for($i=0;$i<count($srcset_arr);$i++){
8764
+ $original = $srcset_arr[$i];
8765
+ $new = str_replace($home_url, $img_cdn_url, $original);
8766
+ if(preg_match('/'.preg_quote($original,'/').'/', $content)){
8767
+ $content = preg_replace('/'.preg_quote($original,'/').'/', $new, $content);
8768
+ }
8769
+ }
8770
+ }
8771
+ }
8772
+ }
8773
+ }
8774
+ return $content;
8775
+ }
8776
+ // Adding Mobile theme color meta data in header
8777
+ if(true == ampforwp_get_setting('mobile-theme-color')){
8778
+ add_action( 'amp_post_template_head', 'ampforwp_mobile_theme_color');
8779
+ }
8780
+ function ampforwp_mobile_theme_color(){
8781
+ $content_code = ampforwp_get_setting('mobile-theme-color-picker','color');
8782
+ if(empty($content_code)){
8783
+ $content_code = '#ffffff';
8784
+ }
8785
+ ?>
8786
+ <meta name="theme-color" content="<?php echo ampforwp_sanitize_color($content_code); ?>"/>
8787
+ <?php
8788
+ }
8789
+
8790
+ if(function_exists('herald_theme_setup')){
8791
+ add_filter('the_content', 'ampforwp_herald_popup_media_in_content', 100, 1 );
8792
+ add_filter('bbp_get_topic_content','herald_popup_media_in_content');
8793
+ add_filter('bbp_get_reply_content','herald_popup_media_in_content');
8794
+ }
8795
+ function ampforwp_herald_popup_media_in_content( $content ) {
8796
+ if(ampforwp_is_amp_endpoint()){
8797
+ if (function_exists('herald_get_option') && herald_get_option( 'on_single_img_popup' ) ) {
8798
+ if(preg_match("/<a class=\"herald-popup-img\" href=('|\")(.*?).(bmp|gif|jpeg|jpg|png)('|\")><img(.*?)<\/a>/i", $content,$matches)){
8799
+ $content = preg_replace( "/<a class=\"herald-popup-img\" href=('|\")(.*?).(bmp|gif|jpeg|jpg|png)('|\")><img(.*?)<\/a>/i", '<img on="tap:amp-img-lightbox" role="button" tabindex="0" $5', $content );
8800
+ }
8801
+ }
8802
+ }
8803
+ return $content;
8804
+ }
8805
+ // Added TravelTour theme page builder content support.#4540
8806
+ function ampforwp_gdlr_core_page_builder_content($content){
8807
+ ob_start();
8808
+ do_action('gdlr_core_print_page_builder');
8809
+ $content_gdlr = ob_get_contents();
8810
+ ob_end_clean();
8811
+ if ( $content_gdlr ) {
8812
+ $content = $content . $content_gdlr ;
8813
+ }
8814
+ return $content;
8815
+ }