From 3d38109e756df829b84c6c45bf559a53dbe184b5 Mon Sep 17 00:00:00 2001 From: Stephen Page Date: Mon, 16 Oct 2023 14:54:03 -0400 Subject: [PATCH 01/75] See: https://github.com/the-events-calendar/tribe-common/pull/1864 --- readme.txt | 4 ++++ src/functions/template-tags/general.php | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index e9a5b1b973..5f2da5f276 100644 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,9 @@ == Changelog == += [TBD] TBD = + +* Tweak - Remove ini_check for deprecated safe_mode. [TBD] + = [5.1.10.1] 2023-10-12 = * Fix - Correct a problem that can cause a fatal when plugins are deactivated in a certain order. [TEC-4951] diff --git a/src/functions/template-tags/general.php b/src/functions/template-tags/general.php index f0ccd1334c..1668146bd4 100755 --- a/src/functions/template-tags/general.php +++ b/src/functions/template-tags/general.php @@ -788,7 +788,6 @@ function tribe_set_time_limit( $limit = 0 ) { if ( ! function_exists( 'set_time_limit' ) && false !== strpos( ini_get( 'disable_functions' ), 'set_time_limit' ) - && ini_get( 'safe_mode' ) ) { return false; } From e1eef8a09d4ef5157b0d7f6af1bb0b1b9e3c75ff Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Thu, 2 May 2024 10:44:30 +0200 Subject: [PATCH 02/75] Set version to 5.3.0-dev --- package.json | 2 +- src/Tribe/Main.php | 2 +- tribe-common.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 1cd149d72d..43b31c3beb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tribe-common", - "version": "5.2.5", + "version": "5.3.0-dev", "repository": "git@github.com:the-events-calendar/tribe-common.git", "_resourcepath": "src/resources", "_domainPath": "lang", diff --git a/src/Tribe/Main.php b/src/Tribe/Main.php index fd55d2cbca..a926c925ed 100644 --- a/src/Tribe/Main.php +++ b/src/Tribe/Main.php @@ -18,7 +18,7 @@ class Tribe__Main { const OPTIONNAME = 'tribe_events_calendar_options'; const OPTIONNAMENETWORK = 'tribe_events_calendar_network_options'; const FEED_URL = 'https://theeventscalendar.com/feed/'; - const VERSION = '5.2.5'; + const VERSION = '5.3.0-dev'; protected $plugin_context; protected $plugin_context_class; diff --git a/tribe-common.php b/tribe-common.php index 0fc4e0d7ce..e2a2b99ca6 100644 --- a/tribe-common.php +++ b/tribe-common.php @@ -2,7 +2,7 @@ /** * Plugin Name: Tribe Common * Description: An event settings framework for managing shared options. - * Version: 5.2.5 + * Version: 5.3.0-dev * Author: The Events Calendar * Author URI: http://evnt.is/1x * Text Domain: tribe-common From 7faaab877f608c00efc73165b933d7b1c7c4ac40 Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Fri, 26 Apr 2024 16:48:23 +0200 Subject: [PATCH 03/75] build(composer.json) require di52 ^3.3.7 --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 1cef4830c2..e3555460ba 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ }, "require": { "firebase/php-jwt": "~6.3.0", - "lucatume/di52": "^3.3.4", + "lucatume/di52": "^3.3.7", "monolog/monolog": "1.24.*", "psr/container": "^1.0.0", "stellarwp/container-contract": "^1.0.4", diff --git a/composer.lock b/composer.lock index 415ce03047..1cbea3ea03 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6b73fd2c3dd621ec2cc01b42d50549af", + "content-hash": "0cc9f62df5147555c244e91678a87a2f", "packages": [ { "name": "firebase/php-jwt", @@ -70,16 +70,16 @@ }, { "name": "lucatume/di52", - "version": "3.3.5", + "version": "3.3.7", "source": { "type": "git", "url": "https://github.com/lucatume/di52.git", - "reference": "d39d1cbbc57eb41c7aa21fab106e17b6938ec6b3" + "reference": "76c0c2ad0422ce595e2e38138456f3475888e32c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lucatume/di52/zipball/d39d1cbbc57eb41c7aa21fab106e17b6938ec6b3", - "reference": "d39d1cbbc57eb41c7aa21fab106e17b6938ec6b3", + "url": "https://api.github.com/repos/lucatume/di52/zipball/76c0c2ad0422ce595e2e38138456f3475888e32c", + "reference": "76c0c2ad0422ce595e2e38138456f3475888e32c", "shasum": "" }, "require": { @@ -109,9 +109,9 @@ "description": "A PHP 5.6 compatible dependency injection container.", "support": { "issues": "https://github.com/lucatume/di52/issues", - "source": "https://github.com/lucatume/di52/tree/3.3.5" + "source": "https://github.com/lucatume/di52/tree/3.3.7" }, - "time": "2023-09-01T08:49:32+00:00" + "time": "2024-04-26T14:46:26+00:00" }, { "name": "monolog/monolog", From 3121e5562a46b63c39027f51530a43bbc117cfc7 Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Wed, 1 May 2024 15:14:53 +0200 Subject: [PATCH 04/75] refactor(Assets) replace with stellarwp/assets --- composer.json | 6 +- composer.lock | 58 ++++++- package.json | 2 +- src/Common/Libraries/Provider.php | 7 +- src/Tribe/Main.php | 2 +- src/functions/template-tags/general.php | 199 +++++++++++++++++++++--- tribe-common.php | 2 +- 7 files changed, 250 insertions(+), 26 deletions(-) diff --git a/composer.json b/composer.json index e3555460ba..877c8b981c 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,8 @@ "stellarwp/installer": "^1.1.0", "stellarwp/models": "dev-main", "stellarwp/schema": "^1.1.3", - "stellarwp/telemetry": "^2.3.1" + "stellarwp/telemetry": "^2.3.1", + "stellarwp/assets": "^1.1.3" }, "require-dev": { "automattic/vipwpcs": "^3.0", @@ -86,7 +87,8 @@ "lucatume/di52", "monolog/monolog", "firebase/php-jwt", - "psr/container" + "psr/container", + "stellarwp/assets" ], "exclude_from_prefix": { "file_patterns": [] diff --git a/composer.lock b/composer.lock index 1cbea3ea03..750dfd3c3b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0cc9f62df5147555c244e91678a87a2f", + "content-hash": "8acbbb32acc7e8b4f40be7c4eb6a6791", "packages": [ { "name": "firebase/php-jwt", @@ -293,6 +293,62 @@ }, "time": "2021-05-03T11:20:27+00:00" }, + { + "name": "stellarwp/assets", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/stellarwp/assets.git", + "reference": "4ee3fa915579b8384835bb87d906188a10a7a109" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/stellarwp/assets/zipball/4ee3fa915579b8384835bb87d906188a10a7a109", + "reference": "4ee3fa915579b8384835bb87d906188a10a7a109", + "shasum": "" + }, + "require-dev": { + "codeception/module-asserts": "^1.0", + "codeception/module-cli": "^1.0", + "codeception/module-db": "^1.0", + "codeception/module-filesystem": "^1.0", + "codeception/module-phpbrowser": "^1.0", + "codeception/module-rest": "^1.0", + "codeception/module-webdriver": "^1.0", + "codeception/util-universalframework": "^1.0", + "lucatume/wp-browser": "^3.0.14", + "phpunit/phpunit": "~6.0", + "symfony/event-dispatcher-contracts": "^2.5.1", + "symfony/string": "^5.4", + "szepeviktor/phpstan-wordpress": "^1.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "StellarWP\\Assets\\": "src/Assets/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0" + ], + "authors": [ + { + "name": "StellarWP", + "email": "dev@stellarwp.com" + }, + { + "name": "Matthew Batchelder", + "email": "matt.batchelder@stellarwp.com" + } + ], + "description": "A library for managing asset registration and enqueuing in WordPress.", + "support": { + "issues": "https://github.com/stellarwp/assets/issues", + "source": "https://github.com/stellarwp/assets/tree/1.1.3" + }, + "time": "2024-04-30T08:51:09+00:00" + }, { "name": "stellarwp/container-contract", "version": "1.1.1", diff --git a/package.json b/package.json index 43b31c3beb..8478ff4684 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tribe-common", - "version": "5.3.0-dev", + "version": "5.4.0-dev", "repository": "git@github.com:the-events-calendar/tribe-common.git", "_resourcepath": "src/resources", "_domainPath": "lang", diff --git a/src/Common/Libraries/Provider.php b/src/Common/Libraries/Provider.php index 95c7a036eb..6faf77bc37 100644 --- a/src/Common/Libraries/Provider.php +++ b/src/Common/Libraries/Provider.php @@ -3,8 +3,9 @@ namespace TEC\Common\Libraries; use TEC\Common\StellarWP\DB; +use TEC\Common\StellarWP\Assets; use TEC\Common\Contracts\Service_Provider; - +use Tribe__Main as Common; class Provider extends Service_Provider { @@ -28,6 +29,10 @@ public function register() { tribe_register_provider( Installer\Provider::class ); DB\Config::setHookPrefix( $this->get_hook_prefix() ); + Assets\Config::set_hook_prefix( $this->get_hook_prefix() ); + Assets\Config::set_path( Common::instance()->plugin_path . 'src/resources/' ); + Assets\Config::set_version( Common::VERSION ); + Assets\Config::set_relative_asset_path( 'src/resources/' ); } /** diff --git a/src/Tribe/Main.php b/src/Tribe/Main.php index a926c925ed..60bcd5ab88 100644 --- a/src/Tribe/Main.php +++ b/src/Tribe/Main.php @@ -18,7 +18,7 @@ class Tribe__Main { const OPTIONNAME = 'tribe_events_calendar_options'; const OPTIONNAMENETWORK = 'tribe_events_calendar_network_options'; const FEED_URL = 'https://theeventscalendar.com/feed/'; - const VERSION = '5.3.0-dev'; + const VERSION = '5.4-dev'; protected $plugin_context; protected $plugin_context_class; diff --git a/src/functions/template-tags/general.php b/src/functions/template-tags/general.php index f0ccd1334c..fe7bc369b9 100755 --- a/src/functions/template-tags/general.php +++ b/src/functions/template-tags/general.php @@ -3,6 +3,10 @@ * Display functions (template-tags) for use in WordPress templates. */ +use TEC\Common\StellarWP\Assets\Asset; +use TEC\Common\StellarWP\Assets\Assets; +use Tribe__Utils__Array as Arr; + // Don't load directly if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); @@ -641,9 +645,10 @@ function tribe_register_error( $indexes, $message ) { } /** - * Shortcut for Tribe__Assets::register(), include a single asset + * Registers an asset. * * @since 4.3 + * @since TBD Replaced the function internals with calls to the stellarwp/assets library. * * @param object $origin The main object for the plugin you are enqueueing the asset for. * @param string $slug Slug to save the asset - passes through `sanitize_title_with_dashes()`. @@ -651,43 +656,202 @@ function tribe_register_error( $indexes, $message ) { * @param array $deps The list of dependencies or callable function that will return a list of dependencies. * @param string|array|null $action The WordPress action(s) to enqueue on, such as `wp_enqueue_scripts`, * `admin_enqueue_scripts`, or `login_enqueue_scripts`. - * @param array $arguments See `Tribe__Assets::register()` for more info. + * @param array{ + * priority?: int|null, // The priority of the asset, defaults to 10. + * type?: string|null, // The type of the asset, defaults to 'script'. + * media?: string|null, // The media type of the asset, defaults to 'all'. + * conditionals?: array|null, // The conditionals that the asset should be enqueued for, defaults to `[]`. + * deps?: array|null, // The list of dependencies or callable function that will return a list of dependencies. + * groups: array|null, // The list of groups the asset should be enqueued for, defaults to `[]`. + * print_before: string|null, // The hook to print the asset before, defaults to `null`. + * print_after: string|null, // The hook to print the asset after, defaults to `null`. + * localize: array|null, // The localization data for the asset, defaults to `[]`. + * defer: bool|null, // Whether the asset should be deferred, defaults to `false`. + * async: bool|null, // Whether the asset should be asynchronous, defaults to `false`. + * print: bool|null, // Whether the asset should be printed, defaults to `false`. + * } $arguments See `Tribe__Assets::register()` for more info. * * @return object|false The asset that got registered or false on error. */ function tribe_asset( $origin, $slug, $file, $deps = [], $action = null, $arguments = [] ) { - /** @var Tribe__Assets $assets */ - $assets = tribe( 'assets' ); + // Origin needs to be a class with a `instance` method and a Version constant. + if ( + is_string( $origin ) + && class_exists( $origin, false ) + && defined( $origin . '::VERSION' ) + && method_exists( $origin, 'instance' ) + ) { + $origin = call_user_func( [ $origin, 'instance' ] ); + } + + if ( is_object( $origin ) ) { + $origin_name = get_class( $origin ); + + if ( ! defined( $origin_name . '::VERSION' ) ) { + // If we have an Object, and we don't have instance or version. + return false; + } + } else { + return false; + } + + // Infer the type from the file extension, if not passed. + $type = empty( $arguments['type'] ) ? + substr( $file, strrpos( $file, '.' ) + 1 ) + : $arguments['type']; + + // Work out the file from the origin. + if ( ! is_file( $file ) ) { + $relative_asset_path = TEC\Common\StellarWP\Assets\Config::get_relative_asset_path(); + $origin_path = trailingslashit( ! empty( $origin->plugin_url ) ? $origin->plugin_url : $origin->pluginUrl ); + $file = $origin_path . $relative_asset_path . "{$type}/" . $file; + } + + // Fetches the version on the Origin Version constant if not passed. + $version = $arguments['version'] ?: constant( $origin_name . '::VERSION' ); + + $asset = Asset::add( $slug, $file, $arguments['version'] ?: '' ); + + if ( ! empty( $action ) ) { + foreach ( (array) $action as $enqueue_on ) { + $asset->enqueue_on( $enqueue_on, $arguments['priority'] ?? null ); + } + } + + $asset->set_type( $type ); + + if ( isset( $arguments['media'] ) ) { + $asset->set_media( $arguments['media'] ); + } + + if ( isset( $arguments['conditionals'] ) ) { + if ( is_callable( $arguments['conditionals'] ) ) { + // One array argument is a callable, so call it. + $asset->set_condition( $arguments['conditionals'] ); + } else { + // Build a condition closure out of a list of conditionals. + $conditionals = (array) $arguments['conditionals']; + + // Pluck the operator from the conditionals. + $operator = Arr::get( $conditionals, 'operator', 'OR' ); + // Keep the callables. + $conditional_callables = array_values( array_filter( $conditionals, 'is_callable' ) ); + + if ( $operator === 'OR' ) { + // Build a Closure condition that will return true if any of the callables return true. + $asset->set_condition( function () use ( $conditional_callables ) { + foreach ( $conditional_callables as $condition ) { + if ( $condition() ) { + return true; + } + } + + return false; + } ); + } else { + // Build a Closure condition that will return true if all of the callables return true. + $asset->set_condition( function () use ( $conditional_callables ) { + foreach ( $conditional_callables as $condition ) { + if ( ! $condition() ) { + return false; + } + } + + return true; + } ); + } + } + } - return $assets->register( $origin, $slug, $file, $deps, $action, $arguments ); + if ( isset( $arguments['deps'] ) ) { + foreach ( (array) $arguments['deps'] as $dependency ) { + $asset->add_dependency( $dependency ); + } + } + + if ( isset( $arguments['groups'] ) ) { + foreach ( (array) $arguments['groups'] as $group ) { + $asset->add_to_group( $group ); + } + } + + if ( isset( $arguments['print_before'] ) ) { + $asset->print_before( $arguments['print_before'] ); + } + + if ( isset( $arguments['print_after'] ) ) { + $asset->print_after( $arguments['print_after'] ); + } + + if ( isset( $arguments['localize'] ) ) { + foreach ( (array) $arguments['localize'] as $localize ) { + $array_localize = (array) $localize; + $object_name = $array_localize['name'] ?? null; + $data = $array_localize['data'] ?? null; + if ( ! ( $object_name && $data ) ) { + continue; + } + $asset->add_localize_script( $object_name, $data ); + } + } + + if ( isset( $arguments['translations'], $arguments['translations']['domain'], $arguments['translations']['path'] ) ) { + $domain = $arguments['translations']['domain']; + $path = $arguments['translations']['path']; + $asset->call_after_enqueue( fn() => wp_set_script_translations( $slug, $domain, $path ) ); + } + + if ( isset( $arguments['after_enqueue'] ) ) { + $asset->call_after_enqueue( $arguments['after_enqueue'] ); + } + + if ( ! empty( $arguments['in_footer'] ) ) { + $asset->in_footer(); + } + + if ( ! empty( $arguments['module'] ) ) { + $asset->set_as_module(); + } + + if ( ! empty( $arguments['defer'] ) ) { + $asset->set_as_deferred(); + } + + if ( ! empty( $arguments['async'] ) ) { + $asset->set_as_async(); + } + + if ( ! empty( $arguments['print'] ) ) { + $asset->print( true ); + } + + $asset->register(); + + return $asset; } /** - * Shortcut for Tribe__Assets::enqueue() to include assets. + * Immediately enqueues an asset. * * @since 4.7 + * @since TBD Refactored to use the `stelarwp/assets` library. * * @param string|array $slug Slug to enqueue */ function tribe_asset_enqueue( $slug ) { - /** @var Tribe__Assets $assets */ - $assets = tribe( 'assets' ); - - $assets->enqueue( $slug ); + Assets::instance()->enqueue( $slug ); } /** - * Shortcut for Tribe__Assets::enqueue_group() include assets by groups. + * Enqueues assets by groups. * * @since 4.7 + * @since TBD Refactored to use the `stelarwp/assets` library. * * @param string|array $group Which group(s) should be enqueued. */ function tribe_asset_enqueue_group( $group ) { - /** @var Tribe__Assets $assets */ - $assets = tribe( 'assets' ); - - $assets->enqueue_group( $group ); + Assets::instance()->enqueue_group( $group ); } /** @@ -850,10 +1014,7 @@ function tribe_cache() { * @return string The `script` and `link` HTML tags produced for the group(s). */ function tribe_asset_print_group( $group, $echo = true ) { - /** @var \Tribe__Assets $assets */ - $assets = tribe( 'assets' ); - - return $assets->print_group($group, $echo); + return Assets::instance()->print_group( $group, $echo ); } } diff --git a/tribe-common.php b/tribe-common.php index e2a2b99ca6..3d3289c43b 100644 --- a/tribe-common.php +++ b/tribe-common.php @@ -2,7 +2,7 @@ /** * Plugin Name: Tribe Common * Description: An event settings framework for managing shared options. - * Version: 5.3.0-dev + * Version: 5.4-dev * Author: The Events Calendar * Author URI: http://evnt.is/1x * Text Domain: tribe-common From 57863fd3d9317f6ed27f674965506c45b938ae1c Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Wed, 1 May 2024 17:30:28 +0200 Subject: [PATCH 05/75] fix(tribe_assets) fix dependencies issue --- package-lock.json | 4 ++-- src/functions/template-tags/general.php | 24 ++++++++++++++---------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index e63e7eddd5..7288e326c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "tribe-common", - "version": "5.2.5", + "version": "5.4.0-dev", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "tribe-common", - "version": "5.2.5", + "version": "5.4.0-dev", "dependencies": { "@babel/runtime": "^7.15.3", "@moderntribe/common": "file:src/modules", diff --git a/src/functions/template-tags/general.php b/src/functions/template-tags/general.php index fe7bc369b9..f3fb916e90 100755 --- a/src/functions/template-tags/general.php +++ b/src/functions/template-tags/general.php @@ -700,17 +700,17 @@ function tribe_asset( $origin, $slug, $file, $deps = [], $action = null, $argume substr( $file, strrpos( $file, '.' ) + 1 ) : $arguments['type']; - // Work out the file from the origin. - if ( ! is_file( $file ) ) { - $relative_asset_path = TEC\Common\StellarWP\Assets\Config::get_relative_asset_path(); - $origin_path = trailingslashit( ! empty( $origin->plugin_url ) ? $origin->plugin_url : $origin->pluginUrl ); - $file = $origin_path . $relative_asset_path . "{$type}/" . $file; - } + // Work out the root path from the origin. + $root_path = str_replace( + dirname( WP_CONTENT_DIR ) ?: WP_CONTENT_DIR, + '', + trailingslashit( ! empty( $origin->plugin_path ) ? $origin->plugin_path : $origin->pluginPath ) + ); // Fetches the version on the Origin Version constant if not passed. $version = $arguments['version'] ?: constant( $origin_name . '::VERSION' ); - $asset = Asset::add( $slug, $file, $arguments['version'] ?: '' ); + $asset = Asset::add( $slug, $file, $arguments['version'] ?: '', $root_path ); if ( ! empty( $action ) ) { foreach ( (array) $action as $enqueue_on ) { @@ -763,9 +763,13 @@ function tribe_asset( $origin, $slug, $file, $deps = [], $action = null, $argume } } - if ( isset( $arguments['deps'] ) ) { - foreach ( (array) $arguments['deps'] as $dependency ) { - $asset->add_dependency( $dependency ); + if ( isset( $deps ) ) { + if ( is_callable( $deps ) ) { + $asset->set_dependencies( $deps ); + } else { + foreach ( (array) $deps as $dependency ) { + $asset->add_dependency( $dependency ); + } } } From 1c7de6c8da3df43f1c0c766586a6c6e5f9280c15 Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Wed, 1 May 2024 17:39:09 +0200 Subject: [PATCH 06/75] fix(tribe_assets) read localize data correctly --- src/functions/template-tags/general.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/functions/template-tags/general.php b/src/functions/template-tags/general.php index f3fb916e90..3d418b1153 100755 --- a/src/functions/template-tags/general.php +++ b/src/functions/template-tags/general.php @@ -788,13 +788,10 @@ function tribe_asset( $origin, $slug, $file, $deps = [], $action = null, $argume } if ( isset( $arguments['localize'] ) ) { - foreach ( (array) $arguments['localize'] as $localize ) { - $array_localize = (array) $localize; - $object_name = $array_localize['name'] ?? null; - $data = $array_localize['data'] ?? null; - if ( ! ( $object_name && $data ) ) { - continue; - } + $array_localize = (array) $arguments['localize']; + $object_name = $array_localize['name'] ?? null; + $data = $array_localize['data'] ?? null; + if ( $object_name && $data ) { $asset->add_localize_script( $object_name, $data ); } } From 6131e01e4dcfc658958c14b3d36ab26670e7a658 Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Wed, 1 May 2024 17:43:45 +0200 Subject: [PATCH 07/75] build(stellarwp/assets) req. ^1.2.0 --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 877c8b981c..bb8a8bf145 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "stellarwp/models": "dev-main", "stellarwp/schema": "^1.1.3", "stellarwp/telemetry": "^2.3.1", - "stellarwp/assets": "^1.1.3" + "stellarwp/assets": "^1.2.0" }, "require-dev": { "automattic/vipwpcs": "^3.0", diff --git a/composer.lock b/composer.lock index 750dfd3c3b..97e3183568 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8acbbb32acc7e8b4f40be7c4eb6a6791", + "content-hash": "200fe05f1d08f331634ab25927a0bf14", "packages": [ { "name": "firebase/php-jwt", @@ -295,16 +295,16 @@ }, { "name": "stellarwp/assets", - "version": "1.1.3", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/stellarwp/assets.git", - "reference": "4ee3fa915579b8384835bb87d906188a10a7a109" + "reference": "c97e3288660c795db12bbae455741600ca08d584" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stellarwp/assets/zipball/4ee3fa915579b8384835bb87d906188a10a7a109", - "reference": "4ee3fa915579b8384835bb87d906188a10a7a109", + "url": "https://api.github.com/repos/stellarwp/assets/zipball/c97e3288660c795db12bbae455741600ca08d584", + "reference": "c97e3288660c795db12bbae455741600ca08d584", "shasum": "" }, "require-dev": { @@ -345,9 +345,9 @@ "description": "A library for managing asset registration and enqueuing in WordPress.", "support": { "issues": "https://github.com/stellarwp/assets/issues", - "source": "https://github.com/stellarwp/assets/tree/1.1.3" + "source": "https://github.com/stellarwp/assets/tree/1.2.0" }, - "time": "2024-04-30T08:51:09+00:00" + "time": "2024-05-01T15:31:50+00:00" }, { "name": "stellarwp/container-contract", From 929ef642156dd135a273e4315c1cb3f4f5b69c69 Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Thu, 2 May 2024 14:44:22 +0200 Subject: [PATCH 08/75] refactor(Tribe_Assets) redirect to stellarwp/assets --- src/Tribe/Assets.php | 816 +++++++----------------- src/Tribe/Main.php | 2 +- src/functions/template-tags/general.php | 220 ++----- 3 files changed, 278 insertions(+), 760 deletions(-) diff --git a/src/Tribe/Assets.php b/src/Tribe/Assets.php index 6a5354d2d1..941e14eb48 100644 --- a/src/Tribe/Assets.php +++ b/src/Tribe/Assets.php @@ -1,24 +1,15 @@ get_slug()}", $enqueue, $asset ); } /** @@ -57,36 +85,12 @@ public function __construct() { * @param string $handle Which is the ID/Handle of the tag we are about to print. * * @return string Script tag with the before and after strings attached to it. + * + * @deprecated TBD */ public function filter_print_before_after_script( $tag, $handle ) : string { - // Only filter for our own filters. - if ( ! $asset = $this->get( $handle ) ) { - return (string) $tag; - } - - // Bail when not dealing with JS assets. - if ( 'js' !== $asset->type ) { - return (string) $tag; - } - - // Only go forward if there is any print before or after. - if ( empty( $asset->print_before ) && empty( $asset->print_after ) ) { - return (string) $tag; - } - - $before = ''; - if ( ! empty( $asset->print_before ) ) { - $before = (string) ( is_callable( $asset->print_before ) ? call_user_func( $asset->print_before, $asset ) : $asset->print_before ); - } - - $after = ''; - if ( ! empty( $asset->print_after ) ) { - $after = (string) ( is_callable( $asset->print_after ) ? call_user_func( $asset->print_after, $asset ) : $asset->print_after ); - } - - $tag = $before . (string) $tag . $after; - - return $tag; + _deprecated_function( __METHOD__, 'TBD', '' ); + return ''; } /** @@ -99,61 +103,12 @@ public function filter_print_before_after_script( $tag, $handle ) : string { * @param string $handle Which is the ID/Handle of the tag we are about to print. * * @return string Script tag with the localization variable HTML attached to it. + * + * @deprecated TBD */ public function filter_add_localization_data( $tag, $handle ) { - // Only filter for own filters. - if ( ! $asset = $this->get( $handle ) ) { - return $tag; - } - - // Bail when not dealing with JS assets. - if ( 'js' !== $asset->type ) { - return $tag; - } - - // Only localize on JS and if we have data. - if ( empty( $asset->localize ) ) { - return $tag; - } - - global $wp_scripts; - - // Makes sure we have an Array of Localize data. - if ( is_object( $asset->localize ) ) { - $localization = [ $asset->localize ]; - } else { - $localization = (array) $asset->localize; - } - - /** - * Check to ensure we haven't already localized it before. - * - * @since 4.5.8 - */ - foreach ( $localization as $localize ) { - if ( in_array( $localize->name, $this->localized ) ) { - continue; - } - - // If we have a Callable as the Localize data we execute it. - if ( is_callable( $localize->data ) ) { - $localize->data = call_user_func( $localize->data, $asset ); - } - - wp_localize_script( $asset->slug, $localize->name, $localize->data ); - - $this->localized[] = $localize->name; - } - - // Fetch the HTML for all the localized data. - ob_start(); - $wp_scripts->print_extra_script( $asset->slug, true ); - $localization_html = ob_get_clean(); - - // After printing it remove data;| - $wp_scripts->add_data( $asset->slug, 'data', '' ); - - return $localization_html . $tag; + _deprecated_function( __METHOD__, 'TBD', '' ); + return ''; } /** @@ -165,37 +120,12 @@ public function filter_add_localization_data( $tag, $handle ) { * @param string $handle Which is the ID/Handle of the tag we are about to print. * * @return string Script tag with the defer and/or async attached. + * + * @deprecated TBD */ public function filter_tag_async_defer( $tag, $handle ) { - // Only filter for our own filters. - if ( ! $asset = $this->get( $handle ) ) { - return $tag; - } - - // Bail when not dealing with JS assets. - if ( 'js' !== $asset->type ) { - return $tag; - } - - // When async and defer are false we bail with the tag. - if ( ! $asset->defer && ! $asset->async ) { - return $tag; - } - - $tag_has_async = false !== strpos( $tag, ' async ' ); - $tag_has_defer = false !== strpos( $tag, ' defer ' ); - $replacement = '' - ]; - yield 'simple-with-existing-type' => [ - '' - ]; - yield 'simple-without-src-or-id' => [ - '' - ]; - yield 'simple-with-existing-type-simple-quotes' => [ - '' - ]; - yield 'simple-with-existing-type-no-quotes' => [ - '' - ]; - } - - /** - * @test - * @dataProvider get_script_tags - */ - public function it_should_properly_had_module_type( $script_tag ) { - $plugin = Plugin::instance(); - $assets = new Assets; - - // Register generic script to ensure the module type is added. - $assets->register( - $plugin, - 'test-script', - codecept_data_dir( 'resources/test-script-1.js' ), - [], - null, - [ - 'module' => true, - ] - ); - - $script_tag = $assets->filter_modify_to_module( $script_tag, 'test-script' ); - - $this->assertContains( 'type="module"', $script_tag ); - } -} From 4bd61366341c6da57210887d728c92bbb4bd8bd2 Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Fri, 3 May 2024 10:56:08 +0200 Subject: [PATCH 10/75] fix(Libraries) configure Schema correctly --- src/Common/Libraries/Provider.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Common/Libraries/Provider.php b/src/Common/Libraries/Provider.php index 6faf77bc37..8578e1e381 100644 --- a/src/Common/Libraries/Provider.php +++ b/src/Common/Libraries/Provider.php @@ -2,9 +2,10 @@ namespace TEC\Common\Libraries; -use TEC\Common\StellarWP\DB; -use TEC\Common\StellarWP\Assets; use TEC\Common\Contracts\Service_Provider; +use TEC\Common\StellarWP\Assets; +use TEC\Common\StellarWP\DB; +use TEC\Common\StellarWP\Schema; use Tribe__Main as Common; class Provider extends Service_Provider { @@ -33,6 +34,8 @@ public function register() { Assets\Config::set_path( Common::instance()->plugin_path . 'src/resources/' ); Assets\Config::set_version( Common::VERSION ); Assets\Config::set_relative_asset_path( 'src/resources/' ); + Schema\Config::set_db( DB\DB::class ); + Schema\Config::set_container( tribe() ); } /** From edcd9bda85db72ba738e584c2d690aba0de3301a Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Fri, 3 May 2024 11:44:22 +0200 Subject: [PATCH 11/75] fix(Assets) null-safe version check --- src/Tribe/Assets.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tribe/Assets.php b/src/Tribe/Assets.php index 941e14eb48..36c1aa3525 100644 --- a/src/Tribe/Assets.php +++ b/src/Tribe/Assets.php @@ -356,7 +356,7 @@ public function register( $origin, $slug, $file, $deps = [], $action = null, $ar ); // Fetches the version on the Origin Version constant if not passed. - $version = $arguments['version'] ?: constant( $origin_name . '::VERSION' ); + $version = $arguments['version'] ?? constant( $origin_name . '::VERSION' ); /** * Filter to change version number on assets. From decb7df3f7d592acc8d76a8db86c8ce3ac488911 Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Fri, 3 May 2024 13:38:11 +0200 Subject: [PATCH 12/75] build(composer.json) track feature branch of assets lib --- composer.json | 2 +- composer.lock | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index bb8a8bf145..22d4c8bdf2 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "stellarwp/models": "dev-main", "stellarwp/schema": "^1.1.3", "stellarwp/telemetry": "^2.3.1", - "stellarwp/assets": "^1.2.0" + "stellarwp/assets": "dev-fix/too-early-checks" }, "require-dev": { "automattic/vipwpcs": "^3.0", diff --git a/composer.lock b/composer.lock index 97e3183568..bf6df465ee 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "200fe05f1d08f331634ab25927a0bf14", + "content-hash": "037d37c8c1bfb7b1e2b4b758465c4620", "packages": [ { "name": "firebase/php-jwt", @@ -295,16 +295,16 @@ }, { "name": "stellarwp/assets", - "version": "1.2.0", + "version": "dev-fix/too-early-checks", "source": { "type": "git", "url": "https://github.com/stellarwp/assets.git", - "reference": "c97e3288660c795db12bbae455741600ca08d584" + "reference": "a11ce813bb3c302d00469e1d9fe04fa6a1f9557a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stellarwp/assets/zipball/c97e3288660c795db12bbae455741600ca08d584", - "reference": "c97e3288660c795db12bbae455741600ca08d584", + "url": "https://api.github.com/repos/stellarwp/assets/zipball/a11ce813bb3c302d00469e1d9fe04fa6a1f9557a", + "reference": "a11ce813bb3c302d00469e1d9fe04fa6a1f9557a", "shasum": "" }, "require-dev": { @@ -345,9 +345,9 @@ "description": "A library for managing asset registration and enqueuing in WordPress.", "support": { "issues": "https://github.com/stellarwp/assets/issues", - "source": "https://github.com/stellarwp/assets/tree/1.2.0" + "source": "https://github.com/stellarwp/assets/tree/fix/too-early-checks" }, - "time": "2024-05-01T15:31:50+00:00" + "time": "2024-05-03T11:29:33+00:00" }, { "name": "stellarwp/container-contract", @@ -6920,6 +6920,7 @@ "minimum-stability": "dev", "stability-flags": { "stellarwp/models": 20, + "stellarwp/assets": 20, "stellarwp/coding-standards": 20, "the-events-calendar/tec-testing-facilities": 20 }, From d5d152c775c51388ab87f9339bbca9bf4e7f4e88 Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Fri, 3 May 2024 15:04:31 +0200 Subject: [PATCH 13/75] build(stellarwp/assets) req. 1.2.1 --- composer.json | 2 +- composer.lock | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 22d4c8bdf2..1c83140adc 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "stellarwp/models": "dev-main", "stellarwp/schema": "^1.1.3", "stellarwp/telemetry": "^2.3.1", - "stellarwp/assets": "dev-fix/too-early-checks" + "stellarwp/assets": "^1.2.1" }, "require-dev": { "automattic/vipwpcs": "^3.0", diff --git a/composer.lock b/composer.lock index bf6df465ee..2a73c1937e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "037d37c8c1bfb7b1e2b4b758465c4620", + "content-hash": "2d03ba22a6b50c06b8f6af8e4a188eb4", "packages": [ { "name": "firebase/php-jwt", @@ -295,16 +295,16 @@ }, { "name": "stellarwp/assets", - "version": "dev-fix/too-early-checks", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/stellarwp/assets.git", - "reference": "a11ce813bb3c302d00469e1d9fe04fa6a1f9557a" + "reference": "c5cbed2dcda2f075403440da5c46a96f53d74af9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stellarwp/assets/zipball/a11ce813bb3c302d00469e1d9fe04fa6a1f9557a", - "reference": "a11ce813bb3c302d00469e1d9fe04fa6a1f9557a", + "url": "https://api.github.com/repos/stellarwp/assets/zipball/c5cbed2dcda2f075403440da5c46a96f53d74af9", + "reference": "c5cbed2dcda2f075403440da5c46a96f53d74af9", "shasum": "" }, "require-dev": { @@ -345,9 +345,9 @@ "description": "A library for managing asset registration and enqueuing in WordPress.", "support": { "issues": "https://github.com/stellarwp/assets/issues", - "source": "https://github.com/stellarwp/assets/tree/fix/too-early-checks" + "source": "https://github.com/stellarwp/assets/tree/1.2.1" }, - "time": "2024-05-03T11:29:33+00:00" + "time": "2024-05-03T13:01:10+00:00" }, { "name": "stellarwp/container-contract", @@ -6920,7 +6920,6 @@ "minimum-stability": "dev", "stability-flags": { "stellarwp/models": 20, - "stellarwp/assets": 20, "stellarwp/coding-standards": 20, "the-events-calendar/tec-testing-facilities": 20 }, From 9d60fdbe43e834ea4db1d07befee77482e138f3d Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Mon, 6 May 2024 12:11:13 +0200 Subject: [PATCH 14/75] test(wpunit) remove debug statements --- .../Repository/ReadMultipleFieldsTest.php | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/tests/wpunit/Tribe/Repository/ReadMultipleFieldsTest.php b/tests/wpunit/Tribe/Repository/ReadMultipleFieldsTest.php index 9c3a3c7e21..96d5b02ae2 100644 --- a/tests/wpunit/Tribe/Repository/ReadMultipleFieldsTest.php +++ b/tests/wpunit/Tribe/Repository/ReadMultipleFieldsTest.php @@ -25,7 +25,6 @@ public function should_allow_querying_posts_by_two_post_fields() { 'LIKE', '%jump%' )->get_ids(); - codecept_debug( 'Query request SQL: ' . $repository->get_last_built_query()->request ); $this->assertEquals( [ $one, $three ], $matches ); @@ -35,7 +34,6 @@ public function should_allow_querying_posts_by_two_post_fields() { 'LIKE', 'jump%' )->get_ids(); - codecept_debug( 'Query request SQL: ' . $repository->get_last_built_query()->request ); $this->assertEquals( [ $one ], $matches ); @@ -45,7 +43,6 @@ public function should_allow_querying_posts_by_two_post_fields() { 'LIKE', '%jump' )->get_ids(); - codecept_debug( 'Query request SQL: ' . $repository->get_last_built_query()->request ); $this->assertEmpty( $matches ); @@ -56,7 +53,6 @@ public function should_allow_querying_posts_by_two_post_fields() { '%jump%', 'AND' )->get_ids(); - codecept_debug( 'Query request SQL: ' . $repository->get_last_built_query()->request ); $this->assertEquals( [ $two ], $matches ); } @@ -170,7 +166,6 @@ public function should_prefix_and_postfix_like_strings_if_no_placeholder_provide 'LIKE', 'jump' )->get_ids(); - codecept_debug( 'Query request SQL: ' . $repository->get_last_built_query()->request ); $this->assertEquals( [ $one, $three ], $matches ); @@ -181,7 +176,6 @@ public function should_prefix_and_postfix_like_strings_if_no_placeholder_provide '%jump%', 'AND' )->get_ids(); - codecept_debug( 'Query request SQL: ' . $repository->get_last_built_query()->request ); $this->assertEquals( [ $two ], $matches ); } @@ -202,7 +196,6 @@ public function should_allow_multiple_values_with_logic_or_and_and() { 'OR', 'OR' )->get_ids(); - codecept_debug( 'Query request SQL: ' . $repository->get_last_built_query()->request ); $this->assertEquals( [ $one, $two, $three ], $matches ); $repository = $this->repository(); @@ -213,7 +206,6 @@ public function should_allow_multiple_values_with_logic_or_and_and() { 'OR', 'AND' )->get_ids(); - codecept_debug( 'Query request SQL: ' . $repository->get_last_built_query()->request ); $this->assertEmpty( $matches ); $repository = $this->repository(); @@ -222,7 +214,6 @@ public function should_allow_multiple_values_with_logic_or_and_and() { 'LIKE', [ 'wizards', 'quickly' ] )->get_ids(); - codecept_debug( 'Query request SQL: ' . $repository->get_last_built_query()->request ); $this->assertEquals( [ $three ], $matches ); } @@ -276,7 +267,6 @@ public function should_allow_comparing_on_taxonomy_term_name() { 'LIKE', 'fiction' )->get_ids(); - codecept_debug( 'Query request SQL: ' . $repository->get_last_built_query()->request ); $this->assertEquals( [ $one, $two ], $matches ); $repository = $this->repository(); @@ -287,7 +277,6 @@ public function should_allow_comparing_on_taxonomy_term_name() { 'AND', 'AND' )->get_ids(); - codecept_debug( 'Query request SQL: ' . $repository->get_last_built_query()->request ); $this->assertEquals( [ $three ], $matches ); $repository = $this->repository(); @@ -297,7 +286,6 @@ public function should_allow_comparing_on_taxonomy_term_name() { [ 'trolling' ], 'AND' )->get_ids(); - codecept_debug( 'Query request SQL: ' . $repository->get_last_built_query()->request ); $this->assertEquals( [ $one, $two, $three ], $matches ); $repository = $this->repository(); @@ -306,7 +294,6 @@ public function should_allow_comparing_on_taxonomy_term_name() { 'LIKE', [ 'trolling' ] )->get_ids(); - codecept_debug( 'Query request SQL: ' . $repository->get_last_built_query()->request ); $this->assertEquals( [ $one, $two ], $matches ); } @@ -324,7 +311,6 @@ public function should_allow_searching_by_multiple_custom_fields() { 'LIKE', [ 'good' ] )->get_ids(); - codecept_debug( 'Query request SQL: ' . $repository->get_last_built_query()->request ); $this->assertEquals( [ $one, $two, $three ], $matches ); $repository = $this->repository(); @@ -333,7 +319,6 @@ public function should_allow_searching_by_multiple_custom_fields() { 'LIKE', [ 'pretty good' ] )->get_ids(); - codecept_debug( 'Query request SQL: ' . $repository->get_last_built_query()->request ); $this->assertEquals( [ $three ], $matches ); $repository = $this->repository(); @@ -342,7 +327,6 @@ public function should_allow_searching_by_multiple_custom_fields() { 'LIKE', [ 'bad', 'pretty bad' ] )->get_ids(); - codecept_debug( 'Query request SQL: ' . $repository->get_last_built_query()->request ); $this->assertEquals( [ $two, $three ], $matches ); } @@ -360,7 +344,6 @@ public function should_allow_searching_by_post_and_custom_fields_and_taxonomy_fi 'LIKE', [ 'fox', 'good' ] )->get_ids(); - codecept_debug( 'Query request SQL: ' . $repository->get_last_built_query()->request ); $this->assertEquals( [ $one, $two, $three ], $matches ); $repository = $this->repository(); @@ -369,7 +352,6 @@ public function should_allow_searching_by_post_and_custom_fields_and_taxonomy_fi 'LIKE', [ 'fox' ] )->get_ids(); - codecept_debug( 'Query request SQL: ' . $repository->get_last_built_query()->request ); $this->assertEquals( [ $one ], $matches ); } } From c75c735f39298301aa56ebf97f79cc134fcd8149 Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Mon, 6 May 2024 12:11:38 +0200 Subject: [PATCH 15/75] style(template-tags/general.php) remove excess blank line --- src/functions/template-tags/general.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/functions/template-tags/general.php b/src/functions/template-tags/general.php index 8c0a481838..e69fddf8de 100755 --- a/src/functions/template-tags/general.php +++ b/src/functions/template-tags/general.php @@ -758,7 +758,6 @@ function tribe_assets( $origin, $assets, $action = null, $arguments = [] ) { $asset_arguments = ! empty( $asset[4] ) ? array_merge( $arguments, $asset[4] ) : $arguments; $registered[] = Tribe__Assets::instance()->register( $origin, $slug, $file, $deps, $asset_action, $asset_arguments ); - } return $registered; From 1b361cc7eb6b4859872b49e5860e9c2cbb547b57 Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Mon, 6 May 2024 12:11:53 +0200 Subject: [PATCH 16/75] test(wpunit) update expectation --- .../Tribe/functions/templateTags/generalTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/wpunit/Tribe/functions/templateTags/generalTest.php b/tests/wpunit/Tribe/functions/templateTags/generalTest.php index 52833b336e..3ed4bcf0d6 100644 --- a/tests/wpunit/Tribe/functions/templateTags/generalTest.php +++ b/tests/wpunit/Tribe/functions/templateTags/generalTest.php @@ -47,8 +47,8 @@ public function test_tribe_asset_print_group() { tribe_assets( \Tribe__Main::instance(), [ - [ 'tribe-test-css', '/tests/_data/resources/test-style-1.css' ], - [ 'tribe-test-js', '/tests/_data/resources/test-script-1.js' ], + [ 'tribe-test-css', 'test-style-1.css' ], + [ 'tribe-test-js', 'test-script-1.js' ], ], // This action cannot possibly have happened. 'test_test_test', @@ -62,11 +62,11 @@ public function test_tribe_asset_print_group() { $output = tribe_asset_print_group( 'test-group', false ); $expected_tmpl = <<< TAG - - + + TAG; - $expected = str_replace( '{{ home_url }}', home_url(), $expected_tmpl ); + $expected = str_replace( '{{ common_url }}', home_url('/wp-content/plugins/the-events-calendar/common/resources'), $expected_tmpl ); $this->assertEquals( $expected, $output ); } } From 951e408ea3dfe1aef4711a282ac1f5c15595987c Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Mon, 6 May 2024 12:11:53 +0200 Subject: [PATCH 17/75] test(wpunit) update expectation --- .../Tribe/functions/templateTags/generalTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/wpunit/Tribe/functions/templateTags/generalTest.php b/tests/wpunit/Tribe/functions/templateTags/generalTest.php index 52833b336e..1a31277391 100644 --- a/tests/wpunit/Tribe/functions/templateTags/generalTest.php +++ b/tests/wpunit/Tribe/functions/templateTags/generalTest.php @@ -47,8 +47,8 @@ public function test_tribe_asset_print_group() { tribe_assets( \Tribe__Main::instance(), [ - [ 'tribe-test-css', '/tests/_data/resources/test-style-1.css' ], - [ 'tribe-test-js', '/tests/_data/resources/test-script-1.js' ], + [ 'tribe-test-css', 'test-style-1.css' ], + [ 'tribe-test-js', 'test-script-1.js' ], ], // This action cannot possibly have happened. 'test_test_test', @@ -62,11 +62,11 @@ public function test_tribe_asset_print_group() { $output = tribe_asset_print_group( 'test-group', false ); $expected_tmpl = <<< TAG - - + + TAG; - $expected = str_replace( '{{ home_url }}', home_url(), $expected_tmpl ); + $expected = str_replace( '{{ common_url }}', home_url('/wp-content/plugins/the-events-calendar/common/src/resources'), $expected_tmpl ); $this->assertEquals( $expected, $output ); } } From 9a5b021a22c7aef1be0e250a2626f508e8598392 Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Mon, 6 May 2024 13:15:32 +0200 Subject: [PATCH 18/75] style(src,tests) autofix some issues --- src/Tribe/Assets.php | 38 ++++++----- src/functions/template-tags/general.php | 65 ++++++++++--------- .../functions/templateTags/generalTest.php | 29 ++++++--- 3 files changed, 73 insertions(+), 59 deletions(-) diff --git a/src/Tribe/Assets.php b/src/Tribe/Assets.php index 36c1aa3525..885c0b90d0 100644 --- a/src/Tribe/Assets.php +++ b/src/Tribe/Assets.php @@ -38,7 +38,7 @@ public function __construct() { * @return void */ public function hook(): void { - add_filter( "stellarwp/assets/tec/enqueue", [ $this, 'proxy_enqueue_filter' ], 10, 2 ); + add_filter( 'stellarwp/assets/tec/enqueue', [ $this, 'proxy_enqueue_filter' ], 10, 2 ); } /** @@ -46,7 +46,7 @@ public function hook(): void { * * @since TBD * - * @param bool $enqueue If we should enqueue or not a given asset. + * @param bool $enqueue If we should enqueue or not a given asset. * @param Asset $asset Which asset we are dealing with. * * @return mixed|null @@ -88,7 +88,7 @@ public function proxy_enqueue_filter( $enqueue, $asset ) { * * @deprecated TBD */ - public function filter_print_before_after_script( $tag, $handle ) : string { + public function filter_print_before_after_script( $tag, $handle ): string { _deprecated_function( __METHOD__, 'TBD', '' ); return ''; } @@ -399,26 +399,30 @@ public function register( $origin, $slug, $file, $deps = [], $action = null, $ar if ( $operator === 'OR' ) { // Build a Closure condition that will return true if any of the callables return true. - $asset->set_condition( function () use ( $conditional_callables ) { - foreach ( $conditional_callables as $condition ) { - if ( $condition() ) { - return true; + $asset->set_condition( + function () use ( $conditional_callables ) { + foreach ( $conditional_callables as $condition ) { + if ( $condition() ) { + return true; + } } - } - return false; - } ); + return false; + } + ); } else { // Build a Closure condition that will return true if all of the callables return true. - $asset->set_condition( function () use ( $conditional_callables ) { - foreach ( $conditional_callables as $condition ) { - if ( ! $condition() ) { - return false; + $asset->set_condition( + function () use ( $conditional_callables ) { + foreach ( $conditional_callables as $condition ) { + if ( ! $condition() ) { + return false; + } } - } - return true; - } ); + return true; + } + ); } } } diff --git a/src/functions/template-tags/general.php b/src/functions/template-tags/general.php index e69fddf8de..bb5b0c868f 100755 --- a/src/functions/template-tags/general.php +++ b/src/functions/template-tags/general.php @@ -127,7 +127,7 @@ function tribe_resource_url( $resource, $echo = false, $root_dir = null, $origin if ( is_object( $origin ) ) { $plugin_path = ! empty( $origin->plugin_path ) ? $origin->plugin_path : $origin->pluginPath; } else { - $plugin_path = dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) ); + $plugin_path = dirname( dirname( dirname( dirname( __DIR__ ) ) ) ); } if ( ! isset( $_plugin_url[ $plugin_path ] ) ) { @@ -135,7 +135,7 @@ function tribe_resource_url( $resource, $echo = false, $root_dir = null, $origin } $plugin_base_url = $_plugin_url[ $plugin_path ]; - $extension = pathinfo( $resource, PATHINFO_EXTENSION ); + $extension = pathinfo( $resource, PATHINFO_EXTENSION ); $resource_path = $root_dir; if ( is_null( $resource_path ) ) { @@ -231,7 +231,7 @@ function tribe_get_datetime_format( $with_year = false ) { $separator = (array) str_split( $raw_separator ); if ( empty( $raw_separator ) ) { - /** + /** * Filterable fallback for when the dateTimeSeparator is an empty string. Defaults to a space. * * @since 4.5.6 @@ -243,7 +243,7 @@ function tribe_get_datetime_format( $with_year = false ) { $separator[0] = apply_filters( 'tribe_empty_datetime_separator_fallback', ' ', $raw_separator ); } - $format = tribe_get_date_format( $with_year ); + $format = tribe_get_date_format( $with_year ); $format .= ( ! empty( $separator ) ? '\\' : '' ) . implode( '\\', $separator ); $format .= get_option( 'time_format' ); @@ -259,7 +259,7 @@ function tribe_get_datetime_format( $with_year = false ) { * * @return mixed|void */ - function tribe_get_time_format( ) { + function tribe_get_time_format() { static $cache_var_name = __FUNCTION__; $format = tribe_get_var( $cache_var_name, null ); @@ -323,7 +323,7 @@ function tribe_prepare_for_json( $string ) { $value = str_replace( '"', '"', $value ); // &#013; is same as \r and JSON strings should be a single line not multiple lines. $removable_values = [ '\r', '\n', '\t', '&#013;' ]; - $value = str_replace( $removable_values, '', $value ); + $value = str_replace( $removable_values, '', $value ); return $value; } @@ -369,7 +369,7 @@ function tribe_prepare_for_json_deep( $value ) { function tribe_the_notices( $echo = true ) { $notices = Tribe__Notices::get(); - $html = ! empty( $notices ) ? '
  • ' . implode( '
  • ', $notices ) . '
' : ''; + $html = ! empty( $notices ) ? '
  • ' . implode( '
  • ', $notices ) . '
' : ''; /** * Deprecated the tribe_events_the_notices filter in 4.0 in favor of tribe_the_notices. Remove in 5.0 @@ -407,7 +407,8 @@ function tribe_is_bot() { // declare known bot user agents (lowercase) $user_agent_bots = (array) apply_filters( - 'tribe_is_bot_list', [ + 'tribe_is_bot_list', + [ 'bot', 'slurp', 'spider', @@ -437,7 +438,7 @@ function tribe_is_bot() { */ function tribe_count_hierarchical_keys( $value, $key ) { global $tribe_count_hierarchical_increment; - $tribe_count_hierarchical_increment++; + ++$tribe_count_hierarchical_increment; } }//end if @@ -481,10 +482,10 @@ function tribe_get_mobile_breakpoint( $default = 768 ) { * Receives a float and formats it with a currency symbol * * @category Cost - * @param string $cost pricing to format - * @param null|int $post_id + * @param string $cost pricing to format + * @param null|int $post_id * @param null|string $currency_symbol - * @param null|bool $reverse_position + * @param null|bool $reverse_position * * @return string */ @@ -563,14 +564,14 @@ function tribe_format_currency( $cost, $post_id = null, $currency_symbol = null, * * @category Events * @param string $optionName Name of the option to retrieve. - * @param string $default Value to return if no such option is found. + * @param string $default Value to return if no such option is found. * * @return mixed Value of the option if found */ function tribe_get_date_option( $optionName, $default = '' ) { $value = tribe_get_option( $optionName, $default ); - return Tribe__Date_Utils::unescape_date_format($value); + return Tribe__Date_Utils::unescape_date_format( $value ); } } @@ -580,8 +581,8 @@ function tribe_get_date_option( $optionName, $default = '' ) { * @param string $slug Slug to save the notice * @param callable|string $callback A callable Method/Function to actually display the notice * @param array $arguments Arguments to Setup a notice - * @param callable|null $active_callback An optional callback that should return bool values - * to indicate whether the notice should display or not. + * @param callable|null $active_callback An optional callback that should return bool values + * to indicate whether the notice should display or not. * * @return stdClass Which notice was registered */ @@ -598,7 +599,7 @@ function tribe_notice( $slug, $callback, $arguments = [], $active_callback = nul * @param string $slug Slug to save the notice * @param string $html The notice output HTML code * @param array $arguments Arguments to Setup a notice - * @param int $expire After how much time (in seconds) the notice will stop showing. + * @param int $expire After how much time (in seconds) the notice will stop showing. * * @return stdClass Which notice was registered */ @@ -635,8 +636,8 @@ function tribe_error( $indexes, $context = [], $sprintf = [] ) { /** * Register a new error based on a Namespace * - * @param string|array $indexes A list of the namespaces and last item should be the error name - * @param string $message What is going to be the message associate with this indexes + * @param string|array $indexes A list of the namespaces and last item should be the error name + * @param string $message What is going to be the message associate with this indexes * * @return boolean */ @@ -650,14 +651,14 @@ function tribe_register_error( $indexes, $message ) { * @since 4.3 * @since TBD Replaced the function internals with calls to the stellarwp/assets library. * - * @param object|string $origin The origin of the asset, either a class or a string. - * @param string $handle The handle of the asset. - * @param string $file The file of the asset. + * @param object|string $origin The origin of the asset, either a class or a string. + * @param string $handle The handle of the asset. + * @param string $file The file of the asset. * @param array|callable $deps The dependencies of the asset; either an array of dependencies or a callable * that returns an array of dependencies. - * @param string|string[]|null $action The action(s) to enqueue the asset on; either a string or an array of strings. - * @param array $arguments { - * The arguments to pass to the asset. + * @param string|string[]|null $action The action(s) to enqueue the asset on; either a string or an array of strings. + * @param array $arguments { + * The arguments to pass to the asset. * * @type string $type The type of the asset. * @type string $media The media type of the asset. @@ -709,7 +710,7 @@ function tribe_asset_enqueue( $slug ) { * @since 4.7 * @since TBD Refactored to use the `stelarwp/assets` library. * - * @param string|array $group Which group(s) should be enqueued. + * @param string|array $group Which group(s) should be enqueued. */ function tribe_asset_enqueue_group( $group ) { Tribe__Assets::instance()->enqueue_group( $group ); @@ -721,17 +722,17 @@ function tribe_asset_enqueue_group( $group ) { * @since 4.3 * @since 4.12.10 Added support for overriding arguments for individual assets. * - * @param object $origin The main Object for the plugin you are enqueueing the script/style for - * @param array $assets { - * Indexed array, don't use any associative key. - * E.g.: [ 'slug-my-script', 'my/own/path.js', [ 'jquery' ] ] + * @param object $origin The main Object for the plugin you are enqueueing the script/style for + * @param array $assets { + * Indexed array, don't use any associative key. + * E.g.: [ 'slug-my-script', 'my/own/path.js', [ 'jquery' ] ] * * @type string $slug Slug to save the asset * @type string $file Which file will be loaded, either CSS or JS * @type array $deps (optional) Dependencies * } - * @param string $action A WordPress hook that will automatically enqueue this asset once fired - * @param array $arguments Look at `Tribe__Assets::register()` for more info + * @param string $action A WordPress hook that will automatically enqueue this asset once fired + * @param array $arguments Look at `Tribe__Assets::register()` for more info * * @return array Which Assets were registered */ diff --git a/tests/wpunit/Tribe/functions/templateTags/generalTest.php b/tests/wpunit/Tribe/functions/templateTags/generalTest.php index 1a31277391..af86b9fe1f 100644 --- a/tests/wpunit/Tribe/functions/templateTags/generalTest.php +++ b/tests/wpunit/Tribe/functions/templateTags/generalTest.php @@ -22,12 +22,18 @@ public function tearDown() { */ public function test_tribe_format_currency() { $post_id = $this->factory->post->create(); - add_filter( 'tribe_currency_symbol', function () { - return 'Q'; - } ); - add_filter( 'tribe_reverse_currency_position', function () { - return false; - } ); + add_filter( + 'tribe_currency_symbol', + function () { + return 'Q'; + } + ); + add_filter( + 'tribe_reverse_currency_position', + function () { + return false; + } + ); $this->assertEquals( 'Q12', tribe_format_currency( 12, $post_id ) ); $this->assertEquals( 'F12', tribe_format_currency( 12, $post_id, 'F' ) ); @@ -40,9 +46,12 @@ public function test_tribe_format_currency() { */ public function test_tribe_asset_print_group() { // Ensure the version will stay fixed. - add_filter( 'tribe_asset_version', static function () { - return '1.0.0'; - } ); + add_filter( + 'tribe_asset_version', + static function () { + return '1.0.0'; + } + ); // Register a group of assets that would never be printed. tribe_assets( \Tribe__Main::instance(), @@ -66,7 +75,7 @@ public function test_tribe_asset_print_group() { TAG; - $expected = str_replace( '{{ common_url }}', home_url('/wp-content/plugins/the-events-calendar/common/src/resources'), $expected_tmpl ); + $expected = str_replace( '{{ common_url }}', home_url( '/wp-content/plugins/the-events-calendar/common/src/resources' ), $expected_tmpl ); $this->assertEquals( $expected, $output ); } } From 402b413bffd2c39ef97358c53afcc58cbd486a14 Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Mon, 6 May 2024 13:50:20 +0200 Subject: [PATCH 19/75] test(wpunit) correct quotes --- tests/wpunit/Tribe/functions/templateTags/generalTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/wpunit/Tribe/functions/templateTags/generalTest.php b/tests/wpunit/Tribe/functions/templateTags/generalTest.php index af86b9fe1f..a8b5909b1c 100644 --- a/tests/wpunit/Tribe/functions/templateTags/generalTest.php +++ b/tests/wpunit/Tribe/functions/templateTags/generalTest.php @@ -26,13 +26,13 @@ public function test_tribe_format_currency() { 'tribe_currency_symbol', function () { return 'Q'; - } + } ); add_filter( 'tribe_reverse_currency_position', function () { return false; - } + } ); $this->assertEquals( 'Q12', tribe_format_currency( 12, $post_id ) ); @@ -50,7 +50,7 @@ public function test_tribe_asset_print_group() { 'tribe_asset_version', static function () { return '1.0.0'; - } + } ); // Register a group of assets that would never be printed. tribe_assets( @@ -71,7 +71,7 @@ static function () { $output = tribe_asset_print_group( 'test-group', false ); $expected_tmpl = <<< TAG - + TAG; From 231b88b52d328064eae9e37a65bb020424e6345b Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Mon, 6 May 2024 14:11:05 +0200 Subject: [PATCH 20/75] style(src) more fixes --- src/Tribe/Assets.php | 19 ++++++++-------- src/functions/template-tags/general.php | 30 ++++++++++++------------- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/Tribe/Assets.php b/src/Tribe/Assets.php index 885c0b90d0..7af13a7873 100644 --- a/src/Tribe/Assets.php +++ b/src/Tribe/Assets.php @@ -88,7 +88,7 @@ public function proxy_enqueue_filter( $enqueue, $asset ) { * * @deprecated TBD */ - public function filter_print_before_after_script( $tag, $handle ): string { + public function filter_print_before_after_script( $tag, $handle ): string { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed _deprecated_function( __METHOD__, 'TBD', '' ); return ''; } @@ -106,7 +106,7 @@ public function filter_print_before_after_script( $tag, $handle ): string { * * @deprecated TBD */ - public function filter_add_localization_data( $tag, $handle ) { + public function filter_add_localization_data( $tag, $handle ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed _deprecated_function( __METHOD__, 'TBD', '' ); return ''; } @@ -123,7 +123,7 @@ public function filter_add_localization_data( $tag, $handle ) { * * @deprecated TBD */ - public function filter_tag_async_defer( $tag, $handle ) { + public function filter_tag_async_defer( $tag, $handle ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed _deprecated_function( __METHOD__, 'TBD', '' ); return ''; } @@ -140,7 +140,7 @@ public function filter_tag_async_defer( $tag, $handle ) { * * @deprecated TBD */ - public function filter_modify_to_module( $tag, $handle ) { + public function filter_modify_to_module( $tag, $handle ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed _deprecated_function( __METHOD__, 'TBD', '' ); return ''; } @@ -155,7 +155,7 @@ public function filter_modify_to_module( $tag, $handle ) { * * @deprecated TBD */ - public function register_in_wp( $assets = null ) { + public function register_in_wp( $assets = null ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found _deprecated_function( __METHOD__, 'TBD', '' ); } @@ -185,7 +185,7 @@ public function enqueue_group( $groups ) { * @since 4.3 * @since TBD Refactored to use the stellarwp/assets library. * - * @param string|array $forcibly_enqueue + * @param string|array $forcibly_enqueue Whether to force enqueueing of the assets or not. */ public function enqueue( $forcibly_enqueue = null ) { Assets::instance()->enqueue( $forcibly_enqueue ); @@ -352,6 +352,7 @@ public function register( $origin, $slug, $file, $deps = [], $action = null, $ar $root_path = str_replace( dirname( WP_CONTENT_DIR ) ?: WP_CONTENT_DIR, '', + // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase trailingslashit( ! empty( $origin->plugin_path ) ? $origin->plugin_path : $origin->pluginPath ) ); @@ -408,7 +409,7 @@ function () use ( $conditional_callables ) { } return false; - } + } ); } else { // Build a Closure condition that will return true if all of the callables return true. @@ -421,7 +422,7 @@ function () use ( $conditional_callables ) { } return true; - } + } ); } } @@ -509,7 +510,7 @@ function () use ( $conditional_callables ) { } if ( ! empty( $arguments['print'] ) ) { - $asset->print( true ); + $asset->print(); } $asset->register(); diff --git a/src/functions/template-tags/general.php b/src/functions/template-tags/general.php index bb5b0c868f..11502003df 100755 --- a/src/functions/template-tags/general.php +++ b/src/functions/template-tags/general.php @@ -482,12 +482,12 @@ function tribe_get_mobile_breakpoint( $default = 768 ) { * Receives a float and formats it with a currency symbol * * @category Cost - * @param string $cost pricing to format - * @param null|int $post_id - * @param null|string $currency_symbol - * @param null|bool $reverse_position + * @param string $cost pricing to format. + * @param null|int $post_id Post ID. + * @param null|string $currency_symbol Currency symbol. + * @param null|bool $reverse_position Reverse position. * - * @return string + * @return string Formatted currency. */ function tribe_format_currency( $cost, $post_id = null, $currency_symbol = null, $reverse_position = null ) { $post_id = Tribe__Main::post_id_helper( $post_id ); @@ -636,10 +636,10 @@ function tribe_error( $indexes, $context = [], $sprintf = [] ) { /** * Register a new error based on a Namespace * - * @param string|array $indexes A list of the namespaces and last item should be the error name - * @param string $message What is going to be the message associate with this indexes + * @param string|array $indexes A list of the namespaces and last item should be the error name. + * @param string $message What is going to be the message associate with this indexes. * - * @return boolean + * @return boolean Whether the error was registered or not. */ function tribe_register_error( $indexes, $message ) { return Tribe__Error::instance()->register( $indexes, $message ); @@ -652,7 +652,7 @@ function tribe_register_error( $indexes, $message ) { * @since TBD Replaced the function internals with calls to the stellarwp/assets library. * * @param object|string $origin The origin of the asset, either a class or a string. - * @param string $handle The handle of the asset. + * @param string $slug The handle of the asset. * @param string $file The file of the asset. * @param array|callable $deps The dependencies of the asset; either an array of dependencies or a callable * that returns an array of dependencies. @@ -722,19 +722,19 @@ function tribe_asset_enqueue_group( $group ) { * @since 4.3 * @since 4.12.10 Added support for overriding arguments for individual assets. * - * @param object $origin The main Object for the plugin you are enqueueing the script/style for + * @param object $origin The main Object for the plugin you are enqueueing the script/style for. * @param array $assets { * Indexed array, don't use any associative key. * E.g.: [ 'slug-my-script', 'my/own/path.js', [ 'jquery' ] ] * - * @type string $slug Slug to save the asset - * @type string $file Which file will be loaded, either CSS or JS + * @type string $slug Slug to save the asset. + * @type string $file Which file will be loaded, either CSS or JS. * @type array $deps (optional) Dependencies * } - * @param string $action A WordPress hook that will automatically enqueue this asset once fired - * @param array $arguments Look at `Tribe__Assets::register()` for more info + * @param string $action A WordPress hook that will automatically enqueue this asset once fired. + * @param array $arguments Look at `Tribe__Assets::register()` for more info. * - * @return array Which Assets were registered + * @return array Which Assets were registered. */ function tribe_assets( $origin, $assets, $action = null, $arguments = [] ) { $registered = []; From 174ba0442669419d05d4ce69e2c1f9c2207e1d10 Mon Sep 17 00:00:00 2001 From: Stephen Page Date: Mon, 20 May 2024 12:49:48 -0400 Subject: [PATCH 21/75] Apply suggestions from code review --- src/Tribe/Assets.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tribe/Assets.php b/src/Tribe/Assets.php index 7af13a7873..b53e910d62 100644 --- a/src/Tribe/Assets.php +++ b/src/Tribe/Assets.php @@ -25,7 +25,7 @@ public static function instance() { * Register the Methods in the correct places. * * @since 4.3 - * @since TBD Emptied of all hooks in favor fo the stellarwp/assets library. + * @since TBD Emptied of all hooks in favor of the stellarwp/assets library. */ public function __construct() { } From 3ce5b9cfc36811923798c5f445a46230c2c70efe Mon Sep 17 00:00:00 2001 From: Stephen Page Date: Mon, 20 May 2024 13:15:17 -0400 Subject: [PATCH 22/75] Add puprc --- .puprc | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .puprc diff --git a/.puprc b/.puprc new file mode 100644 index 0000000000..156d9331ef --- /dev/null +++ b/.puprc @@ -0,0 +1,59 @@ +{ + "build": [ + "rm -rf vendor", + "git checkout -- vendor", + "composer install --no-dev", + "npm ci", + "npm run build" + ], + "build_dev": [ + "rm -rf vendor", + "git checkout -- vendor", + "composer install", + "npm ci", + "npm run build" + ], + "checks": { + "tbd": { + "dirs": [ "src" ] + }, + "version-conflict": {} + }, + "i18n": [ + { + "textdomain": "tribe-common", + "url": "https://translations.theeventscalendar.com", + "slug": "tribe-common" + } + ], + "paths": { + "changelog": "readme.txt", + "css": [ + "src/resources/postcss" + ], + "js": [ + "src/resources/js", + "src/modules" + ], + "sync_files": [ + ".distfiles", + ".gitattributes" + ], + "versions": [ + { + "file": "src/Tribe/Main.php", + "regex": "(const VERSION += ')([^']+)" + }, + { + "file": "tribe-common.php", + "regex": "(Version: )(.+)" + }, + { + "file": "package.json", + "regex": "(\"version\": \")([^\"]+)" + } + ], + "views": [ "src/views" ] + }, + "zip_name": "tribe-common" +} From cbe471b6281e953de8e46242ddfa3fd23e5cbf90 Mon Sep 17 00:00:00 2001 From: Stephen Page Date: Mon, 20 May 2024 13:40:01 -0400 Subject: [PATCH 23/75] Make sure space between : and " is there, but optional. --- .puprc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.puprc b/.puprc index 156d9331ef..a4796f489c 100644 --- a/.puprc +++ b/.puprc @@ -50,7 +50,7 @@ }, { "file": "package.json", - "regex": "(\"version\": \")([^\"]+)" + "regex": "(\"version\": ?\")([^\"]+)" } ], "views": [ "src/views" ] From 16bbeefa1cc8f294e967e175dafc31fb415cdc13 Mon Sep 17 00:00:00 2001 From: Stephen Page Date: Mon, 20 May 2024 15:36:35 -0400 Subject: [PATCH 24/75] versioning --- package.json | 2 +- readme.txt | 4 ++++ src/Tribe/Main.php | 2 +- tribe-common.php | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c3a5c5728d..5adc84fa6c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tribe-common", - "version": "5.2.7", + "version": "5.3.0", "repository": "git@github.com:the-events-calendar/tribe-common.git", "_resourcepath": "src/resources", "_domainPath": "lang", diff --git a/readme.txt b/readme.txt index 6f5d6dc3aa..b300b9d152 100644 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,9 @@ == Changelog == += [5.3.0] 2024-06-11 = + + + = [5.2.7] 2024-05-14 = * Fix - Add dir/filename of `event-automator` in the Plugins_API to fix CTA button text/links in the Help section. [TEC-5071] diff --git a/src/Tribe/Main.php b/src/Tribe/Main.php index 978f1c1b47..b1f76abe16 100644 --- a/src/Tribe/Main.php +++ b/src/Tribe/Main.php @@ -18,7 +18,7 @@ class Tribe__Main { const OPTIONNAME = 'tribe_events_calendar_options'; const OPTIONNAMENETWORK = 'tribe_events_calendar_network_options'; const FEED_URL = 'https://theeventscalendar.com/feed/'; - const VERSION = '5.2.7'; + const VERSION = '5.3.0'; protected $plugin_context; protected $plugin_context_class; diff --git a/tribe-common.php b/tribe-common.php index 0e586b11fd..638a49cf5e 100644 --- a/tribe-common.php +++ b/tribe-common.php @@ -2,7 +2,7 @@ /** * Plugin Name: Tribe Common * Description: An event settings framework for managing shared options. - * Version: 5.2.7 + * Version: 5.3.0 * Author: The Events Calendar * Author URI: http://evnt.is/1x * Text Domain: tribe-common From e86cee4907dfaf2b3ec1432049e7782e71e57dc1 Mon Sep 17 00:00:00 2001 From: Stephen Page Date: Wed, 22 May 2024 15:55:14 -0400 Subject: [PATCH 25/75] Add pup generated files to gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index f4f7149792..c15600479a 100644 --- a/.gitignore +++ b/.gitignore @@ -46,5 +46,8 @@ src/resources/js/**/*.min.js lang/*.po lang/*.mo +# Local packaging files +.pup-* + # Strauss bin/strauss.phar From 1cac817f405b3a123fc0a3e05090bb32fd4ed37f Mon Sep 17 00:00:00 2001 From: Stephen Page Date: Fri, 24 May 2024 14:45:06 -0400 Subject: [PATCH 26/75] Update package lock --- package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index efe9869ea8..9cfe5c43e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "tribe-common", - "version": "5.4.0-dev", + "version": "5.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "tribe-common", - "version": "5.4.0-dev", + "version": "5.3.0", "dependencies": { "@babel/runtime": "^7.15.3", "@moderntribe/common": "file:src/modules", From 324b0d3cb5959348c787052830588f25079b45c1 Mon Sep 17 00:00:00 2001 From: Stephen Page Date: Mon, 27 May 2024 13:23:11 -0400 Subject: [PATCH 27/75] Add output to indicate where we're building common. --- .puprc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.puprc b/.puprc index a4796f489c..0e2fc4d568 100644 --- a/.puprc +++ b/.puprc @@ -1,5 +1,6 @@ { "build": [ + "echo 'building Tribe Common in: '$(pwd)", "rm -rf vendor", "git checkout -- vendor", "composer install --no-dev", @@ -7,6 +8,7 @@ "npm run build" ], "build_dev": [ + "echo 'building Tribe Common in: '$(pwd)", "rm -rf vendor", "git checkout -- vendor", "composer install", From 916f26e5d7b35d1d637a8300cbd4ef0b8606e3a2 Mon Sep 17 00:00:00 2001 From: Stellar Bot <74736843+tec-bot@users.noreply.github.com> Date: Tue, 28 May 2024 17:06:36 +0200 Subject: [PATCH 28/75] :fast_forward: https://github.com/the-events-calendar/tribe-common-styles/commit/5c56a469f2eb3f4be40afcc7cb676c2cb19bfa39 --- src/resources/postcss/utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resources/postcss/utilities b/src/resources/postcss/utilities index ecb4d65dfb..5c56a469f2 160000 --- a/src/resources/postcss/utilities +++ b/src/resources/postcss/utilities @@ -1 +1 @@ -Subproject commit ecb4d65dfbb6e48704e309c2586e6950cff5f44d +Subproject commit 5c56a469f2eb3f4be40afcc7cb676c2cb19bfa39 From c454e649135f201050ba6bf2c920979d629f79fe Mon Sep 17 00:00:00 2001 From: Stephen Page Date: Wed, 29 May 2024 09:48:18 -0400 Subject: [PATCH 29/75] readme --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index b300b9d152..51575dd183 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ = [5.3.0] 2024-06-11 = - +* Feature - Refactor tribe_asset to use Stellar Assets. [TCMN-172] = [5.2.7] 2024-05-14 = From 02ecaf58265389cc0dbfd94a8164b342218b24d1 Mon Sep 17 00:00:00 2001 From: Stellar Bot <74736843+tec-bot@users.noreply.github.com> Date: Wed, 29 May 2024 15:54:47 +0200 Subject: [PATCH 30/75] :fast_forward: https://github.com/the-events-calendar/tribe-common-styles/commit/5c56a469f2eb3f4be40afcc7cb676c2cb19bfa39 --- src/resources/postcss/utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resources/postcss/utilities b/src/resources/postcss/utilities index ecb4d65dfb..5c56a469f2 160000 --- a/src/resources/postcss/utilities +++ b/src/resources/postcss/utilities @@ -1 +1 @@ -Subproject commit ecb4d65dfbb6e48704e309c2586e6950cff5f44d +Subproject commit 5c56a469f2eb3f4be40afcc7cb676c2cb19bfa39 From 12cac34d3450f814198985a386d895132686410f Mon Sep 17 00:00:00 2001 From: Stephen Page Date: Wed, 29 May 2024 16:08:45 -0400 Subject: [PATCH 31/75] Implement force enqueue as we had before. --- src/Tribe/Assets.php | 14 ++++++++------ src/functions/template-tags/general.php | 19 +++++++++++++------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/Tribe/Assets.php b/src/Tribe/Assets.php index b53e910d62..3836399030 100644 --- a/src/Tribe/Assets.php +++ b/src/Tribe/Assets.php @@ -167,10 +167,11 @@ public function register_in_wp( $assets = null ) { // phpcs:ignore Generic.CodeA * * @uses Tribe__Assets::enqueue() * - * @param string|array $groups Which groups will be enqueued. + * @param string|array $groups Which groups will be enqueued. + * @param bool $forcibly_enqueue Whether to ignore conditional requirements when enqueuing. */ - public function enqueue_group( $groups ) { - Assets::instance()->enqueue_group( $groups ); + public function enqueue_group( $groups, $forcibly_enqueue = false ) { + Assets::instance()->enqueue_group( $groups, $forcibly_enqueue ); } /** @@ -185,10 +186,11 @@ public function enqueue_group( $groups ) { * @since 4.3 * @since TBD Refactored to use the stellarwp/assets library. * - * @param string|array $forcibly_enqueue Whether to force enqueueing of the assets or not. + * @param string|array $assets Which assets to enqueue. + * @param bool $forcibly_enqueue Whether to ignore conditional requirements when enqueuing. */ - public function enqueue( $forcibly_enqueue = null ) { - Assets::instance()->enqueue( $forcibly_enqueue ); + public function enqueue( $assets = [], $forcibly_enqueue = true ) { + Assets::instance()->enqueue( $assets, $forcibly_enqueue ); } /** diff --git a/src/functions/template-tags/general.php b/src/functions/template-tags/general.php index 11502003df..fe7e41b2eb 100755 --- a/src/functions/template-tags/general.php +++ b/src/functions/template-tags/general.php @@ -695,25 +695,32 @@ function tribe_asset( $origin, $slug, $file, $deps = [], $action = null, $argume /** * Immediately enqueues an asset. * + * Note if force is set ot `true` (default) this will ignore any + * conditional logic set for the asset and enqueue regardless. + * * @since 4.7 - * @since TBD Refactored to use the `stelarwp/assets` library. + * @since TBD Refactored to use the `stellarwp/assets` library. * * @param string|array $slug Slug to enqueue + * @param bool $force Whether to force the enqueue or not. */ -function tribe_asset_enqueue( $slug ) { - Tribe__Assets::instance()->enqueue( $slug ); +function tribe_asset_enqueue( $slug, $force = true ) { + Tribe__Assets::instance()->enqueue( $slug, $force ); } /** * Enqueues assets by groups. * + * Note if force is set ot `true` (default) this will ignore any + * conditional logic set for the asset and enqueue regardless. + * * @since 4.7 - * @since TBD Refactored to use the `stelarwp/assets` library. + * @since TBD Refactored to use the `stellarwp/assets` library. * * @param string|array $group Which group(s) should be enqueued. */ -function tribe_asset_enqueue_group( $group ) { - Tribe__Assets::instance()->enqueue_group( $group ); +function tribe_asset_enqueue_group( $group, $force = true ) { + Tribe__Assets::instance()->enqueue_group( $group, $force ); } /** From ee9d3721a4d777357bc49f2d6a3733fa9bd004eb Mon Sep 17 00:00:00 2001 From: Stephen Page Date: Wed, 29 May 2024 16:42:49 -0400 Subject: [PATCH 32/75] Default to true --- src/Tribe/Assets.php | 6 ++++-- src/functions/template-tags/general.php | 14 +++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/Tribe/Assets.php b/src/Tribe/Assets.php index 3836399030..c174ccfa61 100644 --- a/src/Tribe/Assets.php +++ b/src/Tribe/Assets.php @@ -165,12 +165,12 @@ public function register_in_wp( $assets = null ) { // phpcs:ignore Generic.CodeA * @since 4.7 * @since TBD Refactored to use the stellarwp/assets library. * - * @uses Tribe__Assets::enqueue() + * @uses TEC\Common\StellarWP\Assets\Assets::enqueue_group() * * @param string|array $groups Which groups will be enqueued. * @param bool $forcibly_enqueue Whether to ignore conditional requirements when enqueuing. */ - public function enqueue_group( $groups, $forcibly_enqueue = false ) { + public function enqueue_group( $groups, $forcibly_enqueue = true ) { Assets::instance()->enqueue_group( $groups, $forcibly_enqueue ); } @@ -186,6 +186,8 @@ public function enqueue_group( $groups, $forcibly_enqueue = false ) { * @since 4.3 * @since TBD Refactored to use the stellarwp/assets library. * + * @uses TEC\Common\StellarWP\Assets\Assets::enqueue() + * * @param string|array $assets Which assets to enqueue. * @param bool $forcibly_enqueue Whether to ignore conditional requirements when enqueuing. */ diff --git a/src/functions/template-tags/general.php b/src/functions/template-tags/general.php index fe7e41b2eb..0cfafbecd0 100755 --- a/src/functions/template-tags/general.php +++ b/src/functions/template-tags/general.php @@ -719,7 +719,7 @@ function tribe_asset_enqueue( $slug, $force = true ) { * * @param string|array $group Which group(s) should be enqueued. */ -function tribe_asset_enqueue_group( $group, $force = true ) { +function tribe_asset_enqueue_group( $group, $force = false ) { Tribe__Assets::instance()->enqueue_group( $group, $force ); } @@ -731,13 +731,13 @@ function tribe_asset_enqueue_group( $group, $force = true ) { * * @param object $origin The main Object for the plugin you are enqueueing the script/style for. * @param array $assets { - * Indexed array, don't use any associative key. - * E.g.: [ 'slug-my-script', 'my/own/path.js', [ 'jquery' ] ] + * Indexed array, don't use any associative key. + * E.g.: [ 'slug-my-script', 'my/own/path.js', [ 'jquery' ] ] * - * @type string $slug Slug to save the asset. - * @type string $file Which file will be loaded, either CSS or JS. - * @type array $deps (optional) Dependencies - * } + * @type string $slug Slug to save the asset. + * @type string $file Which file will be loaded, either CSS or JS. + * @type array $deps (optional) Dependencies + * } * @param string $action A WordPress hook that will automatically enqueue this asset once fired. * @param array $arguments Look at `Tribe__Assets::register()` for more info. * From 109c3d687e16d68fab66b2240379e9fd2f490e07 Mon Sep 17 00:00:00 2001 From: Stephen Page Date: Wed, 29 May 2024 16:43:51 -0400 Subject: [PATCH 33/75] I said true. --- src/functions/template-tags/general.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/functions/template-tags/general.php b/src/functions/template-tags/general.php index 0cfafbecd0..28c265705d 100755 --- a/src/functions/template-tags/general.php +++ b/src/functions/template-tags/general.php @@ -719,7 +719,7 @@ function tribe_asset_enqueue( $slug, $force = true ) { * * @param string|array $group Which group(s) should be enqueued. */ -function tribe_asset_enqueue_group( $group, $force = false ) { +function tribe_asset_enqueue_group( $group, $force = true ) { Tribe__Assets::instance()->enqueue_group( $group, $force ); } From f0b498d263321f174a1707678b0aa43d14a7d607 Mon Sep 17 00:00:00 2001 From: Stephen Page Date: Mon, 3 Jun 2024 11:31:13 -0400 Subject: [PATCH 34/75] Remove unneeded schema entries --- src/Common/Libraries/Provider.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Common/Libraries/Provider.php b/src/Common/Libraries/Provider.php index 8578e1e381..43d0f344ae 100644 --- a/src/Common/Libraries/Provider.php +++ b/src/Common/Libraries/Provider.php @@ -34,8 +34,6 @@ public function register() { Assets\Config::set_path( Common::instance()->plugin_path . 'src/resources/' ); Assets\Config::set_version( Common::VERSION ); Assets\Config::set_relative_asset_path( 'src/resources/' ); - Schema\Config::set_db( DB\DB::class ); - Schema\Config::set_container( tribe() ); } /** From 8c98bda34c8a1a16fdda3c9da503468d8bd41599 Mon Sep 17 00:00:00 2001 From: Mike Cotton Date: Tue, 4 Jun 2024 16:49:18 -0500 Subject: [PATCH 35/75] update stellar sale banner and logic --- .../Admin/Notice/Marketing/Stellar_Sale.php | 51 +++++++++++-------- .../notices/tribe-stellar-sale.php | 12 ++--- .../postcss/tribe-common-admin/_main.pcss | 2 +- 3 files changed, 36 insertions(+), 29 deletions(-) diff --git a/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php b/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php index 232e72d60d..b0e773c95e 100644 --- a/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php +++ b/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php @@ -18,12 +18,12 @@ class Stellar_Sale extends \Tribe\Admin\Notice\Date_Based { /** * {@inheritDoc} */ - public $slug = 'stellar-sale'; + public $slug = 'stellar-sale-2024'; /** * {@inheritDoc} */ - public $start_date = 'July 24th, 2023'; + public $start_date = 'July 23rd, 2024'; /** * {@inheritDoc} @@ -35,7 +35,7 @@ class Stellar_Sale extends \Tribe\Admin\Notice\Date_Based { /** * {@inheritDoc} */ - public $end_date = 'July 31st, 2023'; + public $end_date = 'July 30th, 2024'; /** * {@inheritDoc} @@ -44,39 +44,46 @@ class Stellar_Sale extends \Tribe\Admin\Notice\Date_Based { */ public $end_time = 19; - /** - * {@inheritDoc} - */ - public $extension_date = 'August 2nd, 2023'; - - /** - * {@inheritDoc} - * - * 7am UTC is midnight PDT (-7) and 3am EDT (-4) - */ - public $extension_time = 19; - /** * {@inheritDoc} */ public function display_notice() { + error_log( 'Stellar_Sale::display_notice()' ); \Tribe__Assets::instance()->enqueue( [ 'tribe-common-admin' ] ); // Used in the template. $cta_url = 'https://evnt.is/1bcv'; $stellar_url = 'https://evnt.is/1bcu'; - $end_date = $this->get_end_time(); + $template_args = [ - 'cta_url' => 'https://evnt.is/1bcv', - 'stellar_url' => 'https://evnt.is/1bcu', - 'end_date' => $this->get_end_time(), + 'heading' => __( 'Make it yours.', 'tribe-common' ), + 'sub_heading' => __( 'Save 40% on all The Events Calendar products.', 'tribe-common' ), + 'content' => __( 'Take 40% off all premium The Events Calendar products during the annual Stellar Sale. Now through July 30.', 'tribe-common' ), + 'cta_link_text' => _x( 'Shop now', 'Shop now link text', 'tribe-common' ), + 'cta_url' => $cta_url, + 'stellar_link_text' => _x( 'View all StellarWP Deals', 'View all StellarWP Deals link text', 'tribe-common' ), + 'stellar_url' => $stellar_url, ]; $dependency = tribe( \Tribe__Dependency::class ); if ( $dependency->has_active_premium_plugin() ) { - return $this->get_template()->template( 'notices/tribe-stellar-sale-premium', $template_args, false ); - } else { - return $this->get_template()->template( 'notices/tribe-stellar-sale', $template_args, false ); + // Determine the copy based on the active plugins. + $has_events_calendar_pro = $dependency->is_plugin_active( 'Tribe__Events__Pro__Main' ); + $has_event_tickets_plus = $dependency->is_plugin_active( 'Tribe__Tickets_Plus__Main' ); + + if ( $has_events_calendar_pro && ! $has_event_tickets_plus ) { + $template_args['sub_heading'] = __( 'Save 40% on Filter Bar.', 'tribe-common' ); + $template_args['stellar_copy'] = __( 'Add filters to your calendar during the annual Stellar Sale. Now through July 30.', 'tribe-common' ); + } elseif( $has_event_tickets_plus && ! $has_events_calendar_pro ) { + $template_args['sub_heading'] = __( 'Save 40% on The Events Calendar Bundles.', 'tribe-common' ); + $template_args['stellar_copy'] = __( 'Take 40% off when you upgrade to a bundle during the annual Stellar Sale. Now through July 30.', 'tribe-common' ); + } else { + $template_args['heading'] = __( 'Make it stellar.', 'tribe-common' ); + $template_args['sub_heading'] = __( 'Save 40% on all StellarWP products.', 'tribe-common' ); + $template_args['stellar_copy'] = __( 'Take 40% off all brands during the annual Stellar Sale. Now through July 30.', 'tribe-common' ); + } } + + return $this->get_template()->template( 'notices/tribe-stellar-sale', $template_args, false ); } } diff --git a/src/admin-views/notices/tribe-stellar-sale.php b/src/admin-views/notices/tribe-stellar-sale.php index c8eaf21e1b..a15d810dba 100644 --- a/src/admin-views/notices/tribe-stellar-sale.php +++ b/src/admin-views/notices/tribe-stellar-sale.php @@ -13,15 +13,15 @@

- +

- +

- +

@@ -29,13 +29,13 @@

- 100% off WP Business Reviews and take 40% off all other brands.', 'tribe-common' ); ?> +

- +

@@ -43,7 +43,7 @@

- +

diff --git a/src/resources/postcss/tribe-common-admin/_main.pcss b/src/resources/postcss/tribe-common-admin/_main.pcss index 674c9d8ac4..0e472da066 100644 --- a/src/resources/postcss/tribe-common-admin/_main.pcss +++ b/src/resources/postcss/tribe-common-admin/_main.pcss @@ -1645,7 +1645,7 @@ a.tribe-rating-link { margin: 0 0 16px 0; padding-right: 0; - &.tribe-notice-stellar-sale { + &.tribe-notice-stellar-sale-2024 { background-color: #1D202F; overflow: hidden; From 9ada6ca0380273d2b392b7bcfa01f2523c581e07 Mon Sep 17 00:00:00 2001 From: Mike Cotton Date: Tue, 4 Jun 2024 16:57:54 -0500 Subject: [PATCH 36/75] fix spacing --- src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php b/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php index b0e773c95e..b6f2d3be18 100644 --- a/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php +++ b/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php @@ -58,7 +58,7 @@ public function display_notice() { $template_args = [ 'heading' => __( 'Make it yours.', 'tribe-common' ), 'sub_heading' => __( 'Save 40% on all The Events Calendar products.', 'tribe-common' ), - 'content' => __( 'Take 40% off all premium The Events Calendar products during the annual Stellar Sale. Now through July 30.', 'tribe-common' ), + 'content' => __( 'Take 40% off all premium The Events Calendar products during the annual Stellar Sale. Now through July 30.', 'tribe-common' ), 'cta_link_text' => _x( 'Shop now', 'Shop now link text', 'tribe-common' ), 'cta_url' => $cta_url, 'stellar_link_text' => _x( 'View all StellarWP Deals', 'View all StellarWP Deals link text', 'tribe-common' ), From 8f94de74da66f77227a7b948880dac098fd973da Mon Sep 17 00:00:00 2001 From: Mike Cotton Date: Tue, 4 Jun 2024 16:58:34 -0500 Subject: [PATCH 37/75] oops. remove debugging --- src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php b/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php index b6f2d3be18..3684999af7 100644 --- a/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php +++ b/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php @@ -48,7 +48,6 @@ class Stellar_Sale extends \Tribe\Admin\Notice\Date_Based { * {@inheritDoc} */ public function display_notice() { - error_log( 'Stellar_Sale::display_notice()' ); \Tribe__Assets::instance()->enqueue( [ 'tribe-common-admin' ] ); // Used in the template. From bcb069e760b2b9f712a1965eb03443fb558d0734 Mon Sep 17 00:00:00 2001 From: Mike Cotton Date: Tue, 4 Jun 2024 16:59:23 -0500 Subject: [PATCH 38/75] fix spacing --- src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php b/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php index 3684999af7..8fc24d31e6 100644 --- a/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php +++ b/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php @@ -51,8 +51,8 @@ public function display_notice() { \Tribe__Assets::instance()->enqueue( [ 'tribe-common-admin' ] ); // Used in the template. - $cta_url = 'https://evnt.is/1bcv'; - $stellar_url = 'https://evnt.is/1bcu'; + $cta_url = 'https://evnt.is/1bcv'; + $stellar_url = 'https://evnt.is/1bcu'; $template_args = [ 'heading' => __( 'Make it yours.', 'tribe-common' ), From bb7a8e505c4129074b96c45d15cec2358058adee Mon Sep 17 00:00:00 2001 From: Mike Cotton Date: Tue, 4 Jun 2024 17:00:18 -0500 Subject: [PATCH 39/75] fix spacing --- src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php b/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php index 8fc24d31e6..895cfad881 100644 --- a/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php +++ b/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php @@ -67,8 +67,8 @@ public function display_notice() { if ( $dependency->has_active_premium_plugin() ) { // Determine the copy based on the active plugins. - $has_events_calendar_pro = $dependency->is_plugin_active( 'Tribe__Events__Pro__Main' ); - $has_event_tickets_plus = $dependency->is_plugin_active( 'Tribe__Tickets_Plus__Main' ); + $has_events_calendar_pro = $dependency->is_plugin_active( 'Tribe__Events__Pro__Main' ); + $has_event_tickets_plus = $dependency->is_plugin_active( 'Tribe__Tickets_Plus__Main' ); if ( $has_events_calendar_pro && ! $has_event_tickets_plus ) { $template_args['sub_heading'] = __( 'Save 40% on Filter Bar.', 'tribe-common' ); From c94149b026c72bd870fb026870b7f504353812c4 Mon Sep 17 00:00:00 2001 From: Mike Cotton Date: Tue, 4 Jun 2024 17:01:20 -0500 Subject: [PATCH 40/75] add todo --- src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php b/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php index 895cfad881..c9e2901e84 100644 --- a/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php +++ b/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php @@ -51,6 +51,7 @@ public function display_notice() { \Tribe__Assets::instance()->enqueue( [ 'tribe-common-admin' ] ); // Used in the template. + // @todo @codingmusician - Update the URLs when they are available. $cta_url = 'https://evnt.is/1bcv'; $stellar_url = 'https://evnt.is/1bcu'; From 0d48db44cb4130119d4406a68d88dc8ced1edfae Mon Sep 17 00:00:00 2001 From: Mike Cotton Date: Tue, 4 Jun 2024 17:03:59 -0500 Subject: [PATCH 41/75] use `esc_html` not `esc_html_e` --- src/admin-views/notices/tribe-stellar-sale.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/admin-views/notices/tribe-stellar-sale.php b/src/admin-views/notices/tribe-stellar-sale.php index a15d810dba..736f042c41 100644 --- a/src/admin-views/notices/tribe-stellar-sale.php +++ b/src/admin-views/notices/tribe-stellar-sale.php @@ -13,15 +13,15 @@

- +

- +

- +

@@ -35,7 +35,7 @@

- +

@@ -43,7 +43,7 @@

- +

From 0800a96b081eb19091afdc29bc3f742c8bb4abb8 Mon Sep 17 00:00:00 2001 From: Mike Cotton Date: Tue, 4 Jun 2024 17:04:29 -0500 Subject: [PATCH 42/75] fix spacing --- src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php b/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php index c9e2901e84..ae818de132 100644 --- a/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php +++ b/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php @@ -74,7 +74,7 @@ public function display_notice() { if ( $has_events_calendar_pro && ! $has_event_tickets_plus ) { $template_args['sub_heading'] = __( 'Save 40% on Filter Bar.', 'tribe-common' ); $template_args['stellar_copy'] = __( 'Add filters to your calendar during the annual Stellar Sale. Now through July 30.', 'tribe-common' ); - } elseif( $has_event_tickets_plus && ! $has_events_calendar_pro ) { + } elseif ( $has_event_tickets_plus && ! $has_events_calendar_pro ) { $template_args['sub_heading'] = __( 'Save 40% on The Events Calendar Bundles.', 'tribe-common' ); $template_args['stellar_copy'] = __( 'Take 40% off when you upgrade to a bundle during the annual Stellar Sale. Now through July 30.', 'tribe-common' ); } else { From 4aa8b4c6c3d8a3f37a03a3e9f1b8c058c5da5076 Mon Sep 17 00:00:00 2001 From: Mike Cotton Date: Tue, 4 Jun 2024 17:06:13 -0500 Subject: [PATCH 43/75] missing semicolons --- src/admin-views/notices/tribe-stellar-sale.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/admin-views/notices/tribe-stellar-sale.php b/src/admin-views/notices/tribe-stellar-sale.php index 736f042c41..d98a0855e6 100644 --- a/src/admin-views/notices/tribe-stellar-sale.php +++ b/src/admin-views/notices/tribe-stellar-sale.php @@ -35,7 +35,7 @@

- +

@@ -43,7 +43,7 @@

- +

From 7a6d52eb2946ea4ca0d2bc58c812b022990949f7 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 5 Jun 2024 19:48:16 +0300 Subject: [PATCH 44/75] Update stellarwp assets to 1.2.2 --- composer.json | 2 +- composer.lock | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 1c83140adc..4526745f30 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "stellarwp/models": "dev-main", "stellarwp/schema": "^1.1.3", "stellarwp/telemetry": "^2.3.1", - "stellarwp/assets": "^1.2.1" + "stellarwp/assets": "^1.2.2" }, "require-dev": { "automattic/vipwpcs": "^3.0", diff --git a/composer.lock b/composer.lock index 2a73c1937e..72e1a12d6a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2d03ba22a6b50c06b8f6af8e4a188eb4", + "content-hash": "07abb2abd32ed40b0e7d1903d2cec044", "packages": [ { "name": "firebase/php-jwt", @@ -295,16 +295,16 @@ }, { "name": "stellarwp/assets", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/stellarwp/assets.git", - "reference": "c5cbed2dcda2f075403440da5c46a96f53d74af9" + "reference": "3e097e16b8d6c12c697d4688ec07a079fe46a2ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stellarwp/assets/zipball/c5cbed2dcda2f075403440da5c46a96f53d74af9", - "reference": "c5cbed2dcda2f075403440da5c46a96f53d74af9", + "url": "https://api.github.com/repos/stellarwp/assets/zipball/3e097e16b8d6c12c697d4688ec07a079fe46a2ce", + "reference": "3e097e16b8d6c12c697d4688ec07a079fe46a2ce", "shasum": "" }, "require-dev": { @@ -345,9 +345,9 @@ "description": "A library for managing asset registration and enqueuing in WordPress.", "support": { "issues": "https://github.com/stellarwp/assets/issues", - "source": "https://github.com/stellarwp/assets/tree/1.2.1" + "source": "https://github.com/stellarwp/assets/tree/1.2.2" }, - "time": "2024-05-03T13:01:10+00:00" + "time": "2024-06-05T15:58:22+00:00" }, { "name": "stellarwp/container-contract", @@ -6930,5 +6930,5 @@ "platform-overrides": { "php": "7.4.0" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.2.0" } From 61882f2c76438cb371960c138578dc41a378b230 Mon Sep 17 00:00:00 2001 From: Mike Cotton Date: Wed, 5 Jun 2024 13:39:44 -0500 Subject: [PATCH 45/75] update slug --- tests/wpunit/Tribe/Notices/Stellar_SaleTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/wpunit/Tribe/Notices/Stellar_SaleTest.php b/tests/wpunit/Tribe/Notices/Stellar_SaleTest.php index 96c5bf36d5..4d87fed0ee 100644 --- a/tests/wpunit/Tribe/Notices/Stellar_SaleTest.php +++ b/tests/wpunit/Tribe/Notices/Stellar_SaleTest.php @@ -19,7 +19,7 @@ public function should_not_display_when_upsells_hidden() { uopz_redefine( 'TRIBE_HIDE_UPSELL', true ); // Ensure we're on a good date. add_filter( - "tribe_stellar-sale_notice_start_date", + "tribe_stellar-sale-2024_notice_start_date", function( $date ) { // Set the start date to the past. return Dates::build_date_object( '-7 days', 'UTC' ); @@ -27,7 +27,7 @@ function( $date ) { ); add_filter( - "tribe_stellar-sale_notice_end_date", + "tribe_stellar-sale-2024_notice_end_date", function( $date ) { // Set the end date to the future. return Dates::build_date_object( '+7 days', 'UTC' ); @@ -42,7 +42,7 @@ function( $date ) { $this->assertFalse( $notice->should_display() ); // So we don't muck up later tests. - remove_all_filters( "tribe_stellar-sale_notice_start_date" ); + remove_all_filters( "tribe_stellar-sale-2024_notice_start_date" ); uopz_undefine( 'TRIBE_HIDE_UPSELL' ); } @@ -55,7 +55,7 @@ function( $date ) { public function should_not_display_when_wrong_screen() { // Ensure we're on a good date. add_filter( - "tribe_stellar-sale_notice_start_date", + "tribe_stellar-sale-2024_notice_start_date", function( $date ) { // Set the start date to the past. return Dates::build_date_object( '-7 days', 'UTC' ); @@ -63,7 +63,7 @@ function( $date ) { ); add_filter( - "tribe_stellar-sale_notice_end_date", + "tribe_stellar-sale-2024_notice_end_date", function( $date ) { // Set the end date to the future. return Dates::build_date_object( '+7 days', 'UTC' ); @@ -78,7 +78,7 @@ function( $date ) { $this->assertFalse( $notice->should_display() ); // So we don't muck up later tests. - remove_all_filters( "tribe_stellar-sale_notice_start_date" ); + remove_all_filters( "tribe_stellar-sale-2024_notice_start_date" ); } /** From b57ff884235c6c98b1ae1b9bef5f5d5d518302f3 Mon Sep 17 00:00:00 2001 From: Mike Cotton Date: Wed, 5 Jun 2024 13:44:02 -0500 Subject: [PATCH 46/75] update test and fix quotes --- tests/wpunit/Tribe/Notices/Stellar_SaleTest.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/wpunit/Tribe/Notices/Stellar_SaleTest.php b/tests/wpunit/Tribe/Notices/Stellar_SaleTest.php index 4d87fed0ee..2920158556 100644 --- a/tests/wpunit/Tribe/Notices/Stellar_SaleTest.php +++ b/tests/wpunit/Tribe/Notices/Stellar_SaleTest.php @@ -19,7 +19,7 @@ public function should_not_display_when_upsells_hidden() { uopz_redefine( 'TRIBE_HIDE_UPSELL', true ); // Ensure we're on a good date. add_filter( - "tribe_stellar-sale-2024_notice_start_date", + 'tribe_stellar-sale-2024_notice_start_date', function( $date ) { // Set the start date to the past. return Dates::build_date_object( '-7 days', 'UTC' ); @@ -27,7 +27,7 @@ function( $date ) { ); add_filter( - "tribe_stellar-sale-2024_notice_end_date", + 'tribe_stellar-sale-2024_notice_end_date', function( $date ) { // Set the end date to the future. return Dates::build_date_object( '+7 days', 'UTC' ); @@ -42,7 +42,7 @@ function( $date ) { $this->assertFalse( $notice->should_display() ); // So we don't muck up later tests. - remove_all_filters( "tribe_stellar-sale-2024_notice_start_date" ); + remove_all_filters( 'tribe_stellar-sale-2024_notice_start_date' ); uopz_undefine( 'TRIBE_HIDE_UPSELL' ); } @@ -55,7 +55,7 @@ function( $date ) { public function should_not_display_when_wrong_screen() { // Ensure we're on a good date. add_filter( - "tribe_stellar-sale-2024_notice_start_date", + 'tribe_stellar-sale-2024_notice_start_date', function( $date ) { // Set the start date to the past. return Dates::build_date_object( '-7 days', 'UTC' ); @@ -63,7 +63,7 @@ function( $date ) { ); add_filter( - "tribe_stellar-sale-2024_notice_end_date", + 'tribe_stellar-sale-2024_notice_end_date', function( $date ) { // Set the end date to the future. return Dates::build_date_object( '+7 days', 'UTC' ); @@ -78,7 +78,7 @@ function( $date ) { $this->assertFalse( $notice->should_display() ); // So we don't muck up later tests. - remove_all_filters( "tribe_stellar-sale-2024_notice_start_date" ); + remove_all_filters( 'tribe_stellar-sale-2024_notice_start_date' ); } /** @@ -141,7 +141,7 @@ public function should_display_when_stars_align() { $year = date( 'Y' ); $this->set_class_fn_return( Dates::class, 'build_date_object', static function ( $input ) use ( $year ) { return $input === 'now' ? - new DateTime( "2023-07-27 19:23:23" ) + new DateTime( "2024-07-26 19:23:23" ) : new DateTime( $input ); }, true ); From aad9f776fa2551653d9309982e58df8a306d2c67 Mon Sep 17 00:00:00 2001 From: Mike Cotton Date: Wed, 5 Jun 2024 13:45:31 -0500 Subject: [PATCH 47/75] fix quotes --- tests/wpunit/Tribe/Notices/Stellar_SaleTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/wpunit/Tribe/Notices/Stellar_SaleTest.php b/tests/wpunit/Tribe/Notices/Stellar_SaleTest.php index 2920158556..3529300702 100644 --- a/tests/wpunit/Tribe/Notices/Stellar_SaleTest.php +++ b/tests/wpunit/Tribe/Notices/Stellar_SaleTest.php @@ -141,7 +141,7 @@ public function should_display_when_stars_align() { $year = date( 'Y' ); $this->set_class_fn_return( Dates::class, 'build_date_object', static function ( $input ) use ( $year ) { return $input === 'now' ? - new DateTime( "2024-07-26 19:23:23" ) + new DateTime( '2024-07-26 19:23:23' ) : new DateTime( $input ); }, true ); From 2644b4adab46106dc83dd6cbeb83857b3b8ba59b Mon Sep 17 00:00:00 2001 From: Mike Cotton Date: Wed, 5 Jun 2024 13:49:11 -0500 Subject: [PATCH 48/75] changelog --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index eb74ba8ffb..b10dc51602 100644 --- a/readme.txt +++ b/readme.txt @@ -4,6 +4,7 @@ * Feature - Refactor tribe_asset to use Stellar Assets. [TCMN-172] * Tweak - Remove ini_check for deprecated safe_mode. [TBD] +* Tweak - Added information about upcoming promotion. [ET-2113] = [5.2.7] 2024-05-14 = From 1f09d58da0922828321f4d94852a9a877ffcfd3c Mon Sep 17 00:00:00 2001 From: Mike Cotton Date: Fri, 7 Jun 2024 09:56:56 -0500 Subject: [PATCH 49/75] update url and remove todo --- src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php b/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php index ae818de132..40181dcd27 100644 --- a/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php +++ b/src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php @@ -51,9 +51,8 @@ public function display_notice() { \Tribe__Assets::instance()->enqueue( [ 'tribe-common-admin' ] ); // Used in the template. - // @todo @codingmusician - Update the URLs when they are available. - $cta_url = 'https://evnt.is/1bcv'; - $stellar_url = 'https://evnt.is/1bcu'; + $cta_url = 'https://evnt.is/1bdv'; + $stellar_url = 'https://evnt.is/1bdw'; $template_args = [ 'heading' => __( 'Make it yours.', 'tribe-common' ), From bbe68e8350e30449a17b16ffe08135c02113deca Mon Sep 17 00:00:00 2001 From: tec-bot Date: Fri, 7 Jun 2024 11:39:25 -0700 Subject: [PATCH 50/75] Updating pot file --- lang/tribe-common.pot | 57 +++++++++++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 15 deletions(-) diff --git a/lang/tribe-common.pot b/lang/tribe-common.pot index f741096605..3873d43c88 100644 --- a/lang/tribe-common.pot +++ b/lang/tribe-common.pot @@ -2,15 +2,15 @@ # This file is distributed under the GPLv2 or later. msgid "" msgstr "" -"Project-Id-Version: Tribe Common 5.2.7\n" +"Project-Id-Version: Tribe Common 5.3.0\n" "Report-Msgid-Bugs-To: https://evnt.is/191x\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2024-05-13T09:38:31-07:00\n" -"PO-Revision-Date: 2024-05-13 16:38\n" +"POT-Creation-Date: 2024-06-07T11:39:23-07:00\n" +"PO-Revision-Date: 2024-06-07 18:39\n" "X-Generator: WP-CLI 2.7.1\n" "X-Domain: tribe-common\n" @@ -500,13 +500,13 @@ msgstr "" #: src/admin-views/notices/tribe-bf-general.php:25 #: src/admin-views/notices/tribe-stellar-sale-premium.php:24 #: src/admin-views/notices/tribe-stellar-sale-premium.php:38 -#: src/admin-views/notices/tribe-stellar-sale.php:24 -#: src/admin-views/notices/tribe-stellar-sale.php:38 +#: src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php:61 msgctxt "Shop now link text" msgid "Shop now" msgstr "" #: src/admin-views/notices/tribe-stellar-sale-premium.php:16 +#: src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php:80 msgid "Make it stellar." msgstr "" @@ -515,24 +515,15 @@ msgid "Save 30% on all StellarWP products." msgstr "" #: src/admin-views/notices/tribe-stellar-sale-premium.php:32 -#: src/admin-views/notices/tribe-stellar-sale.php:32 msgid "Purchase any StellarWP product during the sale and get 100% off WP Business Reviews and take 40% off all other brands." msgstr "" #: src/admin-views/notices/tribe-stellar-sale-premium.php:46 -#: src/admin-views/notices/tribe-stellar-sale.php:46 +#: src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php:63 msgctxt "View all StellarWP Deals link text" msgid "View all StellarWP Deals" msgstr "" -#: src/admin-views/notices/tribe-stellar-sale.php:16 -msgid "Make it yours." -msgstr "" - -#: src/admin-views/notices/tribe-stellar-sale.php:19 -msgid "Save 30% on all The Events Calendar products." -msgstr "" - #: src/admin-views/notices/upsell/icon.php:19 msgid "The Events Calendar important notice icon" msgstr "" @@ -1275,6 +1266,42 @@ msgstr "" msgid "This extension allows you to add custom HTML content to the top of the Community Events submission form." msgstr "" +#: src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php:58 +msgid "Make it yours." +msgstr "" + +#: src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php:59 +msgid "Save 40% on all The Events Calendar products." +msgstr "" + +#: src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php:60 +msgid "Take 40% off all premium The Events Calendar products during the annual Stellar Sale. Now through July 30." +msgstr "" + +#: src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php:74 +msgid "Save 40% on Filter Bar." +msgstr "" + +#: src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php:75 +msgid "Add filters to your calendar during the annual Stellar Sale. Now through July 30." +msgstr "" + +#: src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php:77 +msgid "Save 40% on The Events Calendar Bundles." +msgstr "" + +#: src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php:78 +msgid "Take 40% off when you upgrade to a bundle during the annual Stellar Sale. Now through July 30." +msgstr "" + +#: src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php:81 +msgid "Save 40% on all StellarWP products." +msgstr "" + +#: src/Tribe/Admin/Notice/Marketing/Stellar_Sale.php:82 +msgid "Take 40% off all brands during the annual Stellar Sale. Now through July 30." +msgstr "" + #: src/Tribe/Admin/Notice/Php_Version.php:59 #: src/Tribe/Admin/Notice/Plugin_Download.php:147 msgctxt "separator used in a list of items" From 7226946a5988ff6f442315c71ccd090131b62140 Mon Sep 17 00:00:00 2001 From: Mike Cotton Date: Fri, 7 Jun 2024 13:40:30 -0500 Subject: [PATCH 51/75] replace TBD --- src/Tribe/Assets.php | 48 ++++++++++++------------- src/functions/template-tags/general.php | 6 ++-- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/Tribe/Assets.php b/src/Tribe/Assets.php index c174ccfa61..c28d42a777 100644 --- a/src/Tribe/Assets.php +++ b/src/Tribe/Assets.php @@ -25,7 +25,7 @@ public static function instance() { * Register the Methods in the correct places. * * @since 4.3 - * @since TBD Emptied of all hooks in favor of the stellarwp/assets library. + * @since 5.3.0 Emptied of all hooks in favor of the stellarwp/assets library. */ public function __construct() { } @@ -33,7 +33,7 @@ public function __construct() { /** * Hooks the filters used to register the assets. * - * @since TBD + * @since 5.3.0 * * @return void */ @@ -44,7 +44,7 @@ public function hook(): void { /** * Proxies the generic stellarwp/assets/enqueue filter to apply the TEC ones. * - * @since TBD + * @since 5.3.0 * * @param bool $enqueue If we should enqueue or not a given asset. * @param Asset $asset Which asset we are dealing with. @@ -56,7 +56,7 @@ public function proxy_enqueue_filter( $enqueue, $asset ) { * Allows developers to hook-in and prevent an asset from being loaded. * * @since 4.3 - * @since TBD Moved here from the `Tribe__Assets` class. + * @since 5.3.0 Moved here from the `Tribe__Assets` class. * * @param bool $enqueue If we should enqueue or not a given asset. * @param object $asset Which asset we are dealing with. @@ -67,7 +67,7 @@ public function proxy_enqueue_filter( $enqueue, $asset ) { * Allows developers to hook-in and prevent an asset from being loaded. * * @since 4.3 - * @since TBD Moved here from the `Tribe__Assets` class. + * @since 5.3.0 Moved here from the `Tribe__Assets` class. * * @param bool $enqueue If we should enqueue or not a given asset. * @param object $asset Which asset we are dealing with. @@ -86,10 +86,10 @@ public function proxy_enqueue_filter( $enqueue, $asset ) { * * @return string Script tag with the before and after strings attached to it. * - * @deprecated TBD + * @deprecated 5.3.0 */ public function filter_print_before_after_script( $tag, $handle ): string { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed - _deprecated_function( __METHOD__, 'TBD', '' ); + _deprecated_function( __METHOD__, '5.3.0', '' ); return ''; } @@ -104,10 +104,10 @@ public function filter_print_before_after_script( $tag, $handle ): string { // p * * @return string Script tag with the localization variable HTML attached to it. * - * @deprecated TBD + * @deprecated 5.3.0 */ public function filter_add_localization_data( $tag, $handle ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed - _deprecated_function( __METHOD__, 'TBD', '' ); + _deprecated_function( __METHOD__, '5.3.0', '' ); return ''; } @@ -121,10 +121,10 @@ public function filter_add_localization_data( $tag, $handle ) { // phpcs:ignore * * @return string Script tag with the defer and/or async attached. * - * @deprecated TBD + * @deprecated 5.3.0 */ public function filter_tag_async_defer( $tag, $handle ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed - _deprecated_function( __METHOD__, 'TBD', '' ); + _deprecated_function( __METHOD__, '5.3.0', '' ); return ''; } @@ -138,10 +138,10 @@ public function filter_tag_async_defer( $tag, $handle ) { // phpcs:ignore Generi * * @return string Script tag with the type=module * - * @deprecated TBD + * @deprecated 5.3.0 */ public function filter_modify_to_module( $tag, $handle ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed - _deprecated_function( __METHOD__, 'TBD', '' ); + _deprecated_function( __METHOD__, '5.3.0', '' ); return ''; } @@ -153,17 +153,17 @@ public function filter_modify_to_module( $tag, $handle ) { // phpcs:ignore Gener * * @return void * - * @deprecated TBD + * @deprecated 5.3.0 */ public function register_in_wp( $assets = null ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found - _deprecated_function( __METHOD__, 'TBD', '' ); + _deprecated_function( __METHOD__, '5.3.0', '' ); } /** * Enqueues registered assets based on their groups. * * @since 4.7 - * @since TBD Refactored to use the stellarwp/assets library. + * @since 5.3.0 Refactored to use the stellarwp/assets library. * * @uses TEC\Common\StellarWP\Assets\Assets::enqueue_group() * @@ -184,7 +184,7 @@ public function enqueue_group( $groups, $forcibly_enqueue = true ) { * registered. * * @since 4.3 - * @since TBD Refactored to use the stellarwp/assets library. + * @since 5.3.0 Refactored to use the stellarwp/assets library. * * @uses TEC\Common\StellarWP\Assets\Assets::enqueue() * @@ -367,7 +367,7 @@ public function register( $origin, $slug, $file, $deps = [], $action = null, $ar * Filter to change version number on assets. * * @since 4.3 - * @since TBD The second filter argument is now deprecated; added the slug as a third argument. + * @since 5.3.0 The second filter argument is now deprecated; added the slug as a third argument. * * @param string $version The version number. * @param null $deprecated Used to be the asset object, it will now be always null. @@ -531,10 +531,10 @@ function () use ( $conditional_callables ) { * * @return stdClass * - * @deprecated TBD + * @deprecated 5.3.0 */ public function parse_argument_localize( stdClass $asset ) { - _deprecated_function( __METHOD__, 'TBD', '' ); + _deprecated_function( __METHOD__, '5.3.0', '' ); return $asset; } @@ -542,7 +542,7 @@ public function parse_argument_localize( stdClass $asset ) { * Removes an Asset from been registered and enqueue. * * @since 4.3 - * @since TBD Refactored to use the stellarwp/assets library. + * @since 5.3.0 Refactored to use the stellarwp/assets library. * * @param string $slug Slug of the Asset. * @@ -557,7 +557,7 @@ public function remove( $slug ) { * * @since 4.3 * @since 4.11.0 Added $sort param. - * @since TBD Refactored to use the stellarwp/assets library. + * @since 5.3.0 Refactored to use the stellarwp/assets library. * * @param string|array $slug Slug of the Asset. * @param boolean $sort If we should do any sorting before returning. @@ -574,7 +574,7 @@ public function get( $slug = null, $sort = true ) { * * @param string|array $slug Slug of the Asset. * - * @since TBD Refactored to use the stellarwp/assets library. + * @since 5.3.0 Refactored to use the stellarwp/assets library. * * @return bool */ @@ -588,7 +588,7 @@ public function exists( $slug ) { * The method will force the scripts and styles to print overriding their registration and conditional. * * @since 4.12.6 - * @since TBD Refactored to use the stellarwp/assets library. + * @since 5.3.0 Refactored to use the stellarwp/assets library. * * @param string|array $group Which group(s) should be enqueued. * @param bool $echo Whether to print the group(s) tag(s) to the page or not; default to `true` to diff --git a/src/functions/template-tags/general.php b/src/functions/template-tags/general.php index 633c2f092a..ea0db524ae 100755 --- a/src/functions/template-tags/general.php +++ b/src/functions/template-tags/general.php @@ -649,7 +649,7 @@ function tribe_register_error( $indexes, $message ) { * Registers an asset. * * @since 4.3 - * @since TBD Replaced the function internals with calls to the stellarwp/assets library. + * @since 5.3.0 Replaced the function internals with calls to the stellarwp/assets library. * * @param object|string $origin The origin of the asset, either a class or a string. * @param string $slug The handle of the asset. @@ -699,7 +699,7 @@ function tribe_asset( $origin, $slug, $file, $deps = [], $action = null, $argume * conditional logic set for the asset and enqueue regardless. * * @since 4.7 - * @since TBD Refactored to use the `stellarwp/assets` library. + * @since 5.3.0 Refactored to use the `stellarwp/assets` library. * * @param string|array $slug Slug to enqueue * @param bool $force Whether to force the enqueue or not. @@ -715,7 +715,7 @@ function tribe_asset_enqueue( $slug, $force = true ) { * conditional logic set for the asset and enqueue regardless. * * @since 4.7 - * @since TBD Refactored to use the `stellarwp/assets` library. + * @since 5.3.0 Refactored to use the `stellarwp/assets` library. * * @param string|array $group Which group(s) should be enqueued. */ From ac4d597dc6235385621e09894baa080feebf4de8 Mon Sep 17 00:00:00 2001 From: Mike Cotton Date: Fri, 7 Jun 2024 13:40:51 -0500 Subject: [PATCH 52/75] update readme for release --- readme.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/readme.txt b/readme.txt index b10dc51602..c7e0cfe202 100644 --- a/readme.txt +++ b/readme.txt @@ -5,6 +5,9 @@ * Feature - Refactor tribe_asset to use Stellar Assets. [TCMN-172] * Tweak - Remove ini_check for deprecated safe_mode. [TBD] * Tweak - Added information about upcoming promotion. [ET-2113] +* Tweak - Added filters: `tribe_asset_enqueue_{$asset->get_slug()}` +* Tweak - Removed filters: `tribe_asset_enqueue_{$asset->slug}`, `tribe_asset_pre_register` +* Language: 7 new strings added, 5 updated, 2 fuzzied, and 0 obsoleted = [5.2.7] 2024-05-14 = From 1dfb34520e4e203f4f27f08eb265a24aed133231 Mon Sep 17 00:00:00 2001 From: Gustavo Bordoni Date: Wed, 12 Jun 2024 17:09:20 -0400 Subject: [PATCH 53/75] Ensure the whole path is passed to Stellar Assets --- src/Tribe/Assets.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Tribe/Assets.php b/src/Tribe/Assets.php index c28d42a777..d4b65444cf 100644 --- a/src/Tribe/Assets.php +++ b/src/Tribe/Assets.php @@ -353,12 +353,7 @@ public function register( $origin, $slug, $file, $deps = [], $action = null, $ar : $arguments['type']; // Work out the root path from the origin. - $root_path = str_replace( - dirname( WP_CONTENT_DIR ) ?: WP_CONTENT_DIR, - '', - // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase - trailingslashit( ! empty( $origin->plugin_path ) ? $origin->plugin_path : $origin->pluginPath ) - ); + $root_path = trailingslashit( ! empty( $origin->plugin_path ) ? $origin->plugin_path : $origin->pluginPath ); // Fetches the version on the Origin Version constant if not passed. $version = $arguments['version'] ?? constant( $origin_name . '::VERSION' ); From 135746c2122c79bb280f7eafe3f1bfe4b69c7b9d Mon Sep 17 00:00:00 2001 From: Gustavo Bordoni Date: Wed, 12 Jun 2024 21:06:37 -0400 Subject: [PATCH 54/75] Avoid code sniffer --- src/Tribe/Assets.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tribe/Assets.php b/src/Tribe/Assets.php index d4b65444cf..6ce777fea8 100644 --- a/src/Tribe/Assets.php +++ b/src/Tribe/Assets.php @@ -353,7 +353,7 @@ public function register( $origin, $slug, $file, $deps = [], $action = null, $ar : $arguments['type']; // Work out the root path from the origin. - $root_path = trailingslashit( ! empty( $origin->plugin_path ) ? $origin->plugin_path : $origin->pluginPath ); + $root_path = trailingslashit( ! empty( $origin->plugin_path ) ? $origin->plugin_path : $origin->pluginPath ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase // Fetches the version on the Origin Version constant if not passed. $version = $arguments['version'] ?? constant( $origin_name . '::VERSION' ); From 8b9081da26d7de6ce88c0dbe17de42f79e14f924 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Thu, 13 Jun 2024 18:15:24 +0300 Subject: [PATCH 55/75] Update stelllarwp/assets to 1.2.3 --- composer.json | 2 +- composer.lock | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 4526745f30..d93ef403b8 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "stellarwp/models": "dev-main", "stellarwp/schema": "^1.1.3", "stellarwp/telemetry": "^2.3.1", - "stellarwp/assets": "^1.2.2" + "stellarwp/assets": "^1.2.3" }, "require-dev": { "automattic/vipwpcs": "^3.0", diff --git a/composer.lock b/composer.lock index 72e1a12d6a..1690dcb255 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "07abb2abd32ed40b0e7d1903d2cec044", + "content-hash": "5d5a0230728153590656e0e84334e23d", "packages": [ { "name": "firebase/php-jwt", @@ -295,16 +295,16 @@ }, { "name": "stellarwp/assets", - "version": "1.2.2", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/stellarwp/assets.git", - "reference": "3e097e16b8d6c12c697d4688ec07a079fe46a2ce" + "reference": "0ec7d376531e4d9c188a91f2e26a2a9b74737a33" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stellarwp/assets/zipball/3e097e16b8d6c12c697d4688ec07a079fe46a2ce", - "reference": "3e097e16b8d6c12c697d4688ec07a079fe46a2ce", + "url": "https://api.github.com/repos/stellarwp/assets/zipball/0ec7d376531e4d9c188a91f2e26a2a9b74737a33", + "reference": "0ec7d376531e4d9c188a91f2e26a2a9b74737a33", "shasum": "" }, "require-dev": { @@ -345,9 +345,9 @@ "description": "A library for managing asset registration and enqueuing in WordPress.", "support": { "issues": "https://github.com/stellarwp/assets/issues", - "source": "https://github.com/stellarwp/assets/tree/1.2.2" + "source": "https://github.com/stellarwp/assets/tree/1.2.3" }, - "time": "2024-06-05T15:58:22+00:00" + "time": "2024-06-13T14:23:47+00:00" }, { "name": "stellarwp/container-contract", @@ -6930,5 +6930,5 @@ "platform-overrides": { "php": "7.4.0" }, - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } From cbeba52a8a0595c8d2e84e4fef23f9c392f7328f Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Thu, 13 Jun 2024 18:32:39 +0300 Subject: [PATCH 56/75] version bump --- src/Tribe/Main.php | 2 +- tribe-common.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tribe/Main.php b/src/Tribe/Main.php index 610a15c6bf..7028904d20 100644 --- a/src/Tribe/Main.php +++ b/src/Tribe/Main.php @@ -18,7 +18,7 @@ class Tribe__Main { const OPTIONNAME = 'tribe_events_calendar_options'; const OPTIONNAMENETWORK = 'tribe_events_calendar_network_options'; const FEED_URL = 'https://theeventscalendar.com/feed/'; - const VERSION = '5.3.0'; + const VERSION = '5.3.0.1'; protected $plugin_context; protected $plugin_context_class; diff --git a/tribe-common.php b/tribe-common.php index 638a49cf5e..4efd534865 100644 --- a/tribe-common.php +++ b/tribe-common.php @@ -2,7 +2,7 @@ /** * Plugin Name: Tribe Common * Description: An event settings framework for managing shared options. - * Version: 5.3.0 + * Version: 5.3.0.1 * Author: The Events Calendar * Author URI: http://evnt.is/1x * Text Domain: tribe-common From dce24878580ac34abe8fd9cf8030a10798cfe93b Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Thu, 13 Jun 2024 18:47:31 +0300 Subject: [PATCH 57/75] Updates readme --- readme.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readme.txt b/readme.txt index c7e0cfe202..807b6bf035 100644 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,9 @@ == Changelog == += [5.3.0.1] 2024-06-13 = + +* Fix - Issue on which some assets (css,js) would not be located in WP installs which could have some WP constant modified (WP_CONTENT_DIR, WP_PLUGIN_DIR)[TECTRIA-83] + = [5.3.0] 2024-06-11 = * Feature - Refactor tribe_asset to use Stellar Assets. [TCMN-172] From 6bb2ef5b4dd13ed249140b0e826e8b34adc6c9a0 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Thu, 13 Jun 2024 22:03:02 +0300 Subject: [PATCH 58/75] Update stellarwp/assets to 1.2.4 --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index d93ef403b8..6a2a41e7b7 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "stellarwp/models": "dev-main", "stellarwp/schema": "^1.1.3", "stellarwp/telemetry": "^2.3.1", - "stellarwp/assets": "^1.2.3" + "stellarwp/assets": "^1.2.4" }, "require-dev": { "automattic/vipwpcs": "^3.0", diff --git a/composer.lock b/composer.lock index 1690dcb255..3352200760 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5d5a0230728153590656e0e84334e23d", + "content-hash": "a21c3ab68975487869bd79c341edb7cb", "packages": [ { "name": "firebase/php-jwt", @@ -295,16 +295,16 @@ }, { "name": "stellarwp/assets", - "version": "1.2.3", + "version": "1.2.4", "source": { "type": "git", "url": "https://github.com/stellarwp/assets.git", - "reference": "0ec7d376531e4d9c188a91f2e26a2a9b74737a33" + "reference": "9c7a9580bb16cdd10b78b6767b982ed3f8b34a9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stellarwp/assets/zipball/0ec7d376531e4d9c188a91f2e26a2a9b74737a33", - "reference": "0ec7d376531e4d9c188a91f2e26a2a9b74737a33", + "url": "https://api.github.com/repos/stellarwp/assets/zipball/9c7a9580bb16cdd10b78b6767b982ed3f8b34a9d", + "reference": "9c7a9580bb16cdd10b78b6767b982ed3f8b34a9d", "shasum": "" }, "require-dev": { @@ -345,9 +345,9 @@ "description": "A library for managing asset registration and enqueuing in WordPress.", "support": { "issues": "https://github.com/stellarwp/assets/issues", - "source": "https://github.com/stellarwp/assets/tree/1.2.3" + "source": "https://github.com/stellarwp/assets/tree/1.2.4" }, - "time": "2024-06-13T14:23:47+00:00" + "time": "2024-06-13T18:59:09+00:00" }, { "name": "stellarwp/container-contract", From bf40a42f147417ddc62f981c9a9afc9b1e382f47 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Thu, 13 Jun 2024 22:22:52 +0300 Subject: [PATCH 59/75] Update changelog for language --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index 807b6bf035..4505115a46 100644 --- a/readme.txt +++ b/readme.txt @@ -3,6 +3,7 @@ = [5.3.0.1] 2024-06-13 = * Fix - Issue on which some assets (css,js) would not be located in WP installs which could have some WP constant modified (WP_CONTENT_DIR, WP_PLUGIN_DIR)[TECTRIA-83] +* Language - 0 new strings added, 0 updated, 1 fuzzied, and 0 obsoleted = [5.3.0] 2024-06-11 = From f9ef9176683bdf19b57e15d32868e411549f3ac1 Mon Sep 17 00:00:00 2001 From: Gustavo Bordoni Date: Thu, 13 Jun 2024 22:50:59 -0400 Subject: [PATCH 60/75] Version bump to 5.3.0.2 --- readme.txt | 4 ++++ src/Tribe/Main.php | 2 +- tribe-common.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/readme.txt b/readme.txt index 4505115a46..1505dc2bf8 100644 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,9 @@ == Changelog == += [5.3.0.2] 2024-06-14 = + +* Fix - Windows Server compatibility issues with updated Assets handling. [TECTRIA-83] + = [5.3.0.1] 2024-06-13 = * Fix - Issue on which some assets (css,js) would not be located in WP installs which could have some WP constant modified (WP_CONTENT_DIR, WP_PLUGIN_DIR)[TECTRIA-83] diff --git a/src/Tribe/Main.php b/src/Tribe/Main.php index 7028904d20..ed557b8b73 100644 --- a/src/Tribe/Main.php +++ b/src/Tribe/Main.php @@ -18,7 +18,7 @@ class Tribe__Main { const OPTIONNAME = 'tribe_events_calendar_options'; const OPTIONNAMENETWORK = 'tribe_events_calendar_network_options'; const FEED_URL = 'https://theeventscalendar.com/feed/'; - const VERSION = '5.3.0.1'; + const VERSION = '5.3.0.2'; protected $plugin_context; protected $plugin_context_class; diff --git a/tribe-common.php b/tribe-common.php index 4efd534865..37269cbe70 100644 --- a/tribe-common.php +++ b/tribe-common.php @@ -2,7 +2,7 @@ /** * Plugin Name: Tribe Common * Description: An event settings framework for managing shared options. - * Version: 5.3.0.1 + * Version: 5.3.0.2 * Author: The Events Calendar * Author URI: http://evnt.is/1x * Text Domain: tribe-common From 9ecc6dcfabba6d6a7209a6fac097f507ee611762 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 14 Jun 2024 14:56:57 +0300 Subject: [PATCH 61/75] Update stellarwp/assets to 1.2.5 --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 6a2a41e7b7..b8d3f1d3dd 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "stellarwp/models": "dev-main", "stellarwp/schema": "^1.1.3", "stellarwp/telemetry": "^2.3.1", - "stellarwp/assets": "^1.2.4" + "stellarwp/assets": "^1.2.5" }, "require-dev": { "automattic/vipwpcs": "^3.0", diff --git a/composer.lock b/composer.lock index 3352200760..2d4b0d0132 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a21c3ab68975487869bd79c341edb7cb", + "content-hash": "413f04c50b13c60787e1358842eccd7c", "packages": [ { "name": "firebase/php-jwt", @@ -295,16 +295,16 @@ }, { "name": "stellarwp/assets", - "version": "1.2.4", + "version": "1.2.5", "source": { "type": "git", "url": "https://github.com/stellarwp/assets.git", - "reference": "9c7a9580bb16cdd10b78b6767b982ed3f8b34a9d" + "reference": "5d5b4f2fe3b0d1d71608228cfd907119825984a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stellarwp/assets/zipball/9c7a9580bb16cdd10b78b6767b982ed3f8b34a9d", - "reference": "9c7a9580bb16cdd10b78b6767b982ed3f8b34a9d", + "url": "https://api.github.com/repos/stellarwp/assets/zipball/5d5b4f2fe3b0d1d71608228cfd907119825984a7", + "reference": "5d5b4f2fe3b0d1d71608228cfd907119825984a7", "shasum": "" }, "require-dev": { @@ -345,9 +345,9 @@ "description": "A library for managing asset registration and enqueuing in WordPress.", "support": { "issues": "https://github.com/stellarwp/assets/issues", - "source": "https://github.com/stellarwp/assets/tree/1.2.4" + "source": "https://github.com/stellarwp/assets/tree/1.2.5" }, - "time": "2024-06-13T18:59:09+00:00" + "time": "2024-06-14T11:29:41+00:00" }, { "name": "stellarwp/container-contract", From 97f1a40e6a120bef3dde6d852879473894d3e63e Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 14 Jun 2024 16:21:39 +0300 Subject: [PATCH 62/75] Update readme's language --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index 1505dc2bf8..1eda470a07 100644 --- a/readme.txt +++ b/readme.txt @@ -3,6 +3,7 @@ = [5.3.0.2] 2024-06-14 = * Fix - Windows Server compatibility issues with updated Assets handling. [TECTRIA-83] +* Language - 0 new strings added, 0 updated, 1 fuzzied, and 0 obsoleted = [5.3.0.1] 2024-06-13 = From a4b7c07cdda83eec1f8d43c870d59f038bc5d0e9 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 14 Jun 2024 20:16:23 +0300 Subject: [PATCH 63/75] Version bump to 5.3.0.2 --- readme.txt | 5 +++++ src/Tribe/Main.php | 2 +- tribe-common.php | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/readme.txt b/readme.txt index 1eda470a07..76bd086d68 100644 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,10 @@ == Changelog == += [5.3.0.3] 2024-06-14 = + +* Fix - Issue where scripts would not be enqueued as modules. [TECTRIA-86] +* Language - 0 new strings added, 0 updated, 1 fuzzied, and 0 obsoleted + = [5.3.0.2] 2024-06-14 = * Fix - Windows Server compatibility issues with updated Assets handling. [TECTRIA-83] diff --git a/src/Tribe/Main.php b/src/Tribe/Main.php index ed557b8b73..6caa41fd12 100644 --- a/src/Tribe/Main.php +++ b/src/Tribe/Main.php @@ -18,7 +18,7 @@ class Tribe__Main { const OPTIONNAME = 'tribe_events_calendar_options'; const OPTIONNAMENETWORK = 'tribe_events_calendar_network_options'; const FEED_URL = 'https://theeventscalendar.com/feed/'; - const VERSION = '5.3.0.2'; + const VERSION = '5.3.0.3'; protected $plugin_context; protected $plugin_context_class; diff --git a/tribe-common.php b/tribe-common.php index 37269cbe70..ceb5da07bd 100644 --- a/tribe-common.php +++ b/tribe-common.php @@ -2,7 +2,7 @@ /** * Plugin Name: Tribe Common * Description: An event settings framework for managing shared options. - * Version: 5.3.0.2 + * Version: 5.3.0.3 * Author: The Events Calendar * Author URI: http://evnt.is/1x * Text Domain: tribe-common From 7a3f47d5724938cf89f4049e158879eb99d158bf Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 14 Jun 2024 20:17:57 +0300 Subject: [PATCH 64/75] Update stellarwp assets to 1.2.6 --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index b8d3f1d3dd..b5c48952a1 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "stellarwp/models": "dev-main", "stellarwp/schema": "^1.1.3", "stellarwp/telemetry": "^2.3.1", - "stellarwp/assets": "^1.2.5" + "stellarwp/assets": "^1.2.6" }, "require-dev": { "automattic/vipwpcs": "^3.0", diff --git a/composer.lock b/composer.lock index 2d4b0d0132..57ffad60fd 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "413f04c50b13c60787e1358842eccd7c", + "content-hash": "8d1a6a11034c5373e397b6117a9821a2", "packages": [ { "name": "firebase/php-jwt", @@ -295,16 +295,16 @@ }, { "name": "stellarwp/assets", - "version": "1.2.5", + "version": "1.2.6", "source": { "type": "git", "url": "https://github.com/stellarwp/assets.git", - "reference": "5d5b4f2fe3b0d1d71608228cfd907119825984a7" + "reference": "fa481491c8a2df1a4462154ef4d5ddc423c60ecd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stellarwp/assets/zipball/5d5b4f2fe3b0d1d71608228cfd907119825984a7", - "reference": "5d5b4f2fe3b0d1d71608228cfd907119825984a7", + "url": "https://api.github.com/repos/stellarwp/assets/zipball/fa481491c8a2df1a4462154ef4d5ddc423c60ecd", + "reference": "fa481491c8a2df1a4462154ef4d5ddc423c60ecd", "shasum": "" }, "require-dev": { @@ -345,9 +345,9 @@ "description": "A library for managing asset registration and enqueuing in WordPress.", "support": { "issues": "https://github.com/stellarwp/assets/issues", - "source": "https://github.com/stellarwp/assets/tree/1.2.5" + "source": "https://github.com/stellarwp/assets/tree/1.2.6" }, - "time": "2024-06-14T11:29:41+00:00" + "time": "2024-06-14T16:59:38+00:00" }, { "name": "stellarwp/container-contract", From c61ddfdc99931013ca011a33b7a84524971e2277 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Tue, 18 Jun 2024 16:16:04 +0300 Subject: [PATCH 65/75] Follow symlinks --- src/Tribe/Assets.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Tribe/Assets.php b/src/Tribe/Assets.php index 6ce777fea8..ac199f69c9 100644 --- a/src/Tribe/Assets.php +++ b/src/Tribe/Assets.php @@ -355,6 +355,9 @@ public function register( $origin, $slug, $file, $deps = [], $action = null, $ar // Work out the root path from the origin. $root_path = trailingslashit( ! empty( $origin->plugin_path ) ? $origin->plugin_path : $origin->pluginPath ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + // Follow symlinks. + $root_path = str_replace( trailingslashit( dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) ), trailingslashit( WP_PLUGIN_DIR ), $root_path ); + // Fetches the version on the Origin Version constant if not passed. $version = $arguments['version'] ?? constant( $origin_name . '::VERSION' ); From a7226883b623e5dbe0025afd0072225af3bd157f Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Tue, 18 Jun 2024 16:37:57 +0300 Subject: [PATCH 66/75] Version bump to 5.3.0.4 --- readme.txt | 5 +++++ src/Tribe/Main.php | 2 +- tribe-common.php | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/readme.txt b/readme.txt index 76bd086d68..83e439ca9f 100644 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,10 @@ == Changelog == += [5.3.0.4] 2024-06-18 = + +* Fix - Follow Symlinks in order to locate assets [] +* Language - 0 new strings added, 0 updated, 1 fuzzied, and 0 obsoleted + = [5.3.0.3] 2024-06-14 = * Fix - Issue where scripts would not be enqueued as modules. [TECTRIA-86] diff --git a/src/Tribe/Main.php b/src/Tribe/Main.php index 6caa41fd12..adc55fac05 100644 --- a/src/Tribe/Main.php +++ b/src/Tribe/Main.php @@ -18,7 +18,7 @@ class Tribe__Main { const OPTIONNAME = 'tribe_events_calendar_options'; const OPTIONNAMENETWORK = 'tribe_events_calendar_network_options'; const FEED_URL = 'https://theeventscalendar.com/feed/'; - const VERSION = '5.3.0.3'; + const VERSION = '5.3.0.4'; protected $plugin_context; protected $plugin_context_class; diff --git a/tribe-common.php b/tribe-common.php index ceb5da07bd..916961f1ab 100644 --- a/tribe-common.php +++ b/tribe-common.php @@ -2,7 +2,7 @@ /** * Plugin Name: Tribe Common * Description: An event settings framework for managing shared options. - * Version: 5.3.0.3 + * Version: 5.3.0.4 * Author: The Events Calendar * Author URI: http://evnt.is/1x * Text Domain: tribe-common From cff7e25ee1c56598fad8ee214e4433d52c40cd60 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Tue, 18 Jun 2024 16:57:04 +0300 Subject: [PATCH 67/75] Update readme changelog for release 5.3.0.4 --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 83e439ca9f..4c197132a4 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ = [5.3.0.4] 2024-06-18 = -* Fix - Follow Symlinks in order to locate assets [] +* Fix - Follow Symlinks in order to locate assets [TECTRIA-91] * Language - 0 new strings added, 0 updated, 1 fuzzied, and 0 obsoleted = [5.3.0.3] 2024-06-14 = From 324dbff96c1a555cdc54347b51fd576f3994c435 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Tue, 18 Jun 2024 19:27:43 +0300 Subject: [PATCH 68/75] Update language changelog for release --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 4c197132a4..ab7f036658 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ = [5.3.0.4] 2024-06-18 = * Fix - Follow Symlinks in order to locate assets [TECTRIA-91] -* Language - 0 new strings added, 0 updated, 1 fuzzied, and 0 obsoleted +* Language - 0 new strings added, 0 updated, 0 fuzzied, and 0 obsoleted = [5.3.0.3] 2024-06-14 = From 96b57caba40affd956fa791335fadfe9cf9ce340 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Tue, 18 Jun 2024 19:37:09 +0300 Subject: [PATCH 69/75] Update changelog entry --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index ab7f036658..0f7950ccbe 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ = [5.3.0.4] 2024-06-18 = -* Fix - Follow Symlinks in order to locate assets [TECTRIA-91] +* Fix - In installations where the plugins or wp-content directories were symbolic linked, assets would fail to be located.[TECTRIA-91] * Language - 0 new strings added, 0 updated, 0 fuzzied, and 0 obsoleted = [5.3.0.3] 2024-06-14 = From b18cd54425611cde6f309bbb42f0ff00373e4311 Mon Sep 17 00:00:00 2001 From: Gustavo Bordoni Date: Wed, 19 Jun 2024 12:55:49 -0400 Subject: [PATCH 70/75] :recycle: https://github.com/the-events-calendar/tribe-common-styles/commit/5c56a469f2eb3f4be40afcc7cb676c2cb19bfa39 --- src/resources/postcss/utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resources/postcss/utilities b/src/resources/postcss/utilities index 5c56a469f2..024e7fa9ff 160000 --- a/src/resources/postcss/utilities +++ b/src/resources/postcss/utilities @@ -1 +1 @@ -Subproject commit 5c56a469f2eb3f4be40afcc7cb676c2cb19bfa39 +Subproject commit 024e7fa9ffc1483ab6e7cbfed1a5883adc9ce829 From b59db43ab8abf196ed21116d3aabac07b3e391ad Mon Sep 17 00:00:00 2001 From: Gustavo Bordoni Date: Wed, 19 Jun 2024 12:59:18 -0400 Subject: [PATCH 71/75] Update hash --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 0f7950ccbe..385925b136 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ = [5.3.0.4] 2024-06-18 = -* Fix - In installations where the plugins or wp-content directories were symbolic linked, assets would fail to be located.[TECTRIA-91] +* Fix - In installations where the plugins or wp-content directories were symbolic linked, assets would fail to be located. [TECTRIA-91] * Language - 0 new strings added, 0 updated, 0 fuzzied, and 0 obsoleted = [5.3.0.3] 2024-06-14 = From ef47dd5597e87c2f9c8a19340abbae28904cef61 Mon Sep 17 00:00:00 2001 From: George Pattichis Date: Sun, 23 Jun 2024 17:31:02 +0300 Subject: [PATCH 72/75] Change copy of tooltips for disabled endpoints --- .../components/missing-dependency.php | 43 ++++++++++--------- .../components/missing-dependency.php | 35 ++++++++------- 2 files changed, 42 insertions(+), 36 deletions(-) diff --git a/src/admin-views/dashboard/components/missing-dependency.php b/src/admin-views/dashboard/components/missing-dependency.php index b2874faec4..179f49daab 100644 --- a/src/admin-views/dashboard/components/missing-dependency.php +++ b/src/admin-views/dashboard/components/missing-dependency.php @@ -23,26 +23,29 @@ return; } -$dependents = []; -foreach ( $endpoint['dependents'] as $dependent ) { - if ( $dependent === 'tec') { - $dependents[] = _x( 'The Events Calendar', 'The name of the missing dependent plugin for a Integration Endpoint.','event-automator' ); - } - if ( $dependent === 'et') { - $dependents[] = _x( 'Event Tickets', 'The name of the missing dependent plugin for a Integration Endpoint.','event-automator' ); - } +switch ( $endpoint['dependents'][0] ) { + case 'tec': + $dependency = '' . _x( 'The Events Calendar', 'The name of the missing dependent plugin for a Integration Endpoint.', 'event-automator' ) . ''; + break; + case 'et': + $dependency = '' . _x( 'Event Tickets', 'The name of the missing dependent plugin for a Integration Endpoint.', 'event-automator' ) . ''; + break; } -$tooltip = [ - 'classes_wrap' => [ 'tec-settings-connection-endpoint-dashboard-details__tooltip' ], - 'message' => sprintf( '%1s %2s', - _x( 'Missing ', 'Missing dependency message in the settings.', 'event-automator' ), - implode( ' and ', $dependents ) - ), - ]; + +$tooltip = [ + 'classes_wrap' => [ 'tec-settings-connection-endpoint-dashboard-details__tooltip' ], + 'message' => sprintf( + '%1s %2s %3s', + _x( 'Missing ', 'Missing dependency message in the settings.', 'event-automator' ), + $dependency, + _x( ' plugin.', 'Missing dependency message in the settings.', 'event-automator' ) + ), +]; ?> -
- - template( 'components/tooltip', $tooltip ); - ?> -
+
+ + template( 'components/tooltip', $tooltip ); + ?> +
' . _x( 'The Events Calendar', 'The name of the missing dependent plugin for a Integration Endpoint.', 'event-automator' ) . ''; + break; + case 'et': + $dependency = '' . _x( 'Event Tickets', 'The name of the missing dependent plugin for a Integration Endpoint.', 'event-automator' ) . ''; + break; } -$tooltip = [ - 'classes_wrap' => [ 'tec-settings-connection-endpoint-dashboard-details__tooltip' ], - 'message' => sprintf( '%1s %2s', - _x( 'Missing ', 'Missing dependency message in the settings.', 'event-automator' ), - implode( ' and ', $dependents ) - ), - ]; + +$tooltip = [ + 'classes_wrap' => [ 'tec-settings-connection-endpoint-dashboard-details__tooltip' ], + 'message' => sprintf( + '%1s %2s %3s', + _x( 'Missing ', 'Missing dependency message in the settings.', 'event-automator' ), + $dependency, + _x( ' plugin.', 'Missing dependency message in the settings.', 'event-automator' ) + ), +]; ?>
- template( 'components/tooltip', $tooltip ); + template( 'components/tooltip', $tooltip ); ?>
Date: Sun, 23 Jun 2024 17:37:18 +0300 Subject: [PATCH 73/75] PHPCS formatting --- .../dashboard/components/missing-dependency.php | 6 +++--- .../dashboard/components/missing-dependency.php | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/admin-views/dashboard/components/missing-dependency.php b/src/admin-views/dashboard/components/missing-dependency.php index 179f49daab..c9a5e9aeae 100644 --- a/src/admin-views/dashboard/components/missing-dependency.php +++ b/src/admin-views/dashboard/components/missing-dependency.php @@ -25,10 +25,10 @@ switch ( $endpoint['dependents'][0] ) { case 'tec': - $dependency = '' . _x( 'The Events Calendar', 'The name of the missing dependent plugin for a Integration Endpoint.', 'event-automator' ) . ''; + $dependency = '' . _x( 'The Events Calendar', 'Name of missing dependency for Endpoint.', 'event-automator' ) . ''; break; case 'et': - $dependency = '' . _x( 'Event Tickets', 'The name of the missing dependent plugin for a Integration Endpoint.', 'event-automator' ) . ''; + $dependency = '' . _x( 'Event Tickets', 'Name of missing dependency for Endpoint.', 'event-automator' ) . ''; break; } @@ -43,8 +43,8 @@ ]; ?>
- template( 'components/tooltip', $tooltip ); ?>
diff --git a/src/admin-views/zapier/dashboard/components/missing-dependency.php b/src/admin-views/zapier/dashboard/components/missing-dependency.php index eaff00a682..08ce5a1dc2 100644 --- a/src/admin-views/zapier/dashboard/components/missing-dependency.php +++ b/src/admin-views/zapier/dashboard/components/missing-dependency.php @@ -25,10 +25,10 @@ switch ( $endpoint['dependents'][0] ) { case 'tec': - $dependency = '' . _x( 'The Events Calendar', 'The name of the missing dependent plugin for a Integration Endpoint.', 'event-automator' ) . ''; + $dependency = '' . _x( 'The Events Calendar', 'Name of missing dependency for Endpoint.', 'event-automator' ) . ''; break; case 'et': - $dependency = '' . _x( 'Event Tickets', 'The name of the missing dependent plugin for a Integration Endpoint.', 'event-automator' ) . ''; + $dependency = '' . _x( 'Event Tickets', 'Name of missing dependency for Endpoint.', 'event-automator' ) . ''; break; } @@ -42,10 +42,10 @@ ), ]; ?> -
- - template( 'components/tooltip', $tooltip ); - ?> -
+
+ template( 'components/tooltip', $tooltip ); + ?> +
Date: Mon, 24 Jun 2024 15:50:51 -0700 Subject: [PATCH 74/75] Missing dependencies for EVA. --- src/Common/Event_Automator/Integrations/Assets.php | 2 +- src/Common/Event_Automator/Zapier/Assets.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Common/Event_Automator/Integrations/Assets.php b/src/Common/Event_Automator/Integrations/Assets.php index 56a70c3c40..da8b2d6571 100644 --- a/src/Common/Event_Automator/Integrations/Assets.php +++ b/src/Common/Event_Automator/Integrations/Assets.php @@ -28,7 +28,7 @@ public function register_admin_assets() { \Tribe__Main::instance(), 'tec-event-automator-js', 'tec-event-automator.js', - [ 'jquery' ], + [ 'jquery', 'tribe-dropdowns', 'tribe-clipboard' ], 'admin_enqueue_scripts', [ 'conditionals' => [ diff --git a/src/Common/Event_Automator/Zapier/Assets.php b/src/Common/Event_Automator/Zapier/Assets.php index 4546e6ef18..ffd178bc88 100644 --- a/src/Common/Event_Automator/Zapier/Assets.php +++ b/src/Common/Event_Automator/Zapier/Assets.php @@ -28,7 +28,7 @@ public function register_admin_assets() { \Tribe__Main::instance(), 'tec-event-automator-js', 'tec-event-automator.js', - [ 'jquery' ], + [ 'jquery', 'tribe-dropdowns', 'tribe-clipboard' ], 'admin_enqueue_scripts', [ 'conditionals' => [ From 2914f8f8acf3b74ebeb9645aba6074183f4f53ec Mon Sep 17 00:00:00 2001 From: Edwin Daniels Date: Tue, 25 Jun 2024 18:28:29 -0700 Subject: [PATCH 75/75] Moving plugin path defin up. --- src/Common/Event_Automator/Plugin.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/Common/Event_Automator/Plugin.php b/src/Common/Event_Automator/Plugin.php index fdcdb9126b..d940732dc4 100644 --- a/src/Common/Event_Automator/Plugin.php +++ b/src/Common/Event_Automator/Plugin.php @@ -84,6 +84,22 @@ class Plugin extends \tad_DI52_ServiceProvider { */ protected $container; + /** + * Plugin constructor. + * + * @since TBD + * + * @param \tad_DI52_Container $container The container to use. + */ + public function __construct( \tad_DI52_Container $container ) { + $this->container = $container; + + // Set up the plugin provider properties. + $this->plugin_path = trailingslashit( Tribe__Main::instance()->plugin_path ); + $this->plugin_dir = trailingslashit( basename( $this->plugin_path ) ); + $this->plugin_url = plugins_url( $this->plugin_dir, $this->plugin_path ); + } + /** * Sets the container for the class. * @@ -124,11 +140,6 @@ public function boot( $container = null ): void { * This always executes even if the required plugins are not present. */ public function register() { - // Set up the plugin provider properties. - $this->plugin_path = trailingslashit( Tribe__Main::instance()->plugin_path ); - $this->plugin_dir = trailingslashit( basename( $this->plugin_path ) ); - $this->plugin_url = plugins_url( $this->plugin_dir, $this->plugin_path ); - // Register this provider as the main one and use a bunch of aliases. $this->container->singleton( static::class, $this ); $this->container->singleton( 'event-automator', $this );