AMP for WP – Accelerated Mobile Pages - Version 1.0.77.8

Version Description

(23rd June 2021) = * Added: Webp images support with LiteSpeed Cache plugin #5051 * Added: Primary category compatibility of all SEO plugins #5049 * Added: Notice if license key isn't added in AMP pro extension manager #5068 * Fixed: Instagram embeds are not loading on the Facebook instance Article #5066 * Fixed: WP rocket cache not working with ?amp query string #5063 * Fixed: Debug error appearing in the non-amp #5059 * Fixed: Code improvements for options panel #5057 * Fixed: Disqus comments not showing on mobile when adding ads #5055 * Fixed: Proper preload added if WebP Express is active #4357 * Fixed: The slashes () are no longer appear in the custom CSS #5035

Download this release

Release Info

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

Code changes from version 1.0.77.7 to 1.0.77.8

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.7
7
- Stable tag: 1.0.77.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -193,6 +193,18 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
193
 
194
  == Changelog ==
195
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  = 1.0.77.7 (21st June 2021) =
197
  * Added: AMP Optimizer (SSR) Support #5034
198
 
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.7
7
+ Stable tag: 1.0.77.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
193
 
194
  == Changelog ==
195
 
196
+ = 1.0.77.8 (23rd June 2021) =
197
+ * Added: Webp images support with LiteSpeed Cache plugin #5051
198
+ * Added: Primary category compatibility of all SEO plugins #5049
199
+ * Added: Notice if license key isn't added in AMP pro extension manager #5068
200
+ * Fixed: Instagram embeds are not loading on the Facebook instance Article #5066
201
+ * Fixed: WP rocket cache not working with ?amp query string #5063
202
+ * Fixed: Debug error appearing in the non-amp #5059
203
+ * Fixed: Code improvements for options panel #5057
204
+ * Fixed: Disqus comments not showing on mobile when adding ads #5055
205
+ * Fixed: Proper preload added if WebP Express is active #4357
206
+ * Fixed: The slashes (\) are no longer appear in the custom CSS #5035
207
+
208
  = 1.0.77.7 (21st June 2021) =
209
  * Added: AMP Optimizer (SSR) Support #5034
210
 
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.77.7
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.77.7');
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.77.8
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.77.8');
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.77.7 (21st June 2021) =
4
  * Added: AMP Optimizer (SSR) Support #5034
5
 
1
  == Changelog ==
2
 
3
+ = 1.0.77.8 (23rd June 2021) =
4
+ * Added: Webp images support with LiteSpeed Cache plugin #5051
5
+ * Added: Primary category compatibility of all SEO plugins #5049
6
+ * Added: Notice if license key isn't added in AMP pro extension manager #5068
7
+ * Fixed: Instagram embeds are not loading on the Facebook instance Article #5066
8
+ * Fixed: WP rocket cache not working with ?amp query string #5063
9
+ * Fixed: Debug error appearing in the non-amp #5059
10
+ * Fixed: Code improvements for options panel #5057
11
+ * Fixed: Disqus comments not showing on mobile when adding ads #5055
12
+ * Fixed: Proper preload added if WebP Express is active #4357
13
+ * Fixed: The slashes (\) are no longer appear in the custom CSS #5035
14
+
15
  = 1.0.77.7 (21st June 2021) =
16
  * Added: AMP Optimizer (SSR) Support #5034
17
 
components/categories-tags/categories-tags.php CHANGED
@@ -9,8 +9,29 @@ TODO: 1: Connect with options panel(archive support and translational panel)
9
  global $post;
10
  function ampforwp_framework_get_categories_list( $separator = '' ){
11
  global $post, $redux_builder_amp;
12
- $ampforwp_categories = get_the_terms( $post->ID, 'category' );
13
- if(ampforwp_get_setting('ampforwp-cats-single') == '1'){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  if ( $ampforwp_categories ) : ?>
15
  <div class="amp-category">
16
  <span><?php echo esc_html(ampforwp_translation($redux_builder_amp['amp-translator-categories-text'], 'Categories' )); ?></span>
@@ -46,6 +67,18 @@ function ampforwp_framework_get_categories_list( $separator = '' ){
46
  } ?>
47
  </div>
48
  <?php endif;
 
 
 
 
 
 
 
 
 
 
 
 
49
  }
50
  }
51
  function ampforwp_framework_get_tags_list($separator=''){
9
  global $post;
10
  function ampforwp_framework_get_categories_list( $separator = '' ){
11
  global $post, $redux_builder_amp;
12
+ $ampforwp_categories = get_the_terms( $post->ID, 'category' );
13
+ $cat_id = '';
14
+ if (function_exists('seopress_activation')){
15
+ $cat_id = get_post_meta(ampforwp_get_the_ID(),'_seopress_robots_primary_cat',true);
16
+ }
17
+ if(class_exists( 'WPSEO_Options' )){
18
+ $cat_id = get_post_meta(ampforwp_get_the_ID(), '_yoast_wpseo_primary_category', true);
19
+ }
20
+ if(class_exists('RankMath')){
21
+ $cat_id = get_post_meta(ampforwp_get_the_ID(), 'rank_math_primary_category', true);
22
+ }
23
+ if (function_exists( 'the_seo_framework' )) {
24
+ $cat_id = the_seo_framework()->get_primary_term_id( ampforwp_get_the_ID(),'category' );
25
+ }
26
+ if(class_exists( 'SQ_Classes_ObjController' )){
27
+ $get_cat_id = SQ_Classes_ObjController::getClass('SQ_Models_Domain_Categories')->getAllCategories(ampforwp_get_the_ID());
28
+ $cat_id = key($get_cat_id);
29
+ }
30
+ $cat_id = apply_filters('ampforwp_custom_primary_cat',$cat_id);
31
+ if (isset($cat_id)) {
32
+ $cat_name = get_cat_name($cat_id);
33
+ }
34
+ if(ampforwp_get_setting('ampforwp-cats-single') == '1' && empty($cat_id)){
35
  if ( $ampforwp_categories ) : ?>
36
  <div class="amp-category">
37
  <span><?php echo esc_html(ampforwp_translation($redux_builder_amp['amp-translator-categories-text'], 'Categories' )); ?></span>
67
  } ?>
68
  </div>
69
  <?php endif;
70
+ }else{
71
+ if( true == ampforwp_get_setting('ampforwp-cats-tags-links-single') ){
72
+ $url = get_category_link( $cat_id );
73
+ if( true == ampforwp_get_setting('ampforwp-archive-support') && true == ampforwp_get_setting('ampforwp-archive-support-cat')){
74
+ $url = ampforwp_url_controller($url);
75
+ }
76
+ $anchorTag = '<a href="'.esc_url($url).'" title="'.esc_html($cat_name).'">';
77
+ $anchorClose = "</a>";
78
+ echo ('<span class="amp-cat amp-cat-'.esc_attr($cat_id).'">'.$anchorTag.esc_html($cat_name).$anchorClose.'</span>');
79
+ }else{
80
+ echo ('<span class="amp-cat"> '.esc_html($cat_name).'</span>');
81
+ }
82
  }
83
  }
84
  function ampforwp_framework_get_tags_list($separator=''){
components/comments/comments.php CHANGED
@@ -173,12 +173,8 @@ function ampforwp_framework_get_disqus_comments(){
173
  $layout = 'responsive';
174
  if ( isset($redux_builder_amp['ampforwp-disqus-layout']) && 'fixed' == $redux_builder_amp['ampforwp-disqus-layout'] ) {
175
  $layout = 'fixed';
176
-
177
- if ( isset($redux_builder_amp['ampforwp-disqus-height']) && $redux_builder_amp['ampforwp-disqus-height'] ) {
178
- $height = $redux_builder_amp['ampforwp-disqus-height'];
179
- }
180
  }
181
-
182
  if( $redux_builder_amp['ampforwp-disqus-comments-name'] !== '' ) {
183
  global $post; $post_slug = rawurlencode($post->post_name);
184
 
173
  $layout = 'responsive';
174
  if ( isset($redux_builder_amp['ampforwp-disqus-layout']) && 'fixed' == $redux_builder_amp['ampforwp-disqus-layout'] ) {
175
  $layout = 'fixed';
 
 
 
 
176
  }
177
+ $height = ampforwp_get_setting('ampforwp-disqus-height');
178
  if( $redux_builder_amp['ampforwp-disqus-comments-name'] !== '' ) {
179
  global $post; $post_slug = rawurlencode($post->post_name);
180
 
components/loop/loop.php CHANGED
@@ -549,21 +549,54 @@ function amp_loop_image( $data=array() ) {
549
 
550
  // Category
551
  function amp_loop_category(){
552
- global $redux_builder_amp;
553
- if(count(get_the_category()) > 0){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
554
  echo ' <ul class="loop-category">';
555
- foreach((get_the_category()) as $category) {
556
  if(ampforwp_get_setting('ampforwp-cats-tags-links-single') == true){
557
  $cat_link = get_category_link( $category->term_id );
558
  if(ampforwp_get_setting('ampforwp-archive-support-cat') == true && ampforwp_get_setting('ampforwp-archive-support') == true){
559
  $cat_link = ampforwp_url_controller( $cat_link );
560
  }
561
- echo '<li class="amp-cat-'. $category->term_id.'"><a href="'.esc_url($cat_link).'">'. esc_html($category->cat_name).'</a></li>';
562
  }else{
563
- echo '<li class="amp-cat-'. $category->term_id.'">'. esc_html($category->cat_name).'</li>';
564
  }
565
  }
566
  echo '</ul>';
 
 
 
 
 
 
 
 
 
 
 
 
567
  }
568
  }
569
  // author
549
 
550
  // Category
551
  function amp_loop_category(){
552
+ $categories = get_the_category();
553
+ $cat_id = '';
554
+ if (function_exists('seopress_activation')){
555
+ $cat_id = get_post_meta(ampforwp_get_the_ID(),'_seopress_robots_primary_cat',true);
556
+ }
557
+ if(class_exists( 'WPSEO_Options' )){
558
+ $cat_id = get_post_meta(ampforwp_get_the_ID(), '_yoast_wpseo_primary_category', true);
559
+ }
560
+ if(class_exists('RankMath')){
561
+ $cat_id = get_post_meta(ampforwp_get_the_ID(), 'rank_math_primary_category', true);
562
+ }
563
+ if (function_exists( 'the_seo_framework' )) {
564
+ $cat_id = the_seo_framework()->get_primary_term_id( ampforwp_get_the_ID(),'category' );
565
+ }
566
+ if(class_exists( 'SQ_Classes_ObjController' )){
567
+ $get_cat_id = SQ_Classes_ObjController::getClass('SQ_Models_Domain_Categories')->getAllCategories(ampforwp_get_the_ID());
568
+ $cat_id = key($get_cat_id);
569
+ }
570
+ $cat_id = apply_filters('ampforwp_custom_primary_cat',$cat_id);
571
+ if (isset($cat_id)) {
572
+ $cat_name = get_cat_name($cat_id);
573
+ }
574
+ if( count($categories) > 0 && empty($cat_id)){
575
  echo ' <ul class="loop-category">';
576
+ foreach($categories as $category) {
577
  if(ampforwp_get_setting('ampforwp-cats-tags-links-single') == true){
578
  $cat_link = get_category_link( $category->term_id );
579
  if(ampforwp_get_setting('ampforwp-archive-support-cat') == true && ampforwp_get_setting('ampforwp-archive-support') == true){
580
  $cat_link = ampforwp_url_controller( $cat_link );
581
  }
582
+ echo '<li class="amp-cat-'. esc_attr($category->term_id) .'"><a href="'.esc_url($cat_link).'">'. esc_html($category->cat_name).'</a></li>';
583
  }else{
584
+ echo '<li class="amp-cat-'. esc_attr($category->term_id) .'">'. esc_html($category->cat_name).'</li>';
585
  }
586
  }
587
  echo '</ul>';
588
+ }else{
589
+ echo '<ul class="loop-category">';
590
+ if(ampforwp_get_setting('ampforwp-cats-tags-links-single') == true){
591
+ $cat_link = get_category_link( $cat_id );
592
+ if(ampforwp_get_setting('ampforwp-archive-support-cat') == true && ampforwp_get_setting('ampforwp-archive-support') == true){
593
+ $cat_link = ampforwp_url_controller( $cat_link );
594
+ }
595
+ echo '<li class="amp-cat-'. esc_attr($cat_id) .'"><a href="'.esc_url($cat_link).'">'. esc_html($cat_name).'</a></li>';
596
+ }else{
597
+ echo '<li class="amp-cat-'. esc_attr($cat_id) .'">'. esc_html($cat_name).'</li>';
598
+ }
599
+ echo '</ul>';
600
  }
601
  }
602
  // author
includes/admin-script.js CHANGED
@@ -2176,7 +2176,7 @@ function Drawer(drawerElem) {
2176
  } else if (currentId == 'amp-ux-ext-ssd') {
2177
  activate = '&activate=structure_data';
2178
  } else if (currentId == 'amp-ux-ext-afwp') {
2179
- activate = '&activate=adsforwp';
2180
  }
2181
  console.log(wp.updates.l10n.installing);
2182
 
@@ -2267,7 +2267,7 @@ function Drawer(drawerElem) {
2267
  }
2268
  });
2269
  }else if(self.attr('id')=='amp-ux-ext-afwp'){
2270
- msgplug = 'Ads for WP';
2271
  self.text( 'Importing data...' );
2272
  //Import Data
2273
  jQuery.ajax({
@@ -2275,12 +2275,12 @@ function Drawer(drawerElem) {
2275
  type: 'post',
2276
  data: 'action=ampforwp_import_modules_ads&verify_nonce='+nonce,
2277
  success: function () {
2278
- console.log("Ads for WP");
2279
  var res_url = ampforwp_generate_plugin_ulr(response.redirect_url);
2280
  $('.amp-ux-ext-afwp').html(res_url);
2281
  $("[required=amp-ux-ext-afwp]").addClass("hide");
2282
  var afwp_str = '<div id="section-ampforwp-ads-section" class="redux-section-field redux-field adsactive redux-section-indent-start afw-accordion-header afw-accordion-tab-open">'+
2283
- '<h3 style="margin-top: 20px;">Introducing Ads for WP</h3>'+
2284
  '</div>'+
2285
  '<table id="section-table-ampforwp-ads-section" data-id="ampforwp-ads-section" class="form-table form-table-section no-border form-table-section-indented" style="display: inline-table;">'+
2286
  '<tbody>'+
@@ -2292,15 +2292,15 @@ function Drawer(drawerElem) {
2292
  '<td colspan="2">'+
2293
  '<fieldset id="redux_builder_amp-ampforwp-ads-module" class="redux-field-container redux-field redux-field-init redux-container-raw redux_remove_th" data-id="ampforwp-ads-module" data-type="raw">'+
2294
  '<div class="ampforwp-ads-data-update">'+
2295
- '<input type="hidden" value="admin.php?page=adsforwp&amp;tab=general&amp;reference=ampforwp" class="ampforwp-activation-url" id="active">'+
2296
- 'Thank you for upgrading the Ads for WP'+
2297
  '<div class="row"><div>'+
2298
- '<a href="http://localhost/wasweb/wp-admin/edit.php?post_type=adsforwp">'+
2299
  '<div class="ampforwp-recommendation-btn updated-message">'+
2300
- '<p>Go to Ads for WP settings</p>'+
2301
  '</div>'+
2302
  '</a>&nbsp;<br>'+
2303
- '<a href="https://ampforwp.com/tutorials/article/what-is-ads-for-wp-update-all-about/" class="amp_recommend_learnmore" target="_blank">Learn more</a>'+
2304
  '</div>'+
2305
  '</fieldset>'+
2306
  '</td>'+
2176
  } else if (currentId == 'amp-ux-ext-ssd') {
2177
  activate = '&activate=structure_data';
2178
  } else if (currentId == 'amp-ux-ext-afwp') {
2179
+ activate = '&activate=quads-settings';
2180
  }
2181
  console.log(wp.updates.l10n.installing);
2182
 
2267
  }
2268
  });
2269
  }else if(self.attr('id')=='amp-ux-ext-afwp'){
2270
+ msgplug = 'Ads by WPQuads';
2271
  self.text( 'Importing data...' );
2272
  //Import Data
2273
  jQuery.ajax({
2275
  type: 'post',
2276
  data: 'action=ampforwp_import_modules_ads&verify_nonce='+nonce,
2277
  success: function () {
2278
+ console.log("Ads by WPQuads");
2279
  var res_url = ampforwp_generate_plugin_ulr(response.redirect_url);
2280
  $('.amp-ux-ext-afwp').html(res_url);
2281
  $("[required=amp-ux-ext-afwp]").addClass("hide");
2282
  var afwp_str = '<div id="section-ampforwp-ads-section" class="redux-section-field redux-field adsactive redux-section-indent-start afw-accordion-header afw-accordion-tab-open">'+
2283
+ '<h3 style="margin-top: 20px;">Introducing Ads by WPQuads</h3>'+
2284
  '</div>'+
2285
  '<table id="section-table-ampforwp-ads-section" data-id="ampforwp-ads-section" class="form-table form-table-section no-border form-table-section-indented" style="display: inline-table;">'+
2286
  '<tbody>'+
2292
  '<td colspan="2">'+
2293
  '<fieldset id="redux_builder_amp-ampforwp-ads-module" class="redux-field-container redux-field redux-field-init redux-container-raw redux_remove_th" data-id="ampforwp-ads-module" data-type="raw">'+
2294
  '<div class="ampforwp-ads-data-update">'+
2295
+ '<input type="hidden" value="admin.php?page=quads-settings&amp;tab=general&amp;reference=ampforwp" class="ampforwp-activation-url" id="active">'+
2296
+ 'Thank you for upgrading the Ads by WPQuads'+
2297
  '<div class="row"><div>'+
2298
+ '<a href="http://localhost/wasweb/wp-admin/edit.php?post_type=quads-settings">'+
2299
  '<div class="ampforwp-recommendation-btn updated-message">'+
2300
+ '<p>Go to Ads by WPQuads settings</p>'+
2301
  '</div>'+
2302
  '</a>&nbsp;<br>'+
2303
+ '<a href="https://wpquads.com/documentation/" class="amp_recommend_learnmore" target="_blank">Learn more</a>'+
2304
  '</div>'+
2305
  '</fieldset>'+
2306
  '</td>'+
includes/ampforwp-fields-array.php CHANGED
@@ -424,14 +424,14 @@ if(file_exists(AMPFORWP_MAIN_PLUGIN_DIR."schema-and-structured-data-for-wp/struc
424
  $is_afwp = "not-exist";
425
  $afwp_active_url = '';
426
  $afwp_default = 0;
427
- if(file_exists(AMPFORWP_MAIN_PLUGIN_DIR."ads-for-wp/ads-for-wp.php")){
428
- if(!is_plugin_active('ads-for-wp/ads-for-wp.php')){
429
  $is_afwp = "inactive";
430
- $plugin_file = "ads-for-wp/ads-for-wp.php";
431
  $afwp_active_url = ampforwp_wp_plugin_action_link( $plugin_file, 'activate' );
432
  }else{
433
  $is_afwp = "active";
434
- $afwp_active_url = $ampforwp_admin_url.'admin.php?page=adsforwp&amp;tab=general&amp;reference=ampforwp';
435
  $afwp_default = 2;
436
  }
437
  }
@@ -652,7 +652,7 @@ $amp_ux_fields[] = array('field_type'=>'switch','field_data'=>array('title'=>"St
652
 
653
  $amp_ux_fields[] = array('field_type'=>'notification', 'field_data'=>array('type'=>'notice','desc'=>'Please wait until process completes.','required'=>array('amp-ux-ext-ssd','=',0),'default'=>0));
654
 
655
- $amp_ux_fields[] = array('field_type'=>'switch','field_data'=>array('title'=>"Ads for WP",'id'=>"amp-ux-ext-afwp",'class'=>esc_attr($afwp_class),'data-id'=>'amp-ux-ext-afwp-switch','desc'=>'','data-secure'=>esc_attr($ux_secure),'element-class'=>'third-pp','parent-class'=>'ux-seo-blk','default'=>esc_attr($afwp_default),'data-url'=>esc_url($afwp_active_url)));
656
 
657
  $amp_ux_fields[] = array('field_type'=>'notification', 'field_data'=>array('type'=>'notice','desc'=>'Please wait until process completes.','required'=>array('amp-ux-ext-afwp','=',0),'default'=>0));
658
 
424
  $is_afwp = "not-exist";
425
  $afwp_active_url = '';
426
  $afwp_default = 0;
427
+ if(file_exists(AMPFORWP_MAIN_PLUGIN_DIR."quick-adsense-reloaded/quick-adsense-reloaded.php")){
428
+ if(!is_plugin_active('quick-adsense-reloaded/quick-adsense-reloaded.php')){
429
  $is_afwp = "inactive";
430
+ $plugin_file = "quick-adsense-reloaded/quick-adsense-reloaded.php";
431
  $afwp_active_url = ampforwp_wp_plugin_action_link( $plugin_file, 'activate' );
432
  }else{
433
  $is_afwp = "active";
434
+ $afwp_active_url = $ampforwp_admin_url.'admin.php?page=quads-settings&amp;tab=general&amp;reference=ampforwp';
435
  $afwp_default = 2;
436
  }
437
  }
652
 
653
  $amp_ux_fields[] = array('field_type'=>'notification', 'field_data'=>array('type'=>'notice','desc'=>'Please wait until process completes.','required'=>array('amp-ux-ext-ssd','=',0),'default'=>0));
654
 
655
+ $amp_ux_fields[] = array('field_type'=>'switch','field_data'=>array('title'=>"Ads by WPQuads",'id'=>"amp-ux-ext-afwp",'class'=>esc_attr($afwp_class),'data-id'=>'amp-ux-ext-afwp-switch','desc'=>'','data-secure'=>esc_attr($ux_secure),'element-class'=>'third-pp','parent-class'=>'ux-seo-blk','default'=>esc_attr($afwp_default),'data-url'=>esc_url($afwp_active_url)));
656
 
657
  $amp_ux_fields[] = array('field_type'=>'notification', 'field_data'=>array('type'=>'notice','desc'=>'Please wait until process completes.','required'=>array('amp-ux-ext-afwp','=',0),'default'=>0));
658
 
includes/features/functions.php CHANGED
@@ -70,6 +70,12 @@ function ampforwp_add_admin_styling($hook_suffix){
70
  add_action('admin_notices', 'ampforwp_mobile_redirection_notice' );
71
  add_action('admin_notices', 'ampforwp_category_base_remove_notice' );
72
  add_action('admin_notices', 'ampforwp_internal_feedback_notice' );
 
 
 
 
 
 
73
  }else{
74
  $redux_data['ampforwp-amp-takeover'] = ampforwp_get_setting('ampforwp-amp-takeover');
75
  }
@@ -1497,4 +1503,13 @@ function ampforwp_feedback_remove_notice(){
1497
  }
1498
  wp_die();
1499
  }
1500
- add_action('wp_ajax_ampforwp_feedback_remove_notice', 'ampforwp_feedback_remove_notice');
 
 
 
 
 
 
 
 
 
70
  add_action('admin_notices', 'ampforwp_mobile_redirection_notice' );
71
  add_action('admin_notices', 'ampforwp_category_base_remove_notice' );
72
  add_action('admin_notices', 'ampforwp_internal_feedback_notice' );
73
+ if ( defined('AMPFORWPPRO_PLUGIN_DIR') ) {
74
+ $license_info = get_option( 'ampforwppro_license_info');
75
+ if (!$license_info) {
76
+ add_action('admin_notices', 'ampforwp_pro_extension_manager_notice' );
77
+ }
78
+ }
79
  }else{
80
  $redux_data['ampforwp-amp-takeover'] = ampforwp_get_setting('ampforwp-amp-takeover');
81
  }
1503
  }
1504
  wp_die();
1505
  }
1506
+ add_action('wp_ajax_ampforwp_feedback_remove_notice', 'ampforwp_feedback_remove_notice');
1507
+
1508
+ function ampforwp_pro_extension_manager_notice(){?>
1509
+ <div class="updated notice ampforwp_remove_notice" style="box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);background-color:white;">
1510
+ <p>
1511
+ <?php echo esc_html__('AMP Pro Extension Manager has been activated, Please enter your license key', 'accelerated-mobile-pages'); ?>
1512
+ <a href="<?php echo esc_url(admin_url('admin.php?page=amp-extension-manager')) ?>" style="font-weight:bold;"> <?php echo esc_html__('here', 'accelerated-mobile-pages') ?></a>
1513
+ </p>
1514
+ </div>
1515
+ <?php }
includes/options/admin-config.php CHANGED
@@ -2501,7 +2501,7 @@ function ampforwp_get_all_tags($id){
2501
  'title' => esc_html__('Disqus Iframe Height', 'accelerated-mobile-pages'),
2502
  'placeholder' => 'Enter the height',
2503
  'default' => '420',
2504
- 'required' => array('ampforwp-disqus-layout', '=' , 'fixed'),
2505
  ),
2506
  array(
2507
  'id' => 'ampforwp-facebook-comments-support',
2501
  'title' => esc_html__('Disqus Iframe Height', 'accelerated-mobile-pages'),
2502
  'placeholder' => 'Enter the height',
2503
  'default' => '420',
2504
+ 'required'=>array('ampforwp-disqus-comments-support','=','1'),
2505
  ),
2506
  array(
2507
  'id' => 'ampforwp-facebook-comments-support',
includes/options/redux-core/framework.php CHANGED
@@ -2849,9 +2849,6 @@
2849
  if ( version_compare( PHP_VERSION, '7.4', '<' ) && function_exists( 'get_magic_quotes_gpc' ) && get_magic_quotes_gpc() ) {
2850
  $values = array_map( 'stripslashes_deep', $values );
2851
  }
2852
- else{
2853
- $values = stripslashes_deep($values);
2854
- }
2855
 
2856
  if ( ! empty ( $values ) ) {
2857
 
2849
  if ( version_compare( PHP_VERSION, '7.4', '<' ) && function_exists( 'get_magic_quotes_gpc' ) && get_magic_quotes_gpc() ) {
2850
  $values = array_map( 'stripslashes_deep', $values );
2851
  }
 
 
 
2852
 
2853
  if ( ! empty ( $values ) ) {
2854
 
includes/vendor/amp/includes/amp-post-template-actions.php CHANGED
@@ -60,7 +60,7 @@ function amp_post_template_add_cached_link($amp_template) {
60
  $image_size = ampforwp_get_setting('swift-featued-image-size');
61
  $image = wp_get_attachment_image_src( $thumb_id, $image_size );
62
  if($image!="" && isset($image[0])){
63
- if(function_exists('_imagify_init')){
64
  $image[0] = esc_url($image[0]).".webp";
65
  }?>
66
  <link rel="preload" href="<?php echo esc_url($image[0]);?>" as="image">
60
  $image_size = ampforwp_get_setting('swift-featued-image-size');
61
  $image = wp_get_attachment_image_src( $thumb_id, $image_size );
62
  if($image!="" && isset($image[0])){
63
+ if(function_exists('_imagify_init') || function_exists('webp_express_process_post')){
64
  $image[0] = esc_url($image[0]).".webp";
65
  }?>
66
  <link rel="preload" href="<?php echo esc_url($image[0]);?>" as="image">
includes/vendor/aq_resizer.php CHANGED
@@ -292,7 +292,7 @@ if(!function_exists('ampforwp_aq_resize')) {
292
  // Disable ampforwp_aq_resize and return images without compressing.
293
  // Useful for some who wants to disable when using CDN images
294
  $disable_aq_resize = false;
295
- if (function_exists('imagify_set_activation') || function_exists('ud_check_stateless_media')) {
296
  $disable_aq_resize = true;
297
  }
298
  $disable_aq_resize = apply_filters('ampforwp_disable_aq_resize', $disable_aq_resize, $url);
292
  // Disable ampforwp_aq_resize and return images without compressing.
293
  // Useful for some who wants to disable when using CDN images
294
  $disable_aq_resize = false;
295
+ if (function_exists('imagify_set_activation') || function_exists('ud_check_stateless_media') || function_exists('webp_express_process_post')) {
296
  $disable_aq_resize = true;
297
  }
298
  $disable_aq_resize = apply_filters('ampforwp_disable_aq_resize', $disable_aq_resize, $url);
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.7
7
- Stable tag: 1.0.77.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -190,6 +190,18 @@ You can contact us from [here](https://ampforwp.com/contact/)
190
 
191
  == Changelog ==
192
 
 
 
 
 
 
 
 
 
 
 
 
 
193
  = 1.0.77.7 (21st June 2021) =
194
  * Added: AMP Optimizer (SSR) Support #5034
195
 
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.7
7
+ Stable tag: 1.0.77.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
190
 
191
  == Changelog ==
192
 
193
+ = 1.0.77.8 (23rd June 2021) =
194
+ * Added: Webp images support with LiteSpeed Cache plugin #5051
195
+ * Added: Primary category compatibility of all SEO plugins #5049
196
+ * Added: Notice if license key isn't added in AMP pro extension manager #5068
197
+ * Fixed: Instagram embeds are not loading on the Facebook instance Article #5066
198
+ * Fixed: WP rocket cache not working with ?amp query string #5063
199
+ * Fixed: Debug error appearing in the non-amp #5059
200
+ * Fixed: Code improvements for options panel #5057
201
+ * Fixed: Disqus comments not showing on mobile when adding ads #5055
202
+ * Fixed: Proper preload added if WebP Express is active #4357
203
+ * Fixed: The slashes (\) are no longer appear in the custom CSS #5035
204
+
205
  = 1.0.77.7 (21st June 2021) =
206
  * Added: AMP Optimizer (SSR) Support #5034
207
 
templates/features.php CHANGED
@@ -2245,12 +2245,8 @@ function ampforwp_add_disqus_support() {
2245
  $display_comments_on = ampforwp_get_comments_status();
2246
  if ( isset($redux_builder_amp['ampforwp-disqus-layout']) && 'fixed' == $redux_builder_amp['ampforwp-disqus-layout'] ) {
2247
  $layout = 'fixed';
2248
-
2249
- if ( isset($redux_builder_amp['ampforwp-disqus-height']) && $redux_builder_amp['ampforwp-disqus-height'] ) {
2250
- $height = $redux_builder_amp['ampforwp-disqus-height'];
2251
- }
2252
  }
2253
-
2254
  if ( $redux_builder_amp['ampforwp-disqus-comments-support'] && 4 != $redux_builder_amp['amp-design-selector'] && $display_comments_on ) {
2255
  if( $redux_builder_amp['ampforwp-disqus-comments-name'] !== '' ) {
2256
  global $post; $post_slug = rawurlencode($post->post_name);
@@ -6234,7 +6230,7 @@ function ampforwp_is_non_amp( $type="" ) {
6234
  }
6235
  }
6236
  }
6237
- if ( is_front_page() && false == $redux_builder_amp['ampforwp-homepage-on-off-support'] ) {
6238
  return false;
6239
  }
6240
  if ( is_feed() ) {
@@ -6246,33 +6242,31 @@ function ampforwp_is_non_amp( $type="" ) {
6246
  if ( function_exists('is_embed') && is_embed() ){
6247
  return;
6248
  }
6249
- if(is_search() && 0 == ampforwp_get_setting('amp-redirection-search')){
6250
  return false;
6251
  }
6252
  }elseif( (
6253
  ampforwp_get_setting('amp-design-selector') == 4)
6254
  &&
6255
  (
6256
- isset( $redux_builder_amp['ampforwp-amp-convert-to-wp'])
6257
- && true == $redux_builder_amp['ampforwp-amp-convert-to-wp']
6258
  )
6259
  ||
6260
  (
6261
  'non_amp_check_convert' === $type
6262
- && isset( $redux_builder_amp['ampforwp-amp-convert-to-wp'])
6263
- && true == $redux_builder_amp['ampforwp-amp-convert-to-wp']
6264
  ) ) {
6265
  $non_amp = true;
6266
 
6267
  }
6268
  // Convert AMP to WP issues fixed #2493
6269
  //Blogposts
6270
- if ( is_home() && $redux_builder_amp['ampforwp-homepage-on-off-support'] ==false ) {
6271
  return;
6272
  }
6273
  // Pages
6274
 
6275
- if ( is_page() && false == $redux_builder_amp['amp-on-off-for-all-pages'] ) {
6276
  return;
6277
  }
6278
  if ( is_singular() || ampforwp_is_front_page() || ampforwp_is_blog() ) {
@@ -8742,6 +8736,7 @@ if(!function_exists('ampforwp_add_fallback_element')){
8742
  $m_content = ampforwp_imagify_webp_compatibility($m_content);
8743
  $m_content = ampforwp_ewww_webp_compatibility($m_content);
8744
  $m_content = ampforwp_webp_express_compatibility($m_content);
 
8745
  $m1_content = ampforwp_set_default_fallback_image($matches[1][$i]);
8746
  preg_match_all('/src="(.*?)"/', $m1_content,$fimgsrc);
8747
  preg_match_all('/width="(.*?)"/', $m1_content,$fimgwidth);
@@ -9548,7 +9543,7 @@ function ampforwp_webp_express_compatibility($content){
9548
  preg_match_all('/src="(.*?)"/', $content,$src);
9549
  if(isset($src[1][0])){
9550
  $img_url = esc_url($src[1][0]);
9551
- if(preg_match('/http(.*?)\/wp-content\/uploads/', $img_url)){
9552
  $img_url_webp = preg_replace('/http(.*?)\/wp-content(.*?)/', 'http$1/wp-content/webp-express/webp-images/doc-root/wp-content$2', $img_url);
9553
  if(!preg_match('/\.webp/', $img_url)){
9554
  $img_url_webp = esc_url($img_url_webp).".webp";
@@ -9603,4 +9598,33 @@ function ampforwp_year_shortcode() {
9603
  $year = date('Y');
9604
  return $year;
9605
  }
9606
- add_shortcode('ampforwp_current_year', 'ampforwp_year_shortcode');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2245
  $display_comments_on = ampforwp_get_comments_status();
2246
  if ( isset($redux_builder_amp['ampforwp-disqus-layout']) && 'fixed' == $redux_builder_amp['ampforwp-disqus-layout'] ) {
2247
  $layout = 'fixed';
 
 
 
 
2248
  }
2249
+ $height = ampforwp_get_setting('ampforwp-disqus-height');
2250
  if ( $redux_builder_amp['ampforwp-disqus-comments-support'] && 4 != $redux_builder_amp['amp-design-selector'] && $display_comments_on ) {
2251
  if( $redux_builder_amp['ampforwp-disqus-comments-name'] !== '' ) {
2252
  global $post; $post_slug = rawurlencode($post->post_name);
6230
  }
6231
  }
6232
  }
6233
+ if ( is_front_page() && false == ampforwp_get_setting('ampforwp-homepage-on-off-support') ) {
6234
  return false;
6235
  }
6236
  if ( is_feed() ) {
6242
  if ( function_exists('is_embed') && is_embed() ){
6243
  return;
6244
  }
6245
+ if(is_search() && 0 == ampforwp_get_setting('amp-redirection-search')){
6246
  return false;
6247
  }
6248
  }elseif( (
6249
  ampforwp_get_setting('amp-design-selector') == 4)
6250
  &&
6251
  (
6252
+ true == ampforwp_get_setting('ampforwp-amp-convert-to-wp')
 
6253
  )
6254
  ||
6255
  (
6256
  'non_amp_check_convert' === $type
6257
+ && true == ampforwp_get_setting('ampforwp-amp-convert-to-wp')
 
6258
  ) ) {
6259
  $non_amp = true;
6260
 
6261
  }
6262
  // Convert AMP to WP issues fixed #2493
6263
  //Blogposts
6264
+ if ( is_home() && ampforwp_get_setting('ampforwp-homepage-on-off-support') == false ) {
6265
  return;
6266
  }
6267
  // Pages
6268
 
6269
+ if ( is_page() && false == ampforwp_get_setting('amp-on-off-for-all-pages') ) {
6270
  return;
6271
  }
6272
  if ( is_singular() || ampforwp_is_front_page() || ampforwp_is_blog() ) {
8736
  $m_content = ampforwp_imagify_webp_compatibility($m_content);
8737
  $m_content = ampforwp_ewww_webp_compatibility($m_content);
8738
  $m_content = ampforwp_webp_express_compatibility($m_content);
8739
+ $m_content = ampforwp_litespeed_webp_compatibility($m_content);
8740
  $m1_content = ampforwp_set_default_fallback_image($matches[1][$i]);
8741
  preg_match_all('/src="(.*?)"/', $m1_content,$fimgsrc);
8742
  preg_match_all('/width="(.*?)"/', $m1_content,$fimgwidth);
9543
  preg_match_all('/src="(.*?)"/', $content,$src);
9544
  if(isset($src[1][0])){
9545
  $img_url = esc_url($src[1][0]);
9546
+ if(file_exists($img_url_webp) && !preg_match('/\.webp/', $img_url)){
9547
  $img_url_webp = preg_replace('/http(.*?)\/wp-content(.*?)/', 'http$1/wp-content/webp-express/webp-images/doc-root/wp-content$2', $img_url);
9548
  if(!preg_match('/\.webp/', $img_url)){
9549
  $img_url_webp = esc_url($img_url_webp).".webp";
9598
  $year = date('Y');
9599
  return $year;
9600
  }
9601
+ add_shortcode('ampforwp_current_year', 'ampforwp_year_shortcode');
9602
+
9603
+ function ampforwp_litespeed_webp_compatibility($content){
9604
+ if(function_exists( 'run_litespeed_cache' )){
9605
+ preg_match_all('/src="(.*?)"/', $content,$src);
9606
+ if(isset($src[1][0])){
9607
+ $img_url = esc_url($src[1][0]);
9608
+ if(!preg_match('/\.webp/', $img_url)){
9609
+ $rep_url = esc_url($src[1][0]).".webp";
9610
+ if(preg_match('/http(.*)\/wp-content\/uploads/', $rep_url)){
9611
+ $upload_dir = wp_upload_dir()['basedir'];
9612
+ $img_file = preg_replace('/http(.*)\/wp-content\/uploads/', $upload_dir, $rep_url);
9613
+ if(file_exists($img_file)){
9614
+ $content = str_replace($img_url, $rep_url, $content);
9615
+ }
9616
+ }
9617
+ }
9618
+ }
9619
+ }
9620
+ return $content;
9621
+ }
9622
+
9623
+ if (ampforwp_get_setting('amp-core-end-point') && function_exists('get_rocket_cache_query_string') ) {
9624
+ add_filter('rocket_cache_query_strings', 'ampforwp_rocket_cache_query_string');
9625
+ }
9626
+
9627
+ function ampforwp_rocket_cache_query_string($query_strings){
9628
+ array_push($query_strings,"amp");
9629
+ return $query_strings;
9630
+ }
templates/instant-articles/instant-article-sanitizer.php CHANGED
@@ -156,7 +156,10 @@ function ampforwp_fbia_get_content_from_DOM($DOMDocument){
156
  $filtered_content .= $temp_content;
157
  }
158
  }
159
-
 
 
 
160
  return $filtered_content;
161
  }
162
 
156
  $filtered_content .= $temp_content;
157
  }
158
  }
159
+ //Instagram embeds are not loading on the Facebook instance Article #5066
160
+ if (preg_match('/<blockquote class="instagram-media"/', $filtered_content)) {
161
+ $filtered_content = preg_replace( '/<blockquote class="instagram-media"(.*?)>(.*?)<\/blockquote><\/iframe><\/figure>(.*?)<script(.*?)src="(.*?)instagram(.*?)"><\/script>/s', '<blockquote class="instagram-media"$1>$2</blockquote><script$4src="$5instagram$6"></script></iframe></figure>$3', $filtered_content );
162
+ }
163
  return $filtered_content;
164
  }
165