AMP for WP – Accelerated Mobile Pages - Version 1.0.77.21

Version Description

(6th September 2021) = * Fixed: Images not displaying in AMP with Lazy loading of Zeen theme #5126 * Fixed: Missing rel noopener attribute in links #5125 * Fixed: Incorrect canonical for Homepage if WordPress installation is another folder #5122 * Fixed: No data hero attribute on featured image of default image #5121 * Fixed: Debug log errors #5124

Download this release

Release Info

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

Code changes from version 1.0.77.20 to 1.0.77.21

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.20
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -197,6 +197,13 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
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
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.21
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.21 (6th September 2021) =
201
+ * Fixed: Images not displaying in AMP with Lazy loading of Zeen theme #5126
202
+ * Fixed: Missing rel noopener attribute in links #5125
203
+ * Fixed: Incorrect canonical for Homepage if WordPress installation is another folder #5122
204
+ * Fixed: No data hero attribute on featured image of default image #5121
205
+ * Fixed: Debug log errors #5124
206
+
207
  = 1.0.77.20 (24th August 2021) =
208
  * Fixed: Validation errors when Jetpack boost plugin is active #5120
209
  * Fixed: Display Warning Icon more clearly if setup is not completed #5119
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.20
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.20');
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.21
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.21');
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,12 @@
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
1
  == Changelog ==
2
 
3
+ = 1.0.77.21 (6th September 2021) =
4
+ * Fixed: Images not displaying in AMP with Lazy loading of Zeen theme #5126
5
+ * Fixed: Missing rel noopener attribute in links #5125
6
+ * Fixed: Incorrect canonical for Homepage if WordPress installation is another folder #5122
7
+ * Fixed: No data hero attribute on featured image of default image #5121
8
+ * Fixed: Debug log errors #5124
9
+
10
  = 1.0.77.20 (24th August 2021) =
11
  * Fixed: Validation errors when Jetpack boost plugin is active #5120
12
  * Fixed: Display Warning Icon more clearly if setup is not completed #5119
includes/features/functions.php CHANGED
@@ -1187,9 +1187,9 @@ function ampforwp_new_gallery_images($images_markup, $image, $markup_arr){
1187
  }
1188
  if( ! function_exists( 'ampforwp_additional_gallery_style' ) ){
1189
  function ampforwp_additional_gallery_style(){
1190
- global $redux_builder_amp,$carousel_markup_all;
1191
  $design_type = '';
1192
- $design_type = $redux_builder_amp['ampforwp-gallery-design-type'];
1193
 
1194
  if(isset($design_type) && $design_type!==''){
1195
  echo $carousel_markup_all[$design_type]['gallery_css'];
1187
  }
1188
  if( ! function_exists( 'ampforwp_additional_gallery_style' ) ){
1189
  function ampforwp_additional_gallery_style(){
1190
+ global $carousel_markup_all;
1191
  $design_type = '';
1192
+ $design_type = ampforwp_get_setting('ampforwp-gallery-design-type');
1193
 
1194
  if(isset($design_type) && $design_type!==''){
1195
  echo $carousel_markup_all[$design_type]['gallery_css'];
includes/thirdparty-compatibility.php CHANGED
@@ -77,6 +77,9 @@ function ampforwp_thirdparty_compatibility(){
77
  }
78
  if(function_exists('megashop_setup')){
79
  remove_filter( 'wp_nav_menu_args', 'TT_nav_menu_args' );
 
 
 
80
  }
81
  $yoast_canonical = $yoast_canonical_post = $yoast_canonical_page = '';
82
  $yoast_canonical = get_option( 'wpseo_titles' );
@@ -1309,6 +1312,12 @@ if(!function_exists('ampforwp_category_image_compatibility')){
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),'/' );
77
  }
78
  if(function_exists('megashop_setup')){
79
  remove_filter( 'wp_nav_menu_args', 'TT_nav_menu_args' );
80
+ }
81
+ if(function_exists('zeen_lazyload_images')){
82
+ add_filter('zeen_lazy_embedded_images','ampforwp_zeen_lazyload');
83
  }
84
  $yoast_canonical = $yoast_canonical_post = $yoast_canonical_page = '';
85
  $yoast_canonical = get_option( 'wpseo_titles' );
1312
  }
1313
  }
1314
  }
1315
+
1316
+ function ampforwp_zeen_lazyload($lazyload){
1317
+ $lazyload = false;
1318
+ return $lazyload;
1319
+ }
1320
+
1321
  add_action('plugins_loaded', 'ampforwp_jetpack_boost_compatibility' , 0);
1322
  function ampforwp_jetpack_boost_compatibility(){
1323
  $url_path = trim(parse_url(add_query_arg(array()), PHP_URL_PATH),'/' );
includes/vendor/amp/includes/utils/class-amp-image-dimension-extractor.php CHANGED
@@ -241,7 +241,9 @@ class AMP_Image_Dimension_Extractor {
241
  $urlArrayLastdata = end( $urlArraydata );
242
  $parsed_url = explode( 'x', $urlArrayLastdata );
243
  if ( is_array( $parsed_url ) ) {
244
- $height = explode( '.', $parsed_url[1] );
 
 
245
  $image_data['size'] = array( $parsed_url[0], $height[0] );
246
  }
247
  }
241
  $urlArrayLastdata = end( $urlArraydata );
242
  $parsed_url = explode( 'x', $urlArrayLastdata );
243
  if ( is_array( $parsed_url ) ) {
244
+ if (array_key_exists( 1, $parsed_url )){
245
+ $height = explode( '.', $parsed_url[1] );
246
+ }
247
  $image_data['size'] = array( $parsed_url[0], $height[0] );
248
  }
249
  }
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.20
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -194,6 +194,13 @@ You can contact us from [here](https://ampforwp.com/contact/)
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
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.21
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.21 (6th September 2021) =
198
+ * Fixed: Images not displaying in AMP with Lazy loading of Zeen theme #5126
199
+ * Fixed: Missing rel noopener attribute in links #5125
200
+ * Fixed: Incorrect canonical for Homepage if WordPress installation is another folder #5122
201
+ * Fixed: No data hero attribute on featured image of default image #5121
202
+ * Fixed: Debug log errors #5124
203
+
204
  = 1.0.77.20 (24th August 2021) =
205
  * Fixed: Validation errors when Jetpack boost plugin is active #5120
206
  * Fixed: Display Warning Icon more clearly if setup is not completed #5119
templates/features.php CHANGED
@@ -692,7 +692,6 @@ function ampforwp_new_dir( $dir ) {
692
  $content = preg_replace('/<script[^>]*>.*?<\/script>/i', '', $content);
693
  //for removing attributes within html tags
694
  $content = preg_replace('/(<[^>]+) onclick=".*?"/', '$1', $content);
695
- $content = preg_replace('/(<[^>]+) rel="(.*?) noopener(.*?)"/', '$1 rel="$2$3"', $content);
696
  // Remove alt attribute from the div tag #2093
697
  $content = preg_replace('/<div(.*?) alt=".*?"(.*?)/', '<div $1', $content);
698
  $content = preg_replace('/(<[^>]+) ref=".*?"/', '$1', $content);
@@ -4407,7 +4406,7 @@ function ampforwp_generate_yoast_no_index_canonical_url(){
4407
  if(isset($yoast_data['canonical'])){
4408
  $canonical_url = $yoast_data['canonical'];
4409
  if(ampforwp_is_home() || ampforwp_is_front_page()){
4410
- $canonical_url = user_trailingslashit(get_site_url());
4411
  } ?>
4412
  <link rel="canonical" href="<?php echo esc_url($canonical_url) ?>"/>
4413
  <?php }
@@ -4421,7 +4420,7 @@ function ampforwp_modify_yoast_amp_homepage_canonical(){
4421
 
4422
  function ampforwp_modify_yoast_homepage_canonical_url($canonical_url){
4423
  if(ampforwp_is_home() || ampforwp_is_front_page()){
4424
- $canonical_url = user_trailingslashit(get_site_url());
4425
  }
4426
  return esc_url($canonical_url);
4427
  }
@@ -8773,7 +8772,7 @@ if(!function_exists('ampforwp_add_fallback_element')){
8773
  if(function_exists('rocket_activation')){
8774
  $m1_content = preg_replace('/srcset="(.*?)"/', '', $m1_content);
8775
  }
8776
- $fallback_img = "<amp-img ".$m_content."<amp-img fallback ".$m1_content."</amp-img></amp-img>";//$m_content, $m1_content escaped above.
8777
  $content = str_replace("$match", $fallback_img, $content);
8778
  }
8779
  }
692
  $content = preg_replace('/<script[^>]*>.*?<\/script>/i', '', $content);
693
  //for removing attributes within html tags
694
  $content = preg_replace('/(<[^>]+) onclick=".*?"/', '$1', $content);
 
695
  // Remove alt attribute from the div tag #2093
696
  $content = preg_replace('/<div(.*?) alt=".*?"(.*?)/', '<div $1', $content);
697
  $content = preg_replace('/(<[^>]+) ref=".*?"/', '$1', $content);
4406
  if(isset($yoast_data['canonical'])){
4407
  $canonical_url = $yoast_data['canonical'];
4408
  if(ampforwp_is_home() || ampforwp_is_front_page()){
4409
+ $canonical_url = user_trailingslashit(get_home_url());
4410
  } ?>
4411
  <link rel="canonical" href="<?php echo esc_url($canonical_url) ?>"/>
4412
  <?php }
4420
 
4421
  function ampforwp_modify_yoast_homepage_canonical_url($canonical_url){
4422
  if(ampforwp_is_home() || ampforwp_is_front_page()){
4423
+ $canonical_url = user_trailingslashit(get_home_url());
4424
  }
4425
  return esc_url($canonical_url);
4426
  }
8772
  if(function_exists('rocket_activation')){
8773
  $m1_content = preg_replace('/srcset="(.*?)"/', '', $m1_content);
8774
  }
8775
+ $fallback_img = "<amp-img data-hero ".$m_content."<amp-img fallback data-hero ".$m1_content."</amp-img></amp-img>";//$m_content, $m1_content escaped above.
8776
  $content = str_replace("$match", $fallback_img, $content);
8777
  }
8778
  }