AdSense Plugin WP QUADS - Version 1.5.7

Version Description

  • Tweak: Remove external empty quads.css file
  • Tweak: Better wordings for ad blocker notice
  • Tweak: Make code more robust
  • Tweak: Simpler notice for renewing license keys
  • Tweak: Change admin bar warning color from red to a more suitable orange
  • Fix: Remove jQuery frontpage check
  • Fix: Rating notice not hiding
Download this release

Release Info

Developer ReneHermi
Plugin Icon 128x128 AdSense Plugin WP QUADS
Version 1.5.7
Comparing to
See all releases

Code changes from version 1.5.6 to 1.5.7

assets/css/quads.css CHANGED
@@ -1,10 +1 @@
1
- /*
2
- To change this license header, choose License Headers in Project Properties.
3
- To change this template file, choose Tools | Templates
4
- @version
5
- */
6
- /*
7
- Created on : 20.10.2016, 10:37:23
8
- Author : IronMan
9
- */
10
-
1
+ /* Silence */
 
 
 
 
 
 
 
 
 
includes/Cron/Cron.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Chron relevant stuff
5
+ */
6
+
7
+ // No Direct Access
8
+ if( !defined( "WPINC" ) ) {
9
+ die;
10
+ }
11
+
12
+ class quadsCron {
13
+
14
+ public function __construct() {
15
+ add_filter( 'cron_schedules', array($this, 'add_new_intervals') );
16
+ }
17
+
18
+ /**
19
+ * Add new intervals for wp cron jobs
20
+ * @param type $schedules
21
+ * @return type
22
+ */
23
+ public function add_new_intervals( $schedules ) {
24
+ // add weekly and monthly intervals
25
+ $schedules['weekly'] = array(
26
+ 'interval' => 604800,
27
+ 'display' => __( 'Once Weekly' )
28
+ );
29
+
30
+ $schedules['monthly'] = array(
31
+ 'interval' => 2635200,
32
+ 'display' => __( 'Once a month' )
33
+ );
34
+
35
+ return $schedules;
36
+ }
37
+
38
+ public function schedule_event() {
39
+ if( !wp_next_scheduled( 'quads_weekly_event' ) ) {
40
+ wp_schedule_event( time(), 'weekly', 'quads_weekly_event' );
41
+ }
42
+ }
43
+ }
44
+
45
+ $quadsCron = new quadsCron();
includes/admin/admin-footer.php CHANGED
@@ -24,7 +24,7 @@ function quads_admin_rate_us( $footer_text ) {
24
  global $typenow;
25
 
26
  if ( quads_is_admin_page() ) {
27
- $rate_text = sprintf( __( '<strong>Please do us a BIG favor and give us a 5 star rating <a href="%1$s" target="_blank">here</a> . If you`re not happy, please open a <a href="%2s" target="_blank">support ticket</a>, so that we can sort it out. Thank you!</strong>', 'quick-adsense-reloaded' ),
28
  'https://wordpress.org/support/plugin/quick-adsense-reloaded/reviews/?filter=5#new-post',
29
  'http://wpquads.com/support/'
30
  );
24
  global $typenow;
25
 
26
  if ( quads_is_admin_page() ) {
27
+ $rate_text = sprintf( __( '<strong>Please do us a BIG favor and give us a 5 star rating <a href="%1$s" target="_blank">here</a>. If you have issues, open a <a href="%2s" target="_blank">support ticket</a>, so that we can sort it out. Thank you!</strong>', 'quick-adsense-reloaded' ),
28
  'https://wordpress.org/support/plugin/quick-adsense-reloaded/reviews/?filter=5#new-post',
29
  'http://wpquads.com/support/'
30
  );
includes/admin/admin-notices.php CHANGED
@@ -35,7 +35,7 @@ function quads_admin_messages() {
35
  quads_update_notice_1_5_3();
36
 
37
  if( quads_is_admin_page() ) {
38
- echo '<div class="notice notice-error" id="wpquads-adblock-notice" style="display:none;">' . sprintf( __( '<strong><p>Your ad blocker browser extension is removing WP QUADS ressources and is breaking this settings screen! Deactivate adblock for this website and you are good! WP QUADS is used on 40.000 websites and is into focus of the big adblocking companies. That\'s the downside of our success but nothing you need to worry about. </strong></p>', 'quick-adsense-reloaded' ), admin_url() . 'admin.php?page=quads-settings#quads_settingsgeneral_header' ) . '</div>';
39
  }
40
 
41
  if( !quads_is_any_ad_activated() && quads_is_admin_page() ) {
@@ -61,8 +61,8 @@ function quads_admin_messages() {
61
  $datetime2 = new DateTime( $display_date );
62
  $diff_intrval = round( ($datetime2->format( 'U' ) - $datetime1->format( 'U' )) / (60 * 60 * 24) );
63
 
64
-
65
- if( $diff_intrval >= 7 && get_option( 'quads_rating_div' ) == "no" || false === get_option( 'quads_rating_div' ) || quads_rate_again() ) {
66
  echo '<div class="quads_fivestar updated " style="box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);background-color:white;">
67
  <p>Awesome, you\'ve been using <strong>WP QUADS</strong> for more than 1 week. <br> May i ask you to give it a <strong>5-star rating</strong> on Wordpress? </br>
68
  This will help to spread its popularity and to make this plugin a better one.
@@ -146,7 +146,6 @@ function quads_hide_rating_div() {
146
  echo json_encode( array("success") );
147
  exit;
148
  }
149
-
150
  add_action( 'wp_ajax_quads_hide_rating', 'quads_hide_rating_div' );
151
 
152
  /**
35
  quads_update_notice_1_5_3();
36
 
37
  if( quads_is_admin_page() ) {
38
+ echo '<div class="notice notice-error" id="wpquads-adblock-notice" style="display:none;">' . sprintf( __( '<strong><p>You need to deactivate your ad blocker to use WP QUADS settings.</strong> Your ad blocker browser extension is removing WP QUADS css ressources and is breaking the settings screen! Deactivating the ad blocker will resolve it. WP QUADS is used on 60.000 websites and is into focus of the big adblocking companies. That\'s the downside of our success but nothing you need to worry about.</p>', 'quick-adsense-reloaded' ), admin_url() . 'admin.php?page=quads-settings#quads_settingsgeneral_header' ) . '</div>';
39
  }
40
 
41
  if( !quads_is_any_ad_activated() && quads_is_admin_page() ) {
61
  $datetime2 = new DateTime( $display_date );
62
  $diff_intrval = round( ($datetime2->format( 'U' ) - $datetime1->format( 'U' )) / (60 * 60 * 24) );
63
 
64
+ $rate = get_option( 'quads_rating_div', false);
65
+ if( $diff_intrval >= 7 && ($rate === "no" || false === $rate || quads_rate_again() ) ) {
66
  echo '<div class="quads_fivestar updated " style="box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);background-color:white;">
67
  <p>Awesome, you\'ve been using <strong>WP QUADS</strong> for more than 1 week. <br> May i ask you to give it a <strong>5-star rating</strong> on Wordpress? </br>
68
  This will help to spread its popularity and to make this plugin a better one.
146
  echo json_encode( array("success") );
147
  exit;
148
  }
 
149
  add_action( 'wp_ajax_quads_hide_rating', 'quads_hide_rating_div' );
150
 
151
  /**
includes/admin/settings/display-settings.php CHANGED
@@ -230,22 +230,25 @@ function quads_options_page() {
230
  <?php settings_errors(); ?>
231
  <?php
232
  // do not show save button on add-on page
233
- if ($active_tab !== 'addons'){
234
  $other_attributes = array( 'id' => 'quads-submit-button' );
235
  submit_button(null, 'primary', 'quads-save-settings' , true, $other_attributes );
 
236
  ?>
237
  <a href="<?php echo admin_url() . '/admin.php?page=quads-settings&quads-action=validate'; ?> " id="quads-validate"><?php _e('Validate Ad Settings','quick-adsense-reloaded')?></a>
238
  <?php
 
 
239
  }
240
  ?>
241
  </form>
242
  <?php
243
  if ($active_tab !== 'addons' && $active_tab !== 'licenses'){
244
- echo sprintf( __( '<strong>If you like this plugin please do us a BIG favor and give us a 5 star rating <a href="%s" target="_blank">here</a> . If you`re not happy, please open a <a href="%2s" target="_blank">support ticket</a>, so that we can sort it out. Thank you!</strong>', 'quick-adsense-reloaded' ),
245
  'https://wordpress.org/support/plugin/quick-adsense-reloaded/reviews/#new-post',
246
  'http://wpquads.com/support/'
247
  );
248
- echo '<p>' . sprintf( __( '<strong>Ads are not showing? Read the <a href="%s" target="_blank">troubleshooting guide</a> to find out how to resolve this issue.', 'quick-adsense-reloaded' ),
249
  'http://wpquads.com/docs/adsense-ads-are-not-showing/?utm_source=plugin&utm_campaign=wpquads-settings&utm_medium=website&utm_term=bottomlink'
250
  );
251
  }
230
  <?php settings_errors(); ?>
231
  <?php
232
  // do not show save button on add-on page
233
+ if ($active_tab !== 'addons' && $active_tab !== 'imexport' && $active_tab !== 'help'){
234
  $other_attributes = array( 'id' => 'quads-submit-button' );
235
  submit_button(null, 'primary', 'quads-save-settings' , true, $other_attributes );
236
+ if ($active_tab !== 'licenses'){
237
  ?>
238
  <a href="<?php echo admin_url() . '/admin.php?page=quads-settings&quads-action=validate'; ?> " id="quads-validate"><?php _e('Validate Ad Settings','quick-adsense-reloaded')?></a>
239
  <?php
240
+ }
241
+
242
  }
243
  ?>
244
  </form>
245
  <?php
246
  if ($active_tab !== 'addons' && $active_tab !== 'licenses'){
247
+ echo sprintf( __( '<strong>If you like this plugin please do us a BIG favor and give us a 5 star rating <a href="%s" target="_blank">here</a> . If you have issues, open a <a href="%2s" target="_blank">support ticket</a>, so that we can sort it out. Thank you!</strong>', 'quick-adsense-reloaded' ),
248
  'https://wordpress.org/support/plugin/quick-adsense-reloaded/reviews/#new-post',
249
  'http://wpquads.com/support/'
250
  );
251
+ echo '<p>' . sprintf( __( '<strong>Ads are not showing? Read the <a href="%s" target="_blank">troubleshooting guide</a> to find out how to resolve it.', 'quick-adsense-reloaded' ),
252
  'http://wpquads.com/docs/adsense-ads-are-not-showing/?utm_source=plugin&utm_campaign=wpquads-settings&utm_medium=website&utm_term=bottomlink'
253
  );
254
  }
includes/admin/settings/register-settings.php CHANGED
@@ -198,7 +198,7 @@ function quads_get_registered_settings() {
198
  . '<li style="font-weight:600;">Select <i>AdSense</i> if you are using AdSense!</li>'
199
  . '<li style="font-weight:600;">Use <i>Plain Text / HTML / JS</i> for all other ads! <br><strong>Caution:</strong> Adding AdSense code into <i>Plain Text</i> option can result in non-displayed ads!</li></ul>', 'quick-adsense-reloaded' ), 'http://wpquads.com/effective-adsense-banner-size-formats/?utm_campaign=plugin&utm_source=general_tab&utm_medium=admin&utm_content=best_banner_sizes' )
200
  . '</ul>'
201
- . '<div style="clear:both;">' . sprintf( __( '<strong>Ads are not showing? Read the <a href="%s" target="_blank">troubleshooting guide</a> to find out how to resolve this issue.', 'quick-adsense-reloaded' ), 'http://wpquads.com/docs/adsense-ads-are-not-showing/?utm_source=plugin&utm_campaign=wpquads-settings&utm_medium=website&utm_term=toplink' ) . ''
202
  . '<br><a href="%s" target="_blank">Read here</a> to find out the most effective AdSense banner sizes. </div>'
203
  . '<div id="quads-open-toggle" class="button">' . __( 'Open All Ads', 'quick-adsense-reloaded' ) . '</div>',
204
  'type' => 'header'
@@ -1058,13 +1058,19 @@ function quads_upload_callback( $args ) {
1058
 
1059
 
1060
  /**
1061
- * Check if extra settings are available
1062
  *
1063
  * @return boolean
1064
  */
1065
  function quads_is_extra() {
 
 
 
 
 
 
1066
  if( function_exists( 'quads_extra' ) ) {
1067
- return quads_extra();
1068
  }
1069
  return false;
1070
  }
198
  . '<li style="font-weight:600;">Select <i>AdSense</i> if you are using AdSense!</li>'
199
  . '<li style="font-weight:600;">Use <i>Plain Text / HTML / JS</i> for all other ads! <br><strong>Caution:</strong> Adding AdSense code into <i>Plain Text</i> option can result in non-displayed ads!</li></ul>', 'quick-adsense-reloaded' ), 'http://wpquads.com/effective-adsense-banner-size-formats/?utm_campaign=plugin&utm_source=general_tab&utm_medium=admin&utm_content=best_banner_sizes' )
200
  . '</ul>'
201
+ . '<div style="clear:both;">' . sprintf( __( '<strong>Ads are not showing? Read the <a href="%s" target="_blank">troubleshooting guide</a> to find out how to resolve it.', 'quick-adsense-reloaded' ), 'http://wpquads.com/docs/adsense-ads-are-not-showing/?utm_source=plugin&utm_campaign=wpquads-settings&utm_medium=website&utm_term=toplink' ) . ''
202
  . '<br><a href="%s" target="_blank">Read here</a> to find out the most effective AdSense banner sizes. </div>'
203
  . '<div id="quads-open-toggle" class="button">' . __( 'Open All Ads', 'quick-adsense-reloaded' ) . '</div>',
204
  'type' => 'header'
1058
 
1059
 
1060
  /**
1061
+ * Check if extra settings are available and activated
1062
  *
1063
  * @return boolean
1064
  */
1065
  function quads_is_extra() {
1066
+
1067
+ $lic = get_option( 'quads_wp_quads_pro_license_active' );
1068
+ if( !$lic || (is_object( $lic ) && $lic->success !== true) ) {
1069
+ return false;
1070
+ }
1071
+
1072
  if( function_exists( 'quads_extra' ) ) {
1073
+ return true;
1074
  }
1075
  return false;
1076
  }
includes/admin/tools.php CHANGED
@@ -158,7 +158,7 @@ function quads_tools_import_export_process_export() {
158
  ignore_user_abort( true );
159
 
160
  if ( ! quads_is_func_disabled( 'set_time_limit' ) )
161
- set_time_limit( 0 );
162
 
163
  nocache_headers();
164
  header( 'Content-Type: application/json; charset=utf-8' );
158
  ignore_user_abort( true );
159
 
160
  if ( ! quads_is_func_disabled( 'set_time_limit' ) )
161
+ @set_time_limit( 0 );
162
 
163
  nocache_headers();
164
  header( 'Content-Type: application/json; charset=utf-8' );
includes/class-quads-license-handler.php CHANGED
@@ -24,8 +24,7 @@ class QUADS_License {
24
  private $version;
25
  private $author;
26
  private $api_url = 'http://wpquads.com/edd-sl-api/'; // production
27
- //private $api_url = 'https://www.mashshare.net/edd-sl-api/'; // production
28
- private $api_url_debug = 'http://src.wordpress-develop.dev/edd-sl-api/'; // development
29
  /**
30
  * Class constructor
31
  *
@@ -107,7 +106,7 @@ class QUADS_License {
107
  add_action( 'admin_init', array( $this, 'deactivate_license' ) );
108
 
109
  // Check that license is valid once per week
110
- add_action( 'quads_weekly_scheduled_events', array( $this, 'weekly_license_check' ) );
111
 
112
  // For testing license notices, uncomment this line to force checks on every page load
113
  //add_action( 'admin_init', array( $this, 'weekly_license_check' ) );
@@ -411,14 +410,19 @@ class QUADS_License {
411
  $messages = array();
412
 
413
  $license = get_option( $this->item_shortname . '_license_active' );
 
 
 
414
 
415
  if( is_object( $license ) && 'valid' !== $license->license && empty( $showed_invalid_message ) ) {
416
 
417
  if( empty( $_GET['tab'] ) || 'licenses' !== $_GET['tab'] ) {
418
 
419
  $messages[] = sprintf(
420
- __( 'You have invalid or expired license keys for WPQUADS PRO. Please go to the <a href="%s" title="Go to Licenses page">Licenses page</a> to correct this issue.', 'quick-adsense-reloaded' ),
421
- admin_url( 'admin.php?page=quads-settings&tab=licenses' )
 
 
422
  );
423
 
424
  $showed_invalid_message = true;
24
  private $version;
25
  private $author;
26
  private $api_url = 'http://wpquads.com/edd-sl-api/'; // production
27
+ private $api_url_debug = 'http://src.wordpress-develop.dev/edd-sl-api/'; // development
 
28
  /**
29
  * Class constructor
30
  *
106
  add_action( 'admin_init', array( $this, 'deactivate_license' ) );
107
 
108
  // Check that license is valid once per week
109
+ add_action( 'quads_weekly_event', array( $this, 'weekly_license_check' ) );
110
 
111
  // For testing license notices, uncomment this line to force checks on every page load
112
  //add_action( 'admin_init', array( $this, 'weekly_license_check' ) );
410
  $messages = array();
411
 
412
  $license = get_option( $this->item_shortname . '_license_active' );
413
+
414
+ $licensekey = empty( $quads_options['quads_wp_quads_pro_license_key'] ) ? '' : $quads_options['quads_wp_quads_pro_license_key'];
415
+
416
 
417
  if( is_object( $license ) && 'valid' !== $license->license && empty( $showed_invalid_message ) ) {
418
 
419
  if( empty( $_GET['tab'] ) || 'licenses' !== $_GET['tab'] ) {
420
 
421
  $messages[] = sprintf(
422
+ __( 'You have invalid or expired license keys for WPQUADS PRO. Go to the <a href="%s" title="Go to Licenses page">Licenses page</a> to correct this issue or <a href="%1s" target="_new">Renew your license key</a>.', 'quick-adsense-reloaded' ),
423
+ admin_url( 'admin.php?page=quads-settings&tab=licenses' ),
424
+ 'https://wpquads.com/checkout/?edd_license_key=' . $licensekey . '&download_id=11'
425
+
426
  );
427
 
428
  $showed_invalid_message = true;
includes/frontend-checks.php CHANGED
@@ -215,12 +215,12 @@ function quads_check_the_content_filter( $content ) {
215
  */
216
  function quads_check_adblocker() {
217
  ?>
218
- <!--noptimize--><style>.quads-hidden { display: none; } .quads-adminbar-is-warnings { background: #ef4000 ! important; color: #fff !important; }
219
  .quads-highlight-ads { outline:6px solid #83c11f !important; }#wp-admin-bar-quads_ad_check_highlight_ads label {color:#b4b9be !important;}</style>
220
  <script type="text/javascript" src="<?php echo QUADS_PLUGIN_URL . 'assets/js/ads.js' ?>"></script>
221
  <script>
222
  (function (d, w) {
223
- var jquery_not_detected = typeof jQuery === 'undefined';
224
 
225
  var addEvent = function (obj, type, fn) {
226
  if (obj.addEventListener)
@@ -262,11 +262,11 @@ function quads_check_adblocker() {
262
  hide_fine = true;
263
  }
264
 
265
- if (jQuery_item && jquery_not_detected) {
266
- // show quads-hidden item
267
- jQuery_item.className = jQuery_item.className.replace(/quads-hidden/, '');
268
- hide_fine = true;
269
- }
270
 
271
  if (hide_fine && fine_item) {
272
  fine_item.className += ' quads-hidden';
215
  */
216
  function quads_check_adblocker() {
217
  ?>
218
+ <!--noptimize--><style>.quads-hidden { display: none; } .quads-adminbar-is-warnings { background: #abc116 ! important; color: #fff !important; }
219
  .quads-highlight-ads { outline:6px solid #83c11f !important; }#wp-admin-bar-quads_ad_check_highlight_ads label {color:#b4b9be !important;}</style>
220
  <script type="text/javascript" src="<?php echo QUADS_PLUGIN_URL . 'assets/js/ads.js' ?>"></script>
221
  <script>
222
  (function (d, w) {
223
+ //var jquery_not_detected = typeof jQuery === 'undefined';
224
 
225
  var addEvent = function (obj, type, fn) {
226
  if (obj.addEventListener)
262
  hide_fine = true;
263
  }
264
 
265
+ // if (jQuery_item && jquery_not_detected) {
266
+ // // show quads-hidden item
267
+ // jQuery_item.className = jQuery_item.className.replace(/quads-hidden/, '');
268
+ // hide_fine = true;
269
+ // }
270
 
271
  if (hide_fine && fine_item) {
272
  fine_item.className += ' quads-hidden';
includes/render-ad-functions.php CHANGED
@@ -170,9 +170,18 @@ function quads_render_desktop_js( $id, $default_ad_sizes ) {
170
  $html = '<ins class="adsbygoogle" style="' . $style . '"';
171
  $html .= ' data-ad-client="' . $quads_options['ads'][$id]['g_data_ad_client'] . '"';
172
  $html .= ' data-ad-slot="' . $quads_options['ads'][$id]['g_data_ad_slot'] . '" ' . $ad_format . '></ins>';
173
-
 
 
 
 
 
 
 
 
 
174
  if( !isset( $quads_options['ads'][$id][$adtype] ) and !empty( $default_ad_sizes[$id][$adtype.'_width'] ) and ! empty( $default_ad_sizes[$id][$adtype.'_height'] ) ) {
175
- $js = 'if ( quads_screen_width >= 1140 ) {
176
  /* desktop monitors */
177
  document.write(\'' . $html . '\');
178
  (adsbygoogle = window.adsbygoogle || []).push({});
@@ -225,6 +234,15 @@ function quads_render_tablet_landscape_js( $id, $default_ad_sizes ) {
225
  $html .= ' data-ad-client="' . $quads_options['ads'][$id]['g_data_ad_client'] . '"';
226
  $html .= ' data-ad-slot="' . $quads_options['ads'][$id]['g_data_ad_slot'] . '" ' . $ad_format . '></ins>';
227
 
 
 
 
 
 
 
 
 
 
228
  if( !isset( $quads_options['ads'][$id]['tablet_landscape'] ) and ! empty( $default_ad_sizes[$id][$adtype.'_width'] ) and ! empty( $default_ad_sizes[$id][$adtype.'_height'] ) ) {
229
  $js = 'if ( quads_screen_width >= 1024 && quads_screen_width < 1140 ) {
230
  /* tablet landscape */
@@ -278,13 +296,22 @@ function quads_render_tablet_portrait_js( $id, $default_ad_sizes ) {
278
  $html .= ' data-ad-client="' . $quads_options['ads'][$id]['g_data_ad_client'] . '"';
279
  $html .= ' data-ad-slot="' . $quads_options['ads'][$id]['g_data_ad_slot'] . '" ' . $ad_format . '></ins>';
280
 
 
 
 
 
 
 
 
 
 
281
  if( !isset( $quads_options['ads'][$id]['tablet_portrait'] ) and !empty( $default_ad_sizes[$id]['tbl_portrait_width'] ) and !empty( $default_ad_sizes[$id][$adtype.'_height'] ) ) {
282
- $js = 'if ( quads_screen_width >= 768 && quads_screen_width < 1024 ) {
283
  /* tablet portrait */
284
  document.write(\'' . $html . '\');
285
  (adsbygoogle = window.adsbygoogle || []).push({});
286
  }';
287
- return $js;
288
  }
289
  }
290
 
@@ -329,6 +356,16 @@ function quads_render_phone_js( $id, $default_ad_sizes ) {
329
  $html .= ' data-ad-client="' . $quads_options['ads'][$id]['g_data_ad_client'] . '"';
330
  $html .= ' data-ad-slot="' . $quads_options['ads'][$id]['g_data_ad_slot'] . '" ' . $ad_format . '></ins>';
331
 
 
 
 
 
 
 
 
 
 
 
332
  if( !isset( $quads_options['ads'][$id][$adtype] ) and ! empty( $default_ad_sizes[$id][$adtype.'_width'] ) and ! empty( $default_ad_sizes[$id][$adtype.'_height'] ) ) {
333
  $js = 'if ( quads_screen_width < 768 ) {
334
  /* phone */
170
  $html = '<ins class="adsbygoogle" style="' . $style . '"';
171
  $html .= ' data-ad-client="' . $quads_options['ads'][$id]['g_data_ad_client'] . '"';
172
  $html .= ' data-ad-slot="' . $quads_options['ads'][$id]['g_data_ad_slot'] . '" ' . $ad_format . '></ins>';
173
+
174
+ if (!quads_is_extra() && !empty( $default_ad_sizes[$id][$adtype.'_width'] ) and ! empty( $default_ad_sizes[$id][$adtype.'_height'])){
175
+ $js = 'if ( quads_screen_width >= 1140 ) {
176
+ /* desktop monitors */
177
+ document.write(\'' . $html . '\');
178
+ (adsbygoogle = window.adsbygoogle || []).push({});
179
+ }';
180
+ return $js;
181
+ }
182
+
183
  if( !isset( $quads_options['ads'][$id][$adtype] ) and !empty( $default_ad_sizes[$id][$adtype.'_width'] ) and ! empty( $default_ad_sizes[$id][$adtype.'_height'] ) ) {
184
+ $js = 'if ( quads_screen_width >= 1140 ) {
185
  /* desktop monitors */
186
  document.write(\'' . $html . '\');
187
  (adsbygoogle = window.adsbygoogle || []).push({});
234
  $html .= ' data-ad-client="' . $quads_options['ads'][$id]['g_data_ad_client'] . '"';
235
  $html .= ' data-ad-slot="' . $quads_options['ads'][$id]['g_data_ad_slot'] . '" ' . $ad_format . '></ins>';
236
 
237
+ if( !quads_is_extra() && ! empty( $default_ad_sizes[$id][$adtype.'_width'] ) and ! empty( $default_ad_sizes[$id][$adtype.'_height'] ) ) {
238
+ $js = 'if ( quads_screen_width >= 1024 && quads_screen_width < 1140 ) {
239
+ /* tablet landscape */
240
+ document.write(\'' . $html . '\');
241
+ (adsbygoogle = window.adsbygoogle || []).push({});
242
+ }';
243
+ return $js;
244
+ }
245
+
246
  if( !isset( $quads_options['ads'][$id]['tablet_landscape'] ) and ! empty( $default_ad_sizes[$id][$adtype.'_width'] ) and ! empty( $default_ad_sizes[$id][$adtype.'_height'] ) ) {
247
  $js = 'if ( quads_screen_width >= 1024 && quads_screen_width < 1140 ) {
248
  /* tablet landscape */
296
  $html .= ' data-ad-client="' . $quads_options['ads'][$id]['g_data_ad_client'] . '"';
297
  $html .= ' data-ad-slot="' . $quads_options['ads'][$id]['g_data_ad_slot'] . '" ' . $ad_format . '></ins>';
298
 
299
+ if( !quads_is_extra() and !empty( $default_ad_sizes[$id]['tbl_portrait_width'] ) and !empty( $default_ad_sizes[$id][$adtype.'_height'] ) ) {
300
+ $js = 'if ( quads_screen_width >= 768 && quads_screen_width < 1024 ) {
301
+ /* tablet portrait */
302
+ document.write(\'' . $html . '\');
303
+ (adsbygoogle = window.adsbygoogle || []).push({});
304
+ }';
305
+ return $js;
306
+ }
307
+
308
  if( !isset( $quads_options['ads'][$id]['tablet_portrait'] ) and !empty( $default_ad_sizes[$id]['tbl_portrait_width'] ) and !empty( $default_ad_sizes[$id][$adtype.'_height'] ) ) {
309
+ $js = 'if ( quads_screen_width >= 768 && quads_screen_width < 1024 ) {
310
  /* tablet portrait */
311
  document.write(\'' . $html . '\');
312
  (adsbygoogle = window.adsbygoogle || []).push({});
313
  }';
314
+ return $js;
315
  }
316
  }
317
 
356
  $html .= ' data-ad-client="' . $quads_options['ads'][$id]['g_data_ad_client'] . '"';
357
  $html .= ' data-ad-slot="' . $quads_options['ads'][$id]['g_data_ad_slot'] . '" ' . $ad_format . '></ins>';
358
 
359
+ if( !quads_is_extra() and ! empty( $default_ad_sizes[$id][$adtype.'_width'] ) and ! empty( $default_ad_sizes[$id][$adtype.'_height'] ) ) {
360
+ $js = 'if ( quads_screen_width < 768 ) {
361
+ /* phone */
362
+ document.write(\'' . $html . '\');
363
+ (adsbygoogle = window.adsbygoogle || []).push({});
364
+ }';
365
+ return $js;
366
+ }
367
+
368
+
369
  if( !isset( $quads_options['ads'][$id][$adtype] ) and ! empty( $default_ad_sizes[$id][$adtype.'_width'] ) and ! empty( $default_ad_sizes[$id][$adtype.'_height'] ) ) {
370
  $js = 'if ( quads_screen_width < 768 ) {
371
  /* phone */
includes/scripts.php CHANGED
@@ -12,8 +12,9 @@
12
  if( !defined( 'ABSPATH' ) )
13
  exit;
14
 
15
- add_action( 'wp_enqueue_scripts', 'quads_register_styles', 10 );
16
  add_action( 'wp_print_styles', 'quads_inline_styles', 9999 );
 
17
  add_action( 'admin_enqueue_scripts', 'quads_load_admin_scripts', 100 );
18
  add_action( 'admin_enqueue_scripts', 'quads_load_plugins_admin_scripts', 100 );
19
  add_action('admin_print_footer_scripts', 'quads_check_ad_blocker');
@@ -113,14 +114,15 @@ function quads_load_plugins_admin_scripts( $hook ) {
113
  * @global $mashsb_options
114
  * @return void
115
  */
116
- function quads_register_styles( $hook ) {
117
- global $quads_options;
118
-
119
- // Register empty quads.css to be able to register quads_inline_styles()
120
- $url = QUADS_PLUGIN_URL . 'assets/css/quads.css';
121
-
122
- wp_enqueue_style( 'quads-styles', $url, array(), QUADS_VERSION );
123
- }
 
124
 
125
  /**
126
  * Add dynamic CSS to write media queries for removing unwanted ads without the need to use any cache busting method
@@ -142,8 +144,11 @@ function quads_inline_styles() {
142
  $css .= quads_render_media_query( $key, $value );
143
  }
144
  }
145
-
146
-
 
 
 
147
  wp_add_inline_style( 'quads-styles', $css );
148
  }
149
 
@@ -155,11 +160,14 @@ function quads_inline_styles() {
155
  * @return string
156
  */
157
  function quads_render_media_query($key, $value){
 
 
 
 
158
 
159
  $html = '';
160
 
161
  if (isset($value['desktop']) ){
162
- //$html .= '@media only screen and (min-width:1140px){.quads-'.$key.' {display:none;}}'. "\n";
163
  //$html .= '/* Hide on desktop */';
164
  $html .= '@media only screen and (min-width:1140px){#quads-'.$key.', .quads-' . $key . ' {display:none;}}'. "\n";
165
  }
12
  if( !defined( 'ABSPATH' ) )
13
  exit;
14
 
15
+ //add_action( 'wp_enqueue_scripts', 'quads_register_styles', 10 );
16
  add_action( 'wp_print_styles', 'quads_inline_styles', 9999 );
17
+
18
  add_action( 'admin_enqueue_scripts', 'quads_load_admin_scripts', 100 );
19
  add_action( 'admin_enqueue_scripts', 'quads_load_plugins_admin_scripts', 100 );
20
  add_action('admin_print_footer_scripts', 'quads_check_ad_blocker');
114
  * @global $mashsb_options
115
  * @return void
116
  */
117
+ //function quads_register_styles( $hook ) {
118
+ // global $quads_options;
119
+ //
120
+ // // Register empty quads.css to be able to register quads_inline_styles()
121
+ // //$url = QUADS_PLUGIN_URL . 'assets/css/quads.css';
122
+ //
123
+ // //wp_enqueue_style( 'quads-styles', $url, array(), QUADS_VERSION );
124
+ // wp_enqueue_style( 'quads-styles', false );
125
+ //}
126
 
127
  /**
128
  * Add dynamic CSS to write media queries for removing unwanted ads without the need to use any cache busting method
144
  $css .= quads_render_media_query( $key, $value );
145
  }
146
  }
147
+ // Register empty style so we do not need an external css file
148
+ wp_register_style( 'quads-styles', false );
149
+ // Enque empty style
150
+ wp_enqueue_style( 'quads-styles' );
151
+ // Add inline css to that style
152
  wp_add_inline_style( 'quads-styles', $css );
153
  }
154
 
160
  * @return string
161
  */
162
  function quads_render_media_query($key, $value){
163
+ $lic = get_option( 'quads_wp_quads_pro_license_active' );
164
+ if( !$lic || (is_object( $lic ) && $lic->success !== true) ) {
165
+ return '';
166
+ }
167
 
168
  $html = '';
169
 
170
  if (isset($value['desktop']) ){
 
171
  //$html .= '/* Hide on desktop */';
172
  $html .= '@media only screen and (min-width:1140px){#quads-'.$key.', .quads-' . $key . ' {display:none;}}'. "\n";
173
  }
quick-adsense-reloaded.php CHANGED
@@ -6,7 +6,7 @@
6
  * Description: Insert Google AdSense or any Ads code into your website. A fork of Quick AdSense
7
  * Author: Rene Hermenau, WP-Staging
8
  * Author URI: https://wordpress.org/plugins/quick-adsense-reloaded/
9
- * Version: 1.5.6
10
  * Text Domain: quick-adsense-reloaded
11
  * Domain Path: languages
12
  * Credits: WP QUADS - Quick AdSense Reloaded is a fork of Quick AdSense
@@ -35,7 +35,7 @@ if( !defined( 'ABSPATH' ) )
35
 
36
  // Plugin version
37
  if( !defined( 'QUADS_VERSION' ) ) {
38
- define( 'QUADS_VERSION', '1.5.6' );
39
  }
40
 
41
  // Plugin name
@@ -200,6 +200,8 @@ if( !class_exists( 'QuickAdsenseReloaded' ) ) :
200
  require_once QUADS_PLUGIN_DIR . 'includes/helper-functions.php';
201
  require_once QUADS_PLUGIN_DIR . 'includes/conditions.php';
202
  require_once QUADS_PLUGIN_DIR . 'includes/frontend-checks.php';
 
 
203
 
204
  if( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
205
  require_once QUADS_PLUGIN_DIR . 'includes/admin/add-ons.php';
@@ -293,6 +295,11 @@ if( !class_exists( 'QuickAdsenseReloaded' ) ) :
293
  * @return void
294
  */
295
  public static function during_activation() {
 
 
 
 
 
296
 
297
  // Add Upgraded From Option
298
  $current_version = get_option( 'quads_version' );
6
  * Description: Insert Google AdSense or any Ads code into your website. A fork of Quick AdSense
7
  * Author: Rene Hermenau, WP-Staging
8
  * Author URI: https://wordpress.org/plugins/quick-adsense-reloaded/
9
+ * Version: 1.5.7
10
  * Text Domain: quick-adsense-reloaded
11
  * Domain Path: languages
12
  * Credits: WP QUADS - Quick AdSense Reloaded is a fork of Quick AdSense
35
 
36
  // Plugin version
37
  if( !defined( 'QUADS_VERSION' ) ) {
38
+ define( 'QUADS_VERSION', '1.5.7' );
39
  }
40
 
41
  // Plugin name
200
  require_once QUADS_PLUGIN_DIR . 'includes/helper-functions.php';
201
  require_once QUADS_PLUGIN_DIR . 'includes/conditions.php';
202
  require_once QUADS_PLUGIN_DIR . 'includes/frontend-checks.php';
203
+ require_once QUADS_PLUGIN_DIR . 'includes/Cron/Cron.php';
204
+
205
 
206
  if( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
207
  require_once QUADS_PLUGIN_DIR . 'includes/admin/add-ons.php';
295
  * @return void
296
  */
297
  public static function during_activation() {
298
+
299
+ // Add cron event
300
+ require_once plugin_dir_path( __FILE__ ) . 'includes/Cron/Cron.php';
301
+ $cron = new quadsCron();
302
+ $cron->schedule_event();
303
 
304
  // Add Upgraded From Option
305
  $current_version = get_option( 'quads_version' );
readme.txt CHANGED
@@ -9,7 +9,7 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Tags: adsense, ads, ad, google adsense, advertising, amp, ad injection, ad inserter, ad manager
10
  Requires at least: 3.6+
11
  Tested up to: 4.8
12
- Stable tag: 1.5.6
13
 
14
  Quick Adsense Reloaded! Quickest way to insert Google AdSense & other ads into your website. Google AdSense integration with Google AMP support
15
 
@@ -129,6 +129,15 @@ Alternative Installation:
129
 
130
  == Changelog ==
131
 
 
 
 
 
 
 
 
 
 
132
  = 1.5.6 =
133
  * Fix: License tab not shown after update of WP QUADS to version 1.5.5 and WP QUADS PRO is lower than version 1.3.3
134
  * Fix: Quicktags button in editor not shown
9
  Tags: adsense, ads, ad, google adsense, advertising, amp, ad injection, ad inserter, ad manager
10
  Requires at least: 3.6+
11
  Tested up to: 4.8
12
+ Stable tag: 1.5.7
13
 
14
  Quick Adsense Reloaded! Quickest way to insert Google AdSense & other ads into your website. Google AdSense integration with Google AMP support
15
 
129
 
130
  == Changelog ==
131
 
132
+ = 1.5.7 =
133
+ * Tweak: Remove external empty quads.css file
134
+ * Tweak: Better wordings for ad blocker notice
135
+ * Tweak: Make code more robust
136
+ * Tweak: Simpler notice for renewing license keys
137
+ * Tweak: Change admin bar warning color from red to a more suitable orange
138
+ * Fix: Remove jQuery frontpage check
139
+ * Fix: Rating notice not hiding
140
+
141
  = 1.5.6 =
142
  * Fix: License tab not shown after update of WP QUADS to version 1.5.5 and WP QUADS PRO is lower than version 1.3.3
143
  * Fix: Quicktags button in editor not shown