diff --git a/includes/Services/PluginUpgrader.php b/includes/Services/PluginUpgrader.php index 9acae1c..fbd0999 100644 --- a/includes/Services/PluginUpgrader.php +++ b/includes/Services/PluginUpgrader.php @@ -30,16 +30,11 @@ public static function upgrade_extended_yith_plugins() { // Array to store the status of each plugin's upgrade process $yith_plugins_upgrade_status = array(); - // Loop through each YITH plugin and use the upgrade_single_extended_plugin function for the upgrade foreach ( $yith_plugins_to_upgrade as $index => $extended_slug ) { - // Call the single plugin upgrade function and get the status - $upgrade_status = self::upgrade_single_extended_plugin( $extended_slug ); - - // Store the result of the upgrade in the array + $upgrade_status = self::upgrade_extended_yith_plugin( $extended_slug ); $yith_plugins_upgrade_status[ $extended_slug ] = $upgrade_status; } - // Return the array containing the upgrade status for each plugin return $yith_plugins_upgrade_status; } @@ -50,7 +45,7 @@ public static function upgrade_extended_yith_plugins() { * * @return array Contains the status of the upgrade process with 'upgraded' and 'message' keys. */ - public static function upgrade_single_extended_plugin( $extended_slug ) { + public static function upgrade_extended_yith_plugin( $extended_slug ) { // Define the list of extended YITH plugins and their corresponding premium versions. // TODO: Replace the dummy entitlement slug 'nfd_slug_yith_paypal_payments_for_woocommerce' with actual entitlement slugs. $yith_plugins_to_upgrade = array( diff --git a/includes/WPCLI/Handlers/InstallerCommandHandler.php b/includes/WPCLI/Handlers/InstallerCommandHandler.php index 1b78c58..7ddc5d5 100644 --- a/includes/WPCLI/Handlers/InstallerCommandHandler.php +++ b/includes/WPCLI/Handlers/InstallerCommandHandler.php @@ -57,16 +57,16 @@ public function auto_upgrade_extended_yith_plugins() { * * ## EXAMPLES * - * wp installer upgrade_single_extended_yith_plugin + * wp installer upgrade_extended_yith_plugin * * @param array $args Arguments passed from the command line. First argument is the plugin slug. * * @return void */ - public function upgrade_single_yith_plugin( $args ) { + public function upgrade_extended_yith_plugin( $args ) { $plugin_slug = $args[0]; - $status_info = PluginUpgrader::upgrade_single_extended_plugin( $plugin_slug ); + $status_info = PluginUpgrader::upgrade_extended_yith_plugin( $plugin_slug ); $status_json = wp_json_encode( array( 'slug' => $plugin_slug,