AMP for WP – Accelerated Mobile Pages - Version 1.0.77.20

Version Description

(24th August 2021) = * Fixed: Validation errors when Jetpack boost plugin is active #5120 * Fixed: Display Warning Icon more clearly if setup is not completed #5119 * Fixed: Image loading issues while using Webp express #5118

Download this release

Release Info

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

Code changes from version 1.0.77.19 to 1.0.77.20

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.8
7
- Stable tag: 1.0.77.19
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -197,6 +197,11 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
197
 
198
  == Changelog ==
199
 
 
 
 
 
 
200
  = 1.0.77.19 (13th August 2021) =
201
  * Fixed: Disable AMP on desktop not working with ?amp #5113
202
  * Fixed: Can't use function return value error when activating plugin #5115
@@ -205,8 +210,4 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
205
  = 1.0.77.18 (5th August 2021) =
206
  * Improvements: Added License Key information in AMP panel #5110
207
 
208
- = 1.0.77.17 (3rd August 2021) =
209
- * Improvements: Added dotmetrics analytics support in amp #5107
210
- * Improvements: Added support to preserve query string with ?amp #5103
211
-
212
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.8
7
+ Stable tag: 1.0.77.20
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
197
 
198
  == Changelog ==
199
 
200
+ = 1.0.77.20 (24th August 2021) =
201
+ * Fixed: Validation errors when Jetpack boost plugin is active #5120
202
+ * Fixed: Display Warning Icon more clearly if setup is not completed #5119
203
+ * Fixed: Image loading issues while using Webp express #5118
204
+
205
  = 1.0.77.19 (13th August 2021) =
206
  * Fixed: Disable AMP on desktop not working with ?amp #5113
207
  * Fixed: Can't use function return value error when activating plugin #5115
210
  = 1.0.77.18 (5th August 2021) =
211
  * Improvements: Added License Key information in AMP panel #5110
212
 
 
 
 
 
213
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
accelerated-moblie-pages.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Accelerated Mobile Pages
4
  Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
5
  Description: AMP for WP - Accelerated Mobile Pages for WordPress
6
- Version: 1.0.77.19
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.19');
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.20
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.20');
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,10 @@
1
  == Changelog ==
2
 
 
 
 
 
 
3
  = 1.0.77.19 (13th August 2021) =
4
  * Fixed: Disable AMP on desktop not working with ?amp #5113
5
  * Fixed: Can't use function return value error when activating plugin #5115
1
  == Changelog ==
2
 
3
+ = 1.0.77.20 (24th August 2021) =
4
+ * Fixed: Validation errors when Jetpack boost plugin is active #5120
5
+ * Fixed: Display Warning Icon more clearly if setup is not completed #5119
6
+ * Fixed: Image loading issues while using Webp express #5118
7
+
8
  = 1.0.77.19 (13th August 2021) =
9
  * Fixed: Disable AMP on desktop not working with ?amp #5113
10
  * Fixed: Can't use function return value error when activating plugin #5115
includes/features/functions.php CHANGED
@@ -76,6 +76,17 @@ function ampforwp_add_admin_styling($hook_suffix){
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
  }
@@ -1510,4 +1521,12 @@ function ampforwp_pro_extension_manager_notice(){?>
1510
  <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>
1511
  </p>
1512
  </div>
 
 
 
 
 
 
 
 
1513
  <?php }
76
  add_action('admin_notices', 'ampforwp_pro_extension_manager_notice' );
77
  }
78
  }
79
+ $setup_ids = array(
80
+ 'ampforwp-ux-website-type-section',
81
+ 'ampforwp-ux-need-type-section',
82
+ 'ampforwp-ux-analytics-section'
83
+ );
84
+ for($sid = 0; $sid < count($setup_ids); $sid++ ){
85
+ $check = ampforwp_get_setup_info($setup_ids[$sid]);
86
+ if($check == ""){
87
+ add_action('admin_notices', 'ampforwp_incomplate_setup_notice' );
88
+ }
89
+ }
90
  }else{
91
  $redux_data['ampforwp-amp-takeover'] = ampforwp_get_setting('ampforwp-amp-takeover');
92
  }
1521
  <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>
1522
  </p>
1523
  </div>
1524
+ <?php }
1525
+
1526
+ function ampforwp_incomplate_setup_notice(){?>
1527
+ <div class="updated notice ampforwp_remove_notice">
1528
+ <p>
1529
+ <?php esc_html_e('Your setup is not completed. Please setup for better AMP Experience', 'accelerated-mobile-pages'); ?>
1530
+ </p>
1531
+ </div>
1532
  <?php }
includes/thirdparty-compatibility.php CHANGED
@@ -1308,4 +1308,11 @@ if(!function_exists('ampforwp_category_image_compatibility')){
1308
  echo $cat_image;
1309
  }
1310
  }
 
 
 
 
 
 
 
1311
  }
1308
  echo $cat_image;
1309
  }
1310
  }
1311
+ }
1312
+ add_action('plugins_loaded', 'ampforwp_jetpack_boost_compatibility' , 0);
1313
+ function ampforwp_jetpack_boost_compatibility(){
1314
+ $url_path = trim(parse_url(add_query_arg(array()), PHP_URL_PATH),'/' );
1315
+ if (function_exists('\Automattic\Jetpack_Boost\run_jetpack_boost') && function_exists('ampforwp_is_amp_inURL') && ampforwp_is_amp_inURL($url_path)) {
1316
+ remove_action( 'plugins_loaded', '\Automattic\Jetpack_Boost\run_jetpack_boost', 1 );
1317
+ }
1318
  }
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.8
7
- Stable tag: 1.0.77.19
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -194,6 +194,11 @@ You can contact us from [here](https://ampforwp.com/contact/)
194
 
195
  == Changelog ==
196
 
 
 
 
 
 
197
  = 1.0.77.19 (13th August 2021) =
198
  * Fixed: Disable AMP on desktop not working with ?amp #5113
199
  * Fixed: Can't use function return value error when activating plugin #5115
@@ -202,8 +207,4 @@ You can contact us from [here](https://ampforwp.com/contact/)
202
  = 1.0.77.18 (5th August 2021) =
203
  * Improvements: Added License Key information in AMP panel #5110
204
 
205
- = 1.0.77.17 (3rd August 2021) =
206
- * Improvements: Added dotmetrics analytics support in amp #5107
207
- * Improvements: Added support to preserve query string with ?amp #5103
208
-
209
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.8
7
+ Stable tag: 1.0.77.20
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
194
 
195
  == Changelog ==
196
 
197
+ = 1.0.77.20 (24th August 2021) =
198
+ * Fixed: Validation errors when Jetpack boost plugin is active #5120
199
+ * Fixed: Display Warning Icon more clearly if setup is not completed #5119
200
+ * Fixed: Image loading issues while using Webp express #5118
201
+
202
  = 1.0.77.19 (13th August 2021) =
203
  * Fixed: Disable AMP on desktop not working with ?amp #5113
204
  * Fixed: Can't use function return value error when activating plugin #5115
207
  = 1.0.77.18 (5th August 2021) =
208
  * Improvements: Added License Key information in AMP panel #5110
209
 
 
 
 
 
210
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
templates/features.php CHANGED
@@ -9544,7 +9544,15 @@ function ampforwp_webp_express_compatibility($content){
9544
  if(isset($src[1][0])){
9545
  $img_url = esc_url($src[1][0]);
9546
  if(!preg_match('/\.webp/', $img_url)){
9547
- $img_url_webp = preg_replace('/http(.*?)\/wp-content(.*?)/', 'http$1/wp-content/webp-express/webp-images$2', $img_url);
 
 
 
 
 
 
 
 
9548
  if(!preg_match('/\.webp/', $img_url)){
9549
  $img_url_webp = esc_url($img_url_webp).".webp";
9550
  $content = str_replace($img_url, $img_url_webp, $content);
9544
  if(isset($src[1][0])){
9545
  $img_url = esc_url($src[1][0]);
9546
  if(!preg_match('/\.webp/', $img_url)){
9547
+ $config = \WebPExpress\Config::loadConfigAndFix();
9548
+ if($config['destination-folder'] == 'mingled'){
9549
+ $img_url_webp = $img_url;
9550
+ }else{
9551
+ $img_url_webp = preg_replace('/http(.*?)\/wp-content(.*?)/', 'http$1/wp-content/webp-express/webp-images$2', $img_url);
9552
+ if($config['destination-structure'] == 'doc-root'){
9553
+ $img_url_webp = preg_replace('/http(.*?)\/wp-content(.*?)/', 'http$1/wp-content/webp-express/webp-images/doc-root/wordpress/wp-content$2', $img_url);
9554
+ }
9555
+ }
9556
  if(!preg_match('/\.webp/', $img_url)){
9557
  $img_url_webp = esc_url($img_url_webp).".webp";
9558
  $content = str_replace($img_url, $img_url_webp, $content);