AMP for WP – Accelerated Mobile Pages - Version 0.9.97.44.1

Version Description

(29th March 2019) = * Added: Advertisement AMP panel improved #2724 * Fixed: Vuukle AMP integration code updated #2600 * Fixed: Fatal Error with old Plugins manager v1.0 #2976

Full changelog available in changelog.txt

Download this release

Release Info

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

Code changes from version 0.9.97.44 to 0.9.97.44.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.1
7
- Stable tag: 0.9.97.44
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -183,6 +183,11 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
183
 
184
  == Changelog ==
185
 
 
 
 
 
 
186
  = 0.9.97.44 (28th March 2019) =
187
  * Added: Captions feature in AMP page builder #2645
188
  * Added: Compatibility with the Youtube Oembed Plyr plugin #1505
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.1
7
+ Stable tag: 0.9.97.44.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
183
 
184
  == Changelog ==
185
 
186
+ = 0.9.97.44.1 (29th March 2019) =
187
+ * Added: Advertisement AMP panel improved #2724
188
+ * Fixed: Vuukle AMP integration code updated #2600
189
+ * Fixed: Fatal Error with old Plugins manager v1.0 #2976
190
+
191
  = 0.9.97.44 (28th March 2019) =
192
  * Added: Captions feature in AMP page builder #2645
193
  * Added: Compatibility with the Youtube Oembed Plyr plugin #1505
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.97.44
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.97.44');
24
  // any changes to AMP_QUERY_VAR should be refelected here
25
  function ampforwp_generate_endpoint(){
26
  $ampforwp_slug = '';
@@ -884,4 +884,45 @@ function ampforwp_redux_class(){
884
  # Do nothing, it will inherit all the methods
885
  }
886
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
887
  }
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.97.44.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','0.9.97.44.1');
24
  // any changes to AMP_QUERY_VAR should be refelected here
25
  function ampforwp_generate_endpoint(){
26
  $ampforwp_slug = '';
884
  # Do nothing, it will inherit all the methods
885
  }
886
  }
887
+ }
888
+
889
+ // AMP Plugins Manager compatibility #2976
890
+ if ( false == get_transient('ampforwp-pm-disabler') ) {
891
+ $ampforwp_active_plugins = array_flip(get_option('active_plugins'));
892
+ if (isset($ampforwp_active_plugins['amp-plugin-manager/ampforwp-3rd-party-plugin-creator.php'] ) ){
893
+ $plugin_data = get_plugin_data(AMPFORWP_MAIN_PLUGIN_DIR . 'amp-plugin-manager/ampforwp-3rd-party-plugin-creator.php' );
894
+ if ( version_compare( floatval( $plugin_data['Version'] ), '1.1', '<' ) ){
895
+ unset($ampforwp_active_plugins['amp-plugin-manager/ampforwp-3rd-party-plugin-creator.php']);
896
+ update_option('active_plugins', array_flip($ampforwp_active_plugins));
897
+ set_transient('ampforwp-pm-disabler', true);
898
+ include_once( ABSPATH . 'wp-includes/pluggable.php' );
899
+ wp_redirect(admin_url('plugins.php'));
900
+ }
901
+ }
902
+ elseif(isset($ampforwp_active_plugins['amp-plugin-manager-master/ampforwp-3rd-party-plugin-creator.php'] )){
903
+ $plugin_data = get_plugin_data(AMPFORWP_MAIN_PLUGIN_DIR . 'amp-plugin-manager-master/ampforwp-3rd-party-plugin-creator.php' );
904
+ if ( version_compare( floatval( $plugin_data['Version'] ), '1.1', '<' ) ){
905
+ unset($ampforwp_active_plugins['amp-plugin-manager-master/ampforwp-3rd-party-plugin-creator.php']);
906
+ update_option('active_plugins', array_flip($ampforwp_active_plugins));
907
+ set_transient('ampforwp-pm-disabler', true);
908
+ include_once( ABSPATH . 'wp-includes/pluggable.php' );
909
+ wp_redirect(admin_url('plugins.php'));
910
+ }
911
+ }
912
+
913
+ }
914
+ add_action('admin_notices', 'ampforwp_plugins_manager_notice');
915
+ function ampforwp_plugins_manager_notice(){
916
+ if ( true == get_transient('ampforwp-pm-disabler') ) { ?>
917
+ <div id="ampforwp_pluginmanager" class="notice-warning settings-error notice is-dismissible"><p><b><?php echo esc_html__('Attention: ','accelerated-mobile-pages');?></b><?php echo esc_html__('AMPforWP Plugin Manager has been deactivated and requires an upgrade. Please','accelerated-mobile-pages');?> <b><a target="_blank" href=<?php echo esc_url('https://ampforwp.com/plugins-manager/?update=plugins-manager#utm_source=plugin-page&utm_medium=plugin-manager-update&utm_campaign=update-notice');?>><?php echo esc_html__('Download &amp; install the latest version','accelerated-mobile-pages');?></a></b><?php echo esc_html__(' for free.','accelerated-mobile-pages');?>
918
+ </p>
919
+ </div>
920
+ <?php
921
+ }
922
+ }
923
+ add_action( 'activate_plugin', 'ampforwp_delete_plugins_manager_transient' );
924
+ function ampforwp_delete_plugins_manager_transient($plugin){
925
+ if ( strpos($plugin, 'ampforwp-3rd-party-plugin-creator.php') || strpos($plugin, 'accelerated-moblie-pages.php') ) {
926
+ delete_transient( 'ampforwp-pm-disabler' );
927
+ }
928
  }
changelog.txt CHANGED
@@ -1,5 +1,10 @@
1
  == Changelog ==
2
 
 
 
 
 
 
3
  = 0.9.97.44 (28th March 2019) =
4
  * Added: Captions feature in AMP page builder #2645
5
  * Added: Compatibility with the Youtube Oembed Plyr plugin #1505
1
  == Changelog ==
2
 
3
+ = 0.9.97.44.1 (29th March 2019) =
4
+ * Added: Advertisement AMP panel improved #2724
5
+ * Fixed: Vuukle AMP integration code updated #2600
6
+ * Fixed: Fatal Error with old Plugins manager v1.0 #2976
7
+
8
  = 0.9.97.44 (28th March 2019) =
9
  * Added: Captions feature in AMP page builder #2645
10
  * Added: Compatibility with the Youtube Oembed Plyr plugin #1505
components/call-now/call-now.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
- /*TODO: Check the usage of call-now component, or we are using #55 from features.php #2652*/
3
- add_action('amp_call_button','amp_call_button_html_output');
4
- function amp_call_button_html_output(){
5
- global $redux_builder_amp;
6
- if ( $redux_builder_amp['ampforwp-callnow-button'] ) { ?>
7
- <div class="amp-phone">
8
- <a href="tel:<?php echo esc_attr($redux_builder_amp['enable-amp-call-numberfield']); ?>"></a>
9
- </div> <?php
10
- }
11
- }
12
- add_action('amp_post_template_css','amp_callnow_styles',11);
13
- function amp_callnow_styles(){
14
- global $redux_builder_amp; if ($redux_builder_amp['ampforwp-callnow-button']) { ?>
15
- .amp-phone{ position:relative }
16
- .amp-phone a:before { content: ""; display:inline-block; width: 4px; height: 8px; border-width: 6px 0 6px 3px; border-style: solid; border-color:<?php echo $redux_builder_amp['amp-opt-color-rgba-colorscheme-call']['color']; ?>; background: transparent; transform: rotate(-30deg); box-sizing: initial; border-top-left-radius: 3px 5px; border-bottom-left-radius: 3px 5px; }
17
- <?php }} ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
components/comments/comments.php CHANGED
@@ -195,22 +195,35 @@ function ampforwp_framework_get_disqus_comments(){
195
  function ampforwp_framework_get_vuukle_comments(){
196
  global $post, $redux_builder_amp;
197
  $apiKey ='';
 
 
 
198
  if( isset($redux_builder_amp['ampforwp-vuukle-comments-apiKey']) && $redux_builder_amp['ampforwp-vuukle-comments-apiKey'] !== ""){
199
  $apiKey = $redux_builder_amp['ampforwp-vuukle-comments-apiKey'];
200
  }
201
  $siteUrl = trim(site_url(), '/');
202
- if (!preg_match('#^http(s)?://#', $siteUrl)) {
203
  $siteUrl = 'http://' . $siteUrl;
204
- }
 
 
 
 
 
 
 
 
205
  $urlParts = parse_url($siteUrl);
206
  $siteUrl = preg_replace('/^www\./', '', $urlParts['host']);// remove www
207
  $srcUrl = 'https://cdn.vuukle.com/amp.html?';
208
  $srcUrl = add_query_arg('url' ,get_permalink(), $srcUrl);
209
  $srcUrl = add_query_arg('host' ,$siteUrl, $srcUrl);
210
  $srcUrl = add_query_arg('id' , $post->ID, $srcUrl);
211
- $srcUrl = add_query_arg('apiKey' , $apiKey, $srcUrl);
212
- $srcUrl = add_query_arg('title' , urlencode($post->post_title), $srcUrl);
213
- $vuukle_html = '<amp-iframe width="600" height="350" layout="responsive" sandbox="allow-scripts allow-same-origin allow-modals allow-popups allow-forms" resizable frameborder="0" src="'.esc_url($srcUrl).'">
 
 
214
 
215
  <div overflow tabindex="0" role="button" aria-label="Show comments">Show comments</div>';
216
  echo $vuukle_html;
@@ -263,8 +276,7 @@ function ampforwp_framework_comments_scripts( $data ) {
263
  if ( empty( $data['amp_component_scripts']['amp-iframe'] ) ) {
264
  $data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
265
  }
266
- if ($redux_builder_amp['ampforwp-vuukle-Ads-before-comments']==1
267
- && empty( $data['amp_component_scripts']['amp-ad'] ) ) {
268
  $data['amp_component_scripts']['amp-ad'] = 'https://cdn.ampproject.org/v0/amp-ad-0.1.js';
269
  }
270
  }
195
  function ampforwp_framework_get_vuukle_comments(){
196
  global $post, $redux_builder_amp;
197
  $apiKey ='';
198
+ $tag_name ='';
199
+ $img = get_the_post_thumbnail_url();
200
+ $tags = get_the_tags($post->ID);
201
  if( isset($redux_builder_amp['ampforwp-vuukle-comments-apiKey']) && $redux_builder_amp['ampforwp-vuukle-comments-apiKey'] !== ""){
202
  $apiKey = $redux_builder_amp['ampforwp-vuukle-comments-apiKey'];
203
  }
204
  $siteUrl = trim(site_url(), '/');
205
+ if (!preg_match('#^http(s)?://#', $siteUrl)) {
206
  $siteUrl = 'http://' . $siteUrl;
207
+ }
208
+ if($img == false){
209
+ $img = plugins_url('accelerated-mobile-pages/images/150x150.png');
210
+ }
211
+ if($tags){
212
+ foreach($tags as $individual_tag) {
213
+ $tag_name = $individual_tag->name;
214
+ }
215
+ }
216
  $urlParts = parse_url($siteUrl);
217
  $siteUrl = preg_replace('/^www\./', '', $urlParts['host']);// remove www
218
  $srcUrl = 'https://cdn.vuukle.com/amp.html?';
219
  $srcUrl = add_query_arg('url' ,get_permalink(), $srcUrl);
220
  $srcUrl = add_query_arg('host' ,$siteUrl, $srcUrl);
221
  $srcUrl = add_query_arg('id' , $post->ID, $srcUrl);
222
+ $srcUrl = add_query_arg('title' , urlencode($post->post_title), $srcUrl);
223
+ $srcUrl = add_query_arg('img' , esc_url($img), $srcUrl);
224
+ $srcUrl = add_query_arg('tags' , urlencode($tag_name), $srcUrl);
225
+
226
+ $vuukle_html = '<amp-iframe width="600" height="350" layout="responsive" sandbox="allow-scripts allow-same-origin allow-modals allow-popups allow-forms" resizable frameborder="0" src="'.esc_url($srcUrl).'">
227
 
228
  <div overflow tabindex="0" role="button" aria-label="Show comments">Show comments</div>';
229
  echo $vuukle_html;
276
  if ( empty( $data['amp_component_scripts']['amp-iframe'] ) ) {
277
  $data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
278
  }
279
+ if (ampforwp_get_setting('ampforwp-vuukle-Ads-before-comments') && empty( $data['amp_component_scripts']['amp-ad'] ) ) {
 
280
  $data['amp_component_scripts']['amp-ad'] = 'https://cdn.ampproject.org/v0/amp-ad-0.1.js';
281
  }
282
  }
includes/admin-style.css CHANGED
@@ -738,7 +738,7 @@ span.switch-text {
738
  font-size: 14px;
739
  color: #333;}
740
  .ampforwp-st-data-update .col-1{width: 30%;float: left;}
741
- .ampforwp-st-data-update .col-3 li:before {
742
  content: "\f147";
743
  font-family: dashicons;
744
  position: relative;
@@ -831,4 +831,43 @@ span.switch-text {
831
  }
832
  .ampforwp-rate-stars svg:hover ~ svg{
833
  fill:none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
834
  }
738
  font-size: 14px;
739
  color: #333;}
740
  .ampforwp-st-data-update .col-1{width: 30%;float: left;}
741
+ .ampforwp-st-data-update .col-3 li:before , .ampforwp-ads-data-update .col-3 li:before{
742
  content: "\f147";
743
  font-family: dashicons;
744
  position: relative;
831
  }
832
  .ampforwp-rate-stars svg:hover ~ svg{
833
  fill:none;
834
+ }
835
+ div#section-amp-ads_1,table#section-table-amp-ads_1{
836
+ max-width: 75%;
837
+ }
838
+ div#section-ampforwp-ads-section , table#section-table-ampforwp-ads-section{
839
+ max-width: 24%;
840
+ float: right;
841
+ position: relative;
842
+ margin-top: -37px;
843
+ }
844
+
845
+ div#section-ampforwp-ads-section:after {
846
+ content: '';
847
+ }
848
+
849
+ div#section-ampforwp-ads-section h3:before{
850
+ content: "NEW";
851
+ color: #fff;
852
+ background: #4452a7;
853
+ padding: 5px 6px;
854
+ border-radius: 30px;
855
+ font-weight: normal;
856
+ position: relative;
857
+ top: 1px;
858
+ left: -6px;
859
+ font-size: 10px;
860
+ line-height: 10px;
861
+ }
862
+ .redux-main .redux-field-container{
863
+ padding: 18px 10px 18px 0;
864
+ }
865
+ .adsactive {
866
+ max-width: 100%!important;
867
+ float: none!important;
868
+ margin-top:0!important;
869
+ }
870
+ .adsactive + #section-table-ampforwp-ads-section {
871
+ max-width:100%;
872
+ float: none ;
873
  }
includes/module-upgrade.js CHANGED
@@ -12,6 +12,8 @@ jQuery(document).ready(function($){
12
  activate = '&activate=pwa';
13
  }else if(currentId=='ampforwp-structure-data-activation-call'){
14
  activate = '&activate=structure_data';
 
 
15
  }
16
  self.text( wp.updates.l10n.installing );
17
  $.ajax({
@@ -74,6 +76,19 @@ jQuery(document).ready(function($){
74
  self.removeClass('ampforwp-activation-call-module-upgrade');
75
  }
76
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  }
78
  },
79
  error: function (jqXHR, exception) {
12
  activate = '&activate=pwa';
13
  }else if(currentId=='ampforwp-structure-data-activation-call'){
14
  activate = '&activate=structure_data';
15
+ }else if(currentId=='ampforwp-adsforwp-activation-call'){
16
+ activate = '&activate=adsforwp';
17
  }
18
  self.text( wp.updates.l10n.installing );
19
  $.ajax({
76
  self.removeClass('ampforwp-activation-call-module-upgrade');
77
  }
78
  });
79
+ }else if(self.attr('id')=='ampforwp-adsforwp-activation-call'){
80
+ msgplug = 'Ads for WP';
81
+ self.text( 'Importing data...' );
82
+ //Import Data
83
+ jQuery.ajax({
84
+ url: ajaxurl,
85
+ type: 'post',
86
+ data: 'action=ampforwp_import_modules_ads&verify_nonce='+nonce,
87
+ success: function () {
88
+ self.html('<a href="'+response.redirect_url+'" style="text-decoration: none;color: #555;">Installed! - Let\'s Go to '+msgplug+' Settings</a>')
89
+ self.removeClass('ampforwp-activation-call-module-upgrade');
90
+ }
91
+ });
92
  }
93
  },
94
  error: function (jqXHR, exception) {
includes/modules-upgrade.php CHANGED
@@ -62,6 +62,33 @@ function ampforwp_enable_modules_upgread(){
62
  );
63
  $redirectSettingsUrl = admin_url('admin.php?page=structured_data_options&tab=general&reference=ampforwp');
64
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  default:
66
  $plugins = array();
67
  break;
@@ -91,6 +118,9 @@ function ampforwp_admin_notice_module_reference_install() {
91
  case 'structured_data_options':
92
  $message = 'AMPforWP Structured data Module has been Upgraded. You may configure it below:';
93
  break;
 
 
 
94
  }
95
  }
96
  if($message){ ?>
@@ -105,9 +135,10 @@ add_action( 'admin_notices', 'ampforwp_admin_notice_module_reference_install' );
105
 
106
 
107
  /**
108
- * Finish setub and Import default settings
109
  *
110
  */
 
111
  //On module upgrade
112
  add_action('wp_ajax_ampforwp_import_modules_scema', 'ampforwp_import_structure_data');
113
  function ampforwp_import_structure_data(){
@@ -206,4 +237,28 @@ function ampforwp_import_structure_data(){
206
  update_option('sd_data', $sd_data_update);
207
  update_option('ampforwp_structure_data_module_upgrade','migrated');
208
  return true;
209
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  );
63
  $redirectSettingsUrl = admin_url('admin.php?page=structured_data_options&tab=general&reference=ampforwp');
64
  break;
65
+ case 'adsforwp':
66
+ $nonceUrl = add_query_arg(
67
+ array(
68
+ 'action' => 'activate',
69
+ 'plugin' => 'ads-for-wp',
70
+ 'plugin_status' => 'all',
71
+ 'paged' => '1',
72
+ '_wpnonce' => wp_create_nonce( 'ads-for-wp' ),
73
+ ),
74
+ network_admin_url( 'plugins.php' )
75
+ );
76
+ $plugins[] = array(
77
+ 'name' => 'ads-for-wp',
78
+ 'path_' => 'https://downloads.wordpress.org/plugin/ads-for-wp.zip',
79
+ 'path' => add_query_arg(
80
+ array(
81
+ 'action' => 'activate',
82
+ 'plugin' => 'ads-for-wp',
83
+ 'plugin_status' => 'all',
84
+ 'paged' => '1',
85
+ '_wpnonce' => $nonceUrl,
86
+ )
87
+ ),
88
+ 'install' => 'ads-for-wp/ads-for-wp.php',
89
+ );
90
+ $redirectSettingsUrl = admin_url('admin.php?page=adsforwp&tab=general&reference=ampforwp');
91
+ break;
92
  default:
93
  $plugins = array();
94
  break;
118
  case 'structured_data_options':
119
  $message = 'AMPforWP Structured data Module has been Upgraded. You may configure it below:';
120
  break;
121
+ case 'adsforwp_options':
122
+ $message = 'AMPforWP AdsforWP Module has been Upgraded. You may configure it below:';
123
+ break;
124
  }
125
  }
126
  if($message){ ?>
135
 
136
 
137
  /**
138
+ * Finish setup and Import default settings
139
  *
140
  */
141
+ // Structured Data
142
  //On module upgrade
143
  add_action('wp_ajax_ampforwp_import_modules_scema', 'ampforwp_import_structure_data');
144
  function ampforwp_import_structure_data(){
237
  update_option('sd_data', $sd_data_update);
238
  update_option('ampforwp_structure_data_module_upgrade','migrated');
239
  return true;
240
+ }
241
+ // AdsforWP
242
+ //On module upgrade
243
+ add_action('wp_ajax_ampforwp_import_modules_ads', 'ampforwp_import_ads_data');
244
+ function ampforwp_import_ads_data(){
245
+ global $redux_builder_amp;
246
+ if(!wp_verify_nonce( $_REQUEST['verify_nonce'], 'verify_module' ) ) {
247
+ echo json_encode(array("status"=>300,"message"=>'Request not valid'));
248
+ exit();
249
+ }
250
+ // Exit if the user does not have proper permissions
251
+ if(! current_user_can( 'install_plugins' ) ) {
252
+ echo json_encode(array("status"=>300,"message"=>'User Request not valid'));
253
+ exit();
254
+ }
255
+ $adsforwp_object = new adsforwp_admin_common_functions();
256
+ $result = $adsforwp_object->adsforwp_migrate_ampforwp_ads();
257
+ $result = array_filter($result);
258
+ if($result){
259
+ echo json_encode(array('status'=>'t', 'message'=>esc_html__('Data has been imported succeessfully','accelerated-mobile-pages')));
260
+ }else{
261
+ echo json_encode(array('status'=>'f', 'message'=>esc_html__('Plugin data is not available or it is not activated','accelerated-mobile-pages')));
262
+ }
263
+ wp_die();
264
+ }
includes/options/admin-config.php CHANGED
@@ -1374,42 +1374,282 @@ Redux::setArgs( "redux_builder_amp", $args );
1374
  $AD_URL = "http://ampforwp.com/advanced-amp-ads/#utm_source=options-panel&utm_medium=advertisement-tab&utm_campaign=AMP%20Plugin";
1375
  $desc = '';
1376
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
1377
- if(!is_plugin_active( 'amp-incontent-ads/amptoolkit-incontent-ads.php' ) ){
1378
 
1379
  $desc = '<a href="'.esc_url($AD_URL).'" target="_blank"><img class="ampforwp-ad-img-banner" src="'.AMPFORWP_IMAGE_DIR . '/amp-ads-retina.png" width="560" height="85" /></a>';
1380
  }
1381
 
1382
- // ADS SECTION
1383
- Redux::setSection( $opt_name, array(
1384
- 'title' => esc_html__( 'Advertisement', 'accelerated-mobile-pages' ),
1385
- 'desc' => $desc,
1386
- 'id' => 'amp-ads',
1387
- 'subsection' => true,
1388
- 'fields' => array(
1389
- array(
1390
  'id' => 'amp-ads_1',
1391
  'type' => 'section',
1392
  'title' => esc_html__('Advertisement Positions', 'accelerated-mobile-pages'),
1393
  'indent' => true,
1394
  'layout_type' => 'accordion',
1395
  'accordion-open'=> 1,
1396
- ),
1397
- // Ad 1 Starts
1398
- array(
1399
- 'id' =>'enable-amp-ads-1',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1400
  'type' => 'switch',
1401
- 'title' => esc_html__('AD #1', 'accelerated-mobile-pages'),
1402
  'default' => 0,
1403
- 'desc' => esc_html__('Below the Header (SiteWide)', 'accelerated-mobile-pages'),
1404
  'true' => 'Enabled',
1405
  'false' => 'Disabled',
1406
- ),
1407
- array(
1408
- 'class' => 'child_opt child_opt_arrow',
1409
- 'id' => 'enable-amp-ads-select-1',
1410
  'type' => 'select',
1411
  'title' => esc_html__('AD Size', 'accelerated-mobile-pages'),
1412
- 'required' => array('enable-amp-ads-1', '=' , '1'),
1413
  // Must provide key => value pairs for select options
1414
  'options' => array(
1415
  '1' => esc_html__('300x250','accelerated-mobile-pages'),
@@ -1418,187 +1658,55 @@ Redux::setArgs( "redux_builder_amp", $args );
1418
  '4' => esc_html__('300x600','accelerated-mobile-pages'),
1419
  '5' => esc_html__('320x100','accelerated-mobile-pages'),
1420
  '6' => esc_html__('200x50','accelerated-mobile-pages'),
1421
- '7' => esc_html__('320x50','accelerated-mobile-pages'), ),
1422
- 'default' => '2',
1423
- ),
1424
- array(
1425
- 'class' => 'child_opt',
1426
- 'id' =>'enable-amp-ads-text-feild-client-1',
1427
- 'type' => 'text',
1428
- 'required' => array('enable-amp-ads-1', '=' , '1'),
1429
- 'title' => esc_html__('Data AD Client', 'accelerated-mobile-pages'),
1430
- 'tooltip-subtitle' => esc_html__('Enter the Data Ad Client (data-ad-client) from the adsense ad code.', 'accelerated-mobile-pages'),
1431
- 'default' => '',
1432
- 'placeholder'=> 'ca-pub-2005XXXXXXXXX342'
1433
- ),
1434
- array(
1435
- 'class' => 'child_opt',
1436
- 'id' => 'enable-amp-ads-text-feild-slot-1',
1437
- 'type' => 'text',
1438
- 'title' => esc_html__('Data AD Slot', 'accelerated-mobile-pages'),
1439
- 'tooltip-subtitle' => esc_html__('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code.', 'accelerated-mobile-pages'),
1440
- 'default' => '',
1441
- 'required' => array('enable-amp-ads-1', '=' , '1'),
1442
- 'placeholder'=> '70XXXXXX12'
1443
- ),
1444
- array(
1445
- 'class' => 'child_opt',
1446
- 'id' =>'enable-amp-ads-resp-1',
1447
- 'type' => 'switch',
1448
- 'title' => esc_html__('Responsive Ad unit', 'accelerated-mobile-pages'),
1449
- 'default' => 0,
1450
- 'required' => array('enable-amp-ads-1', '=' , '1'),
1451
- ),
1452
- // Ad 1 ends
1453
-
1454
- // Ad 2 Starts
1455
- array(
1456
- 'id'=>'enable-amp-ads-2',
1457
- 'type' => 'switch',
1458
- 'title' => esc_html__('AD #2', 'accelerated-mobile-pages'),
1459
- 'default' => 0,
1460
- 'desc' => esc_html__('Below the Footer (SiteWide)', 'accelerated-mobile-pages'),
1461
- 'true' => 'Enabled',
1462
- 'false' => 'Disabled',
1463
- ),
1464
- array(
1465
- 'class' => 'child_opt child_opt_arrow',
1466
- 'id' => 'enable-amp-ads-select-2',
1467
- 'type' => 'select',
1468
- 'title' => esc_html__('AD Size', 'accelerated-mobile-pages'),
1469
- 'required' => array('enable-amp-ads-2', '=' , '1'),
1470
- // Must provide key => value pairs for select options
1471
- 'options' => array(
1472
- '1' => '300x250',
1473
- '2' => '336x280',
1474
- '3' => '728x90',
1475
- '4' => '300x600',
1476
- '5' => '320x100',
1477
- '6' => '200x50',
1478
- '7' => '320x50'
1479
- ),
1480
- 'default' => '2',
1481
- ),
1482
- array(
1483
- 'class' => 'child_opt',
1484
- 'id' =>'enable-amp-ads-text-feild-client-2',
1485
- 'type' => 'text',
1486
- 'required' => array('enable-amp-ads-2', '=' , '1'),
1487
- 'title' => esc_html__('Data AD Client', 'accelerated-mobile-pages'),
1488
- 'tooltip-subtitle' => __('Enter the Data Ad Client (data-ad-client) from the adsense ad code.', 'accelerated-mobile-pages'),
1489
- 'default' => '',
1490
- 'placeholder'=> 'ca-pub-2005XXXXXXXXX342'
1491
- ),
1492
- array(
1493
- 'class' => 'child_opt',
1494
- 'id' => 'enable-amp-ads-text-feild-slot-2',
1495
- 'type' => 'text',
1496
- 'title' => esc_html__('Data AD Slot', 'accelerated-mobile-pages'),
1497
- 'tooltip-subtitle' => esc_html__('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code.', 'accelerated-mobile-pages'),
1498
- 'default' => '',
1499
- 'required' => array('enable-amp-ads-2', '=' , '1'),
1500
- 'placeholder'=> '70XXXXXX12'
1501
- ),
1502
- array(
1503
- 'class' => 'child_opt',
1504
- 'id' =>'enable-amp-ads-resp-2',
1505
- 'type' => 'switch',
1506
- 'title' => esc_html__('Responsive Ad unit', 'accelerated-mobile-pages'),
1507
- 'default' => 0,
1508
- 'required' => array('enable-amp-ads-2', '=' , '1'),
1509
- ),
1510
- // Ad 2 ends
1511
-
1512
- // Ad 3 starts
1513
- array(
1514
- 'id' => 'enable-amp-ads-3',
1515
- 'type' => 'switch',
1516
- 'title' => esc_html__('AD #3', 'accelerated-mobile-pages'),
1517
- 'default' => 0,
1518
- 'desc' => esc_html__('Above the Post Content', 'accelerated-mobile-pages'),
1519
- 'true' => 'Enabled',
1520
- 'false' => 'Disabled',
1521
- ),
1522
- array(
1523
- 'class' => 'child_opt child_opt_arrow',
1524
- 'id' => 'made-amp-ad-3-global',
1525
- 'type' => 'select',
1526
- 'title' => esc_html__('Display on', 'accelerated-mobile-pages'),
1527
- 'options' => array (
1528
- '1' => 'Single',
1529
- '2' => 'Pages',
1530
- '3' => 'Custom Post Types',
1531
- '4' => 'Global'
1532
- ),
1533
- 'multi' => true,
1534
- 'default' => '1',
1535
- 'desc' => esc_html__('Display the Ad on only post or on all posts and pages ', 'accelerated-mobile-pages'),
1536
- 'required' => array('enable-amp-ads-3', '=' , '1')
1537
- ),
1538
- array(
1539
- 'class' => 'child_opt child_opt_arrow',
1540
- 'id' => 'enable-amp-ads-select-3',
1541
- 'type' => 'select',
1542
- 'title' => esc_html__('AD Size', 'accelerated-mobile-pages'),
1543
- 'required' => array('enable-amp-ads-3', '=' , '1'),
1544
- // Must provide key => value pairs for select options
1545
- 'options' => array(
1546
- '1' => '300x250',
1547
- '2' => '336x280',
1548
- '3' => '728x90',
1549
- '4' => '300x600',
1550
- '5' => '320x100',
1551
- '6' => '200x50',
1552
- '7' => '320x50'
1553
- ),
1554
  'default' => '2',
1555
- ),
1556
- array(
1557
- 'class' => 'child_opt',
1558
- 'id' =>'enable-amp-ads-text-feild-client-3',
1559
  'type' => 'text',
1560
- 'required' => array('enable-amp-ads-3', '=' , '1'),
1561
  'title' => esc_html__('Data AD Client', 'accelerated-mobile-pages'),
1562
  'tooltip-subtitle' => esc_html__('Enter the Data Ad Client (data-ad-client) from the adsense ad code.', 'accelerated-mobile-pages'),
1563
  'default' => '',
1564
  'placeholder'=> 'ca-pub-2005XXXXXXXXX342'
1565
- ),
1566
- array(
1567
- 'class' => 'child_opt',
1568
- 'id' => 'enable-amp-ads-text-feild-slot-3',
1569
  'type' => 'text',
1570
  'title' => esc_html__('Data AD Slot', 'accelerated-mobile-pages'),
1571
- 'tooltip-subtitle' => esc_html__('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code.', 'accelerated-mobile-pages'),
1572
  'default' => '',
1573
- 'required' => array('enable-amp-ads-3', '=' , '1'),
1574
  'placeholder'=> '70XXXXXX12'
1575
- ),
1576
- array(
1577
- 'class' => 'child_opt',
1578
- 'id' =>'enable-amp-ads-resp-3',
1579
- 'type' => 'switch',
1580
- 'title' => esc_html__('Responsive Ad unit', 'accelerated-mobile-pages'),
1581
- 'default' => 0,
1582
- 'required' => array('enable-amp-ads-3', '=' , '1'),
1583
- ),
1584
- // Ad 3 ends
1585
 
1586
- // Ad 4 Starts
1587
- array(
1588
- 'id' => 'enable-amp-ads-4',
1589
  'type' => 'switch',
1590
- 'title' => esc_html__('AD #4', 'accelerated-mobile-pages'),
1591
  'default' => 0,
1592
- 'desc' => esc_html__('Below the Post Content (Single Post)', 'accelerated-mobile-pages'),
1593
  'true' => 'Enabled',
1594
  'false' => 'Disabled',
1595
- ),
1596
- array(
1597
- 'class' => 'child_opt child_opt_arrow',
1598
- 'id' => 'enable-amp-ads-select-4',
1599
  'type' => 'select',
1600
  'title' => esc_html__('AD Size', 'accelerated-mobile-pages'),
1601
- 'required' => array('enable-amp-ads-4', '=' , '1'),
1602
  // Must provide key => value pairs for select options
1603
  'options' => array(
1604
  '1' => esc_html__('300x250','accelerated-mobile-pages'),
@@ -1610,206 +1718,137 @@ Redux::setArgs( "redux_builder_amp", $args );
1610
  '7' => esc_html__('320x50','accelerated-mobile-pages')
1611
  ),
1612
  'default' => '2',
1613
- ),
1614
- array(
1615
- 'class' => 'child_opt',
1616
- 'id' =>'enable-amp-ads-text-feild-client-4',
 
1617
  'type' => 'text',
1618
- 'required' => array('enable-amp-ads-4', '=' , '1'),
1619
  'title' => esc_html__('Data AD Client', 'accelerated-mobile-pages'),
1620
  'tooltip-subtitle' => esc_html__('Enter the Data Ad Client (data-ad-client) from the adsense ad code.', 'accelerated-mobile-pages'),
1621
  'default' => '',
1622
  'placeholder'=> 'ca-pub-2005XXXXXXXXX342'
1623
- ),
1624
- array(
1625
- 'class' => 'child_opt',
1626
- 'id' => 'enable-amp-ads-text-feild-slot-4',
1627
  'type' => 'text',
1628
  'title' => esc_html__('Data AD Slot', 'accelerated-mobile-pages'),
1629
  'tooltip-subtitle' => esc_html__('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code. ', 'accelerated-mobile-pages'),
1630
  'default' => '',
1631
- 'required' => array('enable-amp-ads-4', '=' , '1'),
1632
  'placeholder'=> '70XXXXXX12'
1633
- ),
1634
- array(
1635
- 'class' => 'child_opt',
1636
- 'id' =>'enable-amp-ads-resp-4',
1637
- 'type' => 'switch',
1638
- 'title' => esc_html__('Responsive Ad unit', 'accelerated-mobile-pages'),
1639
- 'default' => 0,
1640
- 'required' => array('enable-amp-ads-4', '=' , '1'),
1641
- ),
1642
- // Ad 4 ends
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1643
 
1644
- //Ad 5 Starts
1645
- array(
1646
- 'id' => 'enable-amp-ads-5',
1647
- 'type' => 'switch',
1648
- 'title' => esc_html__('AD #5', 'accelerated-mobile-pages'),
1649
- 'default' => 0,
1650
- 'desc' => esc_html__('Below The Title (Single Post)', 'accelerated-mobile-pages'),
1651
- 'true' => 'Enabled',
1652
- 'false' => 'Disabled',
1653
- ),
1654
- array(
1655
- 'class' => 'child_opt child_opt_arrow',
1656
- 'id' => 'enable-amp-ads-select-5',
1657
- 'type' => 'select',
1658
- 'title' => esc_html__('AD Size', 'accelerated-mobile-pages'),
1659
- 'required' => array('enable-amp-ads-5', '=' , '1'),
1660
- // Must provide key => value pairs for select options
1661
- 'options' => array(
1662
- '1' => esc_html__('300x250','accelerated-mobile-pages'),
1663
- '2' => esc_html__('336x280','accelerated-mobile-pages'),
1664
- '3' => esc_html__('728x90','accelerated-mobile-pages'),
1665
- '4' => esc_html__('300x600','accelerated-mobile-pages'),
1666
- '5' => esc_html__('320x100','accelerated-mobile-pages'),
1667
- '6' => esc_html__('200x50','accelerated-mobile-pages'),
1668
- '7' => esc_html__('320x50','accelerated-mobile-pages')
1669
- ),
1670
- 'default' => '2',
1671
- ),
1672
- array(
1673
- 'class' => 'child_opt',
1674
- 'id' =>'enable-amp-ads-text-feild-client-5',
1675
- 'type' => 'text',
1676
- 'required' => array('enable-amp-ads-5', '=' , '1'),
1677
- 'title' => esc_html__('Data AD Client', 'accelerated-mobile-pages'),
1678
- 'tooltip-subtitle' => esc_html__('Enter the Data Ad Client (data-ad-client) from the adsense ad code.', 'accelerated-mobile-pages'),
1679
- 'default' => '',
1680
- 'placeholder'=> 'ca-pub-2005XXXXXXXXX342'
1681
- ),
1682
- array(
1683
- 'class' => 'child_opt',
1684
- 'id' => 'enable-amp-ads-text-feild-slot-5',
1685
- 'type' => 'text',
1686
- 'title' => esc_html__('Data AD Slot', 'accelerated-mobile-pages'),
1687
- 'tooltip-subtitle' => esc_html__('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code. ', 'accelerated-mobile-pages'),
1688
- 'default' => '',
1689
- 'required' => array('enable-amp-ads-5', '=' , '1'),
1690
- 'placeholder'=> '70XXXXXX12'
1691
- ),
1692
- array(
1693
- 'class' => 'child_opt',
1694
- 'id' =>'enable-amp-ads-resp-5',
1695
  'type' => 'switch',
1696
- 'title' => esc_html__('Responsive Ad unit', 'accelerated-mobile-pages'),
1697
- 'default' => 0,
1698
- 'required' => array('enable-amp-ads-5', '=' , '1'),
1699
- ),
1700
 
1701
- //Ad 6 Starts
1702
- array(
1703
- 'id' => 'enable-amp-ads-6',
1704
- 'type' => 'switch',
1705
- 'title' => esc_html__('AD #6', 'accelerated-mobile-pages'),
1706
- 'default' => 0,
1707
- 'desc' => esc_html__('Above the Related Posts (Single Post)', 'accelerated-mobile-pages'),
1708
- 'true' => 'Enabled',
1709
- 'false' => 'Disabled',
1710
- ),
1711
- array(
1712
- 'class' => 'child_opt child_opt_arrow',
1713
- 'id' => 'enable-amp-ads-select-6',
1714
- 'type' => 'select',
1715
- 'title' => esc_html__('AD Size', 'accelerated-mobile-pages'),
1716
- 'required' => array('enable-amp-ads-6', '=' , '1'),
1717
- // Must provide key => value pairs for select options
1718
- 'options' => array(
1719
- '1' => esc_html__('300x250','accelerated-mobile-pages'),
1720
- '2' => esc_html__('336x280','accelerated-mobile-pages'),
1721
- '3' => esc_html__('728x90','accelerated-mobile-pages'),
1722
- '4' => esc_html__('300x600','accelerated-mobile-pages'),
1723
- '5' => esc_html__('320x100','accelerated-mobile-pages'),
1724
- '6' => esc_html__('200x50','accelerated-mobile-pages'),
1725
- '7' => esc_html__('320x50','accelerated-mobile-pages')
1726
- ),
1727
- 'default' => '2',
1728
- ),
1729
- array(
1730
- 'class' => 'child_opt',
1731
- 'id' =>'enable-amp-ads-text-feild-client-6',
1732
- 'type' => 'text',
1733
- 'required' => array('enable-amp-ads-6', '=' , '1'),
1734
- 'title' => esc_html__('Data AD Client', 'accelerated-mobile-pages'),
1735
- 'tooltip-subtitle' => esc_html__('Enter the Data Ad Client (data-ad-client) from the adsense ad code.', 'accelerated-mobile-pages'),
1736
- 'default' => '',
1737
- 'placeholder'=> 'ca-pub-2005XXXXXXXXX342'
1738
- ),
1739
- array(
1740
- 'class' => 'child_opt',
1741
- 'id' => 'enable-amp-ads-text-feild-slot-6',
1742
- 'type' => 'text',
1743
- 'title' => esc_html__('Data AD Slot', 'accelerated-mobile-pages'),
1744
- 'tooltip-subtitle' => esc_html__('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code. ', 'accelerated-mobile-pages'),
1745
- 'default' => '',
1746
- 'required' => array('enable-amp-ads-6', '=' , '1'),
1747
- 'placeholder'=> '70XXXXXX12'
1748
- ),
1749
- array(
1750
- 'class' => 'child_opt',
1751
- 'id' =>'enable-amp-ads-resp-6',
1752
  'type' => 'switch',
1753
- 'title' => esc_html__('Responsive Ad unit', 'accelerated-mobile-pages'),
1754
  'default' => 0,
1755
- 'required' => array('enable-amp-ads-6', '=' , '1'),
1756
- ),
1757
-
1758
- array(
1759
- 'id' => 'amp-ads_2',
1760
- 'type' => 'section',
1761
- 'title' => esc_html__('Ad Performance', 'accelerated-mobile-pages'),
1762
- 'indent' => true,
1763
- 'layout_type' => 'accordion',
1764
- 'accordion-open'=> 1,
1765
- ),
1766
-
1767
- array(
1768
- 'id' => 'amp-ads_2',
1769
- 'type' => 'section',
1770
- 'title' => esc_html__('Ad Performance', 'accelerated-mobile-pages'),
1771
- 'indent' => true,
1772
- 'layout_type' => 'accordion',
1773
- 'accordion-open'=> 1,
1774
- ),
1775
- array(
1776
- 'id' =>'ampforwp-ads-data-loading-strategy',
1777
- 'type' => 'switch',
1778
- 'title' => esc_html__('Optimize For Viewability', 'accelerated-mobile-pages'),
1779
- 'default' => 0,
1780
- 'tooltip-subtitle' => esc_html__('This will increase the loading speed of the Ads', 'accelerated-mobile-pages'),
1781
- 'true' => 'Enabled',
1782
- 'false' => 'Disabled',
1783
- ),
1784
- array(
1785
- 'id' => 'amp-ads_3',
1786
- 'type' => 'section',
1787
- 'title' => esc_html__('General', 'accelerated-mobile-pages'),
1788
- 'indent' => true,
1789
- 'layout_type' => 'accordion',
1790
- 'accordion-open'=> 1,
1791
- ),
1792
- array(
1793
- 'id' =>'ampforwp-ads-sponsorship',
1794
- 'type' => 'switch',
1795
- 'title' => esc_html__('Sponsorship Label', 'accelerated-mobile-pages'),
1796
- 'default' => 0,
1797
- 'true' => 'Enabled',
1798
- 'false' => 'Disabled',
1799
- ),
1800
- array(
1801
- 'id' =>'ampforwp-ads-sponsorship-label',
1802
- 'type' => 'text',
1803
- 'required' => array('ampforwp-ads-sponsorship', '=' , '1'),
1804
- 'title' => esc_html__('Sponsorship Label Text', 'accelerated-mobile-pages'),
1805
- 'class' => 'child_opt child_opt_arrow',
1806
- 'default' => '',
1807
- 'placeholder'=> 'Sponsored'
1808
- ),
1809
-
1810
- ),
1811
- ) );
1812
 
 
 
 
 
 
 
 
 
 
 
 
1813
  if ( ! function_exists('ampforwp_seo_default') ) {
1814
  function ampforwp_seo_default() {
1815
  $default = '';
@@ -2001,7 +2040,6 @@ Redux::setArgs( "redux_builder_amp", $args );
2001
  'id' => 'pwa-for-wp',
2002
  'desc' => '',
2003
  'subsection' => true,
2004
- 'class' => 'ampforwp_new_features ',
2005
  'fields' => array(
2006
  array(
2007
  'id' => 'ampforwp-pwa-for-wp',
1374
  $AD_URL = "http://ampforwp.com/advanced-amp-ads/#utm_source=options-panel&utm_medium=advertisement-tab&utm_campaign=AMP%20Plugin";
1375
  $desc = '';
1376
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
1377
+ if(!is_plugin_active( 'amp-incontent-ads/amptoolkit-incontent-ads.php' ) && !is_plugin_active( 'ads-for-wp/ads-for-wp.php' )){
1378
 
1379
  $desc = '<a href="'.esc_url($AD_URL).'" target="_blank"><img class="ampforwp-ad-img-banner" src="'.AMPFORWP_IMAGE_DIR . '/amp-ads-retina.png" width="560" height="85" /></a>';
1380
  }
1381
 
1382
+ add_filter('ampforwp_ads_option_fields', 'ampforwp_add_ads_fields');
1383
+ function ampforwp_add_ads_fields($fields){
1384
+
1385
+ if ( !is_plugin_active('ads-for-wp/ads-for-wp.php') ) {
1386
+ $fields[] = array(
 
 
 
1387
  'id' => 'amp-ads_1',
1388
  'type' => 'section',
1389
  'title' => esc_html__('Advertisement Positions', 'accelerated-mobile-pages'),
1390
  'indent' => true,
1391
  'layout_type' => 'accordion',
1392
  'accordion-open'=> 1,
1393
+ );
1394
+ // Ad 1 Starts
1395
+ $fields[] = array(
1396
+ 'id' =>'enable-amp-ads-1',
1397
+ 'type' => 'switch',
1398
+ 'title' => esc_html__('AD #1', 'accelerated-mobile-pages'),
1399
+ 'default' => 0,
1400
+ 'desc' => esc_html__('Below the Header (SiteWide)', 'accelerated-mobile-pages'),
1401
+ 'true' => 'Enabled',
1402
+ 'false' => 'Disabled',
1403
+ );
1404
+ $fields[] = array(
1405
+ 'class' => 'child_opt child_opt_arrow',
1406
+ 'id' => 'enable-amp-ads-select-1',
1407
+ 'type' => 'select',
1408
+ 'title' => esc_html__('AD Size', 'accelerated-mobile-pages'),
1409
+ 'required' => array('enable-amp-ads-1', '=' , '1'),
1410
+ // Must provide key => value pairs for select options
1411
+ 'options' => array(
1412
+ '1' => esc_html__('300x250','accelerated-mobile-pages'),
1413
+ '2' => esc_html__('336x280','accelerated-mobile-pages'),
1414
+ '3' => esc_html__('728x90','accelerated-mobile-pages'),
1415
+ '4' => esc_html__('300x600','accelerated-mobile-pages'),
1416
+ '5' => esc_html__('320x100','accelerated-mobile-pages'),
1417
+ '6' => esc_html__('200x50','accelerated-mobile-pages'),
1418
+ '7' => esc_html__('320x50','accelerated-mobile-pages'), ),
1419
+ 'default' => '2',
1420
+ );
1421
+ $fields[] = array(
1422
+ 'class' => 'child_opt',
1423
+ 'id' =>'enable-amp-ads-text-feild-client-1',
1424
+ 'type' => 'text',
1425
+ 'required' => array('enable-amp-ads-1', '=' , '1'),
1426
+ 'title' => esc_html__('Data AD Client', 'accelerated-mobile-pages'),
1427
+ 'tooltip-subtitle' => esc_html__('Enter the Data Ad Client (data-ad-client) from the adsense ad code.', 'accelerated-mobile-pages'),
1428
+ 'default' => '',
1429
+ 'placeholder'=> 'ca-pub-2005XXXXXXXXX342'
1430
+ );
1431
+ $fields[] = array(
1432
+ 'class' => 'child_opt',
1433
+ 'id' => 'enable-amp-ads-text-feild-slot-1',
1434
+ 'type' => 'text',
1435
+ 'title' => esc_html__('Data AD Slot', 'accelerated-mobile-pages'),
1436
+ 'tooltip-subtitle' => esc_html__('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code.', 'accelerated-mobile-pages'),
1437
+ 'default' => '',
1438
+ 'required' => array('enable-amp-ads-1', '=' , '1'),
1439
+ 'placeholder'=> '70XXXXXX12'
1440
+ );
1441
+ $fields[] = array(
1442
+ 'class' => 'child_opt',
1443
+ 'id' =>'enable-amp-ads-resp-1',
1444
+ 'type' => 'switch',
1445
+ 'title' => esc_html__('Responsive Ad unit', 'accelerated-mobile-pages'),
1446
+ 'default' => 0,
1447
+ 'required' => array('enable-amp-ads-1', '=' , '1'),
1448
+ );
1449
+ // Ad 1 ends
1450
+ // Ad 2 Starts
1451
+ $fields[] = array(
1452
+ 'id'=>'enable-amp-ads-2',
1453
+ 'type' => 'switch',
1454
+ 'title' => esc_html__('AD #2', 'accelerated-mobile-pages'),
1455
+ 'default' => 0,
1456
+ 'desc' => esc_html__('Below the Footer (SiteWide)', 'accelerated-mobile-pages'),
1457
+ 'true' => 'Enabled',
1458
+ 'false' => 'Disabled',
1459
+ );
1460
+ $fields[] = array(
1461
+ 'class' => 'child_opt child_opt_arrow',
1462
+ 'id' => 'enable-amp-ads-select-2',
1463
+ 'type' => 'select',
1464
+ 'title' => esc_html__('AD Size', 'accelerated-mobile-pages'),
1465
+ 'required' => array('enable-amp-ads-2', '=' , '1'),
1466
+ // Must provide key => value pairs for select options
1467
+ 'options' => array(
1468
+ '1' => '300x250',
1469
+ '2' => '336x280',
1470
+ '3' => '728x90',
1471
+ '4' => '300x600',
1472
+ '5' => '320x100',
1473
+ '6' => '200x50',
1474
+ '7' => '320x50'
1475
+ ),
1476
+ 'default' => '2',
1477
+ );
1478
+ $fields[] = array(
1479
+ 'class' => 'child_opt',
1480
+ 'id' =>'enable-amp-ads-text-feild-client-2',
1481
+ 'type' => 'text',
1482
+ 'required' => array('enable-amp-ads-2', '=' , '1'),
1483
+ 'title' => esc_html__('Data AD Client', 'accelerated-mobile-pages'),
1484
+ 'tooltip-subtitle' => esc_html__('Enter the Data Ad Client (data-ad-client) from the adsense ad code.', 'accelerated-mobile-pages'),
1485
+ 'default' => '',
1486
+ 'placeholder'=> 'ca-pub-2005XXXXXXXXX342'
1487
+ );
1488
+ $fields[] = array(
1489
+ 'class' => 'child_opt',
1490
+ 'id' => 'enable-amp-ads-text-feild-slot-2',
1491
+ 'type' => 'text',
1492
+ 'title' => esc_html__('Data AD Slot', 'accelerated-mobile-pages'),
1493
+ 'tooltip-subtitle' => esc_html__('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code.', 'accelerated-mobile-pages'),
1494
+ 'default' => '',
1495
+ 'required' => array('enable-amp-ads-2', '=' , '1'),
1496
+ 'placeholder'=> '70XXXXXX12'
1497
+ );
1498
+ $fields[] = array(
1499
+ 'class' => 'child_opt',
1500
+ 'id' =>'enable-amp-ads-resp-2',
1501
+ 'type' => 'switch',
1502
+ 'title' => esc_html__('Responsive Ad unit', 'accelerated-mobile-pages'),
1503
+ 'default' => 0,
1504
+ 'required' => array('enable-amp-ads-2', '=' , '1'),
1505
+ );
1506
+ // Ad 2 ends
1507
+ // Ad 3 starts
1508
+ $fields[] = array(
1509
+ 'id' => 'enable-amp-ads-3',
1510
+ 'type' => 'switch',
1511
+ 'title' => esc_html__('AD #3', 'accelerated-mobile-pages'),
1512
+ 'default' => 0,
1513
+ 'desc' => esc_html__('Above the Post Content', 'accelerated-mobile-pages'),
1514
+ 'true' => 'Enabled',
1515
+ 'false' => 'Disabled',
1516
+ );
1517
+ $fields[] = array(
1518
+ 'class' => 'child_opt child_opt_arrow',
1519
+ 'id' => 'made-amp-ad-3-global',
1520
+ 'type' => 'select',
1521
+ 'title' => esc_html__('Display on', 'accelerated-mobile-pages'),
1522
+ 'options' => array (
1523
+ '1' => 'Single',
1524
+ '2' => 'Pages',
1525
+ '3' => 'Custom Post Types',
1526
+ '4' => 'Global'
1527
+ ),
1528
+ 'multi' => true,
1529
+ 'default' => '1',
1530
+ 'desc' => esc_html__('Display the Ad on only post or on all posts and pages ', 'accelerated-mobile-pages'),
1531
+ 'required' => array('enable-amp-ads-3', '=' , '1')
1532
+ );
1533
+ $fields[] = array(
1534
+ 'class' => 'child_opt child_opt_arrow',
1535
+ 'id' => 'enable-amp-ads-select-3',
1536
+ 'type' => 'select',
1537
+ 'title' => esc_html__('AD Size', 'accelerated-mobile-pages'),
1538
+ 'required' => array('enable-amp-ads-3', '=' , '1'),
1539
+ // Must provide key => value pairs for select options
1540
+ 'options' => array(
1541
+ '1' => '300x250',
1542
+ '2' => '336x280',
1543
+ '3' => '728x90',
1544
+ '4' => '300x600',
1545
+ '5' => '320x100',
1546
+ '6' => '200x50',
1547
+ '7' => '320x50'
1548
+ ),
1549
+ 'default' => '2',
1550
+ );
1551
+ $fields[] = array(
1552
+ 'class' => 'child_opt',
1553
+ 'id' =>'enable-amp-ads-text-feild-client-3',
1554
+ 'type' => 'text',
1555
+ 'required' => array('enable-amp-ads-3', '=' , '1'),
1556
+ 'title' => esc_html__('Data AD Client', 'accelerated-mobile-pages'),
1557
+ 'tooltip-subtitle' => esc_html__('Enter the Data Ad Client (data-ad-client) from the adsense ad code.', 'accelerated-mobile-pages'),
1558
+ 'default' => '',
1559
+ 'placeholder'=> 'ca-pub-2005XXXXXXXXX342'
1560
+ );
1561
+ $fields[] = array(
1562
+ 'class' => 'child_opt',
1563
+ 'id' => 'enable-amp-ads-text-feild-slot-3',
1564
+ 'type' => 'text',
1565
+ 'title' => esc_html__('Data AD Slot', 'accelerated-mobile-pages'),
1566
+ 'tooltip-subtitle' => esc_html__('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code.', 'accelerated-mobile-pages'),
1567
+ 'default' => '',
1568
+ 'required' => array('enable-amp-ads-3', '=' , '1'),
1569
+ 'placeholder'=> '70XXXXXX12'
1570
+ );
1571
+ $fields[] = array(
1572
+ 'class' => 'child_opt',
1573
+ 'id' =>'enable-amp-ads-resp-3',
1574
+ 'type' => 'switch',
1575
+ 'title' => esc_html__('Responsive Ad unit', 'accelerated-mobile-pages'),
1576
+ 'default' => 0,
1577
+ 'required' => array('enable-amp-ads-3', '=' , '1'),
1578
+ );
1579
+ // Ad 3 ends
1580
+ // Ad 4 Starts
1581
+ $fields[] = array(
1582
+ 'id' => 'enable-amp-ads-4',
1583
+ 'type' => 'switch',
1584
+ 'title' => esc_html__('AD #4', 'accelerated-mobile-pages'),
1585
+ 'default' => 0,
1586
+ 'desc' => __('Below the Post Content (Single Post)', 'accelerated-mobile-pages'),
1587
+ 'true' => 'Enabled',
1588
+ 'false' => 'Disabled',
1589
+ );
1590
+ $fields[] = array(
1591
+ 'class' => 'child_opt child_opt_arrow',
1592
+ 'id' => 'enable-amp-ads-select-4',
1593
+ 'type' => 'select',
1594
+ 'title' => esc_html__('AD Size', 'accelerated-mobile-pages'),
1595
+ 'required' => array('enable-amp-ads-4', '=' , '1'),
1596
+ // Must provide key => value pairs for select options
1597
+ 'options' => array(
1598
+ '1' => esc_html__('300x250','accelerated-mobile-pages'),
1599
+ '2' => esc_html__('336x280','accelerated-mobile-pages'),
1600
+ '3' => esc_html__('728x90','accelerated-mobile-pages'),
1601
+ '4' => esc_html__('300x600','accelerated-mobile-pages'),
1602
+ '5' => esc_html__('320x100','accelerated-mobile-pages'),
1603
+ '6' =>esc_html__('200x50','accelerated-mobile-pages'),
1604
+ '7' => esc_html__('320x50','accelerated-mobile-pages')
1605
+ ),
1606
+ 'default' => '2',
1607
+ );
1608
+ $fields[] = array(
1609
+ 'class' => 'child_opt',
1610
+ 'id' =>'enable-amp-ads-text-feild-client-4',
1611
+ 'type' => 'text',
1612
+ 'required' => array('enable-amp-ads-4', '=' , '1'),
1613
+ 'title' => esc_html__('Data AD Client', 'accelerated-mobile-pages'),
1614
+ 'tooltip-subtitle' => esc_html__('Enter the Data Ad Client (data-ad-client) from the adsense ad code.', 'accelerated-mobile-pages'),
1615
+ 'default' => '',
1616
+ 'placeholder'=> 'ca-pub-2005XXXXXXXXX342'
1617
+ );
1618
+ $fields[] = array(
1619
+ 'class' => 'child_opt',
1620
+ 'id' => 'enable-amp-ads-text-feild-slot-4',
1621
+ 'type' => 'text',
1622
+ 'title' => esc_html__('Data AD Slot', 'accelerated-mobile-pages'),
1623
+ 'tooltip-subtitle' => esc_html__('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code. ', 'accelerated-mobile-pages'),
1624
+ 'default' => '',
1625
+ 'required' => array('enable-amp-ads-4', '=' , '1'),
1626
+ 'placeholder'=> '70XXXXXX12'
1627
+ );
1628
+ $fields[] = array(
1629
+ 'class' => 'child_opt',
1630
+ 'id' =>'enable-amp-ads-resp-4',
1631
+ 'type' => 'switch',
1632
+ 'title' => esc_html__('Responsive Ad unit', 'accelerated-mobile-pages'),
1633
+ 'default' => 0,
1634
+ 'required' => array('enable-amp-ads-4', '=' , '1'),
1635
+ );
1636
+ // Ad 4 ends
1637
+ //Ad 5 Starts
1638
+ $fields[] =array(
1639
+ 'id' => 'enable-amp-ads-5',
1640
  'type' => 'switch',
1641
+ 'title' => esc_html__('AD #5', 'accelerated-mobile-pages'),
1642
  'default' => 0,
1643
+ 'desc' => esc_html__('Below The Title (Single Post)', 'accelerated-mobile-pages'),
1644
  'true' => 'Enabled',
1645
  'false' => 'Disabled',
1646
+ );
1647
+ $fields[] = array(
1648
+ 'class' => 'child_opt child_opt_arrow',
1649
+ 'id' => 'enable-amp-ads-select-5',
1650
  'type' => 'select',
1651
  'title' => esc_html__('AD Size', 'accelerated-mobile-pages'),
1652
+ 'required' => array('enable-amp-ads-5', '=' , '1'),
1653
  // Must provide key => value pairs for select options
1654
  'options' => array(
1655
  '1' => esc_html__('300x250','accelerated-mobile-pages'),
1658
  '4' => esc_html__('300x600','accelerated-mobile-pages'),
1659
  '5' => esc_html__('320x100','accelerated-mobile-pages'),
1660
  '6' => esc_html__('200x50','accelerated-mobile-pages'),
1661
+ '7' => esc_html__('320x50','accelerated-mobile-pages'),
1662
+ ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1663
  'default' => '2',
1664
+ );
1665
+ $fields[] = array(
1666
+ 'class' => 'child_opt',
1667
+ 'id' =>'enable-amp-ads-text-feild-client-5',
1668
  'type' => 'text',
1669
+ 'required' => array('enable-amp-ads-5', '=' , '1'),
1670
  'title' => esc_html__('Data AD Client', 'accelerated-mobile-pages'),
1671
  'tooltip-subtitle' => esc_html__('Enter the Data Ad Client (data-ad-client) from the adsense ad code.', 'accelerated-mobile-pages'),
1672
  'default' => '',
1673
  'placeholder'=> 'ca-pub-2005XXXXXXXXX342'
1674
+ );
1675
+ $fields[] = array(
1676
+ 'class' => 'child_opt',
1677
+ 'id' => 'enable-amp-ads-text-feild-slot-5',
1678
  'type' => 'text',
1679
  'title' => esc_html__('Data AD Slot', 'accelerated-mobile-pages'),
1680
+ 'tooltip-subtitle' => esc_html__('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code. ', 'accelerated-mobile-pages'),
1681
  'default' => '',
1682
+ 'required' => array('enable-amp-ads-5', '=' , '1'),
1683
  'placeholder'=> '70XXXXXX12'
1684
+ );
1685
+ $fields[] = array(
1686
+ 'class' => 'child_opt',
1687
+ 'id' =>'enable-amp-ads-resp-5',
1688
+ 'type' => 'switch',
1689
+ 'title' => esc_html__('Responsive Ad unit', 'accelerated-mobile-pages'),
1690
+ 'default' => 0,
1691
+ 'required' => array('enable-amp-ads-5', '=' , '1'),
1692
+ );
 
1693
 
1694
+ //Ad 6 Starts
1695
+ $fields[] =array(
1696
+ 'id' => 'enable-amp-ads-6',
1697
  'type' => 'switch',
1698
+ 'title' => esc_html__('AD #6', 'accelerated-mobile-pages'),
1699
  'default' => 0,
1700
+ 'desc' => esc_html__('Above the Related Posts (Single Post)', 'accelerated-mobile-pages'),
1701
  'true' => 'Enabled',
1702
  'false' => 'Disabled',
1703
+ );
1704
+ $fields[] = array(
1705
+ 'class' => 'child_opt child_opt_arrow',
1706
+ 'id' => 'enable-amp-ads-select-6',
1707
  'type' => 'select',
1708
  'title' => esc_html__('AD Size', 'accelerated-mobile-pages'),
1709
+ 'required' => array('enable-amp-ads-6', '=' , '1'),
1710
  // Must provide key => value pairs for select options
1711
  'options' => array(
1712
  '1' => esc_html__('300x250','accelerated-mobile-pages'),
1718
  '7' => esc_html__('320x50','accelerated-mobile-pages')
1719
  ),
1720
  'default' => '2',
1721
+
1722
+ );
1723
+ $fields[] = array(
1724
+ 'class' => 'child_opt',
1725
+ 'id' =>'enable-amp-ads-text-feild-client-6',
1726
  'type' => 'text',
1727
+ 'required' => array('enable-amp-ads-6', '=' , '1'),
1728
  'title' => esc_html__('Data AD Client', 'accelerated-mobile-pages'),
1729
  'tooltip-subtitle' => esc_html__('Enter the Data Ad Client (data-ad-client) from the adsense ad code.', 'accelerated-mobile-pages'),
1730
  'default' => '',
1731
  'placeholder'=> 'ca-pub-2005XXXXXXXXX342'
1732
+ );
1733
+ $fields[] = array(
1734
+ 'class' => 'child_opt',
1735
+ 'id' => 'enable-amp-ads-text-feild-slot-6',
1736
  'type' => 'text',
1737
  'title' => esc_html__('Data AD Slot', 'accelerated-mobile-pages'),
1738
  'tooltip-subtitle' => esc_html__('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code. ', 'accelerated-mobile-pages'),
1739
  'default' => '',
1740
+ 'required' => array('enable-amp-ads-6', '=' , '1'),
1741
  'placeholder'=> '70XXXXXX12'
1742
+
1743
+
1744
+ );
1745
+ $fields[] = array(
1746
+ 'class' => 'child_opt',
1747
+ 'id' =>'enable-amp-ads-resp-6',
1748
+ 'type' => 'switch',
1749
+ 'title' => esc_html__('Responsive Ad unit', 'accelerated-mobile-pages'),
1750
+ 'default' => 0,
1751
+ 'required' => array('enable-amp-ads-6', '=' , '1'),
1752
+ );
1753
+ }
1754
+ $fields[] = array(
1755
+ 'id' => 'ampforwp-ads-section',
1756
+ 'class'=> is_plugin_active('ads-for-wp/ads-for-wp.php')? "adsactive": '',
1757
+ 'type' => 'section',
1758
+ 'title' => esc_html__('Introducing Ads for WP', 'accelerated-mobile-pages'),
1759
+ 'indent' => true,
1760
+ 'layout_type' => 'accordion',
1761
+ 'accordion-open'=> 1,
1762
+ );
1763
+ $fields[] = array(
1764
+ 'id' => 'ampforwp-ads-module',
1765
+ 'class'=> is_plugin_active('ads-for-wp/ads-for-wp.php')? "adsactive": '',
1766
+ 'type' => 'raw',
1767
+ 'content' => '<div class="ampforwp-ads-data-update">
1768
+ '.(!is_plugin_active('ads-for-wp/ads-for-wp.php')? esc_html__('A Revolutionary new Ad plugin from our team which is dedicated to make the #1 Ad solution in the world.','accelerated-mobile-pages'): esc_html__('Thank you for upgrading the Ads for WP','accelerated-mobile-pages')).'
1769
+ <div class="row">
1770
+
1771
+ '.(!is_plugin_active('ads-for-wp/ads-for-wp.php')? '
1772
+ <div class="col-3"><ul>
1773
+ <li>'. esc_html__('Add Unlimited Incontent Ads','accelerated-mobile-pages') .'</li>
1774
+ <li>'. esc_html__('Group Ads','accelerated-mobile-pages') .'</li>
1775
+ <li>'. esc_html__('Display type','accelerated-mobile-pages') .'</li>
1776
+ </ul> </div>' : '')
1777
+ .'
1778
+ <div>
1779
+ '.(!is_plugin_active('ads-for-wp/ads-for-wp.php')?
1780
+ '
1781
+ <div class="install-now ampforwp-activation-call-module-upgrade button " id="ampforwp-adsforwp-activation-call" data-secure="'.wp_create_nonce('verify_module').'">
1782
+ <p>' . esc_html__('Upgrade for Free','accelerated-mobile-pages') .'</p>
1783
+ </div>' :
1784
+ '<a href="'.admin_url('admin.php?page=adsforwp&tab=general&reference=ampforwp').'"><div class="ampforwp-recommendation-btn updated-message"><p>Go to Ads for WP settings</p></div></a>'
1785
+ )
1786
+ .'
1787
+ &nbsp;<br/><a href="https://ampforwp.com/tutorials/article/what-is-ads-for-wp-update-all-about/" class="amp_recommend_learnmore" target="_blank">Learn more</a>
1788
+ </div>
1789
+ </div>'
1790
+
1791
+ );
1792
+ if ( !is_plugin_active('ads-for-wp/ads-for-wp.php') ) {
1793
+ $fields[] = array(
1794
+ 'id' => 'amp-ads_2',
1795
+ 'type' => 'section',
1796
+ 'title' => esc_html__('Ad Performance', 'accelerated-mobile-pages'),
1797
+ 'indent' => true,
1798
+ 'layout_type' => 'accordion',
1799
+ 'accordion-open'=> 1,
1800
+ );
1801
 
1802
+ $fields[] = array(
1803
+ 'id' =>'ampforwp-ads-data-loading-strategy',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1804
  'type' => 'switch',
1805
+ 'title' => esc_html__('Optimize For Viewability', 'accelerated-mobile-pages'),
1806
+ 'desc'=>'Enable this option only if your Ads are either 600px away from the top or not within the first 75% of the viewport and <a href="https://www.ampproject.org/docs/reference/components/amp-iframe" target="_blank">Click here for more information</a>',
 
 
1807
 
1808
+ 'default' => 0,
1809
+
1810
+ 'tooltip-subtitle' => esc_html__('This will increase the loading speed of the Ads', 'accelerated-mobile-pages'),
1811
+ 'true' => 'Enabled',
1812
+ 'false' => 'Disabled',
1813
+ );
1814
+ $fields[] = array(
1815
+ 'id' => 'amp-ads_3',
1816
+ 'type' => 'section',
1817
+ 'title' => esc_html__('General', 'accelerated-mobile-pages'),
1818
+ 'indent' => true,
1819
+ 'layout_type' => 'accordion',
1820
+ 'accordion-open'=> 1,
1821
+ );
1822
+ $fields[] = array(
1823
+ 'id' =>'ampforwp-ads-sponsorship',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1824
  'type' => 'switch',
1825
+ 'title' => esc_html__('Sponsorship Label', 'accelerated-mobile-pages'),
1826
  'default' => 0,
1827
+ 'true' => 'Enabled',
1828
+ 'false' => 'Disabled',
1829
+ );
1830
+ $fields[] = array(
1831
+ 'id' =>'ampforwp-ads-sponsorship-label',
1832
+ 'type' => 'text',
1833
+ 'required' => array('ampforwp-ads-sponsorship', '=' , '1'),
1834
+ 'title' => esc_html__('Sponsorship Label Text', 'accelerated-mobile-pages'),
1835
+ 'class' => 'child_opt child_opt_arrow',
1836
+ 'default' => '',
1837
+ 'placeholder'=> 'Sponsored'
1838
+ );
1839
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1840
 
1841
+ return $fields;
1842
+ }
1843
+ // ADS SECTION
1844
+ Redux::setSection( $opt_name, array(
1845
+ 'title' => esc_html__( 'Advertisement', 'accelerated-mobile-pages' ),
1846
+ 'desc' => $desc,
1847
+ 'class' => 'ampforwp_new_features ',
1848
+ 'id' => 'amp-ads',
1849
+ 'subsection' => true,
1850
+ 'fields' => apply_filters('ampforwp_ads_option_fields', $fields = array() ),
1851
+ ) );
1852
  if ( ! function_exists('ampforwp_seo_default') ) {
1853
  function ampforwp_seo_default() {
1854
  $default = '';
2040
  'id' => 'pwa-for-wp',
2041
  'desc' => '',
2042
  'subsection' => true,
 
2043
  'fields' => array(
2044
  array(
2045
  'id' => 'ampforwp-pwa-for-wp',
includes/options/redux-core/assets/css/redux-admin.css CHANGED
@@ -1069,16 +1069,19 @@ background: linear-gradient(45deg, #E47B49 0%, #ea4c89 100%);
1069
  .beta_tester {
1070
  float: left;
1071
  margin-top: 12px;
1072
- margin-left: 20px
1073
  }
1074
  .beta_tester a{
1075
  text-decoration: none;
1076
- color: #999;
 
 
 
 
1077
  }
1078
  .beta_tester a:hover{
1079
  text-decoration: underline;
1080
  }
1081
-
1082
  @media(max-width:1366px){
1083
  .pri-tb a{padding: 20px;}
1084
  .amp-upg{padding: 60px 0px 0px 0px}
1069
  .beta_tester {
1070
  float: left;
1071
  margin-top: 12px;
1072
+ margin-left: 15px
1073
  }
1074
  .beta_tester a{
1075
  text-decoration: none;
1076
+ background: #fff;
1077
+ color: #4452a7;
1078
+ padding: 6px 10px;
1079
+ border-radius: 20px;
1080
+ border: 1px solid #ddd;
1081
  }
1082
  .beta_tester a:hover{
1083
  text-decoration: underline;
1084
  }
 
1085
  @media(max-width:1366px){
1086
  .pri-tb a{padding: 20px;}
1087
  .amp-upg{padding: 60px 0px 0px 0px}
includes/options/redux-core/templates/panel/footer.tpl.php CHANGED
@@ -49,8 +49,8 @@ namespace ReduxCore\ReduxFramework;
49
  <?php } ?>
50
 
51
  </div>
52
- <?php } $beta_test_url = 'https://ampforwp.com/beta-test/';?>
53
- <div class='beta_tester'><a href="<?php echo esc_url($beta_test_url);?>" target="_blank"><?php echo "Become a Beta Tester" ?></a></div>
54
 
55
  <div class="redux-action_bar">
56
  <span class="spinner"></span>
49
  <?php } ?>
50
 
51
  </div>
52
+ <?php } $beta_test_url = 'https://wordpress.org/plugins/ads-for-wp/';?>
53
+ <div class='beta_tester'><a href="<?php echo esc_url($beta_test_url);?>" target="_blank"><?php echo "Just Launched: Ads for WP" ?></a></div>
54
 
55
  <div class="redux-action_bar">
56
  <span class="spinner"></span>
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.1
7
- Stable tag: 0.9.97.44
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -184,17 +184,9 @@ You can contact us from [here](https://ampforwp.com/contact/)
184
 
185
  == Changelog ==
186
 
187
- = 0.9.97.44 (28th March 2019) =
188
- * Added: Captions feature in AMP page builder #2645
189
- * Added: Compatibility with the Youtube Oembed Plyr plugin #1505
190
- * Added: Caption option for gallery/slider module in pagebuilder #2790
191
- * Added: Like & share feature for every image in instant_articles #2764
192
- * Added: Genesis option in SEO settings #2386
193
- * Added: Improved the 'Setup AMP Feature' and 'Welcome to AMP' tabs & Enhance the Support button on AMP panel #2980
194
- * Fixed: AMP Theme Framework getting conflicted #2782
195
- * Fixed: Unwanted code for call-now component is being used #2652
196
- * Fixed: amphtml tag while AMP Takeover option is enabled #2550
197
- * Fixed: Debug warnings after 0.9.97.15 #2532
198
- * Fixed: 'Header design' section in "Header" tab removed when design-1,2 and 3 is active & minor improvements #2978
199
 
200
  Full changelog available in changelog.txt
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.1
7
+ Stable tag: 0.9.97.44.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
184
 
185
  == Changelog ==
186
 
187
+ = 0.9.97.44.1 (29th March 2019) =
188
+ * Added: Advertisement AMP panel improved #2724
189
+ * Fixed: Vuukle AMP integration code updated #2600
190
+ * Fixed: Fatal Error with old Plugins manager v1.0 #2976
 
 
 
 
 
 
 
 
191
 
192
  Full changelog available in changelog.txt
templates/features.php CHANGED
@@ -680,9 +680,10 @@ function ampforwp_new_dir( $dir ) {
680
 
681
  // 9. Advertisement code
682
  // Below Header Global
 
683
  add_action('ampforwp_after_header','ampforwp_header_advert');
684
  add_action('ampforwp_design_1_after_header','ampforwp_header_advert');
685
-
686
  function ampforwp_header_advert() {
687
  global $redux_builder_amp;
688
  $optimize = '';
@@ -754,8 +755,9 @@ function ampforwp_new_dir( $dir ) {
754
  }
755
 
756
  // Above Footer Global
 
757
  add_action('amp_post_template_footer','ampforwp_footer_advert',10);
758
-
759
  function ampforwp_footer_advert() {
760
  global $redux_builder_amp;
761
  $optimize = '';
@@ -827,9 +829,10 @@ function ampforwp_new_dir( $dir ) {
827
  }
828
 
829
  // Below Title Single
 
830
  add_action('ampforwp_before_post_content','ampforwp_before_post_content_advert');
831
  add_action('ampforwp_inside_post_content_before','ampforwp_before_post_content_advert');
832
-
833
  function ampforwp_before_post_content_advert() {
834
  global $redux_builder_amp;
835
  $optimize = '';
@@ -924,7 +927,9 @@ function ampforwp_new_dir( $dir ) {
924
  }
925
 
926
  // Below Content Single
 
927
  add_action('ampforwp_after_post_content','ampforwp_after_post_content_advert');
 
928
  function ampforwp_after_post_content_advert() {
929
  global $redux_builder_amp;
930
  $optimize = '';
@@ -993,7 +998,9 @@ function ampforwp_new_dir( $dir ) {
993
  }
994
 
995
  // Below The Title
 
996
  add_action('ampforwp_below_the_title','ampforwp_below_the_title_advert');
 
997
  function ampforwp_below_the_title_advert() {
998
  global $redux_builder_amp;
999
  $optimize = '';
@@ -1062,7 +1069,9 @@ function ampforwp_new_dir( $dir ) {
1062
  }
1063
 
1064
  // Above Related post
 
1065
  add_action('ampforwp_above_related_post','ampforwp_above_related_post_advert');
 
1066
  function ampforwp_above_related_post_advert() {
1067
  global $redux_builder_amp;
1068
  $optimize = '';
@@ -7419,17 +7428,28 @@ function ampforwp_vuukle_comments_support() {
7419
  }
7420
  }
7421
  function ampforwp_vuukle_comments_markup() {
7422
- global $redux_builder_amp;
7423
  $apiKey = $locale = '';
 
 
 
7424
  if( isset($redux_builder_amp['ampforwp-vuukle-comments-apiKey']) && $redux_builder_amp['ampforwp-vuukle-comments-apiKey'] !== ""){
7425
  $apiKey = $redux_builder_amp['ampforwp-vuukle-comments-apiKey'];
7426
  }
7427
  $display_comments_on = false;
7428
  $display_comments_on = ampforwp_get_comments_status();
7429
  $siteUrl = trim(site_url(), '/');
7430
- if (!preg_match('#^http(s)?://#', $siteUrl)) {
7431
- $siteUrl = 'http://' . $siteUrl;
7432
- }
 
 
 
 
 
 
 
 
7433
  $urlParts = parse_url($siteUrl);
7434
  $siteUrl = preg_replace('/^www\./', '', $urlParts['host']);// remove www
7435
  $srcUrl = 'https://cdn.vuukle.com/amp.html?';
@@ -7437,7 +7457,9 @@ function ampforwp_vuukle_comments_markup() {
7437
  $srcUrl = add_query_arg('host' ,$siteUrl, $srcUrl);
7438
  $srcUrl = add_query_arg('id' , $post->ID, $srcUrl);
7439
  $srcUrl = add_query_arg('apiKey' , $apiKey, $srcUrl);
7440
- $srcUrl = add_query_arg('title' , urlencode($post->post_title), $srcUrl);
 
 
7441
 
7442
  $vuukle_html ='';
7443
  if ( $display_comments_on ) {
@@ -7456,8 +7478,7 @@ function ampforwp_add_vuukle_scripts( $data ) {
7456
  if ( empty( $data['amp_component_scripts']['amp-iframe'] ) ) {
7457
  $data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
7458
  }
7459
- if ($redux_builder_amp['ampforwp-vuukle-Ads-before-comments']==1
7460
- && empty( $data['amp_component_scripts']['amp-ad'] ) ) {
7461
  $data['amp_component_scripts']['amp-ad'] = 'https://cdn.ampproject.org/v0/amp-ad-0.1.js';
7462
  }
7463
  }
680
 
681
  // 9. Advertisement code
682
  // Below Header Global
683
+ if(!is_plugin_active( 'ads-for-wp/ads-for-wp.php' )){
684
  add_action('ampforwp_after_header','ampforwp_header_advert');
685
  add_action('ampforwp_design_1_after_header','ampforwp_header_advert');
686
+ }
687
  function ampforwp_header_advert() {
688
  global $redux_builder_amp;
689
  $optimize = '';
755
  }
756
 
757
  // Above Footer Global
758
+ if(!is_plugin_active( 'ads-for-wp/ads-for-wp.php' )){
759
  add_action('amp_post_template_footer','ampforwp_footer_advert',10);
760
+ }
761
  function ampforwp_footer_advert() {
762
  global $redux_builder_amp;
763
  $optimize = '';
829
  }
830
 
831
  // Below Title Single
832
+ if(!is_plugin_active( 'ads-for-wp/ads-for-wp.php' )){
833
  add_action('ampforwp_before_post_content','ampforwp_before_post_content_advert');
834
  add_action('ampforwp_inside_post_content_before','ampforwp_before_post_content_advert');
835
+ }
836
  function ampforwp_before_post_content_advert() {
837
  global $redux_builder_amp;
838
  $optimize = '';
927
  }
928
 
929
  // Below Content Single
930
+ if(!is_plugin_active( 'ads-for-wp/ads-for-wp.php' )){
931
  add_action('ampforwp_after_post_content','ampforwp_after_post_content_advert');
932
+ }
933
  function ampforwp_after_post_content_advert() {
934
  global $redux_builder_amp;
935
  $optimize = '';
998
  }
999
 
1000
  // Below The Title
1001
+ if(!is_plugin_active( 'ads-for-wp/ads-for-wp.php' )){
1002
  add_action('ampforwp_below_the_title','ampforwp_below_the_title_advert');
1003
+ }
1004
  function ampforwp_below_the_title_advert() {
1005
  global $redux_builder_amp;
1006
  $optimize = '';
1069
  }
1070
 
1071
  // Above Related post
1072
+ if(!is_plugin_active( 'ads-for-wp/ads-for-wp.php' )){
1073
  add_action('ampforwp_above_related_post','ampforwp_above_related_post_advert');
1074
+ }
1075
  function ampforwp_above_related_post_advert() {
1076
  global $redux_builder_amp;
1077
  $optimize = '';
7428
  }
7429
  }
7430
  function ampforwp_vuukle_comments_markup() {
7431
+ global $redux_builder_amp,$post;
7432
  $apiKey = $locale = '';
7433
+ $tag_name ='';
7434
+ $img = get_the_post_thumbnail_url();
7435
+ $tags = get_the_tags($post->ID);
7436
  if( isset($redux_builder_amp['ampforwp-vuukle-comments-apiKey']) && $redux_builder_amp['ampforwp-vuukle-comments-apiKey'] !== ""){
7437
  $apiKey = $redux_builder_amp['ampforwp-vuukle-comments-apiKey'];
7438
  }
7439
  $display_comments_on = false;
7440
  $display_comments_on = ampforwp_get_comments_status();
7441
  $siteUrl = trim(site_url(), '/');
7442
+ if (!preg_match('#^http(s)?://#', $siteUrl)) {
7443
+ $siteUrl = 'http://' . $siteUrl;
7444
+ }
7445
+ if($img == false){
7446
+ $img = plugins_url('accelerated-mobile-pages/images/150x150.png');
7447
+ }
7448
+ if($tags){
7449
+ foreach($tags as $individual_tag) {
7450
+ $tag_name = $individual_tag->name;
7451
+ }
7452
+ }
7453
  $urlParts = parse_url($siteUrl);
7454
  $siteUrl = preg_replace('/^www\./', '', $urlParts['host']);// remove www
7455
  $srcUrl = 'https://cdn.vuukle.com/amp.html?';
7457
  $srcUrl = add_query_arg('host' ,$siteUrl, $srcUrl);
7458
  $srcUrl = add_query_arg('id' , $post->ID, $srcUrl);
7459
  $srcUrl = add_query_arg('apiKey' , $apiKey, $srcUrl);
7460
+ $srcUrl = add_query_arg('title' , urlencode($post->post_title), $srcUrl);
7461
+ $srcUrl = add_query_arg('img' , esc_url($img), $srcUrl);
7462
+ $srcUrl = add_query_arg('tags' , urlencode($tag_name), $srcUrl);
7463
 
7464
  $vuukle_html ='';
7465
  if ( $display_comments_on ) {
7478
  if ( empty( $data['amp_component_scripts']['amp-iframe'] ) ) {
7479
  $data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
7480
  }
7481
+ if (ampforwp_get_setting('ampforwp-vuukle-Ads-before-comments') && empty( $data['amp_component_scripts']['amp-ad'] ) ) {
 
7482
  $data['amp_component_scripts']['amp-ad'] = 'https://cdn.ampproject.org/v0/amp-ad-0.1.js';
7483
  }
7484
  }