AMP for WP – Accelerated Mobile Pages - Version 0.9.98.7

Version Description

Download this release

Release Info

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

Code changes from version 0.9.98.6 to 0.9.98.7

Files changed (3) hide show
  1. README.md +1 -1
  2. accelerated-moblie-pages.php +54 -19
  3. readme.txt +1 -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.2.2
7
- Stable tag: 0.9.98.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.2.2
7
+ Stable tag: 0.9.98.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
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: 0.9.98.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','0.9.98.6');
24
  define('AMPFORWP_EXTENSION_DIR',plugin_dir_path(__FILE__).'includes/options/extensions');
25
  if(!defined('AMPFROWP_HOST_NAME')){
26
  $urlinfo = get_bloginfo('url');
@@ -1205,24 +1205,59 @@ function ampforwp_automattic_notice_delete(){
1205
 
1206
  add_action('admin_init','ampforwp_replace_redux_comments');
1207
  function ampforwp_replace_redux_comments(){
 
1208
  if(current_user_can( 'manage_options' )){
1209
- $replaced_redux_comments = get_transient('replaced_redux_comments');
 
1210
  if(!$replaced_redux_comments){
1211
- $redux = get_option('redux_builder_amp');
 
1212
  $search = '/******* Paste your Custom CSS in this Editor *******/';
1213
- $rep = str_replace("$search", "", $redux);
1214
- $search = '/**
1215
- * Enter your Advanced Analytics code here
1216
- */';
1217
- $rep = str_replace("$search", "", $rep);
1218
- $search = ' /**
1219
- * Enter your Advanced Analytics code here
1220
- */';
1221
- $rep = str_replace("$search", "", $rep);
1222
- $search = ' //Replace this with your Tracking ID';
1223
- $rep = str_replace("$search", "", $rep);
1224
- update_option('redux_builder_amp', $rep);
1225
- set_transient('replaced_redux_comments',1);
1226
- }
1227
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1228
  }
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: 0.9.98.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','0.9.98.7');
24
  define('AMPFORWP_EXTENSION_DIR',plugin_dir_path(__FILE__).'includes/options/extensions');
25
  if(!defined('AMPFROWP_HOST_NAME')){
26
  $urlinfo = get_bloginfo('url');
1205
 
1206
  add_action('admin_init','ampforwp_replace_redux_comments');
1207
  function ampforwp_replace_redux_comments(){
1208
+
1209
  if(current_user_can( 'manage_options' )){
1210
+ $replaced_redux_comments = get_transient('replaced_redux_comments_updated');
1211
+
1212
  if(!$replaced_redux_comments){
1213
+ $redux_val = get_option('redux_builder_amp',true);
1214
+
1215
  $search = '/******* Paste your Custom CSS in this Editor *******/';
1216
+ $rep = str_replace("$search", "", $redux_val);
1217
+
1218
+ //FOR GA
1219
+ $pattern = '/\s*/m';
1220
+ $replace = '';
1221
+
1222
+ $ga_val = $redux_val['ampforwp-ga-field-advance'];
1223
+ $rep = preg_replace( $pattern, $replace,$ga_val);
1224
+ $search = '/***EnteryourAdvancedAnalyticscodehere*/';
1225
+ $rep = str_replace("$search", "", $rep);
1226
+ $search = '//ReplacethiswithyourTrackingID';
1227
+ $rep = str_replace("$search", "", $rep);
1228
+ $jsonstr = "";
1229
+
1230
+ for($i=0;$i<strlen($rep);$i++){
1231
+ $resp = $rep[$i];
1232
+ $jsonstr.=$resp;
1233
+ if($resp=='{' || $resp=='}'){
1234
+ $jsonstr.=PHP_EOL;
1235
+ }
1236
+ }
1237
+ $redux_val['ampforwp-ga-field-advance'] = $jsonstr;
1238
+ // GA CLOSE
1239
+
1240
+ //FOR GTM
1241
+ $gml_val = $redux_val['ampforwp-gtm-field-advance'];
1242
+ $rep = preg_replace( $pattern, $replace,$gml_val);
1243
+ $search = '/***EnteryourAdvancedAnalyticscodehere*/';
1244
+ $rep = str_replace("$search", "", $rep);
1245
+ $search = '/*ReplacethiswithyourTrackingID*/';
1246
+ $rep = str_replace("$search", "", $rep);
1247
+
1248
+ $jsonstr = "";
1249
+ for($i=0;$i<strlen($rep);$i++){
1250
+ $resp = $rep[$i];
1251
+ $jsonstr.=$resp;
1252
+ if($resp=='{' || $resp=='}'){
1253
+ $jsonstr.=PHP_EOL;
1254
+ }
1255
+ }
1256
+ //GTM CLOSE
1257
+
1258
+ $redux_val['ampforwp-gtm-field-advance'] = $jsonstr;
1259
+ update_option('redux_builder_amp',$redux_val);
1260
+ set_transient('replaced_redux_comments_updated',1);
1261
+ }
1262
+ }
1263
  }
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.2.2
7
- Stable tag: 0.9.98.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.2.2
7
+ Stable tag: 0.9.98.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10