From dbf4a33f0aac33e5fde462f51e2f7188123646c1 Mon Sep 17 00:00:00 2001 From: dpanta94 <29694484+dpanta94@users.noreply.github.com> Date: Wed, 6 Nov 2024 18:35:31 +0000 Subject: [PATCH 01/90] Version bump for bucket/waitlists This is an automated PR created by dpanta94. Generated by: https://github.com/the-events-calendar/event-tickets/actions/runs/11709773989 --- event-tickets.php | 2 +- package.json | 2 +- readme.txt | 2 +- src/Tribe/Main.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/event-tickets.php b/event-tickets.php index ecf7080380..045bba70f1 100644 --- a/event-tickets.php +++ b/event-tickets.php @@ -3,7 +3,7 @@ * Plugin Name: Event Tickets * Plugin URI: https://evnt.is/1acb * Description: Event Tickets allows you to sell basic tickets and collect RSVPs from any post, page, or event. - * Version: 5.16.1 + * Version: 5.17.0 * Requires at least: 6.3 * Requires PHP: 7.4 * Author: The Events Calendar diff --git a/package.json b/package.json index a407b9b708..59f62548db 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "event-tickets", - "version": "5.16.1", + "version": "5.17.0", "repository": "git@github.com:the-events-calendar/event-tickets.git", "_zipname": "event-tickets", "_zipfoldername": "event-tickets", diff --git a/readme.txt b/readme.txt index 1635900a31..daa47035bb 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ Contributors: theeventscalendar, brianjessee, camwynsp, redscar, tribalmike, rafsuntaskin, aguseo, bordoni, borkweb, GeoffBel, jentheo, leahkoerper, lucatume, neillmcshea, vicskf, zbtirrell, juanfra Tags: tickets, event registration, RSVP, ticket sales, attendee management -Stable tag: 5.16.1 +Stable tag: 5.17.0 Requires at least: 6.3 Tested up to: 6.6.2 Requires PHP: 7.4 diff --git a/src/Tribe/Main.php b/src/Tribe/Main.php index 0fb1b5d2e7..ca06edbb7f 100644 --- a/src/Tribe/Main.php +++ b/src/Tribe/Main.php @@ -15,7 +15,7 @@ class Tribe__Tickets__Main { /** * Current version of this plugin. */ - const VERSION = '5.16.1'; + const VERSION = '5.17.0'; /** * Used to store the version history. From 2cee4a51bc917e5ff243e9793fc811ac1fe3083f Mon Sep 17 00:00:00 2001 From: Stellar Bot <74736843+tec-bot@users.noreply.github.com> Date: Wed, 6 Nov 2024 14:40:53 -0400 Subject: [PATCH 02/90] :fast_forward: https://github.com/the-events-calendar/tribe-common/commit/4872ed8a2e8a90027b26799752faeac901536d0f --- common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common b/common index 3f95c08846..4872ed8a2e 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 3f95c08846ce57860e772296c13d1dae1115e62c +Subproject commit 4872ed8a2e8a90027b26799752faeac901536d0f From e1827e7a8cd47d67f5f012f36c9eb94664ec3e7e Mon Sep 17 00:00:00 2001 From: Stellar Bot <74736843+tec-bot@users.noreply.github.com> Date: Thu, 19 Dec 2024 10:55:57 -0400 Subject: [PATCH 03/90] :fast_forward: https://github.com/the-events-calendar/tribe-common/commit/c8beb2a92ebead4bdb76bfdf3897bf5362f1760d --- common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common b/common index 01e4c81e5e..c8beb2a92e 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 01e4c81e5e0d323258124260c6127031a48802db +Subproject commit c8beb2a92ebead4bdb76bfdf3897bf5362f1760d From 971c34307b7232c959d8b9990f932ce822c908a9 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 13 Nov 2024 17:01:21 +0200 Subject: [PATCH 04/90] [wip] custom table query methods --- .../Tables/Custom_Table_Query_Methods.php | 133 ------------------ src/Tickets/Seating/Tables/Layouts.php | 4 +- src/Tickets/Seating/Tables/Maps.php | 4 +- src/Tickets/Seating/Tables/Seat_Types.php | 4 +- src/Tickets/Seating/Tables/Sessions.php | 3 +- .../Seating/Tables/Truncate_Methods.php | 41 ------ 6 files changed, 4 insertions(+), 185 deletions(-) delete mode 100644 src/Tickets/Seating/Tables/Custom_Table_Query_Methods.php delete mode 100644 src/Tickets/Seating/Tables/Truncate_Methods.php diff --git a/src/Tickets/Seating/Tables/Custom_Table_Query_Methods.php b/src/Tickets/Seating/Tables/Custom_Table_Query_Methods.php deleted file mode 100644 index 15b2c6c19a..0000000000 --- a/src/Tickets/Seating/Tables/Custom_Table_Query_Methods.php +++ /dev/null @@ -1,133 +0,0 @@ -> The rows from the table. - */ - public static function fetch_all( int $batch_size = 50, string $output = OBJECT, string $where_clause = '' ): Generator { - $fetched = 0; - $total = null; - $offset = 0; - - do { - // On first iteration, we need to set the SQL_CALC_FOUND_ROWS flag. - $sql_calc_found_rows = 0 === $fetched ? 'SQL_CALC_FOUND_ROWS' : ''; - - $batch = DB::get_results( - DB::prepare( - "SELECT {$sql_calc_found_rows} * FROM %i {$where_clause} ORDER BY id LIMIT %d, %d", - static::table_name( true ), - $offset, - $batch_size - ), - $output - ); - - // We need to get the total number of rows, only after the first batch. - $total ??= DB::get_var( 'SELECT FOUND_ROWS()' ); - $fetched += count( $batch ); - - yield from $batch; - } while ( $fetched < $total ); - } - - /** - * Inserts multiple rows into the table. - * - * @since 5.16.0 - * - * @param array $entries The entries to insert. - * - * @return bool|int The number of rows affected, or `false` on failure. - */ - public static function insert_many( array $entries ) { - $columns = array_keys( $entries[0] ); - $prepared_columns = implode( - ', ', - array_map( - static fn( string $column ) => "`$column`", - $columns - ) - ); - $prepared_values = implode( - ', ', - array_map( - static function ( array $entry ) use ( $columns ) { - return '(' . implode( ', ', array_map( static fn( $e ) => DB::prepare( '%s', $e ), $entry ) ) . ')'; - }, - $entries - ) - ); - - return DB::query( - DB::prepare( - "INSERT INTO %i ({$prepared_columns}) VALUES {$prepared_values}", - static::table_name( true ), - ) - ); - } - - /** - * Fetches all the rows from the table using a batched query and a WHERE clause. - * - * @since 5.16.0 - * - * @param string $where_clause The WHERE clause to use. - * @param int $batch_size The number of rows to fetch per batch. - * @param string $output The output type of the query, one of OBJECT, ARRAY_A, or ARRAY_N. - * - * @return Generator> The rows from the table. - */ - public static function fetch_all_where( string $where_clause, int $batch_size = 50, string $output = OBJECT ): Generator { - return static::fetch_all( $batch_size, $output, $where_clause ); - } - - /** - * Fetches the first row from the table using a WHERE clause. - * - * @since 5.16.0 - * - * @param string $where_clause The prepared WHERE clause to use. - * @param string $output The output type of the query, one of OBJECT, ARRAY_A, or ARRAY_N. - * - * @return array|object|null The row from the table, or `null` if no row was found. - */ - public static function fetch_first_where( string $where_clause, string $output = OBJECT ) { - return DB::get_row( - DB::prepare( - "SELECT * FROM %i {$where_clause} LIMIT 1", - static::table_name( true ) - ), - $output - ); - } -} diff --git a/src/Tickets/Seating/Tables/Layouts.php b/src/Tickets/Seating/Tables/Layouts.php index 1c4a01d168..bb3d33d0de 100644 --- a/src/Tickets/Seating/Tables/Layouts.php +++ b/src/Tickets/Seating/Tables/Layouts.php @@ -9,7 +9,7 @@ namespace TEC\Tickets\Seating\Tables; -use TEC\Common\StellarWP\Schema\Tables\Contracts\Table; +use TEC\Common\Integrations\Custom_Table_Abstract as Table; /** * Class Layouts. @@ -19,8 +19,6 @@ * @package TEC\Controller\Tables; */ class Layouts extends Table { - use Custom_Table_Query_Methods; - /** * The schema version. * diff --git a/src/Tickets/Seating/Tables/Maps.php b/src/Tickets/Seating/Tables/Maps.php index d2bd1e66ec..47fea972f1 100644 --- a/src/Tickets/Seating/Tables/Maps.php +++ b/src/Tickets/Seating/Tables/Maps.php @@ -9,7 +9,7 @@ namespace TEC\Tickets\Seating\Tables; -use TEC\Common\StellarWP\Schema\Tables\Contracts\Table; +use TEC\Common\Integrations\Custom_Table_Abstract as Table; /** * Class Maps. @@ -19,8 +19,6 @@ * @package TEC\Controller\Tables; */ class Maps extends Table { - use Custom_Table_Query_Methods; - /** * The schema version. * diff --git a/src/Tickets/Seating/Tables/Seat_Types.php b/src/Tickets/Seating/Tables/Seat_Types.php index d961b57679..01dd654e1f 100644 --- a/src/Tickets/Seating/Tables/Seat_Types.php +++ b/src/Tickets/Seating/Tables/Seat_Types.php @@ -10,7 +10,7 @@ namespace TEC\Tickets\Seating\Tables; use TEC\Common\StellarWP\DB\DB; -use TEC\Common\StellarWP\Schema\Tables\Contracts\Table; +use TEC\Common\Integrations\Custom_Table_Abstract as Table; /** * Class Seat_Types. @@ -20,8 +20,6 @@ * @package TEC\Controller\Tables; */ class Seat_Types extends Table { - use Custom_Table_Query_Methods; - /** * The schema version. * diff --git a/src/Tickets/Seating/Tables/Sessions.php b/src/Tickets/Seating/Tables/Sessions.php index 4e753fbc08..f3a0c6e939 100644 --- a/src/Tickets/Seating/Tables/Sessions.php +++ b/src/Tickets/Seating/Tables/Sessions.php @@ -11,7 +11,7 @@ use Exception; use TEC\Common\StellarWP\DB\DB; -use TEC\Common\StellarWP\Schema\Tables\Contracts\Table; +use TEC\Common\Integrations\Custom_Table_Abstract as Table; use TEC\Tickets\Seating\Logging; /** @@ -22,7 +22,6 @@ * @package TEC\Tickets\Seating\Tables; */ class Sessions extends Table { - use Truncate_Methods; use Logging; /** diff --git a/src/Tickets/Seating/Tables/Truncate_Methods.php b/src/Tickets/Seating/Tables/Truncate_Methods.php deleted file mode 100644 index 2c20774a56..0000000000 --- a/src/Tickets/Seating/Tables/Truncate_Methods.php +++ /dev/null @@ -1,41 +0,0 @@ - Date: Wed, 18 Dec 2024 15:03:30 +0100 Subject: [PATCH 05/90] build(.github) update wp to 6.5 in workflows --- .github/workflows/tests-php-ct1.yml | 2 +- .github/workflows/tests-php-ft.yml | 2 +- .github/workflows/tests-php.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests-php-ct1.yml b/.github/workflows/tests-php-ct1.yml index 7b1ceb5050..0c4fc97cfb 100644 --- a/.github/workflows/tests-php-ct1.yml +++ b/.github/workflows/tests-php-ct1.yml @@ -250,7 +250,7 @@ jobs: run: | ${SLIC_BIN} up wordpress ${SLIC_BIN} wp core version - ${SLIC_BIN} wp core update --force --version=6.4.1 + ${SLIC_BIN} wp core update --force --version=6.5 ${SLIC_BIN} wp core version # ------------------------------------------------------------------------------ # Install and activate TwentyTwenty diff --git a/.github/workflows/tests-php-ft.yml b/.github/workflows/tests-php-ft.yml index bc5e1e42fb..14fa9d87d4 100644 --- a/.github/workflows/tests-php-ft.yml +++ b/.github/workflows/tests-php-ft.yml @@ -250,7 +250,7 @@ jobs: run: | ${SLIC_BIN} up wordpress ${SLIC_BIN} wp core version - ${SLIC_BIN} wp core update --force --version=6.4.1 + ${SLIC_BIN} wp core update --force --version=6.5 ${SLIC_BIN} wp core version # ------------------------------------------------------------------------------ # Install and activate TwentyTwenty diff --git a/.github/workflows/tests-php.yml b/.github/workflows/tests-php.yml index 7c2589d522..03e876e5f2 100644 --- a/.github/workflows/tests-php.yml +++ b/.github/workflows/tests-php.yml @@ -209,7 +209,7 @@ jobs: run: | ${SLIC_BIN} up wordpress ${SLIC_BIN} wp core version - ${SLIC_BIN} wp core update --force --version=6.4.1 + ${SLIC_BIN} wp core update --force --version=6.5 ${SLIC_BIN} wp core version # ------------------------------------------------------------------------------ # Install and activate TwentyTwenty From 405538e40cb497a633db842d084157308a397d2a Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Wed, 18 Dec 2024 15:17:33 +0100 Subject: [PATCH 06/90] tests(.github,ft_smoketest) update snapshots and wp in workflows --- .github/workflows/tests-php-ft.yml | 2 +- tests/_data/ft_smoketest.sql | 111 ++++++++++++++++++++++++++++- 2 files changed, 109 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests-php-ft.yml b/.github/workflows/tests-php-ft.yml index 14fa9d87d4..26f9440b9f 100644 --- a/.github/workflows/tests-php-ft.yml +++ b/.github/workflows/tests-php-ft.yml @@ -250,7 +250,7 @@ jobs: run: | ${SLIC_BIN} up wordpress ${SLIC_BIN} wp core version - ${SLIC_BIN} wp core update --force --version=6.5 + ${SLIC_BIN} wp core update --force --version=6.5?: oer ${SLIC_BIN} wp core version # ------------------------------------------------------------------------------ # Install and activate TwentyTwenty diff --git a/tests/_data/ft_smoketest.sql b/tests/_data/ft_smoketest.sql index e34cf4f1d9..63c9bbb961 100644 --- a/tests/_data/ft_smoketest.sql +++ b/tests/_data/ft_smoketest.sql @@ -1,4 +1,5 @@ --- MariaDB dump 10.19 Distrib 10.5.23-MariaDB, for debian-linux-gnu (x86_64) +/*M!999999\- enable the sandbox mode */ +-- MariaDB dump 10.19 Distrib 10.5.26-MariaDB, for debian-linux-gnu (aarch64) -- -- Host: db Database: test -- ------------------------------------------------------ @@ -643,7 +644,7 @@ CREATE TABLE `wp_options` ( LOCK TABLES `wp_options` WRITE; /*!40000 ALTER TABLE `wp_options` DISABLE KEYS */; -INSERT INTO `wp_options` VALUES (1,'siteurl','https://wordpress.test','yes'),(2,'home','https://wordpress.test','yes'),(3,'blogname','RT Smoketest','yes'),(4,'blogdescription','Just another WordPress site','yes'),(5,'users_can_register','0','yes'),(6,'admin_email','admin@wordpress.test','yes'),(7,'start_of_week','1','yes'),(8,'use_balanceTags','0','yes'),(9,'use_smilies','1','yes'),(10,'require_name_email','1','yes'),(11,'comments_notify','1','yes'),(12,'posts_per_rss','10','yes'),(13,'rss_use_excerpt','0','yes'),(14,'mailserver_url','mail.example.com','yes'),(15,'mailserver_login','login@example.com','yes'),(16,'mailserver_pass','password','yes'),(17,'mailserver_port','110','yes'),(18,'default_category','1','yes'),(19,'default_comment_status','open','yes'),(20,'default_ping_status','open','yes'),(21,'default_pingback_flag','1','yes'),(22,'posts_per_page','10','yes'),(23,'date_format','F j, Y','yes'),(24,'time_format','g:i a','yes'),(25,'links_updated_date_format','F j, Y g:i a','yes'),(26,'comment_moderation','0','yes'),(27,'moderation_notify','1','yes'),(28,'permalink_structure','','yes'),(29,'rewrite_rules','','yes'),(30,'hack_file','0','yes'),(31,'blog_charset','UTF-8','yes'),(32,'moderation_keys','','no'),(33,'active_plugins','a:3:{i:0;s:31:\"event-tickets/event-tickets.php\";i:1;s:34:\"events-pro/events-calendar-pro.php\";i:2;s:43:\"the-events-calendar/the-events-calendar.php\";}','yes'),(34,'category_base','','yes'),(35,'ping_sites','http://rpc.pingomatic.com/','yes'),(36,'comment_max_links','2','yes'),(37,'gmt_offset','0','yes'),(38,'default_email_category','1','yes'),(39,'recently_edited','','no'),(40,'template','twentytwenty','yes'),(41,'stylesheet','twentytwenty','yes'),(42,'comment_registration','0','yes'),(43,'html_type','text/html','yes'),(44,'use_trackback','0','yes'),(45,'default_role','subscriber','yes'),(46,'db_version','56657','yes'),(47,'uploads_use_yearmonth_folders','1','yes'),(48,'upload_path','','yes'),(49,'blog_public','1','yes'),(50,'default_link_category','2','yes'),(51,'show_on_front','posts','yes'),(52,'tag_base','','yes'),(53,'show_avatars','1','yes'),(54,'avatar_rating','G','yes'),(55,'upload_url_path','','yes'),(56,'thumbnail_size_w','150','yes'),(57,'thumbnail_size_h','150','yes'),(58,'thumbnail_crop','1','yes'),(59,'medium_size_w','300','yes'),(60,'medium_size_h','300','yes'),(61,'avatar_default','mystery','yes'),(62,'large_size_w','1024','yes'),(63,'large_size_h','1024','yes'),(64,'image_default_link_type','none','yes'),(65,'image_default_size','','yes'),(66,'image_default_align','','yes'),(67,'close_comments_for_old_posts','0','yes'),(68,'close_comments_days_old','14','yes'),(69,'thread_comments','1','yes'),(70,'thread_comments_depth','5','yes'),(71,'page_comments','0','yes'),(72,'comments_per_page','50','yes'),(73,'default_comments_page','newest','yes'),(74,'comment_order','asc','yes'),(75,'sticky_posts','a:0:{}','yes'),(76,'widget_categories','a:0:{}','yes'),(77,'widget_text','a:0:{}','yes'),(78,'widget_rss','a:0:{}','yes'),(79,'uninstall_plugins','a:0:{}','no'),(80,'timezone_string','America/New_York','yes'),(81,'page_for_posts','0','yes'),(82,'page_on_front','0','yes'),(83,'default_post_format','0','yes'),(84,'link_manager_enabled','0','yes'),(85,'finished_splitting_shared_terms','1','yes'),(86,'site_icon','0','yes'),(87,'medium_large_size_w','768','yes'),(88,'medium_large_size_h','0','yes'),(89,'wp_page_for_privacy_policy','3','yes'),(90,'show_comments_cookies_opt_in','1','yes'),(91,'admin_email_lifespan','1695563689','yes'),(92,'disallowed_keys','','no'),(93,'comment_previously_approved','1','yes'),(94,'auto_plugin_theme_update_emails','a:0:{}','no'),(95,'auto_update_core_dev','enabled','yes'),(96,'auto_update_core_minor','enabled','yes'),(97,'auto_update_core_major','enabled','yes'),(98,'wp_force_deactivated_plugins','a:0:{}','yes'),(99,'initial_db_version','53496','yes'),(100,'wp_user_roles','a:5:{s:13:\"administrator\";a:2:{s:4:\"name\";s:13:\"Administrator\";s:12:\"capabilities\";a:101:{s:13:\"switch_themes\";b:1;s:11:\"edit_themes\";b:1;s:16:\"activate_plugins\";b:1;s:12:\"edit_plugins\";b:1;s:10:\"edit_users\";b:1;s:10:\"edit_files\";b:1;s:14:\"manage_options\";b:1;s:17:\"moderate_comments\";b:1;s:17:\"manage_categories\";b:1;s:12:\"manage_links\";b:1;s:12:\"upload_files\";b:1;s:6:\"import\";b:1;s:15:\"unfiltered_html\";b:1;s:10:\"edit_posts\";b:1;s:17:\"edit_others_posts\";b:1;s:20:\"edit_published_posts\";b:1;s:13:\"publish_posts\";b:1;s:10:\"edit_pages\";b:1;s:4:\"read\";b:1;s:8:\"level_10\";b:1;s:7:\"level_9\";b:1;s:7:\"level_8\";b:1;s:7:\"level_7\";b:1;s:7:\"level_6\";b:1;s:7:\"level_5\";b:1;s:7:\"level_4\";b:1;s:7:\"level_3\";b:1;s:7:\"level_2\";b:1;s:7:\"level_1\";b:1;s:7:\"level_0\";b:1;s:17:\"edit_others_pages\";b:1;s:20:\"edit_published_pages\";b:1;s:13:\"publish_pages\";b:1;s:12:\"delete_pages\";b:1;s:19:\"delete_others_pages\";b:1;s:22:\"delete_published_pages\";b:1;s:12:\"delete_posts\";b:1;s:19:\"delete_others_posts\";b:1;s:22:\"delete_published_posts\";b:1;s:20:\"delete_private_posts\";b:1;s:18:\"edit_private_posts\";b:1;s:18:\"read_private_posts\";b:1;s:20:\"delete_private_pages\";b:1;s:18:\"edit_private_pages\";b:1;s:18:\"read_private_pages\";b:1;s:12:\"delete_users\";b:1;s:12:\"create_users\";b:1;s:17:\"unfiltered_upload\";b:1;s:14:\"edit_dashboard\";b:1;s:14:\"update_plugins\";b:1;s:14:\"delete_plugins\";b:1;s:15:\"install_plugins\";b:1;s:13:\"update_themes\";b:1;s:14:\"install_themes\";b:1;s:11:\"update_core\";b:1;s:10:\"list_users\";b:1;s:12:\"remove_users\";b:1;s:13:\"promote_users\";b:1;s:18:\"edit_theme_options\";b:1;s:13:\"delete_themes\";b:1;s:6:\"export\";b:1;s:25:\"read_private_tribe_events\";b:1;s:17:\"edit_tribe_events\";b:1;s:24:\"edit_others_tribe_events\";b:1;s:25:\"edit_private_tribe_events\";b:1;s:27:\"edit_published_tribe_events\";b:1;s:19:\"delete_tribe_events\";b:1;s:26:\"delete_others_tribe_events\";b:1;s:27:\"delete_private_tribe_events\";b:1;s:29:\"delete_published_tribe_events\";b:1;s:20:\"publish_tribe_events\";b:1;s:25:\"read_private_tribe_venues\";b:1;s:17:\"edit_tribe_venues\";b:1;s:24:\"edit_others_tribe_venues\";b:1;s:25:\"edit_private_tribe_venues\";b:1;s:27:\"edit_published_tribe_venues\";b:1;s:19:\"delete_tribe_venues\";b:1;s:26:\"delete_others_tribe_venues\";b:1;s:27:\"delete_private_tribe_venues\";b:1;s:29:\"delete_published_tribe_venues\";b:1;s:20:\"publish_tribe_venues\";b:1;s:29:\"read_private_tribe_organizers\";b:1;s:21:\"edit_tribe_organizers\";b:1;s:28:\"edit_others_tribe_organizers\";b:1;s:29:\"edit_private_tribe_organizers\";b:1;s:31:\"edit_published_tribe_organizers\";b:1;s:23:\"delete_tribe_organizers\";b:1;s:30:\"delete_others_tribe_organizers\";b:1;s:31:\"delete_private_tribe_organizers\";b:1;s:33:\"delete_published_tribe_organizers\";b:1;s:24:\"publish_tribe_organizers\";b:1;s:31:\"read_private_aggregator-records\";b:1;s:23:\"edit_aggregator-records\";b:1;s:30:\"edit_others_aggregator-records\";b:1;s:31:\"edit_private_aggregator-records\";b:1;s:33:\"edit_published_aggregator-records\";b:1;s:25:\"delete_aggregator-records\";b:1;s:32:\"delete_others_aggregator-records\";b:1;s:33:\"delete_private_aggregator-records\";b:1;s:35:\"delete_published_aggregator-records\";b:1;s:26:\"publish_aggregator-records\";b:1;}}s:6:\"editor\";a:2:{s:4:\"name\";s:6:\"Editor\";s:12:\"capabilities\";a:74:{s:17:\"moderate_comments\";b:1;s:17:\"manage_categories\";b:1;s:12:\"manage_links\";b:1;s:12:\"upload_files\";b:1;s:15:\"unfiltered_html\";b:1;s:10:\"edit_posts\";b:1;s:17:\"edit_others_posts\";b:1;s:20:\"edit_published_posts\";b:1;s:13:\"publish_posts\";b:1;s:10:\"edit_pages\";b:1;s:4:\"read\";b:1;s:7:\"level_7\";b:1;s:7:\"level_6\";b:1;s:7:\"level_5\";b:1;s:7:\"level_4\";b:1;s:7:\"level_3\";b:1;s:7:\"level_2\";b:1;s:7:\"level_1\";b:1;s:7:\"level_0\";b:1;s:17:\"edit_others_pages\";b:1;s:20:\"edit_published_pages\";b:1;s:13:\"publish_pages\";b:1;s:12:\"delete_pages\";b:1;s:19:\"delete_others_pages\";b:1;s:22:\"delete_published_pages\";b:1;s:12:\"delete_posts\";b:1;s:19:\"delete_others_posts\";b:1;s:22:\"delete_published_posts\";b:1;s:20:\"delete_private_posts\";b:1;s:18:\"edit_private_posts\";b:1;s:18:\"read_private_posts\";b:1;s:20:\"delete_private_pages\";b:1;s:18:\"edit_private_pages\";b:1;s:18:\"read_private_pages\";b:1;s:25:\"read_private_tribe_events\";b:1;s:17:\"edit_tribe_events\";b:1;s:24:\"edit_others_tribe_events\";b:1;s:25:\"edit_private_tribe_events\";b:1;s:27:\"edit_published_tribe_events\";b:1;s:19:\"delete_tribe_events\";b:1;s:26:\"delete_others_tribe_events\";b:1;s:27:\"delete_private_tribe_events\";b:1;s:29:\"delete_published_tribe_events\";b:1;s:20:\"publish_tribe_events\";b:1;s:25:\"read_private_tribe_venues\";b:1;s:17:\"edit_tribe_venues\";b:1;s:24:\"edit_others_tribe_venues\";b:1;s:25:\"edit_private_tribe_venues\";b:1;s:27:\"edit_published_tribe_venues\";b:1;s:19:\"delete_tribe_venues\";b:1;s:26:\"delete_others_tribe_venues\";b:1;s:27:\"delete_private_tribe_venues\";b:1;s:29:\"delete_published_tribe_venues\";b:1;s:20:\"publish_tribe_venues\";b:1;s:29:\"read_private_tribe_organizers\";b:1;s:21:\"edit_tribe_organizers\";b:1;s:28:\"edit_others_tribe_organizers\";b:1;s:29:\"edit_private_tribe_organizers\";b:1;s:31:\"edit_published_tribe_organizers\";b:1;s:23:\"delete_tribe_organizers\";b:1;s:30:\"delete_others_tribe_organizers\";b:1;s:31:\"delete_private_tribe_organizers\";b:1;s:33:\"delete_published_tribe_organizers\";b:1;s:24:\"publish_tribe_organizers\";b:1;s:31:\"read_private_aggregator-records\";b:1;s:23:\"edit_aggregator-records\";b:1;s:30:\"edit_others_aggregator-records\";b:1;s:31:\"edit_private_aggregator-records\";b:1;s:33:\"edit_published_aggregator-records\";b:1;s:25:\"delete_aggregator-records\";b:1;s:32:\"delete_others_aggregator-records\";b:1;s:33:\"delete_private_aggregator-records\";b:1;s:35:\"delete_published_aggregator-records\";b:1;s:26:\"publish_aggregator-records\";b:1;}}s:6:\"author\";a:2:{s:4:\"name\";s:6:\"Author\";s:12:\"capabilities\";a:30:{s:12:\"upload_files\";b:1;s:10:\"edit_posts\";b:1;s:20:\"edit_published_posts\";b:1;s:13:\"publish_posts\";b:1;s:4:\"read\";b:1;s:7:\"level_2\";b:1;s:7:\"level_1\";b:1;s:7:\"level_0\";b:1;s:12:\"delete_posts\";b:1;s:22:\"delete_published_posts\";b:1;s:17:\"edit_tribe_events\";b:1;s:27:\"edit_published_tribe_events\";b:1;s:19:\"delete_tribe_events\";b:1;s:29:\"delete_published_tribe_events\";b:1;s:20:\"publish_tribe_events\";b:1;s:17:\"edit_tribe_venues\";b:1;s:27:\"edit_published_tribe_venues\";b:1;s:19:\"delete_tribe_venues\";b:1;s:29:\"delete_published_tribe_venues\";b:1;s:20:\"publish_tribe_venues\";b:1;s:21:\"edit_tribe_organizers\";b:1;s:31:\"edit_published_tribe_organizers\";b:1;s:23:\"delete_tribe_organizers\";b:1;s:33:\"delete_published_tribe_organizers\";b:1;s:24:\"publish_tribe_organizers\";b:1;s:23:\"edit_aggregator-records\";b:1;s:33:\"edit_published_aggregator-records\";b:1;s:25:\"delete_aggregator-records\";b:1;s:35:\"delete_published_aggregator-records\";b:1;s:26:\"publish_aggregator-records\";b:1;}}s:11:\"contributor\";a:2:{s:4:\"name\";s:11:\"Contributor\";s:12:\"capabilities\";a:13:{s:10:\"edit_posts\";b:1;s:4:\"read\";b:1;s:7:\"level_1\";b:1;s:7:\"level_0\";b:1;s:12:\"delete_posts\";b:1;s:17:\"edit_tribe_events\";b:1;s:19:\"delete_tribe_events\";b:1;s:17:\"edit_tribe_venues\";b:1;s:19:\"delete_tribe_venues\";b:1;s:21:\"edit_tribe_organizers\";b:1;s:23:\"delete_tribe_organizers\";b:1;s:23:\"edit_aggregator-records\";b:1;s:25:\"delete_aggregator-records\";b:1;}}s:10:\"subscriber\";a:2:{s:4:\"name\";s:10:\"Subscriber\";s:12:\"capabilities\";a:2:{s:4:\"read\";b:1;s:7:\"level_0\";b:1;}}}','yes'),(101,'fresh_site','1','yes'),(102,'user_count','1','no'),(103,'widget_block','a:6:{i:2;a:1:{s:7:\"content\";s:19:\"\";}i:3;a:1:{s:7:\"content\";s:154:\"

Recent Posts

\";}i:4;a:1:{s:7:\"content\";s:227:\"

Recent Comments

\";}i:5;a:1:{s:7:\"content\";s:146:\"

Archives

\";}i:6;a:1:{s:7:\"content\";s:150:\"

Categories

\";}s:12:\"_multiwidget\";i:1;}','yes'),(104,'sidebars_widgets','a:2:{s:19:\"wp_inactive_widgets\";a:5:{i:0;s:7:\"block-2\";i:1;s:7:\"block-3\";i:2;s:7:\"block-4\";i:3;s:7:\"block-5\";i:4;s:7:\"block-6\";}s:13:\"array_version\";i:3;}','yes'),(105,'cron','a:7:{i:1680011715;a:5:{s:32:\"recovery_mode_clean_expired_keys\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:5:\"daily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:86400;}}s:34:\"wp_privacy_delete_old_export_files\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:6:\"hourly\";s:4:\"args\";a:0:{}s:8:\"interval\";i:3600;}}s:16:\"wp_version_check\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:10:\"twicedaily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:43200;}}s:17:\"wp_update_plugins\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:10:\"twicedaily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:43200;}}s:16:\"wp_update_themes\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:10:\"twicedaily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:43200;}}}i:1680011801;a:3:{s:30:\"tribe_schedule_transient_purge\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:10:\"twicedaily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:43200;}}s:16:\"tribe_daily_cron\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:5:\"daily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:86400;}}s:26:\"tribe_tickets_migrate_4_12\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:6:\"hourly\";s:4:\"args\";a:0:{}s:8:\"interval\";i:3600;}}}i:1680098115;a:1:{s:30:\"wp_site_health_scheduled_check\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:6:\"weekly\";s:4:\"args\";a:0:{}s:8:\"interval\";i:604800;}}}i:1680098201;a:1:{s:24:\"tribe_common_log_cleanup\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:5:\"daily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:86400;}}}i:1687425476;a:1:{s:21:\"tribe-recurrence-cron\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:5:\"daily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:86400;}}}i:1692276901;a:1:{s:26:\"action_scheduler_run_queue\";a:1:{s:32:\"0d04ed39571b55704c122d726248bbac\";a:3:{s:8:\"schedule\";s:12:\"every_minute\";s:4:\"args\";a:1:{i:0;s:7:\"WP Cron\";}s:8:\"interval\";i:60;}}}s:7:\"version\";i:2;}','yes'),(106,'widget_pages','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(107,'widget_calendar','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(108,'widget_archives','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(109,'widget_media_audio','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(110,'widget_media_image','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(111,'widget_media_gallery','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(112,'widget_media_video','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(113,'widget_meta','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(114,'widget_search','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(115,'widget_tag_cloud','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(116,'widget_nav_menu','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(117,'widget_custom_html','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(118,'_transient_doing_cron','1700233725.4340300559997558593750','yes'),(121,'_site_transient_update_themes','O:8:\"stdClass\":5:{s:12:\"last_checked\";i:1680011726;s:7:\"checked\";a:3:{s:12:\"twentytwenty\";s:3:\"2.0\";s:15:\"twentytwentyone\";s:3:\"1.6\";s:15:\"twentytwentytwo\";s:3:\"1.2\";}s:8:\"response\";a:3:{s:12:\"twentytwenty\";a:6:{s:5:\"theme\";s:12:\"twentytwenty\";s:11:\"new_version\";s:3:\"2.1\";s:3:\"url\";s:42:\"https://wordpress.org/themes/twentytwenty/\";s:7:\"package\";s:58:\"https://downloads.wordpress.org/theme/twentytwenty.2.1.zip\";s:8:\"requires\";s:3:\"4.7\";s:12:\"requires_php\";s:5:\"5.2.4\";}s:15:\"twentytwentyone\";a:6:{s:5:\"theme\";s:15:\"twentytwentyone\";s:11:\"new_version\";s:3:\"1.7\";s:3:\"url\";s:45:\"https://wordpress.org/themes/twentytwentyone/\";s:7:\"package\";s:61:\"https://downloads.wordpress.org/theme/twentytwentyone.1.7.zip\";s:8:\"requires\";s:3:\"5.3\";s:12:\"requires_php\";s:3:\"5.6\";}s:15:\"twentytwentytwo\";a:6:{s:5:\"theme\";s:15:\"twentytwentytwo\";s:11:\"new_version\";s:3:\"1.3\";s:3:\"url\";s:45:\"https://wordpress.org/themes/twentytwentytwo/\";s:7:\"package\";s:61:\"https://downloads.wordpress.org/theme/twentytwentytwo.1.3.zip\";s:8:\"requires\";s:3:\"5.9\";s:12:\"requires_php\";s:3:\"5.6\";}}s:9:\"no_update\";a:0:{}s:12:\"translations\";a:0:{}}','no'),(124,'tribe_last_updated_option','1700233729.9088','yes'),(125,'tribe_events_calendar_options','a:14:{s:25:\"ticket-enabled-post-types\";a:2:{i:0;s:12:\"tribe_events\";i:1;s:4:\"page\";}s:28:\"event-tickets-schema-version\";s:9:\"6.0.0-dev\";s:31:\"previous_event_tickets_versions\";a:1:{i:0;s:1:\"0\";}s:28:\"latest_event_tickets_version\";s:9:\"6.0.0-dev\";s:8:\"did_init\";b:1;s:19:\"tribeEventsTemplate\";s:0:\"\";s:16:\"tribeEnableViews\";a:3:{i:0;s:4:\"list\";i:1;s:5:\"month\";i:2;s:3:\"day\";}s:10:\"viewOption\";s:4:\"list\";s:14:\"schema-version\";s:9:\"6.3.0-dev\";s:21:\"previous_ecp_versions\";a:2:{i:0;s:1:\"0\";i:1;s:5:\"6.1.1\";}s:18:\"latest_ecp_version\";s:9:\"6.3.0-dev\";s:18:\"dateWithYearFormat\";s:6:\"F j, Y\";s:24:\"recurrenceMaxMonthsAfter\";i:60;s:22:\"google_maps_js_api_key\";s:39:\"AIzaSyDNsicAsP6-VuGtAb1O9riI3oc_NOb7IOU\";}','yes'),(126,'tec_recurring_tickets_active','1','yes'),(127,'widget_recent-posts','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(128,'widget_recent-comments','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(132,'tec_ct1_migration_state','a:3:{s:18:\"complete_timestamp\";N;s:5:\"phase\";s:22:\"migration-not-required\";s:19:\"preview_unsupported\";b:0;}','yes'),(133,'tec_ct1_series_relationship_table_schema_version','1.0.0','yes'),(134,'tec_ct1_events_table_schema_version','1.0.1','yes'),(135,'tec_ct1_occurrences_table_schema_version','1.0.2','yes'),(136,'tec_ct1_events_field_schema_version','1.0.1','yes'),(137,'tec_ct1_occurrences_field_schema_version','1.0.1','yes'),(140,'_transient_tec_custom_tables_v1_ecp_initialized','1680098849','yes'),(141,'tec_custom_tables_v1_provisional_post_base_provisional_id','10000000','yes'),(142,'stellar_schema_version_tec-ft-ticket-groups','1.0.0','yes'),(143,'stellar_schema_version_tec-ft-posts-and-ticket-groups','1.0.0','yes'),(146,'tribe_last_save_post','1700233729.9089','yes'),(147,'widget_tribe-widget-events-list','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(148,'widget_tribe-widget-event-countdown','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(149,'widget_tribe-widget-featured-venue','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(150,'widget_tribe-widget-events-month','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(151,'widget_tribe-widget-events-week','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(152,'stellarwp_telemetry_last_send','','yes'),(153,'stellarwp_telemetry','a:1:{s:7:\"plugins\";a:1:{s:13:\"event-tickets\";a:2:{s:7:\"wp_slug\";s:31:\"event-tickets/event-tickets.php\";s:5:\"optin\";b:0;}}}','yes'),(154,'stellarwp_telemetry_event-tickets_show_optin','1','yes'),(155,'tec_timed_tec_custom_tables_v1_ecp_initialized','a:3:{s:3:\"key\";s:36:\"tec_custom_tables_v1_ecp_initialized\";s:5:\"value\";i:1;s:10:\"expiration\";i:1700320125;}','yes'),(156,'tec_timed_tec_custom_tables_v1_initialized','a:3:{s:3:\"key\";s:32:\"tec_custom_tables_v1_initialized\";s:5:\"value\";i:1;s:10:\"expiration\";i:1700320125;}','yes'),(159,'external_updates-events-calendar-pro','O:8:\"stdClass\":3:{s:9:\"lastCheck\";i:1687425483;s:14:\"checkedVersion\";s:5:\"6.1.0\";s:6:\"update\";O:19:\"Tribe__PUE__Utility\":11:{s:2:\"id\";i:0;s:6:\"plugin\";s:34:\"events-pro/events-calendar-pro.php\";s:4:\"slug\";s:19:\"events-calendar-pro\";s:7:\"version\";s:5:\"6.1.0\";s:8:\"homepage\";s:18:\"https://evnt.is/4d\";s:12:\"download_url\";s:301:\"https://pue.theeventscalendar.com/api/plugins/v2/download?plugin=events-calendar-pro&version=6.1.0&installed_version=6.1.0&domain=wordpress.test&multisite=0&network_activated=0&active_sites=1&wp_version=6.0.2&key=97f261bb1246e1c8ad0b7ace9ec6cb7764a09730&dk=97f261bb1246e1c8ad0b7ace9ec6cb7764a09730&o=e\";s:8:\"sections\";O:8:\"stdClass\":3:{s:11:\"description\";s:204:\"Events Calendar Pro is an extension to The Events Calendar, and includes recurring events, additional frontend views and more. To see a full feature list please visit the product page (http://evnt.is/4d).\";s:12:\"installation\";s:353:\"Installing Events Calendar Pro is easy: just back up your site, download/install The Events Calendar from the WordPress.org repo, and download/install Events Calendar Pro from theeventscalendar.com. Activate them both and you\'ll be good to go! If you\'re still confused or encounter problems, check out part 1 of our new user primer (http://m.tri.be/4i).\";s:9:\"changelog\";s:971:\"

= [6.1.0] 2023-06-14 =

\r\n
    \r\n
  • Version - Events Calendar PRO 6.1.0 is only compatible with The Events Calendar 6.1.0 and higher
  • \r\n
  • Feature - Replace Freemius with Telemetry - an in-house info system.
  • \r\n
  • Feature - Add plugin info to Site Health admin page.
  • \r\n
  • Fix - Ensure all the strings in the add event page are translatable. [ECP-1453]
  • \r\n
  • Fix - Ensure the `Use in Block Editor` option under `Events → Settings → Additional Fields` works as expected.
  • \r\n
  • Fix - Removing our eager schema updates. This was causing a number of `ALTER` statements being run redundantly. No longer utilizes cache/transient for the last run check as it is not dependable.
  • \r\n
  • Tweak - Updates title tags on events pages, to be more unique and search specific, taking on formats like \"Summary of Events from February 2, 2017 - February 3, 2019\".
  • \r\n
  • Language - 4 new strings added, 96 updated, 0 fuzzied, and 1 obsoleted
  • \r\n
\";}s:14:\"upgrade_notice\";s:0:\"\";s:13:\"custom_update\";O:8:\"stdClass\":1:{s:5:\"icons\";O:8:\"stdClass\":1:{s:3:\"svg\";s:84:\"https://theeventscalendar.com/content/themes/tribe-ecp/img/svg/product-icons/ECP.svg\";}}s:11:\"api_expired\";b:0;s:11:\"api_upgrade\";b:0;}}','no'),(160,'tribe_pue_key_notices','a:0:{}','yes'),(161,'_site_transient_update_plugins','O:8:\"stdClass\":4:{s:12:\"last_checked\";i:1687425481;s:8:\"response\";a:1:{s:19:\"akismet/akismet.php\";O:8:\"stdClass\":12:{s:2:\"id\";s:21:\"w.org/plugins/akismet\";s:4:\"slug\";s:7:\"akismet\";s:6:\"plugin\";s:19:\"akismet/akismet.php\";s:11:\"new_version\";s:3:\"5.2\";s:3:\"url\";s:38:\"https://wordpress.org/plugins/akismet/\";s:7:\"package\";s:54:\"https://downloads.wordpress.org/plugin/akismet.5.2.zip\";s:5:\"icons\";a:2:{s:2:\"2x\";s:60:\"https://ps.w.org/akismet/assets/icon-256x256.png?rev=2818463\";s:2:\"1x\";s:60:\"https://ps.w.org/akismet/assets/icon-128x128.png?rev=2818463\";}s:7:\"banners\";a:2:{s:2:\"2x\";s:63:\"https://ps.w.org/akismet/assets/banner-1544x500.png?rev=2900731\";s:2:\"1x\";s:62:\"https://ps.w.org/akismet/assets/banner-772x250.png?rev=2900731\";}s:11:\"banners_rtl\";a:0:{}s:8:\"requires\";s:3:\"5.8\";s:6:\"tested\";s:5:\"6.2.2\";s:12:\"requires_php\";s:6:\"5.6.20\";}}s:12:\"translations\";a:0:{}s:9:\"no_update\";a:10:{s:35:\"advanced-post-manager/tribe-apm.php\";O:8:\"stdClass\":10:{s:2:\"id\";s:35:\"w.org/plugins/advanced-post-manager\";s:4:\"slug\";s:21:\"advanced-post-manager\";s:6:\"plugin\";s:35:\"advanced-post-manager/tribe-apm.php\";s:11:\"new_version\";s:5:\"4.5.4\";s:3:\"url\";s:52:\"https://wordpress.org/plugins/advanced-post-manager/\";s:7:\"package\";s:70:\"https://downloads.wordpress.org/plugin/advanced-post-manager.4.5.4.zip\";s:5:\"icons\";a:1:{s:7:\"default\";s:72:\"https://s.w.org/plugins/geopattern-icon/advanced-post-manager_66b8d2.svg\";}s:7:\"banners\";a:2:{s:2:\"2x\";s:76:\"https://ps.w.org/advanced-post-manager/assets/banner-1544x500.jpg?rev=593014\";s:2:\"1x\";s:75:\"https://ps.w.org/advanced-post-manager/assets/banner-772x250.png?rev=517740\";}s:11:\"banners_rtl\";a:0:{}s:8:\"requires\";s:3:\"5.7\";}s:23:\"debug-bar/debug-bar.php\";O:8:\"stdClass\":10:{s:2:\"id\";s:23:\"w.org/plugins/debug-bar\";s:4:\"slug\";s:9:\"debug-bar\";s:6:\"plugin\";s:23:\"debug-bar/debug-bar.php\";s:11:\"new_version\";s:5:\"1.1.4\";s:3:\"url\";s:40:\"https://wordpress.org/plugins/debug-bar/\";s:7:\"package\";s:58:\"https://downloads.wordpress.org/plugin/debug-bar.1.1.4.zip\";s:5:\"icons\";a:2:{s:2:\"1x\";s:54:\"https://ps.w.org/debug-bar/assets/icon.svg?rev=1908362\";s:3:\"svg\";s:54:\"https://ps.w.org/debug-bar/assets/icon.svg?rev=1908362\";}s:7:\"banners\";a:2:{s:2:\"2x\";s:65:\"https://ps.w.org/debug-bar/assets/banner-1544x500.png?rev=1365496\";s:2:\"1x\";s:64:\"https://ps.w.org/debug-bar/assets/banner-772x250.png?rev=1365496\";}s:11:\"banners_rtl\";a:0:{}s:8:\"requires\";s:3:\"3.4\";}s:49:\"easy-digital-downloads/easy-digital-downloads.php\";O:8:\"stdClass\":10:{s:2:\"id\";s:36:\"w.org/plugins/easy-digital-downloads\";s:4:\"slug\";s:22:\"easy-digital-downloads\";s:6:\"plugin\";s:49:\"easy-digital-downloads/easy-digital-downloads.php\";s:11:\"new_version\";s:5:\"3.1.2\";s:3:\"url\";s:53:\"https://wordpress.org/plugins/easy-digital-downloads/\";s:7:\"package\";s:71:\"https://downloads.wordpress.org/plugin/easy-digital-downloads.3.1.2.zip\";s:5:\"icons\";a:2:{s:2:\"1x\";s:66:\"https://ps.w.org/easy-digital-downloads/assets/icon.svg?rev=971968\";s:3:\"svg\";s:66:\"https://ps.w.org/easy-digital-downloads/assets/icon.svg?rev=971968\";}s:7:\"banners\";a:2:{s:2:\"2x\";s:78:\"https://ps.w.org/easy-digital-downloads/assets/banner-1544x500.png?rev=2636140\";s:2:\"1x\";s:77:\"https://ps.w.org/easy-digital-downloads/assets/banner-772x250.png?rev=2636140\";}s:11:\"banners_rtl\";a:0:{}s:8:\"requires\";s:3:\"5.4\";}s:31:\"event-tickets/event-tickets.php\";O:8:\"stdClass\":10:{s:2:\"id\";s:27:\"w.org/plugins/event-tickets\";s:4:\"slug\";s:13:\"event-tickets\";s:6:\"plugin\";s:31:\"event-tickets/event-tickets.php\";s:11:\"new_version\";s:7:\"5.6.0.2\";s:3:\"url\";s:44:\"https://wordpress.org/plugins/event-tickets/\";s:7:\"package\";s:64:\"https://downloads.wordpress.org/plugin/event-tickets.5.6.0.2.zip\";s:5:\"icons\";a:2:{s:2:\"1x\";s:58:\"https://ps.w.org/event-tickets/assets/icon.svg?rev=2259340\";s:3:\"svg\";s:58:\"https://ps.w.org/event-tickets/assets/icon.svg?rev=2259340\";}s:7:\"banners\";a:2:{s:2:\"2x\";s:69:\"https://ps.w.org/event-tickets/assets/banner-1544x500.png?rev=2257626\";s:2:\"1x\";s:68:\"https://ps.w.org/event-tickets/assets/banner-772x250.png?rev=2257626\";}s:11:\"banners_rtl\";a:0:{}s:8:\"requires\";s:5:\"5.8.5\";}s:9:\"hello.php\";O:8:\"stdClass\":10:{s:2:\"id\";s:25:\"w.org/plugins/hello-dolly\";s:4:\"slug\";s:11:\"hello-dolly\";s:6:\"plugin\";s:9:\"hello.php\";s:11:\"new_version\";s:5:\"1.7.2\";s:3:\"url\";s:42:\"https://wordpress.org/plugins/hello-dolly/\";s:7:\"package\";s:60:\"https://downloads.wordpress.org/plugin/hello-dolly.1.7.2.zip\";s:5:\"icons\";a:2:{s:2:\"2x\";s:64:\"https://ps.w.org/hello-dolly/assets/icon-256x256.jpg?rev=2052855\";s:2:\"1x\";s:64:\"https://ps.w.org/hello-dolly/assets/icon-128x128.jpg?rev=2052855\";}s:7:\"banners\";a:2:{s:2:\"2x\";s:67:\"https://ps.w.org/hello-dolly/assets/banner-1544x500.jpg?rev=2645582\";s:2:\"1x\";s:66:\"https://ps.w.org/hello-dolly/assets/banner-772x250.jpg?rev=2052855\";}s:11:\"banners_rtl\";a:0:{}s:8:\"requires\";s:3:\"4.6\";}s:31:\"query-monitor/query-monitor.php\";O:8:\"stdClass\":10:{s:2:\"id\";s:27:\"w.org/plugins/query-monitor\";s:4:\"slug\";s:13:\"query-monitor\";s:6:\"plugin\";s:31:\"query-monitor/query-monitor.php\";s:11:\"new_version\";s:6:\"3.12.3\";s:3:\"url\";s:44:\"https://wordpress.org/plugins/query-monitor/\";s:7:\"package\";s:63:\"https://downloads.wordpress.org/plugin/query-monitor.3.12.3.zip\";s:5:\"icons\";a:2:{s:2:\"1x\";s:58:\"https://ps.w.org/query-monitor/assets/icon.svg?rev=2870124\";s:3:\"svg\";s:58:\"https://ps.w.org/query-monitor/assets/icon.svg?rev=2870124\";}s:7:\"banners\";a:2:{s:2:\"2x\";s:69:\"https://ps.w.org/query-monitor/assets/banner-1544x500.png?rev=2870124\";s:2:\"1x\";s:68:\"https://ps.w.org/query-monitor/assets/banner-772x250.png?rev=2457098\";}s:11:\"banners_rtl\";a:0:{}s:8:\"requires\";s:3:\"5.2\";}s:27:\"redis-cache/redis-cache.php\";O:8:\"stdClass\":10:{s:2:\"id\";s:25:\"w.org/plugins/redis-cache\";s:4:\"slug\";s:11:\"redis-cache\";s:6:\"plugin\";s:27:\"redis-cache/redis-cache.php\";s:11:\"new_version\";s:5:\"2.4.1\";s:3:\"url\";s:42:\"https://wordpress.org/plugins/redis-cache/\";s:7:\"package\";s:60:\"https://downloads.wordpress.org/plugin/redis-cache.2.4.1.zip\";s:5:\"icons\";a:2:{s:2:\"2x\";s:64:\"https://ps.w.org/redis-cache/assets/icon-256x256.gif?rev=2568513\";s:2:\"1x\";s:64:\"https://ps.w.org/redis-cache/assets/icon-128x128.gif?rev=2568513\";}s:7:\"banners\";a:2:{s:2:\"2x\";s:67:\"https://ps.w.org/redis-cache/assets/banner-1544x500.png?rev=2315420\";s:2:\"1x\";s:66:\"https://ps.w.org/redis-cache/assets/banner-772x250.png?rev=2315420\";}s:11:\"banners_rtl\";a:0:{}s:8:\"requires\";s:3:\"3.3\";}s:51:\"rewrite-rules-inspector/rewrite-rules-inspector.php\";O:8:\"stdClass\":10:{s:2:\"id\";s:37:\"w.org/plugins/rewrite-rules-inspector\";s:4:\"slug\";s:23:\"rewrite-rules-inspector\";s:6:\"plugin\";s:51:\"rewrite-rules-inspector/rewrite-rules-inspector.php\";s:11:\"new_version\";s:5:\"1.3.1\";s:3:\"url\";s:54:\"https://wordpress.org/plugins/rewrite-rules-inspector/\";s:7:\"package\";s:72:\"https://downloads.wordpress.org/plugin/rewrite-rules-inspector.1.3.1.zip\";s:5:\"icons\";a:1:{s:7:\"default\";s:74:\"https://s.w.org/plugins/geopattern-icon/rewrite-rules-inspector_e2e3e4.svg\";}s:7:\"banners\";a:2:{s:2:\"2x\";s:79:\"https://ps.w.org/rewrite-rules-inspector/assets/banner-1544x500.png?rev=2533834\";s:2:\"1x\";s:78:\"https://ps.w.org/rewrite-rules-inspector/assets/banner-772x250.png?rev=2533843\";}s:11:\"banners_rtl\";a:0:{}s:8:\"requires\";s:3:\"3.1\";}s:43:\"the-events-calendar/the-events-calendar.php\";O:8:\"stdClass\":10:{s:2:\"id\";s:33:\"w.org/plugins/the-events-calendar\";s:4:\"slug\";s:19:\"the-events-calendar\";s:6:\"plugin\";s:43:\"the-events-calendar/the-events-calendar.php\";s:11:\"new_version\";s:5:\"6.1.1\";s:3:\"url\";s:50:\"https://wordpress.org/plugins/the-events-calendar/\";s:7:\"package\";s:68:\"https://downloads.wordpress.org/plugin/the-events-calendar.6.1.1.zip\";s:5:\"icons\";a:2:{s:2:\"2x\";s:72:\"https://ps.w.org/the-events-calendar/assets/icon-256x256.gif?rev=2516440\";s:2:\"1x\";s:72:\"https://ps.w.org/the-events-calendar/assets/icon-128x128.gif?rev=2516440\";}s:7:\"banners\";a:2:{s:2:\"2x\";s:75:\"https://ps.w.org/the-events-calendar/assets/banner-1544x500.png?rev=2257622\";s:2:\"1x\";s:74:\"https://ps.w.org/the-events-calendar/assets/banner-772x250.png?rev=2257622\";}s:11:\"banners_rtl\";a:0:{}s:8:\"requires\";s:5:\"5.8.6\";}s:27:\"woocommerce/woocommerce.php\";O:8:\"stdClass\":12:{s:2:\"id\";s:25:\"w.org/plugins/woocommerce\";s:4:\"slug\";s:11:\"woocommerce\";s:6:\"plugin\";s:27:\"woocommerce/woocommerce.php\";s:11:\"new_version\";s:5:\"7.8.0\";s:3:\"url\";s:42:\"https://wordpress.org/plugins/woocommerce/\";s:7:\"package\";s:60:\"https://downloads.wordpress.org/plugin/woocommerce.7.8.0.zip\";s:5:\"icons\";a:2:{s:2:\"2x\";s:64:\"https://ps.w.org/woocommerce/assets/icon-256x256.gif?rev=2869506\";s:2:\"1x\";s:64:\"https://ps.w.org/woocommerce/assets/icon-128x128.gif?rev=2869506\";}s:7:\"banners\";a:2:{s:2:\"2x\";s:67:\"https://ps.w.org/woocommerce/assets/banner-1544x500.png?rev=2366418\";s:2:\"1x\";s:66:\"https://ps.w.org/woocommerce/assets/banner-772x250.png?rev=2366418\";}s:11:\"banners_rtl\";a:0:{}s:8:\"requires\";s:3:\"6.1\";s:6:\"tested\";s:5:\"6.2.2\";s:12:\"requires_php\";s:3:\"7.3\";}}}','no'),(162,'schema-ActionScheduler_StoreSchema','7.0.1692276901','yes'),(163,'schema-ActionScheduler_LoggerSchema','3.0.1692276901','yes'),(172,'theme_mods_twentytwentytwo','a:1:{s:16:\"sidebars_widgets\";a:2:{s:4:\"time\";i:1692276901;s:4:\"data\";a:3:{s:19:\"wp_inactive_widgets\";a:0:{}s:9:\"sidebar-1\";a:3:{i:0;s:7:\"block-2\";i:1;s:7:\"block-3\";i:2;s:7:\"block-4\";}s:9:\"sidebar-2\";a:2:{i:0;s:7:\"block-5\";i:1;s:7:\"block-6\";}}}}','yes'),(173,'current_theme','Twenty Twenty','yes'),(174,'theme_switched','','yes'),(175,'_transient_timeout_as-post-store-dependencies-met','1700320125','no'),(176,'_transient_as-post-store-dependencies-met','yes','no'),(177,'theme_mods_twentytwenty','a:1:{s:18:\"nav_menu_locations\";a:0:{}}','yes'),(178,'_transient_timeout_tribe_events_series_flush_rewrite','1702825725','no'),(179,'_transient_tribe_events_series_flush_rewrite','1','no'),(180,'wp_attachment_pages_enabled','1','yes'),(181,'db_upgraded','1','yes'); +INSERT INTO `wp_options` VALUES (1,'siteurl','https://wordpress.test','yes'),(2,'home','https://wordpress.test','yes'),(3,'blogname','RT Smoketest','yes'),(4,'blogdescription','Just another WordPress site','yes'),(5,'users_can_register','0','yes'),(6,'admin_email','admin@wordpress.test','yes'),(7,'start_of_week','1','yes'),(8,'use_balanceTags','0','yes'),(9,'use_smilies','1','yes'),(10,'require_name_email','1','yes'),(11,'comments_notify','1','yes'),(12,'posts_per_rss','10','yes'),(13,'rss_use_excerpt','0','yes'),(14,'mailserver_url','mail.example.com','yes'),(15,'mailserver_login','login@example.com','yes'),(16,'mailserver_pass','password','yes'),(17,'mailserver_port','110','yes'),(18,'default_category','1','yes'),(19,'default_comment_status','open','yes'),(20,'default_ping_status','open','yes'),(21,'default_pingback_flag','1','yes'),(22,'posts_per_page','10','yes'),(23,'date_format','F j, Y','yes'),(24,'time_format','g:i a','yes'),(25,'links_updated_date_format','F j, Y g:i a','yes'),(26,'comment_moderation','0','yes'),(27,'moderation_notify','1','yes'),(28,'permalink_structure','','yes'),(29,'rewrite_rules','','yes'),(30,'hack_file','0','yes'),(31,'blog_charset','UTF-8','yes'),(32,'moderation_keys','','no'),(33,'active_plugins','a:3:{i:0;s:31:\"event-tickets/event-tickets.php\";i:1;s:34:\"events-pro/events-calendar-pro.php\";i:2;s:43:\"the-events-calendar/the-events-calendar.php\";}','yes'),(34,'category_base','','yes'),(35,'ping_sites','http://rpc.pingomatic.com/','yes'),(36,'comment_max_links','2','yes'),(37,'gmt_offset','0','yes'),(38,'default_email_category','1','yes'),(39,'recently_edited','','no'),(40,'template','twentytwenty','yes'),(41,'stylesheet','twentytwenty','yes'),(42,'comment_registration','0','yes'),(43,'html_type','text/html','yes'),(44,'use_trackback','0','yes'),(45,'default_role','subscriber','yes'),(46,'db_version','57155','yes'),(47,'uploads_use_yearmonth_folders','1','yes'),(48,'upload_path','','yes'),(49,'blog_public','1','yes'),(50,'default_link_category','2','yes'),(51,'show_on_front','posts','yes'),(52,'tag_base','','yes'),(53,'show_avatars','1','yes'),(54,'avatar_rating','G','yes'),(55,'upload_url_path','','yes'),(56,'thumbnail_size_w','150','yes'),(57,'thumbnail_size_h','150','yes'),(58,'thumbnail_crop','1','yes'),(59,'medium_size_w','300','yes'),(60,'medium_size_h','300','yes'),(61,'avatar_default','mystery','yes'),(62,'large_size_w','1024','yes'),(63,'large_size_h','1024','yes'),(64,'image_default_link_type','none','yes'),(65,'image_default_size','','yes'),(66,'image_default_align','','yes'),(67,'close_comments_for_old_posts','0','yes'),(68,'close_comments_days_old','14','yes'),(69,'thread_comments','1','yes'),(70,'thread_comments_depth','5','yes'),(71,'page_comments','0','yes'),(72,'comments_per_page','50','yes'),(73,'default_comments_page','newest','yes'),(74,'comment_order','asc','yes'),(75,'sticky_posts','a:0:{}','yes'),(76,'widget_categories','a:0:{}','yes'),(77,'widget_text','a:0:{}','yes'),(78,'widget_rss','a:0:{}','yes'),(79,'uninstall_plugins','a:0:{}','no'),(80,'timezone_string','America/New_York','yes'),(81,'page_for_posts','0','yes'),(82,'page_on_front','0','yes'),(83,'default_post_format','0','yes'),(84,'link_manager_enabled','0','yes'),(85,'finished_splitting_shared_terms','1','yes'),(86,'site_icon','0','yes'),(87,'medium_large_size_w','768','yes'),(88,'medium_large_size_h','0','yes'),(89,'wp_page_for_privacy_policy','3','yes'),(90,'show_comments_cookies_opt_in','1','yes'),(91,'admin_email_lifespan','1695563689','yes'),(92,'disallowed_keys','','no'),(93,'comment_previously_approved','1','yes'),(94,'auto_plugin_theme_update_emails','a:0:{}','no'),(95,'auto_update_core_dev','enabled','yes'),(96,'auto_update_core_minor','enabled','yes'),(97,'auto_update_core_major','enabled','yes'),(98,'wp_force_deactivated_plugins','a:0:{}','yes'),(99,'initial_db_version','53496','yes'),(100,'wp_user_roles','a:5:{s:13:\"administrator\";a:2:{s:4:\"name\";s:13:\"Administrator\";s:12:\"capabilities\";a:101:{s:13:\"switch_themes\";b:1;s:11:\"edit_themes\";b:1;s:16:\"activate_plugins\";b:1;s:12:\"edit_plugins\";b:1;s:10:\"edit_users\";b:1;s:10:\"edit_files\";b:1;s:14:\"manage_options\";b:1;s:17:\"moderate_comments\";b:1;s:17:\"manage_categories\";b:1;s:12:\"manage_links\";b:1;s:12:\"upload_files\";b:1;s:6:\"import\";b:1;s:15:\"unfiltered_html\";b:1;s:10:\"edit_posts\";b:1;s:17:\"edit_others_posts\";b:1;s:20:\"edit_published_posts\";b:1;s:13:\"publish_posts\";b:1;s:10:\"edit_pages\";b:1;s:4:\"read\";b:1;s:8:\"level_10\";b:1;s:7:\"level_9\";b:1;s:7:\"level_8\";b:1;s:7:\"level_7\";b:1;s:7:\"level_6\";b:1;s:7:\"level_5\";b:1;s:7:\"level_4\";b:1;s:7:\"level_3\";b:1;s:7:\"level_2\";b:1;s:7:\"level_1\";b:1;s:7:\"level_0\";b:1;s:17:\"edit_others_pages\";b:1;s:20:\"edit_published_pages\";b:1;s:13:\"publish_pages\";b:1;s:12:\"delete_pages\";b:1;s:19:\"delete_others_pages\";b:1;s:22:\"delete_published_pages\";b:1;s:12:\"delete_posts\";b:1;s:19:\"delete_others_posts\";b:1;s:22:\"delete_published_posts\";b:1;s:20:\"delete_private_posts\";b:1;s:18:\"edit_private_posts\";b:1;s:18:\"read_private_posts\";b:1;s:20:\"delete_private_pages\";b:1;s:18:\"edit_private_pages\";b:1;s:18:\"read_private_pages\";b:1;s:12:\"delete_users\";b:1;s:12:\"create_users\";b:1;s:17:\"unfiltered_upload\";b:1;s:14:\"edit_dashboard\";b:1;s:14:\"update_plugins\";b:1;s:14:\"delete_plugins\";b:1;s:15:\"install_plugins\";b:1;s:13:\"update_themes\";b:1;s:14:\"install_themes\";b:1;s:11:\"update_core\";b:1;s:10:\"list_users\";b:1;s:12:\"remove_users\";b:1;s:13:\"promote_users\";b:1;s:18:\"edit_theme_options\";b:1;s:13:\"delete_themes\";b:1;s:6:\"export\";b:1;s:25:\"read_private_tribe_events\";b:1;s:17:\"edit_tribe_events\";b:1;s:24:\"edit_others_tribe_events\";b:1;s:25:\"edit_private_tribe_events\";b:1;s:27:\"edit_published_tribe_events\";b:1;s:19:\"delete_tribe_events\";b:1;s:26:\"delete_others_tribe_events\";b:1;s:27:\"delete_private_tribe_events\";b:1;s:29:\"delete_published_tribe_events\";b:1;s:20:\"publish_tribe_events\";b:1;s:25:\"read_private_tribe_venues\";b:1;s:17:\"edit_tribe_venues\";b:1;s:24:\"edit_others_tribe_venues\";b:1;s:25:\"edit_private_tribe_venues\";b:1;s:27:\"edit_published_tribe_venues\";b:1;s:19:\"delete_tribe_venues\";b:1;s:26:\"delete_others_tribe_venues\";b:1;s:27:\"delete_private_tribe_venues\";b:1;s:29:\"delete_published_tribe_venues\";b:1;s:20:\"publish_tribe_venues\";b:1;s:29:\"read_private_tribe_organizers\";b:1;s:21:\"edit_tribe_organizers\";b:1;s:28:\"edit_others_tribe_organizers\";b:1;s:29:\"edit_private_tribe_organizers\";b:1;s:31:\"edit_published_tribe_organizers\";b:1;s:23:\"delete_tribe_organizers\";b:1;s:30:\"delete_others_tribe_organizers\";b:1;s:31:\"delete_private_tribe_organizers\";b:1;s:33:\"delete_published_tribe_organizers\";b:1;s:24:\"publish_tribe_organizers\";b:1;s:31:\"read_private_aggregator-records\";b:1;s:23:\"edit_aggregator-records\";b:1;s:30:\"edit_others_aggregator-records\";b:1;s:31:\"edit_private_aggregator-records\";b:1;s:33:\"edit_published_aggregator-records\";b:1;s:25:\"delete_aggregator-records\";b:1;s:32:\"delete_others_aggregator-records\";b:1;s:33:\"delete_private_aggregator-records\";b:1;s:35:\"delete_published_aggregator-records\";b:1;s:26:\"publish_aggregator-records\";b:1;}}s:6:\"editor\";a:2:{s:4:\"name\";s:6:\"Editor\";s:12:\"capabilities\";a:74:{s:17:\"moderate_comments\";b:1;s:17:\"manage_categories\";b:1;s:12:\"manage_links\";b:1;s:12:\"upload_files\";b:1;s:15:\"unfiltered_html\";b:1;s:10:\"edit_posts\";b:1;s:17:\"edit_others_posts\";b:1;s:20:\"edit_published_posts\";b:1;s:13:\"publish_posts\";b:1;s:10:\"edit_pages\";b:1;s:4:\"read\";b:1;s:7:\"level_7\";b:1;s:7:\"level_6\";b:1;s:7:\"level_5\";b:1;s:7:\"level_4\";b:1;s:7:\"level_3\";b:1;s:7:\"level_2\";b:1;s:7:\"level_1\";b:1;s:7:\"level_0\";b:1;s:17:\"edit_others_pages\";b:1;s:20:\"edit_published_pages\";b:1;s:13:\"publish_pages\";b:1;s:12:\"delete_pages\";b:1;s:19:\"delete_others_pages\";b:1;s:22:\"delete_published_pages\";b:1;s:12:\"delete_posts\";b:1;s:19:\"delete_others_posts\";b:1;s:22:\"delete_published_posts\";b:1;s:20:\"delete_private_posts\";b:1;s:18:\"edit_private_posts\";b:1;s:18:\"read_private_posts\";b:1;s:20:\"delete_private_pages\";b:1;s:18:\"edit_private_pages\";b:1;s:18:\"read_private_pages\";b:1;s:25:\"read_private_tribe_events\";b:1;s:17:\"edit_tribe_events\";b:1;s:24:\"edit_others_tribe_events\";b:1;s:25:\"edit_private_tribe_events\";b:1;s:27:\"edit_published_tribe_events\";b:1;s:19:\"delete_tribe_events\";b:1;s:26:\"delete_others_tribe_events\";b:1;s:27:\"delete_private_tribe_events\";b:1;s:29:\"delete_published_tribe_events\";b:1;s:20:\"publish_tribe_events\";b:1;s:25:\"read_private_tribe_venues\";b:1;s:17:\"edit_tribe_venues\";b:1;s:24:\"edit_others_tribe_venues\";b:1;s:25:\"edit_private_tribe_venues\";b:1;s:27:\"edit_published_tribe_venues\";b:1;s:19:\"delete_tribe_venues\";b:1;s:26:\"delete_others_tribe_venues\";b:1;s:27:\"delete_private_tribe_venues\";b:1;s:29:\"delete_published_tribe_venues\";b:1;s:20:\"publish_tribe_venues\";b:1;s:29:\"read_private_tribe_organizers\";b:1;s:21:\"edit_tribe_organizers\";b:1;s:28:\"edit_others_tribe_organizers\";b:1;s:29:\"edit_private_tribe_organizers\";b:1;s:31:\"edit_published_tribe_organizers\";b:1;s:23:\"delete_tribe_organizers\";b:1;s:30:\"delete_others_tribe_organizers\";b:1;s:31:\"delete_private_tribe_organizers\";b:1;s:33:\"delete_published_tribe_organizers\";b:1;s:24:\"publish_tribe_organizers\";b:1;s:31:\"read_private_aggregator-records\";b:1;s:23:\"edit_aggregator-records\";b:1;s:30:\"edit_others_aggregator-records\";b:1;s:31:\"edit_private_aggregator-records\";b:1;s:33:\"edit_published_aggregator-records\";b:1;s:25:\"delete_aggregator-records\";b:1;s:32:\"delete_others_aggregator-records\";b:1;s:33:\"delete_private_aggregator-records\";b:1;s:35:\"delete_published_aggregator-records\";b:1;s:26:\"publish_aggregator-records\";b:1;}}s:6:\"author\";a:2:{s:4:\"name\";s:6:\"Author\";s:12:\"capabilities\";a:30:{s:12:\"upload_files\";b:1;s:10:\"edit_posts\";b:1;s:20:\"edit_published_posts\";b:1;s:13:\"publish_posts\";b:1;s:4:\"read\";b:1;s:7:\"level_2\";b:1;s:7:\"level_1\";b:1;s:7:\"level_0\";b:1;s:12:\"delete_posts\";b:1;s:22:\"delete_published_posts\";b:1;s:17:\"edit_tribe_events\";b:1;s:27:\"edit_published_tribe_events\";b:1;s:19:\"delete_tribe_events\";b:1;s:29:\"delete_published_tribe_events\";b:1;s:20:\"publish_tribe_events\";b:1;s:17:\"edit_tribe_venues\";b:1;s:27:\"edit_published_tribe_venues\";b:1;s:19:\"delete_tribe_venues\";b:1;s:29:\"delete_published_tribe_venues\";b:1;s:20:\"publish_tribe_venues\";b:1;s:21:\"edit_tribe_organizers\";b:1;s:31:\"edit_published_tribe_organizers\";b:1;s:23:\"delete_tribe_organizers\";b:1;s:33:\"delete_published_tribe_organizers\";b:1;s:24:\"publish_tribe_organizers\";b:1;s:23:\"edit_aggregator-records\";b:1;s:33:\"edit_published_aggregator-records\";b:1;s:25:\"delete_aggregator-records\";b:1;s:35:\"delete_published_aggregator-records\";b:1;s:26:\"publish_aggregator-records\";b:1;}}s:11:\"contributor\";a:2:{s:4:\"name\";s:11:\"Contributor\";s:12:\"capabilities\";a:13:{s:10:\"edit_posts\";b:1;s:4:\"read\";b:1;s:7:\"level_1\";b:1;s:7:\"level_0\";b:1;s:12:\"delete_posts\";b:1;s:17:\"edit_tribe_events\";b:1;s:19:\"delete_tribe_events\";b:1;s:17:\"edit_tribe_venues\";b:1;s:19:\"delete_tribe_venues\";b:1;s:21:\"edit_tribe_organizers\";b:1;s:23:\"delete_tribe_organizers\";b:1;s:23:\"edit_aggregator-records\";b:1;s:25:\"delete_aggregator-records\";b:1;}}s:10:\"subscriber\";a:2:{s:4:\"name\";s:10:\"Subscriber\";s:12:\"capabilities\";a:2:{s:4:\"read\";b:1;s:7:\"level_0\";b:1;}}}','yes'),(101,'fresh_site','1','yes'),(102,'user_count','1','no'),(103,'widget_block','a:6:{i:2;a:1:{s:7:\"content\";s:19:\"\";}i:3;a:1:{s:7:\"content\";s:154:\"

Recent Posts

\";}i:4;a:1:{s:7:\"content\";s:227:\"

Recent Comments

\";}i:5;a:1:{s:7:\"content\";s:146:\"

Archives

\";}i:6;a:1:{s:7:\"content\";s:150:\"

Categories

\";}s:12:\"_multiwidget\";i:1;}','yes'),(104,'sidebars_widgets','a:2:{s:19:\"wp_inactive_widgets\";a:5:{i:0;s:7:\"block-2\";i:1;s:7:\"block-3\";i:2;s:7:\"block-4\";i:3;s:7:\"block-5\";i:4;s:7:\"block-6\";}s:13:\"array_version\";i:3;}','yes'),(105,'cron','a:7:{i:1680011715;a:5:{s:32:\"recovery_mode_clean_expired_keys\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:5:\"daily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:86400;}}s:34:\"wp_privacy_delete_old_export_files\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:6:\"hourly\";s:4:\"args\";a:0:{}s:8:\"interval\";i:3600;}}s:16:\"wp_version_check\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:10:\"twicedaily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:43200;}}s:17:\"wp_update_plugins\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:10:\"twicedaily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:43200;}}s:16:\"wp_update_themes\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:10:\"twicedaily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:43200;}}}i:1680011801;a:3:{s:30:\"tribe_schedule_transient_purge\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:10:\"twicedaily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:43200;}}s:16:\"tribe_daily_cron\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:5:\"daily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:86400;}}s:26:\"tribe_tickets_migrate_4_12\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:6:\"hourly\";s:4:\"args\";a:0:{}s:8:\"interval\";i:3600;}}}i:1680098115;a:1:{s:30:\"wp_site_health_scheduled_check\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:6:\"weekly\";s:4:\"args\";a:0:{}s:8:\"interval\";i:604800;}}}i:1680098201;a:1:{s:24:\"tribe_common_log_cleanup\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:5:\"daily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:86400;}}}i:1687425476;a:1:{s:21:\"tribe-recurrence-cron\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:5:\"daily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:86400;}}}i:1692276901;a:1:{s:26:\"action_scheduler_run_queue\";a:1:{s:32:\"0d04ed39571b55704c122d726248bbac\";a:3:{s:8:\"schedule\";s:12:\"every_minute\";s:4:\"args\";a:1:{i:0;s:7:\"WP Cron\";}s:8:\"interval\";i:60;}}}s:7:\"version\";i:2;}','yes'),(106,'widget_pages','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(107,'widget_calendar','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(108,'widget_archives','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(109,'widget_media_audio','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(110,'widget_media_image','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(111,'widget_media_gallery','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(112,'widget_media_video','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(113,'widget_meta','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(114,'widget_search','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(115,'widget_tag_cloud','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(116,'widget_nav_menu','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(117,'widget_custom_html','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(118,'_transient_doing_cron','1700233725.4340300559997558593750','yes'),(121,'_site_transient_update_themes','O:8:\"stdClass\":5:{s:12:\"last_checked\";i:1680011726;s:7:\"checked\";a:3:{s:12:\"twentytwenty\";s:3:\"2.0\";s:15:\"twentytwentyone\";s:3:\"1.6\";s:15:\"twentytwentytwo\";s:3:\"1.2\";}s:8:\"response\";a:3:{s:12:\"twentytwenty\";a:6:{s:5:\"theme\";s:12:\"twentytwenty\";s:11:\"new_version\";s:3:\"2.1\";s:3:\"url\";s:42:\"https://wordpress.org/themes/twentytwenty/\";s:7:\"package\";s:58:\"https://downloads.wordpress.org/theme/twentytwenty.2.1.zip\";s:8:\"requires\";s:3:\"4.7\";s:12:\"requires_php\";s:5:\"5.2.4\";}s:15:\"twentytwentyone\";a:6:{s:5:\"theme\";s:15:\"twentytwentyone\";s:11:\"new_version\";s:3:\"1.7\";s:3:\"url\";s:45:\"https://wordpress.org/themes/twentytwentyone/\";s:7:\"package\";s:61:\"https://downloads.wordpress.org/theme/twentytwentyone.1.7.zip\";s:8:\"requires\";s:3:\"5.3\";s:12:\"requires_php\";s:3:\"5.6\";}s:15:\"twentytwentytwo\";a:6:{s:5:\"theme\";s:15:\"twentytwentytwo\";s:11:\"new_version\";s:3:\"1.3\";s:3:\"url\";s:45:\"https://wordpress.org/themes/twentytwentytwo/\";s:7:\"package\";s:61:\"https://downloads.wordpress.org/theme/twentytwentytwo.1.3.zip\";s:8:\"requires\";s:3:\"5.9\";s:12:\"requires_php\";s:3:\"5.6\";}}s:9:\"no_update\";a:0:{}s:12:\"translations\";a:0:{}}','no'),(124,'tribe_last_updated_option','1700233729.9088','yes'),(125,'tribe_events_calendar_options','a:14:{s:25:\"ticket-enabled-post-types\";a:2:{i:0;s:12:\"tribe_events\";i:1;s:4:\"page\";}s:28:\"event-tickets-schema-version\";s:9:\"6.0.0-dev\";s:31:\"previous_event_tickets_versions\";a:1:{i:0;s:1:\"0\";}s:28:\"latest_event_tickets_version\";s:9:\"6.0.0-dev\";s:8:\"did_init\";b:1;s:19:\"tribeEventsTemplate\";s:0:\"\";s:16:\"tribeEnableViews\";a:3:{i:0;s:4:\"list\";i:1;s:5:\"month\";i:2;s:3:\"day\";}s:10:\"viewOption\";s:4:\"list\";s:14:\"schema-version\";s:9:\"6.3.0-dev\";s:21:\"previous_ecp_versions\";a:2:{i:0;s:1:\"0\";i:1;s:5:\"6.1.1\";}s:18:\"latest_ecp_version\";s:9:\"6.3.0-dev\";s:18:\"dateWithYearFormat\";s:6:\"F j, Y\";s:24:\"recurrenceMaxMonthsAfter\";i:60;s:22:\"google_maps_js_api_key\";s:39:\"AIzaSyDNsicAsP6-VuGtAb1O9riI3oc_NOb7IOU\";}','yes'),(126,'tec_recurring_tickets_active','1','yes'),(127,'widget_recent-posts','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(128,'widget_recent-comments','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(132,'tec_ct1_migration_state','a:3:{s:18:\"complete_timestamp\";N;s:5:\"phase\";s:22:\"migration-not-required\";s:19:\"preview_unsupported\";b:0;}','yes'),(133,'tec_ct1_series_relationship_table_schema_version','1.0.0','yes'),(134,'tec_ct1_events_table_schema_version','1.0.1','yes'),(135,'tec_ct1_occurrences_table_schema_version','1.0.2','yes'),(136,'tec_ct1_events_field_schema_version','1.0.1','yes'),(137,'tec_ct1_occurrences_field_schema_version','1.0.1','yes'),(140,'_transient_tec_custom_tables_v1_ecp_initialized','1680098849','yes'),(141,'tec_custom_tables_v1_provisional_post_base_provisional_id','10000000','yes'),(142,'stellar_schema_version_tec-ft-ticket-groups','1.0.0','yes'),(143,'stellar_schema_version_tec-ft-posts-and-ticket-groups','1.0.0','yes'),(146,'tribe_last_save_post','1700233729.9089','yes'),(147,'widget_tribe-widget-events-list','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(148,'widget_tribe-widget-event-countdown','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(149,'widget_tribe-widget-featured-venue','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(150,'widget_tribe-widget-events-month','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(151,'widget_tribe-widget-events-week','a:1:{s:12:\"_multiwidget\";i:1;}','yes'),(152,'stellarwp_telemetry_last_send','','yes'),(153,'stellarwp_telemetry','a:1:{s:7:\"plugins\";a:1:{s:13:\"event-tickets\";a:2:{s:7:\"wp_slug\";s:31:\"event-tickets/event-tickets.php\";s:5:\"optin\";b:0;}}}','yes'),(154,'stellarwp_telemetry_event-tickets_show_optin','1','yes'),(155,'tec_timed_tec_custom_tables_v1_ecp_initialized','a:3:{s:3:\"key\";s:36:\"tec_custom_tables_v1_ecp_initialized\";s:5:\"value\";i:1;s:10:\"expiration\";i:1700320125;}','yes'),(156,'tec_timed_tec_custom_tables_v1_initialized','a:3:{s:3:\"key\";s:32:\"tec_custom_tables_v1_initialized\";s:5:\"value\";i:1;s:10:\"expiration\";i:1700320125;}','yes'),(159,'external_updates-events-calendar-pro','O:8:\"stdClass\":3:{s:9:\"lastCheck\";i:1687425483;s:14:\"checkedVersion\";s:5:\"6.1.0\";s:6:\"update\";O:19:\"Tribe__PUE__Utility\":11:{s:2:\"id\";i:0;s:6:\"plugin\";s:34:\"events-pro/events-calendar-pro.php\";s:4:\"slug\";s:19:\"events-calendar-pro\";s:7:\"version\";s:5:\"6.1.0\";s:8:\"homepage\";s:18:\"https://evnt.is/4d\";s:12:\"download_url\";s:301:\"https://pue.theeventscalendar.com/api/plugins/v2/download?plugin=events-calendar-pro&version=6.1.0&installed_version=6.1.0&domain=wordpress.test&multisite=0&network_activated=0&active_sites=1&wp_version=6.0.2&key=97f261bb1246e1c8ad0b7ace9ec6cb7764a09730&dk=97f261bb1246e1c8ad0b7ace9ec6cb7764a09730&o=e\";s:8:\"sections\";O:8:\"stdClass\":3:{s:11:\"description\";s:204:\"Events Calendar Pro is an extension to The Events Calendar, and includes recurring events, additional frontend views and more. To see a full feature list please visit the product page (http://evnt.is/4d).\";s:12:\"installation\";s:353:\"Installing Events Calendar Pro is easy: just back up your site, download/install The Events Calendar from the WordPress.org repo, and download/install Events Calendar Pro from theeventscalendar.com. Activate them both and you\'ll be good to go! If you\'re still confused or encounter problems, check out part 1 of our new user primer (http://m.tri.be/4i).\";s:9:\"changelog\";s:971:\"

= [6.1.0] 2023-06-14 =

\r\n
    \r\n
  • Version - Events Calendar PRO 6.1.0 is only compatible with The Events Calendar 6.1.0 and higher
  • \r\n
  • Feature - Replace Freemius with Telemetry - an in-house info system.
  • \r\n
  • Feature - Add plugin info to Site Health admin page.
  • \r\n
  • Fix - Ensure all the strings in the add event page are translatable. [ECP-1453]
  • \r\n
  • Fix - Ensure the `Use in Block Editor` option under `Events → Settings → Additional Fields` works as expected.
  • \r\n
  • Fix - Removing our eager schema updates. This was causing a number of `ALTER` statements being run redundantly. No longer utilizes cache/transient for the last run check as it is not dependable.
  • \r\n
  • Tweak - Updates title tags on events pages, to be more unique and search specific, taking on formats like \"Summary of Events from February 2, 2017 - February 3, 2019\".
  • \r\n
  • Language - 4 new strings added, 96 updated, 0 fuzzied, and 1 obsoleted
  • \r\n
\";}s:14:\"upgrade_notice\";s:0:\"\";s:13:\"custom_update\";O:8:\"stdClass\":1:{s:5:\"icons\";O:8:\"stdClass\":1:{s:3:\"svg\";s:84:\"https://theeventscalendar.com/content/themes/tribe-ecp/img/svg/product-icons/ECP.svg\";}}s:11:\"api_expired\";b:0;s:11:\"api_upgrade\";b:0;}}','no'),(160,'tribe_pue_key_notices','a:0:{}','yes'),(161,'_site_transient_update_plugins','O:8:\"stdClass\":4:{s:12:\"last_checked\";i:1687425481;s:8:\"response\";a:1:{s:19:\"akismet/akismet.php\";O:8:\"stdClass\":12:{s:2:\"id\";s:21:\"w.org/plugins/akismet\";s:4:\"slug\";s:7:\"akismet\";s:6:\"plugin\";s:19:\"akismet/akismet.php\";s:11:\"new_version\";s:3:\"5.2\";s:3:\"url\";s:38:\"https://wordpress.org/plugins/akismet/\";s:7:\"package\";s:54:\"https://downloads.wordpress.org/plugin/akismet.5.2.zip\";s:5:\"icons\";a:2:{s:2:\"2x\";s:60:\"https://ps.w.org/akismet/assets/icon-256x256.png?rev=2818463\";s:2:\"1x\";s:60:\"https://ps.w.org/akismet/assets/icon-128x128.png?rev=2818463\";}s:7:\"banners\";a:2:{s:2:\"2x\";s:63:\"https://ps.w.org/akismet/assets/banner-1544x500.png?rev=2900731\";s:2:\"1x\";s:62:\"https://ps.w.org/akismet/assets/banner-772x250.png?rev=2900731\";}s:11:\"banners_rtl\";a:0:{}s:8:\"requires\";s:3:\"5.8\";s:6:\"tested\";s:5:\"6.2.2\";s:12:\"requires_php\";s:6:\"5.6.20\";}}s:12:\"translations\";a:0:{}s:9:\"no_update\";a:10:{s:35:\"advanced-post-manager/tribe-apm.php\";O:8:\"stdClass\":10:{s:2:\"id\";s:35:\"w.org/plugins/advanced-post-manager\";s:4:\"slug\";s:21:\"advanced-post-manager\";s:6:\"plugin\";s:35:\"advanced-post-manager/tribe-apm.php\";s:11:\"new_version\";s:5:\"4.5.4\";s:3:\"url\";s:52:\"https://wordpress.org/plugins/advanced-post-manager/\";s:7:\"package\";s:70:\"https://downloads.wordpress.org/plugin/advanced-post-manager.4.5.4.zip\";s:5:\"icons\";a:1:{s:7:\"default\";s:72:\"https://s.w.org/plugins/geopattern-icon/advanced-post-manager_66b8d2.svg\";}s:7:\"banners\";a:2:{s:2:\"2x\";s:76:\"https://ps.w.org/advanced-post-manager/assets/banner-1544x500.jpg?rev=593014\";s:2:\"1x\";s:75:\"https://ps.w.org/advanced-post-manager/assets/banner-772x250.png?rev=517740\";}s:11:\"banners_rtl\";a:0:{}s:8:\"requires\";s:3:\"5.7\";}s:23:\"debug-bar/debug-bar.php\";O:8:\"stdClass\":10:{s:2:\"id\";s:23:\"w.org/plugins/debug-bar\";s:4:\"slug\";s:9:\"debug-bar\";s:6:\"plugin\";s:23:\"debug-bar/debug-bar.php\";s:11:\"new_version\";s:5:\"1.1.4\";s:3:\"url\";s:40:\"https://wordpress.org/plugins/debug-bar/\";s:7:\"package\";s:58:\"https://downloads.wordpress.org/plugin/debug-bar.1.1.4.zip\";s:5:\"icons\";a:2:{s:2:\"1x\";s:54:\"https://ps.w.org/debug-bar/assets/icon.svg?rev=1908362\";s:3:\"svg\";s:54:\"https://ps.w.org/debug-bar/assets/icon.svg?rev=1908362\";}s:7:\"banners\";a:2:{s:2:\"2x\";s:65:\"https://ps.w.org/debug-bar/assets/banner-1544x500.png?rev=1365496\";s:2:\"1x\";s:64:\"https://ps.w.org/debug-bar/assets/banner-772x250.png?rev=1365496\";}s:11:\"banners_rtl\";a:0:{}s:8:\"requires\";s:3:\"3.4\";}s:49:\"easy-digital-downloads/easy-digital-downloads.php\";O:8:\"stdClass\":10:{s:2:\"id\";s:36:\"w.org/plugins/easy-digital-downloads\";s:4:\"slug\";s:22:\"easy-digital-downloads\";s:6:\"plugin\";s:49:\"easy-digital-downloads/easy-digital-downloads.php\";s:11:\"new_version\";s:5:\"3.1.2\";s:3:\"url\";s:53:\"https://wordpress.org/plugins/easy-digital-downloads/\";s:7:\"package\";s:71:\"https://downloads.wordpress.org/plugin/easy-digital-downloads.3.1.2.zip\";s:5:\"icons\";a:2:{s:2:\"1x\";s:66:\"https://ps.w.org/easy-digital-downloads/assets/icon.svg?rev=971968\";s:3:\"svg\";s:66:\"https://ps.w.org/easy-digital-downloads/assets/icon.svg?rev=971968\";}s:7:\"banners\";a:2:{s:2:\"2x\";s:78:\"https://ps.w.org/easy-digital-downloads/assets/banner-1544x500.png?rev=2636140\";s:2:\"1x\";s:77:\"https://ps.w.org/easy-digital-downloads/assets/banner-772x250.png?rev=2636140\";}s:11:\"banners_rtl\";a:0:{}s:8:\"requires\";s:3:\"5.4\";}s:31:\"event-tickets/event-tickets.php\";O:8:\"stdClass\":10:{s:2:\"id\";s:27:\"w.org/plugins/event-tickets\";s:4:\"slug\";s:13:\"event-tickets\";s:6:\"plugin\";s:31:\"event-tickets/event-tickets.php\";s:11:\"new_version\";s:7:\"5.6.0.2\";s:3:\"url\";s:44:\"https://wordpress.org/plugins/event-tickets/\";s:7:\"package\";s:64:\"https://downloads.wordpress.org/plugin/event-tickets.5.6.0.2.zip\";s:5:\"icons\";a:2:{s:2:\"1x\";s:58:\"https://ps.w.org/event-tickets/assets/icon.svg?rev=2259340\";s:3:\"svg\";s:58:\"https://ps.w.org/event-tickets/assets/icon.svg?rev=2259340\";}s:7:\"banners\";a:2:{s:2:\"2x\";s:69:\"https://ps.w.org/event-tickets/assets/banner-1544x500.png?rev=2257626\";s:2:\"1x\";s:68:\"https://ps.w.org/event-tickets/assets/banner-772x250.png?rev=2257626\";}s:11:\"banners_rtl\";a:0:{}s:8:\"requires\";s:5:\"5.8.5\";}s:9:\"hello.php\";O:8:\"stdClass\":10:{s:2:\"id\";s:25:\"w.org/plugins/hello-dolly\";s:4:\"slug\";s:11:\"hello-dolly\";s:6:\"plugin\";s:9:\"hello.php\";s:11:\"new_version\";s:5:\"1.7.2\";s:3:\"url\";s:42:\"https://wordpress.org/plugins/hello-dolly/\";s:7:\"package\";s:60:\"https://downloads.wordpress.org/plugin/hello-dolly.1.7.2.zip\";s:5:\"icons\";a:2:{s:2:\"2x\";s:64:\"https://ps.w.org/hello-dolly/assets/icon-256x256.jpg?rev=2052855\";s:2:\"1x\";s:64:\"https://ps.w.org/hello-dolly/assets/icon-128x128.jpg?rev=2052855\";}s:7:\"banners\";a:2:{s:2:\"2x\";s:67:\"https://ps.w.org/hello-dolly/assets/banner-1544x500.jpg?rev=2645582\";s:2:\"1x\";s:66:\"https://ps.w.org/hello-dolly/assets/banner-772x250.jpg?rev=2052855\";}s:11:\"banners_rtl\";a:0:{}s:8:\"requires\";s:3:\"4.6\";}s:31:\"query-monitor/query-monitor.php\";O:8:\"stdClass\":10:{s:2:\"id\";s:27:\"w.org/plugins/query-monitor\";s:4:\"slug\";s:13:\"query-monitor\";s:6:\"plugin\";s:31:\"query-monitor/query-monitor.php\";s:11:\"new_version\";s:6:\"3.12.3\";s:3:\"url\";s:44:\"https://wordpress.org/plugins/query-monitor/\";s:7:\"package\";s:63:\"https://downloads.wordpress.org/plugin/query-monitor.3.12.3.zip\";s:5:\"icons\";a:2:{s:2:\"1x\";s:58:\"https://ps.w.org/query-monitor/assets/icon.svg?rev=2870124\";s:3:\"svg\";s:58:\"https://ps.w.org/query-monitor/assets/icon.svg?rev=2870124\";}s:7:\"banners\";a:2:{s:2:\"2x\";s:69:\"https://ps.w.org/query-monitor/assets/banner-1544x500.png?rev=2870124\";s:2:\"1x\";s:68:\"https://ps.w.org/query-monitor/assets/banner-772x250.png?rev=2457098\";}s:11:\"banners_rtl\";a:0:{}s:8:\"requires\";s:3:\"5.2\";}s:27:\"redis-cache/redis-cache.php\";O:8:\"stdClass\":10:{s:2:\"id\";s:25:\"w.org/plugins/redis-cache\";s:4:\"slug\";s:11:\"redis-cache\";s:6:\"plugin\";s:27:\"redis-cache/redis-cache.php\";s:11:\"new_version\";s:5:\"2.4.1\";s:3:\"url\";s:42:\"https://wordpress.org/plugins/redis-cache/\";s:7:\"package\";s:60:\"https://downloads.wordpress.org/plugin/redis-cache.2.4.1.zip\";s:5:\"icons\";a:2:{s:2:\"2x\";s:64:\"https://ps.w.org/redis-cache/assets/icon-256x256.gif?rev=2568513\";s:2:\"1x\";s:64:\"https://ps.w.org/redis-cache/assets/icon-128x128.gif?rev=2568513\";}s:7:\"banners\";a:2:{s:2:\"2x\";s:67:\"https://ps.w.org/redis-cache/assets/banner-1544x500.png?rev=2315420\";s:2:\"1x\";s:66:\"https://ps.w.org/redis-cache/assets/banner-772x250.png?rev=2315420\";}s:11:\"banners_rtl\";a:0:{}s:8:\"requires\";s:3:\"3.3\";}s:51:\"rewrite-rules-inspector/rewrite-rules-inspector.php\";O:8:\"stdClass\":10:{s:2:\"id\";s:37:\"w.org/plugins/rewrite-rules-inspector\";s:4:\"slug\";s:23:\"rewrite-rules-inspector\";s:6:\"plugin\";s:51:\"rewrite-rules-inspector/rewrite-rules-inspector.php\";s:11:\"new_version\";s:5:\"1.3.1\";s:3:\"url\";s:54:\"https://wordpress.org/plugins/rewrite-rules-inspector/\";s:7:\"package\";s:72:\"https://downloads.wordpress.org/plugin/rewrite-rules-inspector.1.3.1.zip\";s:5:\"icons\";a:1:{s:7:\"default\";s:74:\"https://s.w.org/plugins/geopattern-icon/rewrite-rules-inspector_e2e3e4.svg\";}s:7:\"banners\";a:2:{s:2:\"2x\";s:79:\"https://ps.w.org/rewrite-rules-inspector/assets/banner-1544x500.png?rev=2533834\";s:2:\"1x\";s:78:\"https://ps.w.org/rewrite-rules-inspector/assets/banner-772x250.png?rev=2533843\";}s:11:\"banners_rtl\";a:0:{}s:8:\"requires\";s:3:\"3.1\";}s:43:\"the-events-calendar/the-events-calendar.php\";O:8:\"stdClass\":10:{s:2:\"id\";s:33:\"w.org/plugins/the-events-calendar\";s:4:\"slug\";s:19:\"the-events-calendar\";s:6:\"plugin\";s:43:\"the-events-calendar/the-events-calendar.php\";s:11:\"new_version\";s:5:\"6.1.1\";s:3:\"url\";s:50:\"https://wordpress.org/plugins/the-events-calendar/\";s:7:\"package\";s:68:\"https://downloads.wordpress.org/plugin/the-events-calendar.6.1.1.zip\";s:5:\"icons\";a:2:{s:2:\"2x\";s:72:\"https://ps.w.org/the-events-calendar/assets/icon-256x256.gif?rev=2516440\";s:2:\"1x\";s:72:\"https://ps.w.org/the-events-calendar/assets/icon-128x128.gif?rev=2516440\";}s:7:\"banners\";a:2:{s:2:\"2x\";s:75:\"https://ps.w.org/the-events-calendar/assets/banner-1544x500.png?rev=2257622\";s:2:\"1x\";s:74:\"https://ps.w.org/the-events-calendar/assets/banner-772x250.png?rev=2257622\";}s:11:\"banners_rtl\";a:0:{}s:8:\"requires\";s:5:\"5.8.6\";}s:27:\"woocommerce/woocommerce.php\";O:8:\"stdClass\":12:{s:2:\"id\";s:25:\"w.org/plugins/woocommerce\";s:4:\"slug\";s:11:\"woocommerce\";s:6:\"plugin\";s:27:\"woocommerce/woocommerce.php\";s:11:\"new_version\";s:5:\"7.8.0\";s:3:\"url\";s:42:\"https://wordpress.org/plugins/woocommerce/\";s:7:\"package\";s:60:\"https://downloads.wordpress.org/plugin/woocommerce.7.8.0.zip\";s:5:\"icons\";a:2:{s:2:\"2x\";s:64:\"https://ps.w.org/woocommerce/assets/icon-256x256.gif?rev=2869506\";s:2:\"1x\";s:64:\"https://ps.w.org/woocommerce/assets/icon-128x128.gif?rev=2869506\";}s:7:\"banners\";a:2:{s:2:\"2x\";s:67:\"https://ps.w.org/woocommerce/assets/banner-1544x500.png?rev=2366418\";s:2:\"1x\";s:66:\"https://ps.w.org/woocommerce/assets/banner-772x250.png?rev=2366418\";}s:11:\"banners_rtl\";a:0:{}s:8:\"requires\";s:3:\"6.1\";s:6:\"tested\";s:5:\"6.2.2\";s:12:\"requires_php\";s:3:\"7.3\";}}}','no'),(162,'schema-ActionScheduler_StoreSchema','7.0.1692276901','yes'),(163,'schema-ActionScheduler_LoggerSchema','3.0.1692276901','yes'),(172,'theme_mods_twentytwentytwo','a:1:{s:16:\"sidebars_widgets\";a:2:{s:4:\"time\";i:1692276901;s:4:\"data\";a:3:{s:19:\"wp_inactive_widgets\";a:0:{}s:9:\"sidebar-1\";a:3:{i:0;s:7:\"block-2\";i:1;s:7:\"block-3\";i:2;s:7:\"block-4\";}s:9:\"sidebar-2\";a:2:{i:0;s:7:\"block-5\";i:1;s:7:\"block-6\";}}}}','no'),(173,'current_theme','Twenty Twenty','yes'),(174,'theme_switched','','yes'),(177,'theme_mods_twentytwenty','a:1:{s:18:\"nav_menu_locations\";a:0:{}}','yes'),(180,'wp_attachment_pages_enabled','1','yes'),(181,'db_upgraded','1','yes'); /*!40000 ALTER TABLE `wp_options` ENABLE KEYS */; UNLOCK TABLES; @@ -845,6 +846,110 @@ LOCK TABLES `wp_tec_series_relationships` WRITE; /*!40000 ALTER TABLE `wp_tec_series_relationships` ENABLE KEYS */; UNLOCK TABLES; +-- +-- Table structure for table `wp_tec_slr_layouts` +-- + +DROP TABLE IF EXISTS `wp_tec_slr_layouts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `wp_tec_slr_layouts` ( + `id` varchar(36) NOT NULL, + `name` varchar(255) NOT NULL, + `created_date` datetime NOT NULL, + `map` varchar(36) NOT NULL, + `seats` int(11) NOT NULL DEFAULT 0, + `screenshot_url` varchar(255) DEFAULT '', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `wp_tec_slr_layouts` +-- + +LOCK TABLES `wp_tec_slr_layouts` WRITE; +/*!40000 ALTER TABLE `wp_tec_slr_layouts` DISABLE KEYS */; +/*!40000 ALTER TABLE `wp_tec_slr_layouts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `wp_tec_slr_maps` +-- + +DROP TABLE IF EXISTS `wp_tec_slr_maps`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `wp_tec_slr_maps` ( + `id` varchar(36) NOT NULL, + `name` varchar(255) NOT NULL, + `seats` int(11) NOT NULL DEFAULT 0, + `screenshot_url` varchar(255) DEFAULT '', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `wp_tec_slr_maps` +-- + +LOCK TABLES `wp_tec_slr_maps` WRITE; +/*!40000 ALTER TABLE `wp_tec_slr_maps` DISABLE KEYS */; +/*!40000 ALTER TABLE `wp_tec_slr_maps` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `wp_tec_slr_seat_types` +-- + +DROP TABLE IF EXISTS `wp_tec_slr_seat_types`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `wp_tec_slr_seat_types` ( + `id` varchar(36) NOT NULL, + `name` varchar(255) NOT NULL, + `map` varchar(36) NOT NULL, + `layout` varchar(36) NOT NULL, + `seats` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `wp_tec_slr_seat_types` +-- + +LOCK TABLES `wp_tec_slr_seat_types` WRITE; +/*!40000 ALTER TABLE `wp_tec_slr_seat_types` DISABLE KEYS */; +/*!40000 ALTER TABLE `wp_tec_slr_seat_types` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `wp_tec_slr_sessions` +-- + +DROP TABLE IF EXISTS `wp_tec_slr_sessions`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `wp_tec_slr_sessions` ( + `token` varchar(150) NOT NULL, + `object_id` bigint(20) NOT NULL, + `expiration` int(11) NOT NULL, + `reservations` longblob DEFAULT NULL, + `expiration_lock` tinyint(1) DEFAULT 0, + PRIMARY KEY (`token`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `wp_tec_slr_sessions` +-- + +LOCK TABLES `wp_tec_slr_sessions` WRITE; +/*!40000 ALTER TABLE `wp_tec_slr_sessions` DISABLE KEYS */; +/*!40000 ALTER TABLE `wp_tec_slr_sessions` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `wp_tec_ticket_groups` -- @@ -1052,4 +1157,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2024-07-11 18:14:46 +-- Dump completed on 2024-12-18 14:16:19 From 45817ef10daa24db0490f0ae13136c6d58917b7c Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Wed, 18 Dec 2024 15:47:17 +0100 Subject: [PATCH 07/90] test(ft_integration) explicit menu_order to stabilize snapshots --- tests/ft_integration/Tribe/Tickets/OrderReportTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/ft_integration/Tribe/Tickets/OrderReportTest.php b/tests/ft_integration/Tribe/Tickets/OrderReportTest.php index 7f34160b38..a95109c45c 100644 --- a/tests/ft_integration/Tribe/Tickets/OrderReportTest.php +++ b/tests/ft_integration/Tribe/Tickets/OrderReportTest.php @@ -175,6 +175,10 @@ function (): array { $order_a = $this->create_order( [ $series_pass_id_a => 1 ], [ 'purchaser_email' => 'purchaser@test.com' ] ); $order_b = $this->create_order( [ $series_pass_id_b => 1 ], [ 'purchaser_email' => 'purchaser@test.com' ] ); + // Impose an arbitrary sorting order for orders so we can verify ticket display order in report. + wp_update_post( [ 'ID' => $order_a->ID, 'menu_order' => 0 ] ); + wp_update_post( [ 'ID' => $order_b->ID, 'menu_order' => 1 ] ); + return [ $series_id, [ $series_id, $series_pass_id_a, $order_a->ID, $order_b->ID ] ]; } ]; @@ -214,4 +218,4 @@ public function test_tc_order_report_display( Closure $fixture ) { $this->assertMatchesHtmlSnapshot( $html ); } -} \ No newline at end of file +} From 991dbd9d89d06f2aaf0a2f3602095e3ed5620511 Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Wed, 18 Dec 2024 16:00:22 +0100 Subject: [PATCH 08/90] build(.github) set wp version correctly in workflow --- .github/workflows/tests-php-ft.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests-php-ft.yml b/.github/workflows/tests-php-ft.yml index 26f9440b9f..14fa9d87d4 100644 --- a/.github/workflows/tests-php-ft.yml +++ b/.github/workflows/tests-php-ft.yml @@ -250,7 +250,7 @@ jobs: run: | ${SLIC_BIN} up wordpress ${SLIC_BIN} wp core version - ${SLIC_BIN} wp core update --force --version=6.5?: oer + ${SLIC_BIN} wp core update --force --version=6.5 ${SLIC_BIN} wp core version # ------------------------------------------------------------------------------ # Install and activate TwentyTwenty From 2604d6a08458cc82afd27d25e6ece0dedb50263b Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Thu, 19 Dec 2024 16:40:51 +0200 Subject: [PATCH 09/90] Move methods to TCMN abstract --- .../Custom_Tables/Abstract_Custom_Table.php | 85 ------------------- .../Order_Modifier_Relationships.php | 4 +- .../Custom_Tables/Order_Modifiers.php | 4 +- .../Custom_Tables/Order_Modifiers_Meta.php | 4 +- 4 files changed, 9 insertions(+), 88 deletions(-) delete mode 100644 src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Abstract_Custom_Table.php diff --git a/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Abstract_Custom_Table.php b/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Abstract_Custom_Table.php deleted file mode 100644 index 795205e13e..0000000000 --- a/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Abstract_Custom_Table.php +++ /dev/null @@ -1,85 +0,0 @@ -has_index( $index_name ) ) { - return $results; - } - - $sql = "ALTER TABLE %i ADD INDEX `{$index_name}` ( {$columns} )"; - - $updated = DB::query( - DB::prepare( $sql, $table_name ) - ); - - $message = $updated ? - sprintf( 'Added index to the %s table on %s.', $table_name, $columns ) : - sprintf( 'Failed to add an index on the %s table for %s.', $table_name, $columns ); - - $results[ "{$table_name}.{$columns}" ] = $message; - return $results; - } - - /** - * Empties the custom table in a way that is not causing an implicit commit. - * - * Even though the method is called truncate it doesn't use TRUNCATE. - * Thats because we want to avoid implicit commits in the DB making this method suitable for using during a testcase. - * If you want to use TRUNCATE you can use the `empty_table` method instead. - * - * @since 5.18.0 - * - * @return bool Whether it was emptied or not. - */ - public function truncate(): bool { - if ( ! $this->exists() ) { - // There is really nothing to do. - return true; - } - - $this_table = static::table_name( true ); - - DB::query( 'SET foreign_key_checks = 0' ); - $result = DB::query( "DELETE FROM {$this_table}" ); - DB::query( 'SET foreign_key_checks = 1' ); - - return is_numeric( $result ); - } -} diff --git a/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Order_Modifier_Relationships.php b/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Order_Modifier_Relationships.php index 765f0ce1d5..e8a4e3e22a 100644 --- a/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Order_Modifier_Relationships.php +++ b/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Order_Modifier_Relationships.php @@ -7,6 +7,8 @@ namespace TEC\Tickets\Commerce\Order_Modifiers\Custom_Tables; +use TEC\Common\Integrations\Custom_Table_Abstract as Table; + /** * Class Order_Modifier_Relationships. * @@ -14,7 +16,7 @@ * * @package TEC\Tickets\Commerce\Order_Modifiers\Custom_Tables; */ -class Order_Modifier_Relationships extends Abstract_Custom_Table { +class Order_Modifier_Relationships extends Table { /** * @since 5.18.0 * diff --git a/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Order_Modifiers.php b/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Order_Modifiers.php index 72920f245d..0be32bed3b 100644 --- a/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Order_Modifiers.php +++ b/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Order_Modifiers.php @@ -7,6 +7,8 @@ namespace TEC\Tickets\Commerce\Order_Modifiers\Custom_Tables; +use TEC\Common\Integrations\Custom_Table_Abstract as Table; + /** * Class Orders_Modifiers. * @@ -14,7 +16,7 @@ * * @package TEC\Tickets\Commerce\Order_Modifiers\Custom_Tables; */ -class Order_Modifiers extends Abstract_Custom_Table { +class Order_Modifiers extends Table { /** * @since 5.18.0 * diff --git a/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Order_Modifiers_Meta.php b/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Order_Modifiers_Meta.php index d9ddcef25d..33a89388d1 100644 --- a/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Order_Modifiers_Meta.php +++ b/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Order_Modifiers_Meta.php @@ -9,6 +9,8 @@ namespace TEC\Tickets\Commerce\Order_Modifiers\Custom_Tables; +use TEC\Common\Integrations\Custom_Table_Abstract as Table; + /** * Class Order_Modifiers_Meta. * @@ -16,7 +18,7 @@ * * @package TEC\Tickets\Commerce\Order_Modifiers\Custom_Tables; */ -class Order_Modifiers_Meta extends Abstract_Custom_Table { +class Order_Modifiers_Meta extends Table { /** * @since 5.18.0 From ae975f9cde6bf30620decdb9aaab97b51f66dc45 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Thu, 19 Dec 2024 16:59:34 +0200 Subject: [PATCH 10/90] Added changelog --- changelog/feat-custom-tables | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelog/feat-custom-tables diff --git a/changelog/feat-custom-tables b/changelog/feat-custom-tables new file mode 100644 index 0000000000..419d8c9560 --- /dev/null +++ b/changelog/feat-custom-tables @@ -0,0 +1,4 @@ +Significance: patch +Type: tweak + +Moved abstract class for custom tables into TCMN. From a0e0775a383e4c43e3b04850b3d0963f8408ba08 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Mon, 13 Jan 2025 19:49:43 +0200 Subject: [PATCH 11/90] Convert static calls of truncate to dynamic --- src/Tickets/Seating/Service/Layouts.php | 4 +- src/Tickets/Seating/Service/Maps.php | 2 +- src/Tickets/Seating/Service/Seat_Types.php | 2 +- tests/slr_integration/Admin/Ajax_Test.php | 110 +++++++++--------- .../Admin/Maps_Layout_Homepage_Test.php | 6 +- tests/slr_integration/Orders/Cart_Test.php | 2 +- .../Service/Seat_Types_Test.php | 2 +- 7 files changed, 64 insertions(+), 64 deletions(-) diff --git a/src/Tickets/Seating/Service/Layouts.php b/src/Tickets/Seating/Service/Layouts.php index 2518ea4ffd..9d5b30256b 100644 --- a/src/Tickets/Seating/Service/Layouts.php +++ b/src/Tickets/Seating/Service/Layouts.php @@ -275,8 +275,8 @@ public static function invalidate_cache( bool $truncate = true ): bool { $invalidated = true; if ( $truncate ) { - $invalidated &= Layouts_Table::truncate() !== false && - Seat_Types_Table::truncate() !== false; + $invalidated &= tribe( Layouts_Table::class )->truncate() !== false && + tribe( Seat_Types_Table::class )->truncate() !== false; } /** diff --git a/src/Tickets/Seating/Service/Maps.php b/src/Tickets/Seating/Service/Maps.php index 69db86ea2a..a8301ddaed 100644 --- a/src/Tickets/Seating/Service/Maps.php +++ b/src/Tickets/Seating/Service/Maps.php @@ -70,7 +70,7 @@ public static function invalidate_cache(): bool { delete_transient( self::update_transient_name() ); wp_cache_delete( 'option_map_card_objects', 'tec-tickets-seating' ); - $invalidated = Maps_Table::truncate() !== false; + $invalidated = tribe( Maps_Table::class )->truncate() !== false; /** * Fires after the caches and custom tables storing information about Maps have been diff --git a/src/Tickets/Seating/Service/Seat_Types.php b/src/Tickets/Seating/Service/Seat_Types.php index fd1603e421..84fba73115 100644 --- a/src/Tickets/Seating/Service/Seat_Types.php +++ b/src/Tickets/Seating/Service/Seat_Types.php @@ -155,7 +155,7 @@ public function update( bool $force = false ): bool { ); $updated = $updater->check_last_update( $force ) - ->update_from_service( fn() => Seat_Types_Table::truncate() ) + ->update_from_service( fn() => tribe( Seat_Types_Table::class )->truncate() ) ->store_fetched_data( [ $this, 'insert_rows_from_service' ] ); return $updated; diff --git a/tests/slr_integration/Admin/Ajax_Test.php b/tests/slr_integration/Admin/Ajax_Test.php index 036ad91aaf..ad54258019 100644 --- a/tests/slr_integration/Admin/Ajax_Test.php +++ b/tests/slr_integration/Admin/Ajax_Test.php @@ -57,10 +57,10 @@ public function reset_tribe_options_cache(): void { * @after */ public function truncate_tables(): void { - Maps::truncate(); - Seat_Types_Table::truncate(); - Layouts_Table::truncate(); - Sessions::truncate(); + tribe( Maps::class )->truncate(); + tribe( Seat_Types_Table::class )->truncate(); + tribe( Layouts_Table::class )->truncate(); + tribe( Sessions::class )->truncate(); } public function asset_data_provider() { @@ -2613,10 +2613,10 @@ public function test_update_event_layout_failures(): void { ) ); } - + public function test_remove_event_layout_success() { $this->make_controller()->register(); - + Maps_Service::insert_rows_from_service( [ [ @@ -2628,7 +2628,7 @@ public function test_remove_event_layout_success() { ] ); set_transient( Maps_Service::update_transient_name(), time() ); - + Layouts::insert_rows_from_service( [ [ @@ -2642,7 +2642,7 @@ public function test_remove_event_layout_success() { ] ); set_transient( Layouts::update_transient_name(), time() ); - + Seat_Types_Table::insert_many( [ [ @@ -2661,31 +2661,31 @@ public function test_remove_event_layout_success() { ], ] ); - + set_transient( Seat_Types::update_transient_name(), time() ); $this->set_up_ajax_request_context(); $this->reset_wp_send_json_mocks(); - + // Setup request body. $this->set_oauth_token( 'auth-token' ); - + /** @var \Tribe__Tickets__Tickets_Handler $tickets_handler */ $tickets_handler = tribe( 'tickets.handler' ); $capacity_meta_key = $tickets_handler->key_capacity; - + // Create event with associated layout and ticket and attendees. $post_id = static::factory()->post->create(); - + // Enable the global stock on the Event. update_post_meta( $post_id, Global_Stock::GLOBAL_STOCK_ENABLED, 1 ); - + // set capacity as per layout 1. update_post_meta( $post_id, $capacity_meta_key, 100 ); update_post_meta( $post_id, Global_Stock::GLOBAL_STOCK_LEVEL, 100 ); - + update_post_meta( $post_id, Meta::META_KEY_ENABLED, true ); update_post_meta( $post_id, Meta::META_KEY_LAYOUT_ID, 'some-layout-1' ); - + $ticket_id_1 = $this->create_tc_ticket( $post_id, 10, @@ -2696,7 +2696,7 @@ public function test_remove_event_layout_success() { ], ] ); - + $ticket_id_2 = $this->create_tc_ticket( $post_id, 10, @@ -2707,42 +2707,42 @@ public function test_remove_event_layout_success() { ], ] ); - + update_post_meta( $ticket_id_1, Meta::META_KEY_ENABLED, true ); update_post_meta( $ticket_id_1, Meta::META_KEY_SEAT_TYPE, 'some-seat-type-1' ); update_post_meta( $ticket_id_1, Meta::META_KEY_LAYOUT_ID, 'some-layout-1' ); - - + + update_post_meta( $ticket_id_2, Meta::META_KEY_ENABLED, true ); update_post_meta( $ticket_id_2, Meta::META_KEY_SEAT_TYPE, 'some-seat-type-2' ); update_post_meta( $ticket_id_2, Meta::META_KEY_LAYOUT_ID, 'some-layout-1' ); - + $ticket_1 = tribe( Module::class )->get_ticket( $post_id, $ticket_id_1 ); $ticket_2 = tribe( Module::class )->get_ticket( $post_id, $ticket_id_2 ); - + $this->assertEquals( 70, $ticket_1->capacity() ); $this->assertEquals( 70, $ticket_1->stock() ); $this->assertEquals( 70, $ticket_1->available() ); $this->assertEquals( 70, $ticket_1->inventory() ); - + $this->assertEquals( 30, $ticket_2->capacity() ); $this->assertEquals( 30, $ticket_2->stock() ); $this->assertEquals( 30, $ticket_2->available() ); $this->assertEquals( 30, $ticket_2->inventory() ); - + $global_stock = new Global_Stock( $post_id ); - + $this->assertTrue( $global_stock->is_enabled(), 'Global stock should be enabled.' ); $this->assertEquals( 100, tribe_get_event_capacity( $post_id ), 'Total Event capacity should be 100' ); $this->assertEquals( 100, $global_stock->get_stock_level(), 'Global stock should be 100' ); - + $order = $this->create_order( [ $ticket_id_1 => 5, $ticket_id_2 => 5, ] ); - + // Total attendees by layout should be 10. $this->assertEquals( 10, @@ -2751,12 +2751,12 @@ public function test_remove_event_layout_success() { ->where( 'meta_equals', Meta::META_KEY_LAYOUT_ID, 'some-layout-1' ) ->count() ); - + $_REQUEST['postId'] = $post_id; - + $wp_send_json_success = $this->mock_wp_send_json_success(); do_action( 'wp_ajax_' . Ajax::ACTION_EVENT_LAYOUT_REMOVE ); - + $success = $wp_send_json_success->was_called_times_with( 1, [ @@ -2764,17 +2764,17 @@ public function test_remove_event_layout_success() { 'updatedAttendees' => 10, // Number of Attendees updated. ] ); - + $this->assertTrue( $success ); - + // Confirm no layout is set for the post. $this->assertEquals( '', get_post_meta( $post_id, Meta::META_KEY_LAYOUT_ID, true ) ); $this->assertEquals( '', get_post_meta( $post_id, Meta::META_KEY_ENABLED, true ) ); - + // Confirm the tickets have no layout set. $this->assertEquals( '', get_post_meta( $ticket_id_1, Meta::META_KEY_LAYOUT_ID, true ) ); $this->assertEquals( '', get_post_meta( $ticket_id_2, Meta::META_KEY_LAYOUT_ID, true ) ); - + // Total attendees should be 10. $this->assertEquals( 10, @@ -2782,7 +2782,7 @@ public function test_remove_event_layout_success() { ->where( 'event', $post_id ) ->count() ); - + // Total attendees by layout should be 0. $this->assertEquals( 0, @@ -2791,46 +2791,46 @@ public function test_remove_event_layout_success() { ->where( 'meta_equals', Meta::META_KEY_LAYOUT_ID, 'some-layout-1' ) ->count() ); - + // Refresh tickets. $ticket_1 = tribe( Module::class )->get_ticket( $post_id, $ticket_id_1 ); $ticket_2 = tribe( Module::class )->get_ticket( $post_id, $ticket_id_2 ); - + // Confirm the tickets have no layout set. $this->assertEquals( 1, $ticket_1->capacity() ); $this->assertEquals( 1, $ticket_1->stock() ); $this->assertEquals( 1, $ticket_1->available() ); $this->assertEquals( 1, $ticket_1->inventory() ); - + $this->assertEquals( 1, $ticket_2->capacity() ); $this->assertEquals( 1, $ticket_2->stock() ); $this->assertEquals( 1, $ticket_2->available() ); $this->assertEquals( 1, $ticket_2->inventory() ); - + // Confirm the global stock is removed. $this->assertFalse( $global_stock->is_enabled() ); $this->assertEquals( 0, $global_stock->get_stock_level() ); - + // Check event capacity. $this->assertEquals( 2, tribe_get_event_capacity( $post_id ) ); - + $stock_data = \Tribe__Tickets__Tickets::get_ticket_counts( $post_id ); - + $this->assertMatchesJsonSnapshot( wp_json_encode( $stock_data, JSON_SNAPSHOT_OPTIONS ) ); } - + public function test_remove_event_layout_fails() { $this->make_controller()->register(); - + $admin_id = $this->set_up_ajax_request_context(); $this->reset_wp_send_json_mocks(); - + // Missing post ID. unset( $_REQUEST['postId'] ); $wp_send_json_error = $this->mock_wp_send_json_error(); - + do_action( 'wp_ajax_' . Ajax::ACTION_EVENT_LAYOUT_REMOVE ); - + $this->assertTrue( $wp_send_json_error->was_called_times_with( 1, @@ -2841,14 +2841,14 @@ public function test_remove_event_layout_fails() { ) ); $this->reset_wp_send_json_mocks(); - + // User cannot edit post. wp_set_current_user( self::factory()->user->create( [ 'role' => 'subscriber' ] ) ); $_REQUEST['postId'] = static::factory()->post->create(); $wp_send_json_error = $this->mock_wp_send_json_error(); - + do_action( 'wp_ajax_' . Ajax::ACTION_EVENT_LAYOUT_REMOVE ); - + $this->assertTrue( $wp_send_json_error->was_called_times_with( 1, @@ -2859,15 +2859,15 @@ public function test_remove_event_layout_fails() { ) ); $this->reset_wp_send_json_mocks(); - + wp_set_current_user( $admin_id ); - + // No layout set for the post. $_REQUEST['postId'] = static::factory()->post->create(); $wp_send_json_error = $this->mock_wp_send_json_error(); - + do_action( 'wp_ajax_' . Ajax::ACTION_EVENT_LAYOUT_REMOVE ); - + $this->assertTrue( $wp_send_json_error->was_called_times_with( 1, @@ -2877,7 +2877,7 @@ public function test_remove_event_layout_fails() { 403 ) ); - + $this->reset_wp_send_json_mocks(); } } diff --git a/tests/slr_integration/Admin/Maps_Layout_Homepage_Test.php b/tests/slr_integration/Admin/Maps_Layout_Homepage_Test.php index 1bf85edb80..e5c04a6a79 100644 --- a/tests/slr_integration/Admin/Maps_Layout_Homepage_Test.php +++ b/tests/slr_integration/Admin/Maps_Layout_Homepage_Test.php @@ -38,9 +38,9 @@ public function mock_user() { * @after */ public function truncate_tables():void{ - Maps_Table::truncate(); - Layouts_Table::truncate(); - Seat_Types_Table::truncate(); + tribe( Maps_Table::class )->truncate(); + tribe( Layouts_Table::class )->truncate(); + tribe( Seat_Types_Table::class )->truncate(); } public function test_empty_seating_configurations(): void { diff --git a/tests/slr_integration/Orders/Cart_Test.php b/tests/slr_integration/Orders/Cart_Test.php index 7b026144dc..61e1925cca 100644 --- a/tests/slr_integration/Orders/Cart_Test.php +++ b/tests/slr_integration/Orders/Cart_Test.php @@ -30,7 +30,7 @@ class Cart_Test extends WPTestCase { * @after */ public function truncate_tables(): void { - Sessions_Table::truncate(); + tribe( Sessions_Table::class )->truncate(); } public function test_save_seat_data_for_attendee():void{ diff --git a/tests/slr_integration/Service/Seat_Types_Test.php b/tests/slr_integration/Service/Seat_Types_Test.php index db0793252d..bfae7bc206 100644 --- a/tests/slr_integration/Service/Seat_Types_Test.php +++ b/tests/slr_integration/Service/Seat_Types_Test.php @@ -43,7 +43,7 @@ public function set_up_tickets_commerce(): void { * @after */ public function clean_up(): void { - Seat_Types_Table::truncate(); + tribe( Seat_Types_Table::class )->truncate(); } public function test_update_from_service(): void { From 34f67f92667466bdff94ed00ac883509191ef536 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Mon, 13 Jan 2025 21:15:03 +0200 Subject: [PATCH 12/90] Register ticket blocks assets through stellarwp/assets --- src/Tickets/Blocks/Controller.php | 5 ++ src/Tickets/Blocks/Tickets/Block.php | 69 ++++++++++++++++++++-------- 2 files changed, 56 insertions(+), 18 deletions(-) diff --git a/src/Tickets/Blocks/Controller.php b/src/Tickets/Blocks/Controller.php index a108441ef5..17802a911a 100644 --- a/src/Tickets/Blocks/Controller.php +++ b/src/Tickets/Blocks/Controller.php @@ -23,6 +23,8 @@ use Tribe__Tickets__Editor__Template as Template; use Tribe__Tickets__Editor__Template__Overwrite as Template_Overwrite; use Tribe__Tickets__Ticket_Object as Ticket_Object; +use TEC\Common\StellarWP\Assets\Config; +use Tribe__Tickets__Main as Tickets_Plugin; /** * Class Controller. @@ -38,6 +40,9 @@ class Controller extends \TEC\Common\Contracts\Provider\Controller { * @since 4.9 */ public function do_register(): void { + // Add group path for tickets blocks. + Config::add_group_path( 'et-tickets-blocks', Tickets_Plugin::instance()->plugin_path . 'build/', 'Tickets/Blocks/' ); + // The general warnings class. $this->container->singleton( 'tickets.editor.warnings', Warnings::class, [ 'hook' ] ); diff --git a/src/Tickets/Blocks/Tickets/Block.php b/src/Tickets/Blocks/Tickets/Block.php index 0682517bee..bf127a5b6a 100644 --- a/src/Tickets/Blocks/Tickets/Block.php +++ b/src/Tickets/Blocks/Tickets/Block.php @@ -18,6 +18,7 @@ use Tribe__Tickets__Tickets as Tickets; use Tribe__Tickets__Tickets_Handler as Tickets_Handler; use Tribe__Tickets__Tickets_View as Tickets_View; +use TEC\Common\Asset; /** * Class Block. @@ -27,6 +28,34 @@ * @package TEC\Tickets\Blocks\Tickets; */ class Block extends Abstract_Block { + + /** + * The slug of the editor script. + * + * @since TBD + * + * @var string + */ + public const EDITOR_SCRIPT_SLUG = 'tec-tickets-tickets-block-editor-script'; + + /** + * The slug of the editor style. + * + * @since TBD + * + * @var string + */ + public const EDITOR_STYLE_SLUG = 'tec-tickets-tickets-block-editor-style'; + + /** + * The slug of the frontend script. + * + * @since TBD + * + * @var string + */ + public const FRONTEND_SCRIPT_SLUG = 'tribe-tickets-block'; + /** * Hooks the block on the required actions. * @@ -80,7 +109,7 @@ public function assets() { tribe_asset( $plugin, - 'tribe-tickets-block', + self::FRONTEND_SCRIPT_SLUG, $tickets_js, [ 'jquery', @@ -359,27 +388,31 @@ public function get_registration_args( array $args ): array { * Registers the editor scripts. * * @since 5.8.0 + * @since TBD - Changed from WP methods to StellarWP/assets. * * @return void */ public function register_editor_scripts() { - $plugin = Tickets_Main::instance(); - $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; - - // Using WordPress functions to register since we just need to register them. - wp_register_script( - 'tec-tickets-tickets-block-editor-script', - $plugin->plugin_url . "build/Tickets/Blocks/Tickets/editor{$min}.js", - [ 'tribe-common-gutenberg-vendor', 'tribe-tickets-gutenberg-vendor' ], - Tickets_Main::VERSION, - [ 'in_footer' => false ] - ); - - wp_register_style( - 'tec-tickets-tickets-block-editor-style', - $plugin->plugin_url . "build/Tickets/Blocks/Tickets/editor{$min}.css", - [ 'tribe-tickets-gutenberg-main-styles' ], + Asset::add( + self::EDITOR_SCRIPT_SLUG, + 'Tickets/editor.js', Tickets_Main::VERSION - ); + ) + ->add_to_group_path( 'et-tickets-blocks' ) + ->set_dependencies( + 'tribe-tickets-gutenberg-vendor', + 'tribe-common-gutenberg-vendor' + ) + ->in_header() + ->register(); + + Asset::add( + self::EDITOR_STYLE_SLUG, + 'Tickets/editor.css', + Tickets_Main::VERSION + ) + ->add_to_group_path( 'et-tickets-blocks' ) + ->set_dependencies( 'tribe-tickets-gutenberg-main-styles' ) + ->register(); } } From eabaf26e462af7db347095d93ab183cf15138854 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Tue, 14 Jan 2025 14:53:24 +0200 Subject: [PATCH 13/90] Tickets Block InspectorControls through filters --- .../Tickets/app/editor/controls/template.js | 42 ++++++++++++++++--- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/src/Tickets/Blocks/Tickets/app/editor/controls/template.js b/src/Tickets/Blocks/Tickets/app/editor/controls/template.js index d0124afcf2..eb7556309d 100644 --- a/src/Tickets/Blocks/Tickets/app/editor/controls/template.js +++ b/src/Tickets/Blocks/Tickets/app/editor/controls/template.js @@ -16,6 +16,7 @@ import { InspectorControls } from '@wordpress/editor'; */ import { TICKET_LABELS } from '@moderntribe/tickets/data/blocks/ticket/constants'; import './style.pcss'; +import { applyFilters } from '@wordpress/hooks'; const RadioInput = ({ provider, onProviderChange, ...additionalProps }) => (
@@ -44,16 +45,32 @@ RadioInput.propTypes = { onProviderChange: PropTypes.func, }; -const Controls = ({ +/** + * Get the block controls for the Tickets block. + * + * @since TBD + * + * @param {Object} props The component properties. + * @param {boolean} props.disabled Whether the controls should be disabled. + * @param {boolean} props.hasMultipleProviders Whether there are multiple providers. + * @param {Node} props.message The message to display. + * @param {Function} props.onProviderChange The function to call when the provider changes. + * @param {Array} props.providers The available providers. + * @param {string} props.selectedProvider The selected provider. + * + * @return {Array} The block controls. + */ +function getTicketsBlockControls({ disabled, hasMultipleProviders, message, onProviderChange, providers, selectedProvider, -}) => - hasMultipleProviders && ( - +}) { + const controls = []; + if (hasMultipleProviders) { + controls.push( - - ); + ); + } + + return applyFilters('tec.tickets.blocks.Tickets.Controls', controls); +} + +const Controls = (props) => { + const controls = getTicketsBlockControls(props); + + if (!controls.length) { + return null; + } + + return {controls}; +}; Controls.propTypes = { disabled: PropTypes.bool, From 78b61ffa4740dd671a48fd2ed986c5c3855f1718 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Tue, 14 Jan 2025 15:04:58 +0200 Subject: [PATCH 14/90] test coverage for assets registration --- .../integration/TEC/Tickets/Blocks/Tickets/BlockTest.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/integration/TEC/Tickets/Blocks/Tickets/BlockTest.php b/tests/integration/TEC/Tickets/Blocks/Tickets/BlockTest.php index f52dccd33f..1c055a21e1 100644 --- a/tests/integration/TEC/Tickets/Blocks/Tickets/BlockTest.php +++ b/tests/integration/TEC/Tickets/Blocks/Tickets/BlockTest.php @@ -4,6 +4,7 @@ use Codeception\TestCase\WPTestCase; use tad\Codeception\SnapshotAssertions\SnapshotAssertions; +use TEC\Common\StellarWP\Assets\Assets; class BlockTest extends WPTestCase { use SnapshotAssertions; @@ -13,4 +14,11 @@ public function test_get_registration_args(): void { $this->assertMatchesJsonSnapshot( json_encode( $block->get_registration_args( [] ), JSON_PRETTY_PRINT ) ); } + + public function test_assets_source(): void { + tribe( Block::class )->register_editor_scripts(); + + $this->assertEquals( plugins_url( '/build/Tickets/Blocks/Tickets/editor.js', EVENT_TICKETS_MAIN_PLUGIN_FILE ), Assets::init()->get( Block::EDITOR_SCRIPT_SLUG )->get_url( false ) ); + $this->assertEquals( plugins_url( '/build/Tickets/Blocks/Tickets/editor.css', EVENT_TICKETS_MAIN_PLUGIN_FILE ), Assets::init()->get( Block::EDITOR_STYLE_SLUG )->get_url( false ) ); + } } From c6e385448705f05a7d4346e87adad810a572175f Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Tue, 14 Jan 2025 17:28:00 +0200 Subject: [PATCH 15/90] added prettier config --- .prettierrc.js | 1 + package-lock.json | 36 ++++++++++++++++++++++++++++++------ package.json | 11 +++++++++-- 3 files changed, 40 insertions(+), 8 deletions(-) create mode 100644 .prettierrc.js diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000000..e596d24c20 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1 @@ +module.exports = require('@wordpress/prettier-config'); diff --git a/package-lock.json b/package-lock.json index b88ce7f902..3ae5d7622a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "event-tickets", - "version": "5.14.0", + "version": "5.18.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "event-tickets", - "version": "5.14.0", + "version": "5.18.0", "hasInstallScript": true, "dependencies": { "@babel/runtime": "^7.15.3", @@ -59,6 +59,7 @@ "@types/node": "^20.10.6", "@wordpress/eslint-plugin": "^17.2.0", "@wordpress/hooks": "^1.3.2", + "@wordpress/prettier-config": "^4.15.0", "cross-env": "^5.2.0", "dotenv": "^16.3.1", "enzyme": "^3.7.0", @@ -4087,6 +4088,18 @@ "node": ">=16" } }, + "node_modules/@wordpress/eslint-plugin/node_modules/@wordpress/prettier-config": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/@wordpress/prettier-config/-/prettier-config-3.15.0.tgz", + "integrity": "sha512-exC2rkEioTt//AnzPRyaaFv8FNYIvamPDytNol5bKQ6Qh65QSdZZE9V+GtRCrIPL7/Bq6xba03XuRVxl9TjtJg==", + "dev": true, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "prettier": ">=3" + } + }, "node_modules/@wordpress/eslint-plugin/node_modules/comment-parser": { "version": "1.4.0", "dev": true, @@ -4269,11 +4282,13 @@ } }, "node_modules/@wordpress/prettier-config": { - "version": "3.2.0", + "version": "4.15.0", + "resolved": "https://registry.npmjs.org/@wordpress/prettier-config/-/prettier-config-4.15.0.tgz", + "integrity": "sha512-e5GZCnbm65cXbndAX/lAEpeixTetlXofJ6xk93ppm9bt9Y6RkUVe3+LfNlc6AYpRAt97BGIBEG7CXtMPVEz1ew==", "dev": true, - "license": "GPL-2.0-or-later", "engines": { - "node": ">=14" + "node": ">=18.12.0", + "npm": ">=8.19.2" }, "peerDependencies": { "prettier": ">=3" @@ -30939,6 +30954,13 @@ "jsdoc-type-pratt-parser": "~4.0.0" } }, + "@wordpress/prettier-config": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/@wordpress/prettier-config/-/prettier-config-3.15.0.tgz", + "integrity": "sha512-exC2rkEioTt//AnzPRyaaFv8FNYIvamPDytNol5bKQ6Qh65QSdZZE9V+GtRCrIPL7/Bq6xba03XuRVxl9TjtJg==", + "dev": true, + "requires": {} + }, "comment-parser": { "version": "1.4.0", "dev": true @@ -31055,7 +31077,9 @@ } }, "@wordpress/prettier-config": { - "version": "3.2.0", + "version": "4.15.0", + "resolved": "https://registry.npmjs.org/@wordpress/prettier-config/-/prettier-config-4.15.0.tgz", + "integrity": "sha512-e5GZCnbm65cXbndAX/lAEpeixTetlXofJ6xk93ppm9bt9Y6RkUVe3+LfNlc6AYpRAt97BGIBEG7CXtMPVEz1ew==", "dev": true, "requires": {} }, diff --git a/package.json b/package.json index 17521c014e..33cc7a2649 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,10 @@ "_glotPressUrl": "https://translate.wordpress.org", "_glotPressSlug": "wp-plugins/event-tickets/stable", "_glotPressFileFormat": "%textdomain%-%wp_locale%.%format%", - "_glotPressFormats": ["po", "mo"], + "_glotPressFormats": [ + "po", + "mo" + ], "_glotPressFilter": { "translation_sets": false, "minimum_percentage": 30, @@ -80,13 +83,17 @@ "glotpress": "gulp glotpress", "changelog": "./vendor/bin/changelogger add" }, - "engines": { "node": "18.13.0", "npm": "8.19.3" }, + "engines": { + "node": "18.13.0", + "npm": "8.19.3" + }, "devDependencies": { "@playwright/test": "^1.44.0", "@the-events-calendar/product-taskmaster": "^3.0.0", "@types/node": "^20.10.6", "@wordpress/eslint-plugin": "^17.2.0", "@wordpress/hooks": "^1.3.2", + "@wordpress/prettier-config": "^4.15.0", "cross-env": "^5.2.0", "dotenv": "^16.3.1", "enzyme": "^3.7.0", From 14de1c4fc2afbdeadf67f6f460ceea9c82d59f41 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Tue, 14 Jan 2025 20:51:03 +0200 Subject: [PATCH 16/90] Enriches ticket management hooks --- src/modules/data/blocks/ticket/sagas.js | 136 ++++++++++++++---------- 1 file changed, 79 insertions(+), 57 deletions(-) diff --git a/src/modules/data/blocks/ticket/sagas.js b/src/modules/data/blocks/ticket/sagas.js index 5e8b011150..9488d27631 100644 --- a/src/modules/data/blocks/ticket/sagas.js +++ b/src/modules/data/blocks/ticket/sagas.js @@ -645,34 +645,36 @@ export function* createNewTicket( action ) { select( selectors.getTicketTempSaleEndDateMoment, props ), ] ); + const ticketDetails = { + title, + description, + price, + sku, + iac, + startDate, + startDateInput, + startDateMoment, + endDate, + endDateInput, + endDateMoment, + startTime, + endTime, + startTimeInput, + endTimeInput, + capacityType, + capacity, + salePriceChecked, + salePrice, + saleStartDate, + saleStartDateInput, + saleStartDateMoment, + saleEndDate, + saleEndDateInput, + saleEndDateMoment, + }; + yield all( [ - put( actions.setTicketDetails( clientId, { - title, - description, - price, - sku, - iac, - startDate, - startDateInput, - startDateMoment, - endDate, - endDateInput, - endDateMoment, - startTime, - endTime, - startTimeInput, - endTimeInput, - capacityType, - capacity, - salePriceChecked, - salePrice, - saleStartDate, - saleStartDateInput, - saleStartDateMoment, - saleEndDate, - saleEndDateInput, - saleEndDateMoment, - } ) ), + put( actions.setTicketDetails( clientId, ticketDetails ) ), put( actions.setTempSalePriceChecked( clientId, salePriceChecked ) ), put( actions.setTempSalePrice( clientId, salePrice ) ), put( actions.setTicketId( clientId, ticket.id ) ), @@ -689,9 +691,13 @@ export function* createNewTicket( action ) { * Fires after the ticket has been created. * * @since 5.16.0 + * @since TBD The `ticketId` and `ticketDetails` parameters were added. + * * @param {string} clientId The ticket's client ID. + * @param {number} ticketId The ticket's ID. + * @param {Object} ticketDetails The ticket details. */ - doAction( 'tec.tickets.blocks.ticketCreated', clientId ); + doAction( 'tec.tickets.blocks.ticketCreated', clientId, ticket.id, ticketDetails ); yield fork( saveTicketWithPostSave, clientId ); } @@ -794,35 +800,37 @@ export function* updateTicket( action ) { select( selectors.getTicketTempCapacity, props ), ] ); + const ticketDetails = { + title, + description, + price, + on_sale, + sku, + iac, + startDate, + startDateInput, + startDateMoment, + endDate, + endDateInput, + endDateMoment, + startTime, + endTime, + startTimeInput, + endTimeInput, + capacityType, + capacity, + salePriceChecked, + salePrice, + saleStartDate, + saleStartDateInput, + saleStartDateMoment, + saleEndDate, + saleEndDateInput, + saleEndDateMoment, + } + yield all( [ - put( actions.setTicketDetails( clientId, { - title, - description, - price, - on_sale, - sku, - iac, - startDate, - startDateInput, - startDateMoment, - endDate, - endDateInput, - endDateMoment, - startTime, - endTime, - startTimeInput, - endTimeInput, - capacityType, - capacity, - salePriceChecked, - salePrice, - saleStartDate, - saleStartDateInput, - saleStartDateMoment, - saleEndDate, - saleEndDateInput, - saleEndDateMoment, - } ) ), + put( actions.setTicketDetails( clientId, ticketDetails ) ), put( actions.setTicketSold( clientId, capacity_details.sold ) ), put( actions.setTicketAvailable( clientId, available ) ), put( actions.setTicketHasChanges( clientId, false ) ), @@ -840,9 +848,13 @@ export function* updateTicket( action ) { * Fires after the ticket has been updated. * * @since 5.16.0 + * @since TBD The `ticketId and `ticketDetails` parameters were added + * * @param {string} clientId The ticket's client ID. + * @param {number} ticketId The ticket's ID. + * @param {Object} ticketDetails The ticket details. */ - doAction( 'tec.tickets.blocks.ticketUpdated', clientId ); + doAction( 'tec.tickets.blocks.ticketUpdated', clientId, ticketId, ticketDetails ); } } catch ( e ) { console.error( e ); @@ -903,6 +915,16 @@ export function* deleteTicket( action ) { body: body.join( '&' ), }, } ); + + /** + * Fires after the ticket has been deleted. + * + * @since TBD + * + * @param {string} clientId The ticket's client ID. + * @param {number} ticketId The ticket's ID. + */ + doAction( 'tec.tickets.blocks.ticketDeleted', clientId, ticketId ); } catch ( e ) { /** * @todo handle error on removal From eaa24dbc7b45b9d2bde4d81e6e011144928200e5 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Tue, 14 Jan 2025 20:54:30 +0200 Subject: [PATCH 17/90] add changelog --- changelog/feat-enrich-ticket-management-hooks | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelog/feat-enrich-ticket-management-hooks diff --git a/changelog/feat-enrich-ticket-management-hooks b/changelog/feat-enrich-ticket-management-hooks new file mode 100644 index 0000000000..1879456be8 --- /dev/null +++ b/changelog/feat-enrich-ticket-management-hooks @@ -0,0 +1,4 @@ +Significance: patch +Type: tweak + +Enrich ticket management JS hooks. From f49b429fd0d741dd9fcbf14a1ff207b7a70bf713 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Tue, 14 Jan 2025 21:00:22 +0200 Subject: [PATCH 18/90] Update sagas.js Co-authored-by: Mike Cotton --- src/modules/data/blocks/ticket/sagas.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/data/blocks/ticket/sagas.js b/src/modules/data/blocks/ticket/sagas.js index 9488d27631..0a36098f5a 100644 --- a/src/modules/data/blocks/ticket/sagas.js +++ b/src/modules/data/blocks/ticket/sagas.js @@ -827,7 +827,7 @@ export function* updateTicket( action ) { saleEndDate, saleEndDateInput, saleEndDateMoment, - } + }; yield all( [ put( actions.setTicketDetails( clientId, ticketDetails ) ), From 4a257da3d8834d12ae20dc7c4d745b7b0ba66924 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 15 Jan 2025 17:32:35 +0200 Subject: [PATCH 19/90] rsvp block controls --- src/modules/blocks/rsvp/template.js | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/modules/blocks/rsvp/template.js b/src/modules/blocks/rsvp/template.js index 37d44fcac4..723fb34999 100644 --- a/src/modules/blocks/rsvp/template.js +++ b/src/modules/blocks/rsvp/template.js @@ -10,6 +10,8 @@ import classNames from 'classnames'; */ import { Spinner, Button } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; +import { InspectorControls } from '@wordpress/editor'; +import { applyFilters } from '@wordpress/hooks'; /** * Internal dependencies @@ -22,6 +24,38 @@ import MoveModal from '@moderntribe/tickets/elements/move-modal'; import { Card } from '@moderntribe/tickets/elements'; import './style.pcss'; +/** + * Get the block controls for the RSVP block. + * + * @since TBD + * + * @param {Object} props The component properties. + * + * @return {Array} The block controls. + */ +function getRSVPBlockControls(props) { + const controls = []; + + /** + * Filters the RSVP block controls. + * + * @since TBD + * + * @param {Array} controls The existing controls. + */ + return applyFilters('tec.tickets.blocks.RSVP.Controls', controls); +} + +const RSVPControls = (props) => { + const controls = getRSVPBlockControls(props); + + if (!controls.length) { + return null; + } + + return {controls}; +}; + const RSVP = ( { clientId, created, @@ -86,6 +120,7 @@ const RSVP = ( { } { isSettingsOpen && } { isModalShowing && } +
); }; From 46dc87a6de5b6c25f07f5fd42ca679aed681dbd0 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 15 Jan 2025 17:32:41 +0200 Subject: [PATCH 20/90] docs update --- src/Tickets/Blocks/Tickets/app/editor/controls/template.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Tickets/Blocks/Tickets/app/editor/controls/template.js b/src/Tickets/Blocks/Tickets/app/editor/controls/template.js index eb7556309d..9433c88076 100644 --- a/src/Tickets/Blocks/Tickets/app/editor/controls/template.js +++ b/src/Tickets/Blocks/Tickets/app/editor/controls/template.js @@ -107,6 +107,13 @@ function getTicketsBlockControls({ ); } + /** + * Filters the controls for the Tickets block. + * + * @since TBD + * + * @param {Array} controls The controls. + */ return applyFilters('tec.tickets.blocks.Tickets.Controls', controls); } From a6dcf03458149022065ea120b48f9769ba59da71 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 15 Jan 2025 17:32:50 +0200 Subject: [PATCH 21/90] rsvp management hooks --- src/modules/data/blocks/rsvp/thunks.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/modules/data/blocks/rsvp/thunks.js b/src/modules/data/blocks/rsvp/thunks.js index befd54cc8b..1b0d519c69 100644 --- a/src/modules/data/blocks/rsvp/thunks.js +++ b/src/modules/data/blocks/rsvp/thunks.js @@ -5,6 +5,7 @@ import * as actions from './actions'; import * as utils from '@moderntribe/tickets/data/utils'; import { middlewares } from '@moderntribe/common/store'; import { globals, time, moment as momentUtil } from '@moderntribe/common/utils'; +import { doAction } from '@wordpress/hooks'; const { request: { actions: wpRequestActions, @@ -85,6 +86,16 @@ const createOrUpdateRSVP = ( method ) => ( payload ) => ( dispatch ) => { }; dispatch( wpRequestActions.wpRequest( options ) ); + + /** + * Fires after an RSVP is created or updated. + * + * @since TBD + * + * @param {Object} payload The RSVP payload. + * @param {boolean} isCreate Whether the RSVP was created or not. + */ + doAction( 'tec.tickets.blocks.rsvp.createdOrUpdated', payload, method === METHODS.POST ); }; export const createRSVP = createOrUpdateRSVP( METHODS.POST ); @@ -101,6 +112,15 @@ export const deleteRSVP = ( id ) => ( dispatch ) => { }; dispatch( wpRequestActions.wpRequest( options ) ); + + /** + * Fires after an RSVP is deleted. + * + * @since TBD + * + * @param {number} id The RSVP ID. + */ + doAction( 'tec.tickets.blocks.rsvp.deleted', id ); }; export const getRSVP = ( postId, page = 1 ) => ( dispatch ) => { From 9c30e2b5188a525bd167031e2f8842edd446d02d Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 15 Jan 2025 17:38:16 +0200 Subject: [PATCH 22/90] added changelog --- changelog/feat-more-rsvp-hooks | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelog/feat-more-rsvp-hooks diff --git a/changelog/feat-more-rsvp-hooks b/changelog/feat-more-rsvp-hooks new file mode 100644 index 0000000000..2bd07aeb92 --- /dev/null +++ b/changelog/feat-more-rsvp-hooks @@ -0,0 +1,4 @@ +Significance: patch +Type: tweak + +Introduced hooks that fire during RSVP creation/update/deletion while in the block editor. From dfd122e7855ba653845ad1702577861a61510119 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 15 Jan 2025 17:38:21 +0200 Subject: [PATCH 23/90] amend linter comments --- src/modules/blocks/rsvp/template.js | 13 +++++-------- src/modules/data/blocks/rsvp/thunks.js | 2 -- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/modules/blocks/rsvp/template.js b/src/modules/blocks/rsvp/template.js index 723fb34999..4776301607 100644 --- a/src/modules/blocks/rsvp/template.js +++ b/src/modules/blocks/rsvp/template.js @@ -28,28 +28,25 @@ import './style.pcss'; * Get the block controls for the RSVP block. * * @since TBD - * * @param {Object} props The component properties. - * * @return {Array} The block controls. */ -function getRSVPBlockControls(props) { +function getRSVPBlockControls() { const controls = []; /** * Filters the RSVP block controls. * * @since TBD - * * @param {Array} controls The existing controls. */ - return applyFilters('tec.tickets.blocks.RSVP.Controls', controls); + return applyFilters( 'tec.tickets.blocks.RSVP.Controls', controls ); } -const RSVPControls = (props) => { - const controls = getRSVPBlockControls(props); +const RSVPControls = () => { + const controls = getRSVPBlockControls(); - if (!controls.length) { + if ( !controls.length ) { return null; } diff --git a/src/modules/data/blocks/rsvp/thunks.js b/src/modules/data/blocks/rsvp/thunks.js index 1b0d519c69..2652f36f20 100644 --- a/src/modules/data/blocks/rsvp/thunks.js +++ b/src/modules/data/blocks/rsvp/thunks.js @@ -91,7 +91,6 @@ const createOrUpdateRSVP = ( method ) => ( payload ) => ( dispatch ) => { * Fires after an RSVP is created or updated. * * @since TBD - * * @param {Object} payload The RSVP payload. * @param {boolean} isCreate Whether the RSVP was created or not. */ @@ -117,7 +116,6 @@ export const deleteRSVP = ( id ) => ( dispatch ) => { * Fires after an RSVP is deleted. * * @since TBD - * * @param {number} id The RSVP ID. */ doAction( 'tec.tickets.blocks.rsvp.deleted', id ); From 5725e5141331ee07d2da4a23c25ab05b41f3d385 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 15 Jan 2025 17:42:15 +0200 Subject: [PATCH 24/90] Update src/modules/blocks/rsvp/template.js Co-authored-by: Mike Cotton --- src/modules/blocks/rsvp/template.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/blocks/rsvp/template.js b/src/modules/blocks/rsvp/template.js index 4776301607..a48bfc1c1f 100644 --- a/src/modules/blocks/rsvp/template.js +++ b/src/modules/blocks/rsvp/template.js @@ -46,7 +46,7 @@ function getRSVPBlockControls() { const RSVPControls = () => { const controls = getRSVPBlockControls(); - if ( !controls.length ) { + if ( ! controls.length ) { return null; } From b1c26e04b56b464766579b35f414914cec29340a Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 15 Jan 2025 17:42:24 +0200 Subject: [PATCH 25/90] Update src/modules/blocks/rsvp/template.js Co-authored-by: Mike Cotton --- src/modules/blocks/rsvp/template.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/modules/blocks/rsvp/template.js b/src/modules/blocks/rsvp/template.js index a48bfc1c1f..714f7e6836 100644 --- a/src/modules/blocks/rsvp/template.js +++ b/src/modules/blocks/rsvp/template.js @@ -28,7 +28,6 @@ import './style.pcss'; * Get the block controls for the RSVP block. * * @since TBD - * @param {Object} props The component properties. * @return {Array} The block controls. */ function getRSVPBlockControls() { From 0edb161cc7d7dccebf778eed72fd124fa3009bbc Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 15 Jan 2025 17:50:05 +0200 Subject: [PATCH 26/90] added docblocks --- src/modules/blocks/rsvp/template.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/modules/blocks/rsvp/template.js b/src/modules/blocks/rsvp/template.js index 4776301607..76cab8c357 100644 --- a/src/modules/blocks/rsvp/template.js +++ b/src/modules/blocks/rsvp/template.js @@ -43,6 +43,12 @@ function getRSVPBlockControls() { return applyFilters( 'tec.tickets.blocks.RSVP.Controls', controls ); } +/** + * The RSVP block controls. + * + * @since TBD + * @return {Node} The RSVP block controls. + */ const RSVPControls = () => { const controls = getRSVPBlockControls(); @@ -53,6 +59,12 @@ const RSVPControls = () => { return {controls}; }; +/** + * The RSVP block. + * + * @param {Object} props The component properties. + * @return {Node} The RSVP block. + */ const RSVP = ( { clientId, created, From 55e6b116251ee14c2a3829c6c2a315d7145f30a9 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 15 Jan 2025 17:53:47 +0200 Subject: [PATCH 27/90] add props docs --- src/modules/blocks/rsvp/template.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/modules/blocks/rsvp/template.js b/src/modules/blocks/rsvp/template.js index b61012376c..ff4718a6a8 100644 --- a/src/modules/blocks/rsvp/template.js +++ b/src/modules/blocks/rsvp/template.js @@ -62,6 +62,19 @@ const RSVPControls = () => { * The RSVP block. * * @param {Object} props The component properties. + * @param {string} props.clientId The client ID of the block. + * @param {boolean} props.created Whether the RSVP was created or not. + * @param {boolean} props.hasRecurrenceRules Whether the event has recurrence rules. + * @param {Function} props.initializeRSVP The function to initialize the RSVP. + * @param {boolean} props.isAddEditOpen Whether the add/edit dashboard is open. + * @param {boolean} props.isInactive Whether the RSVP is inactive. + * @param {boolean} props.isLoading Whether the RSVP is loading. + * @param {boolean} props.isModalShowing Whether the move modal is showing. + * @param {boolean} props.isSelected Whether the RSVP is selected. + * @param {boolean} props.isSettingsOpen Whether the settings dashboard is open. + * @param {boolean} props.noRsvpsOnRecurring Whether there are no RSVPs on recurring events. + * @param {number} props.rsvpId The RSVP ID. + * @param {Function} props.setAddEditClosed The function to set the add/edit dashboard closed. * @return {Node} The RSVP block. */ const RSVP = ( { From 2621fb1453e1e33d6841c2c4353d2c15cd72cd25 Mon Sep 17 00:00:00 2001 From: Stellar Bot <74736843+tec-bot@users.noreply.github.com> Date: Fri, 24 Jan 2025 10:05:44 -0400 Subject: [PATCH 28/90] :fast_forward: https://github.com/the-events-calendar/tribe-common/commit/783d4cbd3055637c25c8b786e5c7309b27a95302 --- common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common b/common index c8beb2a92e..783d4cbd30 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit c8beb2a92ebead4bdb76bfdf3897bf5362f1760d +Subproject commit 783d4cbd3055637c25c8b786e5c7309b27a95302 From 2a5cb2fd154991f54214110b80deaae2136a51a4 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 29 Jan 2025 18:17:42 +0200 Subject: [PATCH 29/90] Fix init of TC module --- src/Tickets/Commerce/Provider.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Tickets/Commerce/Provider.php b/src/Tickets/Commerce/Provider.php index 108a5f80f7..0d96410d1e 100644 --- a/src/Tickets/Commerce/Provider.php +++ b/src/Tickets/Commerce/Provider.php @@ -61,6 +61,9 @@ public function register() { $this->container->singleton( Notice_Handler::class ); $this->container->singleton( Module::class ); + // We need to init for the registration as a module to take place early. + $this->container->get( Module::class ); + $this->container->singleton( Attendee::class ); $this->container->singleton( Order::class ); $this->container->singleton( Ticket::class ); From b747df1b71f4fe02cd66158760488bb2f2d817c6 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 29 Jan 2025 18:24:04 +0200 Subject: [PATCH 30/90] added changelog --- changelog/fix-init-of-tc-module | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelog/fix-init-of-tc-module diff --git a/changelog/fix-init-of-tc-module b/changelog/fix-init-of-tc-module new file mode 100644 index 0000000000..8a63044f59 --- /dev/null +++ b/changelog/fix-init-of-tc-module @@ -0,0 +1,4 @@ +Significance: patch +Type: tweak + +Init TicketsCommerce Module as soon as possible. [ETP-972] From 19cfbc601fdb20e30ba6eb0bc014d2caed2a0a9f Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 29 Jan 2025 18:30:51 +0200 Subject: [PATCH 31/90] Added testcase to cover it --- .../_Load/CommerceModuleLoaded_Test.php | 13 +++++++++++++ tests/commerce_integration/_bootstrap.php | 1 - 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 tests/commerce_integration/_Load/CommerceModuleLoaded_Test.php diff --git a/tests/commerce_integration/_Load/CommerceModuleLoaded_Test.php b/tests/commerce_integration/_Load/CommerceModuleLoaded_Test.php new file mode 100644 index 0000000000..94d1440a95 --- /dev/null +++ b/tests/commerce_integration/_Load/CommerceModuleLoaded_Test.php @@ -0,0 +1,13 @@ +assertArrayHasKey( Module::class, Tickets::modules() ); + } +} diff --git a/tests/commerce_integration/_bootstrap.php b/tests/commerce_integration/_bootstrap.php index 08f855595a..a88ef8530a 100644 --- a/tests/commerce_integration/_bootstrap.php +++ b/tests/commerce_integration/_bootstrap.php @@ -1,7 +1,6 @@ Date: Wed, 29 Jan 2025 19:01:09 +0200 Subject: [PATCH 32/90] deprecate on-demand load of Module --- src/Tickets/Commerce/Hooks.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Tickets/Commerce/Hooks.php b/src/Tickets/Commerce/Hooks.php index 6b99b0f624..deab716989 100644 --- a/src/Tickets/Commerce/Hooks.php +++ b/src/Tickets/Commerce/Hooks.php @@ -65,8 +65,6 @@ protected function add_actions() { // Compatibility Hooks add_action( 'init', [ $this, 'register_event_compatibility_hooks' ] ); - add_action( 'tribe_common_loaded', [ $this, 'load_commerce_module' ] ); - add_action( 'template_redirect', [ $this, 'do_cart_parse_request' ] ); add_action( 'template_redirect', [ $this, 'do_checkout_parse_request' ] ); @@ -482,9 +480,11 @@ public function filter_payments_tab_settings( $settings ) { * Initializes the Module Class. * * @since 5.1.9 + * + * @deprecated TBD */ public function load_commerce_module() { - $this->container->make( Module::class ); + _deprecated_function( __METHOD__, 'TBD' ); } /** From 98613424f8a7da4a217e66b31e3167d8759cdd65 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Thu, 30 Jan 2025 16:42:43 +0200 Subject: [PATCH 33/90] Firing an action when the isUsingAssignedSeating property changes --- src/Tickets/Seating/app/blockEditor/store/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Tickets/Seating/app/blockEditor/store/index.js b/src/Tickets/Seating/app/blockEditor/store/index.js index e54a56e280..7f37928e4d 100644 --- a/src/Tickets/Seating/app/blockEditor/store/index.js +++ b/src/Tickets/Seating/app/blockEditor/store/index.js @@ -4,6 +4,7 @@ import { controls } from './controls'; import { selectors } from './selectors'; import { actions } from './actions'; import { localizedData } from './localized-data'; +import { doAction } from '@wordpress/hooks'; const storeName = 'tec-tickets-seating'; @@ -19,6 +20,15 @@ const store = createReduxStore(storeName, { reducer(state = DEFAULT_STATE, action) { switch (action.type) { case 'SET_USING_ASSIGNED_SEATING': + /** + * Fires every time the isUsingAssignedSeating state property is changed. + * + * @since TBD + * + * @param {boolean} isUsingAssignedSeating Whether the event is using assigned seating + */ + doAction( 'tec.tickets.seating.setUsingAssignedSeating', action.isUsingAssignedSeating ); + return { ...state, isUsingAssignedSeating: action.isUsingAssignedSeating, From eb9d6cf1065e0cfb9709baf9356b7dbafb2e2382 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Thu, 30 Jan 2025 16:47:09 +0200 Subject: [PATCH 34/90] adding changelog --- changelog/feat-adding-hook-for-when-asc-status-changes | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelog/feat-adding-hook-for-when-asc-status-changes diff --git a/changelog/feat-adding-hook-for-when-asc-status-changes b/changelog/feat-adding-hook-for-when-asc-status-changes new file mode 100644 index 0000000000..e31bf4b554 --- /dev/null +++ b/changelog/feat-adding-hook-for-when-asc-status-changes @@ -0,0 +1,4 @@ +Significance: patch +Type: tweak + +Firing a hook `tec.tickets.seating.setUsingAssignedSeating` whenever the isUsingAssignedSeating property is set. [ETP-973] From e002c1d8dc2133707204e4833f9c6e79d109d262 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Thu, 30 Jan 2025 05:03:42 +0200 Subject: [PATCH 35/90] Adding get_columns method to all custom tables --- package.json | 10 ++------- .../Order_Modifier_Relationships.php | 16 ++++++++++++++ .../Custom_Tables/Order_Modifiers.php | 22 +++++++++++++++++++ .../Custom_Tables/Order_Modifiers_Meta.php | 19 ++++++++++++++++ src/Tickets/Seating/Tables/Layouts.php | 18 +++++++++++++++ src/Tickets/Seating/Tables/Maps.php | 16 ++++++++++++++ src/Tickets/Seating/Tables/Seat_Types.php | 17 ++++++++++++++ src/Tickets/Seating/Tables/Sessions.php | 17 ++++++++++++++ 8 files changed, 127 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 489fbb9644..1f6e889c9c 100644 --- a/package.json +++ b/package.json @@ -10,10 +10,7 @@ "_glotPressUrl": "https://translate.wordpress.org", "_glotPressSlug": "wp-plugins/event-tickets/stable", "_glotPressFileFormat": "%textdomain%-%wp_locale%.%format%", - "_glotPressFormats": [ - "po", - "mo" - ], + "_glotPressFormats": ["po", "mo"], "_glotPressFilter": { "translation_sets": false, "minimum_percentage": 30, @@ -83,10 +80,7 @@ "glotpress": "gulp glotpress", "changelog": "./vendor/bin/changelogger add" }, - "engines": { - "node": "18.13.0", - "npm": "8.19.3" - }, + "engines": { "node": "18.13.0", "npm": "8.19.3" }, "devDependencies": { "@playwright/test": "^1.44.0", "@the-events-calendar/product-taskmaster": "^3.0.0", diff --git a/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Order_Modifier_Relationships.php b/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Order_Modifier_Relationships.php index e8a4e3e22a..19095715a6 100644 --- a/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Order_Modifier_Relationships.php +++ b/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Order_Modifier_Relationships.php @@ -52,6 +52,22 @@ class Order_Modifier_Relationships extends Table { */ protected static $uid_column = 'id'; + /** + * An array of all the columns in the table. + * + * @since TBD + * + * @var string[] + */ + public static function get_columns(): array { + return [ + 'id', + 'modifier_id', + 'post_id', + 'post_type', + ]; + } + /** * Returns the table creation SQL in the format supported * by the `dbDelta` function. diff --git a/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Order_Modifiers.php b/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Order_Modifiers.php index 0be32bed3b..ba4fbe7e90 100644 --- a/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Order_Modifiers.php +++ b/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Order_Modifiers.php @@ -52,6 +52,28 @@ class Order_Modifiers extends Table { */ protected static $uid_column = 'id'; + /** + * An array of all the columns in the table. + * + * @since TBD + * + * @var string[] + */ + public static function get_columns(): array { + return [ + 'id', + 'modifier_type', + 'sub_type', + 'raw_amount', + 'display_name', + 'status', + 'created_at', + 'start_time', + 'end_time', + 'updated_at', + ]; + } + /** * Returns the table creation SQL in the format supported * by the `dbDelta` function. diff --git a/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Order_Modifiers_Meta.php b/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Order_Modifiers_Meta.php index 33a89388d1..73cc70cf0e 100644 --- a/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Order_Modifiers_Meta.php +++ b/src/Tickets/Commerce/Order_Modifiers/Custom_Tables/Order_Modifiers_Meta.php @@ -55,6 +55,25 @@ class Order_Modifiers_Meta extends Table { */ protected static $uid_column = 'id'; + /** + * An array of all the columns in the table. + * + * @since TBD + * + * @var string[] + */ + public static function get_columns(): array { + return [ + 'id', + 'order_modifier_id', + 'meta_key', + 'meta_value', + 'priority', + 'created_at', + 'updated_at', + ]; + } + /** * Returns the table creation SQL in the format supported * by the `dbDelta` function. diff --git a/src/Tickets/Seating/Tables/Layouts.php b/src/Tickets/Seating/Tables/Layouts.php index bb3d33d0de..48c1f10648 100644 --- a/src/Tickets/Seating/Tables/Layouts.php +++ b/src/Tickets/Seating/Tables/Layouts.php @@ -64,6 +64,24 @@ class Layouts extends Table { */ protected static $uid_column = 'id'; + /** + * An array of all the columns in the table. + * + * @since TBD + * + * @var string[] + */ + public static function get_columns(): array { + return [ + 'id', + 'name', + 'created_date', + 'map', + 'seats', + 'screenshot_url', + ]; + } + /** * Returns the table creation SQL in the format supported * by the `dbDelta` function. diff --git a/src/Tickets/Seating/Tables/Maps.php b/src/Tickets/Seating/Tables/Maps.php index 47fea972f1..493602fb01 100644 --- a/src/Tickets/Seating/Tables/Maps.php +++ b/src/Tickets/Seating/Tables/Maps.php @@ -64,6 +64,22 @@ class Maps extends Table { */ protected static $uid_column = 'id'; + /** + * An array of all the columns in the table. + * + * @since TBD + * + * @var string[] + */ + public static function get_columns(): array { + return [ + 'id', + 'name', + 'seats', + 'screenshot_url', + ]; + } + /** * Returns the table creation SQL in the format supported * by the `dbDelta` function. diff --git a/src/Tickets/Seating/Tables/Seat_Types.php b/src/Tickets/Seating/Tables/Seat_Types.php index 01dd654e1f..3f5b387f3b 100644 --- a/src/Tickets/Seating/Tables/Seat_Types.php +++ b/src/Tickets/Seating/Tables/Seat_Types.php @@ -65,6 +65,23 @@ class Seat_Types extends Table { */ protected static $uid_column = 'id'; + /** + * An array of all the columns in the table. + * + * @since TBD + * + * @var string[] + */ + public static function get_columns(): array { + return [ + 'id', + 'name', + 'map', + 'layout', + 'seats', + ]; + } + /** * Returns the number of seats for a given seat type. * diff --git a/src/Tickets/Seating/Tables/Sessions.php b/src/Tickets/Seating/Tables/Sessions.php index f3a0c6e939..15eca7b3ce 100644 --- a/src/Tickets/Seating/Tables/Sessions.php +++ b/src/Tickets/Seating/Tables/Sessions.php @@ -99,6 +99,23 @@ public static function remove_expired_sessions(): int { } } + /** + * An array of all the columns in the table. + * + * @since TBD + * + * @var string[] + */ + public static function get_columns(): array { + return [ + 'token', + 'object_id', + 'expiration', + 'reservations', + 'expiration_lock', + ]; + } + /** * Returns the table creation SQL in the format supported * by the `dbDelta` function. From aea21e57a67181aa471db362f6ad9d06a16d23dc Mon Sep 17 00:00:00 2001 From: Stellar Bot <74736843+tec-bot@users.noreply.github.com> Date: Thu, 30 Jan 2025 16:27:02 -0400 Subject: [PATCH 36/90] :fast_forward: https://github.com/the-events-calendar/tribe-common/commit/60b45b386994109b091f31314c0be930c0f5a4fb --- common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common b/common index 783d4cbd30..60b45b3869 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 783d4cbd3055637c25c8b786e5c7309b27a95302 +Subproject commit 60b45b386994109b091f31314c0be930c0f5a4fb From 12bcda48f40b28bbe2c2a521f0d5410c71ba4983 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 31 Jan 2025 00:38:30 +0200 Subject: [PATCH 37/90] Move events ajax response to be outside of tickets commerce --- .../Commerce/Admin_Tables/Orders_Table.php | 2 +- src/Tickets/Commerce/Hooks.php | 41 ++------------- src/Tickets/Hooks.php | 52 +++++++++++++++++++ ...__it_should_match_display__0.snapshot.html | 3 +- 4 files changed, 58 insertions(+), 40 deletions(-) diff --git a/src/Tickets/Commerce/Admin_Tables/Orders_Table.php b/src/Tickets/Commerce/Admin_Tables/Orders_Table.php index 860cf220e3..f79ddecfb9 100644 --- a/src/Tickets/Commerce/Admin_Tables/Orders_Table.php +++ b/src/Tickets/Commerce/Admin_Tables/Orders_Table.php @@ -964,7 +964,7 @@ class='tribe-dropdown' data-freeform="1" data-force-search="1" data-searching-placeholder="" - data-source="tec_tc_order_table_events" + data-source="tec_tickets_list_ticketables_ajax" data-source-nonce="" data-ajax-delay="400" data-ajax-cache="1" diff --git a/src/Tickets/Commerce/Hooks.php b/src/Tickets/Commerce/Hooks.php index deab716989..f6b42b4296 100644 --- a/src/Tickets/Commerce/Hooks.php +++ b/src/Tickets/Commerce/Hooks.php @@ -30,6 +30,7 @@ use WP_Query; use WP_Post; use WP_User_Query; +use TEC\Tickets\Hooks as Tickets_Hooks; /** * Class Hooks. @@ -139,7 +140,6 @@ protected function add_filters() { add_filter( 'tec_tickets_editor_configuration_localized_data', [ $this, 'filter_block_editor_localized_data' ] ); add_action( 'tribe_editor_config', [ $this, 'filter_tickets_editor_config' ] ); add_filter( 'wp_list_table_class_name', [ $this, 'filter_wp_list_table_class_name' ], 10, 2 ); - add_filter( 'tribe_dropdown_tec_tc_order_table_events', [ $this, 'provide_events_results_to_ajax' ], 10, 2 ); add_filter( 'tribe_dropdown_tec_tc_order_table_customers', [ $this, 'provide_customers_results_to_ajax' ], 10, 2 ); add_filter( 'tec_tickets_all_tickets_table_provider_options', [ $this, 'filter_all_tickets_table_provider_options' ] ); @@ -150,6 +150,7 @@ protected function add_filters() { * Provides the results for the events dropdown in the Orders table. * * @since 5.13.0 + * @deprecated TBD * * @param array $results The results. * @param array $search The search. @@ -157,42 +158,8 @@ protected function add_filters() { * @return array */ public function provide_events_results_to_ajax( $results, $search ) { - if ( empty( $search['term'] ) ) { - return $results; - } - - $term = $search['term']; - - $args = [ - 'no_found_rows' => true, - 'update_post_meta_cache' => false, - 'update_post_term_cache' => false, - 'post_type' => (array) tribe_get_option( 'ticket-enabled-post-types', [] ), - 'post_status' => 'any', - 'posts_per_page' => 10, - 's' => $term, - // Default to show most recent first. - 'orderby' => 'ID', - 'order' => 'DESC', - ]; - - $query = new WP_Query( $args ); - - if ( empty( $query->posts ) ) { - return $results; - } - - $results = array_map( - function ( WP_Post $result ) { - return [ - 'id' => $result->ID, - 'text' => get_the_title( $result->ID ), - ]; - }, - $query->posts - ); - - return [ 'results' => $results ]; + _deprecated_function( __METHOD__, 'TBD', Tickets_Hooks::class . '::provide_events_results_to_ajax' ); + return tribe( Tickets_Hooks::class )->provide_events_results_to_ajax( $results, $search ); } /** diff --git a/src/Tickets/Hooks.php b/src/Tickets/Hooks.php index 1085653542..6e6d5c217d 100644 --- a/src/Tickets/Hooks.php +++ b/src/Tickets/Hooks.php @@ -19,6 +19,8 @@ use TEC\Common\Contracts\Service_Provider; use TEC\Tickets\Commerce\Payments_Tab; +use WP_Query; +use WP_Post; /** * Class Hooks. @@ -51,6 +53,55 @@ protected function add_actions() { $this->container->register( Ticket_Cache_Controller::class ); } + /** + * Provides the results for the events dropdown in the Orders table. + * + * @since TBD + * + * @param array $results The results. + * @param array $search The search. + * + * @return array + */ + public function provide_events_results_to_ajax( $results, $search ) { + if ( empty( $search['term'] ) ) { + return $results; + } + + $term = $search['term']; + + $args = [ + 'no_found_rows' => true, + 'update_post_meta_cache' => false, + 'update_post_term_cache' => false, + 'post_type' => (array) tribe_get_option( 'ticket-enabled-post-types', [] ), + 'post_status' => 'any', + 'posts_per_page' => 10, + 's' => $term, + // Default to show most recent first. + 'orderby' => 'ID', + 'order' => 'DESC', + ]; + + $query = new WP_Query( $args ); + + if ( empty( $query->posts ) ) { + return $results; + } + + $results = array_map( + function ( WP_Post $result ) { + return [ + 'id' => $result->ID, + 'text' => get_the_title( $result->ID ), + ]; + }, + $query->posts + ); + + return [ 'results' => $results ]; + } + /** * Generate TicketsCommerce Pages. * @@ -67,5 +118,6 @@ public function generate_payments_pages() { */ protected function add_filters() { add_filter( 'tec_tickets_settings_tabs_ids', [ tribe( Payments_Tab::class ), 'settings_add_tab_id' ] ); + add_filter( 'tribe_dropdown_tec_tickets_list_ticketables_ajax', [ $this, 'provide_events_results_to_ajax' ], 10, 2 ); } } diff --git a/tests/integration/TEC/Tickets/Commerce/Admin_Tables/__snapshots__/Orders_TableTest__it_should_match_display__0.snapshot.html b/tests/integration/TEC/Tickets/Commerce/Admin_Tables/__snapshots__/Orders_TableTest__it_should_match_display__0.snapshot.html index 5f317d01fa..fa9948d5bc 100644 --- a/tests/integration/TEC/Tickets/Commerce/Admin_Tables/__snapshots__/Orders_TableTest__it_should_match_display__0.snapshot.html +++ b/tests/integration/TEC/Tickets/Commerce/Admin_Tables/__snapshots__/Orders_TableTest__it_should_match_display__0.snapshot.html @@ -37,7 +37,7 @@ data-freeform="1" data-force-search="1" data-searching-placeholder="Searching..." - data-source="tec_tc_order_table_events" + data-source="tec_tickets_list_ticketables_ajax" data-source-nonce="1234567890" data-ajax-delay="400" data-ajax-cache="1" @@ -129,4 +129,3 @@
- \ No newline at end of file From 38cb8605242800cdefa5f7f3e62beca69dcbcea5 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 31 Jan 2025 00:43:03 +0200 Subject: [PATCH 38/90] Ignore phpcs --- src/Tickets/Commerce/Hooks.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Tickets/Commerce/Hooks.php b/src/Tickets/Commerce/Hooks.php index f6b42b4296..079d0de73d 100644 --- a/src/Tickets/Commerce/Hooks.php +++ b/src/Tickets/Commerce/Hooks.php @@ -158,6 +158,7 @@ protected function add_filters() { * @return array */ public function provide_events_results_to_ajax( $results, $search ) { + // phpcs:ignore StellarWP.XSS.EscapeOutput.OutputNotEscaped _deprecated_function( __METHOD__, 'TBD', Tickets_Hooks::class . '::provide_events_results_to_ajax' ); return tribe( Tickets_Hooks::class )->provide_events_results_to_ajax( $results, $search ); } From 3460f570ef96723028300504d14fa8c9b1d9a6a7 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 31 Jan 2025 00:44:29 +0200 Subject: [PATCH 39/90] Fix testcase --- .../TEC/Tickets/Commerce/Admin_Tables/Orders_TableTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/integration/TEC/Tickets/Commerce/Admin_Tables/Orders_TableTest.php b/tests/integration/TEC/Tickets/Commerce/Admin_Tables/Orders_TableTest.php index f8c226a57b..67df45c9c2 100644 --- a/tests/integration/TEC/Tickets/Commerce/Admin_Tables/Orders_TableTest.php +++ b/tests/integration/TEC/Tickets/Commerce/Admin_Tables/Orders_TableTest.php @@ -10,6 +10,7 @@ use Tribe\Tickets\Test\Commerce\TicketsCommerce\Ticket_Maker; use Tribe\Tests\Traits\With_Uopz; use TEC\Tickets\Commerce\Hooks; +use TEC\Tickets\Hooks as Tickets_Hooks; use WP_Screen; use WP_Query; use Tribe__Date_Utils as Dates; @@ -235,7 +236,7 @@ public function it_should_provide_results_to_ajax() { $this->prepare_test_data( true ); $test_events = function ( $term ) { - return tribe( Hooks::class )->provide_events_results_to_ajax( [], [ 'term' => $term ] ); + return tribe( Tickets_Hooks::class )->provide_events_results_to_ajax( [], [ 'term' => $term ] ); }; $test_customers = function ( $term ) { From df0d64b07dd7c10aba2447d276fc1d87dbef1567 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 31 Jan 2025 00:46:33 +0200 Subject: [PATCH 40/90] stop test from failing randomly... --- tests/integration/Tribe/Admin/OrderReportTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/integration/Tribe/Admin/OrderReportTest.php b/tests/integration/Tribe/Admin/OrderReportTest.php index 735f0541fb..225d5eab1c 100644 --- a/tests/integration/Tribe/Admin/OrderReportTest.php +++ b/tests/integration/Tribe/Admin/OrderReportTest.php @@ -326,6 +326,20 @@ function (): array { ); } + wp_update_post( + [ + 'ID' => $ticket_id_a, + 'menu_order' => 0, + ] + ); + + wp_update_post( + [ + 'ID' => $ticket_id_b, + 'menu_order' => 1, + ] + ); + return [ $event_id, [ From c1c6aa92833f6abe515d199b15b54bd642130a65 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 31 Jan 2025 00:48:07 +0200 Subject: [PATCH 41/90] added changelog --- ...tweak-move-ajax-response-for-events-out-of-ticketscommerce | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelog/tweak-move-ajax-response-for-events-out-of-ticketscommerce diff --git a/changelog/tweak-move-ajax-response-for-events-out-of-ticketscommerce b/changelog/tweak-move-ajax-response-for-events-out-of-ticketscommerce new file mode 100644 index 0000000000..f7ec419004 --- /dev/null +++ b/changelog/tweak-move-ajax-response-for-events-out-of-ticketscommerce @@ -0,0 +1,4 @@ +Significance: patch +Type: tweak + +Move method `provide_events_results_to_ajax` one level higher so that it loads regardless of Tickets Commerce. [ETP-976] From d4667221bb6b8b0bc1e57a826d796c5fc6924030 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 31 Jan 2025 00:53:57 +0200 Subject: [PATCH 42/90] Orders orders is on date NOT on menu order --- .../Tribe/Tickets/OrderReportTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/ft_integration/Tribe/Tickets/OrderReportTest.php b/tests/ft_integration/Tribe/Tickets/OrderReportTest.php index a95109c45c..64711ed6d8 100644 --- a/tests/ft_integration/Tribe/Tickets/OrderReportTest.php +++ b/tests/ft_integration/Tribe/Tickets/OrderReportTest.php @@ -179,6 +179,23 @@ function (): array { wp_update_post( [ 'ID' => $order_a->ID, 'menu_order' => 0 ] ); wp_update_post( [ 'ID' => $order_b->ID, 'menu_order' => 1 ] ); + // Manually set the `post_date` of each order in sequence to ensure the order is consistent in the snapshot. + global $wpdb; + foreach ( + [ + $order_a->ID => '2022-01-01 00:00:00', + $order_b->ID => '2022-01-02 00:00:00', + ] as $order_id => $post_date + ) { + $wpdb->query( + $wpdb->prepare( + "UPDATE {$wpdb->posts} SET post_date = %s WHERE ID = %d", + $post_date, + $order_id + ) + ); + } + return [ $series_id, [ $series_id, $series_pass_id_a, $order_a->ID, $order_b->ID ] ]; } ]; From 7c0ca7645696f85434bfac6d90c3b905ca413612 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 5 Feb 2025 15:26:53 +0200 Subject: [PATCH 43/90] Clear ticket and parent event cache on ticket creation --- tests/_support/Commerce/Ticket_Maker.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/_support/Commerce/Ticket_Maker.php b/tests/_support/Commerce/Ticket_Maker.php index 2d72f074c3..50fb5b4c5c 100644 --- a/tests/_support/Commerce/Ticket_Maker.php +++ b/tests/_support/Commerce/Ticket_Maker.php @@ -45,7 +45,10 @@ protected function create_ticket( $provider, $post_id, $price = 1, array $overri $tickets_handler = tribe( 'tickets.handler' ); update_post_meta( $post_id, $tickets_handler->key_provider_field, get_class( $provider_class ) ); - return $provider_class->ticket_add( $post_id, $data ); + $id = $provider_class->ticket_add( $post_id, $data ); + + wp_cache_flush_group( 'post-queries' ); + return $id; } /** From 15e837b3f9b17647908056cf81c08a17b2db0135 Mon Sep 17 00:00:00 2001 From: Stellar Bot <74736843+tec-bot@users.noreply.github.com> Date: Thu, 6 Feb 2025 21:12:48 -0400 Subject: [PATCH 44/90] :fast_forward: https://github.com/the-events-calendar/tribe-common/commit/e363a5663cb4313e6971bd9ffa10e8aa1bcced87 --- common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common b/common index 60b45b3869..e363a5663c 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 60b45b386994109b091f31314c0be930c0f5a4fb +Subproject commit e363a5663cb4313e6971bd9ffa10e8aa1bcced87 From cdc86a0e448eda0e419857288e1c6939d60a5ffa Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 7 Feb 2025 01:45:08 +0200 Subject: [PATCH 45/90] Adds Ticket actions for ticket goes on sale, ticket sale ended and ticket stock changed. --- src/Tickets/Provider.php | 3 + src/Tickets/Ticket_Actions.php | 468 ++++++++++++++++++ src/Tribe/Tickets.php | 12 + tests/_support/Commerce/RSVP/Ticket_Maker.php | 23 + tests/_support/Commerce/Ticket_Maker.php | 29 +- .../TEC/Tickets/Ticket_Actions_Test.php | 453 +++++++++++++++++ 6 files changed, 987 insertions(+), 1 deletion(-) create mode 100644 src/Tickets/Ticket_Actions.php create mode 100644 tests/integration/TEC/Tickets/Ticket_Actions_Test.php diff --git a/src/Tickets/Provider.php b/src/Tickets/Provider.php index 69c638e2f5..2ab5cf6ae3 100644 --- a/src/Tickets/Provider.php +++ b/src/Tickets/Provider.php @@ -100,6 +100,9 @@ public function register() { // Seating. $this->container->register( Seating\Controller::class ); + // Ticket Action hooks. + $this->container->register( Ticket_Actions::class ); + $this->has_registered = true; return true; diff --git a/src/Tickets/Ticket_Actions.php b/src/Tickets/Ticket_Actions.php new file mode 100644 index 0000000000..2ccf265169 --- /dev/null +++ b/src/Tickets/Ticket_Actions.php @@ -0,0 +1,468 @@ +fire_ticket_date_action( $ticket_id ); + } + + /** + * Fires the ticket end sales action. + * + * @since TBD + * + * @param int $ticket_id The ticket ID. + * + * @return void + */ + public function fire_ticket_end_date_action( int $ticket_id ): void { + as_unschedule_action( self::TICKET_END_SALES_HOOK, [ $ticket_id ], self::AS_TICKET_ACTIONS_GROUP ); + $this->fire_ticket_date_action( $ticket_id, false ); + } + + /** + * Listens for changes to the _stock meta key. + * + * If a change is found and the change is for a Ticket Object, the event is fired. + * + * @since TBD + * + * @param int $meta_id The meta ID. + * @param int $ticket_id The ticket ID. + * @param string $meta_key The meta key. + */ + public function fire_stock_update_action( int $meta_id, int $ticket_id, string $meta_key ): void { + if ( Ticket::$stock_meta_key !== $meta_key ) { + // Not a stock update. + return; + } + + $ticket = Tickets::load_ticket_object( $ticket_id ); + + if ( ! $ticket instanceof Ticket_Object ) { + // Not a ticket object. + return; + } + + $event = $ticket->get_event(); + + if ( ! $event instanceof WP_Post || 1 > $event->ID ) { + // Parent event, no longer exists. + return; + } + + /** + * Fires when the stock of a ticket changes. + * + * @since TBD + * + * @param Ticket_Object $ticket The ticket object. + * @param WP_Post $event The event post object. + */ + do_action( 'tec_tickets_ticket_stock_changed', $ticket, $event ); + } + + /** + * Syncs ticket dates actions. + * + * @since TBD + * + * @param int $meta_id The meta ID. + * @param int $ticket_id The ticket id. + * @param string $meta_key The meta key. + * + * @return void + */ + public function sync_ticket_dates_actions( int $ticket_id ): void { + $ticket = Tickets::load_ticket_object( $ticket_id ); + + if ( ! $ticket instanceof Ticket_Object ) { + // Not a ticket anymore? + return; + } + + $event = $ticket->get_event(); + + if ( ! $event instanceof WP_Post || 1 > $event->ID ) { + // Parent event, no longer exists. + return; + } + + $ticket_start_timestamp = $ticket->start_date(); + $ticket_end_timestamp = $ticket->end_date(); + + if ( ! $ticket_start_timestamp || ! $ticket_end_timestamp ) { + // No timestamps... we might be too early. Lets wait. + return; + } + + $this->sync_action_scheduler_date_actions( $ticket->ID, $ticket_start_timestamp, $ticket_end_timestamp ); + + /** + * Fires when the dates of a ticket are updated. + * + * @since TBD + * + * @param int $ticket_id The ticket ID. + * @param int $ticket_start_timestamp The ticket start timestamp. + * @param int $ticket_end_timestamp The ticket end timestamp. + * @param int $parent_id The parent event ID. + */ + do_action( 'tec_tickets_ticket_dates_updated', $ticket->ID, $ticket_start_timestamp, $ticket_end_timestamp, $event->ID ); + } + + /** + * Syncs rsvp dates actions. + * + * @since TBD + * + * @param int $meta_id The meta ID. + * @param int $ticket_id The ticket id. + * @param string $meta_key The meta key. + * + * @return void + */ + public function sync_rsvp_dates_actions( int $meta_id, int $ticket_id, string $meta_key ): void { + /** @var Tribe__Tickets__Tickets_Handler $tickets_handler */ + $tickets_handler = tribe( 'tickets.handler' ); + + $keys_of_interest = [ + $tickets_handler->key_start_date, + $tickets_handler->key_start_time, + $tickets_handler->key_end_date, + $tickets_handler->key_end_time + ]; + + if ( ! in_array( $meta_key, $keys_of_interest, true ) ) { + return; + } + + if ( 'tribe_rsvp_tickets' !== get_post_type( $ticket_id ) ) { + return; + } + + $ticket = Tickets::load_ticket_object( $ticket_id ); + + if ( ! $ticket instanceof Ticket_Object ) { + // Not a ticket anymore... + return; + } + + $event = $ticket->get_event(); + + if ( ! $event instanceof WP_Post || 1 > $event->ID ) { + // Parent event, no longer exists. + return; + } + + $cache = tribe_cache(); + $cache_key = __METHOD__ . $ticket_id; + + /** + * This is hooking into the save/update process of an RSVP ticket. + * + * More specifically we are hooking into the save/update of specific meta keys that are related to the rsvp's start and end date. + * + * During the request, these may be multiple and the most important issue is that they WILL be one by one. + * + * e.g. + * + * Save start date first, save end date second and so on. + * + * We don't want to fire the action multiple times. so if we reached this point we delegate the syncing to happen later. + */ + if ( ! empty( $cache[ $cache_key ] ) ) { + return; + } + + $cache[ $cache_key ] = true; + + add_action( + 'tec_shutdown', + function () use ( $ticket_id ) { + $this->sync_ticket_dates_actions( $ticket_id ); + } + ); + } + + /** + * Fires the ticket date action. + * + * @since TBD + * + * @param int $ticket_id The ticket ID. + * @param bool $is_start Whether the action is for the start or end date. + * + * @return void + */ + protected function fire_ticket_date_action( int $ticket_id, bool $is_start = true ): void { + $ticket = Tickets::load_ticket_object( $ticket_id ); + + if ( ! $ticket instanceof Ticket_Object ) { + // Not a ticket anymore... + return; + } + + $event = $ticket->get_event(); + + if ( ! $event instanceof WP_Post || 1 > $event->ID ) { + // Parent event, no longer exists. + return; + } + + $its_happening = true; + + $prefix = $is_start ? 'start' : 'end'; + + $method = "{$prefix}_date"; + $timestamp = $ticket->$method(); + + if ( ! $timestamp ) { + // No timestamp... + return; + } + + if ( time() + 30 < $timestamp ) { + $its_happening = false; + $method = "schedule_date_{$prefix}_action"; + // The actual timestamp is not immediate. Lets reschedule closer to the actual event. + $this->$method( $ticket_id, $timestamp ); + } + + try { + /** + * Fires when a ticket's start/end time is almost reached or reached or just reached briefly in the past. + * + * In your callbacks you should use the value of $its_happening to reliably determine if this event is going to be fired + * again in the future or not. If $its_happening is false, the event will be fired again in the future otherwise it won't. + * + * @since TBD + * + * @param int $ticket_id The ticket ID. + * @param bool $its_happening Whether the event is happening or not. + * @param int $timestamp The ticket start/end timestamp. + * @param WP_Post $event The event post object. + */ + do_action( "tec_tickets_ticket_{$prefix}_date_trigger", $ticket_id, $its_happening, $timestamp, $event ); + } catch ( Exception $e ) { + do_action( + 'tribe_log', + 'error', + __( 'Ticket date action failed!', 'event-tickets' ), + [ + 'method' => __METHOD__, + 'error' => $e->getMessage(), + 'code' => $e->getCode(), + 'prefix' => $prefix, + 'timestamp' => $timestamp, + 'its_happening' => $its_happening, + 'now' => time(), + ] + ); + + if ( did_action( 'action_scheduler_before_process_queue' ) ) { + /** + * We are in AS context and AS expects to catch exceptions to mark an action as failed using the exception's message as the reason. + */ + throw $e; + } + } + } + + /** + * Syncs the action scheduler date actions. + * + * @since TBD + * + * @param int $ticket_id The ticket ID. + * @param int $start_timestamp The ticket start date. + * @param int $end_timestamp The ticket end date. + * + * @return void + */ + protected function sync_action_scheduler_date_actions( int $ticket_id, int $start_timestamp, int $end_timestamp ): void { + if ( $start_timestamp >= $end_timestamp ) { + // What is going on ? We cant work with that... + return; + } + + // Unschedule first pre-existing actions. + as_unschedule_action( self::TICKET_START_SALES_HOOK, [ $ticket_id ], self::AS_TICKET_ACTIONS_GROUP ); + as_unschedule_action( self::TICKET_END_SALES_HOOK, [ $ticket_id ], self::AS_TICKET_ACTIONS_GROUP ); + + if ( time() > $end_timestamp ) { + // The ticket has already ended. Do nothing. + return; + } + + $this->schedule_date_start_action( $ticket_id, $start_timestamp ); + $this->schedule_date_end_action( $ticket_id, $end_timestamp ); + } + + /** + * Schedules the ticket start action. + * + * @since TBD + * + * @param int $ticket_id The ticket ID. + * @param int $start_timestamp The ticket start date. + * + * @return void + */ + protected function schedule_date_start_action( int $ticket_id, int $start_timestamp ): void { + $now = time(); + $minus_30_minutes = ( - 30 * MINUTE_IN_SECONDS ); + $minus_20_minutes = ( - 20 * MINUTE_IN_SECONDS ); + $minus_10_minutes = ( - 10 * MINUTE_IN_SECONDS ); + + if ( $now > $start_timestamp ) { + // The ticket has already started. Fire the action immediately. + do_action( self::TICKET_START_SALES_HOOK, $ticket_id ); + return; + } + + if ( $now < ( $start_timestamp + $minus_30_minutes ) ) { + as_schedule_single_action( $start_timestamp + $minus_30_minutes, self::TICKET_START_SALES_HOOK, [ $ticket_id ], self::AS_TICKET_ACTIONS_GROUP ); + return; + } + + if ( $now < ( $start_timestamp + $minus_20_minutes ) ) { + as_schedule_single_action( $start_timestamp + $minus_20_minutes, self::TICKET_START_SALES_HOOK, [ $ticket_id ], self::AS_TICKET_ACTIONS_GROUP ); + return; + } + + if ( $now < ( $start_timestamp + $minus_10_minutes ) ) { + as_schedule_single_action( $start_timestamp + $minus_10_minutes, self::TICKET_START_SALES_HOOK, [ $ticket_id ], self::AS_TICKET_ACTIONS_GROUP ); + return; + } + + as_schedule_single_action( $start_timestamp, self::TICKET_START_SALES_HOOK, [ $ticket_id ], self::AS_TICKET_ACTIONS_GROUP ); + } + + /** + * Schedule the date end action. + * + * @since TBD + * + * @param int $ticket_id The ticket ID. + * @param int $end_timestamp The ticket end date. + * + * @return void + */ + protected function schedule_date_end_action( int $ticket_id, int $end_timestamp ): void { + $now = time(); + $minus_30_minutes = ( - 30 * MINUTE_IN_SECONDS ); + $minus_20_minutes = ( - 20 * MINUTE_IN_SECONDS ); + $minus_10_minutes = ( - 10 * MINUTE_IN_SECONDS ); + + if ( $now < ( $end_timestamp + $minus_30_minutes ) ) { + as_schedule_single_action( $end_timestamp + $minus_30_minutes, self::TICKET_END_SALES_HOOK, [ $ticket_id ], self::AS_TICKET_ACTIONS_GROUP ); + return; + } + + if ( $now < ( $end_timestamp + $minus_20_minutes ) ) { + as_schedule_single_action( $end_timestamp + $minus_20_minutes, self::TICKET_END_SALES_HOOK, [ $ticket_id ], self::AS_TICKET_ACTIONS_GROUP ); + return; + } + + if ( $now < ( $end_timestamp + $minus_10_minutes ) ) { + as_schedule_single_action( $end_timestamp + $minus_10_minutes, self::TICKET_END_SALES_HOOK, [ $ticket_id ], self::AS_TICKET_ACTIONS_GROUP ); + return; + } + + as_schedule_single_action( $end_timestamp, self::TICKET_END_SALES_HOOK, [ $ticket_id ], self::AS_TICKET_ACTIONS_GROUP ); + } +} diff --git a/src/Tribe/Tickets.php b/src/Tribe/Tickets.php index 554f3295e0..8fe5feb1ac 100644 --- a/src/Tribe/Tickets.php +++ b/src/Tribe/Tickets.php @@ -4105,6 +4105,18 @@ public function ticket_add( $post_id, $data ) { $version->update( $ticket->ID ); + /** + * Fired once a ticket's details have been fully saved. + * + * @since TBD + * + * @param int $ticket_id The ticket id that was just added. + * @param int $post_id The ticket parent post ID. + * @param array $raw_data The ticket data that was used to save. + * @param string $class The Commerce engine class name. + */ + do_action( 'tec_tickets_ticket_upserted', $ticket->ID, $post_id, $data, __CLASS__ ); + $this->clear_ticket_cache_for_post( $post_id ); return $save_ticket; diff --git a/tests/_support/Commerce/RSVP/Ticket_Maker.php b/tests/_support/Commerce/RSVP/Ticket_Maker.php index 29f1b93da4..1bdf22dc6b 100644 --- a/tests/_support/Commerce/RSVP/Ticket_Maker.php +++ b/tests/_support/Commerce/RSVP/Ticket_Maker.php @@ -3,6 +3,9 @@ namespace Tribe\Tickets\Test\Commerce\RSVP; use Tribe__Utils__Array as Utils_Array; +use Exception; +use Tribe__Tickets__Tickets as Tickets; +use Tribe__Tickets__Ticket_Object as Ticket_Object; trait Ticket_Maker { @@ -83,6 +86,26 @@ protected function create_rsvp_ticket( $post_id, array $overrides = [] ) { return $ticket_id; } + /** + * Updates an existing RSVP ticket. + * + * @param int $ticket_id The ID of the ticket to update. + * @param array $overrides An array of values to override the default and random generation arguments. + * + * @return int The ticket post ID. + * @throws Exception If the RSVP is not found. + */ + protected function update_rsvp_ticket( $ticket_id, array $overrides ) { + $ticket = Tickets::load_ticket_object( $ticket_id ); + if ( ! $ticket instanceof Ticket_Object ) { + throw new Exception( 'RSVP not found!' ); + } + + $overrides = array_merge( $overrides, [ 'ID' => $ticket->ID ] ); + + return $this->create_rsvp_ticket( $ticket->get_event_id(), $overrides ); + } + protected function create_many_rsvp_tickets( int $count, int $post_id, array $overrides = [] ) { return array_map( function () use ( $post_id, $overrides ) { return $this->create_rsvp_ticket( $post_id, $overrides ); diff --git a/tests/_support/Commerce/Ticket_Maker.php b/tests/_support/Commerce/Ticket_Maker.php index 50fb5b4c5c..fe0db5c6b2 100644 --- a/tests/_support/Commerce/Ticket_Maker.php +++ b/tests/_support/Commerce/Ticket_Maker.php @@ -2,8 +2,11 @@ namespace Tribe\Tickets\Test\Commerce; +use Exception; use Tribe__Tickets__Global_Stock as Global_Stock; use Tribe__Tickets__Tickets_Handler; +use Tribe__Tickets__Tickets as Tickets; +use Tribe__Tickets__Ticket_Object as Ticket_Object; trait Ticket_Maker { @@ -27,7 +30,6 @@ protected function create_ticket( $provider, $post_id, $price = 1, array $overri 'ticket_name' => "Test ticket for {$post_id}", 'ticket_description' => "Test ticket description for {$post_id}", 'ticket_show_description' => 1, - 'ticket_price' => absint( $price ), 'ticket_start_date' => '2020-01-02', 'ticket_start_time' => '08:00:00', 'ticket_end_date' => '2050-03-01', @@ -39,6 +41,10 @@ protected function create_ticket( $provider, $post_id, $price = 1, array $overri ], ]; + if ( null !== $price ) { + $data['ticket_price'] = absint( $price ); + } + $data = array_merge( $data, $overrides ); /** @var Tribe__Tickets__Tickets_Handler $tickets_handler */ @@ -51,6 +57,27 @@ protected function create_ticket( $provider, $post_id, $price = 1, array $overri return $id; } + /** + * Update a ticket. + * + * @param int $ticket_id The ID of the ticket to update. + * @param array $overrides An array of values to override the default and random generation arguments. + * + * @return int|false The new ticket ID or false if not saved. + * + * @throws Exception If the ticket is not found. + */ + protected function update_ticket( $ticket_id, array $overrides ) { + wp_cache_flush_group( 'post-queries' ); + $ticket = Tickets::load_ticket_object( $ticket_id ); + if ( ! $ticket instanceof Ticket_Object ) { + throw new Exception( 'Ticket not found!' ); + } + + $overrides = array_merge( $overrides, [ 'ticket_id' => $ticket->ID ] ); + return $this->create_ticket( $ticket->provider_class, $ticket->get_event_id(), null, $overrides ); + } + /** * Generate multiple tickets for a post - the tickets need not be identical. * diff --git a/tests/integration/TEC/Tickets/Ticket_Actions_Test.php b/tests/integration/TEC/Tickets/Ticket_Actions_Test.php new file mode 100644 index 0000000000..dbc46a46c8 --- /dev/null +++ b/tests/integration/TEC/Tickets/Ticket_Actions_Test.php @@ -0,0 +1,453 @@ + '2050-01-01', + 'ticket_start_time' => '08:00:00', + 'ticket_end_date' => '2050-03-01', + 'ticket_end_time' => '20:00:00', + 'tribe-ticket' => [ + 'mode' => Global_Stock::OWN_STOCK_MODE, + 'capacity' => $capacity_of_all, + ], + ]; + + $after_sales_overrides = [ + 'ticket_start_date' => '2020-01-01', + 'ticket_start_time' => '08:00:00', + 'ticket_end_date' => '2020-03-01', + 'ticket_end_time' => '20:00:00', + 'tribe-ticket' => [ + 'mode' => Global_Stock::OWN_STOCK_MODE, + 'capacity' => $capacity_of_all, + ], + ]; + + $on_sale_overrides = [ + 'ticket_start_date' => '2020-01-01', + 'ticket_start_time' => '08:00:00', + 'ticket_end_date' => '2050-03-01', + 'ticket_end_time' => '20:00:00', + 'tribe-ticket' => [ + 'mode' => Global_Stock::OWN_STOCK_MODE, + 'capacity' => $capacity_of_all, + ], + ]; + + $rsvp_overrides_pre_sale = [ + 'meta_input' => [ + '_ticket_start_date' => '2050-01-01 08:00:00', + '_ticket_end_date' => '2050-03-01 20:00:00', + '_capacity' => $capacity_of_all, + ] + ]; + + $rsvp_overrides_after_sale = [ + 'meta_input' => [ + '_ticket_start_date' => '2020-01-01 08:00:00', + '_ticket_end_date' => '2020-03-01 20:00:00', + '_capacity' => $capacity_of_all, + ] + ]; + + $rsvp_overrides_on_sale = [ + 'meta_input' => [ + '_ticket_start_date' => '2020-01-01 08:00:00', + '_ticket_end_date' => '2050-03-01 20:00:00', + '_capacity' => $capacity_of_all, + ] + ]; + + return [ + 'tickets' => [ + 'pre_sale' => $pre_sale_overrides, + 'after_sale' => $after_sales_overrides, + 'on_sale' => $on_sale_overrides, + ], + 'rsvp' => [ + 'pre_sale' => $rsvp_overrides_pre_sale, + 'after_sale' => $rsvp_overrides_after_sale, + 'on_sale' => $rsvp_overrides_on_sale, + ], + ]; + } + + public function provide_one_ticket_and_one_rsvp(): Generator { + yield 'ticket' => [ + function (): array { + $post_id = $this->factory()->post->create(); + + $data = self::set_up_data(); + + $this->assertEquals( 0, did_action( 'tec_tickets_ticket_dates_updated' ) ); + $this->assertEquals( 0, did_action( 'tec_tickets_ticket_stock_changed' ) ); + + $ticket_id = $this->create_tc_ticket( $post_id, 10, $data['tickets']['pre_sale'] ); + + return [ $post_id, $ticket_id, fn( string $offset ) => $this->update_ticket( $ticket_id, $data['tickets'][ $offset ] ) ]; + } + ]; + yield 'rsvp' => [ + function (): array { + $post_id = $this->factory()->post->create(); + + $data = self::set_up_data(); + + $this->assertEquals( 0, did_action( 'tec_tickets_ticket_dates_updated' ) ); + $this->assertEquals( 0, did_action( 'tec_tickets_ticket_stock_changed' ) ); + + $rsvp_id = $this->create_rsvp_ticket( $post_id, $data['rsvp']['pre_sale'] ); + + do_action( 'tec_shutdown' ); + + return [ + $post_id, + $rsvp_id, + function( string $offset ) use ( $rsvp_id, $data ) { + $result = $this->update_rsvp_ticket( $rsvp_id, $data['rsvp'][ $offset ] ); + do_action( 'tec_shutdown' ); + return $result; + }, + ]; + } + ]; + } + + /** + * @test + * @dataProvider provide_one_ticket_and_one_rsvp + */ + public function it_should_schedule_ticket_date_and_stock_actions( Closure $fixture ): void { + $this->freeze_time( Dates::immutable( '2024-06-13 17:00:00' ) ); + $this->make_controller()->register(); + + [ $post_id, $ticket_id, $updater ] = $fixture(); + + $this->assertEquals( 1, did_action( 'tec_tickets_ticket_dates_updated' ) ); + $this->assertEquals( 1, did_action( 'tec_tickets_ticket_stock_changed' ) ); + + $this->assertCount( + 1, + $this->query_action_scheduler_actions_count( + [ $ticket_id ] + ) + ); + + $this->assertCount( + 1, + $this->query_action_scheduler_actions_count( + [ $ticket_id ], + false + ) + ); + + $this->assertEquals( 0, did_action( $this->controller_class::TICKET_START_SALES_HOOK ) ); + + $updater( 'after_sale' ); + // The stock is now 5 after creation. we need to actually change this to trigger the action. + update_post_meta( $ticket_id, '_stock', 6 ); + + $this->assertEquals( 2, did_action( 'tec_tickets_ticket_dates_updated' ) ); + $this->assertEquals( 2, did_action( 'tec_tickets_ticket_stock_changed' ) ); + + $this->assertCount( + 0, + $this->query_action_scheduler_actions_count( + [ $ticket_id ] + ) + ); + + $this->assertCount( + 0, + $this->query_action_scheduler_actions_count( + [ $ticket_id ], + false + ) + ); + + $this->assertEquals( 0, did_action( $this->controller_class::TICKET_START_SALES_HOOK ) ); + + // Now we update back to 5 the capacity to trigger the action. + // the capacity is part of the $data array. + $updater( 'on_sale' ); + + // The sale start date is in the past, so the action should be fired immediately. + $this->assertEquals( 1, did_action( $this->controller_class::TICKET_START_SALES_HOOK ) ); + + $this->assertEquals( 3, did_action( 'tec_tickets_ticket_dates_updated' ) ); + $this->assertEquals( 3, did_action( 'tec_tickets_ticket_stock_changed' ) ); + + $this->assertCount( + 0, + $this->query_action_scheduler_actions_count( + [ $ticket_id ] + ) + ); + + $this->assertCount( + 1, + $this->query_action_scheduler_actions_count( + [ $ticket_id ], + false + ) + ); + } + + /** + * @test + * @dataProvider provide_one_ticket_and_one_rsvp + */ + public function it_should_fire_actions_and_reschedule_accordingly( Closure $fixture ): void { + $this->freeze_time( Dates::immutable( '2050-01-01 07:00:00' ) ); + + $this->make_controller()->register(); + + [ $post_id, $ticket_id, $updater ] = $fixture(); + + $listeners = [ + 'ticket_id' => null, + 'its_happening' => null, + 'timestamp' => null, + 'event' => null, + ]; + + add_action( 'tec_tickets_ticket_start_date_trigger', function ( $ticket_id, $its_happening, $timestamp, $event ) use ( &$listeners ) { + $listeners['ticket_id'] = $ticket_id; + $listeners['its_happening'] = $its_happening; + $listeners['timestamp'] = $timestamp; + $listeners['event'] = $event; + }, 10, 4 ); + + $this->assertEquals( 0, did_action( 'tec_tickets_ticket_start_date_trigger' ) ); + + $start_actions = $this->query_action_scheduler_actions_count( [ $ticket_id ] ); + + $this->assertCount( 1, $start_actions ); + + $start_action = array_shift( $start_actions ); + + $action_schedule = $start_action->get_schedule(); + + // First one is half an hour ago before its go live timestamp. + $this->assertEquals( '2050-01-01 07:30:00', $action_schedule->get_date()->format( 'Y-m-d H:i:s' ) ); + + // Freeze time when we fire the first action. + $this->freeze_time( Dates::immutable( '2050-01-01 07:30:00' ) ); + + do_action( $this->controller_class::TICKET_START_SALES_HOOK, $ticket_id ); + + $this->assertEquals( 1, did_action( 'tec_tickets_ticket_start_date_trigger' ) ); + $this->assertEquals( $ticket_id, $listeners['ticket_id'] ); + $this->assertFalse( $listeners['its_happening'] ); + $this->assertEquals( strtotime( '2050-01-01 08:00:00' ), $listeners['timestamp'] ); + $this->assertEquals( $post_id, $listeners['event']->ID ); + + $start_actions = $this->query_action_scheduler_actions_count( [ $ticket_id ] ); + + $this->assertCount( 1, $start_actions ); + + $start_action = array_shift( $start_actions ); + + $action_schedule = $start_action->get_schedule(); + + // First one is half an hour ago before its go live timestamp. + $this->assertEquals( '2050-01-01 07:40:00', $action_schedule->get_date()->format( 'Y-m-d H:i:s' ) ); + + // Freeze time when we fire the second action. + $this->freeze_time( Dates::immutable( '2050-01-01 07:40:00' ) ); + + do_action( $this->controller_class::TICKET_START_SALES_HOOK, $ticket_id ); + + $this->assertEquals( 2, did_action( 'tec_tickets_ticket_start_date_trigger' ) ); + $this->assertEquals( $ticket_id, $listeners['ticket_id'] ); + $this->assertFalse( $listeners['its_happening'] ); + $this->assertEquals( strtotime( '2050-01-01 08:00:00' ), $listeners['timestamp'] ); + $this->assertEquals( $post_id, $listeners['event']->ID ); + + $start_actions = $this->query_action_scheduler_actions_count( [ $ticket_id ] ); + + $this->assertCount( 1, $start_actions ); + + $start_action = array_shift( $start_actions ); + + $action_schedule = $start_action->get_schedule(); + + // First one is half an hour ago before its go live timestamp. + $this->assertEquals( '2050-01-01 07:50:00', $action_schedule->get_date()->format( 'Y-m-d H:i:s' ) ); + + // Freeze time when we fire the third action. + $this->freeze_time( Dates::immutable( '2050-01-01 07:50:00' ) ); + + do_action( $this->controller_class::TICKET_START_SALES_HOOK, $ticket_id ); + + $this->assertEquals( 3, did_action( 'tec_tickets_ticket_start_date_trigger' ) ); + $this->assertEquals( $ticket_id, $listeners['ticket_id'] ); + $this->assertFalse( $listeners['its_happening'] ); + $this->assertEquals( strtotime( '2050-01-01 08:00:00' ), $listeners['timestamp'] ); + $this->assertEquals( $post_id, $listeners['event']->ID ); + + $start_actions = $this->query_action_scheduler_actions_count( [ $ticket_id ] ); + + $this->assertCount( 1, $start_actions ); + + $start_action = array_shift( $start_actions ); + + $action_schedule = $start_action->get_schedule(); + + // First one is half an hour ago before its go live timestamp. + $this->assertEquals( '2050-01-01 08:00:00', $action_schedule->get_date()->format( 'Y-m-d H:i:s' ) ); + + // Freeze time when we fire the fourth and final action. + $this->freeze_time( Dates::immutable( '2050-01-01 08:00:00' ) ); + + do_action( $this->controller_class::TICKET_START_SALES_HOOK, $ticket_id ); + + $this->assertEquals( 4, did_action( 'tec_tickets_ticket_start_date_trigger' ) ); + $this->assertEquals( $ticket_id, $listeners['ticket_id'] ); + $this->assertTrue( $listeners['its_happening'] ); + $this->assertEquals( strtotime( '2050-01-01 08:00:00' ), $listeners['timestamp'] ); + $this->assertEquals( $post_id, $listeners['event']->ID ); + + $start_actions = $this->query_action_scheduler_actions_count( [ $ticket_id ] ); + + $this->assertCount( 0, $start_actions ); + } + + /** + * @test + */ + public function it_should_handle_stress() { + $this->make_controller()->register(); + + $this->assertEquals( 0, did_action( 'tec_tickets_ticket_dates_updated' ) ); + $this->assertEquals( 0, did_action( 'tec_tickets_ticket_stock_changed' ) ); + + $posts = 10; + $tickets_per_post = 50; + + $counter = 0; + + for ( $i = 0; $i < $posts; $i++ ) { + $post_id = $this->factory()->post->create(); + for ( $j = 0; $j < $tickets_per_post; $j++ ) { + $counter++; + $this->create_tc_ticket( $post_id, 10, self::set_up_data()['tickets']['pre_sale'] ); + $this->assertEquals( $counter, did_action( 'tec_tickets_ticket_dates_updated' ) ); + $this->assertEquals( $counter, did_action( 'tec_tickets_ticket_stock_changed' ) ); + } + } + + $this->assertEquals( $posts * $tickets_per_post, $counter ); + + // 500 tickets all of them in the future means 1000 actions. + $start_actions = $this->query_action_scheduler_actions_count( null, true, ( $posts * $tickets_per_post ) ); + $end_actions = $this->query_action_scheduler_actions_count( null, false, ( $posts * $tickets_per_post ) ); + + $this->assertCount( ( $posts * $tickets_per_post ), $start_actions ); + $this->assertCount( ( $posts * $tickets_per_post ), $end_actions ); + $this->assertNotSame( $start_actions, $end_actions ); + + /** + * In a real world scenario AS would pull like 100 actions at a time and + * process them for a maximum of 90 seconds. + * + * Of course there are filters to change this behavior, but this is default. + * + * Lets do a time limit of 5 seconds and process all 1000 actions as a stress test. + * + * That is in total 180 times more performant of what AS can handle. + */ + + // Assert that no action is executed yet at this point. + $this->assertEquals( 0, did_action( $this->controller_class::TICKET_START_SALES_HOOK ) ); + $this->assertEquals( 0, did_action( $this->controller_class::TICKET_END_SALES_HOOK ) ); + + $start_process_actions_time = time(); + foreach ( $start_actions as $action ) { + $action->execute(); + } + foreach ( $end_actions as $action ) { + $action->execute(); + } + $end_process_actions_time = time(); + + // Assert that all the actions have actually executed. + $this->assertEquals( ( $posts * $tickets_per_post ), did_action( $this->controller_class::TICKET_START_SALES_HOOK ) ); + $this->assertEquals( ( $posts * $tickets_per_post ), did_action( $this->controller_class::TICKET_END_SALES_HOOK ) ); + + $this->assertLessThan( 5, $end_process_actions_time - $start_process_actions_time ); + } + + /** + * @before + * @after + */ + public function check_we_are_clearing_up() { + $this->assertCount( 0, $this->query_action_scheduler_actions_count() ); + $this->assertCount( 0, $this->query_action_scheduler_actions_count( null, false ) ); + } + + protected function query_action_scheduler_actions_count( ?array $args = null, bool $start = true, $limit = 100, $offset = 0 ): array { + $hook = $start ? $this->controller_class::TICKET_START_SALES_HOOK : $this->controller_class::TICKET_END_SALES_HOOK; + + $params = [ + 'hook' => $hook, + 'status' => ActionScheduler_Store::STATUS_PENDING, + 'orderby' => 'date', + 'order' => 'ASC', + 'group' => $this->controller_class::AS_TICKET_ACTIONS_GROUP, + 'per_page' => $limit, + 'offset' => $offset, + ]; + + if ( is_array( $args ) ) { + $params['args'] = $args; + } + + return as_get_scheduled_actions( $params, OBJECT ); + } +} From 048ae0740b9447d4a6c12964cce762aa091bd7f8 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 7 Feb 2025 01:45:40 +0200 Subject: [PATCH 46/90] Adds changelog --- changelog/feat-ticket-actions | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelog/feat-ticket-actions diff --git a/changelog/feat-ticket-actions b/changelog/feat-ticket-actions new file mode 100644 index 0000000000..3c5f6b07ac --- /dev/null +++ b/changelog/feat-ticket-actions @@ -0,0 +1,4 @@ +Significance: minor +Type: feat + +Adds Ticket actions for ticket goes on sale, ticket sale ended and ticket stock changed. [ETP-975] From dc4e309d5521e37b5f8ea7beb994d4dcc24175b3 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 7 Feb 2025 01:57:29 +0200 Subject: [PATCH 47/90] Fix phpcs --- src/Tickets/Ticket_Actions.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Tickets/Ticket_Actions.php b/src/Tickets/Ticket_Actions.php index 2ccf265169..a9e9625149 100644 --- a/src/Tickets/Ticket_Actions.php +++ b/src/Tickets/Ticket_Actions.php @@ -160,9 +160,7 @@ public function fire_stock_update_action( int $meta_id, int $ticket_id, string $ * * @since TBD * - * @param int $meta_id The meta ID. * @param int $ticket_id The ticket id. - * @param string $meta_key The meta key. * * @return void */ @@ -223,7 +221,7 @@ public function sync_rsvp_dates_actions( int $meta_id, int $ticket_id, string $m $tickets_handler->key_start_date, $tickets_handler->key_start_time, $tickets_handler->key_end_date, - $tickets_handler->key_end_time + $tickets_handler->key_end_time, ]; if ( ! in_array( $meta_key, $keys_of_interest, true ) ) { @@ -287,6 +285,7 @@ function () use ( $ticket_id ) { * @param bool $is_start Whether the action is for the start or end date. * * @return void + * @throws Exception If the action fails. */ protected function fire_ticket_date_action( int $ticket_id, bool $is_start = true ): void { $ticket = Tickets::load_ticket_object( $ticket_id ); From d16b1df2af79002aecd665562816b9bf0267841d Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 7 Feb 2025 01:59:32 +0200 Subject: [PATCH 48/90] Fix more phpcs --- src/Tickets/Ticket_Actions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tickets/Ticket_Actions.php b/src/Tickets/Ticket_Actions.php index a9e9625149..f1746578d7 100644 --- a/src/Tickets/Ticket_Actions.php +++ b/src/Tickets/Ticket_Actions.php @@ -160,7 +160,7 @@ public function fire_stock_update_action( int $meta_id, int $ticket_id, string $ * * @since TBD * - * @param int $ticket_id The ticket id. + * @param int $ticket_id The ticket id. * * @return void */ @@ -305,8 +305,8 @@ protected function fire_ticket_date_action( int $ticket_id, bool $is_start = tru $its_happening = true; $prefix = $is_start ? 'start' : 'end'; - $method = "{$prefix}_date"; + $timestamp = $ticket->$method(); if ( ! $timestamp ) { From d7e0cc53e6dc4543ccd26f9a73effeb3518ae17c Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 7 Feb 2025 02:12:08 +0200 Subject: [PATCH 49/90] Refactor to avoid having to deal with the ticket cache... --- src/Tickets/Ticket_Actions.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/Tickets/Ticket_Actions.php b/src/Tickets/Ticket_Actions.php index f1746578d7..904ceff49b 100644 --- a/src/Tickets/Ticket_Actions.php +++ b/src/Tickets/Ticket_Actions.php @@ -130,17 +130,15 @@ public function fire_stock_update_action( int $meta_id, int $ticket_id, string $ return; } - $ticket = Tickets::load_ticket_object( $ticket_id ); + $ticket = get_post( $ticket_id ); - if ( ! $ticket instanceof Ticket_Object ) { - // Not a ticket object. + if ( ! $ticket instanceof WP_Post || 1 > $ticket->ID ) { + // Deleted ? return; } - $event = $ticket->get_event(); - - if ( ! $event instanceof WP_Post || 1 > $event->ID ) { - // Parent event, no longer exists. + if ( ! in_array( $ticket->post, tribe_tickets()->ticket_types(), true ) ) { + // Not a ticket. return; } @@ -149,10 +147,9 @@ public function fire_stock_update_action( int $meta_id, int $ticket_id, string $ * * @since TBD * - * @param Ticket_Object $ticket The ticket object. - * @param WP_Post $event The event post object. + * @param int $ticket_id The ticket id. */ - do_action( 'tec_tickets_ticket_stock_changed', $ticket, $event ); + do_action( 'tec_tickets_ticket_stock_changed', $ticket->ID ); } /** From ff539ea16f4e02f8ceea0b5ea25e2da88b4b9495 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 7 Feb 2025 02:13:00 +0200 Subject: [PATCH 50/90] Fix typo --- src/Tickets/Ticket_Actions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tickets/Ticket_Actions.php b/src/Tickets/Ticket_Actions.php index 904ceff49b..342fc7dc2d 100644 --- a/src/Tickets/Ticket_Actions.php +++ b/src/Tickets/Ticket_Actions.php @@ -137,7 +137,7 @@ public function fire_stock_update_action( int $meta_id, int $ticket_id, string $ return; } - if ( ! in_array( $ticket->post, tribe_tickets()->ticket_types(), true ) ) { + if ( ! in_array( $ticket->post_type, tribe_tickets()->ticket_types(), true ) ) { // Not a ticket. return; } From 9c0e36f343593e04d17d6c59cbb4d16844dddf33 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 7 Feb 2025 13:17:48 +0200 Subject: [PATCH 51/90] Update src/Tribe/Tickets.php Co-authored-by: theAverageDev (Luca Tumedei) --- src/Tribe/Tickets.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tribe/Tickets.php b/src/Tribe/Tickets.php index 8fe5feb1ac..5db770a3e9 100644 --- a/src/Tribe/Tickets.php +++ b/src/Tribe/Tickets.php @@ -4106,7 +4106,7 @@ public function ticket_add( $post_id, $data ) { $version->update( $ticket->ID ); /** - * Fired once a ticket's details have been fully saved. + * Fires once a ticket's data has been saved. * * @since TBD * From ce75f75031340e1d05a17274e1b7ce4c344fc255 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 7 Feb 2025 13:47:36 +0200 Subject: [PATCH 52/90] first round of CR amends --- src/Tickets/Ticket_Actions.php | 167 +++++++++++++++++++-------------- 1 file changed, 96 insertions(+), 71 deletions(-) diff --git a/src/Tickets/Ticket_Actions.php b/src/Tickets/Ticket_Actions.php index 342fc7dc2d..b027b586e9 100644 --- a/src/Tickets/Ticket_Actions.php +++ b/src/Tickets/Ticket_Actions.php @@ -9,7 +9,7 @@ namespace TEC\Tickets; use TEC\Common\Contracts\Provider\Controller as Controller_Contract; - +use TEC\Common\lucatume\DI52\Container; use Tribe__Tickets__Tickets as Tickets; use Tribe__Tickets__Ticket_Object as Ticket_Object; use TEC\Tickets\Commerce\Ticket; @@ -50,6 +50,34 @@ class Ticket_Actions extends Controller_Contract { */ public const AS_TICKET_ACTIONS_GROUP = 'tec_tickets_ticket_actions'; + /** + * The keys of interest for syncing ticket dates actions. + * + * @since TBD + * + * @var array + */ + protected static array $keys_of_interest = []; + + /** + * Ticket_Actions constructor. + * + * @param Container $container The DI container. + */ + public function __construct( Container $container ) { + parent::__construct( $container ); + + /** @var Tribe__Tickets__Tickets_Handler $tickets_handler */ + $tickets_handler = tribe( 'tickets.handler' ); + + self::$keys_of_interest = [ + $tickets_handler->key_start_date, + $tickets_handler->key_start_time, + $tickets_handler->key_end_date, + $tickets_handler->key_end_time, + ]; + } + /** * Registers the controller by subscribing to front-end hooks and binding implementations. * @@ -58,11 +86,9 @@ class Ticket_Actions extends Controller_Contract { * @return void */ protected function do_register(): void { - add_action( 'tec_tickets_ticket_upserted', [ $this, 'sync_ticket_dates_actions' ], PHP_INT_MAX ); - add_action( 'added_post_meta', [ $this, 'sync_rsvp_dates_actions' ], PHP_INT_MAX, 3 ); - add_action( 'updated_postmeta', [ $this, 'sync_rsvp_dates_actions' ], PHP_INT_MAX, 3 ); - add_action( 'added_post_meta', [ $this, 'fire_stock_update_action' ], PHP_INT_MAX, 3 ); - add_action( 'updated_postmeta', [ $this, 'fire_stock_update_action' ], PHP_INT_MAX, 3 ); + add_action( 'tec_tickets_ticket_upserted', [ $this, 'sync_ticket_dates_actions' ], 1000 ); + add_action( 'added_post_meta', [ $this, 'meta_keys_listener' ], 1000, 3 ); + add_action( 'updated_postmeta', [ $this, 'meta_keys_listener' ], 1000, 3 ); add_action( self::TICKET_START_SALES_HOOK, [ $this, 'fire_ticket_start_date_action' ], 10, 2 ); add_action( self::TICKET_END_SALES_HOOK, [ $this, 'fire_ticket_end_date_action' ], 10, 2 ); } @@ -75,11 +101,9 @@ protected function do_register(): void { * @return void */ public function unregister(): void { - remove_action( 'tec_tickets_ticket_upserted', [ $this, 'sync_ticket_dates_actions' ], PHP_INT_MAX ); - remove_action( 'added_post_meta', [ $this, 'sync_rsvp_dates_actions' ], PHP_INT_MAX ); - remove_action( 'updated_postmeta', [ $this, 'sync_rsvp_dates_actions' ], PHP_INT_MAX ); - remove_action( 'added_post_meta', [ $this, 'fire_stock_update_action' ], PHP_INT_MAX ); - remove_action( 'updated_postmeta', [ $this, 'fire_stock_update_action' ], PHP_INT_MAX ); + remove_action( 'tec_tickets_ticket_upserted', [ $this, 'sync_ticket_dates_actions' ], 1000 ); + remove_action( 'added_post_meta', [ $this, 'meta_keys_listener' ], 1000 ); + remove_action( 'updated_postmeta', [ $this, 'meta_keys_listener' ], 1000 ); remove_action( self::TICKET_START_SALES_HOOK, [ $this, 'fire_ticket_start_date_action' ] ); remove_action( self::TICKET_END_SALES_HOOK, [ $this, 'fire_ticket_end_date_action' ] ); } @@ -113,45 +137,6 @@ public function fire_ticket_end_date_action( int $ticket_id ): void { $this->fire_ticket_date_action( $ticket_id, false ); } - /** - * Listens for changes to the _stock meta key. - * - * If a change is found and the change is for a Ticket Object, the event is fired. - * - * @since TBD - * - * @param int $meta_id The meta ID. - * @param int $ticket_id The ticket ID. - * @param string $meta_key The meta key. - */ - public function fire_stock_update_action( int $meta_id, int $ticket_id, string $meta_key ): void { - if ( Ticket::$stock_meta_key !== $meta_key ) { - // Not a stock update. - return; - } - - $ticket = get_post( $ticket_id ); - - if ( ! $ticket instanceof WP_Post || 1 > $ticket->ID ) { - // Deleted ? - return; - } - - if ( ! in_array( $ticket->post_type, tribe_tickets()->ticket_types(), true ) ) { - // Not a ticket. - return; - } - - /** - * Fires when the stock of a ticket changes. - * - * @since TBD - * - * @param int $ticket_id The ticket id. - */ - do_action( 'tec_tickets_ticket_stock_changed', $ticket->ID ); - } - /** * Syncs ticket dates actions. * @@ -171,7 +156,7 @@ public function sync_ticket_dates_actions( int $ticket_id ): void { $event = $ticket->get_event(); - if ( ! $event instanceof WP_Post || 1 > $event->ID ) { + if ( ! $event instanceof WP_Post || 0 === $event->ID ) { // Parent event, no longer exists. return; } @@ -179,7 +164,7 @@ public function sync_ticket_dates_actions( int $ticket_id ): void { $ticket_start_timestamp = $ticket->start_date(); $ticket_end_timestamp = $ticket->end_date(); - if ( ! $ticket_start_timestamp || ! $ticket_end_timestamp ) { + if ( ! ( $ticket_start_timestamp && $ticket_end_timestamp ) ) { // No timestamps... we might be too early. Lets wait. return; } @@ -200,35 +185,75 @@ public function sync_ticket_dates_actions( int $ticket_id ): void { } /** - * Syncs rsvp dates actions. + * Listens for changes to the meta keys of interest. + * + * If a change is found and the change is for a ticket, an event is fired. * * @since TBD * - * @param int $meta_id The meta ID. - * @param int $ticket_id The ticket id. + * @param int $meta_id The meta ID. + * @param int $ticket_id The ticket ID. * @param string $meta_key The meta key. - * - * @return void */ - public function sync_rsvp_dates_actions( int $meta_id, int $ticket_id, string $meta_key ): void { - /** @var Tribe__Tickets__Tickets_Handler $tickets_handler */ - $tickets_handler = tribe( 'tickets.handler' ); + public function meta_keys_listener( int $meta_id, int $ticket_id, string $meta_key ): void { + if ( ! in_array( $meta_key, array_merge( self::$keys_of_interest, [ Ticket::$stock_meta_key ] ), true ) ) { + return; + } - $keys_of_interest = [ - $tickets_handler->key_start_date, - $tickets_handler->key_start_time, - $tickets_handler->key_end_date, - $tickets_handler->key_end_time, - ]; + $ptype = get_post_type( $ticket_id ); - if ( ! in_array( $meta_key, $keys_of_interest, true ) ) { + if ( ! in_array( $ptype, tribe_tickets()->ticket_types(), true ) ) { + // Not a ticket. return; } - if ( 'tribe_rsvp_tickets' !== get_post_type( $ticket_id ) ) { + if ( Ticket::$stock_meta_key === $meta_key ) { + $this->fire_stock_update_action( $ticket_id ); return; } + if ( 'tribe_rsvp_tickets' !== $ptype ) { + return; + } + + $this->sync_rsvp_dates_actions( $ticket_id ); + } + + /** + * Listens for changes to the _stock meta key. + * + * If a change is found and the change is for a Ticket Object, the event is fired. + * + * @since TBD + * + * @param int $ticket_id The ticket ID. + */ + protected function fire_stock_update_action( int $ticket_id ): void { + $ticket = get_post( $ticket_id ); + + if ( ! $ticket instanceof WP_Post || 0 === $ticket->ID ) { + // Deleted ? + return; + } + + /** + * Fires when the stock of a ticket changes. + * + * @since TBD + * + * @param int $ticket_id The ticket id. + */ + do_action( 'tec_tickets_ticket_stock_changed', $ticket->ID ); + } + + /** + * Syncs rsvp dates actions. + * + * @since TBD + * + * @param int $ticket_id The ticket id. + */ + protected function sync_rsvp_dates_actions( int $ticket_id ): void { $ticket = Tickets::load_ticket_object( $ticket_id ); if ( ! $ticket instanceof Ticket_Object ) { @@ -238,7 +263,7 @@ public function sync_rsvp_dates_actions( int $meta_id, int $ticket_id, string $m $event = $ticket->get_event(); - if ( ! $event instanceof WP_Post || 1 > $event->ID ) { + if ( ! $event instanceof WP_Post || 0 === $event->ID ) { // Parent event, no longer exists. return; } @@ -294,7 +319,7 @@ protected function fire_ticket_date_action( int $ticket_id, bool $is_start = tru $event = $ticket->get_event(); - if ( ! $event instanceof WP_Post || 1 > $event->ID ) { + if ( ! $event instanceof WP_Post || 0 === $event->ID ) { // Parent event, no longer exists. return; } @@ -380,7 +405,7 @@ protected function sync_action_scheduler_date_actions( int $ticket_id, int $star as_unschedule_action( self::TICKET_END_SALES_HOOK, [ $ticket_id ], self::AS_TICKET_ACTIONS_GROUP ); if ( time() > $end_timestamp ) { - // The ticket has already ended. Do nothing. + // The ticket sale has already ended. Do nothing. return; } From c7f713933062d9a4db21b71e2242ec0fc9e03095 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 7 Feb 2025 13:59:18 +0200 Subject: [PATCH 53/90] keep time() steady within one operation --- src/Tickets/Ticket_Actions.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/Tickets/Ticket_Actions.php b/src/Tickets/Ticket_Actions.php index b027b586e9..5f9f139418 100644 --- a/src/Tickets/Ticket_Actions.php +++ b/src/Tickets/Ticket_Actions.php @@ -336,11 +336,13 @@ protected function fire_ticket_date_action( int $ticket_id, bool $is_start = tru return; } - if ( time() + 30 < $timestamp ) { + $now = time(); + + if ( $now + 30 < $timestamp ) { $its_happening = false; $method = "schedule_date_{$prefix}_action"; // The actual timestamp is not immediate. Lets reschedule closer to the actual event. - $this->$method( $ticket_id, $timestamp ); + $this->$method( $ticket_id, $now, $timestamp ); } try { @@ -370,7 +372,7 @@ protected function fire_ticket_date_action( int $ticket_id, bool $is_start = tru 'prefix' => $prefix, 'timestamp' => $timestamp, 'its_happening' => $its_happening, - 'now' => time(), + 'now' => $now, ] ); @@ -404,13 +406,15 @@ protected function sync_action_scheduler_date_actions( int $ticket_id, int $star as_unschedule_action( self::TICKET_START_SALES_HOOK, [ $ticket_id ], self::AS_TICKET_ACTIONS_GROUP ); as_unschedule_action( self::TICKET_END_SALES_HOOK, [ $ticket_id ], self::AS_TICKET_ACTIONS_GROUP ); - if ( time() > $end_timestamp ) { + $now = time(); + + if ( $now > $end_timestamp ) { // The ticket sale has already ended. Do nothing. return; } - $this->schedule_date_start_action( $ticket_id, $start_timestamp ); - $this->schedule_date_end_action( $ticket_id, $end_timestamp ); + $this->schedule_date_start_action( $ticket_id, $now, $start_timestamp ); + $this->schedule_date_end_action( $ticket_id, $now, $end_timestamp ); } /** @@ -423,8 +427,7 @@ protected function sync_action_scheduler_date_actions( int $ticket_id, int $star * * @return void */ - protected function schedule_date_start_action( int $ticket_id, int $start_timestamp ): void { - $now = time(); + protected function schedule_date_start_action( int $ticket_id, int $now, int $start_timestamp ): void { $minus_30_minutes = ( - 30 * MINUTE_IN_SECONDS ); $minus_20_minutes = ( - 20 * MINUTE_IN_SECONDS ); $minus_10_minutes = ( - 10 * MINUTE_IN_SECONDS ); @@ -463,8 +466,7 @@ protected function schedule_date_start_action( int $ticket_id, int $start_timest * * @return void */ - protected function schedule_date_end_action( int $ticket_id, int $end_timestamp ): void { - $now = time(); + protected function schedule_date_end_action( int $ticket_id, int $now, int $end_timestamp ): void { $minus_30_minutes = ( - 30 * MINUTE_IN_SECONDS ); $minus_20_minutes = ( - 20 * MINUTE_IN_SECONDS ); $minus_10_minutes = ( - 10 * MINUTE_IN_SECONDS ); From baed40880006017859aa1e28a3dfd0b0cc5ba62a Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 7 Feb 2025 14:11:38 +0200 Subject: [PATCH 54/90] implement Luca's ideas instead for cleaner shutdown callback --- src/Tickets/Ticket_Actions.php | 66 +++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 28 deletions(-) diff --git a/src/Tickets/Ticket_Actions.php b/src/Tickets/Ticket_Actions.php index 5f9f139418..97d9655675 100644 --- a/src/Tickets/Ticket_Actions.php +++ b/src/Tickets/Ticket_Actions.php @@ -59,6 +59,15 @@ class Ticket_Actions extends Controller_Contract { */ protected static array $keys_of_interest = []; + /** + * The RSVP IDs to sync. + * + * @since TBD + * + * @var array + */ + protected static array $rsvp_ids_to_sync = []; + /** * Ticket_Actions constructor. * @@ -89,6 +98,7 @@ protected function do_register(): void { add_action( 'tec_tickets_ticket_upserted', [ $this, 'sync_ticket_dates_actions' ], 1000 ); add_action( 'added_post_meta', [ $this, 'meta_keys_listener' ], 1000, 3 ); add_action( 'updated_postmeta', [ $this, 'meta_keys_listener' ], 1000, 3 ); + add_action( 'tec_shutdown', [ $this, 'sync_rsvp_dates_for_all' ] ); add_action( self::TICKET_START_SALES_HOOK, [ $this, 'fire_ticket_start_date_action' ], 10, 2 ); add_action( self::TICKET_END_SALES_HOOK, [ $this, 'fire_ticket_end_date_action' ], 10, 2 ); } @@ -104,6 +114,7 @@ public function unregister(): void { remove_action( 'tec_tickets_ticket_upserted', [ $this, 'sync_ticket_dates_actions' ], 1000 ); remove_action( 'added_post_meta', [ $this, 'meta_keys_listener' ], 1000 ); remove_action( 'updated_postmeta', [ $this, 'meta_keys_listener' ], 1000 ); + remove_action( 'tec_shutdown', [ $this, 'sync_rsvp_dates_for_all' ] ); remove_action( self::TICKET_START_SALES_HOOK, [ $this, 'fire_ticket_start_date_action' ] ); remove_action( self::TICKET_END_SALES_HOOK, [ $this, 'fire_ticket_end_date_action' ] ); } @@ -219,6 +230,31 @@ public function meta_keys_listener( int $meta_id, int $ticket_id, string $meta_k $this->sync_rsvp_dates_actions( $ticket_id ); } + /** + * Syncs the RSVP dates for all RSVPs that had an update to a related + * meta during the request. + * + * @since TBD + * + * @return void + */ + public function sync_rsvp_dates_for_all() { + /** + * Filters the RSVP IDs to sync. + * + * @since TBD + * + * @param array $rsvp_ids The RSVP IDs to sync. + */ + self::$rsvp_ids_to_sync = (array) apply_filters( 'tec_tickets_rsvp_ids_to_sync', array_unique( self::$rsvp_ids_to_sync ) ); + + foreach ( self::$rsvp_ids_to_sync as $offset => $rsvp_id ) { + // Protect ourselves against multiple calls during the same request. + unset( self::$rsvp_ids_to_sync[ $offset ] ); + $this->sync_ticket_dates_actions( $rsvp_id ); + } + } + /** * Listens for changes to the _stock meta key. * @@ -268,34 +304,8 @@ protected function sync_rsvp_dates_actions( int $ticket_id ): void { return; } - $cache = tribe_cache(); - $cache_key = __METHOD__ . $ticket_id; - - /** - * This is hooking into the save/update process of an RSVP ticket. - * - * More specifically we are hooking into the save/update of specific meta keys that are related to the rsvp's start and end date. - * - * During the request, these may be multiple and the most important issue is that they WILL be one by one. - * - * e.g. - * - * Save start date first, save end date second and so on. - * - * We don't want to fire the action multiple times. so if we reached this point we delegate the syncing to happen later. - */ - if ( ! empty( $cache[ $cache_key ] ) ) { - return; - } - - $cache[ $cache_key ] = true; - - add_action( - 'tec_shutdown', - function () use ( $ticket_id ) { - $this->sync_ticket_dates_actions( $ticket_id ); - } - ); + // We avoid checking in_array multiple times and we will rather do array_unique once. + self::$rsvp_ids_to_sync[] = $ticket_id; } /** From b7ed623ebfb59b66906415127b05860f79cddc2e Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 7 Feb 2025 14:14:11 +0200 Subject: [PATCH 55/90] fix phpcs --- src/Tickets/Ticket_Actions.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Tickets/Ticket_Actions.php b/src/Tickets/Ticket_Actions.php index 97d9655675..ece0899f77 100644 --- a/src/Tickets/Ticket_Actions.php +++ b/src/Tickets/Ticket_Actions.php @@ -433,6 +433,7 @@ protected function sync_action_scheduler_date_actions( int $ticket_id, int $star * @since TBD * * @param int $ticket_id The ticket ID. + * @param int $now The current timestamp. * @param int $start_timestamp The ticket start date. * * @return void @@ -472,6 +473,7 @@ protected function schedule_date_start_action( int $ticket_id, int $now, int $st * @since TBD * * @param int $ticket_id The ticket ID. + * @param int $now The current timestamp. * @param int $end_timestamp The ticket end date. * * @return void From 14d9986d83bec1c7bbd1b0561ce7f788fcd434bf Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 7 Feb 2025 14:14:54 +0200 Subject: [PATCH 56/90] amend doc comment --- src/Tickets/Ticket_Actions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tickets/Ticket_Actions.php b/src/Tickets/Ticket_Actions.php index ece0899f77..1a3fd13b40 100644 --- a/src/Tickets/Ticket_Actions.php +++ b/src/Tickets/Ticket_Actions.php @@ -444,7 +444,7 @@ protected function schedule_date_start_action( int $ticket_id, int $now, int $st $minus_10_minutes = ( - 10 * MINUTE_IN_SECONDS ); if ( $now > $start_timestamp ) { - // The ticket has already started. Fire the action immediately. + // The ticket sale has already started. Fire the action immediately. do_action( self::TICKET_START_SALES_HOOK, $ticket_id ); return; } From 1d6b19445ff16791f5c395fb6befbdaa73095bad Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 7 Feb 2025 18:44:04 +0200 Subject: [PATCH 57/90] Support UTC timezone --- src/Tribe/Ticket_Object.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Tribe/Ticket_Object.php b/src/Tribe/Ticket_Object.php index 349bfe73fe..104421a66f 100644 --- a/src/Tribe/Ticket_Object.php +++ b/src/Tribe/Ticket_Object.php @@ -438,9 +438,10 @@ class_exists( 'Tribe__Events__Timezones' ) && is_null( $this->event_timezone ) ) { try { - $this->event_timezone = new DateTimeZone( Tribe__Events__Timezones::get_event_timezone_string( $this->get_event_id() ) ); + $timezone_string = Tribe__Events__Timezones::get_event_timezone_string( $this->get_event_id() ); + $this->event_timezone = new DateTimeZone( $timezone_string ); } catch ( Exception $exception ) { - $this->event_timezone = null; + $this->event_timezone = 'UTC+0' === $timezone_string ? new DateTimeZone( 'UTC' ) : null; } } From 662fec81572888b9fc76d5af282af72b9d0ebed4 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 7 Feb 2025 18:46:01 +0200 Subject: [PATCH 58/90] fix phpcs --- src/Tribe/Ticket_Object.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Tribe/Ticket_Object.php b/src/Tribe/Ticket_Object.php index 104421a66f..48fb6b2f2a 100644 --- a/src/Tribe/Ticket_Object.php +++ b/src/Tribe/Ticket_Object.php @@ -439,6 +439,7 @@ class_exists( 'Tribe__Events__Timezones' ) ) { try { $timezone_string = Tribe__Events__Timezones::get_event_timezone_string( $this->get_event_id() ); + $this->event_timezone = new DateTimeZone( $timezone_string ); } catch ( Exception $exception ) { $this->event_timezone = 'UTC+0' === $timezone_string ? new DateTimeZone( 'UTC' ) : null; From 14c4de1e92ec290dff631e0cd3c68cad2f2182b2 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Tue, 11 Feb 2025 02:34:43 +0200 Subject: [PATCH 59/90] Process subscribers functionality --- src/views/emails/confirmation.php | 38 +++++++++++++++++++++++++++++ src/views/emails/spot-available.php | 38 +++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 src/views/emails/confirmation.php create mode 100644 src/views/emails/spot-available.php diff --git a/src/views/emails/confirmation.php b/src/views/emails/confirmation.php new file mode 100644 index 0000000000..fe02c03ec9 --- /dev/null +++ b/src/views/emails/confirmation.php @@ -0,0 +1,38 @@ +template( 'template-parts/header' ); + +$this->template( 'template-parts/body/title' ); + +$this->template( 'template-parts/body/additional-content' ); + +$this->template( 'template-parts/footer' ); diff --git a/src/views/emails/spot-available.php b/src/views/emails/spot-available.php new file mode 100644 index 0000000000..1d81455978 --- /dev/null +++ b/src/views/emails/spot-available.php @@ -0,0 +1,38 @@ +template( 'template-parts/header' ); + +$this->template( 'template-parts/body/title' ); + +$this->template( 'template-parts/body/additional-content' ); + +$this->template( 'template-parts/footer' ); From ddb0bfb022ac860adc7bd24b7644600971bc60a9 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Tue, 11 Feb 2025 21:36:28 +0200 Subject: [PATCH 60/90] added changelog --- changelog/feat-process-waitlist-subscribers | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelog/feat-process-waitlist-subscribers diff --git a/changelog/feat-process-waitlist-subscribers b/changelog/feat-process-waitlist-subscribers new file mode 100644 index 0000000000..7560b09c04 --- /dev/null +++ b/changelog/feat-process-waitlist-subscribers @@ -0,0 +1,4 @@ +Significance: patch +Type: tweak + +Introduce Waitlist email templates. [ETP-957] From bb1e6ecdf59389b8c64a85d4b8b25f1d4f73185e Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Tue, 11 Feb 2025 22:31:22 +0200 Subject: [PATCH 61/90] Adding waitlist entry points --- src/views/v2/rsvp/content.php | 5 ++++- src/views/v2/tickets.php | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/views/v2/rsvp/content.php b/src/views/v2/rsvp/content.php index 1f9b081513..d4643e82b7 100644 --- a/src/views/v2/rsvp/content.php +++ b/src/views/v2/rsvp/content.php @@ -15,8 +15,9 @@ * * @since 4.12.3 * @since 5.7.0 Add list of attendees that confirmed RSVP. + * @since TBD Added waitlist entry point. * - * @version 5.7.0 + * @version TBD */ ?> @@ -41,6 +42,8 @@ template( 'v2/rsvp/actions', [ 'rsvp' => $rsvp ] ); ?> + do_entry_point( 'waitlist' ) ?> + template( 'v2/rsvp/attendees' ); ?> diff --git a/src/views/v2/tickets.php b/src/views/v2/tickets.php index 8835f2547b..aee100863b 100644 --- a/src/views/v2/tickets.php +++ b/src/views/v2/tickets.php @@ -10,8 +10,9 @@ * @link https://evnt.is/1amp Help article for RSVP & Ticket template files. * * @since 5.0.3 + * @since TBD Added waitlist entry point. * - * @version 5.0.3 + * @version TBD * * @var Tribe__Tickets__Editor__Template $this [Global] Template object. * @var Tribe__Tickets__Tickets $provider [Global] The tickets provider class. @@ -79,6 +80,7 @@ class="tribe-tickets__tickets-form tribe-tickets__form" template( 'v2/components/loader/loader' ); ?> + do_entry_point( 'waitlist' ) ?> Date: Tue, 11 Feb 2025 22:32:03 +0200 Subject: [PATCH 62/90] added changelog --- changelog/feat-added-waitlist-entry-points | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelog/feat-added-waitlist-entry-points diff --git a/changelog/feat-added-waitlist-entry-points b/changelog/feat-added-waitlist-entry-points new file mode 100644 index 0000000000..3c26c38cb0 --- /dev/null +++ b/changelog/feat-added-waitlist-entry-points @@ -0,0 +1,4 @@ +Significance: minor +Type: feat + +Introduced Waitlist entry points in Ticket and RSVP templates. [ETP-944] From 1ed72e11ace6b1957454a4e7c28d6aeae2c64e9a Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Tue, 11 Feb 2025 22:34:04 +0200 Subject: [PATCH 63/90] fix phpcs --- src/views/v2/rsvp/content.php | 2 +- src/views/v2/tickets.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/v2/rsvp/content.php b/src/views/v2/rsvp/content.php index d4643e82b7..4c945a7339 100644 --- a/src/views/v2/rsvp/content.php +++ b/src/views/v2/rsvp/content.php @@ -42,7 +42,7 @@ template( 'v2/rsvp/actions', [ 'rsvp' => $rsvp ] ); ?> - do_entry_point( 'waitlist' ) ?> + do_entry_point( 'waitlist' ); ?> diff --git a/src/views/v2/tickets.php b/src/views/v2/tickets.php index aee100863b..f968d09724 100644 --- a/src/views/v2/tickets.php +++ b/src/views/v2/tickets.php @@ -80,7 +80,7 @@ class="tribe-tickets__tickets-form tribe-tickets__form" template( 'v2/components/loader/loader' ); ?> - do_entry_point( 'waitlist' ) ?> + do_entry_point( 'waitlist' ); ?> Date: Tue, 11 Feb 2025 22:44:09 +0200 Subject: [PATCH 64/90] added namespace --- src/views/v2/rsvp/content.php | 2 +- src/views/v2/tickets.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/v2/rsvp/content.php b/src/views/v2/rsvp/content.php index 4c945a7339..ae20a1a42a 100644 --- a/src/views/v2/rsvp/content.php +++ b/src/views/v2/rsvp/content.php @@ -42,7 +42,7 @@ template( 'v2/rsvp/actions', [ 'rsvp' => $rsvp ] ); ?> - do_entry_point( 'waitlist' ); ?> + do_entry_point( 'etp-waitlist' ); ?> diff --git a/src/views/v2/tickets.php b/src/views/v2/tickets.php index f968d09724..24b570882c 100644 --- a/src/views/v2/tickets.php +++ b/src/views/v2/tickets.php @@ -80,7 +80,7 @@ class="tribe-tickets__tickets-form tribe-tickets__form" template( 'v2/components/loader/loader' ); ?> - do_entry_point( 'waitlist' ); ?> + do_entry_point( 'etp-waitlist' ); ?> Date: Tue, 11 Feb 2025 22:44:19 +0200 Subject: [PATCH 65/90] Update snapshots for new line after new entry point --- ...est_should_render_ticket_block with data set 0__1.php | 6 +++--- ...est_should_render_ticket_block with data set 1__1.php | 6 +++--- ...est_should_render_ticket_block with data set 2__1.php | 6 +++--- ...est_should_render_ticket_block with data set 3__1.php | 6 +++--- ...est_should_render_ticket_block with data set 4__1.php | 6 +++--- ...est_should_render_ticket_block with data set 5__1.php | 6 +++--- ...nder_ticket_block_after_update with data set 0__1.php | 6 +++--- ...der_ticket_block_after_update with data set 10__1.php | 6 +++--- ...der_ticket_block_after_update with data set 11__1.php | 6 +++--- ...der_ticket_block_after_update with data set 12__1.php | 6 +++--- ...der_ticket_block_after_update with data set 13__1.php | 6 +++--- ...der_ticket_block_after_update with data set 14__1.php | 6 +++--- ...der_ticket_block_after_update with data set 15__1.php | 6 +++--- ...der_ticket_block_after_update with data set 16__1.php | 6 +++--- ...der_ticket_block_after_update with data set 17__1.php | 6 +++--- ...der_ticket_block_after_update with data set 18__1.php | 6 +++--- ...der_ticket_block_after_update with data set 19__1.php | 6 +++--- ...nder_ticket_block_after_update with data set 1__1.php | 6 +++--- ...der_ticket_block_after_update with data set 20__1.php | 6 +++--- ...der_ticket_block_after_update with data set 21__1.php | 6 +++--- ...der_ticket_block_after_update with data set 22__1.php | 6 +++--- ...der_ticket_block_after_update with data set 23__1.php | 6 +++--- ...der_ticket_block_after_update with data set 24__1.php | 6 +++--- ...der_ticket_block_after_update with data set 25__1.php | 6 +++--- ...der_ticket_block_after_update with data set 26__1.php | 6 +++--- ...der_ticket_block_after_update with data set 27__1.php | 6 +++--- ...der_ticket_block_after_update with data set 28__1.php | 6 +++--- ...der_ticket_block_after_update with data set 29__1.php | 6 +++--- ...nder_ticket_block_after_update with data set 2__1.php | 6 +++--- ...nder_ticket_block_after_update with data set 3__1.php | 6 +++--- ...nder_ticket_block_after_update with data set 4__1.php | 6 +++--- ...nder_ticket_block_after_update with data set 5__1.php | 6 +++--- ...nder_ticket_block_after_update with data set 6__1.php | 6 +++--- ...nder_ticket_block_after_update with data set 7__1.php | 6 +++--- ...nder_ticket_block_after_update with data set 8__1.php | 6 +++--- ...nder_ticket_block_after_update with data set 9__1.php | 6 +++--- ...est_should_render_ticket_block with data set 0__1.php | 1 + ...est_should_render_ticket_block with data set 1__1.php | 1 + ...est_should_render_ticket_block with data set 2__1.php | 1 + ...nder_ticket_block_after_update with data set 0__1.php | 4 +++- ...nder_ticket_block_after_update with data set 1__1.php | 4 +++- ...nder_ticket_block_after_update with data set 2__1.php | 4 +++- ...nder_ticket_block_after_update with data set 3__1.php | 4 +++- ...nder_ticket_block_after_update with data set 4__1.php | 4 +++- ...nder_ticket_block_after_update with data set 5__1.php | 4 +++- ...Test__test_should_render_regular_tickets_block__1.php | 2 +- ...t__test_should_render_ticket_block_for_is_mini__1.php | 2 +- ...__test_should_render_ticket_block_for_is_modal__1.php | 2 +- ...d_render_rsvp_step with data set initial state__1.php | 5 +++-- ...t_should_render_rsvp_step with data set opt-in__1.php | 5 +++-- ..._should_render_rsvp_step with data set success__1.php | 9 +++++---- 51 files changed, 143 insertions(+), 125 deletions(-) diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block with data set 0__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block with data set 0__1.php index a831b1346c..68fd2f29f9 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block with data set 0__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block with data set 0__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item tribe-tickets__tickets-item--shared-capacity post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="true" data-ticket-price="5" data-shared-cap="15" data-available-count="10" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block with data set 1__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block with data set 1__1.php index 41305a1618..380694182e 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block with data set 1__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block with data set 1__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item tribe-tickets__tickets-item--shared-capacity post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="true" data-ticket-price="5" data-shared-cap="15" data-available-count="11" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block with data set 2__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block with data set 2__1.php index 2d050534ec..be53c1e2e4 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block with data set 2__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block with data set 2__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item tribe-tickets__tickets-item--shared-capacity post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="true" data-ticket-price="5" data-shared-cap="15" data-available-count="15" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block with data set 3__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block with data set 3__1.php index 680b8cecbc..56c7b98a16 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block with data set 3__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block with data set 3__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="false" data-ticket-price="5" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block with data set 4__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block with data set 4__1.php index 060ccab3f6..3b469203da 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block with data set 4__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block with data set 4__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="false" data-ticket-price="5" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block with data set 5__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block with data set 5__1.php index 6a6976dcbd..136f2e1e7e 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block with data set 5__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block with data set 5__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="false" data-ticket-price="5" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 0__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 0__1.php index 41305a1618..380694182e 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 0__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 0__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item tribe-tickets__tickets-item--shared-capacity post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="true" data-ticket-price="5" data-shared-cap="15" data-available-count="11" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 10__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 10__1.php index a831b1346c..68fd2f29f9 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 10__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 10__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item tribe-tickets__tickets-item--shared-capacity post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="true" data-ticket-price="5" data-shared-cap="15" data-available-count="10" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 11__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 11__1.php index 41305a1618..380694182e 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 11__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 11__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item tribe-tickets__tickets-item--shared-capacity post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="true" data-ticket-price="5" data-shared-cap="15" data-available-count="11" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 12__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 12__1.php index 680b8cecbc..56c7b98a16 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 12__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 12__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="false" data-ticket-price="5" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 13__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 13__1.php index 060ccab3f6..3b469203da 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 13__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 13__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="false" data-ticket-price="5" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 14__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 14__1.php index 6a6976dcbd..136f2e1e7e 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 14__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 14__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="false" data-ticket-price="5" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 15__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 15__1.php index a831b1346c..68fd2f29f9 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 15__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 15__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item tribe-tickets__tickets-item--shared-capacity post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="true" data-ticket-price="5" data-shared-cap="15" data-available-count="10" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 16__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 16__1.php index 41305a1618..380694182e 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 16__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 16__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item tribe-tickets__tickets-item--shared-capacity post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="true" data-ticket-price="5" data-shared-cap="15" data-available-count="11" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 17__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 17__1.php index 2d050534ec..be53c1e2e4 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 17__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 17__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item tribe-tickets__tickets-item--shared-capacity post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="true" data-ticket-price="5" data-shared-cap="15" data-available-count="15" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 18__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 18__1.php index 060ccab3f6..3b469203da 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 18__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 18__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="false" data-ticket-price="5" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 19__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 19__1.php index 6a6976dcbd..136f2e1e7e 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 19__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 19__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="false" data-ticket-price="5" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 1__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 1__1.php index 2d050534ec..be53c1e2e4 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 1__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 1__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item tribe-tickets__tickets-item--shared-capacity post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="true" data-ticket-price="5" data-shared-cap="15" data-available-count="15" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 20__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 20__1.php index a831b1346c..68fd2f29f9 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 20__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 20__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item tribe-tickets__tickets-item--shared-capacity post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="true" data-ticket-price="5" data-shared-cap="15" data-available-count="10" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 21__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 21__1.php index 41305a1618..380694182e 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 21__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 21__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item tribe-tickets__tickets-item--shared-capacity post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="true" data-ticket-price="5" data-shared-cap="15" data-available-count="11" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 22__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 22__1.php index 2d050534ec..be53c1e2e4 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 22__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 22__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item tribe-tickets__tickets-item--shared-capacity post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="true" data-ticket-price="5" data-shared-cap="15" data-available-count="15" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 23__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 23__1.php index 680b8cecbc..56c7b98a16 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 23__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 23__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="false" data-ticket-price="5" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 24__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 24__1.php index 6a6976dcbd..136f2e1e7e 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 24__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 24__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="false" data-ticket-price="5" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 25__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 25__1.php index a831b1346c..68fd2f29f9 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 25__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 25__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item tribe-tickets__tickets-item--shared-capacity post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="true" data-ticket-price="5" data-shared-cap="15" data-available-count="10" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 26__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 26__1.php index 41305a1618..380694182e 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 26__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 26__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item tribe-tickets__tickets-item--shared-capacity post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="true" data-ticket-price="5" data-shared-cap="15" data-available-count="11" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 27__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 27__1.php index 2d050534ec..be53c1e2e4 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 27__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 27__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item tribe-tickets__tickets-item--shared-capacity post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="true" data-ticket-price="5" data-shared-cap="15" data-available-count="15" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 28__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 28__1.php index 680b8cecbc..56c7b98a16 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 28__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 28__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="false" data-ticket-price="5" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 29__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 29__1.php index 060ccab3f6..3b469203da 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 29__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 29__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="false" data-ticket-price="5" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 2__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 2__1.php index 680b8cecbc..56c7b98a16 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 2__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 2__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="false" data-ticket-price="5" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 3__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 3__1.php index 060ccab3f6..3b469203da 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 3__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 3__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="false" data-ticket-price="5" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 4__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 4__1.php index 6a6976dcbd..136f2e1e7e 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 4__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 4__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="false" data-ticket-price="5" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 5__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 5__1.php index a831b1346c..68fd2f29f9 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 5__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 5__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item tribe-tickets__tickets-item--shared-capacity post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="true" data-ticket-price="5" data-shared-cap="15" data-available-count="10" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 6__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 6__1.php index 2d050534ec..be53c1e2e4 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 6__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 6__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item tribe-tickets__tickets-item--shared-capacity post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="true" data-ticket-price="5" data-shared-cap="15" data-available-count="15" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 7__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 7__1.php index 680b8cecbc..56c7b98a16 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 7__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 7__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="false" data-ticket-price="5" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 8__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 8__1.php index 060ccab3f6..3b469203da 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 8__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 8__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="false" data-ticket-price="5" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 9__1.php b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 9__1.php index 6a6976dcbd..136f2e1e7e 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 9__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/PayPal/__snapshots__/TicketsBlockV2Test__test_should_render_ticket_block_after_update with data set 9__1.php @@ -37,8 +37,8 @@ class="tribe-tickets__tickets-form tribe-tickets__form" id="tribe-block-tickets-item-[TICKET_ID]" class="tribe-tickets__tickets-item post-[TICKET_ID] tribe_tpp_tickets type-tribe_tpp_tickets status-publish hentry" data-ticket-id="[TICKET_ID]" data-available="false" data-has-shared-cap="false" data-ticket-price="5" > -
-
+
+
Test PayPal ticket for [EVENT_ID]
@@ -119,7 +119,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy"
- +
'; diff --git a/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block with data set 0__1.php b/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block with data set 0__1.php index 8e2615841a..831d82005e 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block with data set 0__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block with data set 0__1.php @@ -67,6 +67,7 @@ class="tribe-common-c-btn tribe-tickets__rsvp-actions-button-going tribe-common- + diff --git a/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block with data set 1__1.php b/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block with data set 1__1.php index 8e2615841a..831d82005e 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block with data set 1__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block with data set 1__1.php @@ -67,6 +67,7 @@ class="tribe-common-c-btn tribe-tickets__rsvp-actions-button-going tribe-common- + diff --git a/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block with data set 2__1.php b/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block with data set 2__1.php index 8e2615841a..831d82005e 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block with data set 2__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block with data set 2__1.php @@ -67,6 +67,7 @@ class="tribe-common-c-btn tribe-tickets__rsvp-actions-button-going tribe-common- + diff --git a/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block_after_update with data set 0__1.php b/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block_after_update with data set 0__1.php index 6efd5ba75b..7ea719ff92 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block_after_update with data set 0__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block_after_update with data set 0__1.php @@ -67,6 +67,7 @@ class="tribe-common-c-btn tribe-tickets__rsvp-actions-button-going tribe-common- + @@ -74,7 +75,7 @@ class="tribe-common-c-btn tribe-tickets__rsvp-actions-button-going tribe-common-
@@ -136,6 +137,7 @@ class="tribe-common-c-btn tribe-tickets__rsvp-actions-button-going tribe-common-
+
diff --git a/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block_after_update with data set 1__1.php b/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block_after_update with data set 1__1.php index 449fdf346c..e0d38acfa2 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block_after_update with data set 1__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block_after_update with data set 1__1.php @@ -67,6 +67,7 @@ class="tribe-common-c-btn tribe-tickets__rsvp-actions-button-going tribe-common- + @@ -74,7 +75,7 @@ class="tribe-common-c-btn tribe-tickets__rsvp-actions-button-going tribe-common-
@@ -136,6 +137,7 @@ class="tribe-common-c-btn tribe-tickets__rsvp-actions-button-going tribe-common-
+
diff --git a/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block_after_update with data set 2__1.php b/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block_after_update with data set 2__1.php index b78276cea7..b0d9a72b04 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block_after_update with data set 2__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block_after_update with data set 2__1.php @@ -67,6 +67,7 @@ class="tribe-common-c-btn tribe-tickets__rsvp-actions-button-going tribe-common- + @@ -74,7 +75,7 @@ class="tribe-common-c-btn tribe-tickets__rsvp-actions-button-going tribe-common-
@@ -136,6 +137,7 @@ class="tribe-common-c-btn tribe-tickets__rsvp-actions-button-going tribe-common-
+
diff --git a/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block_after_update with data set 3__1.php b/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block_after_update with data set 3__1.php index 480ff280bc..cb8744b78f 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block_after_update with data set 3__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block_after_update with data set 3__1.php @@ -67,6 +67,7 @@ class="tribe-common-c-btn tribe-tickets__rsvp-actions-button-going tribe-common- + @@ -74,7 +75,7 @@ class="tribe-common-c-btn tribe-tickets__rsvp-actions-button-going tribe-common-
@@ -136,6 +137,7 @@ class="tribe-common-c-btn tribe-tickets__rsvp-actions-button-going tribe-common-
+
diff --git a/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block_after_update with data set 4__1.php b/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block_after_update with data set 4__1.php index d7272af9aa..faabb76946 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block_after_update with data set 4__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block_after_update with data set 4__1.php @@ -67,6 +67,7 @@ class="tribe-common-c-btn tribe-tickets__rsvp-actions-button-going tribe-common- + @@ -74,7 +75,7 @@ class="tribe-common-c-btn tribe-tickets__rsvp-actions-button-going tribe-common-
@@ -136,6 +137,7 @@ class="tribe-common-c-btn tribe-tickets__rsvp-actions-button-going tribe-common-
+
diff --git a/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block_after_update with data set 5__1.php b/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block_after_update with data set 5__1.php index d39a834e28..5429321667 100644 --- a/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block_after_update with data set 5__1.php +++ b/tests/wpunit/Tribe/Tickets/Commerce/RSVP/__snapshots__/RSVPBlockV2Test__test_should_render_ticket_block_after_update with data set 5__1.php @@ -67,6 +67,7 @@ class="tribe-common-c-btn tribe-tickets__rsvp-actions-button-going tribe-common- + @@ -74,7 +75,7 @@ class="tribe-common-c-btn tribe-tickets__rsvp-actions-button-going tribe-common-
@@ -136,6 +137,7 @@ class="tribe-common-c-btn tribe-tickets__rsvp-actions-button-going tribe-common-
+
diff --git a/tests/wpunit/Tribe/Tickets/Partials/V2/__snapshots__/TicketsTest__test_should_render_regular_tickets_block__1.php b/tests/wpunit/Tribe/Tickets/Partials/V2/__snapshots__/TicketsTest__test_should_render_regular_tickets_block__1.php index 4f81ac651e..976137ec0f 100644 --- a/tests/wpunit/Tribe/Tickets/Partials/V2/__snapshots__/TicketsTest__test_should_render_regular_tickets_block__1.php +++ b/tests/wpunit/Tribe/Tickets/Partials/V2/__snapshots__/TicketsTest__test_should_render_regular_tickets_block__1.php @@ -167,7 +167,7 @@ class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__tickets-buy" - + '; diff --git a/tests/wpunit/Tribe/Tickets/Partials/V2/__snapshots__/TicketsTest__test_should_render_ticket_block_for_is_mini__1.php b/tests/wpunit/Tribe/Tickets/Partials/V2/__snapshots__/TicketsTest__test_should_render_ticket_block_for_is_mini__1.php index 9550be3e3f..17b35d2fd6 100644 --- a/tests/wpunit/Tribe/Tickets/Partials/V2/__snapshots__/TicketsTest__test_should_render_ticket_block_for_is_mini__1.php +++ b/tests/wpunit/Tribe/Tickets/Partials/V2/__snapshots__/TicketsTest__test_should_render_ticket_block_for_is_mini__1.php @@ -127,7 +127,7 @@ class="tribe-tickets__tickets-item post-{{POST_TICKET_ID}} tribe_tpp_tickets typ - + '; diff --git a/tests/wpunit/Tribe/Tickets/Partials/V2/__snapshots__/TicketsTest__test_should_render_ticket_block_for_is_modal__1.php b/tests/wpunit/Tribe/Tickets/Partials/V2/__snapshots__/TicketsTest__test_should_render_ticket_block_for_is_modal__1.php index 4ea7741f7a..fd85216952 100644 --- a/tests/wpunit/Tribe/Tickets/Partials/V2/__snapshots__/TicketsTest__test_should_render_ticket_block_for_is_modal__1.php +++ b/tests/wpunit/Tribe/Tickets/Partials/V2/__snapshots__/TicketsTest__test_should_render_ticket_block_for_is_modal__1.php @@ -187,7 +187,7 @@ class="tribe-common-b2 tribe-common-b3--min-medium tribe-tickets__tickets-item-d - + '; diff --git a/tests/wpunit/Tribe/Tickets/__snapshots__/RSVPTest__it_should_render_rsvp_step with data set initial state__1.php b/tests/wpunit/Tribe/Tickets/__snapshots__/RSVPTest__it_should_render_rsvp_step with data set initial state__1.php index b662f7e1d7..4a1f994469 100644 --- a/tests/wpunit/Tribe/Tickets/__snapshots__/RSVPTest__it_should_render_rsvp_step with data set initial state__1.php +++ b/tests/wpunit/Tribe/Tickets/__snapshots__/RSVPTest__it_should_render_rsvp_step with data set initial state__1.php @@ -12,10 +12,10 @@

- Test RSVP ticket for 267

+ Test RSVP ticket for 13664
-

Ticket RSVP ticket excerpt for 267

+

Ticket RSVP ticket excerpt for 13664

@@ -58,6 +58,7 @@ class="tribe-common-c-btn tribe-tickets__rsvp-actions-button-going tribe-common-
+
diff --git a/tests/wpunit/Tribe/Tickets/__snapshots__/RSVPTest__it_should_render_rsvp_step with data set opt-in__1.php b/tests/wpunit/Tribe/Tickets/__snapshots__/RSVPTest__it_should_render_rsvp_step with data set opt-in__1.php index 7af40960e1..d7c6168199 100644 --- a/tests/wpunit/Tribe/Tickets/__snapshots__/RSVPTest__it_should_render_rsvp_step with data set opt-in__1.php +++ b/tests/wpunit/Tribe/Tickets/__snapshots__/RSVPTest__it_should_render_rsvp_step with data set opt-in__1.php @@ -23,10 +23,10 @@

- Test RSVP ticket for 287

+ Test RSVP ticket for 13774
-

Ticket RSVP ticket excerpt for 287

+

Ticket RSVP ticket excerpt for 13774

@@ -64,6 +64,7 @@
+
diff --git a/tests/wpunit/Tribe/Tickets/__snapshots__/RSVPTest__it_should_render_rsvp_step with data set success__1.php b/tests/wpunit/Tribe/Tickets/__snapshots__/RSVPTest__it_should_render_rsvp_step with data set success__1.php index e6e90a10a6..9acb0d41ca 100644 --- a/tests/wpunit/Tribe/Tickets/__snapshots__/RSVPTest__it_should_render_rsvp_step with data set success__1.php +++ b/tests/wpunit/Tribe/Tickets/__snapshots__/RSVPTest__it_should_render_rsvp_step with data set success__1.php @@ -23,10 +23,10 @@

- Test RSVP ticket for 279

+ Test RSVP ticket for 13712
-

Ticket RSVP ticket excerpt for 279

+

Ticket RSVP ticket excerpt for 13712

@@ -64,6 +64,7 @@
+
@@ -76,7 +77,7 @@
Jane Doe
- Test RSVP ticket for 279
+ Test RSVP ticket for 13712
@@ -84,7 +85,7 @@
Jane Doe
- Test RSVP ticket for 279
+ Test RSVP ticket for 13712
From 69f4a84b94a856b37414353e629f3afb96b4e2d2 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 12 Feb 2025 01:55:59 +0200 Subject: [PATCH 66/90] Ticket stock listener will send pre and post update values --- src/Tickets/Ticket_Actions.php | 58 ++++++++++++++++--- .../TEC/Tickets/Ticket_Actions_Test.php | 25 ++++++++ 2 files changed, 75 insertions(+), 8 deletions(-) diff --git a/src/Tickets/Ticket_Actions.php b/src/Tickets/Ticket_Actions.php index 1a3fd13b40..2803c6a897 100644 --- a/src/Tickets/Ticket_Actions.php +++ b/src/Tickets/Ticket_Actions.php @@ -68,6 +68,15 @@ class Ticket_Actions extends Controller_Contract { */ protected static array $rsvp_ids_to_sync = []; + /** + * The pre-update stock. + * + * @since TBD + * + * @var array + */ + protected static array $pre_update_stock = []; + /** * Ticket_Actions constructor. * @@ -96,8 +105,9 @@ public function __construct( Container $container ) { */ protected function do_register(): void { add_action( 'tec_tickets_ticket_upserted', [ $this, 'sync_ticket_dates_actions' ], 1000 ); - add_action( 'added_post_meta', [ $this, 'meta_keys_listener' ], 1000, 3 ); - add_action( 'updated_postmeta', [ $this, 'meta_keys_listener' ], 1000, 3 ); + add_action( 'update_post_meta', [ $this, 'pre_update_listener' ], 1000, 3 ); + add_action( 'added_post_meta', [ $this, 'meta_keys_listener' ], 1000, 4 ); + add_action( 'updated_postmeta', [ $this, 'meta_keys_listener' ], 1000, 4 ); add_action( 'tec_shutdown', [ $this, 'sync_rsvp_dates_for_all' ] ); add_action( self::TICKET_START_SALES_HOOK, [ $this, 'fire_ticket_start_date_action' ], 10, 2 ); add_action( self::TICKET_END_SALES_HOOK, [ $this, 'fire_ticket_end_date_action' ], 10, 2 ); @@ -112,6 +122,7 @@ protected function do_register(): void { */ public function unregister(): void { remove_action( 'tec_tickets_ticket_upserted', [ $this, 'sync_ticket_dates_actions' ], 1000 ); + remove_action( 'update_post_meta', [ $this, 'pre_update_listener' ], 1000 ); remove_action( 'added_post_meta', [ $this, 'meta_keys_listener' ], 1000 ); remove_action( 'updated_postmeta', [ $this, 'meta_keys_listener' ], 1000 ); remove_action( 'tec_shutdown', [ $this, 'sync_rsvp_dates_for_all' ] ); @@ -195,6 +206,33 @@ public function sync_ticket_dates_actions( int $ticket_id ): void { do_action( 'tec_tickets_ticket_dates_updated', $ticket->ID, $ticket_start_timestamp, $ticket_end_timestamp, $event->ID ); } + /** + * Listens for changes to the _stock meta keys. + * + * The method will store for the request's lifecycle the stock value before the update. + * + * @since TBD + * + * @param int $meta_id The meta ID. + * @param int $ticket_id The ticket ID. + * @param string $meta_key The meta key. + */ + public function pre_update_listener( int $meta_id, int $ticket_id, string $meta_key ): void { + if ( $meta_key !== Ticket::$stock_meta_key ) { + // We only care about _stock pre update! + return; + } + + $ptype = get_post_type( $ticket_id ); + + if ( ! in_array( $ptype, tribe_tickets()->ticket_types(), true ) ) { + // Not a ticket. + return; + } + + self::$pre_update_stock[ $meta_id ] = (int) get_post_meta( $ticket_id, Ticket::$stock_meta_key, true ); + } + /** * Listens for changes to the meta keys of interest. * @@ -206,7 +244,7 @@ public function sync_ticket_dates_actions( int $ticket_id ): void { * @param int $ticket_id The ticket ID. * @param string $meta_key The meta key. */ - public function meta_keys_listener( int $meta_id, int $ticket_id, string $meta_key ): void { + public function meta_keys_listener( int $meta_id, int $ticket_id, string $meta_key, $meta_value ): void { if ( ! in_array( $meta_key, array_merge( self::$keys_of_interest, [ Ticket::$stock_meta_key ] ), true ) ) { return; } @@ -219,7 +257,7 @@ public function meta_keys_listener( int $meta_id, int $ticket_id, string $meta_k } if ( Ticket::$stock_meta_key === $meta_key ) { - $this->fire_stock_update_action( $ticket_id ); + $this->fire_stock_update_action( $ticket_id, (int) $meta_value, self::$pre_update_stock[ $meta_id ] ?? null ); return; } @@ -262,9 +300,11 @@ public function sync_rsvp_dates_for_all() { * * @since TBD * - * @param int $ticket_id The ticket ID. + * @param int $ticket_id The ticket ID. + * @param int $new_stock The new stock value. + * @param ?int $old_stock The old stock value. */ - protected function fire_stock_update_action( int $ticket_id ): void { + protected function fire_stock_update_action( int $ticket_id, int $new_stock, ?int $old_stock = null ): void { $ticket = get_post( $ticket_id ); if ( ! $ticket instanceof WP_Post || 0 === $ticket->ID ) { @@ -277,9 +317,11 @@ protected function fire_stock_update_action( int $ticket_id ): void { * * @since TBD * - * @param int $ticket_id The ticket id. + * @param int $ticket_id The ticket id. + * @param int $new_stock The new stock value. + * @param ?int $old_stock The old stock value. */ - do_action( 'tec_tickets_ticket_stock_changed', $ticket->ID ); + do_action( 'tec_tickets_ticket_stock_changed', $ticket->ID, $new_stock, $old_stock ); } /** diff --git a/tests/integration/TEC/Tickets/Ticket_Actions_Test.php b/tests/integration/TEC/Tickets/Ticket_Actions_Test.php index dbc46a46c8..17a86303e0 100644 --- a/tests/integration/TEC/Tickets/Ticket_Actions_Test.php +++ b/tests/integration/TEC/Tickets/Ticket_Actions_Test.php @@ -165,11 +165,20 @@ public function it_should_schedule_ticket_date_and_stock_actions( Closure $fixtu $this->freeze_time( Dates::immutable( '2024-06-13 17:00:00' ) ); $this->make_controller()->register(); + $store = []; + add_action( 'tec_tickets_ticket_stock_changed', function ( $ticket_id, $new_stock, $old_stock ) use ( &$store ) { + $store = compact( 'ticket_id', 'new_stock', 'old_stock' ); + }, 10, 3 ); + [ $post_id, $ticket_id, $updater ] = $fixture(); $this->assertEquals( 1, did_action( 'tec_tickets_ticket_dates_updated' ) ); $this->assertEquals( 1, did_action( 'tec_tickets_ticket_stock_changed' ) ); + $this->assertEquals( $store['ticket_id'], $ticket_id ); + $this->assertEquals( $store['new_stock'], 5 ); + $this->assertNull( $store['old_stock'] ); + $this->assertCount( 1, $this->query_action_scheduler_actions_count( @@ -194,6 +203,10 @@ public function it_should_schedule_ticket_date_and_stock_actions( Closure $fixtu $this->assertEquals( 2, did_action( 'tec_tickets_ticket_dates_updated' ) ); $this->assertEquals( 2, did_action( 'tec_tickets_ticket_stock_changed' ) ); + $this->assertEquals( $store['ticket_id'], $ticket_id ); + $this->assertEquals( $store['new_stock'], 6 ); + $this->assertEquals( $store['old_stock'], 5 ); + $this->assertCount( 0, $this->query_action_scheduler_actions_count( @@ -221,6 +234,10 @@ public function it_should_schedule_ticket_date_and_stock_actions( Closure $fixtu $this->assertEquals( 3, did_action( 'tec_tickets_ticket_dates_updated' ) ); $this->assertEquals( 3, did_action( 'tec_tickets_ticket_stock_changed' ) ); + $this->assertEquals( $store['ticket_id'], $ticket_id ); + $this->assertEquals( $store['new_stock'], 5 ); + $this->assertEquals( $store['old_stock'], 6 ); + $this->assertCount( 0, $this->query_action_scheduler_actions_count( @@ -371,6 +388,12 @@ public function it_should_handle_stress() { $counter = 0; + $store = []; + + add_action( 'tec_tickets_ticket_stock_changed', function ( $ticket_id, $new_stock, $old_stock ) use ( &$store ) { + $store = compact( 'ticket_id', 'new_stock', 'old_stock' ); + }, 10, 3 ); + for ( $i = 0; $i < $posts; $i++ ) { $post_id = $this->factory()->post->create(); for ( $j = 0; $j < $tickets_per_post; $j++ ) { @@ -378,6 +401,8 @@ public function it_should_handle_stress() { $this->create_tc_ticket( $post_id, 10, self::set_up_data()['tickets']['pre_sale'] ); $this->assertEquals( $counter, did_action( 'tec_tickets_ticket_dates_updated' ) ); $this->assertEquals( $counter, did_action( 'tec_tickets_ticket_stock_changed' ) ); + $this->assertEquals( $store['new_stock'], 5 ); + $this->assertNull( $store['old_stock'] ); } } From ddf50a7e0a2b222351ac5d705a55545cbef69c94 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 12 Feb 2025 15:31:24 +0200 Subject: [PATCH 67/90] CR amends --- src/Tickets/Ticket_Actions.php | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/src/Tickets/Ticket_Actions.php b/src/Tickets/Ticket_Actions.php index 2803c6a897..f65569f76d 100644 --- a/src/Tickets/Ticket_Actions.php +++ b/src/Tickets/Ticket_Actions.php @@ -15,6 +15,7 @@ use TEC\Tickets\Commerce\Ticket; use WP_Post; use Exception; +use TEC\Common\StellarWP\DB\DB; /** * Class Ticket_Actions. @@ -230,7 +231,8 @@ public function pre_update_listener( int $meta_id, int $ticket_id, string $meta_ return; } - self::$pre_update_stock[ $meta_id ] = (int) get_post_meta( $ticket_id, Ticket::$stock_meta_key, true ); + // Direct DB query for performance and also to avoid triggering any hooks from get_post_meta. + self::$pre_update_stock[ $meta_id ] = (int) DB::get_var( DB::prepare( 'SELECT meta_value from %i WHERE meta_id = %d' ), DB::prefix( 'post_meta' ), $meta_id ); } /** @@ -312,14 +314,31 @@ protected function fire_stock_update_action( int $ticket_id, int $new_stock, ?in return; } + if ( null === $old_stock ) { + /** + * Fires when the stock of a ticket added. + * + * @since TBD + * + * @param int $ticket_id The ticket id. + * @param int $new_stock The new stock value. + */ + do_action( 'tec_tickets_ticket_stock_added', $ticket->ID, $new_stock ); + return; + } + + if ( $new_stock === $old_stock ) { + return; + } + /** * Fires when the stock of a ticket changes. * * @since TBD * - * @param int $ticket_id The ticket id. - * @param int $new_stock The new stock value. - * @param ?int $old_stock The old stock value. + * @param int $ticket_id The ticket id. + * @param int $new_stock The new stock value. + * @param int $old_stock The old stock value. */ do_action( 'tec_tickets_ticket_stock_changed', $ticket->ID, $new_stock, $old_stock ); } From 7fbc6f2c21d866352b8774696335e8184332282e Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 12 Feb 2025 15:36:01 +0200 Subject: [PATCH 68/90] test coverage of new action --- src/Tickets/Ticket_Actions.php | 4 ++-- .../integration/TEC/Tickets/Ticket_Actions_Test.php | 13 ++++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Tickets/Ticket_Actions.php b/src/Tickets/Ticket_Actions.php index f65569f76d..c33321f55b 100644 --- a/src/Tickets/Ticket_Actions.php +++ b/src/Tickets/Ticket_Actions.php @@ -316,12 +316,12 @@ protected function fire_stock_update_action( int $ticket_id, int $new_stock, ?in if ( null === $old_stock ) { /** - * Fires when the stock of a ticket added. + * Fires when the stock of a ticket is added. * * @since TBD * * @param int $ticket_id The ticket id. - * @param int $new_stock The new stock value. + * @param int $new_stock The new stock value that has just been set. */ do_action( 'tec_tickets_ticket_stock_added', $ticket->ID, $new_stock ); return; diff --git a/tests/integration/TEC/Tickets/Ticket_Actions_Test.php b/tests/integration/TEC/Tickets/Ticket_Actions_Test.php index 17a86303e0..5d14062e0e 100644 --- a/tests/integration/TEC/Tickets/Ticket_Actions_Test.php +++ b/tests/integration/TEC/Tickets/Ticket_Actions_Test.php @@ -125,6 +125,7 @@ function (): array { $this->assertEquals( 0, did_action( 'tec_tickets_ticket_dates_updated' ) ); $this->assertEquals( 0, did_action( 'tec_tickets_ticket_stock_changed' ) ); + $this->assertEquals( 0, did_action( 'tec_tickets_ticket_stock_added' ) ); $ticket_id = $this->create_tc_ticket( $post_id, 10, $data['tickets']['pre_sale'] ); @@ -139,6 +140,7 @@ function (): array { $this->assertEquals( 0, did_action( 'tec_tickets_ticket_dates_updated' ) ); $this->assertEquals( 0, did_action( 'tec_tickets_ticket_stock_changed' ) ); + $this->assertEquals( 0, did_action( 'tec_tickets_ticket_stock_added' ) ); $rsvp_id = $this->create_rsvp_ticket( $post_id, $data['rsvp']['pre_sale'] ); @@ -173,7 +175,8 @@ public function it_should_schedule_ticket_date_and_stock_actions( Closure $fixtu [ $post_id, $ticket_id, $updater ] = $fixture(); $this->assertEquals( 1, did_action( 'tec_tickets_ticket_dates_updated' ) ); - $this->assertEquals( 1, did_action( 'tec_tickets_ticket_stock_changed' ) ); + $this->assertEquals( 0, did_action( 'tec_tickets_ticket_stock_changed' ) ); + $this->assertEquals( 1, did_action( 'tec_tickets_ticket_stock_added' ) ); $this->assertEquals( $store['ticket_id'], $ticket_id ); $this->assertEquals( $store['new_stock'], 5 ); @@ -201,7 +204,8 @@ public function it_should_schedule_ticket_date_and_stock_actions( Closure $fixtu update_post_meta( $ticket_id, '_stock', 6 ); $this->assertEquals( 2, did_action( 'tec_tickets_ticket_dates_updated' ) ); - $this->assertEquals( 2, did_action( 'tec_tickets_ticket_stock_changed' ) ); + $this->assertEquals( 1, did_action( 'tec_tickets_ticket_stock_changed' ) ); + $this->assertEquals( 1, did_action( 'tec_tickets_ticket_stock_added' ) ); $this->assertEquals( $store['ticket_id'], $ticket_id ); $this->assertEquals( $store['new_stock'], 6 ); @@ -232,7 +236,8 @@ public function it_should_schedule_ticket_date_and_stock_actions( Closure $fixtu $this->assertEquals( 1, did_action( $this->controller_class::TICKET_START_SALES_HOOK ) ); $this->assertEquals( 3, did_action( 'tec_tickets_ticket_dates_updated' ) ); - $this->assertEquals( 3, did_action( 'tec_tickets_ticket_stock_changed' ) ); + $this->assertEquals( 2, did_action( 'tec_tickets_ticket_stock_changed' ) ); + $this->assertEquals( 1, did_action( 'tec_tickets_ticket_stock_added' ) ); $this->assertEquals( $store['ticket_id'], $ticket_id ); $this->assertEquals( $store['new_stock'], 5 ); @@ -382,6 +387,7 @@ public function it_should_handle_stress() { $this->assertEquals( 0, did_action( 'tec_tickets_ticket_dates_updated' ) ); $this->assertEquals( 0, did_action( 'tec_tickets_ticket_stock_changed' ) ); + $this->assertEquals( 0, did_action( 'tec_tickets_ticket_stock_added' ) ); $posts = 10; $tickets_per_post = 50; @@ -401,6 +407,7 @@ public function it_should_handle_stress() { $this->create_tc_ticket( $post_id, 10, self::set_up_data()['tickets']['pre_sale'] ); $this->assertEquals( $counter, did_action( 'tec_tickets_ticket_dates_updated' ) ); $this->assertEquals( $counter, did_action( 'tec_tickets_ticket_stock_changed' ) ); + $this->assertEquals( 1, did_action( 'tec_tickets_ticket_stock_added' ) ); $this->assertEquals( $store['new_stock'], 5 ); $this->assertNull( $store['old_stock'] ); } From 7a56b8dfa9685b4fdd14b0b6a3a2890bdff638b3 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 12 Feb 2025 15:42:22 +0200 Subject: [PATCH 69/90] fix prepare query call --- src/Tickets/Ticket_Actions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tickets/Ticket_Actions.php b/src/Tickets/Ticket_Actions.php index c33321f55b..871b2b1172 100644 --- a/src/Tickets/Ticket_Actions.php +++ b/src/Tickets/Ticket_Actions.php @@ -232,7 +232,7 @@ public function pre_update_listener( int $meta_id, int $ticket_id, string $meta_ } // Direct DB query for performance and also to avoid triggering any hooks from get_post_meta. - self::$pre_update_stock[ $meta_id ] = (int) DB::get_var( DB::prepare( 'SELECT meta_value from %i WHERE meta_id = %d' ), DB::prefix( 'post_meta' ), $meta_id ); + self::$pre_update_stock[ $meta_id ] = (int) DB::get_var( DB::prepare( 'SELECT meta_value from %i WHERE meta_id = %d', DB::prefix( 'post_meta' ), $meta_id ) ); } /** From dbbd225137ca26c9b4f5f9cbc1bb8a14510bf774 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 12 Feb 2025 15:47:01 +0200 Subject: [PATCH 70/90] fix another query issue -_- --- src/Tickets/Ticket_Actions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tickets/Ticket_Actions.php b/src/Tickets/Ticket_Actions.php index 871b2b1172..0a0ec1841f 100644 --- a/src/Tickets/Ticket_Actions.php +++ b/src/Tickets/Ticket_Actions.php @@ -232,7 +232,7 @@ public function pre_update_listener( int $meta_id, int $ticket_id, string $meta_ } // Direct DB query for performance and also to avoid triggering any hooks from get_post_meta. - self::$pre_update_stock[ $meta_id ] = (int) DB::get_var( DB::prepare( 'SELECT meta_value from %i WHERE meta_id = %d', DB::prefix( 'post_meta' ), $meta_id ) ); + self::$pre_update_stock[ $meta_id ] = (int) DB::get_var( DB::prepare( 'SELECT meta_value from %i WHERE meta_id = %d', DB::prefix( 'postmeta' ), $meta_id ) ); } /** From fe7b57bd0e55c3e152daa1b9aa8dfe9dc5d909be Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 12 Feb 2025 15:58:52 +0200 Subject: [PATCH 71/90] Finally fix tests --- .../TEC/Tickets/Ticket_Actions_Test.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/integration/TEC/Tickets/Ticket_Actions_Test.php b/tests/integration/TEC/Tickets/Ticket_Actions_Test.php index 5d14062e0e..57871eacbd 100644 --- a/tests/integration/TEC/Tickets/Ticket_Actions_Test.php +++ b/tests/integration/TEC/Tickets/Ticket_Actions_Test.php @@ -171,6 +171,9 @@ public function it_should_schedule_ticket_date_and_stock_actions( Closure $fixtu add_action( 'tec_tickets_ticket_stock_changed', function ( $ticket_id, $new_stock, $old_stock ) use ( &$store ) { $store = compact( 'ticket_id', 'new_stock', 'old_stock' ); }, 10, 3 ); + add_action( 'tec_tickets_ticket_stock_added', function ( $ticket_id, $new_stock ) use ( &$store ) { + $store = compact( 'ticket_id', 'new_stock' ); + }, 10, 2 ); [ $post_id, $ticket_id, $updater ] = $fixture(); @@ -180,7 +183,7 @@ public function it_should_schedule_ticket_date_and_stock_actions( Closure $fixtu $this->assertEquals( $store['ticket_id'], $ticket_id ); $this->assertEquals( $store['new_stock'], 5 ); - $this->assertNull( $store['old_stock'] ); + $this->assertTrue( ! isset( $store['old_stock'] ) ); $this->assertCount( 1, @@ -399,6 +402,9 @@ public function it_should_handle_stress() { add_action( 'tec_tickets_ticket_stock_changed', function ( $ticket_id, $new_stock, $old_stock ) use ( &$store ) { $store = compact( 'ticket_id', 'new_stock', 'old_stock' ); }, 10, 3 ); + add_action( 'tec_tickets_ticket_stock_added', function ( $ticket_id, $new_stock ) use ( &$store ) { + $store = compact( 'ticket_id', 'new_stock' ); + }, 10, 2 ); for ( $i = 0; $i < $posts; $i++ ) { $post_id = $this->factory()->post->create(); @@ -406,10 +412,10 @@ public function it_should_handle_stress() { $counter++; $this->create_tc_ticket( $post_id, 10, self::set_up_data()['tickets']['pre_sale'] ); $this->assertEquals( $counter, did_action( 'tec_tickets_ticket_dates_updated' ) ); - $this->assertEquals( $counter, did_action( 'tec_tickets_ticket_stock_changed' ) ); - $this->assertEquals( 1, did_action( 'tec_tickets_ticket_stock_added' ) ); + $this->assertEquals( 0, did_action( 'tec_tickets_ticket_stock_changed' ) ); + $this->assertEquals( $counter, did_action( 'tec_tickets_ticket_stock_added' ) ); $this->assertEquals( $store['new_stock'], 5 ); - $this->assertNull( $store['old_stock'] ); + $this->assertTrue( ! isset( $store['old_stock'] ) ); } } From 1f0d11eda7db33bdfdd3fbbc7af68349f7dee7ec Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 12 Feb 2025 16:36:13 +0200 Subject: [PATCH 72/90] Add unsubscribe template in waitlist email templates --- src/views/emails/confirmation.php | 2 + src/views/emails/spot-available.php | 2 + .../template-parts/body/unsubscribe.php | 43 +++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 src/views/emails/template-parts/body/unsubscribe.php diff --git a/src/views/emails/confirmation.php b/src/views/emails/confirmation.php index fe02c03ec9..99b9ff8d42 100644 --- a/src/views/emails/confirmation.php +++ b/src/views/emails/confirmation.php @@ -35,4 +35,6 @@ $this->template( 'template-parts/body/additional-content' ); +$this->template( 'template-parts/body/unsubscribe' ); + $this->template( 'template-parts/footer' ); diff --git a/src/views/emails/spot-available.php b/src/views/emails/spot-available.php index 1d81455978..5fedfc0b6d 100644 --- a/src/views/emails/spot-available.php +++ b/src/views/emails/spot-available.php @@ -35,4 +35,6 @@ $this->template( 'template-parts/body/additional-content' ); +$this->template( 'template-parts/body/unsubscribe' ); + $this->template( 'template-parts/footer' ); diff --git a/src/views/emails/template-parts/body/unsubscribe.php b/src/views/emails/template-parts/body/unsubscribe.php new file mode 100644 index 0000000000..a221d96f11 --- /dev/null +++ b/src/views/emails/template-parts/body/unsubscribe.php @@ -0,0 +1,43 @@ + Body > Unsubscribe. + * + * Override this template in your own theme by creating a file at: + * [your-theme]/tribe/tickets/emails/template-parts/body/unsubscribe.php + * + * See more documentation about our views templating system. + * + * @link https://evnt.is/tickets-emails-tpl Help article for Tickets Emails template files. + * + * @version TBD + * + * @since TBD + * + * @var Subscriber $subscriber The post object with properties. + */ + +use TEC\Tickets_Plus\Waitlist\Subscriber; + +if ( empty( $subscriber ) ) { + return; +} + +if ( ! $subscriber instanceof Subscriber ) { + return; +} + +?> + + +

+ get_unsubscribe_url() ) . '" target="_blank" rel="noopener noreferrer">', + '' + ); + ?> +

+ + From 3b84b3ee440e6d95610730521da587ae669da9f4 Mon Sep 17 00:00:00 2001 From: Stellar Bot <74736843+tec-bot@users.noreply.github.com> Date: Wed, 12 Feb 2025 16:26:15 -0400 Subject: [PATCH 73/90] :fast_forward: https://github.com/the-events-calendar/tribe-common/commit/37111c6eb4f2f588d8f1fd8ca18918963e7ef9c7 --- common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common b/common index e363a5663c..37111c6eb4 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit e363a5663cb4313e6971bd9ffa10e8aa1bcced87 +Subproject commit 37111c6eb4f2f588d8f1fd8ca18918963e7ef9c7 From 949c3670bf0a724b48582570c1ce4cae8aad9b1e Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 12 Feb 2025 22:29:58 +0200 Subject: [PATCH 74/90] update package lock file --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0d73a105c3..e6a1efb0ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4079,9 +4079,9 @@ } }, "node_modules/@wordpress/prettier-config": { - "version": "3.15.0", - "resolved": "https://registry.npmjs.org/@wordpress/prettier-config/-/prettier-config-3.15.0.tgz", - "integrity": "sha512-exC2rkEioTt//AnzPRyaaFv8FNYIvamPDytNol5bKQ6Qh65QSdZZE9V+GtRCrIPL7/Bq6xba03XuRVxl9TjtJg==", + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@wordpress/prettier-config/-/prettier-config-4.18.0.tgz", + "integrity": "sha512-VsFFqSBpMw5u2kq1OTQeSMTUrznnAuZ0Z7+41MOsyJjb9DFX2Yq6k1FcmUhBJWDLEvkunMorSZ7kqhUxHWPR+g==", "dev": true, "engines": { "node": ">=18.12.0", From 4c40eeb0a853c55e07dced71d588f611cbbd6cda Mon Sep 17 00:00:00 2001 From: Stellar Bot <74736843+tec-bot@users.noreply.github.com> Date: Wed, 12 Feb 2025 17:52:16 -0400 Subject: [PATCH 75/90] :fast_forward: https://github.com/the-events-calendar/tribe-common/commit/8969c1a647cb95e7d69513f260cf1e2896e4136b --- common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common b/common index 37111c6eb4..8969c1a647 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 37111c6eb4f2f588d8f1fd8ca18918963e7ef9c7 +Subproject commit 8969c1a647cb95e7d69513f260cf1e2896e4136b From ea199cacf08b0129915db197553f164aacde8ac0 Mon Sep 17 00:00:00 2001 From: Stellar Bot <74736843+tec-bot@users.noreply.github.com> Date: Wed, 12 Feb 2025 20:51:37 -0400 Subject: [PATCH 76/90] :fast_forward: https://github.com/the-events-calendar/tribe-common/commit/7cbcce91eb52fca65cdadf8dd545d42ddd1a8c6d --- common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common b/common index 8969c1a647..7cbcce91eb 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 8969c1a647cb95e7d69513f260cf1e2896e4136b +Subproject commit 7cbcce91eb52fca65cdadf8dd545d42ddd1a8c6d From abaa20d6ed15f947d4855fb48ef1912da35097a2 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Thu, 13 Feb 2025 15:14:27 +0200 Subject: [PATCH 77/90] fix phpcs issue --- src/Tickets/Ticket_Actions.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Tickets/Ticket_Actions.php b/src/Tickets/Ticket_Actions.php index 0a0ec1841f..1217fe49d8 100644 --- a/src/Tickets/Ticket_Actions.php +++ b/src/Tickets/Ticket_Actions.php @@ -242,11 +242,12 @@ public function pre_update_listener( int $meta_id, int $ticket_id, string $meta_ * * @since TBD * - * @param int $meta_id The meta ID. - * @param int $ticket_id The ticket ID. - * @param string $meta_key The meta key. + * @param int $meta_id The meta ID. + * @param int $ticket_id The ticket ID. + * @param string $meta_key The meta key. + * @param mixed $meta_value The meta value. */ - public function meta_keys_listener( int $meta_id, int $ticket_id, string $meta_key, $meta_value ): void { + public function meta_keys_listener( int $meta_id, int $ticket_id, string $meta_key, $meta_value = null ): void { if ( ! in_array( $meta_key, array_merge( self::$keys_of_interest, [ Ticket::$stock_meta_key ] ), true ) ) { return; } From df88434f7399a81af9c58b5cf1258e4f98de1162 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Thu, 13 Feb 2025 15:24:02 +0200 Subject: [PATCH 78/90] remove unsubscribe from spot available email template --- src/views/emails/spot-available.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/views/emails/spot-available.php b/src/views/emails/spot-available.php index 5fedfc0b6d..1d81455978 100644 --- a/src/views/emails/spot-available.php +++ b/src/views/emails/spot-available.php @@ -35,6 +35,4 @@ $this->template( 'template-parts/body/additional-content' ); -$this->template( 'template-parts/body/unsubscribe' ); - $this->template( 'template-parts/footer' ); From 7473b5c5becabf8c210f5921c5cbe4c49c3d1dc1 Mon Sep 17 00:00:00 2001 From: Stellar Bot <74736843+tec-bot@users.noreply.github.com> Date: Thu, 13 Feb 2025 12:28:40 -0400 Subject: [PATCH 79/90] :fast_forward: https://github.com/the-events-calendar/tribe-common/commit/abca0872f557720e8d5f6854f495329ae43afbe8 --- common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common b/common index 7cbcce91eb..abca0872f5 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 7cbcce91eb52fca65cdadf8dd545d42ddd1a8c6d +Subproject commit abca0872f557720e8d5f6854f495329ae43afbe8 From 1d3590baed09d0a9c79a5746a11bafd2600ed9f0 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Thu, 13 Feb 2025 18:23:25 +0200 Subject: [PATCH 80/90] Changes because of stellarwp/schema update --- src/Tickets/Seating/Service/Layouts.php | 4 ++-- src/Tickets/Seating/Service/Maps.php | 2 +- src/Tickets/Seating/Service/Seat_Types.php | 2 +- src/Tickets/Seating/Uplink.php | 8 ++++---- tests/_support/Commerce/OrderModifiers/Fee_Creator.php | 6 +++--- tests/slr_ecp_integration/_bootstrap.php | 8 ++++---- tests/slr_integration/Admin/Ajax_Test.php | 8 ++++---- tests/slr_integration/Admin/Maps_Layout_Homepage_Test.php | 6 +++--- tests/slr_integration/Orders/Cart_Test.php | 2 +- tests/slr_integration/Service/Seat_Types_Test.php | 2 +- tests/slr_integration/_bootstrap.php | 8 ++++---- 11 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/Tickets/Seating/Service/Layouts.php b/src/Tickets/Seating/Service/Layouts.php index 9d5b30256b..8b542481b0 100644 --- a/src/Tickets/Seating/Service/Layouts.php +++ b/src/Tickets/Seating/Service/Layouts.php @@ -275,8 +275,8 @@ public static function invalidate_cache( bool $truncate = true ): bool { $invalidated = true; if ( $truncate ) { - $invalidated &= tribe( Layouts_Table::class )->truncate() !== false && - tribe( Seat_Types_Table::class )->truncate() !== false; + $invalidated &= tribe( Layouts_Table::class )->empty_table() !== false && + tribe( Seat_Types_Table::class )->empty_table() !== false; } /** diff --git a/src/Tickets/Seating/Service/Maps.php b/src/Tickets/Seating/Service/Maps.php index a8301ddaed..0df5d77e2e 100644 --- a/src/Tickets/Seating/Service/Maps.php +++ b/src/Tickets/Seating/Service/Maps.php @@ -70,7 +70,7 @@ public static function invalidate_cache(): bool { delete_transient( self::update_transient_name() ); wp_cache_delete( 'option_map_card_objects', 'tec-tickets-seating' ); - $invalidated = tribe( Maps_Table::class )->truncate() !== false; + $invalidated = tribe( Maps_Table::class )->empty_table() !== false; /** * Fires after the caches and custom tables storing information about Maps have been diff --git a/src/Tickets/Seating/Service/Seat_Types.php b/src/Tickets/Seating/Service/Seat_Types.php index 84fba73115..2ae5535282 100644 --- a/src/Tickets/Seating/Service/Seat_Types.php +++ b/src/Tickets/Seating/Service/Seat_Types.php @@ -155,7 +155,7 @@ public function update( bool $force = false ): bool { ); $updated = $updater->check_last_update( $force ) - ->update_from_service( fn() => tribe( Seat_Types_Table::class )->truncate() ) + ->update_from_service( fn() => tribe( Seat_Types_Table::class )->empty_table() ) ->store_fetched_data( [ $this, 'insert_rows_from_service' ] ); return $updated; diff --git a/src/Tickets/Seating/Uplink.php b/src/Tickets/Seating/Uplink.php index 58e89ba7ab..68be6d6cfd 100644 --- a/src/Tickets/Seating/Uplink.php +++ b/src/Tickets/Seating/Uplink.php @@ -165,10 +165,10 @@ public function render_legend_before_input( string $field_id ): void { */ public function reset_data_on_new_connection() { // Truncate tables. - tribe( Maps::class )->truncate(); - tribe( Layouts::class )->truncate(); - tribe( Seat_Types::class )->truncate(); - tribe( Sessions::class )->truncate(); + tribe( Maps::class )->empty_table(); + tribe( Layouts::class )->empty_table(); + tribe( Seat_Types::class )->empty_table(); + tribe( Sessions::class )->empty_table(); // Clear cache. tribe( Service\Maps::class )->invalidate_cache(); diff --git a/tests/_support/Commerce/OrderModifiers/Fee_Creator.php b/tests/_support/Commerce/OrderModifiers/Fee_Creator.php index 12ef3c41f0..2afc758e41 100644 --- a/tests/_support/Commerce/OrderModifiers/Fee_Creator.php +++ b/tests/_support/Commerce/OrderModifiers/Fee_Creator.php @@ -39,9 +39,9 @@ public function reset_counter() { * @after */ public function truncate_custom_tables() { - $this->assertTrue( tribe( Relationships_Table::class )->truncate() ); - $this->assertTrue( tribe( Meta_Table::class )->truncate() ); - $this->assertTrue( tribe( Modifiers_Table::class )->truncate() ); + $this->assertTrue( tribe( Relationships_Table::class )->empty_table() ); + $this->assertTrue( tribe( Meta_Table::class )->empty_table() ); + $this->assertTrue( tribe( Modifiers_Table::class )->empty_table() ); } /** diff --git a/tests/slr_ecp_integration/_bootstrap.php b/tests/slr_ecp_integration/_bootstrap.php index eb09478616..207f7c80b5 100644 --- a/tests/slr_ecp_integration/_bootstrap.php +++ b/tests/slr_ecp_integration/_bootstrap.php @@ -60,13 +60,13 @@ tribe()->get( \TEC\Tickets\Seating\Service\Service::class ); tribe()->get( Maps::class )->update(); -tribe()->get( Maps::class )->truncate(); +tribe()->get( Maps::class )->empty_table(); tribe()->get( Layouts::class )->update(); -tribe()->get( Layouts::class )->truncate(); +tribe()->get( Layouts::class )->empty_table(); tribe()->get( Seat_Types::class )->update(); -tribe()->get( Seat_Types::class )->truncate(); +tribe()->get( Seat_Types::class )->empty_table(); tribe()->get( Sessions::class )->update(); -tribe()->get( Sessions::class )->truncate(); +tribe()->get( Sessions::class )->empty_table(); define( 'JSON_SNAPSHOT_OPTIONS', JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES ); diff --git a/tests/slr_integration/Admin/Ajax_Test.php b/tests/slr_integration/Admin/Ajax_Test.php index ad54258019..817fe6691f 100644 --- a/tests/slr_integration/Admin/Ajax_Test.php +++ b/tests/slr_integration/Admin/Ajax_Test.php @@ -57,10 +57,10 @@ public function reset_tribe_options_cache(): void { * @after */ public function truncate_tables(): void { - tribe( Maps::class )->truncate(); - tribe( Seat_Types_Table::class )->truncate(); - tribe( Layouts_Table::class )->truncate(); - tribe( Sessions::class )->truncate(); + tribe( Maps::class )->empty_table(); + tribe( Seat_Types_Table::class )->empty_table(); + tribe( Layouts_Table::class )->empty_table(); + tribe( Sessions::class )->empty_table(); } public function asset_data_provider() { diff --git a/tests/slr_integration/Admin/Maps_Layout_Homepage_Test.php b/tests/slr_integration/Admin/Maps_Layout_Homepage_Test.php index e5c04a6a79..9164c4c5a0 100644 --- a/tests/slr_integration/Admin/Maps_Layout_Homepage_Test.php +++ b/tests/slr_integration/Admin/Maps_Layout_Homepage_Test.php @@ -38,9 +38,9 @@ public function mock_user() { * @after */ public function truncate_tables():void{ - tribe( Maps_Table::class )->truncate(); - tribe( Layouts_Table::class )->truncate(); - tribe( Seat_Types_Table::class )->truncate(); + tribe( Maps_Table::class )->empty_table(); + tribe( Layouts_Table::class )->empty_table(); + tribe( Seat_Types_Table::class )->empty_table(); } public function test_empty_seating_configurations(): void { diff --git a/tests/slr_integration/Orders/Cart_Test.php b/tests/slr_integration/Orders/Cart_Test.php index 61e1925cca..83a38f1c1e 100644 --- a/tests/slr_integration/Orders/Cart_Test.php +++ b/tests/slr_integration/Orders/Cart_Test.php @@ -30,7 +30,7 @@ class Cart_Test extends WPTestCase { * @after */ public function truncate_tables(): void { - tribe( Sessions_Table::class )->truncate(); + tribe( Sessions_Table::class )->empty_table(); } public function test_save_seat_data_for_attendee():void{ diff --git a/tests/slr_integration/Service/Seat_Types_Test.php b/tests/slr_integration/Service/Seat_Types_Test.php index bfae7bc206..58defa7540 100644 --- a/tests/slr_integration/Service/Seat_Types_Test.php +++ b/tests/slr_integration/Service/Seat_Types_Test.php @@ -43,7 +43,7 @@ public function set_up_tickets_commerce(): void { * @after */ public function clean_up(): void { - tribe( Seat_Types_Table::class )->truncate(); + tribe( Seat_Types_Table::class )->empty_table(); } public function test_update_from_service(): void { diff --git a/tests/slr_integration/_bootstrap.php b/tests/slr_integration/_bootstrap.php index d99c11fd31..ad6d740af1 100644 --- a/tests/slr_integration/_bootstrap.php +++ b/tests/slr_integration/_bootstrap.php @@ -27,13 +27,13 @@ tribe()->get( \TEC\Tickets\Seating\Service\Service::class ); tribe()->get( Maps::class )->update(); -tribe()->get( Maps::class )->truncate(); +tribe()->get( Maps::class )->empty_table(); tribe()->get( Layouts::class )->update(); -tribe()->get( Layouts::class )->truncate(); +tribe()->get( Layouts::class )->empty_table(); tribe()->get( Seat_Types::class )->update(); -tribe()->get( Seat_Types::class )->truncate(); +tribe()->get( Seat_Types::class )->empty_table(); tribe()->get( Sessions::class )->update(); -tribe()->get( Sessions::class )->truncate(); +tribe()->get( Sessions::class )->empty_table(); define( 'JSON_SNAPSHOT_OPTIONS', JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES ); From 98ae7b55b3cd13bfa962207daff2d7ebd4e57ac1 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Thu, 13 Feb 2025 18:38:58 +0200 Subject: [PATCH 81/90] fix order modifier tests --- tests/_support/Commerce/OrderModifiers/Fee_Creator.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/_support/Commerce/OrderModifiers/Fee_Creator.php b/tests/_support/Commerce/OrderModifiers/Fee_Creator.php index 2afc758e41..74110f7542 100644 --- a/tests/_support/Commerce/OrderModifiers/Fee_Creator.php +++ b/tests/_support/Commerce/OrderModifiers/Fee_Creator.php @@ -39,9 +39,9 @@ public function reset_counter() { * @after */ public function truncate_custom_tables() { - $this->assertTrue( tribe( Relationships_Table::class )->empty_table() ); - $this->assertTrue( tribe( Meta_Table::class )->empty_table() ); - $this->assertTrue( tribe( Modifiers_Table::class )->empty_table() ); + $this->assertTrue( false !== tribe( Relationships_Table::class )->empty_table() ); + $this->assertTrue( false !== tribe( Meta_Table::class )->empty_table() ); + $this->assertTrue( false !== tribe( Modifiers_Table::class )->empty_table() ); } /** From f6217f1436c63d905a57ebca88b5ade8f08617b9 Mon Sep 17 00:00:00 2001 From: Stellar Bot <74736843+tec-bot@users.noreply.github.com> Date: Fri, 14 Feb 2025 12:08:27 -0400 Subject: [PATCH 82/90] :fast_forward: https://github.com/the-events-calendar/tribe-common/commit/8a0c7c3cf78fd63e4eed531d27b30d2c4cc05e9c --- common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common b/common index abca0872f5..8a0c7c3cf7 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit abca0872f557720e8d5f6854f495329ae43afbe8 +Subproject commit 8a0c7c3cf78fd63e4eed531d27b30d2c4cc05e9c From efdd8b1700af6ae9677bb711fd2445610ba26a5f Mon Sep 17 00:00:00 2001 From: Stellar Bot <74736843+tec-bot@users.noreply.github.com> Date: Mon, 17 Feb 2025 15:09:50 -0400 Subject: [PATCH 83/90] :fast_forward: https://github.com/the-events-calendar/tribe-common/commit/eccb78c9a0bf3906c71c236d8f169944b35d6697 --- common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common b/common index 8a0c7c3cf7..eccb78c9a0 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 8a0c7c3cf78fd63e4eed531d27b30d2c4cc05e9c +Subproject commit eccb78c9a0bf3906c71c236d8f169944b35d6697 From cd97db09e601a213b38b82e69260931bae498840 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Tue, 18 Feb 2025 20:58:29 +0200 Subject: [PATCH 84/90] Fix all tickets CSS and default state --- src/Tickets/Admin/Tickets/List_Table.php | 2 +- src/resources/postcss/tickets-admin-tickets.pcss | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Tickets/Admin/Tickets/List_Table.php b/src/Tickets/Admin/Tickets/List_Table.php index 82cc4d177b..92495bda58 100644 --- a/src/Tickets/Admin/Tickets/List_Table.php +++ b/src/Tickets/Admin/Tickets/List_Table.php @@ -49,7 +49,7 @@ class List_Table extends WP_List_Table { * * @var string */ - public static $default_status = 'active'; + public static $default_status = 'all'; /** * Default Sort By. diff --git a/src/resources/postcss/tickets-admin-tickets.pcss b/src/resources/postcss/tickets-admin-tickets.pcss index 822c19d271..363699c166 100644 --- a/src/resources/postcss/tickets-admin-tickets.pcss +++ b/src/resources/postcss/tickets-admin-tickets.pcss @@ -43,6 +43,10 @@ } } + .column-sold { + padding-right: 2em; + } + .column-id { text-align: left; white-space: nowrap; From 3506355f0e363268ba825700b67e573e62ee8cae Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Tue, 18 Feb 2025 21:46:56 +0200 Subject: [PATCH 85/90] Fix css update for all tickets --- src/resources/postcss/tickets-admin-tickets.pcss | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/resources/postcss/tickets-admin-tickets.pcss b/src/resources/postcss/tickets-admin-tickets.pcss index 363699c166..c15f2086ad 100644 --- a/src/resources/postcss/tickets-admin-tickets.pcss +++ b/src/resources/postcss/tickets-admin-tickets.pcss @@ -33,7 +33,7 @@ .column-sales, .column-end, .column-start { - text-align: right; + text-align: center; white-space: nowrap; width: 1%; @@ -43,10 +43,6 @@ } } - .column-sold { - padding-right: 2em; - } - .column-id { text-align: left; white-space: nowrap; From b0d5d11599e859d6a8bbc87d5353a6fd2814fc12 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 19 Feb 2025 16:51:20 +0200 Subject: [PATCH 86/90] Amend listener for RSVP date start/end --- src/Tickets/Ticket_Actions.php | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/Tickets/Ticket_Actions.php b/src/Tickets/Ticket_Actions.php index 1217fe49d8..8c48a48d82 100644 --- a/src/Tickets/Ticket_Actions.php +++ b/src/Tickets/Ticket_Actions.php @@ -352,20 +352,6 @@ protected function fire_stock_update_action( int $ticket_id, int $new_stock, ?in * @param int $ticket_id The ticket id. */ protected function sync_rsvp_dates_actions( int $ticket_id ): void { - $ticket = Tickets::load_ticket_object( $ticket_id ); - - if ( ! $ticket instanceof Ticket_Object ) { - // Not a ticket anymore... - return; - } - - $event = $ticket->get_event(); - - if ( ! $event instanceof WP_Post || 0 === $event->ID ) { - // Parent event, no longer exists. - return; - } - // We avoid checking in_array multiple times and we will rather do array_unique once. self::$rsvp_ids_to_sync[] = $ticket_id; } From 4fbfb79fc4e487ef99517825a2fbddbdf57869e1 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 19 Feb 2025 16:57:04 +0200 Subject: [PATCH 87/90] code cleaning --- src/Tickets/Ticket_Actions.php | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/Tickets/Ticket_Actions.php b/src/Tickets/Ticket_Actions.php index 8c48a48d82..861c63a3c3 100644 --- a/src/Tickets/Ticket_Actions.php +++ b/src/Tickets/Ticket_Actions.php @@ -109,7 +109,7 @@ protected function do_register(): void { add_action( 'update_post_meta', [ $this, 'pre_update_listener' ], 1000, 3 ); add_action( 'added_post_meta', [ $this, 'meta_keys_listener' ], 1000, 4 ); add_action( 'updated_postmeta', [ $this, 'meta_keys_listener' ], 1000, 4 ); - add_action( 'tec_shutdown', [ $this, 'sync_rsvp_dates_for_all' ] ); + add_action( 'tec_shutdown', [ $this, 'sync_rsvp_dates' ] ); add_action( self::TICKET_START_SALES_HOOK, [ $this, 'fire_ticket_start_date_action' ], 10, 2 ); add_action( self::TICKET_END_SALES_HOOK, [ $this, 'fire_ticket_end_date_action' ], 10, 2 ); } @@ -126,7 +126,7 @@ public function unregister(): void { remove_action( 'update_post_meta', [ $this, 'pre_update_listener' ], 1000 ); remove_action( 'added_post_meta', [ $this, 'meta_keys_listener' ], 1000 ); remove_action( 'updated_postmeta', [ $this, 'meta_keys_listener' ], 1000 ); - remove_action( 'tec_shutdown', [ $this, 'sync_rsvp_dates_for_all' ] ); + remove_action( 'tec_shutdown', [ $this, 'sync_rsvp_dates' ] ); remove_action( self::TICKET_START_SALES_HOOK, [ $this, 'fire_ticket_start_date_action' ] ); remove_action( self::TICKET_END_SALES_HOOK, [ $this, 'fire_ticket_end_date_action' ] ); } @@ -268,7 +268,8 @@ public function meta_keys_listener( int $meta_id, int $ticket_id, string $meta_k return; } - $this->sync_rsvp_dates_actions( $ticket_id ); + // We avoid checking in_array multiple times and we will rather do array_unique once. + self::$rsvp_ids_to_sync[] = $ticket_id; } /** @@ -279,7 +280,7 @@ public function meta_keys_listener( int $meta_id, int $ticket_id, string $meta_k * * @return void */ - public function sync_rsvp_dates_for_all() { + public function sync_rsvp_dates() { /** * Filters the RSVP IDs to sync. * @@ -344,18 +345,6 @@ protected function fire_stock_update_action( int $ticket_id, int $new_stock, ?in do_action( 'tec_tickets_ticket_stock_changed', $ticket->ID, $new_stock, $old_stock ); } - /** - * Syncs rsvp dates actions. - * - * @since TBD - * - * @param int $ticket_id The ticket id. - */ - protected function sync_rsvp_dates_actions( int $ticket_id ): void { - // We avoid checking in_array multiple times and we will rather do array_unique once. - self::$rsvp_ids_to_sync[] = $ticket_id; - } - /** * Fires the ticket date action. * From eb1ab11097ae3e3088c60df5b2e35751c8620931 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Wed, 19 Feb 2025 17:02:51 +0200 Subject: [PATCH 88/90] amend RSVP maker to match production code --- tests/_support/Commerce/RSVP/Ticket_Maker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/_support/Commerce/RSVP/Ticket_Maker.php b/tests/_support/Commerce/RSVP/Ticket_Maker.php index 1bdf22dc6b..5799866e0f 100644 --- a/tests/_support/Commerce/RSVP/Ticket_Maker.php +++ b/tests/_support/Commerce/RSVP/Ticket_Maker.php @@ -43,11 +43,11 @@ protected function create_rsvp_ticket( $post_id, array $overrides = [] ) { $merged_meta_input = array_merge( [ - '_tribe_rsvp_for_event' => $post_id, tribe( 'tickets.handler' )->key_capacity => $capacity, '_manage_stock' => 'yes', '_ticket_start_date' => date( 'Y-m-d H:i:s', strtotime( '-1 day' ) ), '_ticket_end_date' => date( 'Y-m-d H:i:s', strtotime( '+1 day' ) ), + '_tribe_rsvp_for_event' => $post_id, ], $meta_input ); From a26728e1338a5d2bddeacb524f5d73da14ed1145 Mon Sep 17 00:00:00 2001 From: Stellar Bot <74736843+tec-bot@users.noreply.github.com> Date: Wed, 19 Feb 2025 12:35:48 -0400 Subject: [PATCH 89/90] :fast_forward: https://github.com/the-events-calendar/tribe-common/commit/4341bea901d3face80df1dc7d26bdfe88f9024f3 --- common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common b/common index eccb78c9a0..4341bea901 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit eccb78c9a0bf3906c71c236d8f169944b35d6697 +Subproject commit 4341bea901d3face80df1dc7d26bdfe88f9024f3 From 7cb54cf20cc75c3ec61a68a40ce6803f2f4e8f02 Mon Sep 17 00:00:00 2001 From: Stellar Bot <74736843+tec-bot@users.noreply.github.com> Date: Thu, 20 Feb 2025 09:56:07 -0400 Subject: [PATCH 90/90] :fast_forward: https://github.com/the-events-calendar/tribe-common/commit/35f59d52cc51048236f8320030ce97a29584d805 --- common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common b/common index 4341bea901..35f59d52cc 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 4341bea901d3face80df1dc7d26bdfe88f9024f3 +Subproject commit 35f59d52cc51048236f8320030ce97a29584d805