Changeset 3298118
- Timestamp:
- 05/21/2025 01:36:01 PM (7 months ago)
- Location:
- advanced-ads
- Files:
-
- 46 edited
- 1 copied
-
tags/2.0.9 (copied) (copied from advanced-ads/trunk)
-
tags/2.0.9/admin/includes/class-licenses.php (modified) (10 diffs)
-
tags/2.0.9/advanced-ads.php (modified) (2 diffs)
-
tags/2.0.9/classes/display-conditions.php (modified) (2 diffs)
-
tags/2.0.9/classes/frontend_checks.php (modified) (4 diffs)
-
tags/2.0.9/includes/admin/class-addon-updater.php (modified) (2 diffs)
-
tags/2.0.9/includes/class-constants.php (modified) (1 diff)
-
tags/2.0.9/includes/frontend/class-ad-display-condition.php (modified) (2 diffs)
-
tags/2.0.9/includes/frontend/class-manager.php (modified) (2 diffs)
-
tags/2.0.9/includes/frontend/class-scripts.php (modified) (4 diffs)
-
tags/2.0.9/includes/importers/class-manager.php (modified) (2 diffs)
-
tags/2.0.9/includes/utilities/class-conditional.php (modified) (2 diffs)
-
tags/2.0.9/includes/utilities/class-data.php (modified) (1 diff)
-
tags/2.0.9/languages/advanced-ads.pot (modified) (21 diffs)
-
tags/2.0.9/modules/adblock-finder/public/public.php (modified) (2 diffs)
-
tags/2.0.9/modules/gadsense/includes/class-ad-type-adsense.php (modified) (2 diffs)
-
tags/2.0.9/modules/gadsense/public/public.php (modified) (3 diffs)
-
tags/2.0.9/modules/privacy/classes/class-privacy.php (modified) (3 diffs)
-
tags/2.0.9/packages/autoload.php (modified) (1 diff)
-
tags/2.0.9/packages/composer/InstalledVersions.php (modified) (3 diffs)
-
tags/2.0.9/public/class-advanced-ads.php (modified) (2 diffs)
-
tags/2.0.9/public/views/ad-debug.php (modified) (1 diff)
-
tags/2.0.9/readme.txt (modified) (2 diffs)
-
tags/2.0.9/wp.advads (modified) (1 diff)
-
trunk/admin/includes/class-licenses.php (modified) (10 diffs)
-
trunk/advanced-ads.php (modified) (2 diffs)
-
trunk/classes/display-conditions.php (modified) (2 diffs)
-
trunk/classes/frontend_checks.php (modified) (4 diffs)
-
trunk/includes/admin/class-addon-updater.php (modified) (2 diffs)
-
trunk/includes/class-constants.php (modified) (1 diff)
-
trunk/includes/frontend/class-ad-display-condition.php (modified) (2 diffs)
-
trunk/includes/frontend/class-manager.php (modified) (2 diffs)
-
trunk/includes/frontend/class-scripts.php (modified) (4 diffs)
-
trunk/includes/importers/class-manager.php (modified) (2 diffs)
-
trunk/includes/utilities/class-conditional.php (modified) (2 diffs)
-
trunk/includes/utilities/class-data.php (modified) (1 diff)
-
trunk/languages/advanced-ads.pot (modified) (21 diffs)
-
trunk/modules/adblock-finder/public/public.php (modified) (2 diffs)
-
trunk/modules/gadsense/includes/class-ad-type-adsense.php (modified) (2 diffs)
-
trunk/modules/gadsense/public/public.php (modified) (3 diffs)
-
trunk/modules/privacy/classes/class-privacy.php (modified) (3 diffs)
-
trunk/packages/autoload.php (modified) (1 diff)
-
trunk/packages/composer/InstalledVersions.php (modified) (3 diffs)
-
trunk/public/class-advanced-ads.php (modified) (2 diffs)
-
trunk/public/views/ad-debug.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wp.advads (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
advanced-ads/tags/2.0.9/admin/includes/class-licenses.php
r3257709 r3298118 8 8 */ 9 9 10 use AdvancedAds\Constants; 10 11 use AdvancedAds\Utilities\Data; 11 12 … … 16 17 */ 17 18 class Advanced_Ads_Admin_Licenses { 18 /**19 * License API endpoint URL20 *21 * @const string22 */23 const API_ENDPOINT = 'https://wpadvancedads.com/license-api/';24 25 /**26 * Add-on slugs and their EDD ID27 *28 * @const array29 */30 const ADDON_SLUGS_ID = [31 'advanced-ads-gam' => 215545,32 'advanced-ads-layer' => 686,33 'advanced-ads-pro' => 1742,34 'advanced-ads-responsive' => 678,35 'advanced-ads-selling' => 35300,36 'advanced-ads-sticky' => 683,37 'advanced-ads-tracking' => 638,38 ];39 40 19 /** 41 20 * Advanced_Ads_Admin_Licenses constructor. … … 106 85 'edd_action' => 'activate_license', 107 86 'license' => $license_key, 108 'item_id' => self::ADDON_SLUGS_ID[ $options_slug ] ?? false,87 'item_id' => Constants::ADDON_SLUGS_ID[ $options_slug ] ?? false, 109 88 'item_name' => rawurlencode( $plugin_name ), 110 89 'url' => home_url(), … … 120 99 // Call the custom API. 121 100 $response = wp_remote_post( 122 self::API_ENDPOINT,101 Constants::API_ENDPOINT, 123 102 [ 124 103 'timeout' => 15, … … 259 238 'edd_action' => 'check_license', 260 239 'license' => $license_key, 261 'item_id' => self::ADDON_SLUGS_ID[ $options_slug ] ?? false,240 'item_id' => Constants::ADDON_SLUGS_ID[ $options_slug ] ?? false, 262 241 'item_name' => rawurlencode( $plugin_name ), 263 242 ]; … … 315 294 'edd_action' => 'deactivate_license', 316 295 'license' => $license_key, 317 'item_id' => self::ADDON_SLUGS_ID[ $options_slug ] ?? false,296 'item_id' => Constants::ADDON_SLUGS_ID[ $options_slug ] ?? false, 318 297 'item_name' => rawurlencode( $plugin_name ), 319 298 ]; … … 321 300 // Send the remote request. 322 301 $response = wp_remote_post( 323 self::API_ENDPOINT,302 Constants::API_ENDPOINT, 324 303 [ 325 304 'body' => $api_params, … … 484 463 */ 485 464 public function addon_upgrade_filter( $reply, $package, $updater ) { 465 $key = null; 466 $value = null; 467 486 468 if ( isset( $updater->skin->plugin ) ) { 487 $plugin_file = $updater->skin->plugin; 469 $key = 'path'; 470 $value = $updater->skin->plugin; 488 471 } elseif ( isset( $updater->skin->plugin_info['Name'] ) ) { 489 $ add_on = $this->get_installed_add_on_by_name( $updater->skin->plugin_info['Name'] );490 // $add_on['path'] should always be set with out official plugins but might be missing for some local and custom made.491 if ( isset( $add_on['path'] ) ) {492 $plugin_file = plugin_basename( $add_on['path'] ); 493 }494 }495 496 if ( isset( $plugin_file ) && $plugin_file ) {497 // if AJAX; show direct update link as first possible solution. 498 if ( wp_doing_ajax() ) {499 $update_link = wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $plugin_file, 'upgrade-plugin_' . $plugin_file );500 /* translators: %s plugin update link */501 $updater->strings['download_failed'] = sprintf( __( 'Download failed. <a href="%s">Click here to try another method</a>.', 'advanced-ads' ), $update_link );502 } else {503 /* translators: %s download failed knowledgebase link */504 $updater->strings['download_failed'] = sprintf( __( 'Download failed. <a href="%s" target="_blank">Click here to learn why</a>.', 'advanced-ads' ), 'https://wpadvancedads.com/manual/download-failed-updating-add-ons/#utm_source=advanced-ads&utm_medium=link&utm_campaign=download-failed' );505 }472 $key = 'name'; 473 $value = $updater->skin->plugin_info['Name']; 474 } 475 476 $add_on = $this->get_installed_add_on_by_key( $key, $value ); 477 if ( ! $add_on || ! isset( $add_on['path'] ) ) { 478 return $reply; 479 } 480 481 $plugin_file = plugin_basename( $add_on['path'] ); 482 if ( wp_doing_ajax() ) { 483 $update_link = wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $plugin_file, 'upgrade-plugin_' . $plugin_file ); 484 /* translators: %s plugin update link */ 485 $updater->strings['download_failed'] = sprintf( __( 'Download failed. <a href="%s">Click here to try another method</a>.', 'advanced-ads' ), $update_link ); 486 } else { 487 /* translators: %s download failed knowledgebase link */ 488 $updater->strings['download_failed'] = sprintf( __( 'Download failed. <a href="%s" target="_blank">Click here to learn why</a>.', 'advanced-ads' ), 'https://wpadvancedads.com/manual/download-failed-updating-add-ons/#utm_source=advanced-ads&utm_medium=link&utm_campaign=download-failed' ); 506 489 } 507 490 … … 512 495 * Search if a name is in the add-on array and return the add-on data of it 513 496 * 514 * @param string $name name of an add-on. 497 * @param string $key key to search for. 498 * @param string $value value to search for. 515 499 * 516 500 * @return array array with the add-on data 517 501 */ 518 private function get_installed_add_on_by_name( $name = '' ) { 502 private function get_installed_add_on_by_key( $key, $value ) { 503 // Early bail!! 504 if ( empty( $key ) || empty( $value ) ) { 505 return null; 506 } 507 519 508 $add_ons = Data::get_addons(); 520 521 509 if ( is_array( $add_ons ) ) { 522 foreach ( $add_ons as $ key => $_add_on ) {523 if ( $ _add_on['name'] === $name ) {524 return $ _add_on;510 foreach ( $add_ons as $add_on ) { 511 if ( $add_on[ $key ] === $value ) { 512 return $add_on; 525 513 } 526 514 } … … 570 558 // Early bail!! 571 559 if ( 572 self::API_ENDPOINT !== $url560 Constants::API_ENDPOINT !== $url 573 561 || ( 574 562 empty( $parsed_args['body']['edd_action'] ) -
advanced-ads/tags/2.0.9/advanced-ads.php
r3283205 r3298118 11 11 * @wordpress-plugin 12 12 * Plugin Name: Advanced Ads 13 * Version: 2.0. 813 * Version: 2.0.9 14 14 * Description: Manage and optimize your ads in WordPress 15 15 * Plugin URI: https://wpadvancedads.com … … 38 38 39 39 define( 'ADVADS_FILE', __FILE__ ); 40 define( 'ADVADS_VERSION', '2.0. 8' );40 define( 'ADVADS_VERSION', '2.0.9' ); 41 41 42 42 // Load the autoloader. -
advanced-ads/tags/2.0.9/classes/display-conditions.php
r3253289 r3298118 202 202 * 203 203 * @param array $options options of the condition. 204 * @param mixed $ad false orAd object.204 * @param Ad $ad Ad object. 205 205 * 206 206 * @return bool false, if ad can’t be delivered 207 207 */ 208 public static function frontend_check( $options = [], $ad = false ) { 208 public static function frontend_check( $options = [], $ad ) { 209 // Early bail!! 210 if ( ! $ad ) { 211 return true; 212 } 213 209 214 $display_conditions = self::get_instance()->conditions; 210 215 … … 936 941 $operator = 'is'; 937 942 } 938 939 $post = $ad->get_prop( 'ad_args.post' ); 943 $post = $ad->get_prop( 'ad_args.post' ) ?? null; 940 944 $post_type = $post['post_type'] ?? false; 941 945 -
advanced-ads/tags/2.0.9/classes/frontend_checks.php
r3253289 r3298118 86 86 */ 87 87 public function enqueue_scripts() { 88 if ( advads_is_amp() ) {88 if ( Conditional::is_amp() ) { 89 89 return; 90 90 } … … 458 458 $notices = Advanced_Ads_Ad_Health_Notices::get_number_of_notices(); 459 459 460 if ( ! advads_is_amp() ) {460 if ( ! Conditional::is_amp() ) { 461 461 $warnings = 0; // Will be updated using JS. 462 462 } else { … … 679 679 echo ob_get_clean(); 680 680 681 if ( advads_is_amp() ) {681 if ( Conditional::is_amp() ) { 682 682 return; 683 683 } … … 1068 1068 } 1069 1069 1070 if ( advads_is_amp() ) {1070 if ( Conditional::is_amp() ) { 1071 1071 return $content; 1072 1072 } -
advanced-ads/tags/2.0.9/includes/admin/class-addon-updater.php
r3257709 r3298118 10 10 namespace AdvancedAds\Admin; 11 11 12 use AdvancedAds\Constants; 13 use AdvancedAds\Utilities\Data; 12 14 use Advanced_Ads_Admin_Licenses; 13 use AdvancedAds\Utilities\Data;14 15 use AdvancedAds\Framework\Interfaces\Integration_Interface; 15 16 … … 73 74 74 75 ( new EDD_Updater( 75 Advanced_Ads_Admin_Licenses::API_ENDPOINT,76 Constants::API_ENDPOINT, 76 77 $_add_on['path'], 77 78 [ 78 79 'version' => $_add_on['version'], 79 80 'license' => $license_key, 80 'item_id' => Advanced_Ads_Admin_Licenses::ADDON_SLUGS_ID[ $options_slug ] ?? false,81 'item_id' => Constants::ADDON_SLUGS_ID[ $options_slug ] ?? false, 81 82 'author' => 'Advanced Ads', 82 83 ] -
advanced-ads/tags/2.0.9/includes/class-constants.php
r3283205 r3298118 175 175 '1.1.0' => 'advanced-ads-browser-language', // Browser Language. 176 176 ]; 177 178 /** 179 * License API endpoint URL 180 * 181 * @const string 182 */ 183 const API_ENDPOINT = 'https://wpadvancedads.com/license-api/'; 184 185 /** 186 * Add-on slugs and their EDD ID 187 * 188 * @const array 189 */ 190 const ADDON_SLUGS_ID = [ 191 'advanced-ads-gam' => 215545, 192 'advanced-ads-layer' => 686, 193 'advanced-ads-pro' => 1742, 194 'advanced-ads-responsive' => 678, 195 'advanced-ads-selling' => 35300, 196 'advanced-ads-sticky' => 683, 197 'advanced-ads-tracking' => 638, 198 'slider-ads' => 1168, 199 ]; 177 200 } -
advanced-ads/tags/2.0.9/includes/frontend/class-ad-display-condition.php
r3253289 r3298118 36 36 37 37 /** 38 * Check if ads are disabled.39 *40 * @return bool41 */42 public function is_ad_disabled(): bool {43 return defined( 'ADVADS_ADS_DISABLED' ) && ADVADS_ADS_DISABLED;44 }45 46 /**47 38 * Get the disabled id. 48 39 * … … 71 62 72 63 // Early bail!! 73 if ( $this->is_ad_disabled() ) {64 if ( Conditional::is_ad_disabled() ) { 74 65 return; 75 66 } -
advanced-ads/tags/2.0.9/includes/frontend/class-manager.php
r3253289 r3298118 10 10 namespace AdvancedAds\Frontend; 11 11 12 use AdvancedAds\Utilities\Conditional; 12 13 use AdvancedAds\Framework\Interfaces\Integration_Interface; 13 14 … … 60 61 $this->page_display->run_checks(); 61 62 62 if ( ! $this->page_display->is_ad_disabled() ) {63 if ( ! Conditional::is_ad_disabled() ) { 63 64 do_action( 'advanced-ads-frontend' ); 64 65 } -
advanced-ads/tags/2.0.9/includes/frontend/class-scripts.php
r3253289 r3298118 14 14 use Advanced_Ads_Privacy; 15 15 use AdvancedAds\Utilities\WordPress; 16 use AdvancedAds\Utilities\Conditional; 16 17 use AdvancedAds\Framework\Utilities\Params; 17 18 use AdvancedAds\Framework\Interfaces\Integration_Interface; … … 41 42 */ 42 43 public function enqueue_scripts(): void { 43 if ( advads_is_amp() ) {44 if ( Conditional::is_amp() ) { 44 45 return; 45 46 } … … 99 100 ); 100 101 101 if ( advads_is_amp() ) {102 if ( Conditional::is_amp() ) { 102 103 return; 103 104 } … … 136 137 */ 137 138 public function print_footer_scripts(): void { 138 if ( advads_is_amp() ) {139 if ( Conditional::is_amp() ) { 139 140 return; 140 141 } -
advanced-ads/tags/2.0.9/includes/importers/class-manager.php
r3145275 r3298118 12 12 use WP_Error; 13 13 use AdvancedAds\Utilities\WordPress; 14 use AdvancedAds\Utilities\Conditional; 14 15 use AdvancedAds\Framework\Utilities\Params; 15 16 use AdvancedAds\Framework\Interfaces\Integration_Interface; … … 69 70 public function handle_action(): void { 70 71 // Early bail!! 72 if ( ! Conditional::user_cap( 'advanced_ads_edit_ads' ) ) { 73 return; 74 } 75 71 76 $action = WordPress::current_action(); 72 77 -
advanced-ads/tags/2.0.9/includes/utilities/class-conditional.php
r3253289 r3298118 121 121 122 122 /** 123 * Check if ads are disabled. 124 * 125 * @return bool 126 */ 127 public static function is_ad_disabled(): bool { 128 return defined( 'ADVADS_ADS_DISABLED' ) && ADVADS_ADS_DISABLED; 129 } 130 131 /** 123 132 * Check if any add-on is activated 124 133 * 125 134 * @return bool true if there is any add-on activated 126 135 */ 127 public static function is_any_addon_activated() {136 public static function is_any_addon_activated(): bool { 128 137 return has_action( 'advanced-ads-loaded' ); 138 } 139 140 /** 141 * Check if the current page is an AMP page. 142 * 143 * @return bool 144 */ 145 public static function is_amp(): bool { 146 return function_exists( 'advads_is_amp' ) && advads_is_amp(); 129 147 } 130 148 … … 136 154 public static function is_ua_bot(): bool { 137 155 // show ads on AMP version also for bots in order to allow Google (and maybe others) to cache the page. 138 if ( advads_is_amp() ) {156 if ( self::is_amp() ) { 139 157 return false; 140 158 } -
advanced-ads/tags/2.0.9/includes/utilities/class-data.php
r3257709 r3298118 44 44 'advanced-ads-sticky', 45 45 'advanced-ads-tracking', 46 'slider-ads', 46 47 ]; 47 48 -
advanced-ads/tags/2.0.9/languages/advanced-ads.pot
r3283205 r3298118 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Advanced Ads 2.0. 7\n"5 "Project-Id-Version: Advanced Ads 2.0.8\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: 2025-0 4-28T07:32:04+00:00\n"12 "POT-Creation-Date: 2025-05-21T13:33:32+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.11.0\n" … … 280 280 msgstr "" 281 281 282 #: admin/includes/class-licenses.php: 86282 #: admin/includes/class-licenses.php:65 283 283 msgid "Error while trying to register the license. Please contact support." 284 284 msgstr "" 285 285 286 #: admin/includes/class-licenses.php: 91286 #: admin/includes/class-licenses.php:70 287 287 #: admin/views/setting-license.php:84 288 288 msgid "Please enter a valid license key" 289 289 msgstr "" 290 290 291 #: admin/includes/class-licenses.php:1 32292 #: admin/includes/class-licenses.php:3 33291 #: admin/includes/class-licenses.php:111 292 #: admin/includes/class-licenses.php:312 293 293 msgid "The license status does not change as long as ADVANCED_ADS_SHOW_LICENSE_RESPONSE is enabled in wp-config.php." 294 294 msgstr "" 295 295 296 #: admin/includes/class-licenses.php:130 297 msgid "License couldn’t be activated. Please try again later." 298 msgstr "" 299 300 #: admin/includes/class-licenses.php:149 301 msgid "This is the bundle license key." 302 msgstr "" 303 304 #: admin/includes/class-licenses.php:150 305 msgid "This is not the correct key for this add-on." 306 msgstr "" 307 296 308 #: admin/includes/class-licenses.php:151 297 msgid "License couldn’t be activated. Please try again later."298 msgstr ""299 300 #: admin/includes/class-licenses.php:170301 msgid "This is the bundle license key."302 msgstr ""303 304 #: admin/includes/class-licenses.php:171305 msgid "This is not the correct key for this add-on."306 msgstr ""307 308 #: admin/includes/class-licenses.php:172309 309 msgid "There are no activations left." 310 310 msgstr "" 311 311 312 312 #. translators: %1$s is a starting link tag, %2$s is the closing one. 313 #: admin/includes/class-licenses.php:1 76313 #: admin/includes/class-licenses.php:155 314 314 msgid "You can manage activations in %1$syour account%2$s." 315 315 msgstr "" 316 316 317 317 #. translators: %1$s is a starting link tag, %2$s is the closing one. 318 #: admin/includes/class-licenses.php:1 82318 #: admin/includes/class-licenses.php:161 319 319 msgid "%1$sUpgrade%2$s for more activations." 320 320 msgstr "" 321 321 322 322 #. translators: %s is a string containing information about the issue. 323 #: admin/includes/class-licenses.php:1 96323 #: admin/includes/class-licenses.php:175 324 324 msgid "License is invalid. Reason: %s" 325 325 msgstr "" 326 326 327 327 #. translators: %s is a list of server information like IP address. Just keep it as is. 328 #: admin/includes/class-licenses.php:2 36328 #: admin/includes/class-licenses.php:215 329 329 msgid "Your request was blocked by our firewall. Please send us the following information to unblock you: %s." 330 330 msgstr "" 331 331 332 #: admin/includes/class-licenses.php:2 99332 #: admin/includes/class-licenses.php:278 333 333 msgid "Error while trying to disable the license. Please contact support." 334 334 msgstr "" 335 335 336 #: admin/includes/class-licenses.php:3 42337 #: admin/includes/class-licenses.php:3 66336 #: admin/includes/class-licenses.php:321 337 #: admin/includes/class-licenses.php:345 338 338 msgid "License couldn’t be deactivated. Please try again later." 339 339 msgstr "" 340 340 341 341 #. translators: %s plugin update link 342 #: admin/includes/class-licenses.php: 501342 #: admin/includes/class-licenses.php:485 343 343 msgid "Download failed. <a href=\"%s\">Click here to try another method</a>." 344 344 msgstr "" 345 345 346 346 #. translators: %s download failed knowledgebase link 347 #: admin/includes/class-licenses.php: 504347 #: admin/includes/class-licenses.php:488 348 348 msgid "Download failed. <a href=\"%s\" target=\"_blank\">Click here to learn why</a>." 349 349 msgstr "" 350 350 351 #: admin/includes/class-licenses.php:6 61351 #: admin/includes/class-licenses.php:649 352 352 msgid "License deactivated. Please try again later." 353 353 msgstr "" … … 521 521 #: admin/views/conditions/condition-string.php:9 522 522 #: admin/views/notices/adblock.php:11 523 #: classes/display-conditions.php:91 4523 #: classes/display-conditions.php:919 524 524 #: includes/admin/metaboxes/class-ad-layout.php:63 525 525 #: includes/admin/metaboxes/class-ad-types.php:63 … … 1127 1127 msgstr "" 1128 1128 1129 #: classes/display-conditions.php:28 01129 #: classes/display-conditions.php:285 1130 1130 msgid "parent page" 1131 1131 msgstr "" 1132 1132 1133 #: classes/display-conditions.php:28 11133 #: classes/display-conditions.php:286 1134 1134 msgid "post meta" 1135 1135 msgstr "" 1136 1136 1137 #: classes/display-conditions.php:28 21137 #: classes/display-conditions.php:287 1138 1138 msgid "page template" 1139 1139 msgstr "" 1140 1140 1141 #: classes/display-conditions.php:28 31141 #: classes/display-conditions.php:288 1142 1142 msgid "url parameters" 1143 1143 msgstr "" 1144 1144 1145 #: classes/display-conditions.php:2 861145 #: classes/display-conditions.php:291 1146 1146 msgid "accelerated mobile pages" 1147 1147 msgstr "" 1148 1148 1149 #: classes/display-conditions.php:31 01149 #: classes/display-conditions.php:315 1150 1150 #: classes/visitor-conditions.php:318 1151 1151 #: includes/admin/class-assets.php:130 … … 1156 1156 msgstr "" 1157 1157 1158 #: classes/display-conditions.php:31 01158 #: classes/display-conditions.php:315 1159 1159 #: classes/visitor-conditions.php:318 1160 1160 #: includes/admin/class-assets.php:131 … … 1162 1162 msgstr "" 1163 1163 1164 #: classes/display-conditions.php:6 391164 #: classes/display-conditions.php:644 1165 1165 msgctxt "display the terms search field on ad edit page" 1166 1166 msgid "add more terms" 1167 1167 msgstr "" 1168 1168 1169 #: classes/display-conditions.php:6 451169 #: classes/display-conditions.php:650 1170 1170 msgid "term name or id" 1171 1171 msgstr "" 1172 1172 1173 #: classes/display-conditions.php:7 271173 #: classes/display-conditions.php:732 1174 1174 msgid "ID" 1175 1175 msgstr "" 1176 1176 1177 #: classes/display-conditions.php:7 271177 #: classes/display-conditions.php:732 1178 1178 #: includes/admin/class-placement-edit-modal.php:120 1179 1179 #: views/admin/placements/quick-edit.php:14 … … 1182 1182 msgstr "" 1183 1183 1184 #: classes/display-conditions.php:7 291184 #: classes/display-conditions.php:734 1185 1185 #: includes/abstracts/abstract-ad.php:830 1186 1186 #: includes/admin/class-groups-list-table.php:362 … … 1190 1190 msgstr "" 1191 1191 1192 #: classes/display-conditions.php:73 11192 #: classes/display-conditions.php:736 1193 1193 #: includes/admin/class-groups-list-table.php:362 1194 1194 #: views/admin/tables/ads/column-date.php:18 … … 1196 1196 msgstr "" 1197 1197 1198 #: classes/display-conditions.php:75 31198 #: classes/display-conditions.php:758 1199 1199 msgid "title or id" 1200 1200 msgstr "" 1201 1201 1202 #: classes/display-conditions.php:8 271202 #: classes/display-conditions.php:832 1203 1203 #: includes/array_ad_conditions.php:59 1204 1204 msgid "Home Page" 1205 1205 msgstr "" 1206 1206 1207 #: classes/display-conditions.php:8 281207 #: classes/display-conditions.php:833 1208 1208 #: includes/array_ad_conditions.php:60 1209 1209 msgid "show on Home page" 1210 1210 msgstr "" 1211 1211 1212 #: classes/display-conditions.php:83 21212 #: classes/display-conditions.php:837 1213 1213 #: includes/array_ad_conditions.php:64 1214 1214 msgid "Singular Pages" 1215 1215 msgstr "" 1216 1216 1217 #: classes/display-conditions.php:83 31217 #: classes/display-conditions.php:838 1218 1218 #: includes/array_ad_conditions.php:65 1219 1219 msgid "show on singular pages/posts" 1220 1220 msgstr "" 1221 1221 1222 #: classes/display-conditions.php:8 371222 #: classes/display-conditions.php:842 1223 1223 #: includes/array_ad_conditions.php:69 1224 1224 msgid "Archive Pages" 1225 1225 msgstr "" 1226 1226 1227 #: classes/display-conditions.php:8 381227 #: classes/display-conditions.php:843 1228 1228 #: includes/array_ad_conditions.php:70 1229 1229 msgid "show on any type of archive page (category, tag, author and date)" 1230 1230 msgstr "" 1231 1231 1232 #: classes/display-conditions.php:84 21232 #: classes/display-conditions.php:847 1233 1233 #: includes/array_ad_conditions.php:74 1234 1234 msgid "Search Results" 1235 1235 msgstr "" 1236 1236 1237 #: classes/display-conditions.php:84 31237 #: classes/display-conditions.php:848 1238 1238 #: includes/array_ad_conditions.php:75 1239 1239 msgid "show on search result pages" 1240 1240 msgstr "" 1241 1241 1242 #: classes/display-conditions.php:8 471242 #: classes/display-conditions.php:852 1243 1243 #: includes/array_ad_conditions.php:79 1244 1244 msgid "404 Page" 1245 1245 msgstr "" 1246 1246 1247 #: classes/display-conditions.php:8 481247 #: classes/display-conditions.php:853 1248 1248 #: includes/array_ad_conditions.php:80 1249 1249 msgid "show on 404 error page" 1250 1250 msgstr "" 1251 1251 1252 #: classes/display-conditions.php:85 21252 #: classes/display-conditions.php:857 1253 1253 #: includes/array_ad_conditions.php:84 1254 1254 msgid "Attachment Pages" 1255 1255 msgstr "" 1256 1256 1257 #: classes/display-conditions.php:85 31257 #: classes/display-conditions.php:858 1258 1258 #: includes/array_ad_conditions.php:85 1259 1259 msgid "show on attachment pages" 1260 1260 msgstr "" 1261 1261 1262 #: classes/display-conditions.php:8 571262 #: classes/display-conditions.php:862 1263 1263 #: includes/array_ad_conditions.php:89 1264 1264 msgid "Secondary Queries" 1265 1265 msgstr "" 1266 1266 1267 #: classes/display-conditions.php:8 581267 #: classes/display-conditions.php:863 1268 1268 #: includes/array_ad_conditions.php:90 1269 1269 msgid "allow ads in secondary queries" 1270 1270 msgstr "" 1271 1271 1272 #: classes/display-conditions.php:86 21272 #: classes/display-conditions.php:867 1273 1273 msgid "RSS Feed" 1274 1274 msgstr "" 1275 1275 1276 #: classes/display-conditions.php:86 31276 #: classes/display-conditions.php:868 1277 1277 msgid "allow ads in RSS Feed" 1278 1278 msgstr "" 1279 1279 1280 #: classes/display-conditions.php:8 671280 #: classes/display-conditions.php:872 1281 1281 msgid "REST API" 1282 1282 msgstr "" 1283 1283 1284 #: classes/display-conditions.php:8 681284 #: classes/display-conditions.php:873 1285 1285 msgid "allow ads in REST API" 1286 1286 msgstr "" 1287 1287 1288 #: classes/display-conditions.php:90 31288 #: classes/display-conditions.php:908 1289 1289 msgid "older than" 1290 1290 msgstr "" 1291 1291 1292 #: classes/display-conditions.php:90 41292 #: classes/display-conditions.php:909 1293 1293 msgid "younger than" 1294 1294 msgstr "" 1295 1295 1296 #: classes/display-conditions.php:9 091296 #: classes/display-conditions.php:914 1297 1297 msgid "days" 1298 1298 msgstr "" 1299 1299 1300 #: classes/display-conditions.php:91 21300 #: classes/display-conditions.php:917 1301 1301 msgid "Display ads based on the age of a page or post." 1302 1302 msgstr "" … … 1604 1604 #: includes/abstracts/abstract-placement-type.php:63 1605 1605 #: includes/class-widget.php:128 1606 #: includes/utilities/class-data.php:29 51606 #: includes/utilities/class-data.php:296 1607 1607 #: modules/gutenberg/includes/class-gutenberg.php:136 1608 1608 #: views/admin/tables/ads/filters.php:75 … … 1616 1616 #: includes/class-entities.php:44 1617 1617 #: includes/class-widget.php:135 1618 #: includes/utilities/class-data.php:28 81618 #: includes/utilities/class-data.php:289 1619 1619 #: modules/gutenberg/includes/class-gutenberg.php:135 1620 1620 #: views/admin/tables/groups/edit-form-modal.php:113 … … 1921 1921 1922 1922 #. Translators: 1: add-on name 2: admin URL to license page 1923 #: includes/admin/class-addon-updater.php:13 11923 #: includes/admin/class-addon-updater.php:132 1924 1924 msgid "There might be a new version of %1$s. Please <strong>provide a valid license key</strong> in order to receive updates and support <a href=\"%2$s\">on this page</a>." 1925 1925 msgstr "" … … 2170 2170 #: includes/admin/class-list-filters.php:122 2171 2171 #: modules/gadsense/admin/views/adsense-ad-parameters.php:131 2172 #: modules/gadsense/includes/class-ad-type-adsense.php:3 02172 #: modules/gadsense/includes/class-ad-type-adsense.php:31 2173 2173 msgid "Responsive" 2174 2174 msgstr "" … … 2913 2913 #: includes/admin/pages/class-placements.php:44 2914 2914 #: includes/class-widget.php:121 2915 #: includes/utilities/class-data.php:30 22915 #: includes/utilities/class-data.php:303 2916 2916 #: modules/gutenberg/includes/class-gutenberg.php:137 2917 2917 #: views/admin/tables/ads/column-used.php:34 … … 3278 3278 3279 3279 #: includes/class-widget.php:119 3280 #: includes/utilities/class-data.php:28 63280 #: includes/utilities/class-data.php:287 3281 3281 #: modules/gutenberg/includes/class-gutenberg.php:133 3282 3282 msgid "--empty--" … … 3438 3438 msgstr "" 3439 3439 3440 #: includes/importers/class-manager.php:10 43440 #: includes/importers/class-manager.php:109 3441 3441 msgid "History deleted successfully." 3442 3442 msgstr "" … … 4116 4116 4117 4117 #: modules/gadsense/admin/views/adsense-account.php:135 4118 #: modules/gadsense/includes/class-ad-type-adsense.php:9 54118 #: modules/gadsense/includes/class-ad-type-adsense.php:96 4119 4119 #: modules/gadsense/includes/types/type-adsense.php:142 4120 4120 msgid "The Publisher ID has an incorrect format. (must start with \"pub-\")" … … 4211 4211 4212 4212 #: modules/gadsense/admin/views/adsense-ad-parameters.php:132 4213 #: modules/gadsense/includes/class-ad-type-adsense.php:3 14213 #: modules/gadsense/includes/class-ad-type-adsense.php:32 4214 4214 msgid "Multiplex" 4215 4215 msgstr "" 4216 4216 4217 4217 #: modules/gadsense/admin/views/adsense-ad-parameters.php:134 4218 #: modules/gadsense/includes/class-ad-type-adsense.php:3 24218 #: modules/gadsense/includes/class-ad-type-adsense.php:33 4219 4219 msgid "Link ads" 4220 4220 msgstr "" 4221 4221 4222 4222 #: modules/gadsense/admin/views/adsense-ad-parameters.php:137 4223 #: modules/gadsense/includes/class-ad-type-adsense.php:3 34223 #: modules/gadsense/includes/class-ad-type-adsense.php:34 4224 4224 msgid "Link ads (Responsive)" 4225 4225 msgstr "" 4226 4226 4227 4227 #: modules/gadsense/admin/views/adsense-ad-parameters.php:139 4228 #: modules/gadsense/includes/class-ad-type-adsense.php:3 44228 #: modules/gadsense/includes/class-ad-type-adsense.php:35 4229 4229 msgid "In-article" 4230 4230 msgstr "" 4231 4231 4232 4232 #: modules/gadsense/admin/views/adsense-ad-parameters.php:140 4233 #: modules/gadsense/includes/class-ad-type-adsense.php:3 54233 #: modules/gadsense/includes/class-ad-type-adsense.php:36 4234 4234 msgid "In-feed" 4235 4235 msgstr "" … … 4386 4386 msgstr "" 4387 4387 4388 #: modules/gadsense/includes/class-ad-type-adsense.php: 294389 #: modules/gadsense/includes/class-ad-type-adsense.php:4 74388 #: modules/gadsense/includes/class-ad-type-adsense.php:30 4389 #: modules/gadsense/includes/class-ad-type-adsense.php:48 4390 4390 msgid "Normal" 4391 4391 msgstr "" 4392 4392 4393 #: modules/gadsense/includes/class-ad-type-adsense.php:13 64393 #: modules/gadsense/includes/class-ad-type-adsense.php:137 4394 4394 #: modules/gadsense/includes/types/type-adsense.php:183 4395 4395 msgid "Your AdSense Publisher ID is missing." … … 5012 5012 msgstr "" 5013 5013 5014 #: public/views/ad-debug.php:2 05014 #: public/views/ad-debug.php:22 5015 5015 msgid "Ad debug output" 5016 5016 msgstr "" 5017 5017 5018 #: public/views/ad-debug.php:2 45018 #: public/views/ad-debug.php:26 5019 5019 msgid "Find solutions in the manual" 5020 5020 msgstr "" -
advanced-ads/tags/2.0.9/modules/adblock-finder/public/public.php
r3253289 r3298118 7 7 */ 8 8 9 use AdvancedAds\Options; 10 use AdvancedAds\Utilities\Conditional; 9 11 use AdvancedAds\Framework\Utilities\Arr; 10 use AdvancedAds\Options;11 12 12 13 /** … … 29 30 */ 30 31 public function print_adblock_check_js() { 31 if ( advads_is_amp() ) {32 if ( Conditional::is_amp() ) { 32 33 return; 33 34 } -
advanced-ads/tags/2.0.9/modules/gadsense/includes/class-ad-type-adsense.php
r3253289 r3298118 11 11 12 12 use AdvancedAds\Abstracts\Ad; 13 use AdvancedAds\Utilities\Conditional; 13 14 use AdvancedAds\Interfaces\Ad_Interface; 14 15 … … 263 264 264 265 // Prevent output on AMP pages. 265 if ( advads_is_amp() ) {266 if ( Conditional::is_amp() ) { 266 267 return ''; 267 268 } -
advanced-ads/tags/2.0.9/modules/gadsense/public/public.php
r3253289 r3298118 1 1 <?php // phpcs:ignore WordPress.Files.FileName 2 3 use AdvancedAds\Utilities\Conditional; 2 4 3 5 /** … … 55 57 } 56 58 57 if ( defined( 'ADVADS_ADS_DISABLED' ) || advads_is_amp() ) {59 if ( Conditional::is_ad_disabled() || Conditional::is_amp() ) { 58 60 return; 59 61 } … … 149 151 150 152 if ( 151 // check if ads are disabled. 152 ( defined( 'ADVADS_ADS_DISABLED' ) && ADVADS_ADS_DISABLED ) 153 Conditional::is_ad_disabled() 153 154 // check if this an AMP page, we're inside `wp` action so it's safe to use. 154 || ( ! function_exists( 'advads_is_amp' ) || ! advads_is_amp())155 || ! Conditional::is_amp() 155 156 ) { 156 157 return; -
advanced-ads/tags/2.0.9/modules/privacy/classes/class-privacy.php
r3253289 r3298118 2 2 3 3 use AdvancedAds\Abstracts\Ad; 4 use AdvancedAds\Utilities\Conditional; 5 use AdvancedAds\Framework\Utilities\Str; 4 6 use AdvancedAds\Framework\Utilities\Params; 5 use AdvancedAds\Framework\Utilities\Str;6 7 7 8 /** … … 57 58 public function final_ad_output( $output, Ad $ad ) { 58 59 if ( 59 advads_is_amp() ||60 Conditional::is_amp() || 60 61 ! $this->ad_type_needs_consent( $ad->get_type() ) || 61 62 ( ! $ad->is_type( 'adsense' ) && $ad->get_prop( 'privacy.ignore-consent' ) ) … … 239 240 */ 240 241 private function parse_state() { 241 if ( empty( $this->options['enabled'] ) || advads_is_amp() ) {242 if ( empty( $this->options['enabled'] ) || Conditional::is_amp() ) { 242 243 return 'not_needed'; 243 244 } -
advanced-ads/tags/2.0.9/packages/autoload.php
r2983598 r3298118 15 15 } 16 16 } 17 trigger_error( 18 $err, 19 E_USER_ERROR 20 ); 17 throw new RuntimeException($err); 21 18 } 22 19 -
advanced-ads/tags/2.0.9/packages/composer/InstalledVersions.php
r3265208 r3298118 27 27 class InstalledVersions 28 28 { 29 /** 30 * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to 31 * @internal 32 */ 33 private static $selfDir = null; 34 29 35 /** 30 36 * @var mixed[]|null … … 324 330 325 331 /** 332 * @return string 333 */ 334 private static function getSelfDir() 335 { 336 if (self::$selfDir === null) { 337 self::$selfDir = strtr(__DIR__, '\\', '/'); 338 } 339 340 return self::$selfDir; 341 } 342 343 /** 326 344 * @return array[] 327 345 * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}> … … 337 355 338 356 if (self::$canGetVendors) { 339 $selfDir = s trtr(__DIR__, '\\', '/');357 $selfDir = self::getSelfDir(); 340 358 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { 341 359 $vendorDir = strtr($vendorDir, '\\', '/'); -
advanced-ads/tags/2.0.9/public/class-advanced-ads.php
r3257709 r3298118 397 397 $injection_enabled = $options['content-injection-enabled'] ?? 'off'; 398 398 399 if ( ( $injection_enabled === 'off' || 0 === $archive_injection_count ) && ( ! is_singular( $public_post_types ) || ( ! advads_is_amp() && ! $this->in_the_loop() && ! $this->was_in_the_loop ) ) ) {399 if ( ( $injection_enabled === 'off' || 0 === $archive_injection_count ) && ( ! is_singular( $public_post_types ) || ( ! Conditional::is_amp() && ! $this->in_the_loop() && ! $this->was_in_the_loop ) ) ) { 400 400 return false; 401 401 } … … 425 425 * @return bool `true` if ads are disabled 426 426 */ 427 $ads_disabled = apply_filters( 'advanced-ads-disabled-ads', defined( 'ADVADS_ADS_DISABLED'), $options );427 $ads_disabled = apply_filters( 'advanced-ads-disabled-ads', Conditional::is_ad_disabled(), $options ); 428 428 429 429 if ( $ads_disabled ) { -
advanced-ads/tags/2.0.9/public/views/ad-debug.php
r3253289 r3298118 12 12 */ 13 13 14 if ( ! advads_is_amp() ) : 14 use AdvancedAds\Utilities\Conditional; 15 16 if ( ! Conditional::is_amp() ) : 15 17 ob_start(); 16 18 echo Advanced_Ads_Utils::get_inline_asset( ob_get_clean() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -
advanced-ads/tags/2.0.9/readme.txt
r3283205 r3298118 3 3 Tags: ads, adsense, amazon, affiliate, ad manager 4 4 Requires at least: 5.7 5 Tested up to: 6. 75 Tested up to: 6.8 6 6 Requires PHP: 7.4 7 Stable tag: 2.0. 87 Stable tag: 2.0.9 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 361 361 == Changelog == 362 362 363 = 2.0.9 (May 21, 2025) = 364 365 - Improvement: improve amp conditions 366 - Improvement: Test plugin compatibility with WordPress 6.8. 367 - Improvement: add capability check in importer 368 - Improvement: standardize `ADVADS_ADS_DISABLED` check 369 - Improvement: null checks before accessing ad properties 370 - Fix: update failure help link only for Advanced Ads add-ons 371 363 372 = 2.0.8 (April 28, 2025) = 364 373 -
advanced-ads/tags/2.0.9/wp.advads
r3283205 r3298118 3 3 "name": "Advanced Ads", 4 4 "description": "Manage and optimize your ads in WordPress", 5 "version": "2.0. 8",5 "version": "2.0.9", 6 6 "requireWP": "5.7", 7 7 "requirePHP": "7.4", -
advanced-ads/trunk/admin/includes/class-licenses.php
r3257709 r3298118 8 8 */ 9 9 10 use AdvancedAds\Constants; 10 11 use AdvancedAds\Utilities\Data; 11 12 … … 16 17 */ 17 18 class Advanced_Ads_Admin_Licenses { 18 /**19 * License API endpoint URL20 *21 * @const string22 */23 const API_ENDPOINT = 'https://wpadvancedads.com/license-api/';24 25 /**26 * Add-on slugs and their EDD ID27 *28 * @const array29 */30 const ADDON_SLUGS_ID = [31 'advanced-ads-gam' => 215545,32 'advanced-ads-layer' => 686,33 'advanced-ads-pro' => 1742,34 'advanced-ads-responsive' => 678,35 'advanced-ads-selling' => 35300,36 'advanced-ads-sticky' => 683,37 'advanced-ads-tracking' => 638,38 ];39 40 19 /** 41 20 * Advanced_Ads_Admin_Licenses constructor. … … 106 85 'edd_action' => 'activate_license', 107 86 'license' => $license_key, 108 'item_id' => self::ADDON_SLUGS_ID[ $options_slug ] ?? false,87 'item_id' => Constants::ADDON_SLUGS_ID[ $options_slug ] ?? false, 109 88 'item_name' => rawurlencode( $plugin_name ), 110 89 'url' => home_url(), … … 120 99 // Call the custom API. 121 100 $response = wp_remote_post( 122 self::API_ENDPOINT,101 Constants::API_ENDPOINT, 123 102 [ 124 103 'timeout' => 15, … … 259 238 'edd_action' => 'check_license', 260 239 'license' => $license_key, 261 'item_id' => self::ADDON_SLUGS_ID[ $options_slug ] ?? false,240 'item_id' => Constants::ADDON_SLUGS_ID[ $options_slug ] ?? false, 262 241 'item_name' => rawurlencode( $plugin_name ), 263 242 ]; … … 315 294 'edd_action' => 'deactivate_license', 316 295 'license' => $license_key, 317 'item_id' => self::ADDON_SLUGS_ID[ $options_slug ] ?? false,296 'item_id' => Constants::ADDON_SLUGS_ID[ $options_slug ] ?? false, 318 297 'item_name' => rawurlencode( $plugin_name ), 319 298 ]; … … 321 300 // Send the remote request. 322 301 $response = wp_remote_post( 323 self::API_ENDPOINT,302 Constants::API_ENDPOINT, 324 303 [ 325 304 'body' => $api_params, … … 484 463 */ 485 464 public function addon_upgrade_filter( $reply, $package, $updater ) { 465 $key = null; 466 $value = null; 467 486 468 if ( isset( $updater->skin->plugin ) ) { 487 $plugin_file = $updater->skin->plugin; 469 $key = 'path'; 470 $value = $updater->skin->plugin; 488 471 } elseif ( isset( $updater->skin->plugin_info['Name'] ) ) { 489 $ add_on = $this->get_installed_add_on_by_name( $updater->skin->plugin_info['Name'] );490 // $add_on['path'] should always be set with out official plugins but might be missing for some local and custom made.491 if ( isset( $add_on['path'] ) ) {492 $plugin_file = plugin_basename( $add_on['path'] ); 493 }494 }495 496 if ( isset( $plugin_file ) && $plugin_file ) {497 // if AJAX; show direct update link as first possible solution. 498 if ( wp_doing_ajax() ) {499 $update_link = wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $plugin_file, 'upgrade-plugin_' . $plugin_file );500 /* translators: %s plugin update link */501 $updater->strings['download_failed'] = sprintf( __( 'Download failed. <a href="%s">Click here to try another method</a>.', 'advanced-ads' ), $update_link );502 } else {503 /* translators: %s download failed knowledgebase link */504 $updater->strings['download_failed'] = sprintf( __( 'Download failed. <a href="%s" target="_blank">Click here to learn why</a>.', 'advanced-ads' ), 'https://wpadvancedads.com/manual/download-failed-updating-add-ons/#utm_source=advanced-ads&utm_medium=link&utm_campaign=download-failed' );505 }472 $key = 'name'; 473 $value = $updater->skin->plugin_info['Name']; 474 } 475 476 $add_on = $this->get_installed_add_on_by_key( $key, $value ); 477 if ( ! $add_on || ! isset( $add_on['path'] ) ) { 478 return $reply; 479 } 480 481 $plugin_file = plugin_basename( $add_on['path'] ); 482 if ( wp_doing_ajax() ) { 483 $update_link = wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $plugin_file, 'upgrade-plugin_' . $plugin_file ); 484 /* translators: %s plugin update link */ 485 $updater->strings['download_failed'] = sprintf( __( 'Download failed. <a href="%s">Click here to try another method</a>.', 'advanced-ads' ), $update_link ); 486 } else { 487 /* translators: %s download failed knowledgebase link */ 488 $updater->strings['download_failed'] = sprintf( __( 'Download failed. <a href="%s" target="_blank">Click here to learn why</a>.', 'advanced-ads' ), 'https://wpadvancedads.com/manual/download-failed-updating-add-ons/#utm_source=advanced-ads&utm_medium=link&utm_campaign=download-failed' ); 506 489 } 507 490 … … 512 495 * Search if a name is in the add-on array and return the add-on data of it 513 496 * 514 * @param string $name name of an add-on. 497 * @param string $key key to search for. 498 * @param string $value value to search for. 515 499 * 516 500 * @return array array with the add-on data 517 501 */ 518 private function get_installed_add_on_by_name( $name = '' ) { 502 private function get_installed_add_on_by_key( $key, $value ) { 503 // Early bail!! 504 if ( empty( $key ) || empty( $value ) ) { 505 return null; 506 } 507 519 508 $add_ons = Data::get_addons(); 520 521 509 if ( is_array( $add_ons ) ) { 522 foreach ( $add_ons as $ key => $_add_on ) {523 if ( $ _add_on['name'] === $name ) {524 return $ _add_on;510 foreach ( $add_ons as $add_on ) { 511 if ( $add_on[ $key ] === $value ) { 512 return $add_on; 525 513 } 526 514 } … … 570 558 // Early bail!! 571 559 if ( 572 self::API_ENDPOINT !== $url560 Constants::API_ENDPOINT !== $url 573 561 || ( 574 562 empty( $parsed_args['body']['edd_action'] ) -
advanced-ads/trunk/advanced-ads.php
r3283205 r3298118 11 11 * @wordpress-plugin 12 12 * Plugin Name: Advanced Ads 13 * Version: 2.0. 813 * Version: 2.0.9 14 14 * Description: Manage and optimize your ads in WordPress 15 15 * Plugin URI: https://wpadvancedads.com … … 38 38 39 39 define( 'ADVADS_FILE', __FILE__ ); 40 define( 'ADVADS_VERSION', '2.0. 8' );40 define( 'ADVADS_VERSION', '2.0.9' ); 41 41 42 42 // Load the autoloader. -
advanced-ads/trunk/classes/display-conditions.php
r3253289 r3298118 202 202 * 203 203 * @param array $options options of the condition. 204 * @param mixed $ad false orAd object.204 * @param Ad $ad Ad object. 205 205 * 206 206 * @return bool false, if ad can’t be delivered 207 207 */ 208 public static function frontend_check( $options = [], $ad = false ) { 208 public static function frontend_check( $options = [], $ad ) { 209 // Early bail!! 210 if ( ! $ad ) { 211 return true; 212 } 213 209 214 $display_conditions = self::get_instance()->conditions; 210 215 … … 936 941 $operator = 'is'; 937 942 } 938 939 $post = $ad->get_prop( 'ad_args.post' ); 943 $post = $ad->get_prop( 'ad_args.post' ) ?? null; 940 944 $post_type = $post['post_type'] ?? false; 941 945 -
advanced-ads/trunk/classes/frontend_checks.php
r3253289 r3298118 86 86 */ 87 87 public function enqueue_scripts() { 88 if ( advads_is_amp() ) {88 if ( Conditional::is_amp() ) { 89 89 return; 90 90 } … … 458 458 $notices = Advanced_Ads_Ad_Health_Notices::get_number_of_notices(); 459 459 460 if ( ! advads_is_amp() ) {460 if ( ! Conditional::is_amp() ) { 461 461 $warnings = 0; // Will be updated using JS. 462 462 } else { … … 679 679 echo ob_get_clean(); 680 680 681 if ( advads_is_amp() ) {681 if ( Conditional::is_amp() ) { 682 682 return; 683 683 } … … 1068 1068 } 1069 1069 1070 if ( advads_is_amp() ) {1070 if ( Conditional::is_amp() ) { 1071 1071 return $content; 1072 1072 } -
advanced-ads/trunk/includes/admin/class-addon-updater.php
r3257709 r3298118 10 10 namespace AdvancedAds\Admin; 11 11 12 use AdvancedAds\Constants; 13 use AdvancedAds\Utilities\Data; 12 14 use Advanced_Ads_Admin_Licenses; 13 use AdvancedAds\Utilities\Data;14 15 use AdvancedAds\Framework\Interfaces\Integration_Interface; 15 16 … … 73 74 74 75 ( new EDD_Updater( 75 Advanced_Ads_Admin_Licenses::API_ENDPOINT,76 Constants::API_ENDPOINT, 76 77 $_add_on['path'], 77 78 [ 78 79 'version' => $_add_on['version'], 79 80 'license' => $license_key, 80 'item_id' => Advanced_Ads_Admin_Licenses::ADDON_SLUGS_ID[ $options_slug ] ?? false,81 'item_id' => Constants::ADDON_SLUGS_ID[ $options_slug ] ?? false, 81 82 'author' => 'Advanced Ads', 82 83 ] -
advanced-ads/trunk/includes/class-constants.php
r3283205 r3298118 175 175 '1.1.0' => 'advanced-ads-browser-language', // Browser Language. 176 176 ]; 177 178 /** 179 * License API endpoint URL 180 * 181 * @const string 182 */ 183 const API_ENDPOINT = 'https://wpadvancedads.com/license-api/'; 184 185 /** 186 * Add-on slugs and their EDD ID 187 * 188 * @const array 189 */ 190 const ADDON_SLUGS_ID = [ 191 'advanced-ads-gam' => 215545, 192 'advanced-ads-layer' => 686, 193 'advanced-ads-pro' => 1742, 194 'advanced-ads-responsive' => 678, 195 'advanced-ads-selling' => 35300, 196 'advanced-ads-sticky' => 683, 197 'advanced-ads-tracking' => 638, 198 'slider-ads' => 1168, 199 ]; 177 200 } -
advanced-ads/trunk/includes/frontend/class-ad-display-condition.php
r3253289 r3298118 36 36 37 37 /** 38 * Check if ads are disabled.39 *40 * @return bool41 */42 public function is_ad_disabled(): bool {43 return defined( 'ADVADS_ADS_DISABLED' ) && ADVADS_ADS_DISABLED;44 }45 46 /**47 38 * Get the disabled id. 48 39 * … … 71 62 72 63 // Early bail!! 73 if ( $this->is_ad_disabled() ) {64 if ( Conditional::is_ad_disabled() ) { 74 65 return; 75 66 } -
advanced-ads/trunk/includes/frontend/class-manager.php
r3253289 r3298118 10 10 namespace AdvancedAds\Frontend; 11 11 12 use AdvancedAds\Utilities\Conditional; 12 13 use AdvancedAds\Framework\Interfaces\Integration_Interface; 13 14 … … 60 61 $this->page_display->run_checks(); 61 62 62 if ( ! $this->page_display->is_ad_disabled() ) {63 if ( ! Conditional::is_ad_disabled() ) { 63 64 do_action( 'advanced-ads-frontend' ); 64 65 } -
advanced-ads/trunk/includes/frontend/class-scripts.php
r3253289 r3298118 14 14 use Advanced_Ads_Privacy; 15 15 use AdvancedAds\Utilities\WordPress; 16 use AdvancedAds\Utilities\Conditional; 16 17 use AdvancedAds\Framework\Utilities\Params; 17 18 use AdvancedAds\Framework\Interfaces\Integration_Interface; … … 41 42 */ 42 43 public function enqueue_scripts(): void { 43 if ( advads_is_amp() ) {44 if ( Conditional::is_amp() ) { 44 45 return; 45 46 } … … 99 100 ); 100 101 101 if ( advads_is_amp() ) {102 if ( Conditional::is_amp() ) { 102 103 return; 103 104 } … … 136 137 */ 137 138 public function print_footer_scripts(): void { 138 if ( advads_is_amp() ) {139 if ( Conditional::is_amp() ) { 139 140 return; 140 141 } -
advanced-ads/trunk/includes/importers/class-manager.php
r3145275 r3298118 12 12 use WP_Error; 13 13 use AdvancedAds\Utilities\WordPress; 14 use AdvancedAds\Utilities\Conditional; 14 15 use AdvancedAds\Framework\Utilities\Params; 15 16 use AdvancedAds\Framework\Interfaces\Integration_Interface; … … 69 70 public function handle_action(): void { 70 71 // Early bail!! 72 if ( ! Conditional::user_cap( 'advanced_ads_edit_ads' ) ) { 73 return; 74 } 75 71 76 $action = WordPress::current_action(); 72 77 -
advanced-ads/trunk/includes/utilities/class-conditional.php
r3253289 r3298118 121 121 122 122 /** 123 * Check if ads are disabled. 124 * 125 * @return bool 126 */ 127 public static function is_ad_disabled(): bool { 128 return defined( 'ADVADS_ADS_DISABLED' ) && ADVADS_ADS_DISABLED; 129 } 130 131 /** 123 132 * Check if any add-on is activated 124 133 * 125 134 * @return bool true if there is any add-on activated 126 135 */ 127 public static function is_any_addon_activated() {136 public static function is_any_addon_activated(): bool { 128 137 return has_action( 'advanced-ads-loaded' ); 138 } 139 140 /** 141 * Check if the current page is an AMP page. 142 * 143 * @return bool 144 */ 145 public static function is_amp(): bool { 146 return function_exists( 'advads_is_amp' ) && advads_is_amp(); 129 147 } 130 148 … … 136 154 public static function is_ua_bot(): bool { 137 155 // show ads on AMP version also for bots in order to allow Google (and maybe others) to cache the page. 138 if ( advads_is_amp() ) {156 if ( self::is_amp() ) { 139 157 return false; 140 158 } -
advanced-ads/trunk/includes/utilities/class-data.php
r3257709 r3298118 44 44 'advanced-ads-sticky', 45 45 'advanced-ads-tracking', 46 'slider-ads', 46 47 ]; 47 48 -
advanced-ads/trunk/languages/advanced-ads.pot
r3283205 r3298118 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Advanced Ads 2.0. 7\n"5 "Project-Id-Version: Advanced Ads 2.0.8\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: 2025-0 4-28T07:32:04+00:00\n"12 "POT-Creation-Date: 2025-05-21T13:33:32+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.11.0\n" … … 280 280 msgstr "" 281 281 282 #: admin/includes/class-licenses.php: 86282 #: admin/includes/class-licenses.php:65 283 283 msgid "Error while trying to register the license. Please contact support." 284 284 msgstr "" 285 285 286 #: admin/includes/class-licenses.php: 91286 #: admin/includes/class-licenses.php:70 287 287 #: admin/views/setting-license.php:84 288 288 msgid "Please enter a valid license key" 289 289 msgstr "" 290 290 291 #: admin/includes/class-licenses.php:1 32292 #: admin/includes/class-licenses.php:3 33291 #: admin/includes/class-licenses.php:111 292 #: admin/includes/class-licenses.php:312 293 293 msgid "The license status does not change as long as ADVANCED_ADS_SHOW_LICENSE_RESPONSE is enabled in wp-config.php." 294 294 msgstr "" 295 295 296 #: admin/includes/class-licenses.php:130 297 msgid "License couldn’t be activated. Please try again later." 298 msgstr "" 299 300 #: admin/includes/class-licenses.php:149 301 msgid "This is the bundle license key." 302 msgstr "" 303 304 #: admin/includes/class-licenses.php:150 305 msgid "This is not the correct key for this add-on." 306 msgstr "" 307 296 308 #: admin/includes/class-licenses.php:151 297 msgid "License couldn’t be activated. Please try again later."298 msgstr ""299 300 #: admin/includes/class-licenses.php:170301 msgid "This is the bundle license key."302 msgstr ""303 304 #: admin/includes/class-licenses.php:171305 msgid "This is not the correct key for this add-on."306 msgstr ""307 308 #: admin/includes/class-licenses.php:172309 309 msgid "There are no activations left." 310 310 msgstr "" 311 311 312 312 #. translators: %1$s is a starting link tag, %2$s is the closing one. 313 #: admin/includes/class-licenses.php:1 76313 #: admin/includes/class-licenses.php:155 314 314 msgid "You can manage activations in %1$syour account%2$s." 315 315 msgstr "" 316 316 317 317 #. translators: %1$s is a starting link tag, %2$s is the closing one. 318 #: admin/includes/class-licenses.php:1 82318 #: admin/includes/class-licenses.php:161 319 319 msgid "%1$sUpgrade%2$s for more activations." 320 320 msgstr "" 321 321 322 322 #. translators: %s is a string containing information about the issue. 323 #: admin/includes/class-licenses.php:1 96323 #: admin/includes/class-licenses.php:175 324 324 msgid "License is invalid. Reason: %s" 325 325 msgstr "" 326 326 327 327 #. translators: %s is a list of server information like IP address. Just keep it as is. 328 #: admin/includes/class-licenses.php:2 36328 #: admin/includes/class-licenses.php:215 329 329 msgid "Your request was blocked by our firewall. Please send us the following information to unblock you: %s." 330 330 msgstr "" 331 331 332 #: admin/includes/class-licenses.php:2 99332 #: admin/includes/class-licenses.php:278 333 333 msgid "Error while trying to disable the license. Please contact support." 334 334 msgstr "" 335 335 336 #: admin/includes/class-licenses.php:3 42337 #: admin/includes/class-licenses.php:3 66336 #: admin/includes/class-licenses.php:321 337 #: admin/includes/class-licenses.php:345 338 338 msgid "License couldn’t be deactivated. Please try again later." 339 339 msgstr "" 340 340 341 341 #. translators: %s plugin update link 342 #: admin/includes/class-licenses.php: 501342 #: admin/includes/class-licenses.php:485 343 343 msgid "Download failed. <a href=\"%s\">Click here to try another method</a>." 344 344 msgstr "" 345 345 346 346 #. translators: %s download failed knowledgebase link 347 #: admin/includes/class-licenses.php: 504347 #: admin/includes/class-licenses.php:488 348 348 msgid "Download failed. <a href=\"%s\" target=\"_blank\">Click here to learn why</a>." 349 349 msgstr "" 350 350 351 #: admin/includes/class-licenses.php:6 61351 #: admin/includes/class-licenses.php:649 352 352 msgid "License deactivated. Please try again later." 353 353 msgstr "" … … 521 521 #: admin/views/conditions/condition-string.php:9 522 522 #: admin/views/notices/adblock.php:11 523 #: classes/display-conditions.php:91 4523 #: classes/display-conditions.php:919 524 524 #: includes/admin/metaboxes/class-ad-layout.php:63 525 525 #: includes/admin/metaboxes/class-ad-types.php:63 … … 1127 1127 msgstr "" 1128 1128 1129 #: classes/display-conditions.php:28 01129 #: classes/display-conditions.php:285 1130 1130 msgid "parent page" 1131 1131 msgstr "" 1132 1132 1133 #: classes/display-conditions.php:28 11133 #: classes/display-conditions.php:286 1134 1134 msgid "post meta" 1135 1135 msgstr "" 1136 1136 1137 #: classes/display-conditions.php:28 21137 #: classes/display-conditions.php:287 1138 1138 msgid "page template" 1139 1139 msgstr "" 1140 1140 1141 #: classes/display-conditions.php:28 31141 #: classes/display-conditions.php:288 1142 1142 msgid "url parameters" 1143 1143 msgstr "" 1144 1144 1145 #: classes/display-conditions.php:2 861145 #: classes/display-conditions.php:291 1146 1146 msgid "accelerated mobile pages" 1147 1147 msgstr "" 1148 1148 1149 #: classes/display-conditions.php:31 01149 #: classes/display-conditions.php:315 1150 1150 #: classes/visitor-conditions.php:318 1151 1151 #: includes/admin/class-assets.php:130 … … 1156 1156 msgstr "" 1157 1157 1158 #: classes/display-conditions.php:31 01158 #: classes/display-conditions.php:315 1159 1159 #: classes/visitor-conditions.php:318 1160 1160 #: includes/admin/class-assets.php:131 … … 1162 1162 msgstr "" 1163 1163 1164 #: classes/display-conditions.php:6 391164 #: classes/display-conditions.php:644 1165 1165 msgctxt "display the terms search field on ad edit page" 1166 1166 msgid "add more terms" 1167 1167 msgstr "" 1168 1168 1169 #: classes/display-conditions.php:6 451169 #: classes/display-conditions.php:650 1170 1170 msgid "term name or id" 1171 1171 msgstr "" 1172 1172 1173 #: classes/display-conditions.php:7 271173 #: classes/display-conditions.php:732 1174 1174 msgid "ID" 1175 1175 msgstr "" 1176 1176 1177 #: classes/display-conditions.php:7 271177 #: classes/display-conditions.php:732 1178 1178 #: includes/admin/class-placement-edit-modal.php:120 1179 1179 #: views/admin/placements/quick-edit.php:14 … … 1182 1182 msgstr "" 1183 1183 1184 #: classes/display-conditions.php:7 291184 #: classes/display-conditions.php:734 1185 1185 #: includes/abstracts/abstract-ad.php:830 1186 1186 #: includes/admin/class-groups-list-table.php:362 … … 1190 1190 msgstr "" 1191 1191 1192 #: classes/display-conditions.php:73 11192 #: classes/display-conditions.php:736 1193 1193 #: includes/admin/class-groups-list-table.php:362 1194 1194 #: views/admin/tables/ads/column-date.php:18 … … 1196 1196 msgstr "" 1197 1197 1198 #: classes/display-conditions.php:75 31198 #: classes/display-conditions.php:758 1199 1199 msgid "title or id" 1200 1200 msgstr "" 1201 1201 1202 #: classes/display-conditions.php:8 271202 #: classes/display-conditions.php:832 1203 1203 #: includes/array_ad_conditions.php:59 1204 1204 msgid "Home Page" 1205 1205 msgstr "" 1206 1206 1207 #: classes/display-conditions.php:8 281207 #: classes/display-conditions.php:833 1208 1208 #: includes/array_ad_conditions.php:60 1209 1209 msgid "show on Home page" 1210 1210 msgstr "" 1211 1211 1212 #: classes/display-conditions.php:83 21212 #: classes/display-conditions.php:837 1213 1213 #: includes/array_ad_conditions.php:64 1214 1214 msgid "Singular Pages" 1215 1215 msgstr "" 1216 1216 1217 #: classes/display-conditions.php:83 31217 #: classes/display-conditions.php:838 1218 1218 #: includes/array_ad_conditions.php:65 1219 1219 msgid "show on singular pages/posts" 1220 1220 msgstr "" 1221 1221 1222 #: classes/display-conditions.php:8 371222 #: classes/display-conditions.php:842 1223 1223 #: includes/array_ad_conditions.php:69 1224 1224 msgid "Archive Pages" 1225 1225 msgstr "" 1226 1226 1227 #: classes/display-conditions.php:8 381227 #: classes/display-conditions.php:843 1228 1228 #: includes/array_ad_conditions.php:70 1229 1229 msgid "show on any type of archive page (category, tag, author and date)" 1230 1230 msgstr "" 1231 1231 1232 #: classes/display-conditions.php:84 21232 #: classes/display-conditions.php:847 1233 1233 #: includes/array_ad_conditions.php:74 1234 1234 msgid "Search Results" 1235 1235 msgstr "" 1236 1236 1237 #: classes/display-conditions.php:84 31237 #: classes/display-conditions.php:848 1238 1238 #: includes/array_ad_conditions.php:75 1239 1239 msgid "show on search result pages" 1240 1240 msgstr "" 1241 1241 1242 #: classes/display-conditions.php:8 471242 #: classes/display-conditions.php:852 1243 1243 #: includes/array_ad_conditions.php:79 1244 1244 msgid "404 Page" 1245 1245 msgstr "" 1246 1246 1247 #: classes/display-conditions.php:8 481247 #: classes/display-conditions.php:853 1248 1248 #: includes/array_ad_conditions.php:80 1249 1249 msgid "show on 404 error page" 1250 1250 msgstr "" 1251 1251 1252 #: classes/display-conditions.php:85 21252 #: classes/display-conditions.php:857 1253 1253 #: includes/array_ad_conditions.php:84 1254 1254 msgid "Attachment Pages" 1255 1255 msgstr "" 1256 1256 1257 #: classes/display-conditions.php:85 31257 #: classes/display-conditions.php:858 1258 1258 #: includes/array_ad_conditions.php:85 1259 1259 msgid "show on attachment pages" 1260 1260 msgstr "" 1261 1261 1262 #: classes/display-conditions.php:8 571262 #: classes/display-conditions.php:862 1263 1263 #: includes/array_ad_conditions.php:89 1264 1264 msgid "Secondary Queries" 1265 1265 msgstr "" 1266 1266 1267 #: classes/display-conditions.php:8 581267 #: classes/display-conditions.php:863 1268 1268 #: includes/array_ad_conditions.php:90 1269 1269 msgid "allow ads in secondary queries" 1270 1270 msgstr "" 1271 1271 1272 #: classes/display-conditions.php:86 21272 #: classes/display-conditions.php:867 1273 1273 msgid "RSS Feed" 1274 1274 msgstr "" 1275 1275 1276 #: classes/display-conditions.php:86 31276 #: classes/display-conditions.php:868 1277 1277 msgid "allow ads in RSS Feed" 1278 1278 msgstr "" 1279 1279 1280 #: classes/display-conditions.php:8 671280 #: classes/display-conditions.php:872 1281 1281 msgid "REST API" 1282 1282 msgstr "" 1283 1283 1284 #: classes/display-conditions.php:8 681284 #: classes/display-conditions.php:873 1285 1285 msgid "allow ads in REST API" 1286 1286 msgstr "" 1287 1287 1288 #: classes/display-conditions.php:90 31288 #: classes/display-conditions.php:908 1289 1289 msgid "older than" 1290 1290 msgstr "" 1291 1291 1292 #: classes/display-conditions.php:90 41292 #: classes/display-conditions.php:909 1293 1293 msgid "younger than" 1294 1294 msgstr "" 1295 1295 1296 #: classes/display-conditions.php:9 091296 #: classes/display-conditions.php:914 1297 1297 msgid "days" 1298 1298 msgstr "" 1299 1299 1300 #: classes/display-conditions.php:91 21300 #: classes/display-conditions.php:917 1301 1301 msgid "Display ads based on the age of a page or post." 1302 1302 msgstr "" … … 1604 1604 #: includes/abstracts/abstract-placement-type.php:63 1605 1605 #: includes/class-widget.php:128 1606 #: includes/utilities/class-data.php:29 51606 #: includes/utilities/class-data.php:296 1607 1607 #: modules/gutenberg/includes/class-gutenberg.php:136 1608 1608 #: views/admin/tables/ads/filters.php:75 … … 1616 1616 #: includes/class-entities.php:44 1617 1617 #: includes/class-widget.php:135 1618 #: includes/utilities/class-data.php:28 81618 #: includes/utilities/class-data.php:289 1619 1619 #: modules/gutenberg/includes/class-gutenberg.php:135 1620 1620 #: views/admin/tables/groups/edit-form-modal.php:113 … … 1921 1921 1922 1922 #. Translators: 1: add-on name 2: admin URL to license page 1923 #: includes/admin/class-addon-updater.php:13 11923 #: includes/admin/class-addon-updater.php:132 1924 1924 msgid "There might be a new version of %1$s. Please <strong>provide a valid license key</strong> in order to receive updates and support <a href=\"%2$s\">on this page</a>." 1925 1925 msgstr "" … … 2170 2170 #: includes/admin/class-list-filters.php:122 2171 2171 #: modules/gadsense/admin/views/adsense-ad-parameters.php:131 2172 #: modules/gadsense/includes/class-ad-type-adsense.php:3 02172 #: modules/gadsense/includes/class-ad-type-adsense.php:31 2173 2173 msgid "Responsive" 2174 2174 msgstr "" … … 2913 2913 #: includes/admin/pages/class-placements.php:44 2914 2914 #: includes/class-widget.php:121 2915 #: includes/utilities/class-data.php:30 22915 #: includes/utilities/class-data.php:303 2916 2916 #: modules/gutenberg/includes/class-gutenberg.php:137 2917 2917 #: views/admin/tables/ads/column-used.php:34 … … 3278 3278 3279 3279 #: includes/class-widget.php:119 3280 #: includes/utilities/class-data.php:28 63280 #: includes/utilities/class-data.php:287 3281 3281 #: modules/gutenberg/includes/class-gutenberg.php:133 3282 3282 msgid "--empty--" … … 3438 3438 msgstr "" 3439 3439 3440 #: includes/importers/class-manager.php:10 43440 #: includes/importers/class-manager.php:109 3441 3441 msgid "History deleted successfully." 3442 3442 msgstr "" … … 4116 4116 4117 4117 #: modules/gadsense/admin/views/adsense-account.php:135 4118 #: modules/gadsense/includes/class-ad-type-adsense.php:9 54118 #: modules/gadsense/includes/class-ad-type-adsense.php:96 4119 4119 #: modules/gadsense/includes/types/type-adsense.php:142 4120 4120 msgid "The Publisher ID has an incorrect format. (must start with \"pub-\")" … … 4211 4211 4212 4212 #: modules/gadsense/admin/views/adsense-ad-parameters.php:132 4213 #: modules/gadsense/includes/class-ad-type-adsense.php:3 14213 #: modules/gadsense/includes/class-ad-type-adsense.php:32 4214 4214 msgid "Multiplex" 4215 4215 msgstr "" 4216 4216 4217 4217 #: modules/gadsense/admin/views/adsense-ad-parameters.php:134 4218 #: modules/gadsense/includes/class-ad-type-adsense.php:3 24218 #: modules/gadsense/includes/class-ad-type-adsense.php:33 4219 4219 msgid "Link ads" 4220 4220 msgstr "" 4221 4221 4222 4222 #: modules/gadsense/admin/views/adsense-ad-parameters.php:137 4223 #: modules/gadsense/includes/class-ad-type-adsense.php:3 34223 #: modules/gadsense/includes/class-ad-type-adsense.php:34 4224 4224 msgid "Link ads (Responsive)" 4225 4225 msgstr "" 4226 4226 4227 4227 #: modules/gadsense/admin/views/adsense-ad-parameters.php:139 4228 #: modules/gadsense/includes/class-ad-type-adsense.php:3 44228 #: modules/gadsense/includes/class-ad-type-adsense.php:35 4229 4229 msgid "In-article" 4230 4230 msgstr "" 4231 4231 4232 4232 #: modules/gadsense/admin/views/adsense-ad-parameters.php:140 4233 #: modules/gadsense/includes/class-ad-type-adsense.php:3 54233 #: modules/gadsense/includes/class-ad-type-adsense.php:36 4234 4234 msgid "In-feed" 4235 4235 msgstr "" … … 4386 4386 msgstr "" 4387 4387 4388 #: modules/gadsense/includes/class-ad-type-adsense.php: 294389 #: modules/gadsense/includes/class-ad-type-adsense.php:4 74388 #: modules/gadsense/includes/class-ad-type-adsense.php:30 4389 #: modules/gadsense/includes/class-ad-type-adsense.php:48 4390 4390 msgid "Normal" 4391 4391 msgstr "" 4392 4392 4393 #: modules/gadsense/includes/class-ad-type-adsense.php:13 64393 #: modules/gadsense/includes/class-ad-type-adsense.php:137 4394 4394 #: modules/gadsense/includes/types/type-adsense.php:183 4395 4395 msgid "Your AdSense Publisher ID is missing." … … 5012 5012 msgstr "" 5013 5013 5014 #: public/views/ad-debug.php:2 05014 #: public/views/ad-debug.php:22 5015 5015 msgid "Ad debug output" 5016 5016 msgstr "" 5017 5017 5018 #: public/views/ad-debug.php:2 45018 #: public/views/ad-debug.php:26 5019 5019 msgid "Find solutions in the manual" 5020 5020 msgstr "" -
advanced-ads/trunk/modules/adblock-finder/public/public.php
r3253289 r3298118 7 7 */ 8 8 9 use AdvancedAds\Options; 10 use AdvancedAds\Utilities\Conditional; 9 11 use AdvancedAds\Framework\Utilities\Arr; 10 use AdvancedAds\Options;11 12 12 13 /** … … 29 30 */ 30 31 public function print_adblock_check_js() { 31 if ( advads_is_amp() ) {32 if ( Conditional::is_amp() ) { 32 33 return; 33 34 } -
advanced-ads/trunk/modules/gadsense/includes/class-ad-type-adsense.php
r3253289 r3298118 11 11 12 12 use AdvancedAds\Abstracts\Ad; 13 use AdvancedAds\Utilities\Conditional; 13 14 use AdvancedAds\Interfaces\Ad_Interface; 14 15 … … 263 264 264 265 // Prevent output on AMP pages. 265 if ( advads_is_amp() ) {266 if ( Conditional::is_amp() ) { 266 267 return ''; 267 268 } -
advanced-ads/trunk/modules/gadsense/public/public.php
r3253289 r3298118 1 1 <?php // phpcs:ignore WordPress.Files.FileName 2 3 use AdvancedAds\Utilities\Conditional; 2 4 3 5 /** … … 55 57 } 56 58 57 if ( defined( 'ADVADS_ADS_DISABLED' ) || advads_is_amp() ) {59 if ( Conditional::is_ad_disabled() || Conditional::is_amp() ) { 58 60 return; 59 61 } … … 149 151 150 152 if ( 151 // check if ads are disabled. 152 ( defined( 'ADVADS_ADS_DISABLED' ) && ADVADS_ADS_DISABLED ) 153 Conditional::is_ad_disabled() 153 154 // check if this an AMP page, we're inside `wp` action so it's safe to use. 154 || ( ! function_exists( 'advads_is_amp' ) || ! advads_is_amp())155 || ! Conditional::is_amp() 155 156 ) { 156 157 return; -
advanced-ads/trunk/modules/privacy/classes/class-privacy.php
r3253289 r3298118 2 2 3 3 use AdvancedAds\Abstracts\Ad; 4 use AdvancedAds\Utilities\Conditional; 5 use AdvancedAds\Framework\Utilities\Str; 4 6 use AdvancedAds\Framework\Utilities\Params; 5 use AdvancedAds\Framework\Utilities\Str;6 7 7 8 /** … … 57 58 public function final_ad_output( $output, Ad $ad ) { 58 59 if ( 59 advads_is_amp() ||60 Conditional::is_amp() || 60 61 ! $this->ad_type_needs_consent( $ad->get_type() ) || 61 62 ( ! $ad->is_type( 'adsense' ) && $ad->get_prop( 'privacy.ignore-consent' ) ) … … 239 240 */ 240 241 private function parse_state() { 241 if ( empty( $this->options['enabled'] ) || advads_is_amp() ) {242 if ( empty( $this->options['enabled'] ) || Conditional::is_amp() ) { 242 243 return 'not_needed'; 243 244 } -
advanced-ads/trunk/packages/autoload.php
r2983598 r3298118 15 15 } 16 16 } 17 trigger_error( 18 $err, 19 E_USER_ERROR 20 ); 17 throw new RuntimeException($err); 21 18 } 22 19 -
advanced-ads/trunk/packages/composer/InstalledVersions.php
r3265208 r3298118 27 27 class InstalledVersions 28 28 { 29 /** 30 * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to 31 * @internal 32 */ 33 private static $selfDir = null; 34 29 35 /** 30 36 * @var mixed[]|null … … 324 330 325 331 /** 332 * @return string 333 */ 334 private static function getSelfDir() 335 { 336 if (self::$selfDir === null) { 337 self::$selfDir = strtr(__DIR__, '\\', '/'); 338 } 339 340 return self::$selfDir; 341 } 342 343 /** 326 344 * @return array[] 327 345 * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}> … … 337 355 338 356 if (self::$canGetVendors) { 339 $selfDir = s trtr(__DIR__, '\\', '/');357 $selfDir = self::getSelfDir(); 340 358 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { 341 359 $vendorDir = strtr($vendorDir, '\\', '/'); -
advanced-ads/trunk/public/class-advanced-ads.php
r3257709 r3298118 397 397 $injection_enabled = $options['content-injection-enabled'] ?? 'off'; 398 398 399 if ( ( $injection_enabled === 'off' || 0 === $archive_injection_count ) && ( ! is_singular( $public_post_types ) || ( ! advads_is_amp() && ! $this->in_the_loop() && ! $this->was_in_the_loop ) ) ) {399 if ( ( $injection_enabled === 'off' || 0 === $archive_injection_count ) && ( ! is_singular( $public_post_types ) || ( ! Conditional::is_amp() && ! $this->in_the_loop() && ! $this->was_in_the_loop ) ) ) { 400 400 return false; 401 401 } … … 425 425 * @return bool `true` if ads are disabled 426 426 */ 427 $ads_disabled = apply_filters( 'advanced-ads-disabled-ads', defined( 'ADVADS_ADS_DISABLED'), $options );427 $ads_disabled = apply_filters( 'advanced-ads-disabled-ads', Conditional::is_ad_disabled(), $options ); 428 428 429 429 if ( $ads_disabled ) { -
advanced-ads/trunk/public/views/ad-debug.php
r3253289 r3298118 12 12 */ 13 13 14 if ( ! advads_is_amp() ) : 14 use AdvancedAds\Utilities\Conditional; 15 16 if ( ! Conditional::is_amp() ) : 15 17 ob_start(); 16 18 echo Advanced_Ads_Utils::get_inline_asset( ob_get_clean() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -
advanced-ads/trunk/readme.txt
r3283205 r3298118 3 3 Tags: ads, adsense, amazon, affiliate, ad manager 4 4 Requires at least: 5.7 5 Tested up to: 6. 75 Tested up to: 6.8 6 6 Requires PHP: 7.4 7 Stable tag: 2.0. 87 Stable tag: 2.0.9 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 361 361 == Changelog == 362 362 363 = 2.0.9 (May 21, 2025) = 364 365 - Improvement: improve amp conditions 366 - Improvement: Test plugin compatibility with WordPress 6.8. 367 - Improvement: add capability check in importer 368 - Improvement: standardize `ADVADS_ADS_DISABLED` check 369 - Improvement: null checks before accessing ad properties 370 - Fix: update failure help link only for Advanced Ads add-ons 371 363 372 = 2.0.8 (April 28, 2025) = 364 373 -
advanced-ads/trunk/wp.advads
r3283205 r3298118 3 3 "name": "Advanced Ads", 4 4 "description": "Manage and optimize your ads in WordPress", 5 "version": "2.0. 8",5 "version": "2.0.9", 6 6 "requireWP": "5.7", 7 7 "requirePHP": "7.4",
Note: See TracChangeset
for help on using the changeset viewer.