Skip to content

Commit

Permalink
Adds compat checker checks before plugin init.
Browse files Browse the repository at this point in the history
  • Loading branch information
ibndawood committed Oct 6, 2023
1 parent 55688c0 commit d64a0f4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions facebook-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
* @package FacebookCommerce
*/

require_once __DIR__ . '/vendor/autoload.php';

use Automattic\WooCommerce\Grow\Tools\CompatChecker\v0_0_1\Checker;
use Automattic\WooCommerce\Utilities\FeaturesUtil;

defined( 'ABSPATH' ) || exit;
Expand Down Expand Up @@ -88,7 +91,6 @@ protected function __construct() {

add_action( 'admin_init', array( $this, 'check_environment' ) );

add_action( 'admin_notices', array( $this, 'add_plugin_notices' ) ); // admin_init is too early for the get_current_screen() function.
add_action( 'admin_notices', array( $this, 'admin_notices' ), 15 );

// If the environment check fails, initialize the plugin.
Expand Down Expand Up @@ -127,7 +129,7 @@ public function __wakeup() {
*/
public function init_plugin() {

if ( ! $this->plugins_compatible() ) {
if ( ! Checker::instance()->is_compatible( __FILE__, self::PLUGIN_VERSION ) || ! $this->plugins_compatible() ) {
return;
}

Expand Down

0 comments on commit d64a0f4

Please sign in to comment.