Advanced Ads - Version 1.30.4-rc.1

Version Description

Download this release

Release Info

Developer advancedads
Plugin Icon 128x128 Advanced Ads
Version 1.30.4-rc.1
Comparing to
See all releases

Code changes from version 1.30.3 to 1.30.4-rc.1

advanced-ads.php CHANGED
@@ -12,7 +12,7 @@
12
  * Plugin Name: Advanced Ads
13
  * Plugin URI: https://wpadvancedads.com
14
  * Description: Manage and optimize your ads in WordPress
15
- * Version: 1.30.3
16
  * Author: Thomas Maier, Advanced Ads GmbH
17
  * Author URI: https://wpadvancedads.com
18
  * Text Domain: advanced-ads
@@ -39,7 +39,7 @@ define( 'ADVADS_BASE_DIR', dirname( ADVADS_BASE ) ); // directory of the plugin
39
  // general and global slug, e.g. to store options in WP.
40
  define( 'ADVADS_SLUG', 'advanced-ads' );
41
  define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
42
- define( 'ADVADS_VERSION', '1.30.3' );
43
 
44
  // Autoloading, modules and functions.
45
 
12
  * Plugin Name: Advanced Ads
13
  * Plugin URI: https://wpadvancedads.com
14
  * Description: Manage and optimize your ads in WordPress
15
+ * Version: 1.30.4-rc.1
16
  * Author: Thomas Maier, Advanced Ads GmbH
17
  * Author URI: https://wpadvancedads.com
18
  * Text Domain: advanced-ads
39
  // general and global slug, e.g. to store options in WP.
40
  define( 'ADVADS_SLUG', 'advanced-ads' );
41
  define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
42
+ define( 'ADVADS_VERSION', '1.30.4-rc.1' );
43
 
44
  // Autoloading, modules and functions.
45
 
classes/ad_group.php CHANGED
@@ -288,6 +288,14 @@ class Advanced_Ads_Group {
288
 
289
  // get ad weights serving as an order here
290
  $weights = $this->get_ad_weights( array_keys( $ads ) );
 
 
 
 
 
 
 
 
291
 
292
  // order ads based on group type
293
  if ( $this->type === 'ordered' ) {
@@ -487,13 +495,6 @@ class Advanced_Ads_Group {
487
  }
488
  }
489
 
490
- // remove ads with 0 ad weight and unavailable ads (e.g. drafts).
491
- foreach ( $this->ad_weights as $ad_id => $ad_weight ) {
492
- if ( $ad_weight === 0 || ! in_array( $ad_id, $ad_ids, true ) ) {
493
- unset( $this->ad_weights[ $ad_id ] );
494
- }
495
- }
496
-
497
  return $this->ad_weights;
498
  }
499
 
288
 
289
  // get ad weights serving as an order here
290
  $weights = $this->get_ad_weights( array_keys( $ads ) );
291
+ $ad_ids = wp_list_pluck( $ads, 'ID' );
292
+
293
+ // remove ads with 0 ad weight and unavailable ads (e.g. drafts).
294
+ foreach ( $weights as $ad_id => $ad_weight ) {
295
+ if ( $ad_weight === 0 || ! in_array( $ad_id, $ad_ids, true ) ) {
296
+ unset( $weights[ $ad_id ] );
297
+ }
298
+ }
299
 
300
  // order ads based on group type
301
  if ( $this->type === 'ordered' ) {
495
  }
496
  }
497
 
 
 
 
 
 
 
 
498
  return $this->ad_weights;
499
  }
500
 
languages/advanced-ads.pot CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the Advanced Ads plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Advanced Ads 1.30.3\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/advanced-ads/\n"
7
  "Last-Translator: Thomas Maier <post@webzunft.de>\n"
8
  "Language-Team: webgilde <support@wpadvancedads.com>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2021-12-01T09:40:52+01:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: advanced-ads\n"
2
  # This file is distributed under the same license as the Advanced Ads plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Advanced Ads 1.30.4-rc.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/advanced-ads/\n"
7
  "Last-Translator: Thomas Maier <post@webzunft.de>\n"
8
  "Language-Team: webgilde <support@wpadvancedads.com>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2021-12-03T14:02:18+01:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: advanced-ads\n"
readme.txt CHANGED
@@ -322,6 +322,10 @@ Yes. You can use plenty of [hooks](https://wpadvancedads.com/codex/) to customiz
322
 
323
  == Changelog ==
324
 
 
 
 
 
325
  = 1.30.3 =
326
 
327
  - Fix: properly output HTML attributes for TCF 2.0 script tag
322
 
323
  == Changelog ==
324
 
325
+ = untagged =
326
+
327
+ - Fix: prevent overriding of ads' weight `0` in ad groups
328
+
329
  = 1.30.3 =
330
 
331
  - Fix: properly output HTML attributes for TCF 2.0 script tag