Skip to content

Commit

Permalink
Version check + update.
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisnissle committed Dec 22, 2023
1 parent af54019 commit 4bf5306
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public static function install() {

wp_die( wp_kses_post( $notice ) );
}

self::add_options();
}

self::add_options();
}

private static function add_options() {
Expand Down
9 changes: 9 additions & 0 deletions src/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public static function init() {

protected static function init_hooks() {
add_action( 'init', array( __CLASS__, 'load_plugin_textdomain' ) );
add_action( 'init', array( __CLASS__, 'check_version' ), 10 );

/**
* Listen to action scheduler hooks for report generation
Expand Down Expand Up @@ -768,6 +769,14 @@ public static function install() {
Install::install();
}

public static function check_version() {
if ( self::has_dependencies() && ! defined( 'IFRAME_REQUEST' ) && ( get_option( 'one_stop_shop_woocommerce' ) !== self::get_version() ) ) {
Install::install();

do_action( 'oss_woocommerce_updated' );
}
}

public static function deactivate() {
if ( self::has_dependencies() && Admin::supports_wc_admin() ) {
foreach ( Admin::get_notes() as $oss_note ) {
Expand Down

0 comments on commit 4bf5306

Please sign in to comment.