AMP for WP – Accelerated Mobile Pages - Version 1.0.14

Version Description

(14th January 2020) = * Fixed: Warning in accelerated-mobile-pages/includes/options/admin-config.php on line 1250 #4027 * Fixed: Code improvement in 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.14
Comparing to
See all releases

Code changes from version 1.0.13 to 1.0.14

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.13
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -191,6 +191,10 @@ You can contact us from [here](https://ampforwp.com/contact/)
191
 
192
  == Changelog ==
193
 
 
 
 
 
194
  = 1.0.13 (13th January 2020) =
195
  * Fixed: Warring in console : [DOM] Found 2 elements with non-unique id #amp-search #3946
196
  * Fixed: New Relic script is getting added in AMP and causing validtion error #4018
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.14
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.14 (14th January 2020) =
195
+ * Fixed: Warning in accelerated-mobile-pages/includes/options/admin-config.php on line 1250 #4027
196
+ * Fixed: Code improvement in Detect Component and add or remove script accordingly #4067
197
+
198
  = 1.0.13 (13th January 2020) =
199
  * Fixed: Warring in console : [DOM] Found 2 elements with non-unique id #amp-search #3946
200
  * Fixed: New Relic script is getting added in AMP and causing validtion error #4018
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.13
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.13');
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.14
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.14');
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,9 @@
1
  == Changelog ==
2
 
 
 
 
 
3
  = 1.0.13 (13th January 2020) =
4
  * Fixed: Warring in console : [DOM] Found 2 elements with non-unique id #amp-search #3946
5
  * Fixed: New Relic script is getting added in AMP and causing validtion error #4018
1
  == Changelog ==
2
 
3
+ = 1.0.14 (14th January 2020) =
4
+ * Fixed: Warning in accelerated-mobile-pages/includes/options/admin-config.php on line 1250
5
+ * Fixed: Code improvement in Detect Component and add or remove script accordingly #4067
6
+
7
  = 1.0.13 (13th January 2020) =
8
  * Fixed: Warring in console : [DOM] Found 2 elements with non-unique id #amp-search #3946
9
  * Fixed: New Relic script is getting added in AMP and causing validtion error #4018
includes/options/admin-config.php CHANGED
@@ -1216,6 +1216,7 @@ if(get_theme_support('amp-template-mode')){
1216
  $upg_to_pro_url = 'https://ampforwp.com/membership/#utm_source=options-panel&utm_medium=view_pro_features_btn&utm_campaign=AMP%20Plugin';
1217
  $upg_to_pro_target = 'target="_blank"';
1218
  }
 
1219
  if($ampforwp_nameOfUser!=""){
1220
  $proDetailsProvide = "<span class='extension-menu-call'><span class='activated-plugins'>Hello, ".esc_html($ampforwp_nameOfUser)."</span> <a class='' href='".esc_url(admin_url('admin.php?page=amp_options&tabid=opt-go-premium'))."'><i class='dashicons-before dashicons-admin-generic'></i></a></span>";
1221
  }elseif($ampforwp_is_productActivated){
1216
  $upg_to_pro_url = 'https://ampforwp.com/membership/#utm_source=options-panel&utm_medium=view_pro_features_btn&utm_campaign=AMP%20Plugin';
1217
  $upg_to_pro_target = 'target="_blank"';
1218
  }
1219
+ $proDetailsProvide = '<a class="technical_support_btn_txt" href="https://ampforwp.com/support/" target="_blank">'.esc_html__('Technical Support','accelerated-mobile-pages').'</a>';
1220
  if($ampforwp_nameOfUser!=""){
1221
  $proDetailsProvide = "<span class='extension-menu-call'><span class='activated-plugins'>Hello, ".esc_html($ampforwp_nameOfUser)."</span> <a class='' href='".esc_url(admin_url('admin.php?page=amp_options&tabid=opt-go-premium'))."'><i class='dashicons-before dashicons-admin-generic'></i></a></span>";
1222
  }elseif($ampforwp_is_productActivated){
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.13
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -191,6 +191,10 @@ You can contact us from [here](https://ampforwp.com/contact/)
191
 
192
  == Changelog ==
193
 
 
 
 
 
194
  = 1.0.13 (13th January 2020) =
195
  * Fixed: Warring in console : [DOM] Found 2 elements with non-unique id #amp-search #3946
196
  * Fixed: New Relic script is getting added in AMP and causing validtion error #4018
@@ -208,12 +212,4 @@ You can contact us from [here](https://ampforwp.com/contact/)
208
  = 1.0.12 (12th January 2020) =
209
  * Fixed: Detect Component and add or remove script accordingly #4067
210
 
211
- = 1.0.11 (11th January 2020) =
212
- * Fixed: In amp-pixel script adding automatically. #4057
213
-
214
- = 1.0.10 (10th January 2020) =
215
- * Improvement: Need a hook to use it in Woocomerce #4048
216
- * Fixed: Scripts are not adding properly if user is adding the content through embed #4040
217
- * Fixed: When Featured Image from The Content is turned on,the image is not displayed when Creating post from Gutenberg. #4022
218
-
219
  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.3.2
7
+ Stable tag: 1.0.14
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.14 (14th January 2020) =
195
+ * Fixed: Warning in accelerated-mobile-pages/includes/options/admin-config.php on line 1250 #4027
196
+ * Fixed: Code improvement in Detect Component and add or remove script accordingly #4067
197
+
198
  = 1.0.13 (13th January 2020) =
199
  * Fixed: Warring in console : [DOM] Found 2 elements with non-unique id #amp-search #3946
200
  * Fixed: New Relic script is getting added in AMP and causing validtion error #4018
212
  = 1.0.12 (12th January 2020) =
213
  * Fixed: Detect Component and add or remove script accordingly #4067
214
 
 
 
 
 
 
 
 
 
215
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
templates/features.php CHANGED
@@ -7622,12 +7622,14 @@ if(!function_exists('ampforwp_transposh_plugin_rtl_css')){
7622
 
7623
  add_filter('ampforwp_the_content_last_filter','ampforwp_include_required_scripts',12);
7624
  function ampforwp_include_required_scripts($content){
 
 
 
7625
  preg_match_all('/<\/amp-(.*?)>/', $content, $matches);
7626
  if(isset($matches[1][0])){
7627
  $amp_comp = $matches[1];
7628
  $comp_to_remove_json = get_transient('ampforwp_amp_exclude_custom_element');
7629
  $comp_to_include_json = get_transient('ampforwp_amp_included_custom_element');
7630
- $comp_to_remove_arr = array();
7631
  if($comp_to_remove_json){
7632
  $comp_to_remove_arr = json_decode($comp_to_remove_json, true);
7633
  }
@@ -7689,7 +7691,6 @@ function ampforwp_include_required_scripts($content){
7689
  for($i=0;$i<count($matches[1]);$i++){
7690
  if(isset($matches[1][$i])){
7691
  $component = $matches[1][$i];
7692
- $headers = get_headers($comp_url);
7693
  if(!in_array($component,$excl_arr)){
7694
  if(!preg_match("/<\/$component>/", $content) && !$is_script){
7695
  $remove_comp = $matches[0][$i];
7622
 
7623
  add_filter('ampforwp_the_content_last_filter','ampforwp_include_required_scripts',12);
7624
  function ampforwp_include_required_scripts($content){
7625
+
7626
+ $comp_to_remove_arr = array();
7627
+
7628
  preg_match_all('/<\/amp-(.*?)>/', $content, $matches);
7629
  if(isset($matches[1][0])){
7630
  $amp_comp = $matches[1];
7631
  $comp_to_remove_json = get_transient('ampforwp_amp_exclude_custom_element');
7632
  $comp_to_include_json = get_transient('ampforwp_amp_included_custom_element');
 
7633
  if($comp_to_remove_json){
7634
  $comp_to_remove_arr = json_decode($comp_to_remove_json, true);
7635
  }
7691
  for($i=0;$i<count($matches[1]);$i++){
7692
  if(isset($matches[1][$i])){
7693
  $component = $matches[1][$i];
 
7694
  if(!in_array($component,$excl_arr)){
7695
  if(!preg_match("/<\/$component>/", $content) && !$is_script){
7696
  $remove_comp = $matches[0][$i];