AMP for WP – Accelerated Mobile Pages - Version 1.0.43

Version Description

(28th April 2020) = * Improvement: Added option to hide category description #4388 * Improvement: Added option to remove Google index on paginated pages #4372 * Improvement: Added Filter for amp-carousel #4374 * Improvement: Code improvements in Related posts and Facebook instance article #4300 #4386 * Fixed: Fatal error with the latest update of yoast 14.0 #4412 * Fixed: AMP Lightbox is not working #4378 * Fixed: White spacing in the responsive mode on left side #4375 * Fixed: Video docking is not working in AMP. #4352 * Fixed: Shortcodes displaying in meta descrption #4385 * Fixed: Debug Warnings: count(): Parameter must be an array or an object that implements Countable. #4387

Download this release

Release Info

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

Code changes from version 1.0.42 to 1.0.43

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
7
- Stable tag: 1.0.42
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -194,6 +194,18 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
194
 
195
  == Changelog ==
196
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  = 1.0.42 (21st April 2020) =
198
  * Improvement: Added Comments module in our AMP page builder #4106
199
  * Improvement: Added CSS icons option #4268
@@ -209,25 +221,4 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
209
  = 1.0.41 (14th April 2020) =
210
  * Improvement: Video docking issue #4352
211
 
212
- = 1.0.40 (14th April 2020) =
213
- * Improvement: Added Filter to change post title tag #4339
214
- * Improvement: Added Rankmath's open external links option feature #4356
215
- * Improvement: Added Themify compatibility #4332
216
- * Improvement: Added AAWP for AMP extension #4337
217
- * Improvement: Added Formidable forms for AMP #4345
218
- * Improvement: Added Reading progress bar for AMP #4364
219
- * Improvement: Added hooks in header for all designs #4359
220
- * Improvement: Added option for one signal notificaion on the pages #4349
221
- * Fixed: Mobile redirection not working in the latest update #4336
222
- * Fixed: AMP option panel not working in Best brokers plugin #4330
223
- * Fixed: AMP option panel not working in custom theme of user #4353
224
- * Fixed: Table not looking good on mobiles #4309
225
- * Fixed: Double quotes in the font-family breaks default Typography #4328
226
- * Fixed: Featured images are getting streched in the amp version #4307
227
- * Fixed: The menu and article links not working after enabling GDPR #4340
228
- * Fixed: Facebook instance article is not working in plain permalink #4354
229
- * Fixed: Video docking is not working in AMP #4352
230
- * Fixed: There is no save button in AMP "Basic setup" #4343
231
- * Fixed: Debug warning #4341
232
-
233
  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
7
+ Stable tag: 1.0.43
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
194
 
195
  == Changelog ==
196
 
197
+ = 1.0.43 (28th April 2020) =
198
+ * Improvement: Added option to hide category description #4388
199
+ * Improvement: Added option to remove Google index on paginated pages #4372
200
+ * Improvement: Added Filter for amp-carousel #4374
201
+ * Improvement: Code improvements in Related posts and Facebook instance article #4300 #4386
202
+ * Fixed: Fatal error with the latest update of yoast 14.0 #4412
203
+ * Fixed: AMP Lightbox is not working #4378
204
+ * Fixed: White spacing in the responsive mode on left side #4375
205
+ * Fixed: Video docking is not working in AMP. #4352
206
+ * Fixed: Shortcodes displaying in meta descrption #4385
207
+ * Fixed: Debug Warnings: count(): Parameter must be an array or an object that implements Countable. #4387
208
+
209
  = 1.0.42 (21st April 2020) =
210
  * Improvement: Added Comments module in our AMP page builder #4106
211
  * Improvement: Added CSS icons option #4268
221
  = 1.0.41 (14th April 2020) =
222
  * Improvement: Video docking issue #4352
223
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
  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.42
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.42');
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.43
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.43');
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,17 @@
1
  == Changelog ==
2
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  = 1.0.42 (21st April 2020) =
4
  * Improvement: Added Comments module in our AMP page builder #4106
5
  * Improvement: Added CSS icons option #4268
1
  == Changelog ==
2
 
3
+ = 1.0.43 (28th April 2020) =
4
+ * Improvement: Added option to hide category description #4388
5
+ * Improvement: Added option to remove Google index on paginated pages #4372
6
+ * Improvement: Added Filter for amp-carousel #4374
7
+ * Improvement: Code improvements in Related posts and Facebook instance article #4300 #4386
8
+ * Fixed: Fatal error with the latest update of yoast 14.0 #4412
9
+ * Fixed: AMP Lightbox is not working #4378
10
+ * Fixed: White spacing in the responsive mode on left side #4375
11
+ * Fixed: Video docking is not working in AMP. #4352
12
+ * Fixed: Shortcodes displaying in meta descrption #4385
13
+ * Fixed: Debug Warnings: count(): Parameter must be an array or an object that implements Countable. #4387
14
+
15
  = 1.0.42 (21st April 2020) =
16
  * Improvement: Added Comments module in our AMP page builder #4106
17
  * Improvement: Added CSS icons option #4268
classes/class-ampforwp-rev-slider.php CHANGED
@@ -340,18 +340,22 @@ class AMP_Rev_Slider_Embed_Handler extends AMPforWP\AMPVendor\AMP_Base_Embed_Han
340
 
341
  //replacements
342
  $r = rand(1,100);
343
- $amp_carousel = AMP_HTML_Utils::build_tag(
344
- 'amp-carousel',
345
- array(
346
  'width' => $this->args['width'],
347
  'height' => $this->args['height'],
348
  'type' => 'slides',
349
- 'loop' =>'',
350
- 'autoplay' =>'',
351
  'layout' => 'responsive',
352
  'class' => 'collapsible-captions',
353
  'id' => 'carousel-with-carousel-preview-'.$r
354
- ),
 
 
 
 
 
 
 
355
  implode( PHP_EOL, $images ));
356
 
357
  $amp_carousel_with_thumbnail_nav = apply_filters('amp_thumbnail_images', $amp_images_small, $r, $markup);
340
 
341
  //replacements
342
  $r = rand(1,100);
343
+
344
+ $carousel_args = array(
 
345
  'width' => $this->args['width'],
346
  'height' => $this->args['height'],
347
  'type' => 'slides',
 
 
348
  'layout' => 'responsive',
349
  'class' => 'collapsible-captions',
350
  'id' => 'carousel-with-carousel-preview-'.$r
351
+ );
352
+ $c_args = array('loop'=>'', 'autoplay'=>'');
353
+ $carousel_filter = apply_filters('ampforwp_carousel_args',$c_args);
354
+ $carousel_args = array_merge($carousel_args,$carousel_filter);
355
+
356
+ $amp_carousel = AMP_HTML_Utils::build_tag(
357
+ 'amp-carousel',
358
+ $carousel_args,
359
  implode( PHP_EOL, $images ));
360
 
361
  $amp_carousel_with_thumbnail_nav = apply_filters('amp_thumbnail_images', $amp_images_small, $r, $markup);
classes/class-ampforwp-slide-anything-embed.php CHANGED
@@ -252,18 +252,21 @@ class AMPFORWP_Slide_Anything_Embed_Handler extends AMPforWP\AMPVendor\AMP_Base_
252
 
253
  //replacements
254
  $r = rand(1,100);
255
- $amp_carousel = AMP_HTML_Utils::build_tag(
256
- 'amp-carousel',
257
- array(
258
  'width' => $this->args['width'],
259
  'height' => $this->args['height'],
260
  'type' => 'slides',
261
- 'loop' =>'',
262
- 'autoplay' =>'',
263
  'layout' => 'responsive',
264
  'class' => 'collapsible-captions',
265
  'id' => 'carousel-with-carousel-preview-'.$r
266
- ),
 
 
 
 
 
 
 
267
  implode( PHP_EOL, $images ));
268
 
269
  $amp_carousel_with_thumbnail_nav = apply_filters('amp_thumbnail_images', $amp_images_small, $r, $markup);
252
 
253
  //replacements
254
  $r = rand(1,100);
255
+ $carousel_args = array(
 
 
256
  'width' => $this->args['width'],
257
  'height' => $this->args['height'],
258
  'type' => 'slides',
 
 
259
  'layout' => 'responsive',
260
  'class' => 'collapsible-captions',
261
  'id' => 'carousel-with-carousel-preview-'.$r
262
+ );
263
+ $c_args = array('loop'=>'', 'autoplay'=>'');
264
+ $carousel_filter = apply_filters('ampforwp_carousel_args',$c_args);
265
+ $carousel_args = array_merge($carousel_args,$carousel_filter);
266
+
267
+ $amp_carousel = AMP_HTML_Utils::build_tag(
268
+ 'amp-carousel',
269
+ $carousel_args,
270
  implode( PHP_EOL, $images ));
271
 
272
  $amp_carousel_with_thumbnail_nav = apply_filters('amp_thumbnail_images', $amp_images_small, $r, $markup);
components/loop/loop.php CHANGED
@@ -46,7 +46,7 @@ function amp_archive_title(){
46
  } else {
47
  $paged = 1;
48
  }
49
- if($paged <= '1') {?>
50
  <div class="amp-archive-desc">
51
  <?php echo do_shortcode($arch_desc);// amphtml content, no kses ?>
52
  </div> <?php
46
  } else {
47
  $paged = 1;
48
  }
49
+ if($paged <= '1' && ampforwp_get_setting('ampforwp-cat-description')) {?>
50
  <div class="amp-archive-desc">
51
  <?php echo do_shortcode($arch_desc);// amphtml content, no kses ?>
52
  </div> <?php
feeds/instant-article-feed.php CHANGED
@@ -34,8 +34,8 @@ header('Content-Type: ' . esc_attr(feed_content_type('rss2')) . '; charset=' . e
34
  'no_found_rows' => true,
35
  'meta_query' => array(
36
  array(
37
- 'value' => 'hide-ia',
38
- 'compare' => "!="
39
  ),
40
  )
41
  );
34
  'no_found_rows' => true,
35
  'meta_query' => array(
36
  array(
37
+ 'key' => 'ampforwp-ia-on-off',
38
+ 'value' => 'default',
39
  ),
40
  )
41
  );
includes/admin-script.js CHANGED
@@ -177,6 +177,47 @@ jQuery(function($) {
177
  }
178
  });
179
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
  $(".redux_field_search").keypress(function (evt) {
181
  //Deterime where our character code is coming from within the event
182
  var charCode = evt.charCode || evt.keyCode;
177
  }
178
  });
179
 
180
+ $("#ampforwp-refersh-related-post").on('click', function(){
181
+ var ref_nonce = $(this).attr('data-nonce');
182
+ var current_post = parseInt($(this).attr('data-id'));
183
+ var elem = document.getElementById("ref_rel_post_bar");
184
+ var first_int = setInterval(first_frame, 1000);
185
+ var width = current_post;
186
+ width++;
187
+ elem.style.width = width + '%';
188
+ elem.innerHTML = width * 1 + '%';
189
+ function first_frame() {
190
+ width++;
191
+ elem.style.width = width + '%';
192
+ elem.innerHTML = width * 1 + '%';
193
+ }
194
+ $.ajax({
195
+ url: ajaxurl,
196
+ method: 'post',
197
+ data: {
198
+ action: 'ampforwp_referesh_related_post',
199
+ verify_nonce: ref_nonce
200
+ },
201
+ success: function(response){
202
+ clearInterval(first_int);
203
+ response = response.replace("}0", "}");
204
+ var resp = JSON.parse(response);
205
+ resp = parseInt(resp.response);
206
+ var id = setInterval(frame, 10);
207
+ var width = current_post;
208
+ function frame() {
209
+ if (width >= resp) {
210
+ clearInterval(id);
211
+ } else {
212
+ width++;
213
+ elem.style.width = width + '%';
214
+ elem.innerHTML = width * 1 + '%';
215
+ }
216
+ }
217
+ }
218
+ });
219
+
220
+ });
221
  $(".redux_field_search").keypress(function (evt) {
222
  //Deterime where our character code is coming from within the event
223
  var charCode = evt.charCode || evt.keyCode;
includes/admin-style.css CHANGED
@@ -2073,4 +2073,17 @@ fieldset#redux_builder_amp-ampforwp-onesignal-positioning {
2073
  }
2074
  .ux-field-container.amp-ux-text-container {
2075
  padding: 10px 0 0 15px;
 
 
 
 
 
 
 
 
 
 
 
 
 
2076
  }
2073
  }
2074
  .ux-field-container.amp-ux-text-container {
2075
  padding: 10px 0 0 15px;
2076
+ }
2077
+ .redux-field-container .ref-rel-bar-cont{
2078
+ background-color:#d0d3d4;
2079
+ color: black;
2080
+ position: relative;
2081
+ top: 5px;
2082
+ border-radius: 5px;
2083
+ }
2084
+ .redux-field-container .ref-rel-post-bar{
2085
+ background-color: #4CAF50;
2086
+ text-align: center;
2087
+ color: white;
2088
+ border-radius: 5px;
2089
  }
includes/features/functions.php CHANGED
@@ -259,7 +259,7 @@ function ampforwp_generate_meta_desc($json=""){
259
  if ( is_archive() ) {
260
  $desc = addslashes( strip_tags( get_the_archive_description() ) );
261
  }
262
- if ( is_single() || is_page() ) {
263
  if ( has_excerpt() ) {
264
  $desc = get_the_excerpt();
265
  } else {
@@ -272,10 +272,6 @@ function ampforwp_generate_meta_desc($json=""){
272
  if ( is_search() ) {
273
  $desc = addslashes( ampforwp_translation($redux_builder_amp['amp-translator-search-text'], 'You searched for:') . ' ' . get_search_query() );
274
  }
275
- if ( ampforwp_is_front_page() ) {
276
- $desc = addslashes( wp_trim_words( strip_tags( get_post_field('post_content', $post_id) ) , 15 ) );
277
- }
278
-
279
  // Yoast
280
  if ( class_exists('WPSEO_Frontend') && ('yoast' == ampforwp_get_setting('ampforwp-seo-selection') || 1 == ampforwp_get_setting('ampforwp-seo-selection'))) {
281
  $front = $yoast_desc = '';
259
  if ( is_archive() ) {
260
  $desc = addslashes( strip_tags( get_the_archive_description() ) );
261
  }
262
+ if ( is_single() || is_page() || ampforwp_is_front_page()) {
263
  if ( has_excerpt() ) {
264
  $desc = get_the_excerpt();
265
  } else {
272
  if ( is_search() ) {
273
  $desc = addslashes( ampforwp_translation($redux_builder_amp['amp-translator-search-text'], 'You searched for:') . ' ' . get_search_query() );
274
  }
 
 
 
 
275
  // Yoast
276
  if ( class_exists('WPSEO_Frontend') && ('yoast' == ampforwp_get_setting('ampforwp-seo-selection') || 1 == ampforwp_get_setting('ampforwp-seo-selection'))) {
277
  $front = $yoast_desc = '';
includes/options/admin-config.php CHANGED
@@ -2156,6 +2156,13 @@ function ampforwp_get_all_tags($id){
2156
  'layout_type' => 'accordion',
2157
  'accordion-open'=> 1,
2158
  ),
 
 
 
 
 
 
 
2159
  array(
2160
  'id' => 'amp-inspection-tool',
2161
  'type' => 'switch',
@@ -2820,6 +2827,13 @@ Redux::setSection( $opt_name, array(
2820
  'tooltip-subtitle' => esc_html__('Enable if you want hide AMP version in view source page(generator).','accelerated-mobile-pages'),
2821
  'default' => 0,
2822
  ),
 
 
 
 
 
 
 
2823
  array(
2824
  'id' => 'ampforwp-smooth-scrolling-for-links',
2825
  'type' => 'switch',
@@ -5517,6 +5531,14 @@ Redux::setSection( $opt_name, array(
5517
  )
5518
  ));
5519
  if(!is_plugin_active( 'amp-newspaper-theme/ampforwp-custom-theme.php' ) ){
 
 
 
 
 
 
 
 
5520
  $single_page_options = array(
5521
  array(
5522
  'id' => 'ampforwp-single_section_1',
@@ -6177,6 +6199,19 @@ $single_page_options = array(
6177
  'default' => '7',
6178
  'required' => array('ampforwp-in-content-related-posts-days-switch', '=' , '1'),
6179
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
6180
  $jetpack_rp,
6181
  array(
6182
  'id' => 'single-tab-2',
@@ -6191,7 +6226,6 @@ $single_page_options = array(
6191
  'id' => 'ampforwp-amp-img-lightbox',
6192
  'type' => 'switch',
6193
  'default' => '0',
6194
- 'class' => 'hide',
6195
  'title' => esc_html__('Lightbox for Images', 'accelerated-mobile-pages'),
6196
  'tooltip-subtitle' => sprintf('%s <a href="%s" target="_blank">%s</a> %s',
6197
  esc_html__('Enable this option to show lightbox for images in AMP and', 'accelerated-mobile-pages'), esc_url('https://ampforwp.com/tutorials/article/how-to-enable-lightbox-in-amp/'),esc_html__('Click Here','accelerated-mobile-pages'), esc_html__('for more info','accelerated-mobile-pages')),
2156
  'layout_type' => 'accordion',
2157
  'accordion-open'=> 1,
2158
  ),
2159
+ array(
2160
+ 'id' => 'amp-paginated-pages-indexing',
2161
+ 'type' => 'switch',
2162
+ 'title' => esc_html__('Remove Paginated Pages Indexing', 'accelerated-mobile-pages'),
2163
+ 'tooltip-subtitle' => sprintf( '%s<a href="%s" target="_blank">%s</a>', esc_html__("You can read more about it ",'accelerated-mobile-pages'),esc_url('https://ampforwp.com/tutorials/article/how-to-remove-paginated-pages-indexing-in-amp/'),esc_html__('here','accelerated-mobile-pages')),
2164
+ 'default' => 0,
2165
+ ),
2166
  array(
2167
  'id' => 'amp-inspection-tool',
2168
  'type' => 'switch',
2827
  'tooltip-subtitle' => esc_html__('Enable if you want hide AMP version in view source page(generator).','accelerated-mobile-pages'),
2828
  'default' => 0,
2829
  ),
2830
+ array(
2831
+ 'id' => 'ampforwp-cat-description',
2832
+ 'type' => 'switch',
2833
+ 'title' => esc_html__('Category Description', 'accelerated-mobile-pages'),
2834
+ 'tooltip-subtitle' => esc_html__('Disable this option if you dont want to show category description in AMP','accelerated-mobile-pages'),
2835
+ 'default' => 1,
2836
+ ),
2837
  array(
2838
  'id' => 'ampforwp-smooth-scrolling-for-links',
2839
  'type' => 'switch',
5531
  )
5532
  ));
5533
  if(!is_plugin_active( 'amp-newspaper-theme/ampforwp-custom-theme.php' ) ){
5534
+ function ampforwp_get_post_percent(){
5535
+ return 0;
5536
+ }
5537
+ $post_percent = 0;
5538
+ $current_page = ampforwp_get_admin_current_page();
5539
+ if($current_page=="amp_options"){
5540
+ $post_percent = ampforwp_get_post_percent();
5541
+ }
5542
  $single_page_options = array(
5543
  array(
5544
  'id' => 'ampforwp-single_section_1',
6199
  'default' => '7',
6200
  'required' => array('ampforwp-in-content-related-posts-days-switch', '=' , '1'),
6201
  ),
6202
+ array(
6203
+ 'id' => 'ampforwp-refersh-related-post',
6204
+ 'type' => 'raw',
6205
+ 'class' => 'hide',
6206
+ 'title' => esc_html__('Refresh Related Post', 'accelerated-mobile-pages'),
6207
+ 'content' => "<span class='button button-primary button-small' id='ampforwp-refersh-related-post' target='_blank' data-id='".intval($post_percent)."' data-nonce='".wp_create_nonce( 'ampforwp_refresh_related_poost')."'><i class='el el-refresh'></i> Refresh</span>
6208
+ <div class='ref-rel-bar-cont'>
6209
+ <div id='ref_rel_post_bar' class='ref-rel-post-bar' style='width:".intval($post_percent)."%;'>".intval($post_percent)."%</div>
6210
+ </div>",
6211
+ 'tooltip-subtitle' => esc_html__('If related post is not showing up properly, please refresh it and check it once again.', 'accelerated-mobile-pages'),
6212
+ 'full_width' => false,
6213
+ 'description' => "It will refresh only 50 records at once, please try refreshing until it will complete to 100%",
6214
+ ),
6215
  $jetpack_rp,
6216
  array(
6217
  'id' => 'single-tab-2',
6226
  'id' => 'ampforwp-amp-img-lightbox',
6227
  'type' => 'switch',
6228
  'default' => '0',
 
6229
  'title' => esc_html__('Lightbox for Images', 'accelerated-mobile-pages'),
6230
  'tooltip-subtitle' => sprintf('%s <a href="%s" target="_blank">%s</a> %s',
6231
  esc_html__('Enable this option to show lightbox for images in AMP and', 'accelerated-mobile-pages'), esc_url('https://ampforwp.com/tutorials/article/how-to-enable-lightbox-in-amp/'),esc_html__('Click Here','accelerated-mobile-pages'), esc_html__('for more info','accelerated-mobile-pages')),
includes/vendor/amp/includes/embeds/class-amp-gallery-embed.php CHANGED
@@ -247,19 +247,22 @@ class AMP_Gallery_Embed_Handler extends AMP_Base_Embed_Handler {
247
 
248
  //replacements
249
  $r = rand(1,100);
250
- $amp_carousel = AMP_HTML_Utils::build_tag(
251
- 'amp-carousel',
252
- array(
253
  'width' => $this->args['width'],
254
  'height' => $this->args['height'],
255
  'type' => 'slides',
256
- 'loop' =>'',
257
- 'autoplay' =>'',
258
  'controls' =>'',
259
  'layout' => 'responsive',
260
  'class' => 'collapsible-captions',
261
  'id' => 'carousel-with-carousel-preview-'.$r
262
- ),
 
 
 
 
 
 
 
263
  implode( PHP_EOL, $images ));
264
 
265
  $amp_carousel_with_thumbnail_nav = apply_filters('amp_thumbnail_images', $amp_images_small, $r, $markup);
247
 
248
  //replacements
249
  $r = rand(1,100);
250
+ $carousel_args = array(
 
 
251
  'width' => $this->args['width'],
252
  'height' => $this->args['height'],
253
  'type' => 'slides',
 
 
254
  'controls' =>'',
255
  'layout' => 'responsive',
256
  'class' => 'collapsible-captions',
257
  'id' => 'carousel-with-carousel-preview-'.$r
258
+ );
259
+ $c_args = array('loop'=>'', 'autoplay'=>'');
260
+ $carousel_filter = apply_filters('ampforwp_carousel_args',$c_args);
261
+ $carousel_args = array_merge($carousel_args,$carousel_filter);
262
+
263
+ $amp_carousel = AMP_HTML_Utils::build_tag(
264
+ 'amp-carousel',
265
+ $carousel_args,
266
  implode( PHP_EOL, $images ));
267
 
268
  $amp_carousel_with_thumbnail_nav = apply_filters('amp_thumbnail_images', $amp_images_small, $r, $markup);
includes/vendor/amp/includes/sanitizers/class-amp-gallery-block-sanitizer-5-3.php CHANGED
@@ -342,18 +342,23 @@ class AMP_Gallery_Block_Sanitizer extends AMP_Base_Sanitizer {
342
  }
343
  if ( 2 == ampforwp_get_setting('ampforwp-gallery-design-type') ) {
344
  $button_nodes = array();
345
- $amp_carousel_thumbnail = AMP_DOM_Utils::create_node(
346
- $this->dom,
347
- 'amp-carousel',
348
- array(
349
  'width' => 'auto',
350
  'height' => 48,
351
  'type' => 'carousel',
352
- 'loop' => '',
353
- 'autoplay' => '',
354
  'layout' => 'fixed-height',
355
  'class' => 'carousel-preview'
356
- )
 
 
 
 
 
 
 
 
 
357
  );
358
  foreach ($amp_images_small as $key => $value) {
359
  $button_node = AMP_DOM_Utils::create_node(
342
  }
343
  if ( 2 == ampforwp_get_setting('ampforwp-gallery-design-type') ) {
344
  $button_nodes = array();
345
+
346
+ $carousel_args = array(
 
 
347
  'width' => 'auto',
348
  'height' => 48,
349
  'type' => 'carousel',
 
 
350
  'layout' => 'fixed-height',
351
  'class' => 'carousel-preview'
352
+ );
353
+
354
+ $c_args = array('loop'=>'', 'autoplay'=>'');
355
+ $carousel_filter = apply_filters('ampforwp_carousel_args',$c_args);
356
+ $carousel_args = array_merge($carousel_args,$carousel_filter);
357
+
358
+ $amp_carousel_thumbnail = AMP_DOM_Utils::create_node(
359
+ $this->dom,
360
+ 'amp-carousel',
361
+ $carousel_args
362
  );
363
  foreach ($amp_images_small as $key => $value) {
364
  $button_node = AMP_DOM_Utils::create_node(
includes/vendor/amp/includes/sanitizers/class-amp-gallery-block-sanitizer.php CHANGED
@@ -324,18 +324,21 @@ class AMP_Gallery_Block_Sanitizer extends AMP_Base_Sanitizer {
324
  //replacements
325
  $r = rand(1,100);
326
  if ( 3 != ampforwp_get_setting('ampforwp-gallery-design-type') ){
327
- $amp_carousel = AMP_DOM_Utils::create_node($this->dom,
328
- 'amp-carousel',
329
- array(
330
  'width' => 600,
331
  'height' => 480,
332
  'type' => 'slides',
333
- 'loop' => '',
334
- 'autoplay' => '',
335
  'layout' => 'responsive',
336
  'class' => 'collapsible-captions',
337
  'id' => 'carousel-with-carousel-preview-'.$r
338
- )
 
 
 
 
 
 
 
339
  );
340
  foreach ($amp_images as $amp_image) {
341
  $amp_carousel->appendChild( $amp_image );
@@ -343,19 +346,21 @@ class AMP_Gallery_Block_Sanitizer extends AMP_Base_Sanitizer {
343
  }
344
 
345
  if ( 2 == ampforwp_get_setting('ampforwp-gallery-design-type') ) {
346
- $button_nodes = array();
347
- $amp_carousel_thumbnail = AMP_DOM_Utils::create_node(
348
- $this->dom,
349
- 'amp-carousel',
350
- array(
351
  'width' => 'auto',
352
  'height' => 48,
353
  'type' => 'carousel',
354
- 'loop' => '',
355
- 'autoplay' => '',
356
  'layout' => 'fixed-height',
357
  'class' => 'carousel-preview'
358
- )
 
 
 
 
 
 
 
 
359
  );
360
  foreach ($amp_images_small as $key => $value) {
361
  $button_node = AMP_DOM_Utils::create_node(
324
  //replacements
325
  $r = rand(1,100);
326
  if ( 3 != ampforwp_get_setting('ampforwp-gallery-design-type') ){
327
+ $carousel_args = array(
 
 
328
  'width' => 600,
329
  'height' => 480,
330
  'type' => 'slides',
 
 
331
  'layout' => 'responsive',
332
  'class' => 'collapsible-captions',
333
  'id' => 'carousel-with-carousel-preview-'.$r
334
+ );
335
+ $c_args = array('loop'=>'', 'autoplay'=>'');
336
+ $carousel_filter = apply_filters('ampforwp_carousel_args',$c_args);
337
+ $carousel_args = array_merge($carousel_args,$carousel_filter);
338
+
339
+ $amp_carousel = AMP_DOM_Utils::create_node($this->dom,
340
+ 'amp-carousel',
341
+ $carousel_args
342
  );
343
  foreach ($amp_images as $amp_image) {
344
  $amp_carousel->appendChild( $amp_image );
346
  }
347
 
348
  if ( 2 == ampforwp_get_setting('ampforwp-gallery-design-type') ) {
349
+ $carousel_args = array(
 
 
 
 
350
  'width' => 'auto',
351
  'height' => 48,
352
  'type' => 'carousel',
 
 
353
  'layout' => 'fixed-height',
354
  'class' => 'carousel-preview'
355
+ );
356
+ $c_args = array('loop'=>'', 'autoplay'=>'');
357
+ $carousel_filter = apply_filters('ampforwp_carousel_args',$c_args);
358
+ $carousel_args = array_merge($carousel_args,$carousel_filter);
359
+ $button_nodes = array();
360
+ $amp_carousel_thumbnail = AMP_DOM_Utils::create_node(
361
+ $this->dom,
362
+ 'amp-carousel',
363
+ $carousel_args
364
  );
365
  foreach ($amp_images_small as $key => $value) {
366
  $button_node = AMP_DOM_Utils::create_node(
pagebuilder/amp-page-builder.php CHANGED
@@ -85,7 +85,7 @@ function ampforwp_call_page_builder(){
85
  $totalmodules = 1;
86
  if(!empty($previousData)){
87
  $jsonData = json_decode($previousData,true);
88
- if(count($jsonData['rows'])>0){
89
  $totalRows = $jsonData['totalrows'];
90
  $totalmodules = $jsonData['totalmodules'];
91
  $previousData = json_encode($jsonData);
85
  $totalmodules = 1;
86
  if(!empty($previousData)){
87
  $jsonData = json_decode($previousData,true);
88
+ if(is_array($jsonData) && count($jsonData['rows'])>0){
89
  $totalRows = $jsonData['totalrows'];
90
  $totalmodules = $jsonData['totalmodules'];
91
  $previousData = json_encode($jsonData);
pagebuilder/inc/viewShowFrontData.php CHANGED
@@ -585,7 +585,7 @@ function amppb_post_content($content){
585
  $html ="";
586
  $previousData = json_decode($previousData,true);
587
  //Call Sorting for rows
588
- if(count($previousData['rows'])>0){
589
  $mainContentClass = '';
590
  if(isset($previousData['settingdata']) && isset($previousData['settingdata']['front_class'])){
591
  $mainContentClass = $previousData['settingdata']['front_class'];
585
  $html ="";
586
  $previousData = json_decode($previousData,true);
587
  //Call Sorting for rows
588
+ if(is_array($previousData) && count($previousData['rows'])>0){
589
  $mainContentClass = '';
590
  if(isset($previousData['settingdata']) && isset($previousData['settingdata']['front_class'])){
591
  $mainContentClass = $previousData['settingdata']['front_class'];
pagebuilder/modules/contents-module.php CHANGED
@@ -114,6 +114,13 @@ function ampforwp_content_module_pagination($args, $fieldValues){
114
  }
115
  {{ifend_condition_content_layout_type_1}}
116
  ';
 
 
 
 
 
 
 
117
  $options = '<option value="recent_option">Recent Posts</option>';
118
  $post_types = '';
119
  $categoriesArray = array();
114
  }
115
  {{ifend_condition_content_layout_type_1}}
116
  ';
117
+ if(ampforwp_get_setting('amp-design-selector') == 3 || ampforwp_get_setting('amp-design-selector') == 2){
118
+ $frontCss .= '@media (max-width: 480px){
119
+ {{module-class}} .cm ul{
120
+ width:80%;
121
+ }
122
+ }';
123
+ }
124
  $options = '<option value="recent_option">Recent Posts</option>';
125
  $post_types = '';
126
  $categoriesArray = array();
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.4
7
- Stable tag: 1.0.42
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -191,6 +191,18 @@ You can contact us from [here](https://ampforwp.com/contact/)
191
 
192
  == Changelog ==
193
 
 
 
 
 
 
 
 
 
 
 
 
 
194
  = 1.0.42 (21st April 2020) =
195
  * Improvement: Added Comments module in our AMP page builder #4106
196
  * Improvement: Added CSS icons option #4268
@@ -206,25 +218,4 @@ You can contact us from [here](https://ampforwp.com/contact/)
206
  = 1.0.41 (14th April 2020) =
207
  * Improvement: Video docking issue #4352
208
 
209
- = 1.0.40 (14th April 2020) =
210
- * Improvement: Added Filter to change post title tag #4339
211
- * Improvement: Added Rankmath's open external links option feature #4356
212
- * Improvement: Added Themify compatibility #4332
213
- * Improvement: Added AAWP for AMP extension #4337
214
- * Improvement: Added Formidable forms for AMP #4345
215
- * Improvement: Added Reading progress bar for AMP #4364
216
- * Improvement: Added hooks in header for all designs #4359
217
- * Improvement: Added option for one signal notificaion on the pages #4349
218
- * Fixed: Mobile redirection not working in the latest update #4336
219
- * Fixed: AMP option panel not working in Best brokers plugin #4330
220
- * Fixed: AMP option panel not working in custom theme of user #4353
221
- * Fixed: Table not looking good on mobiles #4309
222
- * Fixed: Double quotes in the font-family breaks default Typography #4328
223
- * Fixed: Featured images are getting streched in the amp version #4307
224
- * Fixed: The menu and article links not working after enabling GDPR #4340
225
- * Fixed: Facebook instance article is not working in plain permalink #4354
226
- * Fixed: Video docking is not working in AMP #4352
227
- * Fixed: There is no save button in AMP "Basic setup" #4343
228
- * Fixed: Debug warning #4341
229
-
230
  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
7
+ Stable tag: 1.0.43
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
191
 
192
  == Changelog ==
193
 
194
+ = 1.0.43 (28th April 2020) =
195
+ * Improvement: Added option to hide category description #4388
196
+ * Improvement: Added option to remove Google index on paginated pages #4372
197
+ * Improvement: Added Filter for amp-carousel #4374
198
+ * Improvement: Code improvements in Related posts and Facebook instance article #4300 #4386
199
+ * Fixed: Fatal error with the latest update of yoast 14.0 #4412
200
+ * Fixed: AMP Lightbox is not working #4378
201
+ * Fixed: White spacing in the responsive mode on left side #4375
202
+ * Fixed: Video docking is not working in AMP. #4352
203
+ * Fixed: Shortcodes displaying in meta descrption #4385
204
+ * Fixed: Debug Warnings: count(): Parameter must be an array or an object that implements Countable. #4387
205
+
206
  = 1.0.42 (21st April 2020) =
207
  * Improvement: Added Comments module in our AMP page builder #4106
208
  * Improvement: Added CSS icons option #4268
218
  = 1.0.41 (14th April 2020) =
219
  * Improvement: Video docking issue #4352
220
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
templates/design-manager/design-1/archive.php CHANGED
@@ -78,7 +78,7 @@ global $redux_builder_amp, $wp; ?>
78
  } else {
79
  $paged = 1;
80
  }
81
- if($paged <= '1') {?>
82
  <div class="amp-wp-content taxonomy-description">
83
  <?php echo do_shortcode($arch_desc);// amphtml content, no kses ?>
84
  </div> <?php
78
  } else {
79
  $paged = 1;
80
  }
81
+ if($paged <= '1' && ampforwp_get_setting('ampforwp-cat-description')) {?>
82
  <div class="amp-wp-content taxonomy-description">
83
  <?php echo do_shortcode($arch_desc);// amphtml content, no kses ?>
84
  </div> <?php
templates/design-manager/design-2/archive.php CHANGED
@@ -81,7 +81,7 @@ if ( ! defined( 'ABSPATH' ) ) {
81
  } else {
82
  $paged = 1;
83
  }
84
- if($paged <= '1') {?>
85
  <div class="amp-wp-content taxonomy-description">
86
  <?php echo do_shortcode($arch_desc);// amphtml content, no kses ?>
87
  </div> <?php
81
  } else {
82
  $paged = 1;
83
  }
84
+ if($paged <= '1' && ampforwp_get_setting('ampforwp-cat-description')) {?>
85
  <div class="amp-wp-content taxonomy-description">
86
  <?php echo do_shortcode($arch_desc);// amphtml content, no kses ?>
87
  </div> <?php
templates/design-manager/design-3/archive.php CHANGED
@@ -98,7 +98,7 @@ if ( get_query_var( 'paged' ) ) {
98
  }
99
  $arch_desc = $sanitizer->get_amp_content();
100
  if( $arch_desc ) {
101
- if($paged <= '1') {?>
102
  <div class="taxonomy-description">
103
  <?php echo do_shortcode($arch_desc);// amphtml content, no kses ?>
104
  </div>
98
  }
99
  $arch_desc = $sanitizer->get_amp_content();
100
  if( $arch_desc ) {
101
+ if($paged <= '1' && ampforwp_get_setting('ampforwp-cat-description')) {?>
102
  <div class="taxonomy-description">
103
  <?php echo do_shortcode($arch_desc);// amphtml content, no kses ?>
104
  </div>
templates/features.php CHANGED
@@ -205,6 +205,9 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
205
  if( is_attachment() ) {
206
  return;
207
  }
 
 
 
208
  if( is_home() && is_front_page() && !ampforwp_get_setting('ampforwp-homepage-on-off-support') ) {
209
  return;
210
  }
@@ -1497,7 +1500,7 @@ function ampforwp_yoast_social_desc($type) {
1497
  function ampforwp_custom_og_url_homepage() {
1498
  return esc_url( get_bloginfo( 'url' ) );
1499
  }
1500
- function ampforwp_custom_twitter_image_homepage($image){
1501
  $twitter = $WPSEO_get = '';
1502
  $WPSEO_Options = WPSEO_Options::get_instance();
1503
  if( method_exists($WPSEO_Options, 'get') ){
@@ -1545,10 +1548,13 @@ function ampforwp_custom_og_image_homepage() {
1545
  'height' => '500',
1546
  );
1547
  }
1548
- $wpseo_og->og_tag( 'og:image', esc_url( $image_url ) );
1549
- foreach ( $image_tags as $key => $value ) {
1550
- if ( ! empty( $value ) ) {
1551
- $wpseo_og->og_tag( 'og:image:' . $key, $value );
 
 
 
1552
  }
1553
  }
1554
  }
@@ -1644,8 +1650,11 @@ function ampforwp_replace_title_tags() {
1644
  }
1645
 
1646
  // Yoast SEO Title compatibility #2871
1647
- if( class_exists('WPSEO_Frontend') && ('yoast' || 1) == ampforwp_get_setting('ampforwp-seo-selection') ) {
1648
- $yoast_title = $WPSEO_Frontend = '';
 
 
 
1649
  $WPSEO_Frontend = WPSEO_Frontend::get_instance();
1650
  $yoast_title = $WPSEO_Frontend->title($site_title);
1651
  if ( ampforwp_is_home() ) {
@@ -1656,7 +1665,7 @@ function ampforwp_replace_title_tags() {
1656
  $yoast_title = $WPSEO_Frontend->get_content_title( $post );
1657
  }
1658
  if ( $yoast_title ) {
1659
- $site_title = apply_filters( 'wpseo_title', $yoast_title );
1660
  }
1661
  }
1662
 
@@ -6053,7 +6062,7 @@ if ( ! function_exists('ampforwp_amp_img_lightbox') ) {
6053
  add_filter('amp_img_attributes', 'ampforwp_img_new_attrs');
6054
  function ampforwp_img_new_attrs($attributes) {
6055
  global $redux_builder_amp;
6056
- if ( isset($redux_builder_amp['ampforwp-amp-img-lightbox']) && $redux_builder_amp['ampforwp-amp-img-lightbox'] ) {
6057
  $attributes['on'] = 'tap:amp-img-lightbox';
6058
  $attributes['role'] = 'button';
6059
  $attributes['tabindex'] = '0';
@@ -8038,8 +8047,8 @@ function ampforwp_include_required_scripts($content){
8038
  $content = str_replace('<head>', $script_tag, $content);
8039
  }
8040
  }else{
8041
- if(preg_match('/<amp-video(.*?) dock|dock=">/', $content)){
8042
- $content = preg_replace('/<amp-video(.*?) dock|dock=">/','<amp-video $1>', $content);
8043
  }
8044
  }
8045
  }
@@ -8281,3 +8290,62 @@ function ampforwp_rank_math_external_link_newtab($content){
8281
  }
8282
  return $content;
8283
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
205
  if( is_attachment() ) {
206
  return;
207
  }
208
+ if(get_query_var('paged') && true == ampforwp_get_setting('amp-paginated-pages-indexing')) {
209
+ return;
210
+ }
211
  if( is_home() && is_front_page() && !ampforwp_get_setting('ampforwp-homepage-on-off-support') ) {
212
  return;
213
  }
1500
  function ampforwp_custom_og_url_homepage() {
1501
  return esc_url( get_bloginfo( 'url' ) );
1502
  }
1503
+ function ampforwp_custom_twitter_image_homepage(){
1504
  $twitter = $WPSEO_get = '';
1505
  $WPSEO_Options = WPSEO_Options::get_instance();
1506
  if( method_exists($WPSEO_Options, 'get') ){
1548
  'height' => '500',
1549
  );
1550
  }
1551
+
1552
+ if ( method_exists($wpseo_og, 'og_tag') ) {
1553
+ $wpseo_og->og_tag( 'og:image', esc_url( $image_url ) );
1554
+ foreach ( $image_tags as $key => $value ) {
1555
+ if ( ! empty( $value ) ) {
1556
+ $wpseo_og->og_tag( 'og:image:' . $key, $value );
1557
+ }
1558
  }
1559
  }
1560
  }
1650
  }
1651
 
1652
  // Yoast SEO Title compatibility #2871
1653
+ if( class_exists('WPSEO_Frontend') && ('yoast' || 1) == ampforwp_get_setting('ampforwp-seo-selection') ) {
1654
+ $yoast_title = $WPSEO_Frontend = $yoast_instance = '';
1655
+
1656
+ $yoast_instance = new \Yoast\WP\SEO\Presentations\Indexable_Presentation();
1657
+
1658
  $WPSEO_Frontend = WPSEO_Frontend::get_instance();
1659
  $yoast_title = $WPSEO_Frontend->title($site_title);
1660
  if ( ampforwp_is_home() ) {
1665
  $yoast_title = $WPSEO_Frontend->get_content_title( $post );
1666
  }
1667
  if ( $yoast_title ) {
1668
+ $site_title = apply_filters( 'wpseo_title', $yoast_title, $yoast_instance );
1669
  }
1670
  }
1671
 
6062
  add_filter('amp_img_attributes', 'ampforwp_img_new_attrs');
6063
  function ampforwp_img_new_attrs($attributes) {
6064
  global $redux_builder_amp;
6065
+ if ( ampforwp_get_setting('ampforwp-amp-img-lightbox') ) {
6066
  $attributes['on'] = 'tap:amp-img-lightbox';
6067
  $attributes['role'] = 'button';
6068
  $attributes['tabindex'] = '0';
8047
  $content = str_replace('<head>', $script_tag, $content);
8048
  }
8049
  }else{
8050
+ if(preg_match('/<amp-youtube(.*?) dock|dock=">/', $content)){
8051
+ $content = preg_replace('/<amp-youtube(.*?) dock|dock=">/','<amp-youtube $1>', $content);
8052
  }
8053
  }
8054
  }
8290
  }
8291
  return $content;
8292
  }
8293
+ /* add_action( 'wp_ajax_ampforwp_referesh_related_post', 'ampforwp_referesh_related_post' );
8294
+ function ampforwp_referesh_related_post(){
8295
+ if(!wp_verify_nonce($_POST['verify_nonce'],'ampforwp_refresh_related_poost') ){
8296
+ echo json_encode(array('status'=>403,'message'=>'user request is not allowed')) ;
8297
+ die;
8298
+ }
8299
+ $orderby = 'ID';
8300
+ if( true == ampforwp_get_setting('ampforwp-single-order-of-related-posts')){
8301
+ $orderby = 'rand';
8302
+ }
8303
+ $args=array(
8304
+ 'fields' => 'ids',
8305
+ 'post_type' => 'post',
8306
+ 'posts_per_page'=> '50',
8307
+ 'orderby' => $orderby,
8308
+ 'ignore_sticky_posts'=>1,
8309
+ 'has_password' => false ,
8310
+ 'post_status'=> 'publish',
8311
+ 'no_found_rows' => true,
8312
+ 'meta_query' => array(
8313
+ array(
8314
+ 'key' => 'ampforwp-amp-on-off',
8315
+ 'compare' => 'NOT EXISTS',
8316
+ )
8317
+ )
8318
+ );
8319
+ $my_query = new wp_query( $args );
8320
+ while( $my_query->have_posts() ) {
8321
+ $my_query->the_post();
8322
+ update_post_meta(get_the_ID(),'ampforwp-amp-on-off','default');
8323
+ }
8324
+ $args=array(
8325
+ 'fields' => 'ids',
8326
+ 'post_status' => 'publish',
8327
+ 'ignore_sticky_posts' => true,
8328
+ 'posts_per_page' => 50,
8329
+ 'no_found_rows' => true,
8330
+ 'meta_query' => array(
8331
+ array(
8332
+ 'key' => 'ampforwp-ia-on-off',
8333
+ 'compare' => 'NOT EXISTS',
8334
+ )
8335
+ )
8336
+ );
8337
+ $my_query = new wp_query( $args );
8338
+ while( $my_query->have_posts() ) {
8339
+ $my_query->the_post();
8340
+ update_post_meta(get_the_ID(),'ampforwp-ia-on-off','default');
8341
+ }
8342
+ delete_transient('ampforwp_get_not_meta_post_count');
8343
+ $data['response'] = ampforwp_get_post_percent();
8344
+ echo json_encode($data);
8345
+ }
8346
+ add_action( 'save_post', 'ampforwp_delete_refresh_related_post_trans');
8347
+ function ampforwp_delete_refresh_related_post_trans(){
8348
+ delete_transient('ampforwp_get_not_meta_post_count');
8349
+ delete_transient('ampforwp_get_total_post_count');
8350
+ }
8351
+ */