Skip to content

Commit

Permalink
Merge pull request #1286 from tomjn/patch-2
Browse files Browse the repository at this point in the history
Run DB Install check in WP Admin and WP CLI, props @tomjn
  • Loading branch information
kasparsd committed Sep 17, 2021
2 parents fc72b7a + 02baea3 commit f541b74
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions classes/class-install.php
Expand Up @@ -70,6 +70,12 @@ public function __construct( $plugin ) {

$this->db_version = $this->get_db_version();
$this->stream_url = self_admin_url( $this->plugin->admin->admin_parent_page . '&page=' . $this->plugin->admin->settings_page_slug );

// Ensure the tables are created even when the plugin activation hook does not run,
// and run the check in WP Admin or on WP CLI to avoid extra frontend load.
if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI )) {
$this->check();
}

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

0 comments on commit f541b74

Please sign in to comment.