AMP for WP – Accelerated Mobile Pages - Version 0.9.98.6

Version Description

(31th AUGUST 2019) = * Improvements: Structured Data improvements #3567 * Improvements: Addthis share button's postion field in 1,2 and 3 designs #3553 * Fixed: Rare issue AMP settings are not getting saved showing popup error "There was a problem with your action. Please try again or reload the page." #3494 * Fixed: Plugin removes Telegram links #3578 * Fixed: amp-addthis validation error on pages #3580 * Fixed: Spot.IM Comments not working on all designs #3568 * Fixed: Incorrect title tags being generated #3565 * Fixed: Reduce the size of auto inline css. #3115

Download this release

Release Info

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

Code changes from version 0.9.98.5 to 0.9.98.6

Files changed (49) hide show
  1. README.md +11 -1
  2. accelerated-moblie-pages.php +32 -2
  3. changelog.txt +10 -0
  4. classes/class-ampforwp-infinite-scroll.php +6 -4
  5. classes/class-ampforwp-rev-slider.php +16 -16
  6. components/breadcrumb/breadcrumb.php +1 -1
  7. components/comments/comments.php +5 -5
  8. components/components-core.php +1 -0
  9. components/loop/loop.php +10 -6
  10. components/theme-loader.php +4 -3
  11. images/amp-icon-check.png +0 -0
  12. images/amp-img-conv.png +0 -0
  13. includes/features/analytics/analytics-options.php +1 -7
  14. includes/features/functions.php +2 -2
  15. includes/features/performance/performance-functions.php +1 -1
  16. includes/features/structure-data/structured-data-functions.php +12 -3
  17. includes/modules-upgrade.php +1 -1
  18. includes/modules/ampforwp-blurb.php +2 -1
  19. includes/modules/ampforwp-button.php +2 -0
  20. includes/modules/js/amp.js +2 -2
  21. includes/options/admin-config.php +33 -11
  22. includes/options/redux-core/framework.php +1 -1
  23. includes/redirect.php +1 -1
  24. includes/thirdparty-compatibility.php +4 -3
  25. includes/vendor/amp/includes/amp-post-template-actions.php +2 -0
  26. includes/vendor/amp/includes/sanitizers/class-amp-blacklist-sanitizer.php +1 -1
  27. includes/vendor/amp/includes/sanitizers/class-amp-style-sanitizer.php +1 -1
  28. includes/vendor/amp/jetpack-helper.php +1 -1
  29. includes/vendor/vendor-changelog.txt +2 -1
  30. pagebuilder/amp-page-builder.php +2 -1
  31. pagebuilder/inc/admin-amp-page-builder.js +6 -4
  32. pagebuilder/inc/adminAjaxContents.php +37 -29
  33. pagebuilder/modules/contents-module.php +2 -2
  34. readme.txt +12 -9
  35. templates/design-manager.php +3 -24
  36. templates/design-manager/design-1/archive.php +3 -1
  37. templates/design-manager/design-1/elements/addthis.php +0 -3
  38. templates/design-manager/design-1/elements/bread-crumbs.php +1 -1
  39. templates/design-manager/design-1/elements/content.php +8 -0
  40. templates/design-manager/design-2/archive.php +3 -1
  41. templates/design-manager/design-2/elements/addthis.php +0 -3
  42. templates/design-manager/design-2/elements/bread-crumbs.php +1 -1
  43. templates/design-manager/design-2/elements/content.php +9 -0
  44. templates/design-manager/design-3/archive.php +3 -1
  45. templates/design-manager/design-3/elements/addthis.php +0 -3
  46. templates/design-manager/design-3/elements/bread-crumbs.php +1 -1
  47. templates/design-manager/design-3/elements/content.php +8 -2
  48. templates/design-manager/swift/page.php +6 -5
  49. templates/features.php +18 -10
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.2.2
7
- Stable tag: 0.9.98.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -189,6 +189,16 @@ You can contact us from [here](https://ampforwp.com/contact/)
189
 
190
  == Changelog ==
191
 
 
 
 
 
 
 
 
 
 
 
192
  = 0.9.98.5 (27th AUGUST 2019) =
193
  * Improvements: Compatibility integrated with CDN enabler #3515
194
  * Improvements: banner ux section of AMP panel settings improved #3470
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.2.2
7
+ Stable tag: 0.9.98.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
189
 
190
  == Changelog ==
191
 
192
+ = 0.9.98.6 (31th AUGUST 2019) =
193
+ * Improvements: Structured Data improvements #3567
194
+ * Improvements: Addthis share button's postion field in 1,2 and 3 designs #3553
195
+ * Fixed: Rare issue AMP settings are not getting saved showing popup error "There was a problem with your action. Please try again or reload the page." #3494
196
+ * Fixed: Plugin removes Telegram links #3578
197
+ * Fixed: amp-addthis validation error on pages #3580
198
+ * Fixed: Spot.IM Comments not working on all designs #3568
199
+ * Fixed: Incorrect title tags being generated #3565
200
+ * Fixed: Reduce the size of auto inline css. #3115
201
+
202
  = 0.9.98.5 (27th AUGUST 2019) =
203
  * Improvements: Compatibility integrated with CDN enabler #3515
204
  * Improvements: banner ux section of AMP panel settings improved #3470
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: 0.9.98.5
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
@@ -20,8 +20,14 @@ 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','0.9.98.5');
24
  define('AMPFORWP_EXTENSION_DIR',plugin_dir_path(__FILE__).'includes/options/extensions');
 
 
 
 
 
 
25
  // any changes to AMP_QUERY_VAR should be refelected here
26
  function ampforwp_generate_endpoint(){
27
  $ampforwp_slug = '';
@@ -1195,4 +1201,28 @@ function ampforwp_automattic_notice_delete(){
1195
  set_transient( 'ampforwp_automattic_activation_notice', 1 );
1196
  }
1197
  exit();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1198
  }
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: 0.9.98.6
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','0.9.98.6');
24
  define('AMPFORWP_EXTENSION_DIR',plugin_dir_path(__FILE__).'includes/options/extensions');
25
+ if(!defined('AMPFROWP_HOST_NAME')){
26
+ $urlinfo = get_bloginfo('url');
27
+ $url = parse_url($urlinfo);
28
+ $host = $url['host'];
29
+ define('AMPFROWP_HOST_NAME', esc_attr($host));
30
+ }
31
  // any changes to AMP_QUERY_VAR should be refelected here
32
  function ampforwp_generate_endpoint(){
33
  $ampforwp_slug = '';
1201
  set_transient( 'ampforwp_automattic_activation_notice', 1 );
1202
  }
1203
  exit();
1204
+ }
1205
+
1206
+ add_action('admin_init','ampforwp_replace_redux_comments');
1207
+ function ampforwp_replace_redux_comments(){
1208
+ if(current_user_can( 'manage_options' )){
1209
+ $replaced_redux_comments = get_transient('replaced_redux_comments');
1210
+ if(!$replaced_redux_comments){
1211
+ $redux = get_option('redux_builder_amp');
1212
+ $search = '/******* Paste your Custom CSS in this Editor *******/';
1213
+ $rep = str_replace("$search", "", $redux);
1214
+ $search = '/**
1215
+ * Enter your Advanced Analytics code here
1216
+ */';
1217
+ $rep = str_replace("$search", "", $rep);
1218
+ $search = ' /**
1219
+ * Enter your Advanced Analytics code here
1220
+ */';
1221
+ $rep = str_replace("$search", "", $rep);
1222
+ $search = ' //Replace this with your Tracking ID';
1223
+ $rep = str_replace("$search", "", $rep);
1224
+ update_option('redux_builder_amp', $rep);
1225
+ set_transient('replaced_redux_comments',1);
1226
+ }
1227
+ }
1228
  }
changelog.txt CHANGED
@@ -1,5 +1,15 @@
1
  == Changelog ==
2
 
 
 
 
 
 
 
 
 
 
 
3
  = 0.9.98.5 (27th AUGUST 2019) =
4
  * Improvements: Compatibility integrated with CDN enabler #3515
5
  * Improvements: banner ux section of AMP panel settings improved #3470
1
  == Changelog ==
2
 
3
+ = 0.9.98.6 (31th AUGUST 2019) =
4
+ * Improvements: Structured Data improvements #3567
5
+ * Improvements: Addthis share button's postion field in 1,2 and 3 designs #3553
6
+ * Fixed: Rare issue AMP settings are not getting saved showing popup error "There was a problem with your action. Please try again or reload the page." #3494
7
+ * Fixed: Plugin removes Telegram links #3578
8
+ * Fixed: amp-addthis validation error on pages #3580
9
+ * Fixed: Spot.IM Comments not working on all designs #3568
10
+ * Fixed: Incorrect title tags being generated #3565
11
+ * Fixed: Reduce the size of auto inline css. #3115
12
+
13
  = 0.9.98.5 (27th AUGUST 2019) =
14
  * Improvements: Compatibility integrated with CDN enabler #3515
15
  * Improvements: banner ux section of AMP panel settings improved #3470
classes/class-ampforwp-infinite-scroll.php CHANGED
@@ -51,10 +51,12 @@ if( ! class_exists('AMPforWP_Infinite_Scroll') ) {
51
  return false;
52
  }
53
  public function paged() {
54
- if ( get_query_var( 'paged' ) ) {
55
- return get_query_var('paged');
56
- } elseif ( get_query_var( 'page' ) ) {
57
- return get_query_var('page');
 
 
58
  } else {
59
  return 1;
60
  }
51
  return false;
52
  }
53
  public function paged() {
54
+ $paged = get_query_var( 'paged' );
55
+ $page = get_query_var( 'page' );
56
+ if ( $paged ) {
57
+ return intval($paged);
58
+ } elseif ( $page ) {
59
+ return intval($page);
60
  } else {
61
  return 1;
62
  }
classes/class-ampforwp-rev-slider.php CHANGED
@@ -60,9 +60,9 @@ class AMP_Rev_Slider_Embed_Handler extends AMPforWP\AMPVendor\AMP_Base_Embed_Han
60
  $img_h = $slide->getParam('ext_height', '1080');
61
  $urls[] = apply_filters('amp_gallery_image_params', array(
62
  'url' => $url,
63
- 'width' => $img_w,
64
- 'height' => $img_h,
65
- 'bgtype' => $bgtype
66
  ),$attachment_id);
67
  }elseif( $bgtype == 'image'){
68
  $img_data = wp_get_attachment_metadata( $slide->getImageID() );
@@ -70,9 +70,9 @@ class AMP_Rev_Slider_Embed_Handler extends AMPforWP\AMPVendor\AMP_Base_Embed_Han
70
  $attachment_id = $slide->getImageID();
71
  $urls[] = apply_filters('amp_gallery_image_params', array(
72
  'url' => $url,
73
- 'width' => $img_data['width'],
74
- 'height' => $img_data['height'],
75
- 'bgtype' => $bgtype
76
  ),$attachment_id);
77
  }elseif( $bgtype == 'youtube' ){
78
  $youtube_id = $slide->getParam('slide_bg_youtube', '');
@@ -81,7 +81,7 @@ class AMP_Rev_Slider_Embed_Handler extends AMPforWP\AMPVendor\AMP_Base_Embed_Han
81
  'url' => $youtube_id,
82
  'width' => '480',
83
  'height' => '270',
84
- 'bgtype' => $bgtype,
85
  'cover_img' => $cover_img
86
  ),$attachment_id);
87
  }
@@ -124,26 +124,26 @@ class AMP_Rev_Slider_Embed_Handler extends AMPforWP\AMPVendor\AMP_Base_Embed_Han
124
  $img_h = $slide->get_param('ext_height', '1080');
125
  $urls[] = apply_filters('amp_gallery_image_params', array(
126
  'url' => $url,
127
- 'width' => $img_w,
128
- 'height' => $img_h,
129
- 'bgtype' => $bgtype
130
  ),$image_id);
131
  }elseif( $bgtype == 'image'){
132
  $urls[] = apply_filters('amp_gallery_image_params', array(
133
  'url' => $url,
134
- 'width' => $img_data['width'],
135
- 'height' => $img_data['height'],
136
- 'bgtype' => $bgtype
137
  ),$image_id);
138
  }elseif( $bgtype == 'youtube' ){
139
  $youtube_id = $slide->get_param(array('bg','youtube'), '');
140
  $cover_img = $slide->get_param(array('bg','image'), '');
141
  $urls[] = apply_filters('amp_gallery_image_params', array(
142
- 'url' => $youtube_id,
143
  'width' => '480',
144
  'height' => '270',
145
- 'bgtype' => $bgtype,
146
- 'cover_img' => $cover_img
147
  ),$image_id);
148
  }
149
  }
60
  $img_h = $slide->getParam('ext_height', '1080');
61
  $urls[] = apply_filters('amp_gallery_image_params', array(
62
  'url' => $url,
63
+ 'width' => intval($img_w),
64
+ 'height' => intval($img_h),
65
+ 'bgtype' => esc_attr($bgtype)
66
  ),$attachment_id);
67
  }elseif( $bgtype == 'image'){
68
  $img_data = wp_get_attachment_metadata( $slide->getImageID() );
70
  $attachment_id = $slide->getImageID();
71
  $urls[] = apply_filters('amp_gallery_image_params', array(
72
  'url' => $url,
73
+ 'width' => intval($img_data['width']),
74
+ 'height' => intval($img_data['height']),
75
+ 'bgtype' => esc_attr($bgtype)
76
  ),$attachment_id);
77
  }elseif( $bgtype == 'youtube' ){
78
  $youtube_id = $slide->getParam('slide_bg_youtube', '');
81
  'url' => $youtube_id,
82
  'width' => '480',
83
  'height' => '270',
84
+ 'bgtype' => esc_attr($bgtype),
85
  'cover_img' => $cover_img
86
  ),$attachment_id);
87
  }
124
  $img_h = $slide->get_param('ext_height', '1080');
125
  $urls[] = apply_filters('amp_gallery_image_params', array(
126
  'url' => $url,
127
+ 'width' => intval($img_w),
128
+ 'height' => intval($img_h),
129
+ 'bgtype' => esc_attr($bgtype)
130
  ),$image_id);
131
  }elseif( $bgtype == 'image'){
132
  $urls[] = apply_filters('amp_gallery_image_params', array(
133
  'url' => $url,
134
+ 'width' => intval($img_data['width']),
135
+ 'height' => intval($img_data['height']),
136
+ 'bgtype' => esc_attr($bgtype)
137
  ),$image_id);
138
  }elseif( $bgtype == 'youtube' ){
139
  $youtube_id = $slide->get_param(array('bg','youtube'), '');
140
  $cover_img = $slide->get_param(array('bg','image'), '');
141
  $urls[] = apply_filters('amp_gallery_image_params', array(
142
+ 'url' => esc_url($youtube_id),
143
  'width' => '480',
144
  'height' => '270',
145
+ 'bgtype' => esc_attr($bgtype),
146
+ 'cover_img' => esc_attr($cover_img)
147
  ),$image_id);
148
  }
149
  }
components/breadcrumb/breadcrumb.php CHANGED
@@ -191,7 +191,7 @@
191
  // Get tag information
192
  $term_id = get_query_var('tag_id');
193
  $taxonomy = 'post_tag';
194
- $args = 'include=' . $term_id;
195
  $terms = get_terms( $taxonomy, $args );
196
  $get_term_id = $terms[0]->term_id;
197
  $get_term_slug = $terms[0]->slug;
191
  // Get tag information
192
  $term_id = get_query_var('tag_id');
193
  $taxonomy = 'post_tag';
194
+ $args = 'include=' . intval($term_id);
195
  $terms = get_terms( $taxonomy, $args );
196
  $get_term_id = $terms[0]->term_id;
197
  $get_term_slug = $terms[0]->slug;
components/comments/comments.php CHANGED
@@ -230,13 +230,13 @@ function ampforwp_framework_get_vuukle_comments(){
230
  }
231
 
232
  function ampforwp_framework_get_spotim_comments(){
233
- global $post, $redux_builder_amp;
234
  $spotId ='';
235
- if( isset($redux_builder_amp['ampforwp-spotim-comments-apiKey']) && $redux_builder_amp['ampforwp-spotim-comments-apiKey'] !== ""){
236
- $spotId = $redux_builder_amp['ampforwp-spotim-comments-apiKey'];
237
  }
238
- $srcUrl = 'https://amp.spot.im/production.html?';
239
- $srcUrl = add_query_arg('spotId' ,get_permalink(), $srcUrl);
240
  $srcUrl = add_query_arg('postId' , $post->ID, $srcUrl);
241
  $spotim_html = '<amp-iframe width="375" height="815" resizable sandbox="allow-scripts allow-same-origin allow-popups allow-top-navigation" layout="responsive"
242
  frameborder="0" src="'.esc_url($srcUrl).'">
230
  }
231
 
232
  function ampforwp_framework_get_spotim_comments(){
233
+ global $post;
234
  $spotId ='';
235
+ if( true == ampforwp_get_setting('ampforwp-spotim-comments-apiKey') && ampforwp_get_setting('ampforwp-spotim-comments-apiKey') !== ""){
236
+ $spotId = ampforwp_get_setting('ampforwp-spotim-comments-apiKey');
237
  }
238
+ $srcUrl = 'https://amp.spot.im/production.html?spot_im_highlight_immediate=true';
239
+ $srcUrl = add_query_arg('spotId' ,$spotId, $srcUrl);
240
  $srcUrl = add_query_arg('postId' , $post->ID, $srcUrl);
241
  $spotim_html = '<amp-iframe width="375" height="815" resizable sandbox="allow-scripts allow-same-origin allow-popups allow-top-navigation" layout="responsive"
242
  frameborder="0" src="'.esc_url($srcUrl).'">
components/components-core.php CHANGED
@@ -715,6 +715,7 @@ function ampforwp_addThis_support(){
715
  $amp_addthis = '';
716
  if ( ( is_single() || (is_page() && ampforwp_get_setting('ampforwp-page-social')) ) && !checkAMPforPageBuilderStatus(ampforwp_get_the_ID()) ) {
717
  if( ampforwp_get_setting('enable-add-this-option') ) {
 
718
  if( 4 == ampforwp_get_setting('amp-design-selector') && 'default' == ampforwp_get_setting('swift-add-this-position') ){
719
  $addthisWidth = 290;
720
  }
715
  $amp_addthis = '';
716
  if ( ( is_single() || (is_page() && ampforwp_get_setting('ampforwp-page-social')) ) && !checkAMPforPageBuilderStatus(ampforwp_get_the_ID()) ) {
717
  if( ampforwp_get_setting('enable-add-this-option') ) {
718
+
719
  if( 4 == ampforwp_get_setting('amp-design-selector') && 'default' == ampforwp_get_setting('swift-add-this-position') ){
720
  $addthisWidth = 290;
721
  }
components/loop/loop.php CHANGED
@@ -2,7 +2,9 @@
2
  function amp_archive_title(){
3
  global $redux_builder_amp;
4
  if( is_author() ){
5
- $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
 
 
6
  if( true == ampforwp_gravatar_checker($curauth->user_email) ){
7
  $curauth_url = get_avatar_url( $curauth->user_email, array('size'=>180) );
8
  if($curauth_url){ ?>
@@ -123,10 +125,10 @@ function call_loops_standard($data=array()){
123
  $week = get_query_var('week');
124
  $day = get_query_var('day');
125
  $args = array( 'date_query' => array(
126
- array( 'year' => $year,
127
- 'month' => $monthnum,
128
- 'week' => $week,
129
- 'day' => $day )
130
  ),
131
  'paged' => esc_attr($paged),
132
  'post__not_in' => $exclude_ids,
@@ -163,7 +165,8 @@ function call_loops_standard($data=array()){
163
  }
164
  if(is_author()){
165
  $exclude_ids = ampforwp_exclude_posts();
166
- $author = get_user_by( 'slug', get_query_var( 'author_name' ) );
 
167
  $args = array(
168
  'author' => $author->ID,
169
  'post_type' => 'post',
@@ -269,6 +272,7 @@ function amp_pagination($args =array()) {
269
  } else {
270
  $paged = 1;
271
  }
 
272
  $pre_link = '';
273
  if(!isset($args['previous_text']) || $args['previous_text']==''){
274
  $args['previous_text'] = 'Show previous Posts';
2
  function amp_archive_title(){
3
  global $redux_builder_amp;
4
  if( is_author() ){
5
+ $author_name = esc_attr(get_query_var('author_name'));
6
+ $author = esc_attr(get_query_var('author'));
7
+ $curauth = (get_query_var('author_name')) ? get_user_by('slug', $author_name) : get_userdata($author);
8
  if( true == ampforwp_gravatar_checker($curauth->user_email) ){
9
  $curauth_url = get_avatar_url( $curauth->user_email, array('size'=>180) );
10
  if($curauth_url){ ?>
125
  $week = get_query_var('week');
126
  $day = get_query_var('day');
127
  $args = array( 'date_query' => array(
128
+ array( 'year' => esc_attr($year),
129
+ 'month' => esc_attr($monthnum),
130
+ 'week' => esc_attr($week),
131
+ 'day' => esc_attr($day) )
132
  ),
133
  'paged' => esc_attr($paged),
134
  'post__not_in' => $exclude_ids,
165
  }
166
  if(is_author()){
167
  $exclude_ids = ampforwp_exclude_posts();
168
+ $author = esc_attr(get_query_var( 'author_name' ));
169
+ $author = get_user_by( 'slug', $author);
170
  $args = array(
171
  'author' => $author->ID,
172
  'post_type' => 'post',
272
  } else {
273
  $paged = 1;
274
  }
275
+ $paged = esc_attr($paged);
276
  $pre_link = '';
277
  if(!isset($args['previous_text']) || $args['previous_text']==''){
278
  $args['previous_text'] = 'Show previous Posts';
components/theme-loader.php CHANGED
@@ -134,7 +134,8 @@ elseif ( ! defined('AMPFORWP_CUSTOM_THEME') ) {
134
  }
135
  break;
136
  case (is_archive()):
137
- $post_types = array_filter( (array) get_query_var( 'post_type' ) );
 
138
  $templates = array();
139
  if ( count( $post_types ) == 1 ) {
140
  $post_type = reset( $post_types );
@@ -158,8 +159,8 @@ elseif ( ! defined('AMPFORWP_CUSTOM_THEME') ) {
158
  //return '';
159
  break;
160
  }
161
-
162
- $post_types = array_filter( (array) get_query_var( 'post_type' ) );
163
 
164
  $templates = array();
165
 
134
  }
135
  break;
136
  case (is_archive()):
137
+ $p_type = esc_attr(get_query_var( 'post_type' ));
138
+ $post_types = array_filter( (array) $p_type );
139
  $templates = array();
140
  if ( count( $post_types ) == 1 ) {
141
  $post_type = reset( $post_types );
159
  //return '';
160
  break;
161
  }
162
+ $p_type = esc_attr(get_query_var( 'post_type' ));
163
+ $post_types = array_filter( (array) $p_type );
164
 
165
  $templates = array();
166
 
images/amp-icon-check.png ADDED
Binary file
images/amp-img-conv.png ADDED
Binary file
includes/features/analytics/analytics-options.php CHANGED
@@ -123,16 +123,13 @@ function ampforwp_analytics_options($opt_name){
123
  'desc' => '',
124
  'default' => ('{
125
  "vars": {
126
- "account": "UA-xxxxxxx-x" //Replace this with your Tracking ID
127
  },
128
  "triggers": {
129
  "trackPageview": {
130
  "on": "visible",
131
  "request": "pageview"
132
  }
133
- /**
134
- * Enter your Advanced Analytics code here
135
- */
136
  }
137
  }')
138
  ),
@@ -213,9 +210,6 @@ function ampforwp_analytics_options($opt_name){
213
  "on": "visible",
214
  "request": "pageview"
215
  }
216
- /**
217
- * Enter your Advanced Analytics code here
218
- */
219
  }
220
  }')
221
  ),
123
  'desc' => '',
124
  'default' => ('{
125
  "vars": {
126
+ "account": "UA-xxxxxxx-x"
127
  },
128
  "triggers": {
129
  "trackPageview": {
130
  "on": "visible",
131
  "request": "pageview"
132
  }
 
 
 
133
  }
134
  }')
135
  ),
210
  "on": "visible",
211
  "request": "pageview"
212
  }
 
 
 
213
  }
214
  }')
215
  ),
includes/features/functions.php CHANGED
@@ -426,10 +426,10 @@ if ( ! function_exists( 'ampforwp_isexternal ') ) {
426
  if ( empty($components['host']) ) return false;
427
 
428
  // url host looks exactly like the local host
429
- if ( strcasecmp($components['host'], $_SERVER['HTTP_HOST']) === 0 ) return false;
430
 
431
  // check if the url host is a subdomain
432
- return strrpos(strtolower($components['host']), $_SERVER['HTTP_HOST']) !== strlen($components['host']) - strlen($_SERVER['HTTP_HOST']);
433
  }
434
  } // end ampforwp_isexternal
435
 
426
  if ( empty($components['host']) ) return false;
427
 
428
  // url host looks exactly like the local host
429
+ if ( strcasecmp($components['host'], AMPFROWP_HOST_NAME) === 0 ) return false;
430
 
431
  // check if the url host is a subdomain
432
+ return strrpos(strtolower($components['host']), AMPFROWP_HOST_NAME) !== strlen($components['host']) - strlen(AMPFROWP_HOST_NAME);
433
  }
434
  } // end ampforwp_isexternal
435
 
includes/features/performance/performance-functions.php CHANGED
@@ -65,7 +65,7 @@ function ampforwp_minify_html_output($content_buffer){
65
  if ( $minify_html_xhtml == 'yes' && strtolower( substr( ltrim( $buffer ), 0, 15 ) ) == '<!doctype html>' )
66
  $buffer = str_replace( ' />', '>', $buffer );
67
  if ( $minify_html_relative == 'yes' )
68
- $buffer = str_replace( array ( 'https://' . $_SERVER['HTTP_HOST'] . '/', 'http://' . $_SERVER['HTTP_HOST'] . '/', '//' . $_SERVER['HTTP_HOST'] . '/' ), array( '/', '/', '/' ), $buffer );
69
  if ( $minify_html_scheme == 'yes' )
70
  $buffer = str_replace( array( 'http://', 'https://' ), '//', $buffer );
71
 
65
  if ( $minify_html_xhtml == 'yes' && strtolower( substr( ltrim( $buffer ), 0, 15 ) ) == '<!doctype html>' )
66
  $buffer = str_replace( ' />', '>', $buffer );
67
  if ( $minify_html_relative == 'yes' )
68
+ $buffer = str_replace( array ( 'https://' . AMPFROWP_HOST_NAME . '/', 'http://' . AMPFROWP_HOST_NAME . '/', '//' . AMPFROWP_HOST_NAME . '/' ), array( '/', '/', '/' ), $buffer );
69
  if ( $minify_html_scheme == 'yes' )
70
  $buffer = str_replace( array( 'http://', 'https://' ), '//', $buffer );
71
 
includes/features/structure-data/structured-data-functions.php CHANGED
@@ -266,18 +266,27 @@ function ampforwp_structured_data_type( $metadata ) {
266
  }
267
 
268
  if ( isset( $post->post_type ) && $post->post_type == $post_type ) {
269
- if ( empty( $redux_builder_amp['ampforwp-sd-type-'.$post_type.''] ) && $redux_builder_amp['ampforwp-seo-yoast-description'] == 0 ) {
 
 
 
270
  return;
271
  }
272
  if(isset($metadata['@type']) && $metadata['@type']){
273
- $metadata['@type'] = $redux_builder_amp['ampforwp-sd-type-'.$post_type.''];
274
  }
275
  return $metadata;
276
  }
277
  }
278
  }
279
 
280
- if ( empty( $set_sd_post ) && is_single() && $redux_builder_amp['ampforwp-seo-yoast-description'] == 0 ) {;
 
 
 
 
 
 
281
  return;
282
  }
283
 
266
  }
267
 
268
  if ( isset( $post->post_type ) && $post->post_type == $post_type ) {
269
+ if( empty( ampforwp_get_setting('ampforwp-sd-type-'.esc_attr($post_type)) ) ){
270
+ return;
271
+ }
272
+ if ( empty( ampforwp_get_setting('ampforwp-sd-type-'.esc_attr($post_type)) ) && ampforwp_get_setting('ampforwp-seo-yoast-description') == 0 ) {
273
  return;
274
  }
275
  if(isset($metadata['@type']) && $metadata['@type']){
276
+ $metadata['@type'] = ampforwp_get_setting('ampforwp-sd-type-'.esc_attr($post_type));
277
  }
278
  return $metadata;
279
  }
280
  }
281
  }
282
 
283
+ if( $post->post_type == "post" && empty( $set_sd_post )){
284
+ return;
285
+ }elseif($post->post_type == "page" && empty( $set_sd_page )) {
286
+ return;
287
+ }
288
+
289
+ if( empty($set_sd_post) && is_single() && ampforwp_get_setting('ampforwp-seo-yoast-description') == 0) {
290
  return;
291
  }
292
 
includes/modules-upgrade.php CHANGED
@@ -103,7 +103,7 @@ function ampforwp_enable_modules_upgread(){
103
 
104
  function ampforwp_admin_notice_module_reference_install() {
105
  // Exit if the user does not have proper permissions
106
- if(! current_user_can( 'manage_options' ) && !is_admin() ) {
107
  return ;
108
  }
109
 
103
 
104
  function ampforwp_admin_notice_module_reference_install() {
105
  // Exit if the user does not have proper permissions
106
+ if(! current_user_can( 'manage_options' )) {
107
  return ;
108
  }
109
 
includes/modules/ampforwp-blurb.php CHANGED
@@ -178,7 +178,8 @@
178
  wp_enqueue_script('media-upload');
179
  wp_enqueue_script('thickbox');
180
  wp_enqueue_style('thickbox');
181
-
 
182
  wp_enqueue_script( 'ampforwp-builder-script', plugins_url('/modules/js/amp.js' , dirname(__FILE__) ) , array( 'jquery' ), false, true );
183
 
184
  } // end register_admin_scripts
178
  wp_enqueue_script('media-upload');
179
  wp_enqueue_script('thickbox');
180
  wp_enqueue_style('thickbox');
181
+ $builder_data['amp_icon_check'] = AMPFORWP_IMAGE_DIR . '/amp-icon-check.png';
182
+ wp_localize_script( 'ampforwp-builder-script', 'builder_script_data', $builder_data );
183
  wp_enqueue_script( 'ampforwp-builder-script', plugins_url('/modules/js/amp.js' , dirname(__FILE__) ) , array( 'jquery' ), false, true );
184
 
185
  } // end register_admin_scripts
includes/modules/ampforwp-button.php CHANGED
@@ -190,6 +190,8 @@
190
  * Registers and enqueues admin-specific JavaScript.
191
  */
192
  public function register_admin_scripts() {
 
 
193
  wp_enqueue_script( 'ampforwp-builder-script', plugins_url('/modules/js/amp.js' , dirname(__FILE__) ) , array( 'jquery' ), false, true );
194
 
195
  } // end register_admin_scripts
190
  * Registers and enqueues admin-specific JavaScript.
191
  */
192
  public function register_admin_scripts() {
193
+ $builder_data['amp_icon_check'] = AMPFORWP_IMAGE_DIR . '/amp-icon-check.png';
194
+ wp_localize_script( 'ampforwp-builder-script', 'builder_script_data', $builder_data );
195
  wp_enqueue_script( 'ampforwp-builder-script', plugins_url('/modules/js/amp.js' , dirname(__FILE__) ) , array( 'jquery' ), false, true );
196
 
197
  } // end register_admin_scripts
includes/modules/js/amp.js CHANGED
@@ -13,11 +13,11 @@ jQuery(document).ready(function($) {
13
  var instance = container_class_array[0];
14
  var add = $(this).parent().parent().find('.ampforwp-blurb-add');
15
  count = additional.find('.widget-top').length;
16
-
17
  additional.append('<div class="widget"><div class="widget-top"><div class="widget-title-action"> </div> <div class="widget-title"><h3> New Module<span class="in-widget-title"></span></h3></div></div><div class="widget-inside"><p><label for="widget-ampforwp-blurb['+instance+'][features]['+count+'][title]">Title</label>'+
18
  '<input class="widefat" id="widget-ampforwp-blurb-'+instance+'-features-'+count+'-title" name="widget-ampforwp-blurb['+instance+'][features]['+count+'][title]" type="text" value="Heart Of The Landing Page" />'+
19
  '<label for="widget-ampforwp-blurb['+instance+'][features]['+count+'][description]">Description</label>'+
20
- '<textarea class="widefat" id="widget-ampforwp-blurb-'+instance+'-features-'+count+'-description" name="widget-ampforwp-blurb['+instance+'][features]['+count+'][description]" rows=\'6\' cols=\'50\'>This is a sample text which is being used for the dummy purpose to avoid confusion.</textarea> <span class="clear"></span></p>' + '<p> <label for=""> Image: </label><input type="button" class="select-img-'+count+' button left" style="width:auto;" value="Select Image" onclick="ampSelectImage('+count+');"/><input type="button" style="display:none" name="removeimg" id="remove-img-'+count+'" class="button button-secondary remove-img-button" data-count-type="'+count+'" value="Remove Image" onclick="removeImage('+count+')"><img src="http://i.imgur.com/5nPXqZG.png" class="preview-image block-image-'+count+'" >' + '<input type="hidden" id="amp-img-field-'+count+'" class="img'+count+'" style="width:auto;" name="widget-ampforwp-blurb['+instance+'][features]['+count+'][image]" id="'+instance+'-features-'+count+'" value="http://i.imgur.com/5nPXqZG.png" /></p>' + ' <p> <a class="ampforwp-blurb-remove delete button left">Remove Feature</a></p></div></div>');
21
  });
22
  jQuery(".ampforwp-blurb-remove").live('click', function() {
23
  jQuery(this).parent().parent().parent().remove();
13
  var instance = container_class_array[0];
14
  var add = $(this).parent().parent().find('.ampforwp-blurb-add');
15
  count = additional.find('.widget-top').length;
16
+ var amp_check_img = builder_script_data.amp_icon_check;
17
  additional.append('<div class="widget"><div class="widget-top"><div class="widget-title-action"> </div> <div class="widget-title"><h3> New Module<span class="in-widget-title"></span></h3></div></div><div class="widget-inside"><p><label for="widget-ampforwp-blurb['+instance+'][features]['+count+'][title]">Title</label>'+
18
  '<input class="widefat" id="widget-ampforwp-blurb-'+instance+'-features-'+count+'-title" name="widget-ampforwp-blurb['+instance+'][features]['+count+'][title]" type="text" value="Heart Of The Landing Page" />'+
19
  '<label for="widget-ampforwp-blurb['+instance+'][features]['+count+'][description]">Description</label>'+
20
+ '<textarea class="widefat" id="widget-ampforwp-blurb-'+instance+'-features-'+count+'-description" name="widget-ampforwp-blurb['+instance+'][features]['+count+'][description]" rows=\'6\' cols=\'50\'>This is a sample text which is being used for the dummy purpose to avoid confusion.</textarea> <span class="clear"></span></p>' + '<p> <label for=""> Image: </label><input type="button" class="select-img-'+count+' button left" style="width:auto;" value="Select Image" onclick="ampSelectImage('+count+');"/><input type="button" style="display:none" name="removeimg" id="remove-img-'+count+'" class="button button-secondary remove-img-button" data-count-type="'+count+'" value="Remove Image" onclick="removeImage('+count+')"><img src="'+amp_check_img+'" class="preview-image block-image-'+count+'" >' + '<input type="hidden" id="amp-img-field-'+count+'" class="img'+count+'" style="width:auto;" name="widget-ampforwp-blurb['+instance+'][features]['+count+'][image]" id="'+instance+'-features-'+count+'" value="'+amp_check_img+'" /></p>' + ' <p> <a class="ampforwp-blurb-remove delete button left">Remove Feature</a></p></div></div>');
21
  });
22
  jQuery(".ampforwp-blurb-remove").live('click', function() {
23
  jQuery(this).parent().parent().parent().remove();
includes/options/admin-config.php CHANGED
@@ -1102,20 +1102,17 @@ $single_extension_listing = '
1102
  ';
1103
 
1104
  $upcomingLayoutsDesign = '';
1105
- $layouts = array();
1106
- if( is_admin() ){
1107
- $layouts = ampforwp_upcomming_layouts_demo();
1108
- }
1109
  if(is_array($layouts)){
1110
  foreach($layouts as $k=>$val){
1111
  $upcomingLayoutsDesign .= '<div class="amp_layout_upcomming">
1112
  <div class="amppb_ad-layout-layout">
1113
  <div class="amppb_ad-layout-wrapper">
1114
  <div class="amppb_ad-layout_pro"><a href="https://ampforwp.com/amp-layouts/" target="_blank">PRO</a></div>
1115
- <h4 class="amppb_ad-layout-title">'.$val['name'].'</h4>
1116
- <div class="amppb_ad-layout-screenshot"> <img src="'.$val['image'].'" onclick="window.open(\''.$val['link'].'\')"> </div>
1117
  <div class="amppb_ad-layout-button">
1118
- <a target="_blank" href="'.$val['link'].'" class="button">View Theme</a>
1119
  </div>
1120
  </div>
1121
  </div>
@@ -1177,9 +1174,9 @@ $eu_iso_codes = array(
1177
  //$amp_redux_header = '<span id="name"><span style="color: #4dbefa;">U</span>ltimate <span style="color: #4dbefa;">W</span>idgets</span>';
1178
  $proDetailsProvide = '<a class="technical_support_btn_txt" href="https://ampforwp.com/support/" target="_blank">'.esc_html__('Technical Support','accelerated-mobile-pages').'</a> <a class="premium_features_btn" href="https://ampforwp.com/membership/#utm_source=options-panel&utm_medium=view_pro_features_btn&utm_campaign=AMP%20Plugin" target="_blank">Upgrade to PRO</a> ';
1179
  if($ampforwp_nameOfUser!=""){
1180
- $proDetailsProvide = "<span class='extension-menu-call'><span class='activated-plugins'>Hello, ".$ampforwp_nameOfUser."</span> <a class='' href='".admin_url('admin.php?page=amp_options&tabid=opt-go-premium')."'><i class='dashicons-before dashicons-admin-generic'></i></a></span>";
1181
  }elseif($ampforwp_is_productActivated){
1182
- $proDetailsProvide = "<span class='extension-menu-call'>One more Step <a class='premium_features_btn' href='".admin_url('admin.php?tabid=opt-go-premium&page=amp_options')."'>Enter license here</a></span>";
1183
  }
1184
  if(function_exists('amp_activate') ){
1185
  $proDetailsProvide = "<a class='premium_features_btn_txt' href=\"#\"> AMP by Automattic compatibility has been activated</a>";
@@ -1598,7 +1595,7 @@ Redux::setArgs( "redux_builder_amp", $args );
1598
  elseif ( defined( 'RANK_MATH_FILE' ) ) {
1599
  $default = 'rank_math';
1600
  }
1601
- elseif ( function_exists('genesis_title') ) {
1602
  $default = 'genesis';
1603
  }
1604
  elseif ( is_plugin_active('wp-seopress/seopress.php') ) {
@@ -1726,6 +1723,15 @@ Redux::setArgs( "redux_builder_amp", $args );
1726
  'default' => 0,
1727
  'required' => array('ampforwp-seo-selection', '=' , 'yoast'),
1728
  ),
 
 
 
 
 
 
 
 
 
1729
  array(
1730
  'class' => 'child_opt',
1731
  'id' => 'ampforwp-yoast-seo-analysis',
@@ -3554,7 +3560,7 @@ Redux::setSection( $opt_name, array(
3554
  'mode' => 'css',
3555
  'theme' => 'monokai',
3556
  'desc' => '',
3557
- 'default' => esc_html__('/******* Paste your Custom CSS in this Editor *******/','accelerated-mobile-pages')
3558
  ),
3559
  );
3560
  $amp_fontparts = array_merge($amp_fontparts ,$global_settings);
@@ -6350,6 +6356,22 @@ else{
6350
  array('addthis-inline-share', '=', '1'),
6351
  )
6352
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6353
  array(
6354
  'id' => 'add-this-pub-id',
6355
  'title' => esc_html__('Pub ID', 'accelerated-mobile-pages'),
1102
  ';
1103
 
1104
  $upcomingLayoutsDesign = '';
1105
+ $layouts = ampforwp_upcomming_layouts_demo();
 
 
 
1106
  if(is_array($layouts)){
1107
  foreach($layouts as $k=>$val){
1108
  $upcomingLayoutsDesign .= '<div class="amp_layout_upcomming">
1109
  <div class="amppb_ad-layout-layout">
1110
  <div class="amppb_ad-layout-wrapper">
1111
  <div class="amppb_ad-layout_pro"><a href="https://ampforwp.com/amp-layouts/" target="_blank">PRO</a></div>
1112
+ <h4 class="amppb_ad-layout-title">'.esc_html($val['name']).'</h4>
1113
+ <div class="amppb_ad-layout-screenshot"> <img src="'.esc_url($val['image']).'" onclick="window.open(\''.esc_url($val['link']).'\')"> </div>
1114
  <div class="amppb_ad-layout-button">
1115
+ <a target="_blank" href="'.esc_url($val['link']).'" class="button">'. esc_html__('View Theme','accelerated-mobile-pages').'</a>
1116
  </div>
1117
  </div>
1118
  </div>
1174
  //$amp_redux_header = '<span id="name"><span style="color: #4dbefa;">U</span>ltimate <span style="color: #4dbefa;">W</span>idgets</span>';
1175
  $proDetailsProvide = '<a class="technical_support_btn_txt" href="https://ampforwp.com/support/" target="_blank">'.esc_html__('Technical Support','accelerated-mobile-pages').'</a> <a class="premium_features_btn" href="https://ampforwp.com/membership/#utm_source=options-panel&utm_medium=view_pro_features_btn&utm_campaign=AMP%20Plugin" target="_blank">Upgrade to PRO</a> ';
1176
  if($ampforwp_nameOfUser!=""){
1177
+ $proDetailsProvide = "<span class='extension-menu-call'><span class='activated-plugins'>Hello, ".esc_html($ampforwp_nameOfUser)."</span> <a class='' href='".esc_url(admin_url('admin.php?page=amp_options&tabid=opt-go-premium'))."'><i class='dashicons-before dashicons-admin-generic'></i></a></span>";
1178
  }elseif($ampforwp_is_productActivated){
1179
+ $proDetailsProvide = "<span class='extension-menu-call'>One more Step <a class='premium_features_btn' href='".esc_url(admin_url('admin.php?tabid=opt-go-premium&page=amp_options'))."'>Enter license here</a></span>";
1180
  }
1181
  if(function_exists('amp_activate') ){
1182
  $proDetailsProvide = "<a class='premium_features_btn_txt' href=\"#\"> AMP by Automattic compatibility has been activated</a>";
1595
  elseif ( defined( 'RANK_MATH_FILE' ) ) {
1596
  $default = 'rank_math';
1597
  }
1598
+ elseif ( function_exists('genesis_theme_support') ) {
1599
  $default = 'genesis';
1600
  }
1601
  elseif ( is_plugin_active('wp-seopress/seopress.php') ) {
1723
  'default' => 0,
1724
  'required' => array('ampforwp-seo-selection', '=' , 'yoast'),
1725
  ),
1726
+ array(
1727
+ 'class' => 'child_opt',
1728
+ 'id' => 'ampforwp-seo-yoast-schema',
1729
+ 'type' => 'switch',
1730
+ 'tooltip-subtitle' => esc_html__('Fetch Schema from the Yoast Seo for AMP Pages', 'accelerated-mobile-pages'),
1731
+ 'title' => esc_html__( 'Schema from Yoast', 'accelerated-mobile-pages' ),
1732
+ 'default' => 0,
1733
+ 'required' => array('ampforwp-seo-selection', '=' , 'yoast'),
1734
+ ),
1735
  array(
1736
  'class' => 'child_opt',
1737
  'id' => 'ampforwp-yoast-seo-analysis',
3560
  'mode' => 'css',
3561
  'theme' => 'monokai',
3562
  'desc' => '',
3563
+ 'default' => ''
3564
  ),
3565
  );
3566
  $amp_fontparts = array_merge($amp_fontparts ,$global_settings);
6356
  array('addthis-inline-share', '=', '1'),
6357
  )
6358
  ),
6359
+ array(
6360
+ 'id' => 'design-1-2-3-addthis-pos',
6361
+ 'type' => 'select',
6362
+ 'class' => 'child_opt child_opt_arrow',
6363
+ 'title' => esc_html__( 'Position', 'accelerated-mobile-pages' ),
6364
+ 'options' => array(
6365
+ 'above-content' => 'Above Content',
6366
+ 'below-content' => 'Below Content'
6367
+ ),
6368
+ 'default' => 'below-content',
6369
+ 'required' => array(
6370
+ array('amp-design-selector', '!=', '4'),
6371
+ array('enable-add-this-option', '=', '1'),
6372
+ array('addthis-inline-share', '=', '1'),
6373
+ )
6374
+ ),
6375
  array(
6376
  'id' => 'add-this-pub-id',
6377
  'title' => esc_html__('Pub ID', 'accelerated-mobile-pages'),
includes/options/redux-core/framework.php CHANGED
@@ -3331,7 +3331,7 @@
3331
  require_once 'core/panel.php';
3332
  if(is_admin()){
3333
  echo '<div class="a-f-wp-help"><div class="a-f-wp-help-message">
3334
- <a target="_blank" href="http://ampforwp.com/support/?utm_source=options-panel&utm_medium=contact_link_btn&utm_campaign=AMP%20Plugin"> <img src="https://ampforwp.com/wp-content/uploads/2017/03/chatbox-img-1.png" /></a>
3335
 
3336
  </div>
3337
  <div class="a-f-wp-help-container">
3331
  require_once 'core/panel.php';
3332
  if(is_admin()){
3333
  echo '<div class="a-f-wp-help"><div class="a-f-wp-help-message">
3334
+ <a target="_blank" href="http://ampforwp.com/support/?utm_source=options-panel&utm_medium=contact_link_btn&utm_campaign=AMP%20Plugin"> <img src="'.AMPFORWP_IMAGE_DIR . '/amp-img-conv.png'.'" /></a>
3335
 
3336
  </div>
3337
  <div class="a-f-wp-help-container">
includes/redirect.php CHANGED
@@ -51,7 +51,7 @@ function ampforwp_redirection() {
51
  // Redirect ?nonamp=1 to normal url #3269
52
  $current_url = $check = '';
53
  $current_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ?
54
- "https" : "http") . "://" . $_SERVER['HTTP_HOST'] .
55
  $_SERVER['REQUEST_URI'];
56
  $current_url = explode('/', $current_url);
57
  $check = '?nonamp=1';
51
  // Redirect ?nonamp=1 to normal url #3269
52
  $current_url = $check = '';
53
  $current_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ?
54
+ "https" : "http") . "://" . AMPFROWP_HOST_NAME .
55
  $_SERVER['REQUEST_URI'];
56
  $current_url = explode('/', $current_url);
57
  $check = '?nonamp=1';
includes/thirdparty-compatibility.php CHANGED
@@ -257,7 +257,8 @@ require_once AMPFORWP_PLUGIN_DIR . '/includes/updater/update.php';
257
  }
258
  break;
259
  case (is_archive()):
260
- $post_types = array_filter( (array) get_query_var( 'post_type' ) );
 
261
  $templates = array();
262
  if ( count( $post_types ) == 1 ) {
263
  $post_type = reset( $post_types );
@@ -281,8 +282,8 @@ require_once AMPFORWP_PLUGIN_DIR . '/includes/updater/update.php';
281
  //return '';
282
  break;
283
  }
284
-
285
- $post_types = array_filter( (array) get_query_var( 'post_type' ) );
286
 
287
  $templates = array();
288
 
257
  }
258
  break;
259
  case (is_archive()):
260
+ $ptype = esc_attr(get_query_var( 'post_type' ));
261
+ $post_types = array_filter( (array) $ptype );
262
  $templates = array();
263
  if ( count( $post_types ) == 1 ) {
264
  $post_type = reset( $post_types );
282
  //return '';
283
  break;
284
  }
285
+ $ptype = esc_attr(get_query_var( 'post_type' ));
286
+ $post_types = array_filter( (array) $ptype );
287
 
288
  $templates = array();
289
 
includes/vendor/amp/includes/amp-post-template-actions.php CHANGED
@@ -54,9 +54,11 @@ function amp_post_template_add_schemaorg_metadata( $amp_template ) {
54
  if ( empty( $metadata ) ) {
55
  return;
56
  }
 
57
  ?>
58
  <script type="application/ld+json"><?php echo wp_json_encode( $metadata ); ?></script>
59
  <?php
 
60
  }
61
  endif;
62
 
54
  if ( empty( $metadata ) ) {
55
  return;
56
  }
57
+ if( (ampforwp_get_setting('ampforwp-seo-yoast-schema') == false && ampforwp_get_setting('ampforwp-seo-selection') == 'yoast') || empty(ampforwp_get_setting('ampforwp-seo-selection')) ){
58
  ?>
59
  <script type="application/ld+json"><?php echo wp_json_encode( $metadata ); ?></script>
60
  <?php
61
+ }
62
  }
63
  endif;
64
 
includes/vendor/amp/includes/sanitizers/class-amp-blacklist-sanitizer.php CHANGED
@@ -171,7 +171,7 @@ class AMP_Blacklist_Sanitizer extends AMP_Base_Sanitizer {
171
  $href = untrailingslashit( get_home_url() ) . $href;
172
  }
173
 
174
- $valid_protocols = array( 'http', 'https', 'mailto', 'sms', 'tel', 'viber', 'whatsapp' , 'ftp','skype');
175
  $special_protocols = array( 'tel', 'sms','skype' ); // these ones don't valid with `filter_var+FILTER_VALIDATE_URL`
176
  $protocol = strtok( $href, ':' );
177
 
171
  $href = untrailingslashit( get_home_url() ) . $href;
172
  }
173
 
174
+ $valid_protocols = array( 'http', 'https', 'mailto', 'sms', 'tel', 'viber', 'whatsapp' , 'ftp','skype', 'tg');
175
  $special_protocols = array( 'tel', 'sms','skype' ); // these ones don't valid with `filter_var+FILTER_VALIDATE_URL`
176
  $protocol = strtok( $href, ':' );
177
 
includes/vendor/amp/includes/sanitizers/class-amp-style-sanitizer.php CHANGED
@@ -568,7 +568,7 @@ class AMP_Style_Sanitizer extends AMP_Base_Sanitizer {
568
  */
569
  private function generate_class_name( $data ) {
570
  $string = maybe_serialize( $data );
571
- return 'amp-wp-inline-' . substr(md5($string), 0, 7);
572
  }
573
  private function ampforwp_remove_spaces_from_data_urls( $style_css ) {
574
  $new_style_css = array();
568
  */
569
  private function generate_class_name( $data ) {
570
  $string = maybe_serialize( $data );
571
+ return 'acss'.substr(md5($string), 0, 5);
572
  }
573
  private function ampforwp_remove_spaces_from_data_urls( $style_css ) {
574
  $new_style_css = array();
includes/vendor/amp/jetpack-helper.php CHANGED
@@ -66,7 +66,7 @@ function jetpack_amp_build_stats_pixel_url() {
66
  $data = compact( 'v', 'j', 'blog', 'post', 'tz', 'srv' );
67
  }
68
 
69
- $data['host'] = isset( $_SERVER['HTTP_HOST'] ) ? rawurlencode( $_SERVER['HTTP_HOST'] ) : '';
70
  $data['rand'] = 'RANDOM'; // amp placeholder
71
  $data['ref'] = 'DOCUMENT_REFERRER'; // amp placeholder
72
  $data = array_map( 'rawurlencode' , $data );
66
  $data = compact( 'v', 'j', 'blog', 'post', 'tz', 'srv' );
67
  }
68
 
69
+ $data['host'] = rawurlencode( AMPFROWP_HOST_NAME );
70
  $data['rand'] = 'RANDOM'; // amp placeholder
71
  $data['ref'] = 'DOCUMENT_REFERRER'; // amp placeholder
72
  $data = array_map( 'rawurlencode' , $data );
includes/vendor/vendor-changelog.txt CHANGED
@@ -83,4 +83,5 @@ Reason: To extend the functionality of sidebars and Pagebuilder
83
  53. Updated class-amp-wistia-embed.php #3386
84
  54. Added class_exists('SQ_Classes_ObjController') condition to amp_post_template_add_schemaorg_metadata for Squirrly SEO Compatibility #3421
85
  55. class-amp-content.php updated #3422
86
- 56. whitelisted skype in anchor tags #3475
 
83
  53. Updated class-amp-wistia-embed.php #3386
84
  54. Added class_exists('SQ_Classes_ObjController') condition to amp_post_template_add_schemaorg_metadata for Squirrly SEO Compatibility #3421
85
  55. class-amp-content.php updated #3422
86
+ 56. whitelisted skype in anchor tags #3475
87
+ 57. Telegram links has been whitelisted in anchor tags #3578
pagebuilder/amp-page-builder.php CHANGED
@@ -75,7 +75,8 @@ function ampforwp_call_page_builder(){
75
  $postId = $post->ID;
76
  }
77
  if(isset($_GET['post_id'])){
78
- $postId = sanitize_text_field( wp_unslash($_GET['post_id']));
 
79
  }
80
  add_thickbox();
81
 
75
  $postId = $post->ID;
76
  }
77
  if(isset($_GET['post_id'])){
78
+ $id = intval($_GET['post_id']);
79
+ $postId = sanitize_text_field( wp_unslash($id));
80
  }
81
  add_thickbox();
82
 
pagebuilder/inc/admin-amp-page-builder.js CHANGED
@@ -56,15 +56,17 @@ Vue.component('amp-pagebuilder-modal', {
56
  }
57
  ).then(function(response){
58
  response =response.body;
59
- if(response.status="200"){
60
  this.layoutMsg = "Layout removed successfully!";
61
  this.showsavedLayouts = response.data;
62
- amppb_panel_options.savedLayouts = this.showsavedLayouts
63
-
64
  this.save_layout = {name:"",url:""};
65
  }
66
- else
67
  this.layoutMsg = "Try Again";
 
 
 
68
  setTimeout(() => {
69
  this.layoutMsg = '';
70
  },5000);
56
  }
57
  ).then(function(response){
58
  response =response.body;
59
+ if(response.status=="200"){
60
  this.layoutMsg = "Layout removed successfully!";
61
  this.showsavedLayouts = response.data;
62
+ amppb_panel_options.savedLayouts = this.showsavedLayouts;
 
63
  this.save_layout = {name:"",url:""};
64
  }
65
+ else if(response.status=="404"){
66
  this.layoutMsg = "Try Again";
67
+ }else if(response.status=="403"){
68
+ this.layoutMsg = "Sorry! You don't have permission to delete the layout.";
69
+ }
70
  setTimeout(() => {
71
  this.layoutMsg = '';
72
  },5000);
pagebuilder/inc/adminAjaxContents.php CHANGED
@@ -46,7 +46,7 @@ function enable_amp_pagebuilder(){
46
  }else{
47
  echo json_encode(array('status'=>"500", 'Message'=>"post id not found"));
48
  }
49
- if(isset($postId) && get_post_meta($postId,'use_ampforwp_page_builder', true)!=='yes'){
50
  update_post_meta($postId, 'use_ampforwp_page_builder','yes');
51
  echo json_encode(array('status'=>200, 'Message'=>"Pagebuilder Started successfully"));
52
  }else{
@@ -126,32 +126,39 @@ function amppb_save_layout_data(){
126
 
127
  add_action( 'wp_ajax_amppb_remove_saved_layout_data', 'amppb_remove_saved_layout_data');
128
  function amppb_remove_saved_layout_data(){
129
-
130
- $layoutid = intval($_POST['layoutid']);
131
- $is_delete = wp_delete_post($layoutid);
132
- $allPostLayout = array();
133
- $args = array(
134
- 'posts_per_page' => 200,
135
- 'orderby' => 'date',
136
- 'order' => 'DESC',
137
- 'post_type' => 'amppb_layout',
138
- 'post_status' => 'publish'
139
- );
140
- $posts_array = get_posts( $args );
141
- if(count($posts_array)>0){
142
- foreach ($posts_array as $key => $layoutData) {
143
- $allPostLayout[] = array('post_title'=>$layoutData->post_title,
144
- 'post_id'=>$layoutData->ID,
145
- 'post_content'=>$layoutData->post_content,
146
- );
 
 
 
 
147
  }
148
- }
149
- if ( $is_delete ) {
150
- echo json_encode(array("status"=>200,"data"=>$allPostLayout));
151
- exit;
152
- }
153
- else{
154
- echo json_encode(array("status"=>404,"data"=>$allPostLayout));
 
 
 
155
  exit;
156
  }
157
  }
@@ -183,9 +190,10 @@ function ampforwp_get_image() {
183
  }
184
  }
185
  }else{
186
- $image = wp_get_attachment_image( $_GET['id'], 'full', false, array( 'id' => 'ampforwp-preview-image' ) );
187
- $image_src = ampforwp_get_attachment_id($_GET['id'],'thumbnail');
188
- $image_src_full = ampforwp_get_attachment_id($_GET['id'],'full');
 
189
  $svg = pathinfo($image_src_full[0], PATHINFO_EXTENSION) == 'svg' ? true : false;
190
  if ( $svg ) {
191
  $image_src_full[1] = 50;
46
  }else{
47
  echo json_encode(array('status'=>"500", 'Message'=>"post id not found"));
48
  }
49
+ if(isset($postId) && get_post_meta($postId,'use_ampforwp_page_builder', true)!=='yes' && current_user_can('edit_posts')){
50
  update_post_meta($postId, 'use_ampforwp_page_builder','yes');
51
  echo json_encode(array('status'=>200, 'Message'=>"Pagebuilder Started successfully"));
52
  }else{
126
 
127
  add_action( 'wp_ajax_amppb_remove_saved_layout_data', 'amppb_remove_saved_layout_data');
128
  function amppb_remove_saved_layout_data(){
129
+ check_ajax_referer( 'verify_pb', 'verify_nonce' );
130
+ $users = wp_get_current_user();
131
+ $roles = $users->roles;
132
+ if(in_array("administrator", $roles) || in_array("editor", $roles)||in_array("author", $roles)|| in_array("contributor", $roles)){
133
+ $layoutid = intval($_POST['layoutid']);
134
+ $is_delete = wp_delete_post($layoutid);
135
+ $allPostLayout = array();
136
+ $args = array(
137
+ 'posts_per_page' => 200,
138
+ 'orderby' => 'date',
139
+ 'order' => 'DESC',
140
+ 'post_type' => 'amppb_layout',
141
+ 'post_status' => 'publish'
142
+ );
143
+ $posts_array = get_posts( $args );
144
+ if(count($posts_array)>0){
145
+ foreach ($posts_array as $key => $layoutData) {
146
+ $allPostLayout[] = array('post_title'=>$layoutData->post_title,
147
+ 'post_id'=>$layoutData->ID,
148
+ 'post_content'=>$layoutData->post_content,
149
+ );
150
+ }
151
  }
152
+ if ( $is_delete ) {
153
+ echo json_encode(array("status"=>200,"data"=>$allPostLayout));
154
+ exit;
155
+ }
156
+ else{
157
+ echo json_encode(array("status"=>404,"data"=>$allPostLayout));
158
+ exit;
159
+ }
160
+ }else{
161
+ echo json_encode(array("status"=>403,"data"=>array()));
162
  exit;
163
  }
164
  }
190
  }
191
  }
192
  }else{
193
+ $id = intval($_GET['id']);
194
+ $image = wp_get_attachment_image( $id, 'full', false, array( 'id' => 'ampforwp-preview-image' ) );
195
+ $image_src = ampforwp_get_attachment_id($id,'thumbnail');
196
+ $image_src_full = ampforwp_get_attachment_id($id,'full');
197
  $svg = pathinfo($image_src_full[0], PATHINFO_EXTENSION) == 'svg' ? true : false;
198
  if ( $svg ) {
199
  $image_src_full[1] = 50;
pagebuilder/modules/contents-module.php CHANGED
@@ -6,7 +6,7 @@ add_filter('ampforwp_content_module_args','ampforwp_content_module_pagination',1
6
  function ampforwp_content_module_pagination($args, $fieldValues){
7
  if(isset($fieldValues['pagination']) && $fieldValues['pagination'] == 1 ){
8
  if( isset($_GET['pageno']) && $_GET['pageno']!=''){
9
- $paged = $_GET['pageno'];
10
  }else{
11
  $paged = 1;
12
  }
@@ -500,7 +500,7 @@ if ( is_admin() ) {
500
  /*Pagination Sart*/
501
  $total_num_pages = $the_query->max_num_pages;
502
  if(isset($_GET[$pagination_text]) && $_GET[$pagination_text]!='' ){
503
- $paged = $_GET[$pagination_text];
504
  }else{
505
  $paged = 1;
506
  }
6
  function ampforwp_content_module_pagination($args, $fieldValues){
7
  if(isset($fieldValues['pagination']) && $fieldValues['pagination'] == 1 ){
8
  if( isset($_GET['pageno']) && $_GET['pageno']!=''){
9
+ $paged = intval($_GET['pageno']);
10
  }else{
11
  $paged = 1;
12
  }
500
  /*Pagination Sart*/
501
  $total_num_pages = $the_query->max_num_pages;
502
  if(isset($_GET[$pagination_text]) && $_GET[$pagination_text]!='' ){
503
+ $paged = intval($_GET[$pagination_text]);
504
  }else{
505
  $paged = 1;
506
  }
readme.txt 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.2.2
7
- Stable tag: 0.9.98.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -189,6 +189,17 @@ You can contact us from [here](https://ampforwp.com/contact/)
189
 
190
  == Changelog ==
191
 
 
 
 
 
 
 
 
 
 
 
 
192
  = 0.9.98.5 (27th AUGUST 2019) =
193
  * Improvements: Compatibility integrated with CDN enabler #3515
194
  * Improvements: banner ux section of AMP panel settings improved #3470
@@ -218,12 +229,4 @@ You can contact us from [here](https://ampforwp.com/contact/)
218
  * Fixed: Woocommerce archives and shop page support should not be dependent on Archives [Category & Tags] option #3558
219
  * Fixed: noreferrer is getting added automatically, it should have what ever the user passes #3566
220
 
221
- = 0.9.98.4 (6th AUGUST 2019) =
222
- * Improvements: Pagebuilder Compatibility Options in 'AMP By Automattic' Addon Mode Settings #3507
223
- * Fixed: Design is breaking in swift theme when RTL option is enabled #3527
224
- * Fixed: Validation error when width and height is empty in the logo #3530
225
- * Fixed: 'Read more' link in excerpt for category module of AMP page builder #3510
226
- * Fixed: Mobile redirection causing extra redirects from /amp to /amp/ #3459
227
- * Fixed: "Recent Posts below Related Posts" option should show only when it is available for the theme #3528
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.2.2
7
+ Stable tag: 0.9.98.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
189
 
190
  == Changelog ==
191
 
192
+
193
+ = 0.9.98.6 (31th AUGUST 2019) =
194
+ * Improvements: Structured Data improvements #3567
195
+ * Improvements: Addthis share button's postion field in 1,2 and 3 designs #3553
196
+ * Fixed: Rare issue AMP settings are not getting saved showing popup error "There was a problem with your action. Please try again or reload the page." #3494
197
+ * Fixed: Plugin removes Telegram links #3578
198
+ * Fixed: amp-addthis validation error on pages #3580
199
+ * Fixed: Spot.IM Comments not working on all designs #3568
200
+ * Fixed: Incorrect title tags being generated #3565
201
+ * Fixed: Reduce the size of auto inline css. #3115
202
+
203
  = 0.9.98.5 (27th AUGUST 2019) =
204
  * Improvements: Compatibility integrated with CDN enabler #3515
205
  * Improvements: banner ux section of AMP panel settings improved #3470
229
  * Fixed: Woocommerce archives and shop page support should not be dependent on Archives [Category & Tags] option #3558
230
  * Fixed: noreferrer is getting added automatically, it should have what ever the user passes #3566
231
 
 
 
 
 
 
 
 
 
232
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
templates/design-manager.php CHANGED
@@ -21,14 +21,9 @@ if ( is_customize_preview() ) {
21
  $data = get_option( 'ampforwp_design' );
22
  // Adding default Value
23
  if ($data['elements'] == '') {
24
- $data['elements'] = "bread_crumbs:1,meta_info:1,title:1,featured_image:1,content:1,meta_taxonomy:1,social_icons:1,addthis:1,comments:1,related_posts:1";
25
  }
26
 
27
- if(strpos($data['elements'], 'addthis:1') === false){
28
- $addthis = substr_replace( $data['elements'], 'addthis:1,', 78, 0 );
29
- $data['elements'] = $addthis;
30
- }
31
-
32
  if( isset( $data['elements'] ) || ! empty( $data['elements'] ) ){
33
  $options = explode( ',', $data['elements'] );
34
  };
@@ -58,18 +53,13 @@ if ( is_customize_preview() ) {
58
  add_filter( 'ampforwp_design_elements', 'ampforwp_add_element_social_icons' );
59
  define('AMPFORWP_DM_SOCIAL_CHECK','true');
60
  break;
61
- case 'addthis:1':
62
- add_filter( 'ampforwp_design_elements', 'ampforwp_add_element_addthis' );
63
- break;
64
  case 'comments:1':
65
  add_filter( 'ampforwp_design_elements', 'ampforwp_add_element_comments' );
66
  break;
67
  case 'related_posts:1':
68
  add_filter( 'ampforwp_design_elements', 'ampforwp_add_element_related_posts' );
69
  break;
70
- // case 'comments:0':
71
- // add_filter( 'ampforwp_design_elements', 'ampforwp_add_element_simple_comment_button' );
72
- // break;
73
  }
74
  }
75
  }
@@ -266,18 +256,7 @@ function ampforwp_design_element_related_posts( $file, $type, $post ) {
266
  }
267
  return $file;
268
  }
269
- //Addthis
270
- function ampforwp_add_element_addthis( $meta_parts ) {
271
- $meta_parts[] = 'ampforwp-addthis';
272
- return $meta_parts;
273
- }
274
- add_filter( 'amp_post_template_file', 'ampforwp_design_element_addthis', 10, 3 );
275
- function ampforwp_design_element_addthis( $file, $type, $post ) {
276
- if ( 'ampforwp-addthis' === $type ) {
277
- $file = AMPFORWP_PLUGIN_DIR . 'templates/design-manager/design-'. ampforwp_design_selector() .'/elements/addthis.php' ;
278
- }
279
- return $file;
280
- }
281
  // Empty meta parts when Pagebuilder is enabled
282
  add_filter('ampforwp_design_elements', 'ampforwp_empty_design_elements', 12);
283
  function ampforwp_empty_design_elements($meta_parts) {
21
  $data = get_option( 'ampforwp_design' );
22
  // Adding default Value
23
  if ($data['elements'] == '') {
24
+ $data['elements'] = "bread_crumbs:1,meta_info:1,title:1,featured_image:1,content:1,meta_taxonomy:1,social_icons:1,comments:1,related_posts:1";
25
  }
26
 
 
 
 
 
 
27
  if( isset( $data['elements'] ) || ! empty( $data['elements'] ) ){
28
  $options = explode( ',', $data['elements'] );
29
  };
53
  add_filter( 'ampforwp_design_elements', 'ampforwp_add_element_social_icons' );
54
  define('AMPFORWP_DM_SOCIAL_CHECK','true');
55
  break;
 
 
 
56
  case 'comments:1':
57
  add_filter( 'ampforwp_design_elements', 'ampforwp_add_element_comments' );
58
  break;
59
  case 'related_posts:1':
60
  add_filter( 'ampforwp_design_elements', 'ampforwp_add_element_related_posts' );
61
  break;
62
+
 
 
63
  }
64
  }
65
  }
256
  }
257
  return $file;
258
  }
259
+
 
 
 
 
 
 
 
 
 
 
 
260
  // Empty meta parts when Pagebuilder is enabled
261
  add_filter('ampforwp_design_elements', 'ampforwp_empty_design_elements', 12);
262
  function ampforwp_empty_design_elements($meta_parts) {
templates/design-manager/design-1/archive.php CHANGED
@@ -48,7 +48,9 @@ global $redux_builder_amp, $wp; ?>
48
 
49
  <?php if ( is_archive() ) {
50
  if( is_author() ){
51
- $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
 
 
52
  if( true == ampforwp_gravatar_checker($curauth->user_email) ){
53
  $curauth_url = get_avatar_url( $curauth->user_email, array('size'=>180) );
54
  if($curauth_url){ ?>
48
 
49
  <?php if ( is_archive() ) {
50
  if( is_author() ){
51
+ $author_name = get_query_var('author_name');
52
+ $author = get_query_var('author');
53
+ $curauth = (get_query_var('author_name')) ? get_user_by('slug', esc_attr($author_name)) : get_userdata(esc_attr($author));
54
  if( true == ampforwp_gravatar_checker($curauth->user_email) ){
55
  $curauth_url = get_avatar_url( $curauth->user_email, array('size'=>180) );
56
  if($curauth_url){ ?>
templates/design-manager/design-1/elements/addthis.php DELETED
@@ -1,3 +0,0 @@
1
- <?php
2
- echo ampforwp_addThis_support();
3
- ?>
 
 
 
templates/design-manager/design-1/elements/bread-crumbs.php CHANGED
@@ -190,7 +190,7 @@ if ( ( (is_single() && 1 == ampforwp_get_setting('ampforwp-bread-crumb')) || (is
190
  // Get tag information
191
  $term_id = get_query_var('tag_id');
192
  $taxonomy = 'post_tag';
193
- $args = 'include=' . $term_id;
194
  $terms = get_terms( $taxonomy, $args );
195
  $get_term_id = $terms[0]->term_id;
196
  $get_term_slug = $terms[0]->slug;
190
  // Get tag information
191
  $term_id = get_query_var('tag_id');
192
  $taxonomy = 'post_tag';
193
+ $args = 'include=' . intval($term_id);
194
  $terms = get_terms( $taxonomy, $args );
195
  $get_term_id = $terms[0]->term_id;
196
  $get_term_slug = $terms[0]->slug;
templates/design-manager/design-1/elements/content.php CHANGED
@@ -2,9 +2,17 @@
2
  <?php do_action('ampforwp_before_content_hook',$this); ?>
3
 
4
  <div class="amp-wp-article-content">
 
 
 
 
5
  <div class="amp-wp-content the_content">
6
  <?php amp_content(); ?>
7
  </div>
 
 
 
 
8
  <!--Post Next-Previous Links-->
9
  <?php
10
  if($redux_builder_amp['enable-single-next-prev'] && !is_page() ) { ?>
2
  <?php do_action('ampforwp_before_content_hook',$this); ?>
3
 
4
  <div class="amp-wp-article-content">
5
+ <?php
6
+ if ( 'above-content' == ampforwp_get_setting('design-1-2-3-addthis-pos') ){
7
+ echo ampforwp_addThis_support();
8
+ } ?>
9
  <div class="amp-wp-content the_content">
10
  <?php amp_content(); ?>
11
  </div>
12
+ <?php
13
+ if ( 'below-content' == ampforwp_get_setting('design-1-2-3-addthis-pos') ){
14
+ echo ampforwp_addThis_support();
15
+ } ?>
16
  <!--Post Next-Previous Links-->
17
  <?php
18
  if($redux_builder_amp['enable-single-next-prev'] && !is_page() ) { ?>
templates/design-manager/design-2/archive.php CHANGED
@@ -51,7 +51,9 @@
51
  <div class="amp-wp-content amp-archive-heading">
52
  <?php
53
  if( is_author() ){
54
- $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
 
 
55
  if( true == ampforwp_gravatar_checker($curauth->user_email) ){
56
  $curauth_url = get_avatar_url( $curauth->user_email, array('size'=>180) );
57
  if($curauth_url){ ?>
51
  <div class="amp-wp-content amp-archive-heading">
52
  <?php
53
  if( is_author() ){
54
+ $author_name = get_query_var('author_name');
55
+ $author = get_query_var('author');
56
+ $curauth = (get_query_var('author_name')) ? get_user_by('slug', esc_attr($author_name)) : get_userdata(esc_attr($author));
57
  if( true == ampforwp_gravatar_checker($curauth->user_email) ){
58
  $curauth_url = get_avatar_url( $curauth->user_email, array('size'=>180) );
59
  if($curauth_url){ ?>
templates/design-manager/design-2/elements/addthis.php DELETED
@@ -1,3 +0,0 @@
1
- <?php
2
- echo ampforwp_addThis_support();
3
- ?>
 
 
 
templates/design-manager/design-2/elements/bread-crumbs.php CHANGED
@@ -188,7 +188,7 @@ if ( ( (is_single() && 1 == ampforwp_get_setting('ampforwp-bread-crumb')) || (is
188
  // Get tag information
189
  $term_id = get_query_var('tag_id');
190
  $taxonomy = 'post_tag';
191
- $args = 'include=' . $term_id;
192
  $terms = get_terms( $taxonomy, $args );
193
  $get_term_id = $terms[0]->term_id;
194
  $get_term_slug = $terms[0]->slug;
188
  // Get tag information
189
  $term_id = get_query_var('tag_id');
190
  $taxonomy = 'post_tag';
191
+ $args = 'include=' . intval($term_id);
192
  $terms = get_terms( $taxonomy, $args );
193
  $get_term_id = $terms[0]->term_id;
194
  $get_term_slug = $terms[0]->slug;
templates/design-manager/design-2/elements/content.php CHANGED
@@ -1,8 +1,17 @@
1
  <div class="amp-wp-article-content">
 
 
 
 
 
2
  <!--Post Content here-->
3
  <div class="amp-wp-content the_content">
4
  <?php amp_content(); ?>
5
  </div>
 
 
 
 
6
  <!--Post Content Ends here-->
7
 
8
  <!--Post Next-Previous Links-->
1
  <div class="amp-wp-article-content">
2
+ <?php
3
+
4
+ if ( 'above-content' == ampforwp_get_setting('design-1-2-3-addthis-pos') ){
5
+ echo ampforwp_addThis_support();
6
+ } ?>
7
  <!--Post Content here-->
8
  <div class="amp-wp-content the_content">
9
  <?php amp_content(); ?>
10
  </div>
11
+ <?php
12
+ if ( 'below-content' == ampforwp_get_setting('design-1-2-3-addthis-pos') ){
13
+ echo ampforwp_addThis_support();
14
+ } ?>
15
  <!--Post Content Ends here-->
16
 
17
  <!--Post Next-Previous Links-->
templates/design-manager/design-3/archive.php CHANGED
@@ -74,7 +74,9 @@ if ( get_query_var( 'paged' ) ) {
74
  <div class="amp-wp-content">
75
  <?php
76
  if( is_author() ){
77
- $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
 
 
78
  if( true == ampforwp_gravatar_checker($curauth->user_email) ){
79
  $curauth_url = get_avatar_url( $curauth->user_email, array('size'=>180) );
80
  if($curauth_url){ ?>
74
  <div class="amp-wp-content">
75
  <?php
76
  if( is_author() ){
77
+ $author_name = get_query_var('author_name');
78
+ $author = get_query_var('author');
79
+ $curauth = (get_query_var('author_name')) ? get_user_by('slug', esc_attr($author_name)) : get_userdata(esc_attr($author));
80
  if( true == ampforwp_gravatar_checker($curauth->user_email) ){
81
  $curauth_url = get_avatar_url( $curauth->user_email, array('size'=>180) );
82
  if($curauth_url){ ?>
templates/design-manager/design-3/elements/addthis.php DELETED
@@ -1,3 +0,0 @@
1
- <?php
2
- echo ampforwp_addThis_support();
3
- ?>
 
 
 
templates/design-manager/design-3/elements/bread-crumbs.php CHANGED
@@ -188,7 +188,7 @@ if ( ( (is_single() && 1 == ampforwp_get_setting('ampforwp-bread-crumb')) || (is
188
  // Get tag information
189
  $term_id = get_query_var('tag_id');
190
  $taxonomy = 'post_tag';
191
- $args = 'include=' . $term_id;
192
  $terms = get_terms( $taxonomy, $args );
193
  $get_term_id = $terms[0]->term_id;
194
  $get_term_slug = $terms[0]->slug;
188
  // Get tag information
189
  $term_id = get_query_var('tag_id');
190
  $taxonomy = 'post_tag';
191
+ $args = 'include=' . intval($term_id);
192
  $terms = get_terms( $taxonomy, $args );
193
  $get_term_id = $terms[0]->term_id;
194
  $get_term_slug = $terms[0]->slug;
templates/design-manager/design-3/elements/content.php CHANGED
@@ -1,11 +1,17 @@
1
  <div class="amp-wp-article-content">
2
-
 
 
 
3
  <!--Post Content here-->
4
  <div class="amp-wp-content the_content">
5
  <?php amp_content(); ?>
6
  </div>
7
  <!--Post Content Ends here-->
8
-
 
 
 
9
  <!--Post Next-Previous Links-->
10
  <?php global $redux_builder_amp;
11
  if($redux_builder_amp['enable-single-next-prev'] && !is_page() ) { ?>
1
  <div class="amp-wp-article-content">
2
+ <?php
3
+ if ( 'above-content' == ampforwp_get_setting('design-1-2-3-addthis-pos') ){
4
+ echo ampforwp_addThis_support();
5
+ } ?>
6
  <!--Post Content here-->
7
  <div class="amp-wp-content the_content">
8
  <?php amp_content(); ?>
9
  </div>
10
  <!--Post Content Ends here-->
11
+ <?php
12
+ if ( 'below-content' == ampforwp_get_setting('design-1-2-3-addthis-pos') ){
13
+ echo ampforwp_addThis_support();
14
+ } ?>
15
  <!--Post Next-Previous Links-->
16
  <?php global $redux_builder_amp;
17
  if($redux_builder_amp['enable-single-next-prev'] && !is_page() ) { ?>
templates/design-manager/swift/page.php CHANGED
@@ -57,12 +57,13 @@ amp_header(); ?>
57
  <?php amp_content(); ?>
58
  <?php } ?>
59
  </div>
60
- <?php if(!checkAMPforPageBuilderStatus(ampforwp_get_the_ID())){
 
 
 
 
61
  if( is_page() && true == ampforwp_get_setting('ampforwp-page-social') && 'above-content' != ampforwp_get_setting('swift-social-position') ) { ?>
62
- <div class="ss-ic"><?php
63
- if( ampforwp_get_setting('enable-add-this-option') && 'above-content' != ampforwp_get_setting('swift-add-this-position')) {
64
- echo ampforwp_addThis_support();
65
- } ?>
66
  <span class="shr-txt"><?php echo esc_attr(ampforwp_translation($redux_builder_amp['amp-translator-share-text'], 'Share' )); ?></span>
67
  <ul>
68
  <?php if($redux_builder_amp['enable-single-facebook-share']){?>
57
  <?php amp_content(); ?>
58
  <?php } ?>
59
  </div>
60
+ <?php if(!checkAMPforPageBuilderStatus(ampforwp_get_the_ID())){
61
+
62
+ if( ampforwp_get_setting('enable-add-this-option') && 'above-content' != ampforwp_get_setting('swift-add-this-position')) {
63
+ echo ampforwp_addThis_support();
64
+ }
65
  if( is_page() && true == ampforwp_get_setting('ampforwp-page-social') && 'above-content' != ampforwp_get_setting('swift-social-position') ) { ?>
66
+ <div class="ss-ic">
 
 
 
67
  <span class="shr-txt"><?php echo esc_attr(ampforwp_translation($redux_builder_amp['amp-translator-share-text'], 'Share' )); ?></span>
68
  <ul>
69
  <?php if($redux_builder_amp['enable-single-facebook-share']){?>
templates/features.php CHANGED
@@ -1208,8 +1208,16 @@ function ampforwp_remove_schema_data() {
1208
  remove_filter( 'post_thumbnail_html', 'publisher_lazy_loading_img_tags', 6 );
1209
  remove_filter( 'the_content', 'publisher_lazy_loading_img_tags', 6 );
1210
  }
 
 
 
 
 
1211
  }
1212
-
 
 
 
1213
  // 22. Removing author links from comments Issue #180
1214
  if( ! function_exists( 'ampforwp_disable_comment_author_links' ) ) {
1215
  function ampforwp_disable_comment_author_links( $author_link ){
@@ -1686,7 +1694,7 @@ function ampforwp_replace_title_tags() {
1686
  }
1687
 
1688
  //Genesis #1013
1689
- if(function_exists('genesis_title') && 'genesis' == ampforwp_get_setting('ampforwp-seo-selection') ){
1690
  if(is_home() && is_front_page() && !$redux_builder_amp['amp-frontpage-select-option']){
1691
  // Determine the doctitle.
1692
  $genesis_title = genesis_get_seo_option( 'home_doctitle' ) ? genesis_get_seo_option( 'home_doctitle' ) : get_bloginfo( 'name' );
@@ -1994,9 +2002,9 @@ function ampforwp_seopress_title_sanitize($title){
1994
  post_type_archive_title('', false),
1995
  get_the_archive_title(),
1996
  get_the_archive_title(),
1997
- get_query_var('day'),
1998
- get_query_var('monthnum'),
1999
- get_query_var('year'),
2000
  $woo_single_cat_html,
2001
  $woo_single_tag_html,
2002
  $seopress_get_the_excerpt,
@@ -6045,18 +6053,18 @@ function ampforwp_spotim_comments_support() {
6045
  }
6046
  }
6047
  function ampforwp_spotim_comments_markup() {
6048
- global $post, $redux_builder_amp;
6049
  $display_comments_on = false;
6050
  $display_comments_on = ampforwp_get_comments_status();
6051
  if (! $display_comments_on ) {
6052
  return '';
6053
  }
6054
  $spotId ='';
6055
- if( isset($redux_builder_amp['ampforwp-spotim-comments-apiKey']) && $redux_builder_amp['ampforwp-spotim-comments-apiKey'] !== ""){
6056
- $spotId = $redux_builder_amp['ampforwp-spotim-comments-apiKey'];
6057
  }
6058
- $srcUrl = 'https://amp.spot.im/production.html?';
6059
- $srcUrl = add_query_arg('spotId' ,get_permalink(), $srcUrl);
6060
  $srcUrl = add_query_arg('postId' , $post->ID, $srcUrl);
6061
  $spotim_html = '<amp-iframe width="375" height="815" resizable sandbox="allow-scripts allow-same-origin allow-popups allow-top-navigation" layout="responsive"
6062
  frameborder="0" src="'.esc_url($srcUrl).'">
1208
  remove_filter( 'post_thumbnail_html', 'publisher_lazy_loading_img_tags', 6 );
1209
  remove_filter( 'the_content', 'publisher_lazy_loading_img_tags', 6 );
1210
  }
1211
+ if(ampforwp_get_setting('ampforwp-seo-yoast-schema') == false && ampforwp_get_setting('ampforwp-seo-selection') == 'yoast'){
1212
+ if( class_exists('WPSEO_Schema') ){
1213
+ add_filter('wpseo_json_ld_output', 'ampforwp_remove_yoast_json', 10, 1);
1214
+ }
1215
+ }
1216
  }
1217
+ function ampforwp_remove_yoast_json($data){
1218
+ $data = array();
1219
+ return $data;
1220
+ }
1221
  // 22. Removing author links from comments Issue #180
1222
  if( ! function_exists( 'ampforwp_disable_comment_author_links' ) ) {
1223
  function ampforwp_disable_comment_author_links( $author_link ){
1694
  }
1695
 
1696
  //Genesis #1013
1697
+ if(function_exists('genesis_theme_support') && 'genesis' == ampforwp_get_setting('ampforwp-seo-selection') ){
1698
  if(is_home() && is_front_page() && !$redux_builder_amp['amp-frontpage-select-option']){
1699
  // Determine the doctitle.
1700
  $genesis_title = genesis_get_seo_option( 'home_doctitle' ) ? genesis_get_seo_option( 'home_doctitle' ) : get_bloginfo( 'name' );
2002
  post_type_archive_title('', false),
2003
  get_the_archive_title(),
2004
  get_the_archive_title(),
2005
+ esc_attr(get_query_var('day')),
2006
+ esc_attr(get_query_var('monthnum')),
2007
+ esc_attr(get_query_var('year')),
2008
  $woo_single_cat_html,
2009
  $woo_single_tag_html,
2010
  $seopress_get_the_excerpt,
6053
  }
6054
  }
6055
  function ampforwp_spotim_comments_markup() {
6056
+ global $post;
6057
  $display_comments_on = false;
6058
  $display_comments_on = ampforwp_get_comments_status();
6059
  if (! $display_comments_on ) {
6060
  return '';
6061
  }
6062
  $spotId ='';
6063
+ if( true == ampforwp_get_setting('ampforwp-spotim-comments-apiKey') && ampforwp_get_setting('ampforwp-spotim-comments-apiKey') !== ""){
6064
+ $spotId = ampforwp_get_setting('ampforwp-spotim-comments-apiKey');
6065
  }
6066
+ $srcUrl = 'https://amp.spot.im/production.html?spot_im_highlight_immediate=true';
6067
+ $srcUrl = add_query_arg('spotId' ,$spotId, $srcUrl);
6068
  $srcUrl = add_query_arg('postId' , $post->ID, $srcUrl);
6069
  $spotim_html = '<amp-iframe width="375" height="815" resizable sandbox="allow-scripts allow-same-origin allow-popups allow-top-navigation" layout="responsive"
6070
  frameborder="0" src="'.esc_url($srcUrl).'">