helpers->isAjaxCronRestRequest() || ! aioseo()->helpers->isPluginActive( 'bbpress' ) ) { return; } // Hook into `plugins_loaded` to ensure bbPress has loaded some necessary functions. add_action( 'plugins_loaded', [ $this, 'maybeLoad' ], 20 ); } /** * Hooked into `plugins_loaded` action hook. * * @since 4.8.1 * * @return void */ public function maybeLoad() { // If the bbPress version is below 2 we bail. if ( ! function_exists( 'bbp_get_version' ) || version_compare( bbp_get_version(), '2', '<' ) ) { return; } add_action( 'wp', [ $this, 'setComponent' ] ); } /** * Hooked into `wp` action hook. * * @since 4.8.1 * * @return void */ public function setComponent() { $this->component = new Component(); } }