diff --git a/README.md b/README.md
index 60101aad3..5798cf946 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@ Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, go
Donate link: https://www.paypal.me/Kaludi/25
Requires at least: 3.0
Tested up to: 5.3.2
-Stable tag: 1.0.21
+Stable tag: 1.0.22
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -194,6 +194,16 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
== Changelog ==
+= 1.0.22 (6th February 2020) =
+* Fixed: Console error - Uncaught TypeError: Cannot read property 'on' of null #4102
+* Fixed: When Insert post ads plugin is enable then AMP settings panel is not showing. #4107
+* Fixed: Search console error fixed on WooCommerce wishlist page #4097
+* Fixed: GTM Added in Basic Setup and code improvements #4108
+* Fixed: The meta tags was not working in Head section #4116
+* Fixed: Upgrade to Pro button was missing in the AMP setting panel #4118
+* Fixed: Upgrade to Pro option was removing in the setting panel when we activate PWA for WP plugin #4117
+* Fixed: FAQ section improved #4119
+
= 1.0.21 (4th February 2020) =
* Fixed: Fatal error when AMP theme framework is active #4128
@@ -204,20 +214,4 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
* Fixed: Pages won't save apostophies in AMP page builder text module. #4074
* Fixed: Warring in console : [DOM] Found 2 elements with non-unique id #amp-search #3946
-= 1.0.19 (29th January 2020) =
-* Improvement: EWWW Image Optimizer plugin Compatibility #3984
-* Fixed: WP Admin toolbar CSS is not loading when user is logged in #4076
-* Fixed: AMP Options panel UI improvements done. #4088
-* Fixed: video is not displaying in AMP when a video is inserted from gutenberg video module #4086
-* Fixed: Performance section all features not working when Ezoic integration plugin is active. #4092
-* Fixed: Playbuzz is not working #4085
-* Fixed: RECENT POSTS label visible if no posts are available #4011
-* Fixed: data-block-on-consent is missing for Vuukle comments when gdpr is enabled #4095
-* Fixed: Remove Purge AMP CDN cache Settings buuton: #4099
-* Fixed: When categories that we exclude from AMP through the plugin configuration present redirection problem along with mobile redirection option #4075
-* Fixed: Alignment issue in GDPR Privacy link. #4101
-
-= 1.0.18 (27th January 2020) =
-* Fixed: Debug warnings with Imagify plugin #3908
-
Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
\ No newline at end of file
diff --git a/accelerated-moblie-pages.php b/accelerated-moblie-pages.php
index 685da1feb..2f1702888 100644
--- a/accelerated-moblie-pages.php
+++ b/accelerated-moblie-pages.php
@@ -3,7 +3,7 @@
Plugin Name: Accelerated Mobile Pages
Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
Description: AMP for WP - Accelerated Mobile Pages for WordPress
-Version: 1.0.21
+Version: 1.0.22
Author: Ahmed Kaludi, Mohammed Kaludi
Author URI: https://ampforwp.com/
Donate link: https://www.paypal.me/Kaludi/25
@@ -20,7 +20,7 @@
define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
-define('AMPFORWP_VERSION','1.0.21');
+define('AMPFORWP_VERSION','1.0.22');
define('AMPFORWP_EXTENSION_DIR',plugin_dir_path(__FILE__).'includes/options/extensions');
if(!defined('AMPFROWP_HOST_NAME')){
$urlinfo = get_bloginfo('url');
@@ -905,6 +905,7 @@ function ampforwp_get_setup_info($ux_option=''){
$ux_content = ampforwp_get_setting('opt-media','url');
}else if($ux_option=="ampforwp-ux-analytics-section"){
$ga_field = ampforwp_get_setting('ga-feild');
+ $ga_field_gtm = ampforwp_get_setting('amp-gtm-id');
$amp_fb_pixel_id = ampforwp_get_setting('amp-fb-pixel-id');
$sa_feild = ampforwp_get_setting('sa-feild');
$pa_feild = ampforwp_get_setting('pa-feild');
@@ -924,6 +925,7 @@ function ampforwp_get_setup_info($ux_option=''){
$analytics_txt = "";
$analytic_arr = array();
if(ampforwp_get_setting('ampforwp-ga-switch') && $ga_field!="UA-XXXXX-Y" && $ga_field!=""){$analytic_arr[]="Google Analytics";}
+ if(ampforwp_get_setting('amp-use-gtm-option') && $ga_field_gtm!="" && $ga_field_gtm!=""){$analytic_arr[]="Google Tag Manager";}
if(ampforwp_get_setting('amp-fb-pixel') && $amp_fb_pixel_id!=""){$analytic_arr[]="Facebook Pixel";}
if(ampforwp_get_setting('ampforwp-Segment-switch') && $sa_feild!="SEGMENT-WRITE-KEY" && $sa_feild!=""){$analytic_arr[]="Segment Analytics";}
if(ampforwp_get_setting('ampforwp-Piwik-switch') && $pa_feild!="#" && $pa_feild!=""){ $analytic_arr[]="Matomo Analytics";}
diff --git a/changelog.txt b/changelog.txt
index 774af4caf..f7fc88a5f 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,5 +1,15 @@
== Changelog ==
+= 1.0.22 (6th February 2020) =
+* Fixed: Console error - Uncaught TypeError: Cannot read property 'on' of null #4102
+* Fixed: When Insert post ads plugin is enable then AMP settings panel is not showing. #4107
+* Fixed: Search console error fixed on WooCommerce wishlist page #4097
+* Fixed: GTM Added in Basic Setup and code improvements #4108
+* Fixed: The meta tags was not working in Head section #4116
+* Fixed: Upgrade to Pro button was missing in the AMP setting panel #4118
+* Fixed: Upgrade to Pro option was removing in the setting panel when we activate PWA for WP plugin #4117
+* Fixed: FAQ section improved #4119
+
= 1.0.21 (4th February 2020) =
* Fixed: Fatal error when AMP theme framework is active #4128
diff --git a/includes/admin-script.js b/includes/admin-script.js
index 6be4a3a27..7f478f57d 100644
--- a/includes/admin-script.js
+++ b/includes/admin-script.js
@@ -1117,6 +1117,7 @@ jQuery(document).ready(function($) {
button = "SET UP";
}else if(active_drower=='ampforwp-ux-analytics-section'){
var ga_field = $('#ga-feild').val();
+ var ga_field_gtm = $('#amp-gtm-id').val();
var amp_fb_pixel_id = $('#amp-fb-pixel-id').val();
var sa_feild = $('#sa-feild').val();
var pa_feild = $('#pa-feild').val();
@@ -1138,6 +1139,7 @@ jQuery(document).ready(function($) {
var data_href = $(this).attr('data-href');
var hasCls = $(this).hasClass('hide');
if(ga_field!="UA-XXXXX-Y" && ga_field!="" && !hasCls && data_href=='ampforwp-ga-switch'){analytic_arr.push("Google Analytics");}
+ if(ga_field_gtm!="" && !hasCls && data_href=='amp-use-gtm-option'){analytic_arr.push("Google Tag Manager");}
if(amp_fb_pixel_id!="" && !hasCls && data_href=='amp-fb-pixel'){analytic_arr.push("Facebook Pixel");}
if(sa_feild!="SEGMENT-WRITE-KEY" && sa_feild!="" && !hasCls && data_href=='ampforwp-Segment-switch'){analytic_arr.push("Segment Analytics");}
if(pa_feild!="#" && pa_feild!="" && !hasCls && data_href=='ampforwp-Piwik-switch'){ analytic_arr.push("Matomo Analytics");}
@@ -1426,6 +1428,7 @@ jQuery(document).ready(function($) {
});
function ampforwp_check_analytics(data_href){
var ga_field = $('#ga-feild').val();
+ var ga_field_gtm = $('#amp-gtm-id').val();
var amp_fb_pixel_id = $('#amp-fb-pixel-id').val();
var sa_feild = $('#sa-feild').val();
var pa_feild = $('#pa-feild').val();
@@ -1456,6 +1459,18 @@ jQuery(document).ready(function($) {
$('[name="redux_builder_amp['+data_href+']"]').val(0);
}
}
+ }else if(data_href=='amp-use-gtm-option'){
+ if(ga_field_gtm!=""){
+ if(!checked){
+ $('input[data-id="'+data_href+'"]').click();
+ $('[name="redux_builder_amp['+data_href+']"]').val(1);
+ }
+ }else if(ga_field_gtm==""){
+ if(checked){
+ $('input[data-id="'+data_href+'"]').click();
+ $('[name="redux_builder_amp['+data_href+']"]').val(0);
+ }
+ }
}else if(data_href=='amp-fb-pixel'){
if(amp_fb_pixel_id!=""){
if(!checked){
diff --git a/includes/ampforwp-fields-array.php b/includes/ampforwp-fields-array.php
index 18a7d5466..9e8f03301 100644
--- a/includes/ampforwp-fields-array.php
+++ b/includes/ampforwp-fields-array.php
@@ -12,7 +12,7 @@
$options[$page->ID] = $page->post_title;
}
}
-$analytics_options = array(''=>'Add Analytics Type','ampforwp-ga-switch'=>'Google Analytics','ampforwp-Segment-switch'=>'Segment Analytics','ampforwp-Piwik-switch'=>'Matomo (Piwik) Analytics','ampforwp-Quantcast-switch'=>'Quantcast Measurement','ampforwp-comScore-switch'=>'comScore', 'ampforwp-Effective-switch'=>'Effective Measure','ampforwp-StatCounter-switch'=>'StatCounter','ampforwp-Histats-switch'=>'Histats Analytics','ampforwp-Yandex-switch'=>'Yandex Metrika','ampforwp-Chartbeat-switch'=>'Chartbeat Analytics','ampforwp-Alexa-switch'=>'Alexa Metrics','ampforwp-afs-analytics-switch'=>'AFS Analytics','amp-fb-pixel'=>'Facebook Pixel','amp-clicky-switch'=>'Clicky Analytics');
+$analytics_options = array(''=>'Add Analytics Type','ampforwp-ga-switch'=>'Google Analytics','amp-use-gtm-option'=>'Google Tag Manager','ampforwp-Segment-switch'=>'Segment Analytics','ampforwp-Piwik-switch'=>'Matomo (Piwik) Analytics','ampforwp-Quantcast-switch'=>'Quantcast Measurement','ampforwp-comScore-switch'=>'comScore', 'ampforwp-Effective-switch'=>'Effective Measure','ampforwp-StatCounter-switch'=>'StatCounter','ampforwp-Histats-switch'=>'Histats Analytics','ampforwp-Yandex-switch'=>'Yandex Metrika','ampforwp-Chartbeat-switch'=>'Chartbeat Analytics','ampforwp-Alexa-switch'=>'Alexa Metrics','ampforwp-afs-analytics-switch'=>'AFS Analytics','amp-fb-pixel'=>'Facebook Pixel','amp-clicky-switch'=>'Clicky Analytics');
$analytics_default_option = ampforwp_get_setting('amp-analytics-select-option');
$analytics_default = 'ampforwp-ga-switch';
switch ($analytics_default_option) {
@@ -217,6 +217,15 @@ function ampforwp_check_analytics_setup($type = ''){
array('field_type'=>'text', 'field_data'=>array('title'=>'Tracking ID','id'=>'amp-ux-ga','class'=>'amp-ux-ga google-analytics analytics-text','required'=>array(),'data-text'=>'ga-feild','element-class'=>'ux-label trac-id','default'=>ampforwp_get_setting('ga-feild'))
),
array('field_type'=>'sub_section_end','field_data'=>array()),
+ array('field_type'=>'sub_section_start',
+ 'field_data'=>array('id'=>'ampforwp-ux-gtm-analytics-section','class'=>'ampforwp-ux-sub-section ampforwp-ux-ana-sub','default'=>ampforwp_check_analytics_setup('Google Tag Manager'),'closable'=>1,'data-href'=>'amp-use-gtm-option')
+ ),
+ array('field_type'=>'heading',
+ 'field_data'=>array('title'=>'Google Tag Manager','class'=>'child_opt child_opt_arrow')
+ ),
+ array('field_type'=>'text', 'field_data'=>array('title'=>'Tag Manager ID (Container ID)','id'=>'amp-ux-gtm','class'=>'amp-ux-gtm analytics-text','required'=>array(),'data-text'=>'amp-gtm-id','element-class'=>'ux-label trac-id','default'=>ampforwp_get_setting('amp-gtm-id'))
+ ),
+ array('field_type'=>'sub_section_end','field_data'=>array()),
array('field_type'=>'sub_section_start',
'field_data'=>array('id'=>'ampforwp-ux-segment-analytics-section','class'=>'ampforwp-ux-sub-section ampforwp-ux-ana-sub','default'=>ampforwp_check_analytics_setup('Segment Analytics'),'closable'=>1,'data-href'=>'ampforwp-Segment-switch')
),
diff --git a/includes/features/analytics/analytics-functions.php b/includes/features/analytics/analytics-functions.php
index 9ba6ba3ce..385b8431c 100644
--- a/includes/features/analytics/analytics-functions.php
+++ b/includes/features/analytics/analytics-functions.php
@@ -366,7 +366,7 @@ function ampforwp_add_advance_gtm_fields( $ampforwp_adv_gtm_fields ) {
$ampforwp_adv_gtm_fields = preg_replace('/\n\s*\n/', '', $ampforwp_adv_gtm_fields);
$ampforwp_adv_gtm_fields = preg_replace('/\/\/(.*?)\s(.*)/m', '$2', $ampforwp_adv_gtm_fields);
if($gtm_id!=""){?>
-
No. There are no setup fees on any of our plans
All the plans are year-to-year which are subscribed annually.
All the plans are year-to-year which are subscribed annually.
+We accepts PayPal and Credit Card payments.
Yes! Top-notch customer support for our paid customers is key for a quality product, so we’ll do our very best to resolve any issues you encounter via our support page.
Yes, you can use the plugins but you will not get future updates for those plugins.
+All the plans are year-to-year which are subscribed annually.
+Yes, you will get updates for all the premium plugins until your subscription is active.