AMP for WP – Accelerated Mobile Pages - Version 1.0.77.17

Version Description

(3rd August 2021) = * Improvements: Added dotmetrics analytics support in amp #5107 * Improvements: Added support to preserve query string with ?amp #5103

Download this release

Release Info

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

Code changes from version 1.0.77.16 to 1.0.77.17

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.8
7
- Stable tag: 1.0.77.16
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -197,6 +197,10 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
197
 
198
  == Changelog ==
199
 
 
 
 
 
200
  = 1.0.77.16 (29th July 2021) =
201
  * Improvements: Added Filter to remove last-modified header in amp #5101
202
  * Fixed: Webp images are not converting with Webp Express plugin #5108
@@ -209,9 +213,4 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
209
  * Fixed: Youtube videos does not appear on the AMP page with the Video Yoast plugin
210
  * Fixed: The parent tag of tag ‘picture’ must be noscript validation error #5097
211
 
212
- = 1.0.77.14 (20th July 2021) =
213
- * Fixed: AMP page not showing with query string from 1.0.66 version #5096
214
- * Fixed: Related posts title and excerpt not appearing properly #5095
215
- * Fixed: Debug warnigs with WP Foro plugin #5094
216
-
217
  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.8
7
+ Stable tag: 1.0.77.17
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
197
 
198
  == Changelog ==
199
 
200
+ = 1.0.77.17 (3rd August 2021) =
201
+ * Improvements: Added dotmetrics analytics support in amp #5107
202
+ * Improvements: Added support to preserve query string with ?amp #5103
203
+
204
  = 1.0.77.16 (29th July 2021) =
205
  * Improvements: Added Filter to remove last-modified header in amp #5101
206
  * Fixed: Webp images are not converting with Webp Express plugin #5108
213
  * Fixed: Youtube videos does not appear on the AMP page with the Video Yoast plugin
214
  * Fixed: The parent tag of tag ‘picture’ must be noscript validation error #5097
215
 
 
 
 
 
 
216
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
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.77.16
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.77.16');
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.77.17
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.77.17');
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.77.16 (29th July 2021) =
4
  * Improvements: Added Filter to remove last-modified header in amp #5101
5
  * Fixed: Webp images are not converting with Webp Express plugin #5108
1
  == Changelog ==
2
 
3
+ = 1.0.77.17 (3rd August 2021) =
4
+ * Improvements: Added dotmetrics analytics support in amp #5107
5
+ * Improvements: Added support to preserve query string with ?amp #5103
6
+
7
  = 1.0.77.16 (29th July 2021) =
8
  * Improvements: Added Filter to remove last-modified header in amp #5101
9
  * Fixed: Webp images are not converting with Webp Express plugin #5108
includes/features/analytics/analytics-functions.php CHANGED
@@ -310,6 +310,13 @@ function ampforwp_analytics() {
310
  if(!empty($config_url) && !empty($number) && !empty($analytics_url)){?>
311
  <amp-call-tracking config="<?php echo esc_url($config_url); ?>"><a href="tel:<?php echo esc_attr($number);?>"><?php echo esc_html($number);?></a></amp-call-tracking><amp-analytics config="<?php echo esc_url($analytics_url); ?>"></amp-analytics>
312
  <?php } }
 
 
 
 
 
 
 
313
  if( true == ampforwp_get_setting('ampforwp-iotech-switch')) {
314
  $project_id = $id = $title = $author = $categories = $cat_names = '';
315
  $project_id = ampforwp_get_setting('ampforwp-iotech-projectid');
310
  if(!empty($config_url) && !empty($number) && !empty($analytics_url)){?>
311
  <amp-call-tracking config="<?php echo esc_url($config_url); ?>"><a href="tel:<?php echo esc_attr($number);?>"><?php echo esc_html($number);?></a></amp-call-tracking><amp-analytics config="<?php echo esc_url($analytics_url); ?>"></amp-analytics>
312
  <?php } }
313
+ if( true == ampforwp_get_setting('ampforwp-dotmetrics-switch')) {
314
+ $dot_id = '';
315
+ $dot_id = ampforwp_get_setting('ampforwp-dotmetrics-id');
316
+ if(!empty($dot_id)){
317
+ $analytics_url = "https://script.dotmetrics.net/AmpConfig.json?id=".esc_html($dot_id); ?>
318
+ <amp-analytics config="<?php echo esc_url_raw($analytics_url); ?>"></amp-analytics>
319
+ <?php } }
320
  if( true == ampforwp_get_setting('ampforwp-iotech-switch')) {
321
  $project_id = $id = $title = $author = $categories = $cat_names = '';
322
  $project_id = ampforwp_get_setting('ampforwp-iotech-projectid');
includes/features/analytics/analytics-options.php CHANGED
@@ -605,6 +605,22 @@ function ampforwp_analytics_options($opt_name){
605
  'title' => esc_html__( 'Project ID', 'accelerated-mobile-pages' ),
606
  'tooltip-subtitle' => esc_html__( 'Enter Your Project ID Here','accelerated-mobile-pages'),
607
  'required' => array('ampforwp-iotech-switch', '=' , '1')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
608
  ),
609
  )
610
  )
605
  'title' => esc_html__( 'Project ID', 'accelerated-mobile-pages' ),
606
  'tooltip-subtitle' => esc_html__( 'Enter Your Project ID Here','accelerated-mobile-pages'),
607
  'required' => array('ampforwp-iotech-switch', '=' , '1')
608
+ ),
609
+ //Dotmetrics Analytics
610
+ array(
611
+ 'id' =>'ampforwp-dotmetrics-switch',
612
+ 'type' => 'switch',
613
+ 'title' => esc_html__('Dotmetrics Analytics','accelerated-mobile-pages'),
614
+ 'default' => 0,
615
+ 'tooltip-subtitle' => sprintf('%s <a href="%s" target="_blank">%s</a> %s',
616
+ esc_html__('Enable this option to track dotmetrics analytics in AMP and', 'accelerated-mobile-pages'), esc_url('https://ampforwp.com/tutorials/article/how-to-add-dotmetrics-analytics-in-amp/'),esc_html__('Click Here','accelerated-mobile-pages'), esc_html__('for more info','accelerated-mobile-pages')),
617
+ ),
618
+ array(
619
+ 'id' => 'ampforwp-dotmetrics-id',
620
+ 'type' => 'text',
621
+ 'title' => esc_html__( 'User ID', 'accelerated-mobile-pages' ),
622
+ 'tooltip-subtitle' => esc_html__( 'Enter Your User ID Here','accelerated-mobile-pages'),
623
+ 'required' => array('ampforwp-dotmetrics-switch', '=' , '1')
624
  ),
625
  )
626
  )
includes/redirect.php CHANGED
@@ -237,6 +237,17 @@ if(is_search() && 0 == ampforwp_get_setting('amp-redirection-search')){
237
  // Single.php and page.php
238
  if ( ( is_single() && $redux_builder_amp['amp-on-off-for-all-posts'] ) || ( is_page() && $redux_builder_amp['amp-on-off-for-all-pages'] ) ) {
239
  $redirection_location = get_the_permalink();
 
 
 
 
 
 
 
 
 
 
 
240
  }
241
  $ampforwp_amp_post_on_off_meta = "";
242
  $ampforwp_amp_post_on_off_meta = get_post_meta( ampforwp_get_the_ID(),'ampforwp-amp-on-off',true);
237
  // Single.php and page.php
238
  if ( ( is_single() && $redux_builder_amp['amp-on-off-for-all-posts'] ) || ( is_page() && $redux_builder_amp['amp-on-off-for-all-pages'] ) ) {
239
  $redirection_location = get_the_permalink();
240
+ $url_path = '';
241
+ if (true == ampforwp_get_setting('amp-core-end-point')) {
242
+ $url_path = trim(parse_url(add_query_arg(array()), PHP_URL_QUERY),'/' );
243
+ if (strpos($url_path, '&') !== false) {
244
+ $url_path = explode('&', $url_path);
245
+ $url_path = end($url_path);
246
+ if ($url_path != AMPFORWP_AMP_QUERY_VAR) {
247
+ $redirection_location .= '?'. $url_path;
248
+ }
249
+ }
250
+ }
251
  }
252
  $ampforwp_amp_post_on_off_meta = "";
253
  $ampforwp_amp_post_on_off_meta = get_post_meta( ampforwp_get_the_ID(),'ampforwp-amp-on-off',true);
includes/thirdparty-compatibility.php CHANGED
@@ -1230,6 +1230,13 @@ function ampforwp_is_amp_inURL($url){
1230
  if (class_exists('AMPforWP_Subdomain_Endpoint') && ampforwp_get_setting('amp-subdomain-url-format')) {
1231
  return true;
1232
  }
 
 
 
 
 
 
 
1233
  $urlArray = explode("/", $url);
1234
  if( !in_array( AMPFORWP_AMP_QUERY_VAR , $urlArray ) ) {
1235
  return false;
1230
  if (class_exists('AMPforWP_Subdomain_Endpoint') && ampforwp_get_setting('amp-subdomain-url-format')) {
1231
  return true;
1232
  }
1233
+ $mob_pres_link = false;
1234
+ if(function_exists('ampforwp_mobile_redirect_preseve_link')){
1235
+ $mob_pres_link = ampforwp_mobile_redirect_preseve_link();
1236
+ }
1237
+ if ($mob_pres_link == true) {
1238
+ return true;
1239
+ }
1240
  $urlArray = explode("/", $url);
1241
  if( !in_array( AMPFORWP_AMP_QUERY_VAR , $urlArray ) ) {
1242
  return false;
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.8
7
- Stable tag: 1.0.77.16
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -194,6 +194,10 @@ You can contact us from [here](https://ampforwp.com/contact/)
194
 
195
  == Changelog ==
196
 
 
 
 
 
197
  = 1.0.77.16 (29th July 2021) =
198
  * Improvements: Added Filter to remove last-modified header in amp #5101
199
  * Fixed: Webp images are not converting with Webp Express plugin #5108
@@ -206,9 +210,4 @@ You can contact us from [here](https://ampforwp.com/contact/)
206
  * Fixed: Youtube videos does not appear on the AMP page with the Video Yoast plugin
207
  * Fixed: The parent tag of tag ‘picture’ must be noscript validation error #5097
208
 
209
- = 1.0.77.14 (20th July 2021) =
210
- * Fixed: AMP page not showing with query string from 1.0.66 version #5096
211
- * Fixed: Related posts title and excerpt not appearing properly #5095
212
- * Fixed: Debug warnigs with WP Foro plugin #5094
213
-
214
  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.8
7
+ Stable tag: 1.0.77.17
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
194
 
195
  == Changelog ==
196
 
197
+ = 1.0.77.17 (3rd August 2021) =
198
+ * Improvements: Added dotmetrics analytics support in amp #5107
199
+ * Improvements: Added support to preserve query string with ?amp #5103
200
+
201
  = 1.0.77.16 (29th July 2021) =
202
  * Improvements: Added Filter to remove last-modified header in amp #5101
203
  * Fixed: Webp images are not converting with Webp Express plugin #5108
210
  * Fixed: Youtube videos does not appear on the AMP page with the Video Yoast plugin
211
  * Fixed: The parent tag of tag ‘picture’ must be noscript validation error #5097
212
 
 
 
 
 
 
213
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)