AMP for WP – Accelerated Mobile Pages - Version 1.0.7

Version Description

(2nd January 2020) = * Improvement: Need to add Rankmath's "Nofollow External Links" feature. #3970 * Improvement: Need to add floating button in extension list #3972 * Fixed: AMP theme framework GDPR module should be connected to GDPR Compliancy in option panel. #3963 * Fixed: Breadcrumbs are not properly displaying and working in updated version #3917 * Fixed: amp-auto-ads script is loading in AMP-pages when Google site kit plugin is enable. #4009 * Fixed: wp-block CSS is heavily loading even when tree shaking is enabled in core. (Page builder is enabled) #4014

Download this release

Release Info

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

Code changes from version 1.0.6 to 1.0.7

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.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -191,6 +191,14 @@ You can contact us from [here](https://ampforwp.com/contact/)
191
 
192
  == Changelog ==
193
 
 
 
 
 
 
 
 
 
194
  = 1.0.6 (31th December 2019) =
195
  * Improvement: Allow users to add custom script in amp by using amp theme frame work plugin or without plugin #3865
196
  * Improvement: Allow users to register scripts in proper way in AMP Theme Framework #3257
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.7
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.7 (2nd January 2020) =
195
+ * Improvement: Need to add Rankmath's "Nofollow External Links" feature. #3970
196
+ * Improvement: Need to add floating button in extension list #3972
197
+ * Fixed: AMP theme framework GDPR module should be connected to GDPR Compliancy in option panel. #3963
198
+ * Fixed: Breadcrumbs are not properly displaying and working in updated version #3917
199
+ * Fixed: amp-auto-ads script is loading in AMP-pages when Google site kit plugin is enable. #4009
200
+ * Fixed: wp-block CSS is heavily loading even when tree shaking is enabled in core. (Page builder is enabled) #4014
201
+
202
  = 1.0.6 (31th December 2019) =
203
  * Improvement: Allow users to add custom script in amp by using amp theme frame work plugin or without plugin #3865
204
  * Improvement: Allow users to register scripts in proper way in AMP Theme Framework #3257
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.6
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.6');
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.7
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.7');
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,13 @@
1
  == Changelog ==
2
 
 
 
 
 
 
 
 
 
3
  = 1.0.6 (31th December 2019) =
4
  * Improvement: Allow users to add custom script in amp by using amp theme frame work plugin or without plugin #3865
5
  * Improvement: Allow users to register scripts in proper way in AMP Theme Framework #3257
1
  == Changelog ==
2
 
3
+ = 1.0.7 (2nd January 2020) =
4
+ * Improvement: Need to add Rankmath's "Nofollow External Links" feature. #3970
5
+ * Improvement: Need to add floating button in extension list #3972
6
+ * Fixed: AMP theme framework GDPR module should be connected to GDPR Compliancy in option panel. #3963
7
+ * Fixed: Breadcrumbs are not properly displaying and working in updated version #3917
8
+ * Fixed: amp-auto-ads script is loading in AMP-pages when Google site kit plugin is enable. #4009
9
+ * Fixed: wp-block CSS is heavily loading even when tree shaking is enabled in core. (Page builder is enabled) #4014
10
+
11
  = 1.0.6 (31th December 2019) =
12
  * Improvement: Allow users to add custom script in amp by using amp theme frame work plugin or without plugin #3865
13
  * Improvement: Allow users to register scripts in proper way in AMP Theme Framework #3257
components/breadcrumb/breadcrumb.php CHANGED
@@ -117,22 +117,15 @@ function amp_breadcrumb_output(){
117
  // Get last category post is in
118
  $last_category = array_values($category);
119
  $last_category = end($last_category);
120
- $category_name = get_category($last_category);
121
- $get_cat_parents = rtrim(get_category_parents($last_category->term_id, false, '/'),'/');
122
  if(class_exists( 'WPSEO_Options' )){
123
  $primary_cateogory = get_post_meta(ampforwp_get_the_ID(), '_yoast_wpseo_primary_category', true);
124
  if(isset($primary_cateogory) && $primary_cateogory!=""){
125
- $pcname = get_the_category_by_ID($primary_cateogory);
126
- $category_name = $pcname;
127
- $get_cat_parents = rtrim(get_category_parents($primary_cateogory, false, '/'),'/');
128
  }
129
  }
130
- if (strpos($get_cat_parents, '/') !== false) {
131
- $cat_parents = explode(',',$get_cat_parents);
132
- }else{
133
- // Get parent any categories and create array
134
- $cat_parents = explode('/',$get_cat_parents);
135
- }
136
 
137
  // Loop through parent categories and store in variable $cat_display
138
  $cat_display = '';
117
  // Get last category post is in
118
  $last_category = array_values($category);
119
  $last_category = end($last_category);
120
+ $get_cat_parents = rtrim(get_category_parents($last_category->term_id, false, '>'),'>');
 
121
  if(class_exists( 'WPSEO_Options' )){
122
  $primary_cateogory = get_post_meta(ampforwp_get_the_ID(), '_yoast_wpseo_primary_category', true);
123
  if(isset($primary_cateogory) && $primary_cateogory!=""){
124
+ $get_cat_parents = rtrim(get_category_parents($primary_cateogory, false, '>'),'>');
 
 
125
  }
126
  }
127
+ // Get parent any categories and create array
128
+ $cat_parents = explode('>',$get_cat_parents);
 
 
 
 
129
 
130
  // Loop through parent categories and store in variable $cat_display
131
  $cat_display = '';
components/gdpr/gdpr.php CHANGED
@@ -73,7 +73,8 @@ function amp_gdpr_output(){
73
  </amp-consent>
74
  <?php
75
  }
76
- if (ampforwp_get_setting('amp-gdpr-compliance-switch') ) {
 
77
  if(!isset($_COOKIE['ampforwp_gdpr_action'])){
78
  // Scripts
79
  add_filter('amp_post_template_data' , 'ampforwp_gdpr_data', 15);
73
  </amp-consent>
74
  <?php
75
  }
76
+ global $loadComponent;
77
+ if (ampforwp_get_setting('amp-gdpr-compliance-switch') || (isset($loadComponent['AMP-gdpr']) && true == $loadComponent['AMP-gdpr'] )) {
78
  if(!isset($_COOKIE['ampforwp_gdpr_action'])){
79
  // Scripts
80
  add_filter('amp_post_template_data' , 'ampforwp_gdpr_data', 15);
images/floating-icon.png ADDED
Binary file
includes/features/functions.php CHANGED
@@ -2,7 +2,9 @@
2
  if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
  }
5
- add_amp_theme_support('AMP-gdpr');
 
 
6
  // Custom AMP Content
7
  require AMPFORWP_PLUGIN_DIR .'templates/custom-amp-content.php';
8
  // Custom AMPFORWP Sanitizers
2
  if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
  }
5
+ if(ampforwp_get_setting('amp-gdpr-compliance-switch')) {
6
+ add_amp_theme_support('AMP-gdpr');
7
+ }
8
  // Custom AMP Content
9
  require AMPFORWP_PLUGIN_DIR .'templates/custom-amp-content.php';
10
  // Custom AMPFORWP Sanitizers
includes/features/performance/performance-functions.php CHANGED
@@ -208,7 +208,7 @@ function ampforwp_white_list_selectors($completeContent){
208
  if( !function_exists("ampforwp_tree_shaking_purify_amphtml") ){
209
  function ampforwp_tree_shaking_purify_amphtml($completeContent){
210
  $white_lists = ampforwp_white_list_selectors($completeContent);
211
- if( function_exists('amp_pagebuilder_compatibility_init') ){
212
  // compatibility with AMP Pagebuilder Compatibility
213
  return $completeContent;
214
  }
208
  if( !function_exists("ampforwp_tree_shaking_purify_amphtml") ){
209
  function ampforwp_tree_shaking_purify_amphtml($completeContent){
210
  $white_lists = ampforwp_white_list_selectors($completeContent);
211
+ if( function_exists('ampforwp_purify_amphtmls') ){
212
  // compatibility with AMP Pagebuilder Compatibility
213
  return $completeContent;
214
  }
includes/options/admin-config.php CHANGED
@@ -550,6 +550,18 @@ $extension_listing_array = array(
550
  'store_url'=>'https://accounts.ampforwp.com',
551
  'is_activated'=>(is_plugin_active('easy-table-of-contents-for-amp/easy-table-of-contents-for-amp.php')? 1 : 2),
552
  ),
 
 
 
 
 
 
 
 
 
 
 
 
553
  );
554
  $viewAllExtensions = array(
555
  'name'=>'View All Extensions',
550
  'store_url'=>'https://accounts.ampforwp.com',
551
  'is_activated'=>(is_plugin_active('easy-table-of-contents-for-amp/easy-table-of-contents-for-amp.php')? 1 : 2),
552
  ),
553
+ array(
554
+ 'name'=>'Floating Button for AMP',
555
+ 'class'=>'new-ext',
556
+ 'desc'=>'You can add floating button in AMP with the help of this extension',
557
+ 'img_src'=>AMPFORWP_IMAGE_DIR . '/floating-icon.png',
558
+ 'price'=>'$39',
559
+ 'url_link'=>'https://ampforwp.com/addons/floating-button-for-amp/',
560
+ 'plugin_active_path'=> 'floating-button-for-amp/floating-button-for-amp.php',
561
+ 'item_name'=>'Floating Button for AMP',
562
+ 'store_url'=>'https://accounts.ampforwp.com',
563
+ 'is_activated'=>(is_plugin_active('floating-button-for-amp/floating-button-for-amp.php')? 1 : 2),
564
+ ),
565
  );
566
  $viewAllExtensions = array(
567
  'name'=>'View All Extensions',
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.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -191,6 +191,14 @@ You can contact us from [here](https://ampforwp.com/contact/)
191
 
192
  == Changelog ==
193
 
 
 
 
 
 
 
 
 
194
  = 1.0.6 (31th December 2019) =
195
  * Improvement: Allow users to add custom script in amp by using amp theme frame work plugin or without plugin #3865
196
  * Improvement: Allow users to register scripts in proper way in AMP Theme Framework #3257
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.7
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.7 (2nd January 2020) =
195
+ * Improvement: Need to add Rankmath's "Nofollow External Links" feature. #3970
196
+ * Improvement: Need to add floating button in extension list #3972
197
+ * Fixed: AMP theme framework GDPR module should be connected to GDPR Compliancy in option panel. #3963
198
+ * Fixed: Breadcrumbs are not properly displaying and working in updated version #3917
199
+ * Fixed: amp-auto-ads script is loading in AMP-pages when Google site kit plugin is enable. #4009
200
+ * Fixed: wp-block CSS is heavily loading even when tree shaking is enabled in core. (Page builder is enabled) #4014
201
+
202
  = 1.0.6 (31th December 2019) =
203
  * Improvement: Allow users to add custom script in amp by using amp theme frame work plugin or without plugin #3865
204
  * Improvement: Allow users to register scripts in proper way in AMP Theme Framework #3257
templates/design-manager/design-1/elements/bread-crumbs.php CHANGED
@@ -115,21 +115,17 @@ if ( ( (is_single() && 1 == ampforwp_get_setting('ampforwp-bread-crumb')) || (is
115
  $last_category = end($last_category);
116
  $category_name = get_category($last_category);
117
  // Get parent any categories and create array
118
- $get_cat_parents = rtrim(get_category_parents($last_category->term_id, false, '/'),'/');
119
  if(class_exists( 'WPSEO_Options' )){
120
  $primary_cateogory = get_post_meta(ampforwp_get_the_ID(), '_yoast_wpseo_primary_category', true);
121
  if(isset($primary_cateogory) && $primary_cateogory!=""){
122
  $pcname = get_the_category_by_ID($primary_cateogory);
123
  $category_name = $pcname;
124
- $get_cat_parents = rtrim(get_category_parents($primary_cateogory, false, '/'),'/');
125
  }
126
- }
127
- if (strpos($get_cat_parents, '/') !== false) {
128
- $cat_parents = explode(',',$get_cat_parents);
129
- }else{
130
  // Get parent any categories and create array
131
- $cat_parents = explode('/',$get_cat_parents);
132
- }
133
 
134
  // Loop through parent categories and store in variable $cat_display
135
  $cat_display = '';
115
  $last_category = end($last_category);
116
  $category_name = get_category($last_category);
117
  // Get parent any categories and create array
118
+ $get_cat_parents = rtrim(get_category_parents($last_category->term_id, false, '>'),'>');
119
  if(class_exists( 'WPSEO_Options' )){
120
  $primary_cateogory = get_post_meta(ampforwp_get_the_ID(), '_yoast_wpseo_primary_category', true);
121
  if(isset($primary_cateogory) && $primary_cateogory!=""){
122
  $pcname = get_the_category_by_ID($primary_cateogory);
123
  $category_name = $pcname;
124
+ $get_cat_parents = rtrim(get_category_parents($primary_cateogory, false, '>'),'>');
125
  }
126
+ }
 
 
 
127
  // Get parent any categories and create array
128
+ $cat_parents = explode('>',$get_cat_parents);
 
129
 
130
  // Loop through parent categories and store in variable $cat_display
131
  $cat_display = '';
templates/design-manager/design-2/elements/bread-crumbs.php CHANGED
@@ -113,21 +113,17 @@ if ( ( (is_single() && 1 == ampforwp_get_setting('ampforwp-bread-crumb')) || (is
113
  $last_category = end($last_category);
114
  $category_name = get_category($last_category);
115
  // Get parent any categories and create array
116
- $get_cat_parents = rtrim(get_category_parents($last_category->term_id, false, '/'),'/');
117
  if(class_exists( 'WPSEO_Options' )){
118
  $primary_cateogory = get_post_meta(ampforwp_get_the_ID(), '_yoast_wpseo_primary_category', true);
119
  if(isset($primary_cateogory) && $primary_cateogory!=""){
120
  $pcname = get_the_category_by_ID($primary_cateogory);
121
  $category_name = $pcname;
122
- $get_cat_parents = rtrim(get_category_parents($primary_cateogory, false, '/'),'/');
123
  }
124
  }
125
- if (strpos($get_cat_parents, '/') !== false) {
126
- $cat_parents = explode(',',$get_cat_parents);
127
- }else{
128
  // Get parent any categories and create array
129
- $cat_parents = explode('/',$get_cat_parents);
130
- }
131
 
132
  // Loop through parent categories and store in variable $cat_display
133
  $cat_display = '';
113
  $last_category = end($last_category);
114
  $category_name = get_category($last_category);
115
  // Get parent any categories and create array
116
+ $get_cat_parents = rtrim(get_category_parents($last_category->term_id, false, '>'),'>');
117
  if(class_exists( 'WPSEO_Options' )){
118
  $primary_cateogory = get_post_meta(ampforwp_get_the_ID(), '_yoast_wpseo_primary_category', true);
119
  if(isset($primary_cateogory) && $primary_cateogory!=""){
120
  $pcname = get_the_category_by_ID($primary_cateogory);
121
  $category_name = $pcname;
122
+ $get_cat_parents = rtrim(get_category_parents($primary_cateogory, false, '>'),'>');
123
  }
124
  }
 
 
 
125
  // Get parent any categories and create array
126
+ $cat_parents = explode('>',$get_cat_parents);
 
127
 
128
  // Loop through parent categories and store in variable $cat_display
129
  $cat_display = '';
templates/design-manager/design-3/elements/bread-crumbs.php CHANGED
@@ -113,22 +113,17 @@ if ( ( (is_single() && 1 == ampforwp_get_setting('ampforwp-bread-crumb')) || (is
113
  $last_category = end($last_category);
114
  $category_name = get_category($last_category);
115
  // Get parent any categories and create array
116
- $get_cat_parents = rtrim(get_category_parents($last_category->term_id, false, '/'),'/');
117
  if(class_exists( 'WPSEO_Options' )){
118
  $primary_cateogory = get_post_meta(ampforwp_get_the_ID(), '_yoast_wpseo_primary_category', true);
119
  if(isset($primary_cateogory) && $primary_cateogory!=""){
120
  $pcname = get_the_category_by_ID($primary_cateogory);
121
  $category_name = $pcname;
122
- $get_cat_parents = rtrim(get_category_parents($primary_cateogory, false, '/'),'/');
123
  }
124
  }
125
- if (strpos($get_cat_parents, '/') !== false) {
126
- $cat_parents = explode(',',$get_cat_parents);
127
- }else{
128
  // Get parent any categories and create array
129
- $cat_parents = explode('/',$get_cat_parents);
130
- }
131
-
132
  // Loop through parent categories and store in variable $cat_display
133
  $cat_display = '';
134
  foreach($cat_parents as $parents) {
113
  $last_category = end($last_category);
114
  $category_name = get_category($last_category);
115
  // Get parent any categories and create array
116
+ $get_cat_parents = rtrim(get_category_parents($last_category->term_id, false, '>'),'>');
117
  if(class_exists( 'WPSEO_Options' )){
118
  $primary_cateogory = get_post_meta(ampforwp_get_the_ID(), '_yoast_wpseo_primary_category', true);
119
  if(isset($primary_cateogory) && $primary_cateogory!=""){
120
  $pcname = get_the_category_by_ID($primary_cateogory);
121
  $category_name = $pcname;
122
+ $get_cat_parents = rtrim(get_category_parents($primary_cateogory, false, '>'),'>');
123
  }
124
  }
 
 
 
125
  // Get parent any categories and create array
126
+ $cat_parents = explode('>',$get_cat_parents);
 
 
127
  // Loop through parent categories and store in variable $cat_display
128
  $cat_display = '';
129
  foreach($cat_parents as $parents) {
templates/features.php CHANGED
@@ -128,7 +128,9 @@ add_amp_theme_support('AMP-logo');
128
  // AMP Loop
129
  add_amp_theme_support('AMP-loop');
130
  // GDPR
131
- add_amp_theme_support('AMP-gdpr');
 
 
132
  // Menu
133
  add_amp_theme_support('AMP-menu');
134
  // Adding AMP-related things to the main theme
@@ -2291,6 +2293,8 @@ function ampforwp_set_body_content_script($data){
2291
  $thtml = $matches1[1];
2292
  if(!in_array($comp, $thtml)){
2293
  $data['amp_component_scripts']["amp-".esc_attr($comp)] = "https://cdn.ampproject.org/v0/amp-".esc_attr($comp)."-latest.js";
 
 
2294
  }
2295
  } else{
2296
  $data['amp_component_scripts']["amp-".esc_attr($comp)] = "https://cdn.ampproject.org/v0/amp-".esc_attr($comp)."-latest.js";
@@ -7536,6 +7540,26 @@ function ampforwp_remove_unused_pb_amp_script($data){
7536
  return $data;
7537
  }
7538
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7539
  if(class_exists('transposh_plugin')){
7540
  add_action('amp_post_template_css','ampforwp_transposh_plugin_rtl_css');
7541
  }
128
  // AMP Loop
129
  add_amp_theme_support('AMP-loop');
130
  // GDPR
131
+ if(ampforwp_get_setting('amp-gdpr-compliance-switch')) {
132
+ add_amp_theme_support('AMP-gdpr');
133
+ }
134
  // Menu
135
  add_amp_theme_support('AMP-menu');
136
  // Adding AMP-related things to the main theme
2293
  $thtml = $matches1[1];
2294
  if(!in_array($comp, $thtml)){
2295
  $data['amp_component_scripts']["amp-".esc_attr($comp)] = "https://cdn.ampproject.org/v0/amp-".esc_attr($comp)."-latest.js";
2296
+ }else{
2297
+ $data['amp_component_scripts']["amp-".esc_attr($comp)] = "https://cdn.ampproject.org/v0/amp-".esc_attr($comp)."-latest.js";
2298
  }
2299
  } else{
2300
  $data['amp_component_scripts']["amp-".esc_attr($comp)] = "https://cdn.ampproject.org/v0/amp-".esc_attr($comp)."-latest.js";
7540
  return $data;
7541
  }
7542
 
7543
+ if(class_exists('RankMath')){
7544
+ add_filter('ampforwp_modify_the_content','ampforwp_rank_math_nofollow_to_external_link');
7545
+ }
7546
+ function ampforwp_rank_math_nofollow_to_external_link($content){
7547
+ $rank_math_external_link = RankMath\Helper::get_settings( 'general.nofollow_external_links' );
7548
+ if($rank_math_external_link){
7549
+ preg_match_all('/<a href="(.*?)">(.*?)<\/a>/', $content, $matches);
7550
+ for($i=0;$i<count($matches[1]);$i++){
7551
+ $url = $matches[1][$i];
7552
+ $is_external = ampforwp_isexternal($url);
7553
+ if($is_external){
7554
+ $rep_url = $matches[0][$i];
7555
+ $url = str_replace("/", "\/", $url);
7556
+ $content = preg_replace('/(<a href="'.esc_url($url).'.*")/', '$1 rel="nofollow"', $content);
7557
+ }
7558
+ }
7559
+ }
7560
+ return $content;
7561
+ }
7562
+
7563
  if(class_exists('transposh_plugin')){
7564
  add_action('amp_post_template_css','ampforwp_transposh_plugin_rtl_css');
7565
  }