AdSense Plugin WP QUADS - Version 1.5.9

Version Description

Download this release

Release Info

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

Code changes from version 1.5.8 to 1.5.9

includes/template-functions.php CHANGED
@@ -104,12 +104,6 @@ function quads_process_content( $content ) {
104
  return $content;
105
  }
106
 
107
- // placeholder string for random ad
108
- //$cusrnd = 'CusRnd';
109
-
110
- // placeholder string for custom ad spots
111
- //$cusads = 'CusAds';
112
-
113
  // Array of ad codes ids
114
  $adsArray = quads_get_active_ads();
115
 
@@ -170,17 +164,32 @@ function quads_get_active_ads() {
170
  global $quads_options;
171
 
172
  // Max amount of different content ads we can have
173
- $numberAds = 10;
 
 
174
 
175
- $adsArray = array();
 
 
 
176
 
177
  // Array of ad codes
178
- for ( $i = 1; $i <= $numberAds; $i++ ) {
 
 
 
 
 
 
 
 
 
179
  $tmp = isset( $quads_options['ads']['ad' . $i]['code'] ) ? trim( $quads_options['ads']['ad' . $i]['code'] ) : '';
180
  // id is valid if there is either the plain text field populated or the adsense ad slot and the ad client id
181
  if( !empty( $tmp ) || (!empty( $quads_options['ads']['ad' . $i]['g_data_ad_slot'] ) && !empty( $quads_options['ads']['ad' . $i]['g_data_ad_client'] ) ) ) {
182
  $adsArray[] = $i;
183
  }
 
184
  }
185
  //wp_die(count($adsArray));
186
  return (count($adsArray) > 0) ? $adsArray : 0;
@@ -636,9 +645,9 @@ function quads_parse_default_ads( $content ) {
636
  $adsRandom = $adsArray;
637
 
638
  // echo '<pre>';
639
- // echo 'adsArrayCus';
640
  // print_r($adsArrayCus);
641
- // echo 'adsArray';
642
  // print_r( $adsArray );
643
  // echo '</pre>';
644
 
104
  return $content;
105
  }
106
 
 
 
 
 
 
 
107
  // Array of ad codes ids
108
  $adsArray = quads_get_active_ads();
109
 
164
  global $quads_options;
165
 
166
  // Max amount of different content ads we can have
167
+ //$numberAds = 20;
168
+
169
+ //$adsArray = array();
170
 
171
+ // Return early
172
+ if (empty($quads_options['ads'])){
173
+ return 0;
174
+ }
175
 
176
  // Array of ad codes
177
+ // for ( $i = 1; $i <= $numberAds; $i++ ) {
178
+ // $tmp = isset( $quads_options['ads']['ad' . $i]['code'] ) ? trim( $quads_options['ads']['ad' . $i]['code'] ) : '';
179
+ // // id is valid if there is either the plain text field populated or the adsense ad slot and the ad client id
180
+ // if( !empty( $tmp ) || (!empty( $quads_options['ads']['ad' . $i]['g_data_ad_slot'] ) && !empty( $quads_options['ads']['ad' . $i]['g_data_ad_client'] ) ) ) {
181
+ // $adsArray[] = $i;
182
+ // }
183
+ // }
184
+ // count valid ads
185
+ $i = 0;
186
+ foreach ( $quads_options['ads'] as $ads) {
187
  $tmp = isset( $quads_options['ads']['ad' . $i]['code'] ) ? trim( $quads_options['ads']['ad' . $i]['code'] ) : '';
188
  // id is valid if there is either the plain text field populated or the adsense ad slot and the ad client id
189
  if( !empty( $tmp ) || (!empty( $quads_options['ads']['ad' . $i]['g_data_ad_slot'] ) && !empty( $quads_options['ads']['ad' . $i]['g_data_ad_client'] ) ) ) {
190
  $adsArray[] = $i;
191
  }
192
+ $i++;
193
  }
194
  //wp_die(count($adsArray));
195
  return (count($adsArray) > 0) ? $adsArray : 0;
645
  $adsRandom = $adsArray;
646
 
647
  // echo '<pre>';
648
+ // echo 'adsArrayCus: ';
649
  // print_r($adsArrayCus);
650
+ // echo 'adsArray: ';
651
  // print_r( $adsArray );
652
  // echo '</pre>';
653
 
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.8
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.8' );
39
  }
40
 
41
  // Plugin name
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.9
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.9' );
39
  }
40
 
41
  // Plugin name
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.8
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,8 +129,10 @@ Alternative Installation:
129
 
130
  == Changelog ==
131
 
 
 
132
  = 1.5.8 =
133
- * New: Compatible to all AMP plugin, not limited only to automattics AMP plugin
134
 
135
  = 1.5.7 =
136
  * Tweak: Remove external empty quads.css file
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.9
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.9 =
133
+
134
  = 1.5.8 =
135
+ * Fix: Not more than 10 adsense ads at the same time possible
136
 
137
  = 1.5.7 =
138
  * Tweak: Remove external empty quads.css file