Changeset 3134733
- Timestamp:
- 08/13/2024 08:25:51 AM (16 months ago)
- Location:
- advanced-ads
- Files:
-
- 6 added
- 4 deleted
- 32 edited
- 1 copied
-
tags/1.53.1 (copied) (copied from advanced-ads/trunk)
-
tags/1.53.1/advanced-ads.php (modified) (2 diffs)
-
tags/1.53.1/classes/plugin.php (modified) (2 diffs)
-
tags/1.53.1/classes/upgrades.php (modified) (2 diffs)
-
tags/1.53.1/includes/installation/class-capabilities.php (modified) (2 diffs)
-
tags/1.53.1/includes/installation/class-install.php (modified) (2 diffs)
-
tags/1.53.1/languages/advanced-ads.pot (modified) (3 diffs)
-
tags/1.53.1/packages/advanced-ads/framework/src/class-assets-registry.php (modified) (4 diffs)
-
tags/1.53.1/packages/advanced-ads/framework/src/installation/class-install.php (modified) (1 diff)
-
tags/1.53.1/packages/advanced-ads/framework/src/notices/class-notice.php (modified) (2 diffs)
-
tags/1.53.1/packages/advanced-ads/framework/src/utilities/class-arr.php (added)
-
tags/1.53.1/packages/advanced-ads/framework/src/utilities/class-array.php (deleted)
-
tags/1.53.1/packages/advanced-ads/framework/src/utilities/class-formatting.php (modified) (3 diffs)
-
tags/1.53.1/packages/advanced-ads/framework/src/utilities/class-html.php (added)
-
tags/1.53.1/packages/advanced-ads/framework/src/utilities/class-str.php (added)
-
tags/1.53.1/packages/advanced-ads/framework/src/utilities/class-string.php (deleted)
-
tags/1.53.1/packages/composer/LICENSE (modified) (2 diffs)
-
tags/1.53.1/packages/composer/autoload_classmap.php (modified) (1 diff)
-
tags/1.53.1/packages/composer/autoload_static.php (modified) (1 diff)
-
tags/1.53.1/packages/composer/installed.json (modified) (2 diffs)
-
tags/1.53.1/packages/composer/installed.php (modified) (3 diffs)
-
tags/1.53.1/readme.txt (modified) (2 diffs)
-
trunk/advanced-ads.php (modified) (2 diffs)
-
trunk/classes/plugin.php (modified) (2 diffs)
-
trunk/classes/upgrades.php (modified) (2 diffs)
-
trunk/includes/installation/class-capabilities.php (modified) (2 diffs)
-
trunk/includes/installation/class-install.php (modified) (2 diffs)
-
trunk/languages/advanced-ads.pot (modified) (3 diffs)
-
trunk/packages/advanced-ads/framework/src/class-assets-registry.php (modified) (4 diffs)
-
trunk/packages/advanced-ads/framework/src/installation/class-install.php (modified) (1 diff)
-
trunk/packages/advanced-ads/framework/src/notices/class-notice.php (modified) (2 diffs)
-
trunk/packages/advanced-ads/framework/src/utilities/class-arr.php (added)
-
trunk/packages/advanced-ads/framework/src/utilities/class-array.php (deleted)
-
trunk/packages/advanced-ads/framework/src/utilities/class-formatting.php (modified) (3 diffs)
-
trunk/packages/advanced-ads/framework/src/utilities/class-html.php (added)
-
trunk/packages/advanced-ads/framework/src/utilities/class-str.php (added)
-
trunk/packages/advanced-ads/framework/src/utilities/class-string.php (deleted)
-
trunk/packages/composer/LICENSE (modified) (2 diffs)
-
trunk/packages/composer/autoload_classmap.php (modified) (1 diff)
-
trunk/packages/composer/autoload_static.php (modified) (1 diff)
-
trunk/packages/composer/installed.json (modified) (2 diffs)
-
trunk/packages/composer/installed.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
advanced-ads/tags/1.53.1/advanced-ads.php
r3134243 r3134733 13 13 * Plugin URI: https://wpadvancedads.com 14 14 * Description: Manage and optimize your ads in WordPress 15 * Version: 1.53. 015 * Version: 1.53.1 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.53. 0' );36 define( 'ADVADS_VERSION', '1.53.1' ); 37 37 38 38 // Load the autoloader. -
advanced-ads/tags/1.53.1/classes/plugin.php
r3029416 r3134733 428 428 $this->update_internal_options( $this->internal_options ); 429 429 430 self::get_instance()->create_capabilities();430 Capabilities::get_instance()->create_capabilities(); 431 431 } 432 432 … … 545 545 */ 546 546 public function create_capabilities() { 547 _deprecated_function( __METHOD__, '1.47.0', 'AdvancedAds\Installation\Capabilities:: create_capabilities()' );548 549 ( new Capabilities())->create_capabilities();547 _deprecated_function( __METHOD__, '1.47.0', 'AdvancedAds\Installation\Capabilities::get_instance()->create_capabilities();' ); 548 549 Capabilities::get_instance()->create_capabilities(); 550 550 } 551 551 -
advanced-ads/tags/1.53.1/classes/upgrades.php
r2983598 r3134733 1 <?php 1 <?php // phpcs:ignoreFile 2 3 use AdvancedAds\Installation\Capabilities; 2 4 3 5 /** … … 15 17 $internal_options = Advanced_Ads_Plugin::get_instance()->internal_options(); 16 18 17 // the'advanced_ads_edit_ads' capability was added to Entities::POST_TYPE_AD post type in this version19 // 'advanced_ads_edit_ads' capability was added to Entities::POST_TYPE_AD post type in this version 18 20 if ( ! isset( $internal_options['version'] ) || version_compare( $internal_options['version'], '1.7.2', '<' ) ) { 19 Advanced_Ads_Plugin::get_instance()->create_capabilities();21 Capabilities::get_instance()->create_capabilities(); 20 22 } 21 23 -
advanced-ads/tags/1.53.1/includes/installation/class-capabilities.php
r2986093 r3134733 16 16 */ 17 17 class Capabilities { 18 19 /** 20 * Instance 21 * 22 * @var object 23 */ 24 protected static $instance; 18 25 19 26 /** … … 36 43 public function __construct() { 37 44 $this->register_defaults(); 45 } 46 47 /** 48 * Get instance 49 * 50 * @return Capabilities 51 */ 52 public static function get_instance() { 53 // If the single instance hasn't been set, set it now. 54 if ( null === self::$instance ) { 55 self::$instance = new self(); 56 } 57 58 return self::$instance; 38 59 } 39 60 -
advanced-ads/tags/1.53.1/includes/installation/class-install.php
r2983598 r3134733 36 36 protected function activate(): void { 37 37 // TODO: inform modules. 38 ( new Capabilities())->create_capabilities();38 Capabilities::get_instance()->create_capabilities(); 39 39 } 40 40 … … 46 46 protected function deactivate(): void { 47 47 // TODO: inform modules. 48 ( new Capabilities())->remove_capabilities();48 Capabilities::get_instance()->remove_capabilities(); 49 49 } 50 50 -
advanced-ads/tags/1.53.1/languages/advanced-ads.pot
r3134243 r3134733 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Advanced Ads 1.5 2.4\n"5 "Project-Id-Version: Advanced Ads 1.53.0\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-08- 06T11:19:18+00:00\n"12 "POT-Creation-Date: 2024-08-13T08:25:00+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" … … 3130 3130 msgstr "" 3131 3131 3132 #: includes/installation/class-capabilities.php: 483132 #: includes/installation/class-capabilities.php:69 3133 3133 msgid "Allows changing plugin options" 3134 3134 msgstr "" 3135 3135 3136 #: includes/installation/class-capabilities.php: 543136 #: includes/installation/class-capabilities.php:75 3137 3137 msgid "Allows access to the Advanced Ads backend" 3138 3138 msgstr "" 3139 3139 3140 #: includes/installation/class-capabilities.php: 603140 #: includes/installation/class-capabilities.php:81 3141 3141 msgid "Allows editing ads" 3142 3142 msgstr "" 3143 3143 3144 #: includes/installation/class-capabilities.php: 663144 #: includes/installation/class-capabilities.php:87 3145 3145 msgid "Allows changing the placements page" 3146 3146 msgstr "" 3147 3147 3148 #: includes/installation/class-capabilities.php: 723148 #: includes/installation/class-capabilities.php:93 3149 3149 msgid "Enables shortcode button" 3150 3150 msgstr "" -
advanced-ads/tags/1.53.1/packages/advanced-ads/framework/src/class-assets-registry.php
r3035032 r3134733 16 16 /** 17 17 * Assets Registry. 18 * 19 * Script functions: 20 * 21 * @method void enqueue_script(string $handle) 22 * @method void dequeue_script(string $handle) 23 * @method void deregister_script(string $handle) 24 * @method bool register_script(string $handle, string|false $src, string[] $deps = [], string|bool|null $ver = false, array|bool $args = []) 25 * @method bool inline_script(string $handle, string $data, string $position = 'after') 26 * @method bool is_script(string $handle, string $status = 'enqueued') 27 * 28 * Style functions: 29 * 30 * @method void enqueue_style(string $handle) 31 * @method void dequeue_style(string $handle) 32 * @method void deregister_style(string $handle) 33 * @method bool register_style(string $handle, string|false $src, string[] $deps = [], string|bool|null $ver = false, string $media = 'all') 34 * @method bool inline_style(string $handle, string $data, ) 35 * @method bool is_style(string $handle, string $status = 'enqueued') 18 36 */ 19 class Assets_Registry implements Integration_Interface {37 abstract class Assets_Registry implements Integration_Interface { 20 38 21 39 /** 22 * Version of plugin local asset.40 * Base URL for plugin local assets. 23 41 * 24 * @ varstring42 * @return string 25 43 */ 26 const VERSION = '1.0.0';44 abstract public function get_base_url(): string; 27 45 28 46 /** 29 47 * Prefix to use in handle to make it unique. 30 48 * 31 * @ varstring49 * @return string 32 50 */ 33 const PREFIX = 'advads';51 abstract public function get_prefix(): string; 34 52 35 53 /** 36 * Enqueue stylesheet 37 * 38 * @param string $handle Name of the stylesheet. 39 * 40 * @return void 41 */ 42 public static function enqueue_style( $handle ): void { 43 wp_enqueue_style( self::prefix_it( $handle ) ); 44 } 45 46 /** 47 * Enqueue script 48 * 49 * @param string $handle Name of the script. 50 * 51 * @return void 52 */ 53 public static function enqueue_script( $handle ): void { 54 wp_enqueue_script( self::prefix_it( $handle ) ); 55 } 56 57 /** 58 * Prefix the handle 59 * 60 * @param string $handle Name of the asset. 54 * Version for plugin local assets. 61 55 * 62 56 * @return string 63 57 */ 64 public static function prefix_it( $handle ): string { 65 return self::PREFIX . '-' . $handle; 58 abstract public function get_version(): string; 59 60 /** 61 * Magic method to catch all calls to. 62 * 63 * @param string $name The name of the method. 64 * @param array $arguments The arguments passed to the method. 65 * 66 * @return mixed 67 */ 68 public function __call( $name, $arguments ) { 69 if ( preg_match( '/^(enqueue|dequeue|register|deregister|is|inline)_(script|style)$/', $name, $matches ) ) { 70 $action = $matches[1]; 71 $type = $matches[2]; 72 $handle = $this->prefix_it( $arguments[0] ); 73 $func = $this->resolve_function( $action . '_' . $type ); 74 $func_args = [ $handle ]; 75 76 switch ( $action ) { 77 case 'register': 78 $func_args[] = $this->resolve_url( $arguments[1] ); 79 $func_args[] = $arguments[2] ?? []; 80 $func_args[] = isset( $arguments[3] ) && ! empty( $arguments[3] ) ? $arguments[3] : $this->get_version(); 81 $func_args[] = $arguments[4] ?? ( 'script' === $type ? true : 'all' ); 82 break; 83 case 'is': 84 $func_args[] = $arguments[1] ?? 'enqueued'; 85 break; 86 case 'inline': 87 $func_args[] = $arguments[1] ?? ''; 88 if ( 'script' === $type ) { 89 $func_args[] = $arguments[2] ?? 'after'; 90 } 91 break; 92 default: 93 break; 94 } 95 96 return call_user_func_array( $func, $func_args ); 97 } 66 98 } 67 99 … … 72 104 */ 73 105 public function hooks(): void { 106 add_action( 'wp_enqueue_scripts', [ $this, 'register_assets' ], 0 ); 74 107 add_action( 'admin_enqueue_scripts', [ $this, 'register_assets' ], 0 ); 75 108 } … … 83 116 $this->register_styles(); 84 117 $this->register_scripts(); 118 } 119 120 /** 121 * Prefix the handle 122 * 123 * @param string $handle Name of the asset. 124 * 125 * @return string 126 */ 127 public function prefix_it( $handle ): string { 128 return $this->get_prefix() . '-' . $handle; 85 129 } 86 130 … … 100 144 101 145 /** 102 * Re gister stylesheet146 * Resolves the URL. 103 147 * 104 * @param string $handle Name of the stylesheet. Should be unique. 105 * @param string|bool $src URL of the stylesheet. 106 * @param string[] $deps Optional. An array of registered stylesheet handles this stylesheet depends on. 107 * @param string|bool|null $ver Optional. String specifying stylesheet version number. 108 * @param string $media Optional. The media for which this stylesheet has been defined. 148 * If the provided URL is an absolute URL or protocol-relative URL, it is returned as is. 149 * Otherwise, the base URL is prepended to the relative path. 109 150 * 110 * @return void 151 * @param string $src The source URL. 152 * 153 * @return string The resolved URL. 111 154 */ 112 private function re gister_style( $handle, $src, $deps = [], $ver = false, $media = 'all' ){113 if ( false === $ver) {114 $ver = self::VERSION;155 private function resolve_url( $src ): string { 156 if ( preg_match( '/^(https?:)?\/\//', $src ) ) { 157 return $src; 115 158 } 116 159 117 wp_register_style( self::prefix_it( $handle ), ADVADS_BASE_URL . $src, $deps, $ver, $media );160 return $this->get_base_url() . $src; 118 161 } 119 162 120 163 /** 121 * Re gister script164 * Resolves the function name. 122 165 * 123 * @param string $handle Name of the stylesheet. Should be unique. 124 * @param string|bool $src URL of the stylesheet. 125 * @param string[] $deps Optional. An array of registered stylesheet handles this stylesheet depends on. 126 * @param string|bool|null $ver Optional. String specifying stylesheet version number. 127 * @param bool $in_footer Optional. The media for which this stylesheet has been defined. 166 * @param string $name The name of the function. 128 167 * 129 * @return void168 * @return string 130 169 */ 131 private function register_script( $handle, $src, $deps = [], $ver = false, $in_footer = false ) { 132 if ( false === $ver ) { 133 $ver = self::VERSION; 134 } 170 private function resolve_function( $name ): string { 171 $method_map = [ 172 'is_script' => 'script_is', 173 'is_style' => 'style_is', 174 'inline_script' => 'add_inline_script', 175 'inline_style' => 'add_inline_style', 176 ]; 135 177 136 $new_src = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? $src : str_replace( '.js', '.min.js', $src ); 137 wp_register_script( self::prefix_it( $handle ), ADVADS_BASE_URL . $src, $deps, $ver, $in_footer ); 178 $name = $method_map[ $name ] ?? $name; 179 180 return 'wp_' . $name; 138 181 } 139 182 } -
advanced-ads/tags/1.53.1/packages/advanced-ads/framework/src/installation/class-install.php
r2983598 r3134733 49 49 */ 50 50 public function activation( $network_wide = false ): void { 51 register_uninstall_hook( $this->base_file, [ s elf::class, 'uninstall' ] );51 register_uninstall_hook( $this->base_file, [ static::class, 'uninstall' ] ); 52 52 53 53 if ( ! is_multisite() || ! $network_wide ) { -
advanced-ads/tags/1.53.1/packages/advanced-ads/framework/src/notices/class-notice.php
r2983598 r3134733 119 119 120 120 /** 121 * Serialize data .121 * Serialize data, for PHP version < 7.4.0 122 122 * 123 123 * @return string … … 134 134 135 135 /** 136 * Unserialize string. 136 * Return an array representing the serialized form the object. For PHP version >= 7.4.0 137 * 138 * @return array 139 */ 140 public function __serialize(): array { 141 return [ 142 'id' => $this->id, 143 'message' => $this->message, 144 'options' => $this->options, 145 ]; 146 } 147 148 /** 149 * Recreate an instance of this class. For PHP version >= 7.4.0 150 * 151 * @param array $data the array returned by __serialize. 152 * 153 * @return void 154 */ 155 public function __unserialize( $data ): void {} 156 157 /** 158 * Unserialize string, for PHP version < 7.4.0 137 159 * 138 160 * @param string $data Data to unserialize. -
advanced-ads/tags/1.53.1/packages/advanced-ads/framework/src/utilities/class-formatting.php
r3035032 r3134733 16 16 */ 17 17 class Formatting { 18 18 19 /** 19 20 * Converts a string (e.g. 'yes' or 'no') to a bool. … … 85 86 public static function clean( $value ) { 86 87 if ( is_array( $value ) ) { 87 return array_map( [ sel ::class, 'clean' ], $value );88 return array_map( [ self::class, 'clean' ], $value ); 88 89 } 89 90 … … 142 143 ); 143 144 } 144 145 /**146 * Wrapper for mb_strtoupper which see's if supported first.147 *148 * @param string $str String to format.149 *150 * @return string151 */152 public static function strtoupper( $str ) {153 $str = $str ?? '';154 return function_exists( 'mb_strtoupper' ) ? mb_strtoupper( $str ) : strtoupper( $str );155 }156 157 /**158 * Make a string lowercase.159 * Try to use mb_strtolower() when available.160 *161 * @param string $str String to format.162 *163 * @return string164 */165 public static function strtolower( $str ) {166 $str = $str ?? '';167 return function_exists( 'mb_strtolower' ) ? mb_strtolower( $str ) : strtolower( $str );168 }169 170 /**171 * Implode and escape HTML attributes for output.172 *173 * @param array $raw_attributes Attribute name value pairs.174 *175 * @return string176 */177 public static function join_html_attributes( $raw_attributes ) {178 $attributes = [];179 foreach ( $raw_attributes as $name => $value ) {180 $attributes[] = esc_attr( $name ) . '="' . esc_attr( $value ) . '"';181 }182 183 return implode( ' ', $attributes );184 }185 145 } -
advanced-ads/tags/1.53.1/packages/composer/LICENSE
r2983598 r3134733 1 2 1 Copyright (c) Nils Adermann, Jordi Boggiano 3 2 … … 19 18 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 19 THE SOFTWARE. 21 -
advanced-ads/tags/1.53.1/packages/composer/autoload_classmap.php
r3134243 r3134733 47 47 'AdvancedAds\\Framework\\Notices\\Storage' => $vendorDir . '/advanced-ads/framework/src/notices/class-storage.php', 48 48 'AdvancedAds\\Framework\\Updates' => $vendorDir . '/advanced-ads/framework/src/class-updates.php', 49 'AdvancedAds\\Framework\\Utilities\\Arr' => $vendorDir . '/advanced-ads/framework/src/utilities/class-arr ay.php',49 'AdvancedAds\\Framework\\Utilities\\Arr' => $vendorDir . '/advanced-ads/framework/src/utilities/class-arr.php', 50 50 'AdvancedAds\\Framework\\Utilities\\Formatting' => $vendorDir . '/advanced-ads/framework/src/utilities/class-formatting.php', 51 'AdvancedAds\\Framework\\Utilities\\HTML' => $vendorDir . '/advanced-ads/framework/src/utilities/class-html.php', 51 52 'AdvancedAds\\Framework\\Utilities\\Params' => $vendorDir . '/advanced-ads/framework/src/utilities/class-params.php', 52 'AdvancedAds\\Framework\\Utilities\\Str' => $vendorDir . '/advanced-ads/framework/src/utilities/class-str ing.php',53 'AdvancedAds\\Framework\\Utilities\\Str' => $vendorDir . '/advanced-ads/framework/src/utilities/class-str.php', 53 54 'AdvancedAds\\Groups\\Manager' => $baseDir . '/includes/groups/class-manager.php', 54 55 'AdvancedAds\\Groups\\Types\\Grid' => $baseDir . '/includes/groups/types/type-grid.php', -
advanced-ads/tags/1.53.1/packages/composer/autoload_static.php
r3134243 r3134733 76 76 'AdvancedAds\\Framework\\Notices\\Storage' => __DIR__ . '/..' . '/advanced-ads/framework/src/notices/class-storage.php', 77 77 'AdvancedAds\\Framework\\Updates' => __DIR__ . '/..' . '/advanced-ads/framework/src/class-updates.php', 78 'AdvancedAds\\Framework\\Utilities\\Arr' => __DIR__ . '/..' . '/advanced-ads/framework/src/utilities/class-arr ay.php',78 'AdvancedAds\\Framework\\Utilities\\Arr' => __DIR__ . '/..' . '/advanced-ads/framework/src/utilities/class-arr.php', 79 79 'AdvancedAds\\Framework\\Utilities\\Formatting' => __DIR__ . '/..' . '/advanced-ads/framework/src/utilities/class-formatting.php', 80 'AdvancedAds\\Framework\\Utilities\\HTML' => __DIR__ . '/..' . '/advanced-ads/framework/src/utilities/class-html.php', 80 81 'AdvancedAds\\Framework\\Utilities\\Params' => __DIR__ . '/..' . '/advanced-ads/framework/src/utilities/class-params.php', 81 'AdvancedAds\\Framework\\Utilities\\Str' => __DIR__ . '/..' . '/advanced-ads/framework/src/utilities/class-str ing.php',82 'AdvancedAds\\Framework\\Utilities\\Str' => __DIR__ . '/..' . '/advanced-ads/framework/src/utilities/class-str.php', 82 83 'AdvancedAds\\Groups\\Manager' => __DIR__ . '/../..' . '/includes/groups/class-manager.php', 83 84 'AdvancedAds\\Groups\\Types\\Grid' => __DIR__ . '/../..' . '/includes/groups/types/type-grid.php', -
advanced-ads/tags/1.53.1/packages/composer/installed.json
r3041809 r3134733 8 8 "type": "git", 9 9 "url": "https://github.com/advanced-ads/framework.git", 10 "reference": "9 5e385daf3e3f11125711f43c5f7c437e00b075d"10 "reference": "9ceddbff73a7f588e29ab0172314b9a9a349546c" 11 11 }, 12 12 "dist": { 13 13 "type": "zip", 14 "url": "https://api.github.com/repos/advanced-ads/framework/zipball/9 5e385daf3e3f11125711f43c5f7c437e00b075d",15 "reference": "9 5e385daf3e3f11125711f43c5f7c437e00b075d",14 "url": "https://api.github.com/repos/advanced-ads/framework/zipball/9ceddbff73a7f588e29ab0172314b9a9a349546c", 15 "reference": "9ceddbff73a7f588e29ab0172314b9a9a349546c", 16 16 "shasum": "" 17 17 }, … … 23 23 "wp-coding-standards/wpcs": "^3.0.0" 24 24 }, 25 "time": "202 3-12-18T07:33:42+00:00",25 "time": "2024-08-01T10:52:05+00:00", 26 26 "default-branch": true, 27 27 "type": "wordpress-plugin", -
advanced-ads/tags/1.53.1/packages/composer/installed.php
r3050336 r3134733 4 4 'pretty_version' => '1.42.1', 5 5 'version' => '1.42.1.0', 6 'reference' => NULL,6 'reference' => null, 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-main', 15 15 'version' => 'dev-main', 16 'reference' => '9 5e385daf3e3f11125711f43c5f7c437e00b075d',16 'reference' => '9ceddbff73a7f588e29ab0172314b9a9a349546c', 17 17 'type' => 'wordpress-plugin', 18 18 'install_path' => __DIR__ . '/../advanced-ads/framework', … … 34 34 'pretty_version' => '1.42.1', 35 35 'version' => '1.42.1.0', 36 'reference' => NULL,36 'reference' => null, 37 37 'type' => 'wordpress-plugin', 38 38 'install_path' => __DIR__ . '/../../', -
advanced-ads/tags/1.53.1/readme.txt
r3134243 r3134733 5 5 Tested up to: 6.5 6 6 Requires PHP: 7.2 7 Stable tag: 1.53. 07 Stable tag: 1.53.1 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.53.1 (August 13, 2024) = 342 343 - Fix: resolve issue with deleting data on uninstall 344 - Fix: resolve JavaScript error when uninstall 345 341 346 = 1.53.0 (August 6, 2024) = 342 347 -
advanced-ads/trunk/advanced-ads.php
r3134243 r3134733 13 13 * Plugin URI: https://wpadvancedads.com 14 14 * Description: Manage and optimize your ads in WordPress 15 * Version: 1.53. 015 * Version: 1.53.1 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.53. 0' );36 define( 'ADVADS_VERSION', '1.53.1' ); 37 37 38 38 // Load the autoloader. -
advanced-ads/trunk/classes/plugin.php
r3029416 r3134733 428 428 $this->update_internal_options( $this->internal_options ); 429 429 430 self::get_instance()->create_capabilities();430 Capabilities::get_instance()->create_capabilities(); 431 431 } 432 432 … … 545 545 */ 546 546 public function create_capabilities() { 547 _deprecated_function( __METHOD__, '1.47.0', 'AdvancedAds\Installation\Capabilities:: create_capabilities()' );548 549 ( new Capabilities())->create_capabilities();547 _deprecated_function( __METHOD__, '1.47.0', 'AdvancedAds\Installation\Capabilities::get_instance()->create_capabilities();' ); 548 549 Capabilities::get_instance()->create_capabilities(); 550 550 } 551 551 -
advanced-ads/trunk/classes/upgrades.php
r2983598 r3134733 1 <?php 1 <?php // phpcs:ignoreFile 2 3 use AdvancedAds\Installation\Capabilities; 2 4 3 5 /** … … 15 17 $internal_options = Advanced_Ads_Plugin::get_instance()->internal_options(); 16 18 17 // the'advanced_ads_edit_ads' capability was added to Entities::POST_TYPE_AD post type in this version19 // 'advanced_ads_edit_ads' capability was added to Entities::POST_TYPE_AD post type in this version 18 20 if ( ! isset( $internal_options['version'] ) || version_compare( $internal_options['version'], '1.7.2', '<' ) ) { 19 Advanced_Ads_Plugin::get_instance()->create_capabilities();21 Capabilities::get_instance()->create_capabilities(); 20 22 } 21 23 -
advanced-ads/trunk/includes/installation/class-capabilities.php
r2986093 r3134733 16 16 */ 17 17 class Capabilities { 18 19 /** 20 * Instance 21 * 22 * @var object 23 */ 24 protected static $instance; 18 25 19 26 /** … … 36 43 public function __construct() { 37 44 $this->register_defaults(); 45 } 46 47 /** 48 * Get instance 49 * 50 * @return Capabilities 51 */ 52 public static function get_instance() { 53 // If the single instance hasn't been set, set it now. 54 if ( null === self::$instance ) { 55 self::$instance = new self(); 56 } 57 58 return self::$instance; 38 59 } 39 60 -
advanced-ads/trunk/includes/installation/class-install.php
r2983598 r3134733 36 36 protected function activate(): void { 37 37 // TODO: inform modules. 38 ( new Capabilities())->create_capabilities();38 Capabilities::get_instance()->create_capabilities(); 39 39 } 40 40 … … 46 46 protected function deactivate(): void { 47 47 // TODO: inform modules. 48 ( new Capabilities())->remove_capabilities();48 Capabilities::get_instance()->remove_capabilities(); 49 49 } 50 50 -
advanced-ads/trunk/languages/advanced-ads.pot
r3134243 r3134733 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Advanced Ads 1.5 2.4\n"5 "Project-Id-Version: Advanced Ads 1.53.0\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-08- 06T11:19:18+00:00\n"12 "POT-Creation-Date: 2024-08-13T08:25:00+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" … … 3130 3130 msgstr "" 3131 3131 3132 #: includes/installation/class-capabilities.php: 483132 #: includes/installation/class-capabilities.php:69 3133 3133 msgid "Allows changing plugin options" 3134 3134 msgstr "" 3135 3135 3136 #: includes/installation/class-capabilities.php: 543136 #: includes/installation/class-capabilities.php:75 3137 3137 msgid "Allows access to the Advanced Ads backend" 3138 3138 msgstr "" 3139 3139 3140 #: includes/installation/class-capabilities.php: 603140 #: includes/installation/class-capabilities.php:81 3141 3141 msgid "Allows editing ads" 3142 3142 msgstr "" 3143 3143 3144 #: includes/installation/class-capabilities.php: 663144 #: includes/installation/class-capabilities.php:87 3145 3145 msgid "Allows changing the placements page" 3146 3146 msgstr "" 3147 3147 3148 #: includes/installation/class-capabilities.php: 723148 #: includes/installation/class-capabilities.php:93 3149 3149 msgid "Enables shortcode button" 3150 3150 msgstr "" -
advanced-ads/trunk/packages/advanced-ads/framework/src/class-assets-registry.php
r3035032 r3134733 16 16 /** 17 17 * Assets Registry. 18 * 19 * Script functions: 20 * 21 * @method void enqueue_script(string $handle) 22 * @method void dequeue_script(string $handle) 23 * @method void deregister_script(string $handle) 24 * @method bool register_script(string $handle, string|false $src, string[] $deps = [], string|bool|null $ver = false, array|bool $args = []) 25 * @method bool inline_script(string $handle, string $data, string $position = 'after') 26 * @method bool is_script(string $handle, string $status = 'enqueued') 27 * 28 * Style functions: 29 * 30 * @method void enqueue_style(string $handle) 31 * @method void dequeue_style(string $handle) 32 * @method void deregister_style(string $handle) 33 * @method bool register_style(string $handle, string|false $src, string[] $deps = [], string|bool|null $ver = false, string $media = 'all') 34 * @method bool inline_style(string $handle, string $data, ) 35 * @method bool is_style(string $handle, string $status = 'enqueued') 18 36 */ 19 class Assets_Registry implements Integration_Interface {37 abstract class Assets_Registry implements Integration_Interface { 20 38 21 39 /** 22 * Version of plugin local asset.40 * Base URL for plugin local assets. 23 41 * 24 * @ varstring42 * @return string 25 43 */ 26 const VERSION = '1.0.0';44 abstract public function get_base_url(): string; 27 45 28 46 /** 29 47 * Prefix to use in handle to make it unique. 30 48 * 31 * @ varstring49 * @return string 32 50 */ 33 const PREFIX = 'advads';51 abstract public function get_prefix(): string; 34 52 35 53 /** 36 * Enqueue stylesheet 37 * 38 * @param string $handle Name of the stylesheet. 39 * 40 * @return void 41 */ 42 public static function enqueue_style( $handle ): void { 43 wp_enqueue_style( self::prefix_it( $handle ) ); 44 } 45 46 /** 47 * Enqueue script 48 * 49 * @param string $handle Name of the script. 50 * 51 * @return void 52 */ 53 public static function enqueue_script( $handle ): void { 54 wp_enqueue_script( self::prefix_it( $handle ) ); 55 } 56 57 /** 58 * Prefix the handle 59 * 60 * @param string $handle Name of the asset. 54 * Version for plugin local assets. 61 55 * 62 56 * @return string 63 57 */ 64 public static function prefix_it( $handle ): string { 65 return self::PREFIX . '-' . $handle; 58 abstract public function get_version(): string; 59 60 /** 61 * Magic method to catch all calls to. 62 * 63 * @param string $name The name of the method. 64 * @param array $arguments The arguments passed to the method. 65 * 66 * @return mixed 67 */ 68 public function __call( $name, $arguments ) { 69 if ( preg_match( '/^(enqueue|dequeue|register|deregister|is|inline)_(script|style)$/', $name, $matches ) ) { 70 $action = $matches[1]; 71 $type = $matches[2]; 72 $handle = $this->prefix_it( $arguments[0] ); 73 $func = $this->resolve_function( $action . '_' . $type ); 74 $func_args = [ $handle ]; 75 76 switch ( $action ) { 77 case 'register': 78 $func_args[] = $this->resolve_url( $arguments[1] ); 79 $func_args[] = $arguments[2] ?? []; 80 $func_args[] = isset( $arguments[3] ) && ! empty( $arguments[3] ) ? $arguments[3] : $this->get_version(); 81 $func_args[] = $arguments[4] ?? ( 'script' === $type ? true : 'all' ); 82 break; 83 case 'is': 84 $func_args[] = $arguments[1] ?? 'enqueued'; 85 break; 86 case 'inline': 87 $func_args[] = $arguments[1] ?? ''; 88 if ( 'script' === $type ) { 89 $func_args[] = $arguments[2] ?? 'after'; 90 } 91 break; 92 default: 93 break; 94 } 95 96 return call_user_func_array( $func, $func_args ); 97 } 66 98 } 67 99 … … 72 104 */ 73 105 public function hooks(): void { 106 add_action( 'wp_enqueue_scripts', [ $this, 'register_assets' ], 0 ); 74 107 add_action( 'admin_enqueue_scripts', [ $this, 'register_assets' ], 0 ); 75 108 } … … 83 116 $this->register_styles(); 84 117 $this->register_scripts(); 118 } 119 120 /** 121 * Prefix the handle 122 * 123 * @param string $handle Name of the asset. 124 * 125 * @return string 126 */ 127 public function prefix_it( $handle ): string { 128 return $this->get_prefix() . '-' . $handle; 85 129 } 86 130 … … 100 144 101 145 /** 102 * Re gister stylesheet146 * Resolves the URL. 103 147 * 104 * @param string $handle Name of the stylesheet. Should be unique. 105 * @param string|bool $src URL of the stylesheet. 106 * @param string[] $deps Optional. An array of registered stylesheet handles this stylesheet depends on. 107 * @param string|bool|null $ver Optional. String specifying stylesheet version number. 108 * @param string $media Optional. The media for which this stylesheet has been defined. 148 * If the provided URL is an absolute URL or protocol-relative URL, it is returned as is. 149 * Otherwise, the base URL is prepended to the relative path. 109 150 * 110 * @return void 151 * @param string $src The source URL. 152 * 153 * @return string The resolved URL. 111 154 */ 112 private function re gister_style( $handle, $src, $deps = [], $ver = false, $media = 'all' ){113 if ( false === $ver) {114 $ver = self::VERSION;155 private function resolve_url( $src ): string { 156 if ( preg_match( '/^(https?:)?\/\//', $src ) ) { 157 return $src; 115 158 } 116 159 117 wp_register_style( self::prefix_it( $handle ), ADVADS_BASE_URL . $src, $deps, $ver, $media );160 return $this->get_base_url() . $src; 118 161 } 119 162 120 163 /** 121 * Re gister script164 * Resolves the function name. 122 165 * 123 * @param string $handle Name of the stylesheet. Should be unique. 124 * @param string|bool $src URL of the stylesheet. 125 * @param string[] $deps Optional. An array of registered stylesheet handles this stylesheet depends on. 126 * @param string|bool|null $ver Optional. String specifying stylesheet version number. 127 * @param bool $in_footer Optional. The media for which this stylesheet has been defined. 166 * @param string $name The name of the function. 128 167 * 129 * @return void168 * @return string 130 169 */ 131 private function register_script( $handle, $src, $deps = [], $ver = false, $in_footer = false ) { 132 if ( false === $ver ) { 133 $ver = self::VERSION; 134 } 170 private function resolve_function( $name ): string { 171 $method_map = [ 172 'is_script' => 'script_is', 173 'is_style' => 'style_is', 174 'inline_script' => 'add_inline_script', 175 'inline_style' => 'add_inline_style', 176 ]; 135 177 136 $new_src = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? $src : str_replace( '.js', '.min.js', $src ); 137 wp_register_script( self::prefix_it( $handle ), ADVADS_BASE_URL . $src, $deps, $ver, $in_footer ); 178 $name = $method_map[ $name ] ?? $name; 179 180 return 'wp_' . $name; 138 181 } 139 182 } -
advanced-ads/trunk/packages/advanced-ads/framework/src/installation/class-install.php
r2983598 r3134733 49 49 */ 50 50 public function activation( $network_wide = false ): void { 51 register_uninstall_hook( $this->base_file, [ s elf::class, 'uninstall' ] );51 register_uninstall_hook( $this->base_file, [ static::class, 'uninstall' ] ); 52 52 53 53 if ( ! is_multisite() || ! $network_wide ) { -
advanced-ads/trunk/packages/advanced-ads/framework/src/notices/class-notice.php
r2983598 r3134733 119 119 120 120 /** 121 * Serialize data .121 * Serialize data, for PHP version < 7.4.0 122 122 * 123 123 * @return string … … 134 134 135 135 /** 136 * Unserialize string. 136 * Return an array representing the serialized form the object. For PHP version >= 7.4.0 137 * 138 * @return array 139 */ 140 public function __serialize(): array { 141 return [ 142 'id' => $this->id, 143 'message' => $this->message, 144 'options' => $this->options, 145 ]; 146 } 147 148 /** 149 * Recreate an instance of this class. For PHP version >= 7.4.0 150 * 151 * @param array $data the array returned by __serialize. 152 * 153 * @return void 154 */ 155 public function __unserialize( $data ): void {} 156 157 /** 158 * Unserialize string, for PHP version < 7.4.0 137 159 * 138 160 * @param string $data Data to unserialize. -
advanced-ads/trunk/packages/advanced-ads/framework/src/utilities/class-formatting.php
r3035032 r3134733 16 16 */ 17 17 class Formatting { 18 18 19 /** 19 20 * Converts a string (e.g. 'yes' or 'no') to a bool. … … 85 86 public static function clean( $value ) { 86 87 if ( is_array( $value ) ) { 87 return array_map( [ sel ::class, 'clean' ], $value );88 return array_map( [ self::class, 'clean' ], $value ); 88 89 } 89 90 … … 142 143 ); 143 144 } 144 145 /**146 * Wrapper for mb_strtoupper which see's if supported first.147 *148 * @param string $str String to format.149 *150 * @return string151 */152 public static function strtoupper( $str ) {153 $str = $str ?? '';154 return function_exists( 'mb_strtoupper' ) ? mb_strtoupper( $str ) : strtoupper( $str );155 }156 157 /**158 * Make a string lowercase.159 * Try to use mb_strtolower() when available.160 *161 * @param string $str String to format.162 *163 * @return string164 */165 public static function strtolower( $str ) {166 $str = $str ?? '';167 return function_exists( 'mb_strtolower' ) ? mb_strtolower( $str ) : strtolower( $str );168 }169 170 /**171 * Implode and escape HTML attributes for output.172 *173 * @param array $raw_attributes Attribute name value pairs.174 *175 * @return string176 */177 public static function join_html_attributes( $raw_attributes ) {178 $attributes = [];179 foreach ( $raw_attributes as $name => $value ) {180 $attributes[] = esc_attr( $name ) . '="' . esc_attr( $value ) . '"';181 }182 183 return implode( ' ', $attributes );184 }185 145 } -
advanced-ads/trunk/packages/composer/LICENSE
r2983598 r3134733 1 2 1 Copyright (c) Nils Adermann, Jordi Boggiano 3 2 … … 19 18 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 19 THE SOFTWARE. 21 -
advanced-ads/trunk/packages/composer/autoload_classmap.php
r3134243 r3134733 47 47 'AdvancedAds\\Framework\\Notices\\Storage' => $vendorDir . '/advanced-ads/framework/src/notices/class-storage.php', 48 48 'AdvancedAds\\Framework\\Updates' => $vendorDir . '/advanced-ads/framework/src/class-updates.php', 49 'AdvancedAds\\Framework\\Utilities\\Arr' => $vendorDir . '/advanced-ads/framework/src/utilities/class-arr ay.php',49 'AdvancedAds\\Framework\\Utilities\\Arr' => $vendorDir . '/advanced-ads/framework/src/utilities/class-arr.php', 50 50 'AdvancedAds\\Framework\\Utilities\\Formatting' => $vendorDir . '/advanced-ads/framework/src/utilities/class-formatting.php', 51 'AdvancedAds\\Framework\\Utilities\\HTML' => $vendorDir . '/advanced-ads/framework/src/utilities/class-html.php', 51 52 'AdvancedAds\\Framework\\Utilities\\Params' => $vendorDir . '/advanced-ads/framework/src/utilities/class-params.php', 52 'AdvancedAds\\Framework\\Utilities\\Str' => $vendorDir . '/advanced-ads/framework/src/utilities/class-str ing.php',53 'AdvancedAds\\Framework\\Utilities\\Str' => $vendorDir . '/advanced-ads/framework/src/utilities/class-str.php', 53 54 'AdvancedAds\\Groups\\Manager' => $baseDir . '/includes/groups/class-manager.php', 54 55 'AdvancedAds\\Groups\\Types\\Grid' => $baseDir . '/includes/groups/types/type-grid.php', -
advanced-ads/trunk/packages/composer/autoload_static.php
r3134243 r3134733 76 76 'AdvancedAds\\Framework\\Notices\\Storage' => __DIR__ . '/..' . '/advanced-ads/framework/src/notices/class-storage.php', 77 77 'AdvancedAds\\Framework\\Updates' => __DIR__ . '/..' . '/advanced-ads/framework/src/class-updates.php', 78 'AdvancedAds\\Framework\\Utilities\\Arr' => __DIR__ . '/..' . '/advanced-ads/framework/src/utilities/class-arr ay.php',78 'AdvancedAds\\Framework\\Utilities\\Arr' => __DIR__ . '/..' . '/advanced-ads/framework/src/utilities/class-arr.php', 79 79 'AdvancedAds\\Framework\\Utilities\\Formatting' => __DIR__ . '/..' . '/advanced-ads/framework/src/utilities/class-formatting.php', 80 'AdvancedAds\\Framework\\Utilities\\HTML' => __DIR__ . '/..' . '/advanced-ads/framework/src/utilities/class-html.php', 80 81 'AdvancedAds\\Framework\\Utilities\\Params' => __DIR__ . '/..' . '/advanced-ads/framework/src/utilities/class-params.php', 81 'AdvancedAds\\Framework\\Utilities\\Str' => __DIR__ . '/..' . '/advanced-ads/framework/src/utilities/class-str ing.php',82 'AdvancedAds\\Framework\\Utilities\\Str' => __DIR__ . '/..' . '/advanced-ads/framework/src/utilities/class-str.php', 82 83 'AdvancedAds\\Groups\\Manager' => __DIR__ . '/../..' . '/includes/groups/class-manager.php', 83 84 'AdvancedAds\\Groups\\Types\\Grid' => __DIR__ . '/../..' . '/includes/groups/types/type-grid.php', -
advanced-ads/trunk/packages/composer/installed.json
r3041809 r3134733 8 8 "type": "git", 9 9 "url": "https://github.com/advanced-ads/framework.git", 10 "reference": "9 5e385daf3e3f11125711f43c5f7c437e00b075d"10 "reference": "9ceddbff73a7f588e29ab0172314b9a9a349546c" 11 11 }, 12 12 "dist": { 13 13 "type": "zip", 14 "url": "https://api.github.com/repos/advanced-ads/framework/zipball/9 5e385daf3e3f11125711f43c5f7c437e00b075d",15 "reference": "9 5e385daf3e3f11125711f43c5f7c437e00b075d",14 "url": "https://api.github.com/repos/advanced-ads/framework/zipball/9ceddbff73a7f588e29ab0172314b9a9a349546c", 15 "reference": "9ceddbff73a7f588e29ab0172314b9a9a349546c", 16 16 "shasum": "" 17 17 }, … … 23 23 "wp-coding-standards/wpcs": "^3.0.0" 24 24 }, 25 "time": "202 3-12-18T07:33:42+00:00",25 "time": "2024-08-01T10:52:05+00:00", 26 26 "default-branch": true, 27 27 "type": "wordpress-plugin", -
advanced-ads/trunk/packages/composer/installed.php
r3050336 r3134733 4 4 'pretty_version' => '1.42.1', 5 5 'version' => '1.42.1.0', 6 'reference' => NULL,6 'reference' => null, 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-main', 15 15 'version' => 'dev-main', 16 'reference' => '9 5e385daf3e3f11125711f43c5f7c437e00b075d',16 'reference' => '9ceddbff73a7f588e29ab0172314b9a9a349546c', 17 17 'type' => 'wordpress-plugin', 18 18 'install_path' => __DIR__ . '/../advanced-ads/framework', … … 34 34 'pretty_version' => '1.42.1', 35 35 'version' => '1.42.1.0', 36 'reference' => NULL,36 'reference' => null, 37 37 'type' => 'wordpress-plugin', 38 38 'install_path' => __DIR__ . '/../../', -
advanced-ads/trunk/readme.txt
r3134243 r3134733 5 5 Tested up to: 6.5 6 6 Requires PHP: 7.2 7 Stable tag: 1.53. 07 Stable tag: 1.53.1 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.53.1 (August 13, 2024) = 342 343 - Fix: resolve issue with deleting data on uninstall 344 - Fix: resolve JavaScript error when uninstall 345 341 346 = 1.53.0 (August 6, 2024) = 342 347
Note: See TracChangeset
for help on using the changeset viewer.