Skip to content

Commit f541b74

Browse files
authored
Merge pull request #1286 from tomjn/patch-2
Run DB Install check in WP Admin and WP CLI, props @tomjn
2 parents fc72b7a + 02baea3 commit f541b74

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

classes/class-install.php

+6
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ public function __construct( $plugin ) {
7070

7171
$this->db_version = $this->get_db_version();
7272
$this->stream_url = self_admin_url( $this->plugin->admin->admin_parent_page . '&page=' . $this->plugin->admin->settings_page_slug );
73+
74+
// Ensure the tables are created even when the plugin activation hook does not run,
75+
// and run the check in WP Admin or on WP CLI to avoid extra frontend load.
76+
if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI )) {
77+
$this->check();
78+
}
7379

7480
register_activation_hook( $this->plugin->locations['plugin'], array( $this, 'check' ) );
7581
}

0 commit comments

Comments
 (0)