Skip to content

Commit

Permalink
check update transient is an array
Browse files Browse the repository at this point in the history
  • Loading branch information
kilbot committed Mar 19, 2024
1 parent 8e655c5 commit 75f06e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion includes/Admin/Updaters/Pro_Plugin_Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,13 @@ public function update_plugins( $update, $plugin_data, $plugin_file, $locales )
$update_data = $this->check_pro_plugin_updates( $current_version );
$is_development = isset( $_ENV['DEVELOPMENT'] ) && $_ENV['DEVELOPMENT'];

// Check if $update_data is an object and convert to an array if so.
if ( is_object( $update_data ) ) {
$update_data = get_object_vars( $update_data );
}

// Check if update data is valid and if a new version is available.
if ( isset( $update_data['version'] ) && version_compare( $current_version, $update_data['version'], '<' ) ) {
if ( is_array( $update_data ) && isset( $update_data['version'] ) && version_compare( $current_version, $update_data['version'], '<' ) ) {
$license_settings = $this->get_license_settings();
$key = isset( $license_settings['key'] ) ? $license_settings['key'] : '';
$instance = isset( $license_settings['instance'] ) ? $license_settings['instance'] : '';
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=== WooCommerce POS ===
Contributors: kilbot
Tags: cart, e-commerce, ecommerce, inventory, point-of-sale, pos, sales, sell, shop, shopify, store, vend, woocommerce, wordpress-ecommerce
Tags: ecommerce, point-of-sale, pos, inventory, store
Requires at least: 5.6
Tested up to: 6.5
Stable tag: 1.4.12
Expand Down

0 comments on commit 75f06e9

Please sign in to comment.