AMP for WP – Accelerated Mobile Pages - Version 0.9.97.14

Version Description

(4th September 2018) = * Added: Adobe Analytics Support #887 * Fixed: Same Icons loading for some extensions #2172 * Fixed: Removed extra spacing from "Back to top" text #2349 * Fixed: Retina featured images support for Homepage and archive loop images #2334 * Fixed: When WooCommerce Product Slider is Installed, the Picture of Icons are not loading #2325 * Added: Customizr Theme Lazy Loading compatibility #2322 * Fixed: "Save Module" button of AMP page Builder not displaying in OSX and in Safari #1943 * Fixed: Sort Related Posts Randomly Not Working in Swift theme #2308 * Added: Need to create a tutorial of How to Enter your Audience Network Placement ID of advertisement in the Instant Article #1723 * Fixed: Retina Images option Improvement-II #2296 * Fixed: Disable the look or check of redux framework #2293 * Fixed: With Redux core plugin, AMP option panel design not loading #2258 * Fixed: Issues with pagination #2253 * Added: Thrive Architect Compatible #1575 * Fixed: Notice Undefined variable categories_array #2486 * Fixed: Need to add upscale parameter in-line related posts #2488 * Fixed: Getting the warnings in error log due to global variable, not present #2395 * Fixed: Google Analytic issue while setting up Run Installation wizard #2491 * Added: Read more button AKA Content Sneak Peek feature for post #2246 * Added: Showing related items/post in after nth paragraph #2246

Download this release

Release Info

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

Code changes from version 0.9.97.13 to 0.9.97.14

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: 4.9.8
7
- Stable tag: 0.9.97.13
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -183,12 +183,33 @@ You can contact us from [here](https://ampforwp.com/contact/)
183
 
184
  == Changelog ==
185
 
186
- = 0.9.97.13 (27th August 2018) =
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  * Fixed: Fatal error in `ampforwp_related_post_loop_query()`
188
 
189
  = 0.9.97.12 (27th August 2018) =
190
  * Fixed: Quote runs only in block post not on pages #2399
191
-
192
  * Added: Create a Sidebar option that can be used as global Sidebar #2388
193
  * Fixed: words are breaking and not readable #2441
194
  * Fixed: Text is breaking into next line while there is no space between the text in custom AMP Editor #2270
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 4.9.8
7
+ Stable tag: 0.9.97.14
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
183
 
184
  == Changelog ==
185
 
186
+ = 0.9.97.14 (4th September 2018) =
187
+ * Added: Adobe Analytics Support #887
188
+ * Fixed: Same Icons loading for some extensions #2172
189
+ * Fixed: Removed extra spacing from "Back to top" text #2349
190
+ * Fixed: Retina featured images support for Homepage and archive loop images #2334
191
+ * Fixed: When WooCommerce Product Slider is Installed, the Picture of Icons are not loading #2325
192
+ * Added: Customizr Theme Lazy Loading compatibility #2322
193
+ * Fixed: "Save Module" button of AMP page Builder not displaying in OSX and in Safari #1943
194
+ * Fixed: Sort Related Posts Randomly Not Working in Swift theme #2308
195
+ * Added: Need to create a tutorial of How to Enter your Audience Network Placement ID of advertisement in the Instant Article #1723
196
+ * Fixed: Retina Images option Improvement-II #2296
197
+ * Fixed: Disable the look or check of redux framework #2293
198
+ * Fixed: With Redux core plugin, AMP option panel design not loading #2258
199
+ * Fixed: Issues with pagination #2253
200
+ * Added: Thrive Architect Compatible #1575
201
+ * Fixed: Notice Undefined variable categories_array #2486
202
+ * Fixed: Need to add upscale parameter in-line related posts #2488
203
+ * Fixed: Getting the warnings in error log due to global variable, not present #2395
204
+ * Fixed: Google Analytic issue while setting up Run Installation wizard #2491
205
+ * Added: Read more button AKA Content Sneak Peek feature for post #2246
206
+ * Added: Showing related items/post in after nth paragraph #2246
207
+
208
+ = 0.9.97.13 (28th August 2018) =
209
  * Fixed: Fatal error in `ampforwp_related_post_loop_query()`
210
 
211
  = 0.9.97.12 (27th August 2018) =
212
  * Fixed: Quote runs only in block post not on pages #2399
 
213
  * Added: Create a Sidebar option that can be used as global Sidebar #2388
214
  * Fixed: words are breaking and not readable #2441
215
  * Fixed: Text is breaking into next line while there is no space between the text in custom AMP Editor #2270
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.97.13
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
@@ -19,7 +19,7 @@ define('AMPFORWP_PLUGIN_DIR_URI', plugin_dir_url(__FILE__));
19
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
20
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
21
  define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
22
- define('AMPFORWP_VERSION','0.9.97.13');
23
  // any changes to AMP_QUERY_VAR should be refelected here
24
  function ampforwp_generate_endpoint(){
25
  $ampforwp_slug = '';
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.97.14
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
19
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
20
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
21
  define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
22
+ define('AMPFORWP_VERSION','0.9.97.14');
23
  // any changes to AMP_QUERY_VAR should be refelected here
24
  function ampforwp_generate_endpoint(){
25
  $ampforwp_slug = '';
components/related-posts/related-posts.php CHANGED
@@ -7,8 +7,8 @@ function ampforwp_framework_get_related_posts($argsdata=array()){
7
  global $post, $redux_builder_amp;
8
  $show_image = (isset($argsdata['show_image']) ? $argsdata['show_image'] : true);
9
  $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-related-posts'];
10
- $int_number_of_related_posts = round(abs(floatval($string_number_of_related_posts)));
11
- $my_query = related_post_loop_query();
12
  if ( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_builder_amp['ampforwp-single-related-posts-switch'] ) {
13
  if( $my_query->have_posts() ) { ?>
14
  <div class="amp-related-posts">
@@ -43,12 +43,15 @@ function ampforwp_framework_get_related_posts($argsdata=array()){
43
  }
44
  }
45
 
46
- function related_post_loop_query(){
47
  global $post, $redux_builder_amp;
48
  $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-related-posts'];
49
- $int_number_of_related_posts = round(abs(floatval($string_number_of_related_posts)));
50
  $args = null;
51
-
 
 
 
52
  if($redux_builder_amp['ampforwp-single-select-type-of-related']==2){
53
  $categories = get_the_category($post->ID);
54
  if ($categories) {
@@ -59,6 +62,7 @@ function related_post_loop_query(){
59
  'category__in' => $category_ids,
60
  'post__not_in' => array($post->ID),
61
  'posts_per_page'=> $int_number_of_related_posts,
 
62
  'ignore_sticky_posts'=>1,
63
  'has_password' => false ,
64
  'post_status'=> 'publish'
@@ -77,10 +81,12 @@ function related_post_loop_query(){
77
  'tag__in' => $tag_ids,
78
  'post__not_in' => array($post->ID),
79
  'posts_per_page'=> $int_number_of_related_posts,
 
80
  'ignore_sticky_posts'=>1,
81
  'has_password' => false ,
82
  'post_status'=> 'publish'
83
  );
 
84
  }
85
  }
86
  // Related Posts Based on Past few Days #2132
@@ -97,6 +103,7 @@ function related_post_loop_query(){
97
  );
98
  }
99
  $my_query = new wp_query( $args );
 
100
  return $my_query;
101
  }
102
 
@@ -130,6 +137,14 @@ function ampforwp_get_relatedpost_image( $imagetype ='thumbnail', $data=array()
130
  if(empty($height)){
131
  $height = $thumb_url_array_2[2];
132
  }
 
 
 
 
 
 
 
 
133
  $thumb_url_array = ampforwp_aq_resize( $thumb_url, $width, $height, true, false, true ); //resize & crop the image
134
  $thumb_url = $thumb_url_array[0];
135
  $thumb_width = $thumb_url_array[1];
@@ -145,7 +160,13 @@ function ampforwp_get_relatedpost_image( $imagetype ='thumbnail', $data=array()
145
  }
146
 
147
  function ampforwp_get_relatedpost_content($argsdata=array()){
148
- $related_post_permalink = ampforwp_url_controller( get_permalink() ); ?>
 
 
 
 
 
 
149
  <div class="related_link">
150
  <a href="<?php echo esc_url( $related_post_permalink ); ?>"><?php the_title(); ?></a>
151
  <?php
7
  global $post, $redux_builder_amp;
8
  $show_image = (isset($argsdata['show_image']) ? $argsdata['show_image'] : true);
9
  $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-related-posts'];
10
+ $int_number_of_related_posts = (int)$string_number_of_related_posts;
11
+ $my_query = ampforwp_related_post_loop_query();
12
  if ( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_builder_amp['ampforwp-single-related-posts-switch'] ) {
13
  if( $my_query->have_posts() ) { ?>
14
  <div class="amp-related-posts">
43
  }
44
  }
45
 
46
+ function ampforwp_related_post_loop_query(){
47
  global $post, $redux_builder_amp;
48
  $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-related-posts'];
49
+ $int_number_of_related_posts = (int)$string_number_of_related_posts;
50
  $args = null;
51
+ $orderby = 'ID';
52
+ if( isset( $redux_builder_amp['ampforwp-single-order-of-related-posts'] ) && $redux_builder_amp['ampforwp-single-order-of-related-posts'] ){
53
+ $orderby = 'rand';
54
+ }
55
  if($redux_builder_amp['ampforwp-single-select-type-of-related']==2){
56
  $categories = get_the_category($post->ID);
57
  if ($categories) {
62
  'category__in' => $category_ids,
63
  'post__not_in' => array($post->ID),
64
  'posts_per_page'=> $int_number_of_related_posts,
65
+ 'orderby' => $orderby,
66
  'ignore_sticky_posts'=>1,
67
  'has_password' => false ,
68
  'post_status'=> 'publish'
81
  'tag__in' => $tag_ids,
82
  'post__not_in' => array($post->ID),
83
  'posts_per_page'=> $int_number_of_related_posts,
84
+ 'orderby' => $orderby,
85
  'ignore_sticky_posts'=>1,
86
  'has_password' => false ,
87
  'post_status'=> 'publish'
88
  );
89
+
90
  }
91
  }
92
  // Related Posts Based on Past few Days #2132
103
  );
104
  }
105
  $my_query = new wp_query( $args );
106
+
107
  return $my_query;
108
  }
109
 
137
  if(empty($height)){
138
  $height = $thumb_url_array_2[2];
139
  }
140
+ if ( isset($redux_builder_amp['ampforwp-retina-images']) && true == $redux_builder_amp['ampforwp-retina-images'] ) {
141
+ $resolution = 2;
142
+ if ( isset($redux_builder_amp['ampforwp-retina-images-res']) && $redux_builder_amp['ampforwp-retina-images-res'] ) {
143
+ $resolution = $redux_builder_amp['ampforwp-retina-images-res'];
144
+ }
145
+ $width = $width * $resolution;
146
+ $height = $height * $resolution;
147
+ }
148
  $thumb_url_array = ampforwp_aq_resize( $thumb_url, $width, $height, true, false, true ); //resize & crop the image
149
  $thumb_url = $thumb_url_array[0];
150
  $thumb_width = $thumb_url_array[1];
160
  }
161
 
162
  function ampforwp_get_relatedpost_content($argsdata=array()){
163
+ global $redux_builder_amp;
164
+ if ( isset($redux_builder_amp['ampforwp-single-related-posts-link']) && true == $redux_builder_amp['ampforwp-single-related-posts-link'] ) {
165
+ $related_post_permalink = get_permalink();
166
+ } else {
167
+ $related_post_permalink = ampforwp_url_controller( get_permalink() );
168
+ }
169
+ ?>
170
  <div class="related_link">
171
  <a href="<?php echo esc_url( $related_post_permalink ); ?>"><?php the_title(); ?></a>
172
  <?php
images/amplayouts.png ADDED
Binary file
images/bbp-icon.png ADDED
Binary file
images/edd-icon.png ADDED
Binary file
images/polylang-icon.png ADDED
Binary file
images/pwa-icon.png ADDED
Binary file
images/sd-icon.png ADDED
Binary file
images/teaser-icon.png ADDED
Binary file
images/wpml-icon.png ADDED
Binary file
includes/admin-script.js CHANGED
@@ -346,10 +346,10 @@ jQuery(function($) {
346
  // Adding Default Font Family
347
  $('#s2id_amp_font_selector-select a').removeClass('select2-default');
348
 
349
- $('#select2-chosen-3').html(redux_data.amp_font_selector);
350
  if(redux_data.amp_font_selector==''){
351
  redux_data.amp_font_selector = 'Poppins'
352
  }
 
353
 
354
  $('#amp_font_selector-select option[value="'+redux_data.amp_font_selector+'"]').attr("selected", "selected");
355
  $('#amp_font_selector-select').select2('val',redux_data.amp_font_selector).trigger("change");
346
  // Adding Default Font Family
347
  $('#s2id_amp_font_selector-select a').removeClass('select2-default');
348
 
 
349
  if(redux_data.amp_font_selector==''){
350
  redux_data.amp_font_selector = 'Poppins'
351
  }
352
+ $('#s2id_amp_font_selector-select .select2-chosen').html(redux_data.amp_font_selector);
353
 
354
  $('#amp_font_selector-select option[value="'+redux_data.amp_font_selector+'"]').attr("selected", "selected");
355
  $('#amp_font_selector-select').select2('val',redux_data.amp_font_selector).trigger("change");
includes/options/admin-config.php CHANGED
@@ -81,7 +81,7 @@ $extension_listing_array = array(
81
  array(
82
  'name'=>'bbPress For AMP',
83
  'desc'=>'Add bbPress Forum Compatibility to your AMP version',
84
- 'img_src'=>AMPFORWP_IMAGE_DIR . '/cache-icon.png',
85
  'price'=>'$89',
86
  'url_link'=>'http://ampforwp.com/bbpress/#utm_source=options-panel&utm_medium=extension-tab_bbpress-for-wordpress&utm_campaign=AMP%20Plugin',
87
  'plugin_active_path'=> 'bbpress-for-amp/bbpress-for-amp.php',
@@ -140,7 +140,7 @@ $extension_listing_array = array(
140
  array(
141
  'name'=>'PWA For WordPress',
142
  'desc'=>'Add Progressive Web App support for WordPress website',
143
- 'img_src'=>AMPFORWP_IMAGE_DIR . '/cache-icon.png',
144
  'price'=>'$89',
145
  'url_link'=>'http://ampforwp.com/pwa/#utm_source=options-panel&utm_medium=extension-tab_pwa-for-wordpress&utm_campaign=AMP%20Plugin',
146
  'plugin_active_path'=> 'pwa-for-wordpress/amp-pwa.php',
@@ -166,7 +166,7 @@ $extension_listing_array = array(
166
  'desc'=>'Advanced WooCommerce in AMP in two clicks.',
167
  'img_src'=>AMPFORWP_IMAGE_DIR . '/woo.png',
168
  'price'=>'$79',
169
- 'url_link'=>'https://ampforwp.com/woocommerce/',
170
  'plugin_active_path'=> 'amp-woocommerce-pro/amp-woocommerce.php',
171
  'item_name'=>'WooCommerce',
172
  'store_url'=>'https://accounts.ampforwp.com',
@@ -177,9 +177,9 @@ $extension_listing_array = array(
177
  array(
178
  'name'=> 'EDD for AMP',
179
  'desc'=> 'EDD compatibility with AMP',
180
- 'img_src'=> AMPFORWP_IMAGE_DIR . '/click.png',
181
  'price'=> '$19',
182
- 'url_link'=>'https://ampforwp.com/edd-for-amp/',
183
  'plugin_active_path'=> 'edd-for-amp/edd-for-amp.php',
184
  'item_name'=>'EDD for AMP',
185
  'store_url'=>'https://accounts.ampforwp.com',
@@ -188,10 +188,10 @@ $extension_listing_array = array(
188
 
189
  array(
190
  'name'=>'AMP Layouts',
191
- 'desc'=>'layout system built for AMP that makes easy to create your own AMP templates.',
192
- 'img_src'=>AMPFORWP_IMAGE_DIR . '/email.png',
193
  'price'=>'$89',
194
- 'url_link'=>'https://ampforwp.com/amp-layouts/',
195
  'plugin_active_path'=> 'amp-layouts/amp-layouts.php',
196
  'item_name'=>'AMP Layouts',
197
  'store_url'=>'https://accounts.ampforwp.com',
@@ -204,7 +204,7 @@ $extension_listing_array = array(
204
  'desc'=>'Advanced News Magazine theme built for AMP.',
205
  'img_src'=>AMPFORWP_IMAGE_DIR . '/click.png',
206
  'price'=>'$49',
207
- 'url_link'=>'https://ampforwp.com/themes/newspaper/',
208
  'plugin_active_path'=> 'amp-newspaper-theme/ampforwp-custom-theme.php',
209
  'item_name'=>'Newspaper Theme for AMP',
210
  'store_url'=>'https://accounts.ampforwp.com',
@@ -227,9 +227,9 @@ $extension_listing_array = array(
227
  array(
228
  'name'=>'AMP Comments',
229
  'desc'=>'You can now allow the same comment functionality on AMP.',
230
- 'img_src'=>AMPFORWP_IMAGE_DIR . '/click.png',
231
  'price'=>'$29.99',
232
- 'url_link'=>'https://ampforwp.com/amp-comments/',
233
  'plugin_active_path'=> 'amp-comments/amp-comments.php',
234
  'item_name'=>'AMP Comments',
235
  'store_url'=>'https://accounts.ampforwp.com',
@@ -266,7 +266,7 @@ $extension_listing_array = array(
266
  'desc'=>'A Revolutionary new way to share your stories',
267
  'img_src'=>AMPFORWP_IMAGE_DIR . '/cache-icon.png',
268
  'price'=>'$79',
269
- 'url_link'=>'http://ampforwp.com/amp-stories/#utm_source=options-panel&utm_medium=extension-tab_stories&utm_campaign=AMP%20Plugin',
270
  'plugin_active_path'=> 'amp-stories/ampforwp-stories.php',
271
  'item_name'=>'AMP Stories',
272
  'store_url'=>'https://accounts.ampforwp.com',
@@ -276,9 +276,9 @@ $extension_listing_array = array(
276
  array(
277
  'name'=>'Structured Data for WP',
278
  'desc'=>'Structured Data for your site and for AMP',
279
- 'img_src'=>AMPFORWP_IMAGE_DIR . '/click.png',
280
  'price'=>'$29',
281
- 'url_link'=>'https://ampforwp.com/structuredata-for-wp/',
282
  'plugin_active_path'=> 'structured-data-for-wp/structured-data-for-wp.php',
283
  'item_name'=>'Structured Data for WP',
284
  'store_url'=>'https://accounts.ampforwp.com',
@@ -288,9 +288,9 @@ $extension_listing_array = array(
288
  array(
289
  'name'=>'Polylang For AMP',
290
  'desc'=>'Polylang compatibility with AMP',
291
- 'img_src'=>AMPFORWP_IMAGE_DIR . '/click.png',
292
  'price'=>'$19',
293
- 'url_link'=>'https://ampforwp.com/polylang-for-amp/',
294
  'plugin_active_path'=> 'polylang-for-amp/amp_polylang.php',
295
  'item_name'=>'Polylang For AMP',
296
  'store_url'=>'https://accounts.ampforwp.com',
@@ -299,9 +299,9 @@ $extension_listing_array = array(
299
  array(
300
  'name'=>'WPML For AMP',
301
  'desc'=>'WPML compatibility with AMP',
302
- 'img_src'=>AMPFORWP_IMAGE_DIR . '/click.png',
303
  'price'=>'$19',
304
- 'url_link'=>'https://ampforwp.com/wpml-for-amp/',
305
  'plugin_active_path'=> 'wpml-for-amp/wpml_for_amp.php',
306
  'item_name'=>'WPML For AMP',
307
  'store_url'=>'https://accounts.ampforwp.com',
@@ -310,9 +310,9 @@ $extension_listing_array = array(
310
  array(
311
  'name'=>'AMP Teaser',
312
  'desc'=>'AMP Teaser automatically clips the content based on your selection',
313
- 'img_src'=>AMPFORWP_IMAGE_DIR . '/click.png',
314
  'price'=>'$29',
315
- 'url_link'=>'https://ampforwp.com/amp-teaser/',
316
  'plugin_active_path'=> 'amp-teaser/amp-teaser.php',
317
  'item_name'=>'AMP Teaser',
318
  'store_url'=>'https://accounts.ampforwp.com',
@@ -2040,6 +2040,7 @@ Redux::setArgs( "redux_builder_amp", $args );
2040
  '10' => __('Chartbeat Analytics', 'accelerated-mobile-pages'),
2041
  '11' => __('Alexa Metrics', 'accelerated-mobile-pages'),
2042
  '12' => __('AFS Analytics', 'accelerated-mobile-pages'),
 
2043
  ),
2044
  'required' => array(
2045
  array('amp-use-gtm-option', '=' , '0'),
@@ -2136,7 +2137,7 @@ Redux::setArgs( "redux_builder_amp", $args );
2136
  'type' => 'switch',
2137
  'title' => __( 'Google Tag Manager', 'accelerated-mobile-pages' ),
2138
  'tooltip-subtitle' => __( 'Enable GTM Support in AMP.', 'accelerated-mobile-pages' ),
2139
- 'default' => 1,
2140
  ),
2141
  array(
2142
  'class'=>'child_opt child_opt_arrow',
@@ -2420,7 +2421,42 @@ Redux::setArgs( "redux_builder_amp", $args );
2420
  'tooltip-subtitle' => __( 'Enter the Website ID', 'accelerated-mobile-pages' ),
2421
  'default' => '',
2422
  'desc' => 'example: 00000003',
2423
- ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2424
  )
2425
  )
2426
  );
@@ -3240,6 +3276,7 @@ Redux::setSection( $opt_name, array(
3240
  'type' => 'text',
3241
  'title' => __('Enter your Audience Network Placement ID', 'accelerated-mobile-pages'),
3242
  'tooltip-subtitle' => __('You can find out more about this <a href="https://developers.facebook.com/docs/instant-articles/monetization/audience-network">here</a>. ', 'accelerated-mobile-pages'),
 
3243
  'required' => array('fb-instant-article-ads', '=', 1)
3244
  ),
3245
  array(
@@ -5045,7 +5082,7 @@ Redux::setSection( $opt_name, array(
5045
  'orderby' => 'name',
5046
  'order' => 'ASC'
5047
  ) );
5048
-
5049
  $categories_array = array();
5050
  if ( $categories ) :
5051
  foreach ($categories as $cat ) {
@@ -5308,13 +5345,7 @@ Redux::setSection( $opt_name, array(
5308
  )
5309
  ));
5310
 
5311
- // Single Section
5312
- Redux::setSection( $opt_name, array(
5313
- 'title' => __( 'Single', 'accelerated-mobile-pages' ),
5314
- // 'desc' => __( 'Additional Options to control the look of Single <a href="' . esc_url(admin_url('customize.php?autofocus[section]=amp_design&customize_amp=1')) .'"> Click here </a> ', 'accelerated-mobile-pages' ),
5315
- 'id' => 'amp-single',
5316
- 'subsection' => true,
5317
- 'fields' => array(
5318
  array(
5319
  'id' => 'ampforwp-single_section_1',
5320
  'type' => 'section',
@@ -5344,6 +5375,7 @@ Redux::setSection( $opt_name, array(
5344
  // 'max-height'=> 60,
5345
  'required' => array( array('amp-design-selector', '=' , '4') ),
5346
  ),
 
5347
  array(
5348
  'id' => 'ampforwp-single_section_2',
5349
  'type' => 'section',
@@ -5496,7 +5528,8 @@ Redux::setSection( $opt_name, array(
5496
  ),
5497
  'default' => '2',
5498
  'required' => array(
5499
- array('ampforwp-single-related-posts-switch', '=' , '1')
 
5500
  ),
5501
  ),
5502
  array(
@@ -5514,7 +5547,7 @@ Redux::setSection( $opt_name, array(
5514
  'type' => 'switch',
5515
  'class' => 'child_opt',
5516
  'title' => __('Excerpt', 'accelerated-mobile-pages'),
5517
- 'default' => 1,
5518
  'required' => array(
5519
  array('ampforwp-single-related-posts-switch', '=' , '1')
5520
  ),
@@ -5522,7 +5555,7 @@ Redux::setSection( $opt_name, array(
5522
  array(
5523
  'id' => 'ampforwp-single-related-posts-link',
5524
  'type' => 'switch',
5525
- 'class' => 'child_opt',
5526
  'title' => __('Link to Non-AMP', 'accelerated-mobile-pages'),
5527
  'default' => 0,
5528
  'required' => array(
@@ -5536,7 +5569,8 @@ Redux::setSection( $opt_name, array(
5536
  'title' => __('Sort Related Posts Randomly', 'accelerated-mobile-pages'),
5537
  'default' => 0,
5538
  'required' => array(
5539
- array('ampforwp-single-related-posts-switch', '=' , '1')
 
5540
  ),
5541
  ),
5542
  array(
@@ -5547,7 +5581,8 @@ Redux::setSection( $opt_name, array(
5547
  'validate' => 'numeric',
5548
  'default' => '3',
5549
  'required' => array(
5550
- array('ampforwp-single-related-posts-switch', '=' , '1')
 
5551
  ),
5552
  ),
5553
  array(
@@ -5558,7 +5593,8 @@ Redux::setSection( $opt_name, array(
5558
  'tooltip-subtitle' => __('Show Related Posts From Past Few Days', 'accelerated-mobile-pages'),
5559
  'default' => 0,
5560
  'required' => array(
5561
- array('ampforwp-single-related-posts-switch', '=' , '1')
 
5562
  ),
5563
  ),
5564
  array(
@@ -5569,17 +5605,10 @@ Redux::setSection( $opt_name, array(
5569
  'validate' => 'numeric',
5570
  'default' => '7',
5571
  'required' => array(
5572
- array('ampforwp-related-posts-days-switch', '=' , '1')
 
5573
  ),
5574
  ),
5575
- array(
5576
- 'id' => 'ampforwp-single_section_4',
5577
- 'type' => 'section',
5578
- 'title' => __('Inline Related Posts Settings', 'accelerated-mobile-pages'),
5579
- 'indent' => true,
5580
- 'layout_type' => 'accordion',
5581
- 'accordion-open'=> 0,
5582
- ),
5583
  array(
5584
  'id' => 'ampforwp-inline-related-posts',
5585
  'type' => 'switch',
@@ -5591,15 +5620,13 @@ Redux::setSection( $opt_name, array(
5591
  'id' => 'ampforwp-inline-related-posts-type',
5592
  'type' => 'select',
5593
  'title' => __('In-content Related Post by', 'accelerated-mobile-pages'),
5594
- 'class' => 'child_opt child_opt_arrow',
5595
- 'data' => 'page',
5596
  'options' => array(
5597
  '1' => 'Tags',
5598
  '2' => 'Categories',
5599
  ),
5600
  'default' => '2',
5601
  'required' => array( array('ampforwp-inline-related-posts', '=' , '1') ),
5602
-
5603
  ),
5604
  array(
5605
  'id' => 'ampforwp-inline-related-posts-order',
@@ -5613,11 +5640,32 @@ Redux::setSection( $opt_name, array(
5613
  'id' => 'ampforwp-number-of-inline-related-posts',
5614
  'type' => 'text',
5615
  'class' => 'child_opt',
5616
- 'title' => __('Count', 'accelerated-mobile-pages'),
5617
  'validate' => 'numeric',
5618
  'default' => '3',
5619
  'required' => array( array('ampforwp-inline-related-posts', '=' , '1') ),
5620
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5621
  array(
5622
  'id' => 'single-tab-2',
5623
  'type' => 'section',
@@ -5770,6 +5818,63 @@ Redux::setSection( $opt_name, array(
5770
  'required' => array('swift_cnt_h6' , '=' , '1'),
5771
  array('swift_cnt' , '=' , '1')
5772
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5773
 
5774
  // array(
5775
  // 'id' => 'ampforwp-comments-banner',
@@ -5782,15 +5887,76 @@ Redux::setSection( $opt_name, array(
5782
  // ),
5783
  //
5784
  $fields = array(
5785
- 'id' => 'info_normal',
5786
- 'type' => 'info',
5787
- 'class' => 'extension_banner_bg',
5788
- 'desc' => $single_extension_listing )
5789
-
5790
- ),
5791
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5792
  ) );
5793
 
 
5794
  // Footer Section
5795
  Redux::setSection( $opt_name, array(
5796
  'title' => __( 'Footer', 'accelerated-mobile-pages' ),
81
  array(
82
  'name'=>'bbPress For AMP',
83
  'desc'=>'Add bbPress Forum Compatibility to your AMP version',
84
+ 'img_src'=>AMPFORWP_IMAGE_DIR . '/bbp-icon.png',
85
  'price'=>'$89',
86
  'url_link'=>'http://ampforwp.com/bbpress/#utm_source=options-panel&utm_medium=extension-tab_bbpress-for-wordpress&utm_campaign=AMP%20Plugin',
87
  'plugin_active_path'=> 'bbpress-for-amp/bbpress-for-amp.php',
140
  array(
141
  'name'=>'PWA For WordPress',
142
  'desc'=>'Add Progressive Web App support for WordPress website',
143
+ 'img_src'=>AMPFORWP_IMAGE_DIR . '/pwa-icon.png',
144
  'price'=>'$89',
145
  'url_link'=>'http://ampforwp.com/pwa/#utm_source=options-panel&utm_medium=extension-tab_pwa-for-wordpress&utm_campaign=AMP%20Plugin',
146
  'plugin_active_path'=> 'pwa-for-wordpress/amp-pwa.php',
166
  'desc'=>'Advanced WooCommerce in AMP in two clicks.',
167
  'img_src'=>AMPFORWP_IMAGE_DIR . '/woo.png',
168
  'price'=>'$79',
169
+ 'url_link'=>'https://ampforwp.com/woocommerce/#utm_source=options-panel&utm_medium=extension-tab_woocommerce&utm_campaign=AMP%20Plugin',
170
  'plugin_active_path'=> 'amp-woocommerce-pro/amp-woocommerce.php',
171
  'item_name'=>'WooCommerce',
172
  'store_url'=>'https://accounts.ampforwp.com',
177
  array(
178
  'name'=> 'EDD for AMP',
179
  'desc'=> 'EDD compatibility with AMP',
180
+ 'img_src'=> AMPFORWP_IMAGE_DIR . '/edd-icon.png',
181
  'price'=> '$19',
182
+ 'url_link'=>'https://ampforwp.com/edd-for-amp/#utm_source=options-panel&utm_medium=extension-tab_edd-for-amp&utm_campaign=AMP%20Plugin',
183
  'plugin_active_path'=> 'edd-for-amp/edd-for-amp.php',
184
  'item_name'=>'EDD for AMP',
185
  'store_url'=>'https://accounts.ampforwp.com',
188
 
189
  array(
190
  'name'=>'AMP Layouts',
191
+ 'desc'=>'Design system built for AMP that makes easy to create your own AMP website.',
192
+ 'img_src'=>AMPFORWP_IMAGE_DIR . '/amplayouts.png',
193
  'price'=>'$89',
194
+ 'url_link'=>'https://ampforwp.com/amp-layouts/#utm_source=options-panel&utm_medium=extension-tab_amp-layouts&utm_campaign=AMP%20Plugin',
195
  'plugin_active_path'=> 'amp-layouts/amp-layouts.php',
196
  'item_name'=>'AMP Layouts',
197
  'store_url'=>'https://accounts.ampforwp.com',
204
  'desc'=>'Advanced News Magazine theme built for AMP.',
205
  'img_src'=>AMPFORWP_IMAGE_DIR . '/click.png',
206
  'price'=>'$49',
207
+ 'url_link'=>'http://ampforwp.com/themes/newspaper/#utm_source=options-panel&utm_medium=extension-tab_themes/newspaper&utm_campaign=AMP%20Plugin',
208
  'plugin_active_path'=> 'amp-newspaper-theme/ampforwp-custom-theme.php',
209
  'item_name'=>'Newspaper Theme for AMP',
210
  'store_url'=>'https://accounts.ampforwp.com',
227
  array(
228
  'name'=>'AMP Comments',
229
  'desc'=>'You can now allow the same comment functionality on AMP.',
230
+ 'img_src'=>AMPFORWP_IMAGE_DIR . '/comments.png',
231
  'price'=>'$29.99',
232
+ 'url_link'=>'https://ampforwp.com/amp-comments/#utm_source=options-panel&utm_medium=extension-tab_amp-comments&utm_campaign=AMP%20Plugin',
233
  'plugin_active_path'=> 'amp-comments/amp-comments.php',
234
  'item_name'=>'AMP Comments',
235
  'store_url'=>'https://accounts.ampforwp.com',
266
  'desc'=>'A Revolutionary new way to share your stories',
267
  'img_src'=>AMPFORWP_IMAGE_DIR . '/cache-icon.png',
268
  'price'=>'$79',
269
+ 'url_link'=>'https://ampforwp.com/amp-stories/#utm_source=options-panel&utm_medium=extension-tab_stories&utm_campaign=AMP%20Plugin',
270
  'plugin_active_path'=> 'amp-stories/ampforwp-stories.php',
271
  'item_name'=>'AMP Stories',
272
  'store_url'=>'https://accounts.ampforwp.com',
276
  array(
277
  'name'=>'Structured Data for WP',
278
  'desc'=>'Structured Data for your site and for AMP',
279
+ 'img_src'=>AMPFORWP_IMAGE_DIR . '/sd-icon.png',
280
  'price'=>'$29',
281
+ 'url_link'=>'https://ampforwp.com/structuredata-for-wp/#utm_source=options-panel&utm_medium=extension-tab_structuredata-for-wp&utm_campaign=AMP%20Plugin',
282
  'plugin_active_path'=> 'structured-data-for-wp/structured-data-for-wp.php',
283
  'item_name'=>'Structured Data for WP',
284
  'store_url'=>'https://accounts.ampforwp.com',
288
  array(
289
  'name'=>'Polylang For AMP',
290
  'desc'=>'Polylang compatibility with AMP',
291
+ 'img_src'=>AMPFORWP_IMAGE_DIR . '/polylang-icon.png',
292
  'price'=>'$19',
293
+ 'url_link'=>'https://ampforwp.com/polylang-for-amp/#utm_source=options-panel&utm_medium=extension-tab_polylang-for-amp&utm_campaign=AMP%20Plugin',
294
  'plugin_active_path'=> 'polylang-for-amp/amp_polylang.php',
295
  'item_name'=>'Polylang For AMP',
296
  'store_url'=>'https://accounts.ampforwp.com',
299
  array(
300
  'name'=>'WPML For AMP',
301
  'desc'=>'WPML compatibility with AMP',
302
+ 'img_src'=>AMPFORWP_IMAGE_DIR . '/wpml-icon.png',
303
  'price'=>'$19',
304
+ 'url_link'=>'https://ampforwp.com/wpml-for-amp/#utm_source=options-panel&utm_medium=extension-tab_wpml-for-amp&utm_campaign=AMP%20Plugin',
305
  'plugin_active_path'=> 'wpml-for-amp/wpml_for_amp.php',
306
  'item_name'=>'WPML For AMP',
307
  'store_url'=>'https://accounts.ampforwp.com',
310
  array(
311
  'name'=>'AMP Teaser',
312
  'desc'=>'AMP Teaser automatically clips the content based on your selection',
313
+ 'img_src'=>AMPFORWP_IMAGE_DIR . '/teaser-icon.png',
314
  'price'=>'$29',
315
+ 'url_link'=>'https://ampforwp.com/amp-teaser/#utm_source=options-panel&utm_medium=extension-tab_amp-teaser&utm_campaign=AMP%20Plugin',
316
  'plugin_active_path'=> 'amp-teaser/amp-teaser.php',
317
  'item_name'=>'AMP Teaser',
318
  'store_url'=>'https://accounts.ampforwp.com',
2040
  '10' => __('Chartbeat Analytics', 'accelerated-mobile-pages'),
2041
  '11' => __('Alexa Metrics', 'accelerated-mobile-pages'),
2042
  '12' => __('AFS Analytics', 'accelerated-mobile-pages'),
2043
+ '13' => __('Adobe Analytics', 'accelerated-mobile-pages'),
2044
  ),
2045
  'required' => array(
2046
  array('amp-use-gtm-option', '=' , '0'),
2137
  'type' => 'switch',
2138
  'title' => __( 'Google Tag Manager', 'accelerated-mobile-pages' ),
2139
  'tooltip-subtitle' => __( 'Enable GTM Support in AMP.', 'accelerated-mobile-pages' ),
2140
+ 'default' => 0,
2141
  ),
2142
  array(
2143
  'class'=>'child_opt child_opt_arrow',
2421
  'tooltip-subtitle' => __( 'Enter the Website ID', 'accelerated-mobile-pages' ),
2422
  'default' => '',
2423
  'desc' => 'example: 00000003',
2424
+ ),
2425
+ //Adobe Analytics
2426
+ array(
2427
+ 'id' => 'ampforwp-adobe-analytics-switch',
2428
+ 'type' => 'switch',
2429
+ 'title' => 'Adobe Analytics',
2430
+ 'default' => ampforwp_get_default_analytics('13'),
2431
+ 'required' => array(
2432
+ array('amp-use-gtm-option', '=' , '0'),
2433
+ ),
2434
+ ),
2435
+ array(
2436
+ 'id' => 'ampforwp-adobe-host',
2437
+ 'type' => 'text',
2438
+ 'title' => __( 'Host Name', 'accelerated-mobile-pages' ),
2439
+ 'required' => array(
2440
+ array('amp-use-gtm-option', '=' , '0'),
2441
+ array('ampforwp-adobe-analytics-switch', '=' , '1')
2442
+ ),
2443
+ 'tooltip-subtitle' => __( 'Enter the Website domain', 'accelerated-mobile-pages' ),
2444
+ 'default' => '',
2445
+ 'desc' => 'example: metrics.example.com',
2446
+ ),
2447
+ array(
2448
+ 'id' => 'ampforwp-adobe-reportsuiteid',
2449
+ 'type' => 'text',
2450
+ 'title' => __( 'ReportSuite ID', 'accelerated-mobile-pages' ),
2451
+ 'required' => array(
2452
+ array('amp-use-gtm-option', '=' , '0'),
2453
+ array('ampforwp-adobe-analytics-switch', '=' , '1')
2454
+ ),
2455
+ 'tooltip-subtitle' => __( 'Enter the ReportSuite ID', 'accelerated-mobile-pages' ),
2456
+ 'default' => '',
2457
+ 'desc' => 'example: 00000003',
2458
+ ),
2459
+ //Adobe Analytics
2460
  )
2461
  )
2462
  );
3276
  'type' => 'text',
3277
  'title' => __('Enter your Audience Network Placement ID', 'accelerated-mobile-pages'),
3278
  'tooltip-subtitle' => __('You can find out more about this <a href="https://developers.facebook.com/docs/instant-articles/monetization/audience-network">here</a>. ', 'accelerated-mobile-pages'),
3279
+ 'desc' => __('<a href="https://ampforwp.com/tutorials/article/how-to-enter-audience-network-placement-id-of-advertisement-in-the-instant-article/" target="_blank">Click here</a> on how to get Audience Network Placement Id.', 'accelerated-mobile-pages'),
3280
  'required' => array('fb-instant-article-ads', '=', 1)
3281
  ),
3282
  array(
5082
  'orderby' => 'name',
5083
  'order' => 'ASC'
5084
  ) );
5085
+ $categories_array = '';
5086
  $categories_array = array();
5087
  if ( $categories ) :
5088
  foreach ($categories as $cat ) {
5345
  )
5346
  ));
5347
 
5348
+ $single_page_options = array(
 
 
 
 
 
 
5349
  array(
5350
  'id' => 'ampforwp-single_section_1',
5351
  'type' => 'section',
5375
  // 'max-height'=> 60,
5376
  'required' => array( array('amp-design-selector', '=' , '4') ),
5377
  ),
5378
+
5379
  array(
5380
  'id' => 'ampforwp-single_section_2',
5381
  'type' => 'section',
5528
  ),
5529
  'default' => '2',
5530
  'required' => array(
5531
+ array('ampforwp-single-related-posts-switch', '=' , '1'),
5532
+ // array('ampforwp-related-posts-yarpp-switch', '=' , '0')
5533
  ),
5534
  ),
5535
  array(
5547
  'type' => 'switch',
5548
  'class' => 'child_opt',
5549
  'title' => __('Excerpt', 'accelerated-mobile-pages'),
5550
+ 'default' => 0,
5551
  'required' => array(
5552
  array('ampforwp-single-related-posts-switch', '=' , '1')
5553
  ),
5555
  array(
5556
  'id' => 'ampforwp-single-related-posts-link',
5557
  'type' => 'switch',
5558
+ 'class' => 'child_opt',
5559
  'title' => __('Link to Non-AMP', 'accelerated-mobile-pages'),
5560
  'default' => 0,
5561
  'required' => array(
5569
  'title' => __('Sort Related Posts Randomly', 'accelerated-mobile-pages'),
5570
  'default' => 0,
5571
  'required' => array(
5572
+ array('ampforwp-single-related-posts-switch', '=' , '1'),
5573
+ // array('ampforwp-related-posts-yarpp-switch', '=' , '1')
5574
  ),
5575
  ),
5576
  array(
5581
  'validate' => 'numeric',
5582
  'default' => '3',
5583
  'required' => array(
5584
+ array('ampforwp-single-related-posts-switch', '=' , '1'),
5585
+ // array('ampforwp-related-posts-yarpp-switch', '=' , '1')
5586
  ),
5587
  ),
5588
  array(
5593
  'tooltip-subtitle' => __('Show Related Posts From Past Few Days', 'accelerated-mobile-pages'),
5594
  'default' => 0,
5595
  'required' => array(
5596
+ array('ampforwp-single-related-posts-switch', '=' , '1'),
5597
+ // array('ampforwp-related-posts-yarpp-switch', '=' , '0')
5598
  ),
5599
  ),
5600
  array(
5605
  'validate' => 'numeric',
5606
  'default' => '7',
5607
  'required' => array(
5608
+ array('ampforwp-related-posts-days-switch', '=' , '1'),
5609
+ // array('ampforwp-related-posts-yarpp-switch', '=' , '0')
5610
  ),
5611
  ),
 
 
 
 
 
 
 
 
5612
  array(
5613
  'id' => 'ampforwp-inline-related-posts',
5614
  'type' => 'switch',
5620
  'id' => 'ampforwp-inline-related-posts-type',
5621
  'type' => 'select',
5622
  'title' => __('In-content Related Post by', 'accelerated-mobile-pages'),
5623
+ 'class' => 'child_opt child_opt_arrow',
 
5624
  'options' => array(
5625
  '1' => 'Tags',
5626
  '2' => 'Categories',
5627
  ),
5628
  'default' => '2',
5629
  'required' => array( array('ampforwp-inline-related-posts', '=' , '1') ),
 
5630
  ),
5631
  array(
5632
  'id' => 'ampforwp-inline-related-posts-order',
5640
  'id' => 'ampforwp-number-of-inline-related-posts',
5641
  'type' => 'text',
5642
  'class' => 'child_opt',
5643
+ 'title' => __('Display No. of Related Posts', 'accelerated-mobile-pages'),
5644
  'validate' => 'numeric',
5645
  'default' => '3',
5646
  'required' => array( array('ampforwp-inline-related-posts', '=' , '1') ),
5647
  ),
5648
+ array(
5649
+ 'id' => 'ampforwp-inline-related-posts-display-type',
5650
+ 'type' => 'select',
5651
+ 'title' => __('Related Post Display', 'accelerated-mobile-pages'),
5652
+ 'class' => 'child_opt child_opt_arrow',
5653
+ 'options' => array(
5654
+ 'middle' => 'After 50% of Content',
5655
+ 'paragraphs' => 'X number of paragraphs',
5656
+ ),
5657
+ 'default' => 'middle',
5658
+ 'required' => array( array('ampforwp-inline-related-posts', '=' , '1') ),
5659
+ ),
5660
+ array(
5661
+ 'id' => 'ampforwp-related-posts-after-number-of-paragraphs',
5662
+ 'type' => 'text',
5663
+ 'class' => 'child_opt',
5664
+ 'title' => __('Related Post After No. of Paragraphs', 'accelerated-mobile-pages'),
5665
+ 'validate' => 'numeric',
5666
+ 'default' => '3',
5667
+ 'required' => array( array('ampforwp-inline-related-posts', '=' , '1'),array('ampforwp-inline-related-posts-display-type', '=' , 'paragraphs') ),
5668
+ ),
5669
  array(
5670
  'id' => 'single-tab-2',
5671
  'type' => 'section',
5818
  'required' => array('swift_cnt_h6' , '=' , '1'),
5819
  array('swift_cnt' , '=' , '1')
5820
  ),
5821
+ array(
5822
+ 'id' => 'single-sneakp-section',
5823
+ 'type' => 'section',
5824
+ 'title' => __('Content Sneak Peek', 'accelerated-mobile-pages'),
5825
+ 'indent' => true,
5826
+ 'layout_type' => 'accordion',
5827
+ 'accordion-open'=> 1,
5828
+ ),
5829
+ array(
5830
+ 'id' => 'content-sneak-peek',
5831
+ 'type' => 'switch',
5832
+ //'class' => 'child_opt',
5833
+ 'title' => __('Content Sneak Peek', 'accelerated-mobile-pages'),
5834
+ 'default' => 0,
5835
+ ),
5836
+ array(
5837
+ 'id' => 'content-sneak-peek-height',
5838
+ 'type' => 'text',
5839
+ 'class' => 'child_opt',
5840
+ 'title' => __('Content Height', 'accelerated-mobile-pages'),
5841
+ 'default' => '600px',
5842
+ 'required' => array('content-sneak-peek' , '=' , '1'),
5843
+ ),
5844
+ array(
5845
+ 'id' => 'content-sneak-peek-btn-text',
5846
+ 'type' => 'text',
5847
+ 'class' => 'child_opt',
5848
+ 'title' => __('Button Text', 'accelerated-mobile-pages'),
5849
+ 'default' => 'Show Full Article',
5850
+ 'required' => array('content-sneak-peek' , '=' , '1'),
5851
+ ),
5852
+ array(
5853
+ 'id' => 'content-sneak-peek-txt-color',
5854
+ 'title' => __('Text Color', 'accelerated-mobile-pages'),
5855
+ 'tooltip-subtitle' => __('Choose the color for button\'s text','accelerated-mobile-pages'),
5856
+ 'type' => 'color_rgba',
5857
+ 'class' => 'child_opt',
5858
+ 'default' => array(
5859
+ 'color' => '#fff',
5860
+ ),
5861
+ 'required' => array(
5862
+ array('content-sneak-peek', '=' , '1')
5863
+ )
5864
+ ),
5865
+ array(
5866
+ 'id' => 'content-sneak-peek-btn-color',
5867
+ 'title' => __('Button Color', 'accelerated-mobile-pages'),
5868
+ 'tooltip-subtitle' => __('Choose the color for button','accelerated-mobile-pages'),
5869
+ 'type' => 'color_rgba',
5870
+ 'class' => 'child_opt',
5871
+ 'default' => array(
5872
+ 'color' => '#000',
5873
+ ),
5874
+ 'required' => array(
5875
+ array('content-sneak-peek', '=' , '1')
5876
+ )
5877
+ ),
5878
 
5879
  // array(
5880
  // 'id' => 'ampforwp-comments-banner',
5887
  // ),
5888
  //
5889
  $fields = array(
5890
+ 'id' => 'info_normal',
5891
+ 'type' => 'info',
5892
+ 'class' => 'extension_banner_bg',
5893
+ 'desc' => $single_extension_listing
5894
+ )
5895
+ );
5896
+ /*Yarpp enable option
5897
+ if( is_plugin_active( 'yet-another-related-posts-plugin/yarpp.php' )){
5898
+ $yarpp_options = array(array(
5899
+ 'id' => 'ampforwp-related-posts-yarpp-switch',
5900
+ 'type' => 'switch',
5901
+ 'class' => 'child_opt',
5902
+ 'title' => __('YARPP Compatibility', 'accelerated-mobile-pages'),
5903
+ 'tooltip-subtitle' => __('Related post options can be used from the YARPP Plugin', 'accelerated-mobile-pages'),
5904
+ 'default' => 0,
5905
+ 'required' => array(
5906
+ array('ampforwp-single-related-posts-switch', '=' , '1')
5907
+ ),
5908
+ ));
5909
+ array_splice($single_page_options, 23, 0, $yarpp_options);
5910
+ }else{
5911
+ foreach ($single_page_options as $key => $optionArray) {
5912
+ if(isset($optionArray['id']) && $optionArray['id']=='ampforwp-number-of-related-posts'){
5913
+ $requiredValues = $optionArray['required'];
5914
+ foreach ($requiredValues as $reqkey => $reqValue) {
5915
+ if($reqValue[0]=='ampforwp-related-posts-yarpp-switch'){
5916
+ unset($single_page_options[$key]['required'][$reqkey]);
5917
+ }
5918
+ }
5919
+ }elseif(isset($optionArray['id']) && $optionArray['id']=='ampforwp-single-select-type-of-related'){
5920
+ $requiredValues = $optionArray['required'];
5921
+ foreach ($requiredValues as $reqkey => $reqValue) {
5922
+ if($reqValue[0]=='ampforwp-related-posts-yarpp-switch'){
5923
+ unset($single_page_options[$key]['required'][$reqkey]);
5924
+ }
5925
+ }
5926
+ }elseif(isset($optionArray['id']) && $optionArray['id']=='ampforwp-related-posts-days-switch'){
5927
+ $requiredValues = $optionArray['required'];
5928
+ foreach ($requiredValues as $reqkey => $reqValue) {
5929
+ if($reqValue[0]=='ampforwp-related-posts-yarpp-switch'){
5930
+ unset($single_page_options[$key]['required'][$reqkey]);
5931
+ }
5932
+ }
5933
+ }elseif(isset($optionArray['id']) && $optionArray['id']=='ampforwp-related-posts-days-text'){
5934
+ $requiredValues = $optionArray['required'];
5935
+ foreach ($requiredValues as $reqkey => $reqValue) {
5936
+ if($reqValue[0]=='ampforwp-related-posts-yarpp-switch'){
5937
+ unset($single_page_options[$key]['required'][$reqkey]);
5938
+ }
5939
+ }
5940
+ }elseif(isset($optionArray['id']) && $optionArray['id']=='ampforwp-single-order-of-related-posts'){
5941
+ $requiredValues = $optionArray['required'];
5942
+ foreach ($requiredValues as $reqkey => $reqValue) {
5943
+ if($reqValue[0]=='ampforwp-related-posts-yarpp-switch'){
5944
+ unset($single_page_options[$key]['required'][$reqkey]);
5945
+ }
5946
+ }
5947
+ }
5948
+ }
5949
+ }*/
5950
+ // Single Section
5951
+ Redux::setSection( $opt_name, array(
5952
+ 'title' => __( 'Single', 'accelerated-mobile-pages' ),
5953
+ // 'desc' => __( 'Additional Options to control the look of Single <a href="' . esc_url(admin_url('customize.php?autofocus[section]=amp_design&customize_amp=1')) .'"> Click here </a> ', 'accelerated-mobile-pages' ),
5954
+ 'id' => 'amp-single',
5955
+ 'subsection' => true,
5956
+ 'fields' => $single_page_options
5957
  ) );
5958
 
5959
+
5960
  // Footer Section
5961
  Redux::setSection( $opt_name, array(
5962
  'title' => __( 'Footer', 'accelerated-mobile-pages' ),
includes/options/redux-core/framework.php CHANGED
@@ -89,7 +89,7 @@
89
  // See if Redux is a plugin or not
90
  if ( strpos( Redux_Helpers::cleanFilePath( __FILE__ ), Redux_Helpers::cleanFilePath( get_stylesheet_directory() ) ) !== false || strpos( Redux_Helpers::cleanFilePath( __FILE__ ), Redux_Helpers::cleanFilePath( get_template_directory_uri() ) ) !== false || strpos( Redux_Helpers::cleanFilePath( __FILE__ ), Redux_Helpers::cleanFilePath( WP_CONTENT_DIR . '/themes/' ) ) !== false ) {
91
  self::$_is_plugin = false;
92
- } else {
93
  // Check if plugin is a symbolic link, see if it's a plugin. If embedded, we can't do a thing.
94
  if ( strpos( self::$_dir, ABSPATH ) === false ) {
95
  if ( ! function_exists( 'get_plugins' ) ) {
@@ -107,7 +107,7 @@
107
  self::$_is_plugin = false;
108
  }
109
  }
110
- }
111
 
112
  if ( self::$_is_plugin == true || self::$_as_plugin == true ) {
113
  self::$_url = plugin_dir_url( __FILE__ );
89
  // See if Redux is a plugin or not
90
  if ( strpos( Redux_Helpers::cleanFilePath( __FILE__ ), Redux_Helpers::cleanFilePath( get_stylesheet_directory() ) ) !== false || strpos( Redux_Helpers::cleanFilePath( __FILE__ ), Redux_Helpers::cleanFilePath( get_template_directory_uri() ) ) !== false || strpos( Redux_Helpers::cleanFilePath( __FILE__ ), Redux_Helpers::cleanFilePath( WP_CONTENT_DIR . '/themes/' ) ) !== false ) {
91
  self::$_is_plugin = false;
92
+ } /*else {
93
  // Check if plugin is a symbolic link, see if it's a plugin. If embedded, we can't do a thing.
94
  if ( strpos( self::$_dir, ABSPATH ) === false ) {
95
  if ( ! function_exists( 'get_plugins' ) ) {
107
  self::$_is_plugin = false;
108
  }
109
  }
110
+ }*/
111
 
112
  if ( self::$_is_plugin == true || self::$_as_plugin == true ) {
113
  self::$_url = plugin_dir_url( __FILE__ );
includes/options/redux-core/inc/class.p.php CHANGED
@@ -255,7 +255,6 @@
255
  }
256
 
257
  if ( isset( $contents ) ) {
258
- print str_replace( 'ads.reduxframework.com', 'look.reduxframework.com', $contents );
259
  }
260
 
261
  } else {
255
  }
256
 
257
  if ( isset( $contents ) ) {
 
258
  }
259
 
260
  } else {
includes/options/redux-core/inc/class.redux_functions.php CHANGED
@@ -225,12 +225,6 @@
225
  } else {
226
 
227
  if ( empty( $check ) ) {
228
- $check = @wp_remote_get( 'http://look.reduxframework.com/status.php?p=' . ReduxFramework::$_is_plugin );
229
- $check = json_decode( wp_remote_retrieve_body( $check ), true );
230
-
231
- if ( ! empty( $check ) && isset( $check['id'] ) ) {
232
- update_user_option( get_current_user_id(), 'r_tru_u_x', $check );
233
- }
234
  }
235
  $check = isset( $check['id'] ) ? $check['id'] : $check;
236
  if ( ! empty( $check ) ) {
225
  } else {
226
 
227
  if ( empty( $check ) ) {
 
 
 
 
 
 
228
  }
229
  $check = isset( $check['id'] ) ? $check['id'] : $check;
230
  if ( ! empty( $check ) ) {
pagebuilder/inc/admin-amp-page-builder.css CHANGED
@@ -760,7 +760,8 @@ position: fixed;
760
  }
761
  .modal-footer{
762
  padding: 10px 0px;
763
- position: sticky;
 
764
  width: 100%;
765
  bottom: 0px;
766
  background: #f1f1f1;
@@ -1233,6 +1234,10 @@ Layout css
1233
  -webkit-font-smoothing: antialiased;
1234
  -moz-osx-font-smoothing: grayscale;
1235
  }
 
 
 
 
1236
  .amppb_accordion__panel {
1237
  padding: 1rem;
1238
  background: #ffffff;
760
  }
761
  .modal-footer{
762
  padding: 10px 0px;
763
+ position: absolute;
764
+ bottom: 0;
765
  width: 100%;
766
  bottom: 0px;
767
  background: #f1f1f1;
1234
  -webkit-font-smoothing: antialiased;
1235
  -moz-osx-font-smoothing: grayscale;
1236
  }
1237
+ /* icons not loading in AMP page builder when WooCommerce Product Slider plugin is Installed */
1238
+ [class*=" icon-"]:before {
1239
+ font-family: 'icomoon'!important;
1240
+ }
1241
  .amppb_accordion__panel {
1242
  padding: 1rem;
1243
  background: #ffffff;
pagebuilder/modules/contents-module.php CHANGED
@@ -235,6 +235,16 @@ require_once ABSPATH . WPINC . '/category.php';
235
  $height = $new_height;
236
  }
237
  }
 
 
 
 
 
 
 
 
 
 
238
  try{
239
  $thumb_url = ampforwp_aq_resize( $image, $width, $height, true, false ); //resize & crop the image
240
 
235
  $height = $new_height;
236
  }
237
  }
238
+
239
+ if ( ampforwp_get_setting('ampforwp-retina-images') ) {
240
+ $resolution = '';
241
+ $resolution = 2;
242
+ if(ampforwp_get_setting('ampforwp-retina-images-res')){
243
+ $resolution = ampforwp_get_setting('ampforwp-retina-images-res');
244
+ }
245
+ $width = $width * $resolution;
246
+ $height = $height * $resolution;
247
+ }
248
  try{
249
  $thumb_url = ampforwp_aq_resize( $image, $width, $height, true, false ); //resize & crop the image
250
 
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: 4.9.8
7
- Stable tag: 0.9.97.13
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -183,12 +183,33 @@ You can contact us from [here](https://ampforwp.com/contact/)
183
 
184
  == Changelog ==
185
 
186
- = 0.9.97.13 (27th August 2018) =
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  * Fixed: Fatal error in `ampforwp_related_post_loop_query()`
188
 
189
  = 0.9.97.12 (27th August 2018) =
190
  * Fixed: Quote runs only in block post not on pages #2399
191
-
192
  * Added: Create a Sidebar option that can be used as global Sidebar #2388
193
  * Fixed: words are breaking and not readable #2441
194
  * Fixed: Text is breaking into next line while there is no space between the text in custom AMP Editor #2270
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 4.9.8
7
+ Stable tag: 0.9.97.14
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
183
 
184
  == Changelog ==
185
 
186
+ = 0.9.97.14 (4th September 2018) =
187
+ * Added: Adobe Analytics Support #887
188
+ * Fixed: Same Icons loading for some extensions #2172
189
+ * Fixed: Removed extra spacing from "Back to top" text #2349
190
+ * Fixed: Retina featured images support for Homepage and archive loop images #2334
191
+ * Fixed: When WooCommerce Product Slider is Installed, the Picture of Icons are not loading #2325
192
+ * Added: Customizr Theme Lazy Loading compatibility #2322
193
+ * Fixed: "Save Module" button of AMP page Builder not displaying in OSX and in Safari #1943
194
+ * Fixed: Sort Related Posts Randomly Not Working in Swift theme #2308
195
+ * Added: Need to create a tutorial of How to Enter your Audience Network Placement ID of advertisement in the Instant Article #1723
196
+ * Fixed: Retina Images option Improvement-II #2296
197
+ * Fixed: Disable the look or check of redux framework #2293
198
+ * Fixed: With Redux core plugin, AMP option panel design not loading #2258
199
+ * Fixed: Issues with pagination #2253
200
+ * Added: Thrive Architect Compatible #1575
201
+ * Fixed: Notice Undefined variable categories_array #2486
202
+ * Fixed: Need to add upscale parameter in-line related posts #2488
203
+ * Fixed: Getting the warnings in error log due to global variable, not present #2395
204
+ * Fixed: Google Analytic issue while setting up Run Installation wizard #2491
205
+ * Added: Read more button AKA Content Sneak Peek feature for post #2246
206
+ * Added: Showing related items/post in after nth paragraph #2246
207
+
208
+ = 0.9.97.13 (28th August 2018) =
209
  * Fixed: Fatal error in `ampforwp_related_post_loop_query()`
210
 
211
  = 0.9.97.12 (27th August 2018) =
212
  * Fixed: Quote runs only in block post not on pages #2399
 
213
  * Added: Create a Sidebar option that can be used as global Sidebar #2388
214
  * Fixed: words are breaking and not readable #2441
215
  * Fixed: Text is breaking into next line while there is no space between the text in custom AMP Editor #2270
templates/design-manager/design-1/elements/related-posts.php CHANGED
@@ -2,7 +2,7 @@
2
  global $post, $redux_builder_amp;
3
  do_action('ampforwp_above_related_post',$this); //Above Related Posts
4
  $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-related-posts'];
5
- $int_number_of_related_posts = round(abs(floatval($string_number_of_related_posts)));
6
 
7
  // declaring this variable here to prevent debug errors
8
  $args = null;
@@ -75,7 +75,7 @@ if ( isset($redux_builder_amp['ampforwp-related-posts-days-switch']) && true ==
75
  );
76
  }
77
  if( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_builder_amp['ampforwp-single-related-posts-switch'] && $redux_builder_amp['ampforwp-single-select-type-of-related'] ){
78
- $my_query = new wp_query( $args );
79
  if( $my_query->have_posts() ) { ?>
80
  <div class="amp-wp-content relatedpost">
81
  <div class="related_posts">
2
  global $post, $redux_builder_amp;
3
  do_action('ampforwp_above_related_post',$this); //Above Related Posts
4
  $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-related-posts'];
5
+ $int_number_of_related_posts = (int) $string_number_of_related_posts;
6
 
7
  // declaring this variable here to prevent debug errors
8
  $args = null;
75
  );
76
  }
77
  if( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_builder_amp['ampforwp-single-related-posts-switch'] && $redux_builder_amp['ampforwp-single-select-type-of-related'] ){
78
+ $my_query = new wp_query( $args );
79
  if( $my_query->have_posts() ) { ?>
80
  <div class="amp-wp-content relatedpost">
81
  <div class="related_posts">
templates/design-manager/design-1/footer.php CHANGED
@@ -32,7 +32,7 @@ wp_reset_postdata(); ?>
32
 
33
  <p class="back-to-top">
34
  <?php if($redux_builder_amp['ampforwp-footer-top']=='1') { ?>
35
- <a title="back to top" on="tap:backtotop.scrollTo(duration=500)" class="btt" ><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-top-text'], 'Top'); ?> </a>
36
  <?php }
37
  if($redux_builder_amp['amp-footer-link-non-amp-page']=='1') {
38
  if($redux_builder_amp['ampforwp-footer-top']=='1') { ?>
32
 
33
  <p class="back-to-top">
34
  <?php if($redux_builder_amp['ampforwp-footer-top']=='1') { ?>
35
+ <a title="back to top" on="tap:backtotop.scrollTo(duration=500)" class="btt" ><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-top-text'], 'Top'); ?></a>
36
  <?php }
37
  if($redux_builder_amp['amp-footer-link-non-amp-page']=='1') {
38
  if($redux_builder_amp['ampforwp-footer-top']=='1') { ?>
templates/design-manager/design-2/elements/related-posts.php CHANGED
@@ -2,7 +2,7 @@
2
  global $post, $redux_builder_amp;
3
  do_action('ampforwp_above_related_post',$this); //Above Related Posts
4
  $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-related-posts'];
5
- $int_number_of_related_posts = round(abs(floatval($string_number_of_related_posts)));
6
 
7
  // declaring this variable here to prevent debug errors
8
  $args = null;
2
  global $post, $redux_builder_amp;
3
  do_action('ampforwp_above_related_post',$this); //Above Related Posts
4
  $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-related-posts'];
5
+ $int_number_of_related_posts = (int)$string_number_of_related_posts;
6
 
7
  // declaring this variable here to prevent debug errors
8
  $args = null;
templates/design-manager/design-2/footer.php CHANGED
@@ -21,7 +21,7 @@
21
  </div>
22
  <?php } ?>
23
  <p> <?php if($redux_builder_amp['ampforwp-footer-top']=='1') { ?>
24
- <a title="back to top" on="tap:backtotop.scrollTo(duration=500)" class="btt" ><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-top-text'], 'Top'); ?> </a>
25
  <?php }
26
  if($redux_builder_amp['amp-footer-link-non-amp-page']=='1') {
27
  if($redux_builder_amp['ampforwp-footer-top']=='1') { ?>
21
  </div>
22
  <?php } ?>
23
  <p> <?php if($redux_builder_amp['ampforwp-footer-top']=='1') { ?>
24
+ <a title="back to top" on="tap:backtotop.scrollTo(duration=500)" class="btt" ><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-top-text'], 'Top'); ?></a>
25
  <?php }
26
  if($redux_builder_amp['amp-footer-link-non-amp-page']=='1') {
27
  if($redux_builder_amp['ampforwp-footer-top']=='1') { ?>
templates/design-manager/design-3/elements/related-posts.php CHANGED
@@ -2,7 +2,7 @@
2
  global $post, $redux_builder_amp;
3
  do_action('ampforwp_above_related_post',$this); //Above Related Posts
4
  $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-related-posts'];
5
- $int_number_of_related_posts = round(abs(floatval($string_number_of_related_posts)));
6
 
7
  // declaring this variable here to prevent debug errors
8
  $args = null;
2
  global $post, $redux_builder_amp;
3
  do_action('ampforwp_above_related_post',$this); //Above Related Posts
4
  $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-related-posts'];
5
+ $int_number_of_related_posts = (int)$string_number_of_related_posts;
6
 
7
  // declaring this variable here to prevent debug errors
8
  $args = null;
templates/design-manager/design-3/footer.php CHANGED
@@ -88,9 +88,7 @@
88
  <?php }
89
  if ( '1' == $redux_builder_amp['ampforwp-footer-top-design3'] ) { ?>
90
  <p class="rightslink back-to-top">
91
- <a title="back to top" on="tap:backtotop.scrollTo(duration=500)" class="btt" >
92
- <?php echo esc_attr(ampforwp_translation( $redux_builder_amp['amp-translator-top-text'], 'Top')); ?>
93
- </a> </p> <?php } ?>
94
  <p class="rightslink">
95
  <?php
96
  global $allowed_html;
88
  <?php }
89
  if ( '1' == $redux_builder_amp['ampforwp-footer-top-design3'] ) { ?>
90
  <p class="rightslink back-to-top">
91
+ <a title="back to top" on="tap:backtotop.scrollTo(duration=500)" class="btt" ><?php echo esc_attr(ampforwp_translation( $redux_builder_amp['amp-translator-top-text'], 'Top')); ?></a></p> <?php } ?>
 
 
92
  <p class="rightslink">
93
  <?php
94
  global $allowed_html;
templates/design-manager/design-3/style.php CHANGED
@@ -34,6 +34,7 @@ a{ color: #312C7E; text-decoration: none }
34
  amp-anim { max-width: 100%; }
35
  amp-wistia-player {margin:5px 0px;}
36
  .amp-wp-content amp-iframe{max-width:100%}
 
37
  @font-face {
38
  font-family: 'Roboto Slab';
39
  font-style: normal;
34
  amp-anim { max-width: 100%; }
35
  amp-wistia-player {margin:5px 0px;}
36
  .amp-wp-content amp-iframe{max-width:100%}
37
+ .hide{display:none}
38
  @font-face {
39
  font-family: 'Roboto Slab';
40
  font-style: normal;
templates/design-manager/swift/single.php CHANGED
@@ -189,7 +189,7 @@
189
  </div>
190
  <?php }
191
  if ( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_builder_amp['ampforwp-single-related-posts-switch'] ) {
192
- $my_query = related_post_loop_query();
193
  if( $my_query->have_posts() ) { $r_count = 1;?>
194
  <div class="srp">
195
  <ul class="clearfix">
@@ -205,9 +205,11 @@
205
  </div>
206
  <?php } } ?>
207
  <div class="rlp-cnt">
208
- <?php $argsdata = array(
 
 
209
  'show_author' => false,
210
- 'show_excerpt' =>false
211
  );
212
  ampforwp_get_relatedpost_content($argsdata); ?>
213
  </div>
@@ -430,7 +432,7 @@ do_action("ampforwp_single_design_type_handle");
430
  </div>
431
  <?php
432
  if ( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_builder_amp['ampforwp-single-related-posts-switch'] ) {
433
- $my_query = related_post_loop_query();
434
  if( $my_query->have_posts() ) { $r_count = 1;?>
435
  <div class="srp">
436
  <?php ampforwp_related_post(); ?>
@@ -446,9 +448,12 @@ do_action("ampforwp_single_design_type_handle");
446
  </div>
447
  <?php } ?>
448
  <div class="rlp-cnt">
449
- <?php $argsdata = array(
 
 
 
450
  'show_author' => false,
451
- 'show_excerpt' =>false
452
  );
453
  ampforwp_get_relatedpost_content($argsdata); ?>
454
  </div>
189
  </div>
190
  <?php }
191
  if ( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_builder_amp['ampforwp-single-related-posts-switch'] ) {
192
+ $my_query = ampforwp_related_post_loop_query();
193
  if( $my_query->have_posts() ) { $r_count = 1;?>
194
  <div class="srp">
195
  <ul class="clearfix">
205
  </div>
206
  <?php } } ?>
207
  <div class="rlp-cnt">
208
+ <?php
209
+ $show_excerpt_opt = $redux_builder_amp['ampforwp-single-related-posts-excerpt'];
210
+ $argsdata = array(
211
  'show_author' => false,
212
+ 'show_excerpt' => $show_excerpt_opt
213
  );
214
  ampforwp_get_relatedpost_content($argsdata); ?>
215
  </div>
432
  </div>
433
  <?php
434
  if ( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_builder_amp['ampforwp-single-related-posts-switch'] ) {
435
+ $my_query = ampforwp_related_post_loop_query();
436
  if( $my_query->have_posts() ) { $r_count = 1;?>
437
  <div class="srp">
438
  <?php ampforwp_related_post(); ?>
448
  </div>
449
  <?php } ?>
450
  <div class="rlp-cnt">
451
+ <?php
452
+ $show_excerpt_opt = $redux_builder_amp['ampforwp-single-related-posts-excerpt'];
453
+
454
+ $argsdata = array(
455
  'show_author' => false,
456
+ 'show_excerpt' => $show_excerpt_opt
457
  );
458
  ampforwp_get_relatedpost_content($argsdata); ?>
459
  </div>
templates/features.php CHANGED
@@ -607,7 +607,7 @@ function ampforwp_new_dir( $dir ) {
607
  add_filter('amp_post_template_data','ampforwp_register_analytics_script', 20);
608
  function ampforwp_register_analytics_script( $data ){
609
  global $redux_builder_amp;
610
- if( true == $redux_builder_amp['ampforwp-ga-switch'] || true == $redux_builder_amp['ampforwp-Segment-switch'] || true == $redux_builder_amp['ampforwp-Quantcast-switch'] || true == $redux_builder_amp['ampforwp-comScore-switch'] || true == $redux_builder_amp['ampforwp-Yandex-switch'] || true == $redux_builder_amp['ampforwp-Chartbeat-switch']|| true == $redux_builder_amp['ampforwp-Alexa-switch'] || true == $redux_builder_amp['ampforwp-afs-analytics-switch'] ) {
611
 
612
  if ( empty( $data['amp_component_scripts']['amp-analytics'] ) ) {
613
  $data['amp_component_scripts']['amp-analytics'] = 'https://cdn.ampproject.org/v0/amp-analytics-0.1.js';
@@ -1348,7 +1348,32 @@ function ampforwp_new_dir( $dir ) {
1348
  </amp-analytics>
1349
  <!-- End AFS Analytics Javascript -->
1350
  <?php
1351
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1352
  }//analytics function ends here
1353
  // For Setting up Google AMP Client ID API
1354
  add_action( 'amp_post_template_head' , 'ampforwp_analytics_clientid_api' );
@@ -2082,6 +2107,8 @@ function ampforwp_remove_schema_data() {
2082
  ampforwp_remove_filters_for_class( 'amp_post_template_data', 'Bunyad_Theme_Amp', 'setup_data', 10 );
2083
  // Remove Jannah Image Lazy Load #2224
2084
  ampforwp_remove_filters_for_class( 'wp_get_attachment_image_attributes', 'TIELABS_FILTERS', 'lazyload_image_attributes', 8 );
 
 
2085
  //SiteOrigin Page builder compatibilty with AMP Frontpage
2086
  if ( ampforwp_is_front_page() ) {
2087
  ampforwp_remove_filters_for_class( 'the_content', 'SiteOrigin_Panels', 'generate_post_content', 10 );
@@ -4480,7 +4507,7 @@ function ampforwp_post_paginated_link_generator( $i ) {
4480
  // Modify the content to make Pagination work on Pages and FrontPage #2253
4481
  add_filter('ampforwp_modify_the_content','ampforwp_post_paginated_content');
4482
  function ampforwp_post_paginated_content($content){
4483
- if ( is_page() || ampforwp_is_front_page() ){
4484
  global $redux_builder_amp, $page, $multipage;
4485
  $ampforwp_new_content = $ampforwp_the_content = $checker = '';
4486
  $ampforwp_the_content = $content;
@@ -5321,7 +5348,6 @@ function ampforwp_add_advance_ga_fields($ga_fields){
5321
  }
5322
  return $ga_fields;
5323
  }
5324
-
5325
  // 84. Inline Related Posts
5326
 
5327
  function ampforwp_inline_related_posts(){
@@ -5410,7 +5436,7 @@ function ampforwp_inline_related_posts(){
5410
 
5411
  if ( ampforwp_has_post_thumbnail() ) {
5412
  if( 4 == $redux_builder_amp['amp-design-selector'] ){
5413
- $thumb_url_2 = ampforwp_aq_resize( $thumb_url_2, 220 , 134 , true, false );
5414
  $inline_related_posts .= '<amp-img src="'.esc_url( $thumb_url_2[0] ).'" width="' . $thumb_url_2[1] . '" height="' . $thumb_url_2[2] . '" layout="responsive"></amp-img>';
5415
  }
5416
  else{
@@ -5443,7 +5469,12 @@ add_action('pre_amp_render_post','ampforwp_add_inline_related_posts');
5443
  function ampforwp_add_inline_related_posts(){
5444
  global $redux_builder_amp;
5445
  if($redux_builder_amp['ampforwp-inline-related-posts'] == 1 && is_single() && ampforwp_inline_related_posts() ){
5446
- add_filter('ampforwp_modify_the_content','ampforwp_generate_inline_related_posts');
 
 
 
 
 
5447
  }
5448
  }
5449
  function ampforwp_generate_inline_related_posts($content){
@@ -5474,6 +5505,48 @@ function ampforwp_generate_inline_related_posts($content){
5474
  return $content;
5475
  }
5476
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5477
  // 85. Caption for Gallery Images
5478
  // Add extra key=>value pair into the attachment array
5479
  add_filter('amp_gallery_image_params','ampforwp_gallery_new_params', 10, 2);
@@ -6911,6 +6984,7 @@ function ampforwp_remove_instant_articles_amp_markup(){
6911
  }
6912
  // #2042
6913
  function ampforwp_404_canonical(){
 
6914
  return home_url( $wp->request );
6915
  }
6916
  // #2001 removing unused JS from the Paginated Posts
@@ -6918,7 +6992,7 @@ add_filter('ampforwp_post_content_filter', 'ampforwp_paginated_post_content');
6918
 
6919
  function ampforwp_paginated_post_content($content){
6920
  global $numpages;
6921
- if(is_single()){
6922
  if ( get_query_var( 'paged' ) ) {
6923
  $paged = get_query_var('paged');
6924
  } elseif ( get_query_var( 'page' ) ) {
@@ -7241,4 +7315,77 @@ function ampforwp_rel_next_prev(){
7241
  if ( get_next_posts_link() ) { ?>
7242
  <link rel="next" href="<?php echo get_pagenum_link( $paged + 1 ); ?>" /><?php
7243
  }
7244
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
607
  add_filter('amp_post_template_data','ampforwp_register_analytics_script', 20);
608
  function ampforwp_register_analytics_script( $data ){
609
  global $redux_builder_amp;
610
+ if( true == $redux_builder_amp['ampforwp-ga-switch'] || true == $redux_builder_amp['ampforwp-Segment-switch'] || true == $redux_builder_amp['ampforwp-Quantcast-switch'] || true == $redux_builder_amp['ampforwp-comScore-switch'] || true == $redux_builder_amp['ampforwp-Yandex-switch'] || true == $redux_builder_amp['ampforwp-Chartbeat-switch']|| true == $redux_builder_amp['ampforwp-Alexa-switch'] || true == $redux_builder_amp['ampforwp-afs-analytics-switch'] || true == $redux_builder_amp['ampforwp-adobe-analytics-switch'] ) {
611
 
612
  if ( empty( $data['amp_component_scripts']['amp-analytics'] ) ) {
613
  $data['amp_component_scripts']['amp-analytics'] = 'https://cdn.ampproject.org/v0/amp-analytics-0.1.js';
1348
  </amp-analytics>
1349
  <!-- End AFS Analytics Javascript -->
1350
  <?php
1351
+ }
1352
+ if ( isset($redux_builder_amp['ampforwp-adobe-analytics-switch']) && true == $redux_builder_amp['ampforwp-adobe-analytics-switch'] ) {
1353
+ $adobe_host = $redux_builder_amp['ampforwp-adobe-host'];
1354
+ $adobe_reportsuiteid = $redux_builder_amp['ampforwp-adobe-reportsuiteid'];
1355
+ ?>
1356
+ <!-- Start Adobe Analytics Support Javascript-->
1357
+ <amp-analytics type="adobeanalytics">
1358
+ <script type="application/json">
1359
+ {
1360
+
1361
+ "vars": {
1362
+ "host": "<?php echo $adobe_host;?>",
1363
+ "reportSuites": "<?php echo $adobe_reportsuiteid;?>",
1364
+ },
1365
+ "triggers": {
1366
+ "pageLoad": {
1367
+ "on": "visible",
1368
+ "request": "pageView"
1369
+ },
1370
+ }
1371
+ }
1372
+ </script>
1373
+ </amp-analytics>
1374
+ <!-- End Adobe Analytics Support Javascript -->
1375
+ <?php
1376
+ }
1377
  }//analytics function ends here
1378
  // For Setting up Google AMP Client ID API
1379
  add_action( 'amp_post_template_head' , 'ampforwp_analytics_clientid_api' );
2107
  ampforwp_remove_filters_for_class( 'amp_post_template_data', 'Bunyad_Theme_Amp', 'setup_data', 10 );
2108
  // Remove Jannah Image Lazy Load #2224
2109
  ampforwp_remove_filters_for_class( 'wp_get_attachment_image_attributes', 'TIELABS_FILTERS', 'lazyload_image_attributes', 8 );
2110
+ // Remove JPG, PNG Compression and Optimization Plugin Lazy Load #2322
2111
+ ampforwp_remove_filters_for_class( 'the_content', 'Wp_Image_compression', 'filter_images', 200 );
2112
  //SiteOrigin Page builder compatibilty with AMP Frontpage
2113
  if ( ampforwp_is_front_page() ) {
2114
  ampforwp_remove_filters_for_class( 'the_content', 'SiteOrigin_Panels', 'generate_post_content', 10 );
4507
  // Modify the content to make Pagination work on Pages and FrontPage #2253
4508
  add_filter('ampforwp_modify_the_content','ampforwp_post_paginated_content');
4509
  function ampforwp_post_paginated_content($content){
4510
+ if ( is_singular() || ampforwp_is_front_page() ){
4511
  global $redux_builder_amp, $page, $multipage;
4512
  $ampforwp_new_content = $ampforwp_the_content = $checker = '';
4513
  $ampforwp_the_content = $content;
5348
  }
5349
  return $ga_fields;
5350
  }
 
5351
  // 84. Inline Related Posts
5352
 
5353
  function ampforwp_inline_related_posts(){
5436
 
5437
  if ( ampforwp_has_post_thumbnail() ) {
5438
  if( 4 == $redux_builder_amp['amp-design-selector'] ){
5439
+ $thumb_url_2 = ampforwp_aq_resize( $thumb_url_2, 220 , 134 , true, false, true );
5440
  $inline_related_posts .= '<amp-img src="'.esc_url( $thumb_url_2[0] ).'" width="' . $thumb_url_2[1] . '" height="' . $thumb_url_2[2] . '" layout="responsive"></amp-img>';
5441
  }
5442
  else{
5469
  function ampforwp_add_inline_related_posts(){
5470
  global $redux_builder_amp;
5471
  if($redux_builder_amp['ampforwp-inline-related-posts'] == 1 && is_single() && ampforwp_inline_related_posts() ){
5472
+ if( isset($redux_builder_amp['ampforwp-inline-related-posts-display-type']) && $redux_builder_amp['ampforwp-inline-related-posts-display-type']=='middle' ){
5473
+ add_filter('ampforwp_modify_the_content','ampforwp_generate_inline_related_posts');
5474
+ }else{
5475
+ add_filter('ampforwp_modify_the_content','ampforwp_generate_inline_related_posts_by_paragraph');
5476
+ }
5477
+
5478
  }
5479
  }
5480
  function ampforwp_generate_inline_related_posts($content){
5505
  return $content;
5506
  }
5507
 
5508
+ function ampforwp_generate_inline_related_posts_by_paragraph($content){
5509
+ global $redux_builder_amp;
5510
+ $total_count = '';
5511
+ $int_number_of_paragraphs = (integer) ampforwp_get_setting('ampforwp-related-posts-after-number-of-paragraphs');
5512
+
5513
+ if(isset($int_number_of_paragraphs) && $int_number_of_paragraphs!=''){
5514
+ if($int_number_of_paragraphs == 0){
5515
+ $content = '<div class="ampforwp-inline-related-post">'.ampforwp_inline_related_posts().'</div>'.$content;
5516
+ }else{
5517
+ $total_count = explode("</p>", $content);
5518
+ $total_count = count($total_count); // call count() only once, it's faster
5519
+ if($total_count < $int_number_of_paragraphs){
5520
+ $content = $content.'<div class="ampforwp-inline-related-post">'.ampforwp_inline_related_posts().'</div>';
5521
+ }else{
5522
+ $content = preg_replace_callback('#(<p>.*?</p>)#', 'ampforwp_add_related_post_after_paragraph', $content);
5523
+ }
5524
+
5525
+ }
5526
+ }else{
5527
+ $content = $content.'<div class="ampforwp-inline-related-post">'.ampforwp_inline_related_posts().'</div>';
5528
+ }
5529
+
5530
+ return $content;
5531
+ }
5532
+
5533
+ function ampforwp_add_related_post_after_paragraph($matches)
5534
+ {
5535
+ global $redux_builder_amp;
5536
+ static $count = 0;
5537
+ $ret = '';
5538
+ $int_number_of_paragraphs = (integer) ampforwp_get_setting('ampforwp-related-posts-after-number-of-paragraphs');
5539
+
5540
+ $ret = $matches[1];
5541
+
5542
+ if (++$count == $int_number_of_paragraphs){
5543
+ $ret .= '<div class="ampforwp-inline-related-post">'.ampforwp_inline_related_posts().'</div>';
5544
+
5545
+ }
5546
+
5547
+ return $ret;
5548
+ }
5549
+
5550
  // 85. Caption for Gallery Images
5551
  // Add extra key=>value pair into the attachment array
5552
  add_filter('amp_gallery_image_params','ampforwp_gallery_new_params', 10, 2);
6984
  }
6985
  // #2042
6986
  function ampforwp_404_canonical(){
6987
+ global $wp;
6988
  return home_url( $wp->request );
6989
  }
6990
  // #2001 removing unused JS from the Paginated Posts
6992
 
6993
  function ampforwp_paginated_post_content($content){
6994
  global $numpages;
6995
+ if(is_singular()){
6996
  if ( get_query_var( 'paged' ) ) {
6997
  $paged = get_query_var('paged');
6998
  } elseif ( get_query_var( 'page' ) ) {
7315
  if ( get_next_posts_link() ) { ?>
7316
  <link rel="next" href="<?php echo get_pagenum_link( $paged + 1 ); ?>" /><?php
7317
  }
7318
+ }
7319
+
7320
+ // Content Sneak Peek #2246
7321
+ add_action('pre_amp_render_post', 'ampforwp_content_sneak_peek');
7322
+ if ( ! function_exists('ampforwp_content_sneak_peek') ) {
7323
+ function ampforwp_content_sneak_peek() {
7324
+ global $redux_builder_amp;
7325
+ if ( isset($redux_builder_amp['content-sneak-peek']) && $redux_builder_amp['content-sneak-peek'] ) {
7326
+ add_filter('ampforwp_modify_the_content', 'ampforwp_sneak_peek_content_modifier');
7327
+ add_action('amp_post_template_css','ampforwp_sneak_peek_css');
7328
+ add_filter('amp_post_template_data','ampforwp_sneak_peek_scripts');
7329
+ }
7330
+
7331
+ }
7332
+ }
7333
+ // Content Sneak Peek content
7334
+ function ampforwp_sneak_peek_content_modifier($content){
7335
+ global $redux_builder_amp;
7336
+ $content = '<div class="fd-h" [class]="contentVisible ? \'show\' : \'fd-h\'">' . $content . '</div>';
7337
+ $content = $content . '<div id="fader" class="content-fader" [class]="contentVisible ? \'content-fader hide\' : \'content-fader\'"></div>';
7338
+ $content = $content . '<div class="fd-b-c" [class]="contentVisible ? \'fd-b-c hide\' : \'fd-b-c\'"><button class="fd-b" [text]="contentVisible ? \'\' : \'Show Full Article\'" on="tap:AMP.setState({contentVisible: !contentVisible})">'.ampforwp_translation($redux_builder_amp['content-sneak-peek-btn-text'], 'Show Full Article').'</button></div>';
7339
+
7340
+ return $content;
7341
+ }
7342
+ // Content Sneak Peek Scripts css
7343
+ function ampforwp_sneak_peek_css(){
7344
+ global $redux_builder_amp;
7345
+ $height = $txt_color = $btn_color = '';
7346
+ $height = $redux_builder_amp['content-sneak-peek-height'];
7347
+ $btn_color = $redux_builder_amp['content-sneak-peek-btn-color']['color'];
7348
+ $txt_color = $redux_builder_amp['content-sneak-peek-txt-color']['color'];?>
7349
+ .fd-h{height: <?php echo $height; ?>;overflow: hidden;}
7350
+ .fd-b-c{text-align: center;}
7351
+ .fd-b-c .fd-b {border: 1px solid #93abbc;border-radius: 5px;color: <?php echo $txt_color; ?>;font-size: 16px;font-weight: 700;line-height: 24px;padding: 8px 5px;width: 250px;background-color: <?php echo $btn_color; ?>; }
7352
+ <?php }
7353
+ // Content Sneak Peek Scripts
7354
+ function ampforwp_sneak_peek_scripts($data) {
7355
+ if ( empty( $data['amp_component_scripts']['amp-bind'] ) ) {
7356
+ $data['amp_component_scripts']['amp-bind'] = 'https://cdn.ampproject.org/v0/amp-bind-0.1.js';
7357
+ }
7358
+ return $data;
7359
+ }
7360
+
7361
+ // #1575 Thrive Content Support
7362
+ add_action('amp_init','ampforwp_thrive_architect_content');
7363
+ function ampforwp_thrive_architect_content(){
7364
+ if(function_exists('tve_wp_action')){
7365
+ add_filter( 'ampforwp_modify_the_content','ampforwp_thrive_content');
7366
+ }
7367
+ }
7368
+ function ampforwp_thrive_content($content){
7369
+ $post_id = "";
7370
+ if ( ampforwp_is_front_page() ){
7371
+ $post_id = ampforwp_get_frontpage_id();
7372
+ $content = get_post_field( 'post_content', $post_id );
7373
+ }
7374
+
7375
+ $sanitizer_obj = new AMPFORWP_Content( $content,
7376
+ array(),
7377
+ apply_filters( 'ampforwp_content_sanitizers',
7378
+ array( 'AMP_Img_Sanitizer' => array(),
7379
+ 'AMP_Blacklist_Sanitizer' => array(),
7380
+ 'AMP_Style_Sanitizer' => array(),
7381
+ 'AMP_Video_Sanitizer' => array(),
7382
+ 'AMP_Audio_Sanitizer' => array(),
7383
+ 'AMP_Iframe_Sanitizer' => array(
7384
+ 'add_placeholder' => true,
7385
+ ),
7386
+ )
7387
+ )
7388
+ );
7389
+ $content = $sanitizer_obj->get_amp_content();
7390
+ return $content;
7391
+ }