AMP for WP – Accelerated Mobile Pages - Version 1.0.12

Version Description

(12th January 2020) = * Fixed: Detect Component and add or remove script accordingly #4067

Download this release

Release Info

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

Code changes from version 1.0.11 to 1.0.12

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.3.2
7
- Stable tag: 1.0.11
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -191,6 +191,9 @@ You can contact us from [here](https://ampforwp.com/contact/)
191
 
192
  == Changelog ==
193
 
 
 
 
194
  = 1.0.11 (11th January 2020) =
195
  * Fixed: In amp-pixel script adding automatically. #4057
196
 
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.3.2
7
+ Stable tag: 1.0.12
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
191
 
192
  == Changelog ==
193
 
194
+ = 1.0.12 (12th January 2020) =
195
+ * Fixed: Detect Component and add or remove script accordingly #4067
196
+
197
  = 1.0.11 (11th January 2020) =
198
  * Fixed: In amp-pixel script adding automatically. #4057
199
 
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.11
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.11');
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.12
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.12');
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,8 @@
1
  == Changelog ==
2
 
 
 
 
3
  = 1.0.11 (11th January 2020) =
4
  * Fixed: In amp-pixel script adding automatically. #4057
5
 
1
  == Changelog ==
2
 
3
+ = 1.0.12 (12th January 2020) =
4
+ * Fixed: Detect Component and add or remove script accordingly #4067
5
+
6
  = 1.0.11 (11th January 2020) =
7
  * Fixed: In amp-pixel script adding automatically. #4057
8
 
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.3.2
7
- Stable tag: 1.0.11
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -191,6 +191,9 @@ You can contact us from [here](https://ampforwp.com/contact/)
191
 
192
  == Changelog ==
193
 
 
 
 
194
  = 1.0.11 (11th January 2020) =
195
  * Fixed: In amp-pixel script adding automatically. #4057
196
 
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.3.2
7
+ Stable tag: 1.0.12
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
191
 
192
  == Changelog ==
193
 
194
+ = 1.0.12 (12th January 2020) =
195
+ * Fixed: Detect Component and add or remove script accordingly #4067
196
+
197
  = 1.0.11 (11th January 2020) =
198
  * Fixed: In amp-pixel script adding automatically. #4057
199
 
templates/features.php CHANGED
@@ -7666,5 +7666,21 @@ function ampforwp_include_required_scripts($content){
7666
  }
7667
  }
7668
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7669
  return $content;
7670
  }
7666
  }
7667
  }
7668
  }
7669
+ preg_match_all('/<script\scustom-element="(.*?)"(.*?)><\/script>/', $content, $matches);
7670
+ if(isset($matches[0])){
7671
+ if(isset($matches[1])){
7672
+ for($i=0;$i<count($matches[1]);$i++){
7673
+ if(isset($matches[1][$i])){
7674
+ $component = $matches[1][$i];
7675
+ if($component!='amp-form'){
7676
+ if(!preg_match("/<\/$component>/", $content)){
7677
+ $remove_comp = $matches[0][$i];
7678
+ $content = str_replace($remove_comp, '', $content);
7679
+ }
7680
+ }
7681
+ }
7682
+ }
7683
+ }
7684
+ }
7685
  return $content;
7686
  }