Advanced Ads - Version 1.30.5

Version Description

  • Fix: correct ad weight calculation if ad count in group is retained but ad ids change
Download this release

Release Info

Developer advancedads
Plugin Icon 128x128 Advanced Ads
Version 1.30.5
Comparing to
See all releases

Code changes from version 1.30.4 to 1.30.5

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.4
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.4' );
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.5
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.5' );
43
 
44
  // Autoloading, modules and functions.
45
 
classes/ad_group.php CHANGED
@@ -487,11 +487,9 @@ class Advanced_Ads_Group {
487
  asort( $this->ad_weights );
488
 
489
  // add ads whose weight has not yet been saved with the default value.
490
- if ( count( $ad_ids ) > count( $this->ad_weights ) ) {
491
- foreach ( $ad_ids as $ad_id ) {
492
- if ( ! array_key_exists( $ad_id, $this->ad_weights ) ) {
493
- $this->ad_weights[ $ad_id ] = self::MAX_AD_GROUP_DEFAULT_WEIGHT;
494
- }
495
  }
496
  }
497
 
487
  asort( $this->ad_weights );
488
 
489
  // add ads whose weight has not yet been saved with the default value.
490
+ foreach ( $ad_ids as $ad_id ) {
491
+ if ( ! array_key_exists( $ad_id, $this->ad_weights ) ) {
492
+ $this->ad_weights[ $ad_id ] = self::MAX_AD_GROUP_DEFAULT_WEIGHT;
 
 
493
  }
494
  }
495
 
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.4\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:05:35+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.5\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-16T09:41:32+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
@@ -4,7 +4,7 @@ Tags: ads, ad manager, ad rotation, adsense, banner
4
  Requires at least: 4.9
5
  Tested up to: 5.8
6
  Requires PHP: 5.6
7
- Stable tag: 1.30.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -322,6 +322,10 @@ Yes. You can use plenty of [hooks](https://wpadvancedads.com/codex/) to customiz
322
 
323
  == Changelog ==
324
 
 
 
 
 
325
  = 1.30.4 =
326
 
327
  - Fix: prevent overriding of ads' weight `0` in ad groups
4
  Requires at least: 4.9
5
  Tested up to: 5.8
6
  Requires PHP: 5.6
7
+ Stable tag: 1.30.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
322
 
323
  == Changelog ==
324
 
325
+ = 1.30.5 =
326
+
327
+ - Fix: correct ad weight calculation if ad count in group is retained but ad ids change
328
+
329
  = 1.30.4 =
330
 
331
  - Fix: prevent overriding of ads' weight `0` in ad groups