Changeset 3055119
- Timestamp:
- 03/20/2024 09:38:04 AM (21 months ago)
- Location:
- advanced-ads
- Files:
-
- 12 edited
- 1 copied
-
tags/1.51.3 (copied) (copied from advanced-ads/trunk)
-
tags/1.51.3/admin/includes/class-meta-box.php (modified) (1 diff)
-
tags/1.51.3/advanced-ads.php (modified) (2 diffs)
-
tags/1.51.3/includes/admin/class-groups-list-table.php (modified) (2 diffs)
-
tags/1.51.3/languages/advanced-ads.pot (modified) (6 diffs)
-
tags/1.51.3/readme.txt (modified) (2 diffs)
-
tags/1.51.3/views/admin/tables/groups/list-row-loop.php (modified) (1 diff)
-
trunk/admin/includes/class-meta-box.php (modified) (1 diff)
-
trunk/advanced-ads.php (modified) (2 diffs)
-
trunk/includes/admin/class-groups-list-table.php (modified) (2 diffs)
-
trunk/languages/advanced-ads.pot (modified) (6 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/views/admin/tables/groups/list-row-loop.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
advanced-ads/tags/1.51.3/admin/includes/class-meta-box.php
r3041809 r3055119 301 301 $advads_gadsense_options['hidden'] = ! $unit_code; 302 302 $view = 'gadsense-dashboard.php'; 303 $pub_id = Advanced_Ads_AdSense_Data::get_instance()->get_adsense_id(); 303 304 $hndlelinks = '<a href="' . esc_url( admin_url( 'admin.php?page=advanced-ads-settings#top#adsense' ) ) . '" target="_blank">' . __( 'Disable', 'advanced-ads' ) . '</a>'; 304 305 break; -
advanced-ads/tags/1.51.3/advanced-ads.php
r3050336 r3055119 13 13 * Plugin URI: https://wpadvancedads.com 14 14 * Description: Manage and optimize your ads in WordPress 15 * Version: 1.51. 215 * Version: 1.51.3 16 16 * Author: Advanced Ads GmbH 17 17 * Author URI: https://wpadvancedads.com … … 34 34 35 35 define( 'ADVADS_FILE', __FILE__ ); 36 define( 'ADVADS_VERSION', '1.51. 2' );36 define( 'ADVADS_VERSION', '1.51.3' ); 37 37 38 38 // Load the autoloader. -
advanced-ads/tags/1.51.3/includes/admin/class-groups-list-table.php
r3006148 r3055119 368 368 */ 369 369 private function render_edit_modal( $group ): void { 370 $group_ads_info = $this->get_group_ads_info( $group );370 $group_ads_info = $this->get_group_ads_info( $group, 'modal' ); 371 371 $ads = $group_ads_info['ads'] ?? null; 372 372 $weights = $group_ads_info['weights'] ?? null; … … 465 465 466 466 /** 467 * Get ads information for this group 467 * Get ads information for this group. 468 468 * 469 469 * @param Advanced_Ads_Group $group group object. 470 470 * 471 * @return WP_Query 472 */ 473 private function get_group_ads_info( $group ) { 474 if ( isset( $this->group_ads_info[ $group->id ] ) ) { 475 return $this->group_ads_info[ $group->id ]; 476 } 471 * @return array 472 */ 473 private function get_group_ads_info( $group, $view = 'list' ) { 474 /* TODO: reenable the following caching mechanism when switching to AA 2.0 */ 475 // if ( isset( $this->group_ads_info[ $group->id ] ) ) { 476 // return $this->group_ads_info[ $group->id ]; 477 // } 477 478 478 479 $weights = $group->get_ad_weights(); 479 480 $sorted_ad_ids = array_keys( $weights ); 481 $args = [ 480 $args = [ 482 481 'post_type' => Entities::POST_TYPE_AD, 483 482 'post_status' => [ 'publish', 'future', 'pending', 'private' ], 484 483 'taxonomy' => $group->taxonomy, 485 484 'term' => $group->slug, 486 'posts_per_page' => - 1,485 'posts_per_page' => -1, 487 486 ]; 488 487 489 $ads = new WP_Query( $args ); 490 491 $ad_ids = wp_list_pluck( $ads->posts, 'ID' ); 492 493 $weights = array_reduce( $ads->posts, function( $carry, $item ) use ( $weights ) { 494 $weight = $weights[$item->ID] ?? Advanced_Ads_Group::MAX_AD_GROUP_DEFAULT_WEIGHT; 495 $carry[ $item->ID ] = $item->post_status === 'publish' ? $weight : 0; 488 $ads = new WP_Query( $args ); 489 $ad_ids = wp_list_pluck( $ads->posts, 'ID' ); 490 491 $weights = array_reduce( $ads->posts, function( $carry, $item ) use ( $weights, $view ) { 492 $weight = $weights[ $item->ID ] ?? Advanced_Ads_Group::MAX_AD_GROUP_DEFAULT_WEIGHT; 493 $carry[ $item->ID ] = ( $view === 'modal' || $item->post_status === 'publish' ) ? $weight : 0; 496 494 497 495 return $carry; -
advanced-ads/tags/1.51.3/languages/advanced-ads.pot
r3050336 r3055119 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Advanced Ads 1.51. 1\n"5 "Project-Id-Version: Advanced Ads 1.51.2\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/advanced-ads/\n" 7 7 "Last-Translator: Thomas Maier <[email protected]>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2024-03- 13T09:10:08+00:00\n"12 "POT-Creation-Date: 2024-03-20T09:37:32+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.6.0\n" … … 16 16 17 17 #. Plugin Name of the plugin 18 #: admin/includes/class-meta-box.php:56 418 #: admin/includes/class-meta-box.php:565 19 19 #: modules/gutenberg/includes/class-gutenberg.php:136 20 20 msgid "Advanced Ads" … … 518 518 msgstr "" 519 519 520 #: admin/includes/class-meta-box.php:30 3520 #: admin/includes/class-meta-box.php:304 521 521 #: admin/includes/class-overview-widgets.php:64 522 522 msgid "Disable" 523 523 msgstr "" 524 524 525 #: admin/includes/class-meta-box.php:46 5525 #: admin/includes/class-meta-box.php:466 526 526 msgid "Ad Settings" 527 527 msgstr "" 528 528 529 529 #. translators: %1$d is the number of ads, %2$s and %3$s are URLs. 530 #: admin/includes/class-meta-box.php:58 0530 #: admin/includes/class-meta-box.php:581 531 531 msgid "%1$d ads – <a href=\"%2$s\">manage</a> - <a href=\"%3$s\">new</a>" 532 532 msgstr "" 533 533 534 #: admin/includes/class-meta-box.php:59 3534 #: admin/includes/class-meta-box.php:594 535 535 msgid "Get the tutorial via email" 536 536 msgstr "" 537 537 538 #: admin/includes/class-meta-box.php:60 2538 #: admin/includes/class-meta-box.php:603 539 539 msgid "Get AdSense tips via email" 540 540 msgstr "" 541 541 542 #: admin/includes/class-meta-box.php:61 1542 #: admin/includes/class-meta-box.php:612 543 543 msgid "Visit our blog for more articles about ad optimization" 544 544 msgstr "" 545 545 546 546 #. translators: %s is our URL. 547 #: admin/includes/class-meta-box.php:66 6547 #: admin/includes/class-meta-box.php:667 548 548 msgid "Latest posts on wpadvancedads.com" 549 549 msgstr "" … … 2877 2877 2878 2878 #. translators: amount of ads displayed 2879 #: includes/admin/class-groups-list-table.php:52 82879 #: includes/admin/class-groups-list-table.php:526 2880 2880 msgid "Up to %d ad displayed." 2881 2881 msgid_plural "Up to %d ads displayed" … … 4572 4572 4573 4573 #. translators: %d is a number. 4574 #: views/admin/tables/groups/list-row-loop.php: 384574 #: views/admin/tables/groups/list-row-loop.php:42 4575 4575 msgid "show %d more ads" 4576 4576 msgstr "" -
advanced-ads/tags/1.51.3/readme.txt
r3050336 r3055119 5 5 Tested up to: 6.4 6 6 Requires PHP: 7.2 7 Stable tag: 1.51. 27 Stable tag: 1.51.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 339 339 == Changelog == 340 340 341 = 1.51.3 (March 20, 2024) = 342 343 - Fix: prevent weight reset to 0 for resaved scheduled ads 344 - Fix: correct issue with AdSense metabox on ad edit page 345 341 346 = 1.51.2 (March 13, 2024) = 342 347 -
advanced-ads/tags/1.51.3/views/admin/tables/groups/list-row-loop.php
r2983598 r3055119 9 9 * @var int[] $weights All weights. 10 10 * @var int $weight_sum Sum of all ad weights. 11 * @var Groups_List_Table $this The group terms list table class. 12 * @var WP_Query $ads The query object to fetch all ads inside that group. 11 13 */ 14 15 use AdvancedAds\Admin\Groups_List_Table; 12 16 13 17 $i = 1; -
advanced-ads/trunk/admin/includes/class-meta-box.php
r3041809 r3055119 301 301 $advads_gadsense_options['hidden'] = ! $unit_code; 302 302 $view = 'gadsense-dashboard.php'; 303 $pub_id = Advanced_Ads_AdSense_Data::get_instance()->get_adsense_id(); 303 304 $hndlelinks = '<a href="' . esc_url( admin_url( 'admin.php?page=advanced-ads-settings#top#adsense' ) ) . '" target="_blank">' . __( 'Disable', 'advanced-ads' ) . '</a>'; 304 305 break; -
advanced-ads/trunk/advanced-ads.php
r3050336 r3055119 13 13 * Plugin URI: https://wpadvancedads.com 14 14 * Description: Manage and optimize your ads in WordPress 15 * Version: 1.51. 215 * Version: 1.51.3 16 16 * Author: Advanced Ads GmbH 17 17 * Author URI: https://wpadvancedads.com … … 34 34 35 35 define( 'ADVADS_FILE', __FILE__ ); 36 define( 'ADVADS_VERSION', '1.51. 2' );36 define( 'ADVADS_VERSION', '1.51.3' ); 37 37 38 38 // Load the autoloader. -
advanced-ads/trunk/includes/admin/class-groups-list-table.php
r3006148 r3055119 368 368 */ 369 369 private function render_edit_modal( $group ): void { 370 $group_ads_info = $this->get_group_ads_info( $group );370 $group_ads_info = $this->get_group_ads_info( $group, 'modal' ); 371 371 $ads = $group_ads_info['ads'] ?? null; 372 372 $weights = $group_ads_info['weights'] ?? null; … … 465 465 466 466 /** 467 * Get ads information for this group 467 * Get ads information for this group. 468 468 * 469 469 * @param Advanced_Ads_Group $group group object. 470 470 * 471 * @return WP_Query 472 */ 473 private function get_group_ads_info( $group ) { 474 if ( isset( $this->group_ads_info[ $group->id ] ) ) { 475 return $this->group_ads_info[ $group->id ]; 476 } 471 * @return array 472 */ 473 private function get_group_ads_info( $group, $view = 'list' ) { 474 /* TODO: reenable the following caching mechanism when switching to AA 2.0 */ 475 // if ( isset( $this->group_ads_info[ $group->id ] ) ) { 476 // return $this->group_ads_info[ $group->id ]; 477 // } 477 478 478 479 $weights = $group->get_ad_weights(); 479 480 $sorted_ad_ids = array_keys( $weights ); 481 $args = [ 480 $args = [ 482 481 'post_type' => Entities::POST_TYPE_AD, 483 482 'post_status' => [ 'publish', 'future', 'pending', 'private' ], 484 483 'taxonomy' => $group->taxonomy, 485 484 'term' => $group->slug, 486 'posts_per_page' => - 1,485 'posts_per_page' => -1, 487 486 ]; 488 487 489 $ads = new WP_Query( $args ); 490 491 $ad_ids = wp_list_pluck( $ads->posts, 'ID' ); 492 493 $weights = array_reduce( $ads->posts, function( $carry, $item ) use ( $weights ) { 494 $weight = $weights[$item->ID] ?? Advanced_Ads_Group::MAX_AD_GROUP_DEFAULT_WEIGHT; 495 $carry[ $item->ID ] = $item->post_status === 'publish' ? $weight : 0; 488 $ads = new WP_Query( $args ); 489 $ad_ids = wp_list_pluck( $ads->posts, 'ID' ); 490 491 $weights = array_reduce( $ads->posts, function( $carry, $item ) use ( $weights, $view ) { 492 $weight = $weights[ $item->ID ] ?? Advanced_Ads_Group::MAX_AD_GROUP_DEFAULT_WEIGHT; 493 $carry[ $item->ID ] = ( $view === 'modal' || $item->post_status === 'publish' ) ? $weight : 0; 496 494 497 495 return $carry; -
advanced-ads/trunk/languages/advanced-ads.pot
r3050336 r3055119 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Advanced Ads 1.51. 1\n"5 "Project-Id-Version: Advanced Ads 1.51.2\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/advanced-ads/\n" 7 7 "Last-Translator: Thomas Maier <[email protected]>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2024-03- 13T09:10:08+00:00\n"12 "POT-Creation-Date: 2024-03-20T09:37:32+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.6.0\n" … … 16 16 17 17 #. Plugin Name of the plugin 18 #: admin/includes/class-meta-box.php:56 418 #: admin/includes/class-meta-box.php:565 19 19 #: modules/gutenberg/includes/class-gutenberg.php:136 20 20 msgid "Advanced Ads" … … 518 518 msgstr "" 519 519 520 #: admin/includes/class-meta-box.php:30 3520 #: admin/includes/class-meta-box.php:304 521 521 #: admin/includes/class-overview-widgets.php:64 522 522 msgid "Disable" 523 523 msgstr "" 524 524 525 #: admin/includes/class-meta-box.php:46 5525 #: admin/includes/class-meta-box.php:466 526 526 msgid "Ad Settings" 527 527 msgstr "" 528 528 529 529 #. translators: %1$d is the number of ads, %2$s and %3$s are URLs. 530 #: admin/includes/class-meta-box.php:58 0530 #: admin/includes/class-meta-box.php:581 531 531 msgid "%1$d ads – <a href=\"%2$s\">manage</a> - <a href=\"%3$s\">new</a>" 532 532 msgstr "" 533 533 534 #: admin/includes/class-meta-box.php:59 3534 #: admin/includes/class-meta-box.php:594 535 535 msgid "Get the tutorial via email" 536 536 msgstr "" 537 537 538 #: admin/includes/class-meta-box.php:60 2538 #: admin/includes/class-meta-box.php:603 539 539 msgid "Get AdSense tips via email" 540 540 msgstr "" 541 541 542 #: admin/includes/class-meta-box.php:61 1542 #: admin/includes/class-meta-box.php:612 543 543 msgid "Visit our blog for more articles about ad optimization" 544 544 msgstr "" 545 545 546 546 #. translators: %s is our URL. 547 #: admin/includes/class-meta-box.php:66 6547 #: admin/includes/class-meta-box.php:667 548 548 msgid "Latest posts on wpadvancedads.com" 549 549 msgstr "" … … 2877 2877 2878 2878 #. translators: amount of ads displayed 2879 #: includes/admin/class-groups-list-table.php:52 82879 #: includes/admin/class-groups-list-table.php:526 2880 2880 msgid "Up to %d ad displayed." 2881 2881 msgid_plural "Up to %d ads displayed" … … 4572 4572 4573 4573 #. translators: %d is a number. 4574 #: views/admin/tables/groups/list-row-loop.php: 384574 #: views/admin/tables/groups/list-row-loop.php:42 4575 4575 msgid "show %d more ads" 4576 4576 msgstr "" -
advanced-ads/trunk/readme.txt
r3050336 r3055119 5 5 Tested up to: 6.4 6 6 Requires PHP: 7.2 7 Stable tag: 1.51. 27 Stable tag: 1.51.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 339 339 == Changelog == 340 340 341 = 1.51.3 (March 20, 2024) = 342 343 - Fix: prevent weight reset to 0 for resaved scheduled ads 344 - Fix: correct issue with AdSense metabox on ad edit page 345 341 346 = 1.51.2 (March 13, 2024) = 342 347 -
advanced-ads/trunk/views/admin/tables/groups/list-row-loop.php
r2983598 r3055119 9 9 * @var int[] $weights All weights. 10 10 * @var int $weight_sum Sum of all ad weights. 11 * @var Groups_List_Table $this The group terms list table class. 12 * @var WP_Query $ads The query object to fetch all ads inside that group. 11 13 */ 14 15 use AdvancedAds\Admin\Groups_List_Table; 12 16 13 17 $i = 1;
Note: See TracChangeset
for help on using the changeset viewer.