File tree Expand file tree Collapse file tree 3 files changed +33
-0
lines changed
Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 22
33All notable changes to this project will be documented in this file. This project adhere to the [ Semantic Versioning] ( http://semver.org/ ) standard.
44
5+ ## [ 0.2.1] 2026-02-03
6+
7+ * Fix - Prevent table readiness checks while WordPress is installing.
8+
59## [ 0.2.0] 2026-01-05
610
711* Version - Update minimum required version of the stellarwp/schema library to v3.2.0.
Original file line number Diff line number Diff line change @@ -57,6 +57,14 @@ public function register(): void {
5757 Register::table ( Task_Logs::class );
5858 }
5959
60+ /*
61+ * During WordPress installation, database operations are deferred.
62+ * Don't signal table readiness until installation is complete.
63+ */
64+ if ( wp_installing () ) {
65+ return ;
66+ }
67+
6068 /**
6169 * Fires an action when the Shepherd tables are registered.
6270 *
Original file line number Diff line number Diff line change @@ -30,6 +30,27 @@ public function it_should_fire_tables_registered_action_when_successful(): void
3030 $ this ->assertTrue ( $ hook_fired , 'The tables_registered action should be fired ' );
3131 }
3232
33+ /**
34+ * @test
35+ */
36+ public function it_should_not_fire_tables_registered_action_when_wp_installing (): void {
37+ // Mock wp_installing() to return true
38+ $ this ->set_fn_return ( 'wp_installing ' , true );
39+
40+ $ hook_fired = false ;
41+ $ prefix = Config::get_hook_prefix ();
42+
43+ add_action ( "shepherd_ {$ prefix }_tables_registered " , function () use ( &$ hook_fired ) {
44+ $ hook_fired = true ;
45+ } );
46+
47+ // Re-register to trigger the action
48+ $ provider = new Provider ( Config::get_container () );
49+ $ provider ->register ();
50+
51+ $ this ->assertFalse ( $ hook_fired , 'The tables_registered action should NOT be fired when wp_installing() returns true ' );
52+ }
53+
3354 /**
3455 * @test
3556 */
You can’t perform that action at this time.
0 commit comments