AMP for WP – Accelerated Mobile Pages - Version 1.0.77.45

Version Description

(13th June 2022) = * Fixed: Conflict issue with WPML #5274 * Fixed: Page builder modal is getting hidden below the header of the post/page editor. #5279 * Fixed: FAQ Schema For Pages And Posts compatibility #5278 * Fixed: Debug Warnings - Trying to access array offset on value of type null #5277 * Fixed: fatal error #5280

Download this release

Release Info

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

Code changes from version 1.0.77.44 to 1.0.77.45

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: 6.0
7
- Stable tag: 1.0.77.44
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.44 (2nd June 2022) =
201
  * Improvements: Added Marfeel analytics compatibility in AMP #5266
202
  * Improvements: Added WP Table Builder compatibility in AMP #5270
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 6.0
7
+ Stable tag: 1.0.77.45
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.45 (13th June 2022) =
201
+ * Fixed: Conflict issue with WPML #5274
202
+ * Fixed: Page builder modal is getting hidden below the header of the post/page editor. #5279
203
+ * Fixed: FAQ Schema For Pages And Posts compatibility #5278
204
+ * Fixed: Debug Warnings - Trying to access array offset on value of type null #5277
205
+ * Fixed: fatal error #5280
206
+
207
  = 1.0.77.44 (2nd June 2022) =
208
  * Improvements: Added Marfeel analytics compatibility in AMP #5266
209
  * Improvements: Added WP Table Builder compatibility in AMP #5270
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.44
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.44');
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.45
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.45');
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.44 (2nd June 2022) =
4
  * Improvements: Added Marfeel analytics compatibility in AMP #5266
5
  * Improvements: Added WP Table Builder compatibility in AMP #5270
1
  == Changelog ==
2
 
3
+ = 1.0.77.45 (13th June 2022) =
4
+ * Fixed: Conflict issue with WPML #5274
5
+ * Fixed: Page builder modal is getting hidden below the header of the post/page editor. #5279
6
+ * Fixed: FAQ Schema For Pages And Posts compatibility #5278
7
+ * Fixed: Debug Warnings - Trying to access array offset on value of type null #5277
8
+ * Fixed: fatal error #5280
9
+
10
  = 1.0.77.44 (2nd June 2022) =
11
  * Improvements: Added Marfeel analytics compatibility in AMP #5266
12
  * Improvements: Added WP Table Builder compatibility in AMP #5270
includes/features/performance/performance-functions.php CHANGED
@@ -95,7 +95,13 @@ function ampforwp_minify_html_output($content_buffer){
95
  if(preg_match('/<blockquote\sclass="wp-embedded-content"(.*?)<a href="(.*?)"(.*?)<\/blockquote>/', $content_buffer)){
96
  $content_buffer = preg_replace('/<blockquote\sclass="wp-embedded-content"(.*?)<a href="(.*?)"(.*?)<\/blockquote>/', '<amp-wordpress-embed width="400" height="400" data-url="$2" ></amp-wordpress-embed>', $content_buffer);
97
  $content_buffer = preg_replace('/<amp-iframe(.*?)class="wp-embedded-content(.*?)<\/amp-iframe>/', '', $content_buffer);
98
- }
 
 
 
 
 
 
99
  global $redux_builder_amp;
100
  if(!$redux_builder_amp['ampforwp_cache_minimize_mode']){
101
  return $content_buffer;
95
  if(preg_match('/<blockquote\sclass="wp-embedded-content"(.*?)<a href="(.*?)"(.*?)<\/blockquote>/', $content_buffer)){
96
  $content_buffer = preg_replace('/<blockquote\sclass="wp-embedded-content"(.*?)<a href="(.*?)"(.*?)<\/blockquote>/', '<amp-wordpress-embed width="400" height="400" data-url="$2" ></amp-wordpress-embed>', $content_buffer);
97
  $content_buffer = preg_replace('/<amp-iframe(.*?)class="wp-embedded-content(.*?)<\/amp-iframe>/', '', $content_buffer);
98
+ }
99
+ if (function_exists('wp_faq_schema_load_plugin_textdomain')) {
100
+ $content_buffer = preg_replace('/<div\sclass="">(.*?)<\/div>/s', '$1', $content_buffer);
101
+ $content_buffer = preg_replace('/<h4>/s', '<section><h4>', $content_buffer);
102
+ $content_buffer = preg_replace('/<\/p>/s', '</p></section>', $content_buffer);
103
+ $content_buffer = preg_replace('/<div\sclass="wp-faq-schema-items">(.*?)<\/div>/s', '<amp-accordion expand-single-section>$1</amp-accordion>', $content_buffer);
104
+ }
105
  global $redux_builder_amp;
106
  if(!$redux_builder_amp['ampforwp_cache_minimize_mode']){
107
  return $content_buffer;
includes/redirect.php CHANGED
@@ -224,8 +224,10 @@ if(is_search() && 0 == ampforwp_get_setting('amp-redirection-search')){
224
  // Single and Pages
225
  if ( is_singular() ) {
226
  $amp_metas = json_decode(get_post_meta( get_the_ID(),'ampforwp-post-metas',true), true );
227
- if ( 'hide-amp' == $amp_metas['ampforwp-amp-on-off'] ) {
228
- $amp_on_off = true;
 
 
229
  }
230
  }
231
  if ( ( is_single() && !$redux_builder_amp['amp-on-off-for-all-posts'] ) || ( is_page() && !$redux_builder_amp['amp-on-off-for-all-pages'] ) || ($amp_on_off) ) {
224
  // Single and Pages
225
  if ( is_singular() ) {
226
  $amp_metas = json_decode(get_post_meta( get_the_ID(),'ampforwp-post-metas',true), true );
227
+ if(!empty($amp_metas['ampforwp-amp-on-off'])){
228
+ if ( 'hide-amp' == $amp_metas['ampforwp-amp-on-off'] ) {
229
+ $amp_on_off = true;
230
+ }
231
  }
232
  }
233
  if ( ( is_single() && !$redux_builder_amp['amp-on-off-for-all-posts'] ) || ( is_page() && !$redux_builder_amp['amp-on-off-for-all-pages'] ) || ($amp_on_off) ) {
includes/vendor/tool/Optimizer/Transformer/ServerSideRendering.php CHANGED
@@ -166,7 +166,9 @@ final class ServerSideRendering implements Transformer
166
  // Removal of attributes is deferred as layout application needs them.
167
  if (is_array($attributesToRemove)) {
168
  foreach ($attributesToRemove as $attributeToRemove) {
169
- $adaptedElement->removeAttribute($attributeToRemove);
 
 
170
  }
171
  }
172
  }
166
  // Removal of attributes is deferred as layout application needs them.
167
  if (is_array($attributesToRemove)) {
168
  foreach ($attributesToRemove as $attributeToRemove) {
169
+ if(!empty($attributeToRemove)){
170
+ $adaptedElement->removeAttribute($attributeToRemove);
171
+ }
172
  }
173
  }
174
  }
pagebuilder/inc/admin-amp-page-builder.css CHANGED
@@ -677,7 +677,7 @@ position: fixed;
677
  padding-left: 20px;
678
  padding-top: 0px;
679
  }
680
- #amp-page-builder .modal-container {position: fixed;overflow: hidden;top:30px;left: 30px;right: 30px;bottom: 30px;z-index: 160000;overflow: hidden;min-height: 300px;box-shadow: 0 5px 15px rgba(0,0,0,.7);background: #fcfcfc;-webkit-font-smoothing: subpixel-antialiased;max-width: 1200px;}
681
 
682
  .modal-header h3 {
683
  font-weight: normal;
677
  padding-left: 20px;
678
  padding-top: 0px;
679
  }
680
+ #amp-page-builder .modal-container {position: fixed;overflow: hidden;top:65px;left: 6px;right: 30px;bottom: 30px;z-index: 160000;overflow: hidden;min-height: 300px;box-shadow: 0 5px 15px rgba(0,0,0,.7);background: #fcfcfc;-webkit-font-smoothing: subpixel-antialiased;max-width: 1190px;}
681
 
682
  .modal-header h3 {
683
  font-weight: normal;
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: 6.0
7
- Stable tag: 1.0.77.44
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.44 (2nd June 2022) =
198
  * Improvements: Added Marfeel analytics compatibility in AMP #5266
199
  * Improvements: Added WP Table Builder compatibility in AMP #5270
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 6.0
7
+ Stable tag: 1.0.77.45
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.45 (13th June 2022) =
198
+ * Fixed: Conflict issue with WPML #5274
199
+ * Fixed: Page builder modal is getting hidden below the header of the post/page editor. #5279
200
+ * Fixed: FAQ Schema For Pages And Posts compatibility #5278
201
+ * Fixed: Debug Warnings - Trying to access array offset on value of type null #5277
202
+ * Fixed: fatal error #5280
203
+
204
  = 1.0.77.44 (2nd June 2022) =
205
  * Improvements: Added Marfeel analytics compatibility in AMP #5266
206
  * Improvements: Added WP Table Builder compatibility in AMP #5270
templates/features.php CHANGED
@@ -9741,4 +9741,13 @@ function ampforwp_publisher_desk_ads( $content ) {
9741
  }
9742
  }
9743
  return $content;
9744
- }
 
 
 
 
 
 
 
 
 
9741
  }
9742
  }
9743
  return $content;
9744
+ }
9745
+
9746
+ // #5274 AMP Take over conflict with WPML
9747
+ add_filter('ampforwp_is_amp_endpoint_takeover', 'ampforwp_wpml_takeover_compatibility');
9748
+ function ampforwp_wpml_takeover_compatibility($return) {
9749
+ if (is_user_logged_in() && !empty($_GET['wpml-app'])) {
9750
+ return false;
9751
+ }
9752
+ return $return;
9753
+ };