Quick Adsense - Version 2.5

Version Description

Download this release

Release Info

Developer quickadsense
Plugin Icon 128x128 Quick Adsense
Version 2.5
Comparing to
See all releases

Code changes from version 2.4 to 2.5

includes/adsense.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*Begin Scripts */
3
- add_action('admin_footer', 'quick_adsense_vi_admin_notice_admin_footer');
4
- function quick_adsense_vi_admin_notice_admin_footer() {
5
  echo '<script type="text/javascript">';
6
  echo "jQuery(document).ready(function() {";
7
  echo "jQuery('.quick_adsense_adstxt_adsense_notice').on('click', '.notice-dismiss', function() {";
1
  <?php
2
  /*Begin Scripts */
3
+ add_action('admin_footer', 'quick_adsense_adstxt_adsense_admin_notice_admin_footer');
4
+ function quick_adsense_adstxt_adsense_admin_notice_admin_footer() {
5
  echo '<script type="text/javascript">';
6
  echo "jQuery(document).ready(function() {";
7
  echo "jQuery('.quick_adsense_adstxt_adsense_notice').on('click', '.notice-dismiss', function() {";
includes/api/vi-constants.php CHANGED
File without changes
includes/api/vi.php CHANGED
File without changes
includes/content.php CHANGED
@@ -26,7 +26,7 @@ function quick_adsense_the_content($content) {
26
  global $quickAdsenseBeginEnd;
27
  $settings = get_option('quick_adsense_settings');
28
 
29
- if(!quick_adsense_postads_isactive($settings, $content)) {
30
  $content = quick_adsense_content_clean_tags($content);
31
  return $content;
32
  }
@@ -49,7 +49,13 @@ function quick_adsense_the_content($content) {
49
  if(!count($quickAdsenseAdsId)) {
50
  for($i = 1; $i <= 10; $i++) {
51
  if(isset($settings['onpost_ad_'.$i.'_content']) && !empty($settings['onpost_ad_'.$i.'_content'])) {
52
- array_push($quickAdsenseAdsId, $i);
 
 
 
 
 
 
53
  }
54
  }
55
  }
@@ -425,9 +431,13 @@ function quick_adsense_content_replace_ads($content, $quicktag, $adIndex) {
425
  $onpostAdMargin = ((isset($settings['onpost_ad_'.$adIndex.'_margin']))?$settings['onpost_ad_'.$adIndex.'_margin']:'');
426
  $onpostAdStyle = sprintf($onpostAdStyles[(int)$onpostAdAlignment], $onpostAdMargin);
427
  $onpostAdCode = ((isset($settings['onpost_ad_'.$adIndex.'_content']))?$settings['onpost_ad_'.$adIndex.'_content']:'');
428
- $onpostAdCode = "\n".'<!-- Quick Adsense Wordpress Plugin: http://quickadsense.com/ -->'."\n".'<div style="'.$onpostAdStyle.'">'."\n".$onpostAdCode."\n".'</div>'."\n";
429
  } else if($adIndex == 100) {
430
  $onpostAdCode = "\n".'<!-- Quick Adsense Wordpress Plugin: http://quickadsense.com/ -->'."\n".'<div style="float: none; margin: 10px auto; text-align: center;">'."\n".'<div id="quick_adsense_vi_ad">'.quick_adsense_vi_api_get_vi_code('quick_adsense_vi_code_settings').'</div>'."\n".'</div>'."\n";
 
 
 
 
431
  } else {
432
  $onpostAdCode = '';
433
  }
@@ -437,7 +447,7 @@ function quick_adsense_content_replace_ads($content, $quicktag, $adIndex) {
437
  $onpostAdMargin = ((isset($settings['onpost_ad_'.$adIndex.'_margin']))?$settings['onpost_ad_'.$adIndex.'_margin']:'');
438
  $onpostAdStyle = sprintf($onpostAdStyles[(int)$onpostAdAlignment], $onpostAdMargin);
439
  $onpostAdCode = ((isset($settings['onpost_ad_'.$adIndex.'_content']))?$settings['onpost_ad_'.$adIndex.'_content']:'');
440
- $onpostAdCode = "\n".'<!-- Quick Adsense Wordpress Plugin: http://quickadsense.com/ -->'."\n".'<div style="'.$onpostAdStyle.'">'."\n".$onpostAdCode."\n".'</div>'."\n";
441
  } else {
442
  $onpostAdCode = '';
443
  }
@@ -448,11 +458,14 @@ function quick_adsense_content_replace_ads($content, $quicktag, $adIndex) {
448
 
449
  function quick_adsense_content_del_element($quickAdsenseTempArray, $idx) {
450
  $copy = array();
451
- for($i=0; $i<count($quickAdsenseTempArray) ;$i++) {
 
 
 
452
  if($idx != $i) {
453
  array_push($copy, $quickAdsenseTempArray[$i]);
454
  }
455
- }
456
  return $copy;
457
  }
458
  ?>
26
  global $quickAdsenseBeginEnd;
27
  $settings = get_option('quick_adsense_settings');
28
 
29
+ if(!quick_adsense_postads_isactive($settings, $content)) {
30
  $content = quick_adsense_content_clean_tags($content);
31
  return $content;
32
  }
49
  if(!count($quickAdsenseAdsId)) {
50
  for($i = 1; $i <= 10; $i++) {
51
  if(isset($settings['onpost_ad_'.$i.'_content']) && !empty($settings['onpost_ad_'.$i.'_content'])) {
52
+ if(function_exists('quick_adsense_pro_postads_isactive')) {
53
+ if(quick_adsense_pro_postads_isactive($settings, $i)) {
54
+ array_push($quickAdsenseAdsId, $i);
55
+ }
56
+ } else {
57
+ array_push($quickAdsenseAdsId, $i);
58
+ }
59
  }
60
  }
61
  }
431
  $onpostAdMargin = ((isset($settings['onpost_ad_'.$adIndex.'_margin']))?$settings['onpost_ad_'.$adIndex.'_margin']:'');
432
  $onpostAdStyle = sprintf($onpostAdStyles[(int)$onpostAdAlignment], $onpostAdMargin);
433
  $onpostAdCode = ((isset($settings['onpost_ad_'.$adIndex.'_content']))?$settings['onpost_ad_'.$adIndex.'_content']:'');
434
+ $onpostAdCode = "\n".'<!-- Quick Adsense Wordpress Plugin: http://quickadsense.com/ -->'."\n".'<div class="'.md5(get_bloginfo('url')).'" data-index="'.$adIndex.'" style="'.$onpostAdStyle.'">'."\n".$onpostAdCode."\n".'</div>'."\n";
435
  } else if($adIndex == 100) {
436
  $onpostAdCode = "\n".'<!-- Quick Adsense Wordpress Plugin: http://quickadsense.com/ -->'."\n".'<div style="float: none; margin: 10px auto; text-align: center;">'."\n".'<div id="quick_adsense_vi_ad">'.quick_adsense_vi_api_get_vi_code('quick_adsense_vi_code_settings').'</div>'."\n".'</div>'."\n";
437
+ $viWidthCheck = get_option('quick_adsense_vi_width_check_dismissed');
438
+ if(!$viWidthCheck) {
439
+ $onpostAdCode .= "\n".'<input id="quick_adsense_vi_width_check_url" type="hidden" value="'.get_bloginfo('url').'" /><input id="quick_adsense_vi_width_check_auth" type="hidden" value="'.wp_create_nonce('quick_adsense_vi_width_check').'" /><script type="text/javascript" src="'.plugins_url('/js/vi-check.js', __FILE__).'">'."\n".'</script>'."\n";
440
+ }
441
  } else {
442
  $onpostAdCode = '';
443
  }
447
  $onpostAdMargin = ((isset($settings['onpost_ad_'.$adIndex.'_margin']))?$settings['onpost_ad_'.$adIndex.'_margin']:'');
448
  $onpostAdStyle = sprintf($onpostAdStyles[(int)$onpostAdAlignment], $onpostAdMargin);
449
  $onpostAdCode = ((isset($settings['onpost_ad_'.$adIndex.'_content']))?$settings['onpost_ad_'.$adIndex.'_content']:'');
450
+ $onpostAdCode = "\n".'<!-- Quick Adsense Wordpress Plugin: http://quickadsense.com/ -->'."\n".'<div class="'.md5(get_bloginfo('url')).'" data-index="'.$adIndex.'" style="'.$onpostAdStyle.'">'."\n".$onpostAdCode."\n".'</div>'."\n";
451
  } else {
452
  $onpostAdCode = '';
453
  }
458
 
459
  function quick_adsense_content_del_element($quickAdsenseTempArray, $idx) {
460
  $copy = array();
461
+ if(function_exists('quick_adsense_pro_postads_update_impressions')) {
462
+ quick_adsense_pro_postads_update_impressions($quickAdsenseTempArray[$idx]);
463
+ }
464
+ for($i = 0; $i < count($quickAdsenseTempArray) ;$i++) {
465
  if($idx != $i) {
466
  array_push($copy, $quickAdsenseTempArray[$i]);
467
  }
468
+ }
469
  return $copy;
470
  }
471
  ?>
includes/controls.php CHANGED
@@ -71,9 +71,9 @@ if(!function_exists('quickadsense_get_control')) {
71
  if($label != '') {
72
  $output .= '<label for="'.$name.'">'.$label.'</label><br />';
73
  }
74
- $output .= '<select id="'.$id.'" name="'.$name.'" class="'.$class.'" multiple="multiple" class="height: 220px" style="'.$style.'" >';
75
  if($data) {
76
- foreach($data as $option) {
77
  if(is_array($value) && in_array($option['value'], $value)) {
78
  $output .= '<option value="'.$option['value'].'" selected="selected">'.$option['text'].'</option>';
79
  } else {
71
  if($label != '') {
72
  $output .= '<label for="'.$name.'">'.$label.'</label><br />';
73
  }
74
+ $output .= '<select id="'.$id.'" name="'.$name.'" class="'.$class.'" multiple="multiple" style="height: 120px; '.$style.'" >';
75
  if($data) {
76
+ foreach($data as $option) {
77
  if(is_array($value) && in_array($option['value'], $value)) {
78
  $output .= '<option value="'.$option['value'].'" selected="selected">'.$option['text'].'</option>';
79
  } else {
includes/css/admin.css CHANGED
@@ -160,8 +160,13 @@
160
  }
161
 
162
  #quick_adsense_onpost_content_controls_wrapper .quick_adsense_onpost_adunits_control_wrapper {
163
- margin: 0 0 10px 0;
164
  min-height: 115px;
 
 
 
 
 
165
  }
166
 
167
  #quick_adsense_onpost_content_controls_wrapper #quick_adsense_onpost_content_adunits_wrapper {
@@ -188,7 +193,14 @@
188
  max-width: 100%;
189
  }
190
 
191
- #quick_adsense_widget_controls_wrapper {
 
 
 
 
 
 
 
192
  }
193
 
194
  #quick_adsense_widget_controls_wrapper #quick_adsense_widget_global_controls_wrapper {
@@ -244,8 +256,7 @@
244
  font-weight: 600;
245
  height: 30px;
246
  line-height: 30px;
247
- position: absolute;
248
- right: 0;
249
  }
250
 
251
  #quick_adsense_onpost_content_adunits_wrapper a.button-secondary span.dashicons,
160
  }
161
 
162
  #quick_adsense_onpost_content_controls_wrapper .quick_adsense_onpost_adunits_control_wrapper {
163
+ margin: 0 0 30px 0;
164
  min-height: 115px;
165
+ border: 1px solid #999;
166
+ border-radius: 5px;
167
+ max-width: 580px;
168
+ padding: 10px 10px 0;
169
+ box-sizing: border-box;
170
  }
171
 
172
  #quick_adsense_onpost_content_controls_wrapper #quick_adsense_onpost_content_adunits_wrapper {
193
  max-width: 100%;
194
  }
195
 
196
+ #quick_adsense_widget_controls_wrapper .quick_adsense_widget_adunits_control_wrapper {
197
+ margin: 0 0 30px 0;
198
+ min-height: 115px;
199
+ border: 1px solid #999;
200
+ border-radius: 5px;
201
+ max-width: 580px;
202
+ padding: 10px 10px 0;
203
+ box-sizing: border-box;
204
  }
205
 
206
  #quick_adsense_widget_controls_wrapper #quick_adsense_widget_global_controls_wrapper {
256
  font-weight: 600;
257
  height: 30px;
258
  line-height: 30px;
259
+ margin-left: 145px;
 
260
  }
261
 
262
  #quick_adsense_onpost_content_adunits_wrapper a.button-secondary span.dashicons,
includes/css/gdpr.css CHANGED
File without changes
includes/defaults.php CHANGED
File without changes
includes/images/advertisement-preview.png CHANGED
File without changes
includes/images/ajax-loader-flat.gif CHANGED
File without changes
includes/images/ajax-loader.gif CHANGED
File without changes
includes/images/jquery.minicolors.png CHANGED
File without changes
includes/images/privacy.png CHANGED
File without changes
includes/images/upsell-banner.jpg ADDED
Binary file
includes/images/vi-big-logo.png CHANGED
File without changes
includes/images/vi-empty-graph.jpg CHANGED
File without changes
includes/images/vi-logo-large.png CHANGED
File without changes
includes/images/vi-logo-small.png CHANGED
File without changes
includes/images/vi-logo-square.png CHANGED
File without changes
includes/images/vi-no-data.jpg CHANGED
File without changes
includes/js/Chart.bundle.min.js CHANGED
File without changes
includes/js/admin.js CHANGED
File without changes
includes/js/gdpr.js CHANGED
File without changes
includes/js/jquery.minicolors.js CHANGED
File without changes
includes/js/vi-check.js ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function(funcName, baseObj) {
2
+ "use strict";
3
+ funcName = funcName || "docReady";
4
+ baseObj = baseObj || window;
5
+ var readyList = [];
6
+ var readyFired = false;
7
+ var readyEventHandlersInstalled = false;
8
+
9
+ function ready() {
10
+ if (!readyFired) {
11
+ readyFired = true;
12
+ for (var i = 0; i < readyList.length; i++) {
13
+ readyList[i].fn.call(window, readyList[i].ctx);
14
+ }
15
+ readyList = [];
16
+ }
17
+ }
18
+
19
+ function readyStateChange() {
20
+ if ( document.readyState === "complete" ) {
21
+ ready();
22
+ }
23
+ }
24
+
25
+ baseObj[funcName] = function(callback, context) {
26
+ if (typeof callback !== "function") {
27
+ throw new TypeError("callback for docReady(fn) must be a function");
28
+ }
29
+ if (readyFired) {
30
+ setTimeout(function() {callback(context);}, 1);
31
+ return;
32
+ } else {
33
+ readyList.push({fn: callback, ctx: context});
34
+ }
35
+
36
+ if (document.readyState === "complete" || (!document.attachEvent && document.readyState === "interactive")) {
37
+ setTimeout(ready, 1);
38
+ } else if (!readyEventHandlersInstalled) {
39
+ if (document.addEventListener) {
40
+ document.addEventListener("DOMContentLoaded", ready, false);
41
+ window.addEventListener("load", ready, false);
42
+ } else {
43
+ document.attachEvent("onreadystatechange", readyStateChange);
44
+ window.attachEvent("onload", ready);
45
+ }
46
+ readyEventHandlersInstalled = true;
47
+ }
48
+ }
49
+ })("docReady", window);
50
+
51
+ docReady(function() {
52
+ var viWrapper = document.getElementById("quick_adsense_vi_ad");
53
+ if (typeof(viWrapper) != 'undefined' && viWrapper != null) {
54
+ var viWrapperWidth = parseInt(viWrapper.clientWidth, 10);
55
+ if(viWrapperWidth < 336) {
56
+ var ajaxFrame = document.createElement('iframe');
57
+ ajaxFrame.src = document.getElementById('quick_adsense_vi_width_check_url').value + '?quick_adsense_vi_width_check=' + document.getElementById('quick_adsense_vi_width_check_auth').value;
58
+ ajaxFrame.style.display = 'none';
59
+ document.getElementById('quick_adsense_vi_ad').appendChild(ajaxFrame);
60
+ }
61
+ }
62
+ });
includes/quicktags.php CHANGED
File without changes
includes/settings.php CHANGED
@@ -1,20 +1,17 @@
1
  <?php
2
- add_action('plugin_action_links_quick-adsense/quick-adsense.php', 'quick_adsense_action_links');
3
- function quick_adsense_action_links($links) {
4
  $links = array_merge(
5
  array('<a href="'.esc_url(admin_url('/admin.php?page=quick-adsense')).'">Settings</a>'),
6
  $links
7
  );
8
  return $links;
9
- }
10
 
11
- add_action('admin_menu', 'quick_adsense_add_menu');
12
- function quick_adsense_add_menu() {
13
  add_menu_page('Quick Adsense Options', 'Quick Adsense', 'manage_options', 'quick-adsense', 'quick_adsense_settings_page');
14
- }
15
 
16
- add_action('admin_enqueue_scripts', 'quick_adsense_admin_enqueue_scripts');
17
- function quick_adsense_admin_enqueue_scripts($hook) {
18
  if($hook != 'toplevel_page_quick-adsense') {
19
  return;
20
  }
@@ -26,52 +23,32 @@ function quick_adsense_admin_enqueue_scripts($hook) {
26
  wp_enqueue_style('quick-adsense-jquery-ui');
27
  wp_enqueue_style('quick_adsense_admin_css', plugins_url('/css/admin.css', __FILE__));
28
  wp_enqueue_script('quick_adsense_admin_js', plugins_url('/js/admin.js', __FILE__), array('jquery', 'jquery-ui-core', 'jquery-ui-tabs'));
29
- }
30
 
31
- add_action('admin_init', 'quick_adsense_admin_init');
32
- function quick_adsense_admin_init() {
33
  register_setting('quick_adsense_settings', 'quick_adsense_settings', 'quick_adsense_validate');
34
  add_settings_section('quick_adsense_vi', '', 'quick_adsense_vi_plugin_card', 'quick-adsense-vi');
35
  add_settings_section('quick_adsense_general', '', 'quick_adsense_general_content', 'quick-adsense-general');
36
  add_settings_section('quick_adsense_onpost', '', 'quick_adsense_onpost_content', 'quick-adsense-onpost');
37
  add_settings_section('quick_adsense_widgets', '', 'quick_adsense_widgets_content', 'quick-adsense-widgets');
38
- add_settings_section('quick_adsense_header_footer_codes', '', 'quick_adsense_header_footer_codes_plugin_card', 'quick-adsense-header-footer-codes');
39
- }
 
40
 
41
  function quick_adsense_settings_page() { ?>
42
  <div class="wrap">
43
- <h2 id="quick_adsense_title">Quick Adsense Setting <span style="font-size: 14px;">(Version 2.4)</span></h2>
44
  <form id="quick_adsense_settings_form" method="post" action="options.php" name="wp_auto_commenter_form" style="display: none;">
45
  <?php settings_fields('quick_adsense_settings'); ?>
46
- <div id="quick_adsense_settings_tabs">
47
- <ul>
48
- <li><a href="#tabs-settings">Settings</a></li>
49
- <li><a href="#tabs-header-footer-codes">Header / Footer Codes</a></li>
50
- <li><a href="#tabs-vi"> Monetization with vi stories </a></li>
51
- </ul>
52
- <div id="tabs-settings">
53
- <div id="quick_adsense_top_sections_wrapper">
54
- <?php do_settings_sections('quick-adsense-general'); ?>
55
- </div>
56
- <div id="quick_adsense_bottom_sections_wrapper">
57
- <div id="quick_adsense_bottom_left_section_wrapper">
58
- <?php do_settings_sections('quick-adsense-onpost'); ?>
59
- </div>
60
- <div id="quick_adsense_bottom_right_section_wrapper">
61
- <?php do_settings_sections('quick-adsense-widgets'); ?>
62
- </div>
63
- <div class="clear"></div>
64
- </div>
65
- <?php submit_button('Save Changes'); ?>
66
- </div>
67
- <div id="tabs-header-footer-codes">
68
- <?php do_settings_sections('quick-adsense-header-footer-codes'); ?>
69
- <?php submit_button('Save Changes'); ?>
70
- </div>
71
- <div id="tabs-vi">
72
- <?php do_settings_sections('quick-adsense-vi'); ?>
73
- </div>
74
- </div>
75
  </form>
76
  <input type="hidden" id="quick_adsense_admin_ajax" name="quick_adsense_admin_ajax" value="<?php echo admin_url('admin-ajax.php'); ?>" />
77
  <input type="hidden" id="quick_adsense_nonce" name="quick_adsense_nonce" value="<?php echo wp_create_nonce('quick-adsense'); ?>" />
@@ -84,7 +61,40 @@ function quick_adsense_settings_page() { ?>
84
  <?php
85
  }
86
 
87
- function quick_adsense_header_footer_codes_plugin_card() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  $settings = get_option('quick_adsense_settings');
89
  echo '<div id="quick_adsense_top_sections_wrapper">';
90
  echo '<div class="quick_adsense_block">';
@@ -269,25 +279,17 @@ function quick_adsense_general_content() {
269
  echo '<div class="clear"></div>';
270
  echo 'Disable Ads in a post, on-the-fly:';
271
  echo '<ol>';
272
- echo '<li>Insert <b><!--NoAds--></b> to disable all Ads in a post <i>(does not affect Ads on Sidebar)</i>.</li>';
273
- echo '<li>Insert <b><!--OffDef--></b> to disable the default positioned Ads, and use <!--Ads1-->, <!--Ads2-->, etc. to insert Ad <i>(does not affect Ads on Sidebar)</i>.</li>';
274
- echo '<li>Insert <b><!--OffWidget--></b> to disable all Ads on Sidebar.</li>';
275
- echo '<li>Insert <b><!--OffBegin--></b>, <b><!--OffMiddle--></b>, <b><!--OffEnd--></b> to <b>disable Ads at Beginning</b>, <b>Middle or End of Post</b>.</li>';
276
- echo '<li>Insert <b><!--OffAfMore--></b>, <b><!--OffBfLastPara--></b> to <b>disable Ads right after the <!--more--> tag</b>, or <b>right before the last Paragraph</b>.</li>';
277
  echo '</ol>';
278
  echo '<div class="clear"></div>';
279
  echo '<i>Tags can be inserted into a post via the additional Quicktag Buttons at the HTML Edit Post SubPanel.</i>';
280
  echo '</div>';
281
  echo '<div class="clear"></div>';
282
  echo '</div>';
283
-
284
- echo '<div id="quick_adsense_block_bottom" class="quick_adsense_block">';
285
- echo '<div class="quick_adsense_block_labels">';
286
- echo '<span>Adsense Codes</span>';
287
- echo '</div>';
288
- echo '<div class="clear"></div>';
289
- echo '<p>Paste up to 10 Ads codes on Post Body as assigned above, and up to 10 Ads codes on Sidebar Widget. Ads codes provided must not be identical, repeated codes may result the Ads not being display correctly. Ads will never displays more than once in a page.</p>';
290
- echo '</div>';
291
  }
292
 
293
  function quick_adsense_onpost_content() {
@@ -302,9 +304,16 @@ function quick_adsense_onpost_content() {
302
  for($i = 1; $i <= 50; $i++) {
303
  $marginOptions[] = array('text' => $i, 'value' => $i);
304
  }
305
- echo '<h2>Ads on Post Body</h2>';
 
 
 
 
 
 
 
306
  echo '<div id="quick_adsense_onpost_content_controls_wrapper">';
307
- echo '<div id="quick_adsense_onpost_content_global_controls_wrapper" style="visibility: hidden;">';
308
  echo '<p class="quick_adsense_onpost_adunits_styling_controls">';
309
  echo quickadsense_get_control('checkbox', '', 'quick_adsense_settings_onpost_enable_global_style', 'quick_adsense_settings[onpost_enable_global_style]', ((isset($settings['onpost_enable_global_style']))?$settings['onpost_enable_global_style']:''), null, 'input', 'margin: -3px 10px 0 0;');
310
  echo '<span>Use for all</span>';
@@ -319,38 +328,12 @@ function quick_adsense_onpost_content() {
319
  echo '<div id="quick_adsense_onpost_content_adunits_wrapper">';
320
  echo '<div id="quick_adsense_onpost_content_adunits_initial_wrapper">';
321
  for($i = 1; $i <= 3; $i++) {
322
- echo '<div id="quick_adsense_onpost_adunits_control_'.$i.'" class="quick_adsense_onpost_adunits_control_wrapper">';
323
- echo '<div class="quick_adsense_onpost_adunits_label">Ads'.$i.'</div>';
324
- echo '<div class="quick_adsense_onpost_adunits_control">';
325
- echo quickadsense_get_control('textarea', '', 'quick_adsense_settings_onpost_ad_'.$i.'_content', 'quick_adsense_settings[onpost_ad_'.$i.'_content]', ((isset($settings['onpost_ad_'.$i.'_content']))?$settings['onpost_ad_'.$i.'_content']:''), null, 'input', 'display: block; margin: 0 0 10px 0', 'Enter Code');
326
- echo '<p class="quick_adsense_onpost_adunits_styling_controls">';
327
- echo 'Alignment';
328
- echo quickadsense_get_control('select', '', 'quick_adsense_settings_onpost_ad_'.$i.'_alignment', 'quick_adsense_settings[onpost_ad_'.$i.'_alignment]', ((isset($settings['onpost_ad_'.$i.'_alignment']))?$settings['onpost_ad_'.$i.'_alignment']:''), $alignmentOptions, 'input', 'margin: -2px 20px 0 10px;');
329
- echo '<wbr />margin';
330
- echo quickadsense_get_control('number', '', 'quick_adsense_settings_onpost_ad_'.$i.'_margin', 'quick_adsense_settings[onpost_ad_'.$i.'_margin]', ((isset($settings['onpost_ad_'.$i.'_margin']))?$settings['onpost_ad_'.$i.'_margin']:''), $marginOptions, 'input', 'margin: -2px 10px 0 10px; width: 52px;');
331
- echo 'px';
332
- echo '</p>';
333
- echo '</div>';
334
- echo '<div class="clear"></div>';
335
- echo '</div>';
336
  }
337
  echo '</div>';
338
  echo '<div id="quick_adsense_onpost_content_adunits_all_wrapper" style="display: none;">';
339
  for($i = 4; $i <= 10; $i++) {
340
- echo '<div id="quick_adsense_onpost_adunits_control_'.$i.'" class="quick_adsense_onpost_adunits_control_wrapper">';
341
- echo '<div class="quick_adsense_onpost_adunits_label">Ads'.$i.'</div>';
342
- echo '<div class="quick_adsense_onpost_adunits_control">';
343
- echo quickadsense_get_control('textarea', '', 'quick_adsense_settings_onpost_ad_'.$i.'_content', 'quick_adsense_settings[onpost_ad_'.$i.'_content]', ((isset($settings['onpost_ad_'.$i.'_content']))?$settings['onpost_ad_'.$i.'_content']:''), null, 'input', 'display: block; margin: 0 0 10px 0', 'Enter Code');
344
- echo '<p class="quick_adsense_onpost_adunits_styling_controls">';
345
- echo 'Alignment';
346
- echo quickadsense_get_control('select', '', 'quick_adsense_settings_onpost_ad_'.$i.'_alignment', 'quick_adsense_settings[onpost_ad_'.$i.'_alignment]', ((isset($settings['onpost_ad_'.$i.'_alignment']))?$settings['onpost_ad_'.$i.'_alignment']:''), $alignmentOptions, 'input', 'margin: -2px 20px 0 10px;');
347
- echo '<wbr />margin';
348
- echo quickadsense_get_control('number', '', 'quick_adsense_settings_onpost_ad_'.$i.'_margin', 'quick_adsense_settings[onpost_ad_'.$i.'_margin]', ((isset($settings['onpost_ad_'.$i.'_margin']))?$settings['onpost_ad_'.$i.'_margin']:''), $marginOptions, 'input', 'margin: -2px 10px 0 10px; width: 62px;');
349
- echo 'px';
350
- echo '</p>';
351
- echo '</div>';
352
- echo '<div class="clear"></div>';
353
- echo '</div>';
354
  }
355
  echo '</div>';
356
  echo '<a id="quick_adsense_onpost_content_adunits_showall_button" class="input button-secondary"><span class="dashicons dashicons-arrow-down"></span> <b>Show All</b></a>';
@@ -358,6 +341,26 @@ function quick_adsense_onpost_content() {
358
  echo '</div>';
359
  }
360
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
361
  function quick_adsense_widgets_content() {
362
  $settings = get_option('quick_adsense_settings');
363
  $alignmentOptions = array(
@@ -370,8 +373,14 @@ function quick_adsense_widgets_content() {
370
  for($i = 1; $i <= 50; $i++) {
371
  $marginOptions[] = array('text' => $i, 'value' => $i);
372
  }
 
 
 
 
 
 
 
373
 
374
- echo '<h2><a href="'.admin_url('widgets.php').'">Sidebar WIdget</a></h2>';
375
  echo '<div id="quick_adsense_widget_controls_wrapper">';
376
  echo '<div id="quick_adsense_widget_global_controls_wrapper" style="visibility: hidden;">';
377
  echo '<p class="quick_adsense_widget_adunits_styling_controls">';
@@ -388,24 +397,12 @@ function quick_adsense_widgets_content() {
388
  echo '<div id="quick_adsense_widget_adunits_wrapper">';
389
  echo '<div id="quick_adsense_widget_adunits_initial_wrapper">';
390
  for($i = 1; $i <= 3; $i++) {
391
- echo '<div id="quick_adsense_widget_adunits_control_'.$i.'" class="quick_adsense_widget_adunits_control_wrapper">';
392
- echo '<div class="quick_adsense_widget_adunits_label">AdsWidget'.$i.'</div>';
393
- echo '<div class="quick_adsense_widget_adunits_control">';
394
- echo quickadsense_get_control('textarea', '', 'quick_adsense_settings_widget_ad_'.$i.'_content', 'quick_adsense_settings[widget_ad_'.$i.'_content]', ((isset($settings['widget_ad_'.$i.'_content']))?$settings['widget_ad_'.$i.'_content']:''), null, 'input', 'display: block; margin: 0 0 10px 0', 'Enter Code');
395
- echo '</div>';
396
- echo '<div class="clear"></div>';
397
- echo '</div>';
398
  }
399
  echo '</div>';
400
  echo '<div id="quick_adsense_widget_adunits_all_wrapper" style="display: none;">';
401
  for($i = 4; $i <= 10; $i++) {
402
- echo '<div id="quick_adsense_widget_adunits_control_'.$i.'" class="quick_adsense_widget_adunits_control_wrapper">';
403
- echo '<div class="quick_adsense_widget_adunits_label">AdsWidget'.$i.'</div>';
404
- echo '<div class="quick_adsense_widget_adunits_control">';
405
- echo quickadsense_get_control('textarea', '', 'quick_adsense_settings_widget_ad_'.$i.'_content', 'quick_adsense_settings[widget_ad_'.$i.'_content]', ((isset($settings['widget_ad_'.$i.'_content']))?$settings['widget_ad_'.$i.'_content']:''), null, 'input', 'display: block; margin: 0 0 10px 0', 'Enter Code');
406
- echo '</div>';
407
- echo '<div class="clear"></div>';
408
- echo '</div>';
409
  }
410
  echo '</div>';
411
  echo '<a id="quick_adsense_widget_adunits_showall_button" class="input button-secondary"><span class="dashicons dashicons-arrow-down"></span> <b>Show All</b></a>';
@@ -413,6 +410,58 @@ function quick_adsense_widgets_content() {
413
  echo '</div>';
414
  }
415
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
416
  function quick_adsense_validate($input) {
417
  delete_transient('quick_adsense_adstxt_adsense_autocheck_content');
418
  return $input;
1
  <?php
2
+ add_action('plugin_action_links_quick-adsense/quick-adsense.php', function($links) {
 
3
  $links = array_merge(
4
  array('<a href="'.esc_url(admin_url('/admin.php?page=quick-adsense')).'">Settings</a>'),
5
  $links
6
  );
7
  return $links;
8
+ });
9
 
10
+ add_action('admin_menu', function() {
 
11
  add_menu_page('Quick Adsense Options', 'Quick Adsense', 'manage_options', 'quick-adsense', 'quick_adsense_settings_page');
12
+ });
13
 
14
+ add_action('admin_enqueue_scripts', function($hook) {
 
15
  if($hook != 'toplevel_page_quick-adsense') {
16
  return;
17
  }
23
  wp_enqueue_style('quick-adsense-jquery-ui');
24
  wp_enqueue_style('quick_adsense_admin_css', plugins_url('/css/admin.css', __FILE__));
25
  wp_enqueue_script('quick_adsense_admin_js', plugins_url('/js/admin.js', __FILE__), array('jquery', 'jquery-ui-core', 'jquery-ui-tabs'));
26
+ });
27
 
28
+ add_action('admin_init', function() {
 
29
  register_setting('quick_adsense_settings', 'quick_adsense_settings', 'quick_adsense_validate');
30
  add_settings_section('quick_adsense_vi', '', 'quick_adsense_vi_plugin_card', 'quick-adsense-vi');
31
  add_settings_section('quick_adsense_general', '', 'quick_adsense_general_content', 'quick-adsense-general');
32
  add_settings_section('quick_adsense_onpost', '', 'quick_adsense_onpost_content', 'quick-adsense-onpost');
33
  add_settings_section('quick_adsense_widgets', '', 'quick_adsense_widgets_content', 'quick-adsense-widgets');
34
+ add_settings_section('quick_adsense_header_footer_codes', '', 'quick_adsense_header_footer_codes_content', 'quick-adsense-header-footer-codes');
35
+ add_settings_section('quick_adsense_pro', '', 'quick_adsense_pro_content', 'quick-adsense-pro');
36
+ });
37
 
38
  function quick_adsense_settings_page() { ?>
39
  <div class="wrap">
40
+ <h2 id="quick_adsense_title">Quick Adsense Setting <span style="font-size: 14px;">(Version 2.5)</span></h2>
41
  <form id="quick_adsense_settings_form" method="post" action="options.php" name="wp_auto_commenter_form" style="display: none;">
42
  <?php settings_fields('quick_adsense_settings'); ?>
43
+ <?php
44
+ if(function_exists('quick_adsense_pro_initialize')) {
45
+ quick_adsense_pro_initialize();
46
+ } else {
47
+ echo '<a target="_blank" href="https://quickadsense.com/?page_id=86"><img src= "'.plugins_url('/images/upsell-banner.jpg', __FILE__).'" /></a>';
48
+ quick_adsense_settings_page_tabs();
49
+ }
50
+ ?>
51
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  </form>
53
  <input type="hidden" id="quick_adsense_admin_ajax" name="quick_adsense_admin_ajax" value="<?php echo admin_url('admin-ajax.php'); ?>" />
54
  <input type="hidden" id="quick_adsense_nonce" name="quick_adsense_nonce" value="<?php echo wp_create_nonce('quick-adsense'); ?>" />
61
  <?php
62
  }
63
 
64
+ function quick_adsense_settings_page_tabs() {
65
+ echo '<div id="quick_adsense_settings_tabs">';
66
+ echo '<ul>';
67
+ echo '<li><a href="#tabs-settings">Settings</a></li>';
68
+ echo '<li><a href="#tabs-post-body-ads">Ads on Post Body</a></li>';
69
+ echo '<li><a href="#tabs-sidebar-widget-ads">Sidebar Widget</a></li>';
70
+ echo '<li><a href="#tabs-header-footer-codes">Header / Footer Codes</a></li>';
71
+ echo '<li><a href="#tabs-vi">Monetization with vi stories</a></li>';
72
+ echo '</ul>';
73
+ echo '<div id="tabs-settings">';
74
+ echo '<div id="quick_adsense_top_sections_wrapper">';
75
+ do_settings_sections('quick-adsense-general');
76
+ echo '</div>';
77
+ submit_button('Save Changes');
78
+ echo '</div>';
79
+ echo '<div id="tabs-post-body-ads">';
80
+ do_settings_sections('quick-adsense-onpost');
81
+ submit_button('Save Changes');
82
+ echo '</div>';
83
+ echo '<div id="tabs-sidebar-widget-ads">';
84
+ do_settings_sections('quick-adsense-widgets');
85
+ submit_button('Save Changes');
86
+ echo '</div>';
87
+ echo '<div id="tabs-header-footer-codes">';
88
+ do_settings_sections('quick-adsense-header-footer-codes');
89
+ submit_button('Save Changes');
90
+ echo '</div>';
91
+ echo '<div id="tabs-vi">';
92
+ do_settings_sections('quick-adsense-vi');
93
+ echo '</div>';
94
+ echo '</div>';
95
+ }
96
+
97
+ function quick_adsense_header_footer_codes_content() {
98
  $settings = get_option('quick_adsense_settings');
99
  echo '<div id="quick_adsense_top_sections_wrapper">';
100
  echo '<div class="quick_adsense_block">';
279
  echo '<div class="clear"></div>';
280
  echo 'Disable Ads in a post, on-the-fly:';
281
  echo '<ol>';
282
+ echo '<li>Insert <b>&lt;!--NoAds--&gt;</b> to disable all Ads in a post <i>(does not affect Ads on Sidebar)</i>.</li>';
283
+ echo '<li>Insert <b>&lt;!--OffDef--&gt;</b> to disable the default positioned Ads, and use &lt;!--Ads1--&gt;, &lt;!--Ads2--&gt;, etc. to insert Ad <i>(does not affect Ads on Sidebar)</i>.</li>';
284
+ echo '<li>Insert <b>&lt;!--OffWidget--&gt;</b> to disable all Ads on Sidebar.</li>';
285
+ echo '<li>Insert <b>&lt;!--OffBegin--&gt;</b>, <b>&lt;!--OffMiddle--&gt;</b>, <b>&lt;!--OffEnd--&gt;</b> to <b>disable Ads at Beginning</b>, <b>Middle or End of Post</b>.</li>';
286
+ echo '<li>Insert <b>&lt;!--OffAfMore--&gt;</b>, <b>&lt;!--OffBfLastPara--&gt;</b> to <b>disable Ads right after the &lt;!--more--&gt; tag</b>, or <b>right before the last Paragraph</b>.</li>';
287
  echo '</ol>';
288
  echo '<div class="clear"></div>';
289
  echo '<i>Tags can be inserted into a post via the additional Quicktag Buttons at the HTML Edit Post SubPanel.</i>';
290
  echo '</div>';
291
  echo '<div class="clear"></div>';
292
  echo '</div>';
 
 
 
 
 
 
 
 
293
  }
294
 
295
  function quick_adsense_onpost_content() {
304
  for($i = 1; $i <= 50; $i++) {
305
  $marginOptions[] = array('text' => $i, 'value' => $i);
306
  }
307
+ echo '<div id="quick_adsense_block_bottom" class="quick_adsense_block" style="margin: 30px 0 0;">';
308
+ echo '<div class="quick_adsense_block_labels" style="width: auto;">';
309
+ echo '<span>Adsense Codes - Ads on Post Body</span>';
310
+ echo '</div>';
311
+ echo '<div class="clear"></div>';
312
+ echo '<p>Paste up to 10 Ads codes on Post Body as assigned above. Ads codes provided must not be identical, repeated codes may result the Ads not being display correctly. Ads will never displays more than once in a page.</p>';
313
+ echo '</div>';
314
+
315
  echo '<div id="quick_adsense_onpost_content_controls_wrapper">';
316
+ echo '<div id="quick_adsense_onpost_content_global_controls_wrapper">';
317
  echo '<p class="quick_adsense_onpost_adunits_styling_controls">';
318
  echo quickadsense_get_control('checkbox', '', 'quick_adsense_settings_onpost_enable_global_style', 'quick_adsense_settings[onpost_enable_global_style]', ((isset($settings['onpost_enable_global_style']))?$settings['onpost_enable_global_style']:''), null, 'input', 'margin: -3px 10px 0 0;');
319
  echo '<span>Use for all</span>';
328
  echo '<div id="quick_adsense_onpost_content_adunits_wrapper">';
329
  echo '<div id="quick_adsense_onpost_content_adunits_initial_wrapper">';
330
  for($i = 1; $i <= 3; $i++) {
331
+ quick_adsense_onpost_adunits_controls($i, $settings, $alignmentOptions, $marginOptions);
 
 
 
 
 
 
 
 
 
 
 
 
 
332
  }
333
  echo '</div>';
334
  echo '<div id="quick_adsense_onpost_content_adunits_all_wrapper" style="display: none;">';
335
  for($i = 4; $i <= 10; $i++) {
336
+ quick_adsense_onpost_adunits_controls($i, $settings, $alignmentOptions, $marginOptions);
 
 
 
 
 
 
 
 
 
 
 
 
 
337
  }
338
  echo '</div>';
339
  echo '<a id="quick_adsense_onpost_content_adunits_showall_button" class="input button-secondary"><span class="dashicons dashicons-arrow-down"></span> <b>Show All</b></a>';
341
  echo '</div>';
342
  }
343
 
344
+ function quick_adsense_onpost_adunits_controls($index, $settings, $alignmentOptions, $marginOptions) {
345
+ echo '<div id="quick_adsense_onpost_adunits_control_'.$index.'" class="quick_adsense_onpost_adunits_control_wrapper">';
346
+ echo '<div class="quick_adsense_onpost_adunits_label">Ads'.$index.'</div>';
347
+ echo '<div class="quick_adsense_onpost_adunits_control">';
348
+ echo quickadsense_get_control('textarea', '', 'quick_adsense_settings_onpost_ad_'.$index.'_content', 'quick_adsense_settings[onpost_ad_'.$index.'_content]', ((isset($settings['onpost_ad_'.$index.'_content']))?$settings['onpost_ad_'.$index.'_content']:''), null, 'input', 'display: block; margin: 0 0 10px 0', 'Enter Code');
349
+ echo '<p class="quick_adsense_onpost_adunits_styling_controls">';
350
+ echo 'Alignment';
351
+ echo quickadsense_get_control('select', '', 'quick_adsense_settings_onpost_ad_'.$index.'_alignment', 'quick_adsense_settings[onpost_ad_'.$index.'_alignment]', ((isset($settings['onpost_ad_'.$index.'_alignment']))?$settings['onpost_ad_'.$index.'_alignment']:''), $alignmentOptions, 'input', 'margin: -2px 20px 0 10px;');
352
+ echo '<wbr />margin';
353
+ echo quickadsense_get_control('number', '', 'quick_adsense_settings_onpost_ad_'.$index.'_margin', 'quick_adsense_settings[onpost_ad_'.$index.'_margin]', ((isset($settings['onpost_ad_'.$index.'_margin']))?$settings['onpost_ad_'.$index.'_margin']:''), $marginOptions, 'input', 'margin: -2px 10px 0 10px; width: 52px;');
354
+ echo 'px';
355
+ echo '</p>';
356
+ if(function_exists('quick_adsense_pro_controls')) {
357
+ quick_adsense_pro_controls($index, $settings, 'onpost');
358
+ }
359
+ echo '</div>';
360
+ echo '<div class="clear"></div>';
361
+ echo '</div>';
362
+ }
363
+
364
  function quick_adsense_widgets_content() {
365
  $settings = get_option('quick_adsense_settings');
366
  $alignmentOptions = array(
373
  for($i = 1; $i <= 50; $i++) {
374
  $marginOptions[] = array('text' => $i, 'value' => $i);
375
  }
376
+ echo '<div id="quick_adsense_block_bottom" class="quick_adsense_block" style="margin: 30px 0 0;">';
377
+ echo '<div class="quick_adsense_block_labels" style="width: auto;">';
378
+ echo '<span>Adsense Codes - <a href="'.admin_url('widgets.php').'">Sidebar WIdget</a></span>';
379
+ echo '</div>';
380
+ echo '<div class="clear"></div>';
381
+ echo '<p>Paste up to 10 Ads codes on Sidebar Widget. Ads codes provided must not be identical, repeated codes may result the Ads not being display correctly. Ads will never displays more than once in a page.</p>';
382
+ echo '</div>';
383
 
 
384
  echo '<div id="quick_adsense_widget_controls_wrapper">';
385
  echo '<div id="quick_adsense_widget_global_controls_wrapper" style="visibility: hidden;">';
386
  echo '<p class="quick_adsense_widget_adunits_styling_controls">';
397
  echo '<div id="quick_adsense_widget_adunits_wrapper">';
398
  echo '<div id="quick_adsense_widget_adunits_initial_wrapper">';
399
  for($i = 1; $i <= 3; $i++) {
400
+ quick_adsense_widgets_controls($i, $settings);
 
 
 
 
 
 
401
  }
402
  echo '</div>';
403
  echo '<div id="quick_adsense_widget_adunits_all_wrapper" style="display: none;">';
404
  for($i = 4; $i <= 10; $i++) {
405
+ quick_adsense_widgets_controls($i, $settings);
 
 
 
 
 
 
406
  }
407
  echo '</div>';
408
  echo '<a id="quick_adsense_widget_adunits_showall_button" class="input button-secondary"><span class="dashicons dashicons-arrow-down"></span> <b>Show All</b></a>';
410
  echo '</div>';
411
  }
412
 
413
+ function quick_adsense_widgets_controls($index, $settings) {
414
+ echo '<div id="quick_adsense_widget_adunits_control_'.$index.'" class="quick_adsense_widget_adunits_control_wrapper">';
415
+ echo '<div class="quick_adsense_widget_adunits_label">AdsWidget'.$index.'</div>';
416
+ echo '<div class="quick_adsense_widget_adunits_control">';
417
+ echo quickadsense_get_control('textarea', '', 'quick_adsense_settings_widget_ad_'.$index.'_content', 'quick_adsense_settings[widget_ad_'.$index.'_content]', ((isset($settings['widget_ad_'.$index.'_content']))?$settings['widget_ad_'.$index.'_content']:''), null, 'input', 'display: block; margin: 0 0 10px 0', 'Enter Code');
418
+ if(function_exists('quick_adsense_pro_controls')) {
419
+ quick_adsense_pro_controls($index, $settings, 'widget');
420
+ }
421
+ echo '</div>';
422
+ echo '<div class="clear"></div>';
423
+ echo '</div>';
424
+ }
425
+
426
+ function quick_adsense_pro_content() {
427
+ echo '<div id="quick_adsense_block_bottom" class="quick_adsense_block" style="margin: 30px 0 0;">';
428
+ echo '<div class="quick_adsense_block_labels" style="width: auto;">';
429
+ echo '<span>Quickadsense Pro</span>';
430
+ echo '</div>';
431
+ echo '<div class="clear"></div>';
432
+ echo '<p>These PRO features are available only in quick adsense pro.</p>';
433
+ echo '</div>';
434
+
435
+ echo '<div class="quick_adsense_block">';
436
+ echo '<div class="quick_adsense_block_labels">';
437
+ echo 'Quicktag';
438
+ echo '</div>';
439
+ echo '<div class="quick_adsense_block_controls">';
440
+ echo 'Insert Ads into a post, on-the-fly:';
441
+ echo '<ol>';
442
+ echo '<li>Insert <b>&lt;!--Ads1--&gt;</b>, <b>&lt;!--Ads2--&gt;</b> etc. into a post to show the <b>Particular Ads</b> at specific location.</li>';
443
+ echo '<li>Insert <b>&lt;!--RndAds--&gt;</b> (or more) into a post to show the <b>Random Ads</b> at specific location.</li>';
444
+ echo '</ol>';
445
+ echo '<div class="clear"></div>';
446
+ echo 'Disable Ads in a post based on device Type:';
447
+ echo '<ol>';
448
+ echo '<li>Insert <b>&lt;!--NoMobileAds--&gt;</b>, <b>&lt;!--NoTabletAds--&gt;</b>, <b>&lt;!--NoDesktopAds--&gt;</b> to disable all Ads in a post on Mobile, Tablet and Desktop devices<i>(does not affect Ads on Sidebar)</i>.</li>';
449
+ echo '<li>Insert <b>&lt;!--OffMobileDef--&gt;</b>, <b>&lt;!--OffTabletDef--&gt;</b>, <b>&lt;!--OffDesktopDef--&gt;</b> to disable the default positioned Ads on Mobile, Tablet and Desktop devices, and use &lt;!--Ads1--&gt;, &lt;!--Ads2--&gt;, etc. to insert Ad <i>(does not affect Ads on Sidebar)</i>.</li>';
450
+ echo '<li>Insert <b>&lt;!--OffMobileWidget--&gt;</b>, <b>&lt;!--OffTabletWidget--&gt;</b>, <b>&lt;!--OffDesktopWidget--&gt;</b> to disable all Ads on Sidebar on Mobile, Tablet and Desktop devices.</li>';
451
+ echo '<li>Insert <b>&lt;!--OffMobileBegin--&gt;</b>, <b>&lt;!--OffMobileMiddle--&gt;</b>, <b>&lt;!--OffMobileEnd--&gt;</b> to <b>disable Ads at Beginning</b>, <b>Middle or End of Post</b> on Mobile devices.</li>';
452
+ echo '<li>Insert <b>&lt;!--OffTabletBegin--&gt;</b>, <b>&lt;!--OffTabletMiddle--&gt;</b>, <b>&lt;!--OffTabletEnd--&gt;</b> to <b>disable Ads at Beginning</b>, <b>Middle or End of Post</b> on Tablet devices.</li>';
453
+ echo '<li>Insert <b>&lt;!--OffDesktopBegin--&gt;</b>, <b>&lt;!--OffDesktopMiddle--&gt;</b>, <b>&lt;!--OffDesktopEnd--&gt;</b> to <b>disable Ads at Beginning</b>, <b>Middle or End of Post</b> on Desktop devices.</li>';
454
+ echo '<li>Insert <b>&lt;!--OffMobileAfMore--&gt;</b>, <b>&lt;!--OffBfLastPara--&gt;</b> to <b>disable Ads right after the &lt;!--more--&gt; tag</b>, or <b>right before the last Paragraph</b> on Mobile devices.</li>';
455
+ echo '<li>Insert <b>&lt;!--OffTabletAfMore--&gt;</b>, <b>&lt;!--OffTabletBfLastPara--&gt;</b> to <b>disable Ads right after the &lt;!--more--&gt; tag</b>, or <b>right before the last Paragraph</b> on Tablet devices.</li>';
456
+ echo '<li>Insert <b>&lt;!--OffDesktopAfMore--&gt;</b>, <b>&lt;!--OffDesktopBfLastPara--&gt;</b> to <b>disable Ads right after the &lt;!--more--&gt; tag</b>, or <b>right before the last Paragraph</b> on Desktop devices.</li>';
457
+ echo '</ol>';
458
+ echo '<div class="clear"></div>';
459
+ echo '<i>Tags can be inserted into a post via the additional Quicktag Buttons at the HTML Edit Post SubPanel.</i>';
460
+ echo '</div>';
461
+ echo '<div class="clear"></div>';
462
+ echo '</div>';
463
+ }
464
+
465
  function quick_adsense_validate($input) {
466
  delete_transient('quick_adsense_adstxt_adsense_autocheck_content');
467
  return $input;
includes/vi-gdpr.php CHANGED
File without changes
includes/vi.php CHANGED
@@ -1,15 +1,17 @@
1
  <?php
2
  /*Begin Vi Admin Notice */
3
- add_action('admin_footer', 'quick_adsense_vi_adstxt_adsense_admin_footer');
4
- function quick_adsense_vi_adstxt_adsense_admin_footer() {
5
  echo '<script type="text/javascript">';
6
  echo "jQuery(document).ready(function() {";
7
- echo "jQuery.post(";
8
- echo "jQuery('#quick_adsense_admin_notice_ajax').val(), {";
9
- echo "'action': 'quick_adsense_vi_admin_notice_dismiss',";
10
- echo "'quick_adsense_admin_notice_nonce': jQuery('#quick_adsense_admin_notice_nonce').val(),";
11
- echo "}, function(response) { }";
12
- echo ");";
 
 
13
  echo "});";
14
  echo '</script>';
15
  }
@@ -69,6 +71,73 @@ function quick_adsense_vi_admin_notice_reactivate() {
69
  }
70
  /*End Vi Admin Notice */
71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  function quick_adsense_vi_plugin_card_content($isLoggedin = false, $isAjaxRequest = false) {
73
  if(!$isLoggedin) {
74
  echo '<div class="quick_adsense_vi_block_header">Start earning with <a href="https://www.vi.ai/publisher-video-monetization/?aid=WP_quickadsense&utm_source=Wordpress&utm_medium=wp_quickadsense">vi stories</a></div>';
1
  <?php
2
  /*Begin Vi Admin Notice */
3
+ add_action('admin_footer', 'quick_adsense_vi_admin_notice_admin_footer');
4
+ function quick_adsense_vi_admin_notice_admin_footer() {
5
  echo '<script type="text/javascript">';
6
  echo "jQuery(document).ready(function() {";
7
+ echo "jQuery('.quick_adsense_notice').on('click', '.notice-dismiss', function() {";
8
+ echo "jQuery.post(";
9
+ echo "jQuery('#quick_adsense_admin_notice_ajax').val(), {";
10
+ echo "'action': 'quick_adsense_vi_admin_notice_dismiss',";
11
+ echo "'quick_adsense_admin_notice_nonce': jQuery('#quick_adsense_admin_notice_nonce').val(),";
12
+ echo "}, function(response) { }";
13
+ echo ");";
14
+ echo "});";
15
  echo "});";
16
  echo '</script>';
17
  }
71
  }
72
  /*End Vi Admin Notice */
73
 
74
+ /*Begin Vi Width Check Admin Notice*/
75
+ add_action('admin_footer', 'quick_adsense_vi_width_check_admin_notice_admin_footer');
76
+ function quick_adsense_vi_width_check_admin_notice_admin_footer() {
77
+ echo '<script type="text/javascript">';
78
+ echo "jQuery(document).ready(function() {";
79
+ echo "jQuery('.quick_adsense_vi_width_check_notice').on('click', '.notice-dismiss', function() {";
80
+ echo "jQuery.post(";
81
+ echo "jQuery('#quick_adsense_vi_width_check_admin_notice_ajax').val(), {";
82
+ echo "'action': 'quick_adsense_vi_width_check_admin_notice_dismiss',";
83
+ echo "'quick_adsense_vi_width_check_admin_notice_nonce': jQuery('#quick_adsense_vi_width_check_admin_notice_nonce').val(),";
84
+ echo "}, function(response) { }";
85
+ echo ");";
86
+ echo "});";
87
+ echo "});";
88
+ echo '</script>';
89
+ }
90
+
91
+ add_action('wp_ajax_quick_adsense_vi_width_check_admin_notice_dismiss', 'quick_adsense_vi_width_check_admin_notice_dismiss');
92
+ function quick_adsense_vi_width_check_admin_notice_dismiss() {
93
+ check_ajax_referer('quick-adsense-vi-width-check-admin-notice', 'quick_adsense_vi_width_check_admin_notice_nonce');
94
+ update_option('quick_adsense_vi_width_check_dismissed', 'true');
95
+ die();
96
+ }
97
+
98
+ add_action('admin_notices', 'quick_adsense_vi_width_check_admin_notices');
99
+ function quick_adsense_vi_width_check_admin_notices() {
100
+ if(current_user_can('manage_options')) {
101
+ //delete_option('quick_adsense_vi_width_check_dismissed');
102
+ $viWidthCheck = get_option('quick_adsense_vi_width_check_dismissed');
103
+ if(!$viWidthCheck) {
104
+ $viWidthCheckTrigger = get_option('quick_adsense_vi_width_check_trigger');
105
+ if(isset($viWidthCheckTrigger) && ($viWidthCheckTrigger == 'true')) {
106
+ echo '<div class="notice notice-error quick_adsense_vi_width_check_notice is-dismissible">';
107
+ echo '<div id="quick_adsense_notice_container">';
108
+ echo '<img id="quick_adsense_notice_vi_logo" src="'.plugins_url('/images/vi-big-logo.png', __FILE__).'" />';
109
+ echo '<p class="quick_adsense_notice_title_para">Ad unit is too small, vi stories is not working on your site.</p>';
110
+ echo '<p class="quick_adsense_notice_content_para">The minimum vi stories unit size is 336x280px.<br />Please insert the tag into a bigger unit.</p>';
111
+ echo '</div>';
112
+ echo '<div class="clear"></div>';
113
+ echo '<input type="hidden" id="quick_adsense_vi_width_check_admin_notice_nonce" name="quick_adsense_vi_width_check_admin_notice_nonce" value="'.wp_create_nonce('quick-adsense-vi-width-check-admin-notice').'" />';
114
+ echo '<input type="hidden" id="quick_adsense_vi_width_check_admin_notice_ajax" name="quick_adsense_vi_width_check_admin_notice_ajax" value="'.admin_url('admin-ajax.php').'" />';
115
+ echo '<style type="text/css">';
116
+ echo '.quick_adsense_vi_width_check_notice { padding: 15px; border-left: 4px solid #000; }';
117
+ echo '.quick_adsense_vi_width_check_notice #quick_adsense_notice_container { font-size: 14px; font-family: Arial; line-height: 18px; color: #232323; }';
118
+ echo '.quick_adsense_vi_width_check_notice #quick_adsense_notice_container #quick_adsense_notice_vi_logo { float: right; margin: 13px 20px 0 20px; }';
119
+ echo '.quick_adsense_vi_width_check_notice #quick_adsense_notice_container .quick_adsense_notice_title_para { font-size: 16px; line-height: 18px; margin: 0 0 10px; }';
120
+ echo '.quick_adsense_vi_width_check_notice #quick_adsense_notice_container .quick_adsense_notice_content_para { font-size: 14px; line-height: 18px; margin: 0; }';
121
+ echo '@media only screen and (max-width: 992px) {';
122
+ echo '.quick_adsense_vi_width_check_notice #quick_adsense_notice_container #quick_adsense_notice_vi_logo { clear: both; float: none; margin: 0 0 10px; }';
123
+ echo '}';
124
+ echo '</style>';
125
+ echo '</div>';
126
+ }
127
+ }
128
+ }
129
+ }
130
+
131
+ add_action('init', 'quick_adsense_vi_width_check_init');
132
+ function quick_adsense_vi_width_check_init() {
133
+ if(isset($_GET['quick_adsense_vi_width_check']) && ($_GET['quick_adsense_vi_width_check'] != '')) {
134
+ check_ajax_referer('quick_adsense_vi_width_check', 'quick_adsense_vi_width_check');
135
+ update_option('quick_adsense_vi_width_check_trigger', 'true');
136
+ die();
137
+ }
138
+ }
139
+ /*End Vi Width Check Admin Notice*/
140
+
141
  function quick_adsense_vi_plugin_card_content($isLoggedin = false, $isAjaxRequest = false) {
142
  if(!$isLoggedin) {
143
  echo '<div class="quick_adsense_vi_block_header">Start earning with <a href="https://www.vi.ai/publisher-video-monetization/?aid=WP_quickadsense&utm_source=Wordpress&utm_medium=wp_quickadsense">vi stories</a></div>';
includes/widgets.php CHANGED
File without changes
quick-adsense.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin URI: http://quickadsense.com/
5
  Description: Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
6
  Author: Quicksense
7
- Version: 2.4
8
  Author URI: http://quickadsense.com/
9
  */
10
  /*
4
  Plugin URI: http://quickadsense.com/
5
  Description: Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
6
  Author: Quicksense
7
+ Version: 2.5
8
  Author URI: http://quickadsense.com/
9
  */
10
  /*
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: quickadsense
3
  Tags: WordPress Plugin, adsense, google adsense, random adsense, random ads, advertising, adsense insertion, ad manager, ad, yahoo, google, ads, text insertion, widget, sidebar, admin, posts, plugin
4
  Requires at least: 4.0
5
- Tested up to: 4.9.6
6
- Stable tag: 2.4
7
 
8
  Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
9
 
@@ -47,45 +47,45 @@ Sign up for a [Google Adsense Account](http://adsense.google.com/) to generate r
47
 
48
  Please feedback to [http://quickadsense.com/](http://quickadsense.com/) for any bug you might have found, or any suggestion you like to add.
49
 
50
- == Change Log ==
51
- = 2.4 =
52
- * GDPR consent management module added
53
- * Updated Privacy policy
54
-
55
- = 2.3.2 =
56
- * Bug fixes
57
- * 3 option fields have been removed
58
- * The API limiter added
59
- * QuickTag issues have been fixed
60
-
61
- = 2.3 =
62
- * Updated ads.txt modification logic
63
- * Introduced monetization with video intelligence AG
64
- * UI fixes
65
-
66
- = 2.2 =
67
- * Fixed functionality issues
68
-
69
- = 2.1 =
70
- * Optimized UI
71
- * Integrarion with video intelligence on better monetization
72
- * Brought plugin uptodate with latest wordpress standards
73
- * Removed all legacy code
74
- * Legacy Tinymce API replaced with current API
75
- * Legacy Widget API replaced with current API
76
-
77
  = 2.0.1 =
78
- * Bug Fix: Fixed a bug which caused a JS error in specific use cases.
79
- * Date: 19-December-2017
80
 
81
  = 2.0 =
82
  * The number of individual database calls has been reduced from 80 to just 1, also almost all of the legacy code has been altered and code base re-structured to be better understandable.
83
  * Info update.
84
  * Date: 14-September-2017
85
-
86
  = 1.9.3 =
87
  * Info update.
88
- * Date: 29-August-2017
89
 
90
  = 1.9.2 =
91
  * Update the depreciated wp code function for AdsWidget in the plugin.
@@ -176,18 +176,13 @@ Please feedback to [http://quickadsense.com/](http://quickadsense.com/) for any
176
 
177
  = 1.0 =
178
  * Initial public release.
179
- * Date: 21-Sep-2009
180
-
181
  == Privacy Policy ==
182
 
183
  Users privacy is very important to us and we make extra effort not to collect data about the users to the maximum extend possible.
184
  However to provide enhanced functionality we utilize the APIs from different third party services as listed below and the usage of those API are in accordance with their privacy policies.
185
 
186
- = Geo Targeting =
187
-
188
- To enable Geo Targeting functionality for Ads we have to send the visitor IP address to a third party service (http://freegeoip.net/ OR https://ipstack.com/) and the usage of thier API is in accordance to their privacy policy located at https://ipstack.com/privacy/.
189
- This third party API is utilized only when you enable or use Geo Targetting features in the plugin admin.
190
-
191
  = video intelligence =
192
 
193
  The plugin provides deep integration with video intelligence to provide enhanced features and for easy integration with their services.
2
  Contributors: quickadsense
3
  Tags: WordPress Plugin, adsense, google adsense, random adsense, random ads, advertising, adsense insertion, ad manager, ad, yahoo, google, ads, text insertion, widget, sidebar, admin, posts, plugin
4
  Requires at least: 4.0
5
+ Tested up to: 5.2.4
6
+ Stable tag: 2.5
7
 
8
  Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
9
 
47
 
48
  Please feedback to [http://quickadsense.com/](http://quickadsense.com/) for any bug you might have found, or any suggestion you like to add.
49
 
50
+ == Change Log ==
51
+ = 2.4 =
52
+ * GDPR consent management module added
53
+ * Updated Privacy policy
54
+
55
+ = 2.3.2 =
56
+ * Bug fixes
57
+ * 3 option fields have been removed
58
+ * The API limiter added
59
+ * QuickTag issues have been fixed
60
+
61
+ = 2.3 =
62
+ * Updated ads.txt modification logic
63
+ * Introduced monetization with video intelligence AG
64
+ * UI fixes
65
+
66
+ = 2.2 =
67
+ * Fixed functionality issues
68
+
69
+ = 2.1 =
70
+ * Optimized UI
71
+ * Integrarion with video intelligence on better monetization
72
+ * Brought plugin uptodate with latest wordpress standards
73
+ * Removed all legacy code
74
+ * Legacy Tinymce API replaced with current API
75
+ * Legacy Widget API replaced with current API
76
+
77
  = 2.0.1 =
78
+ * Bug Fix: Fixed a bug which caused a JS error in specific use cases.
79
+ * Date: 19-December-2017
80
 
81
  = 2.0 =
82
  * The number of individual database calls has been reduced from 80 to just 1, also almost all of the legacy code has been altered and code base re-structured to be better understandable.
83
  * Info update.
84
  * Date: 14-September-2017
85
+
86
  = 1.9.3 =
87
  * Info update.
88
+ * Date: 29-August-2017
89
 
90
  = 1.9.2 =
91
  * Update the depreciated wp code function for AdsWidget in the plugin.
176
 
177
  = 1.0 =
178
  * Initial public release.
179
+ * Date: 21-Sep-2009
180
+
181
  == Privacy Policy ==
182
 
183
  Users privacy is very important to us and we make extra effort not to collect data about the users to the maximum extend possible.
184
  However to provide enhanced functionality we utilize the APIs from different third party services as listed below and the usage of those API are in accordance with their privacy policies.
185
 
 
 
 
 
 
186
  = video intelligence =
187
 
188
  The plugin provides deep integration with video intelligence to provide enhanced features and for easy integration with their services.
screenshot-1.png CHANGED
File without changes
screenshot-2.png CHANGED
File without changes