AMP for WP – Accelerated Mobile Pages - Version 1.0.54.1

Version Description

(26th June 2020) = * Fixed: The duplicate text showing after the anchor link #4584

Download this release

Release Info

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

Code changes from version 1.0.54 to 1.0.54.1

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.4.2
7
- Stable tag: 1.0.54
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -193,6 +193,9 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
193
 
194
  == Changelog ==
195
 
 
 
 
196
  = 1.0.54 (25th June 2020) =
197
  * Fixed: Odnoklassniki sharing not working properly #4525
198
  * Fixed: Post title is not appearing when a post is shared through Whatsapp #4513
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.4.2
7
+ Stable tag: 1.0.54.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
193
 
194
  == Changelog ==
195
 
196
+ = 1.0.54.1 (26th June 2020) =
197
+ * Fixed: The duplicate text showing after the anchor link #4584
198
+
199
  = 1.0.54 (25th June 2020) =
200
  * Fixed: Odnoklassniki sharing not working properly #4525
201
  * Fixed: Post title is not appearing when a post is shared through Whatsapp #4513
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.54
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.54');
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.54.1
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.54.1');
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.54 (25th June 2020) =
4
  * Fixed: Odnoklassniki sharing not working properly #4525
5
  * Fixed: Post title is not appearing when a post is shared through Whatsapp #4513
1
  == Changelog ==
2
 
3
+ = 1.0.54.1 (26th June 2020) =
4
+ * Fixed: The duplicate text showing after the anchor link #4584
5
+
6
  = 1.0.54 (25th June 2020) =
7
  * Fixed: Odnoklassniki sharing not working properly #4525
8
  * Fixed: Post title is not appearing when a post is shared through Whatsapp #4513
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.4.2
7
- Stable tag: 1.0.54
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -190,6 +190,9 @@ You can contact us from [here](https://ampforwp.com/contact/)
190
 
191
  == Changelog ==
192
 
 
 
 
193
  = 1.0.54 (25th June 2020) =
194
  * Fixed: Odnoklassniki sharing not working properly #4525
195
  * Fixed: Post title is not appearing when a post is shared through Whatsapp #4513
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.4.2
7
+ Stable tag: 1.0.54.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
190
 
191
  == Changelog ==
192
 
193
+ = 1.0.54.1 (26th June 2020) =
194
+ * Fixed: The duplicate text showing after the anchor link #4584
195
+
196
  = 1.0.54 (25th June 2020) =
197
  * Fixed: Odnoklassniki sharing not working properly #4525
198
  * Fixed: Post title is not appearing when a post is shared through Whatsapp #4513
templates/features.php CHANGED
@@ -8534,7 +8534,11 @@ function ampforwp_rank_math_external_link_newtab($content){
8534
  $rank_math_external_link = RankMath\Helper::get_settings( 'general.new_window_external_links' );
8535
  if($rank_math_external_link){
8536
  $comp_dom = new DOMDocument();
8537
- @$comp_dom->loadHTML($content);
 
 
 
 
8538
  $xpath = new DOMXPath( $comp_dom );
8539
  $count = 0;
8540
  $nodes = $xpath->query('//a[@href]');
@@ -8545,8 +8549,8 @@ function ampforwp_rank_math_external_link_newtab($content){
8545
  if(!$node->hasAttribute('target')){
8546
  $node->setAttribute('target','_blank');
8547
  $new_node = $comp_dom->saveHTML($node);
8548
- if(preg_match('/<a\b[^>]*?\bhref=[\'\"]'.preg_quote($url,'/').'[\'\"][^>]*>/', $content, $matches)){
8549
- $content = preg_replace('/<a\b[^>]*?\bhref=[\'\"]'.preg_quote($url,'/').'[\'\"][^>]*>/', $new_node, $content);
8550
  }
8551
  }
8552
  }
8534
  $rank_math_external_link = RankMath\Helper::get_settings( 'general.new_window_external_links' );
8535
  if($rank_math_external_link){
8536
  $comp_dom = new DOMDocument();
8537
+ if(function_exists('mb_convert_encoding')){
8538
+ @$comp_dom->loadHTML(mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8'));
8539
+ }else{
8540
+ @$comp_dom->loadHTML($content);
8541
+ }
8542
  $xpath = new DOMXPath( $comp_dom );
8543
  $count = 0;
8544
  $nodes = $xpath->query('//a[@href]');
8549
  if(!$node->hasAttribute('target')){
8550
  $node->setAttribute('target','_blank');
8551
  $new_node = $comp_dom->saveHTML($node);
8552
+ if(preg_match('/<a\b[^>]*?\bhref=[\'\"]'.preg_quote($url,'/').'[\'\"][^>]*>(.*?)<\/a>/', $content, $matches)){
8553
+ $content = preg_replace('/<a\b[^>]*?\bhref=[\'\"]'.preg_quote($url,'/').'[\'\"][^>]*>(.*?)<\/a>/', $new_node, $content);
8554
  }
8555
  }
8556
  }