Plugin Directory

Changeset 3444323


Ignore:
Timestamp:
01/21/2026 05:36:46 PM (2 months ago)
Author:
nakedcatplugins
Message:

Update to version 11.3.2 from GitHub

Location:
multibanco-ifthen-software-gateway-for-woocommerce
Files:
18 edited
1 copied

Legend:

Unmodified
Added
Removed
  • multibanco-ifthen-software-gateway-for-woocommerce/tags/11.3.2/class-wc-cofidispay-ifthen-webdados.php

    r3439612 r3444323  
    175175         */
    176176        private function upgrade() {
    177             if ( version_compare( $this->get_option( 'version' ), $this->version, '<' ) ) {
     177            $db_version = $this->get_option( 'version' );
     178            if ( version_compare( $db_version, $this->version, '<' ) ) {
    178179                $current_options = get_option( 'woocommerce_' . $this->id . '_settings', '' );
    179180                if ( ! is_array( $current_options ) ) {
     
    181182                }
    182183                // Upgrade
    183                 $this->debug_log( 'Upgrade to ' . $this->version . ' started' );
     184                $this->debug_log( 'Upgrade from ' . $db_version . ' to ' . $this->version . ' started' );
    184185                // Specific versions upgrades should be here
    185186                // Update routines when upgrading to 11.0.1 or above - Fix some autoloaded options
    186                 if ( version_compare( $this->get_option( 'version' ), '11.0.1', '<' ) ) {
     187                if ( version_compare( $db_version, '11.0.1', '<' ) ) {
    187188                    $value = get_option( $this->id . '_callback_email_sent' );
    188189                    delete_option( $this->id . '_callback_email_sent' );
     
    192193                $current_options['version'] = $this->version;
    193194                update_option( 'woocommerce_' . $this->id . '_settings', $current_options );
    194                 $this->debug_log( 'Upgrade to ' . $this->version . ' finished' );
     195                $this->debug_log( 'Upgrade from ' . $db_version . ' to ' . $this->version . ' finished' );
    195196            }
    196197        }
  • multibanco-ifthen-software-gateway-for-woocommerce/tags/11.3.2/class-wc-creditcard-ifthen-webdados.php

    r3439612 r3444323  
    170170         */
    171171        private function upgrade() {
    172             if ( version_compare( $this->get_option( 'version' ), $this->version, '<' ) ) {
     172            $db_version = $this->get_option( 'version' );
     173            if ( version_compare( $db_version, $this->version, '<' ) ) {
    173174                $current_options = get_option( 'woocommerce_' . $this->id . '_settings', '' );
    174175                if ( ! is_array( $current_options ) ) {
     
    176177                }
    177178                // Upgrade
    178                 $this->debug_log( 'Upgrade to ' . $this->version . ' started' );
     179                $this->debug_log( 'Upgrade from ' . $db_version . ' to ' . $this->version . ' started' );
    179180                // Specific versions upgrades should be here
    180181                // Update routines when upgrading to 11.0.1 or above - Fix some autoloaded options
    181                 if ( version_compare( $this->get_option( 'version' ), '11.0.1', '<' ) ) {
     182                if ( version_compare( $db_version, '11.0.1', '<' ) ) {
    182183                    $value = get_option( $this->id . '_callback_email_sent' );
    183184                    delete_option( $this->id . '_callback_email_sent' );
     
    187188                $current_options['version'] = $this->version;
    188189                update_option( 'woocommerce_' . $this->id . '_settings', $current_options );
    189                 $this->debug_log( 'Upgrade to ' . $this->version . ' finished' );
     190                $this->debug_log( 'Upgrade from ' . $db_version . ' to ' . $this->version . ' finished' );
    190191            }
    191192        }
  • multibanco-ifthen-software-gateway-for-woocommerce/tags/11.3.2/class-wc-gateway-ifthen-webdados.php

    r3381310 r3444323  
    181181         */
    182182        private function upgrade() {
    183             if ( version_compare( $this->get_option( 'version' ), $this->version, '<' ) ) {
     183            $db_version = $this->get_option( 'version' );
     184            if ( version_compare( $db_version, $this->version, '<' ) ) {
    184185                $current_options = get_option( 'woocommerce_' . $this->id . '_settings', '' );
    185186                if ( ! is_array( $current_options ) ) {
     
    187188                }
    188189                // Upgrade
    189                 $this->debug_log( 'Upgrade to ' . $this->version . ' started' );
     190                $this->debug_log( 'Upgrade from ' . $db_version . ' to ' . $this->version . ' started' );
    190191                // Specific versions upgrades should be here
    191192                // Upgrade on the database - Risky?
    192193                $current_options['version'] = $this->version;
    193194                update_option( 'woocommerce_' . $this->id . '_settings', $current_options );
    194                 $this->debug_log( 'Upgrade to ' . $this->version . ' finished' );
     195                $this->debug_log( 'Upgrade from ' . $db_version . ' to ' . $this->version . ' finished' );
    195196            }
    196197        }
  • multibanco-ifthen-software-gateway-for-woocommerce/tags/11.3.2/class-wc-ifthen-webdados.php

    r3439612 r3444323  
    1717
    1818    /* IDs */
     19    public $id                = 'ifthen_for_woocommerce'; // Plugin ID
    1920    public $multibanco_id     = 'multibanco_ifthen_for_woocommerce';
    2021    public $mbway_id          = 'mbway_ifthen_for_woocommerce';
     
    134135     */
    135136    public function __construct( $version ) {
     137        // Check version
    136138        $this->version           = $version;
    137139        $this->pro_add_on_active = function_exists( 'WC_IfthenPay_Pro' );
     
    237239            home_url( '/wc-api/WC_GatewayReturn_IfThen_Webdados/' )
    238240        );
     241        // Upgrade
     242        $this->upgrade();
    239243        // Hooks
    240244        $this->init_hooks();
     
    252256        }
    253257        return self::$_instance;
     258    }
     259
     260    /**
     261     * Upgrades (if needed)
     262     */
     263    private function upgrade() {
     264        $db_version = get_option( $this->id . '_version', '' );
     265        if ( version_compare( $db_version, $this->version, '<' ) ) {
     266            $this->debug_log( $this->id, 'Upgrade from ' . $db_version . ' to ' . $this->version . ' started' );
     267            // Update routines when upgrading to 11.3 or above - Remove old cron
     268            if ( version_compare( $db_version, '11.3', '<' ) ) {
     269                wp_clear_scheduled_hook( 'wc_ifthen_hourly_cron' );
     270            }
     271            // Update routines when upgrading to 11.3.2 or above - Clear Action Scheduler errors
     272            if ( version_compare( $db_version, '11.3.2', '<' ) ) {
     273                // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
     274                global $wpdb;
     275                // Get action IDs for wc_ifthen_hourly_cron with failed status
     276                $failed_action_ids = $wpdb->get_col(
     277                    $wpdb->prepare(
     278                        "SELECT action_id FROM {$wpdb->prefix}actionscheduler_actions
     279                        WHERE hook = %s AND status = 'failed'",
     280                        'wc_ifthen_hourly_cron'
     281                    )
     282                );
     283                if ( ! empty( $failed_action_ids ) ) {
     284                    // Delete the failed actions
     285                    $wpdb->query(
     286                        $wpdb->prepare(
     287                            "DELETE FROM {$wpdb->prefix}actionscheduler_actions
     288                            WHERE hook = %s AND status = 'failed'",
     289                            'wc_ifthen_hourly_cron'
     290                        )
     291                    );
     292                    // Delete associated logs
     293                    $ids_placeholder = implode( ',', array_fill( 0, count( $failed_action_ids ), '%d' ) );
     294                    $wpdb->query(
     295                        $wpdb->prepare(
     296                            "DELETE FROM {$wpdb->prefix}actionscheduler_logs
     297                            WHERE action_id IN ($ids_placeholder)", // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
     298                            $failed_action_ids
     299                        )
     300                    );
     301                    $this->debug_log( $this->id, 'Cleared ' . count( $failed_action_ids ) . ' failed Action Scheduler entries for wc_ifthen_hourly_cron' );
     302                } else {
     303                    $this->debug_log( $this->id, 'No failed Action Scheduler entries found for wc_ifthen_hourly_cron' );
     304                }
     305                // phpcs:enable
     306            }
     307            update_option( $this->id . '_version', $this->version );
     308            $this->debug_log( $this->id, 'Upgrade from ' . $db_version . ' to ' . $this->version . ' finished' );
     309        }
    254310    }
    255311
     
    307363            }
    308364        );
     365        add_action( 'wc_ifthen_hourly_cron', array( $this, 'action_scheduler_do_nothing' ) );
    309366        // Cancel orders with expired references - Multibanco (after_setup_theme so it runs after theme's functions.php file)
    310367        add_action(
     
    482539     * Debug / Log
    483540     *
    484      * @param string $gateway_id    The payment gateway ID.
     541     * @param string $gateway_id    The payment gateway ID or the main plugin ID.
    485542     * @param string $message       The message to debug.
    486543     * @param string $level         The debug level.
     
    40274084        }
    40284085    }
     4086
     4087    /**
     4088     * Action scheduler task that does nothing
     4089     *
     4090     * Used to keep the Action Scheduler running and not looping
     4091     */
     4092    public function action_scheduler_do_nothing() {
     4093        // Do nothing - Make sure the task does not fail for lack of a hook
     4094    }
    40294095}
  • multibanco-ifthen-software-gateway-for-woocommerce/tags/11.3.2/class-wc-mbway-ifthen-webdados.php

    r3439612 r3444323  
    176176         */
    177177        private function upgrade() {
    178             if ( version_compare( $this->get_option( 'version' ), $this->version, '<' ) ) {
     178            $db_version = $this->get_option( 'version' );
     179            if ( version_compare( $db_version, $this->version, '<' ) ) {
    179180                $current_options = get_option( 'woocommerce_' . $this->id . '_settings', '' );
    180181                if ( ! is_array( $current_options ) ) {
     
    182183                }
    183184                // Upgrade
    184                 $this->debug_log( 'Upgrade to ' . $this->version . ' started' );
     185                $this->debug_log( 'Upgrade from ' . $db_version . ' to ' . $this->version . ' started' );
    185186                // Specific versions upgrades should be here
    186187                // Update routines when upgrading to 11.0.1 or above - Fix some autoloaded options
    187                 if ( version_compare( $this->get_option( 'version' ), '11.0.1', '<' ) ) {
     188                if ( version_compare( $db_version, '11.0.1', '<' ) ) {
    188189                    $value = get_option( $this->id . '_callback_email_sent' );
    189190                    delete_option( $this->id . '_callback_email_sent' );
     
    193194                $current_options['version'] = $this->version;
    194195                update_option( 'woocommerce_' . $this->id . '_settings', $current_options );
    195                 $this->debug_log( 'Upgrade to ' . $this->version . ' finished' );
     196                $this->debug_log( 'Upgrade from ' . $db_version . ' to ' . $this->version . ' finished' );
    196197            }
    197198        }
  • multibanco-ifthen-software-gateway-for-woocommerce/tags/11.3.2/class-wc-multibanco-ifthen-webdados.php

    r3439612 r3444323  
    172172         */
    173173        private function upgrade() {
    174             if ( version_compare( $this->get_option( 'version' ), $this->version, '<' ) ) {
     174            $db_version = $this->get_option( 'version' );
     175            if ( version_compare( $db_version, $this->version, '<' ) ) {
    175176                $current_options = get_option( 'woocommerce_' . $this->id . '_settings', '' );
    176177                if ( ! is_array( $current_options ) ) {
     
    178179                }
    179180                // Upgrade
    180                 $this->debug_log( 'Upgrade to ' . $this->version . ' started' );
     181                $this->debug_log( 'Upgrade from ' . $db_version . ' to ' . $this->version . ' started' );
    181182                // Specific versions upgrades should be here
    182183                // Update routines when upgrading to 11.0.1 or above - Fix some autoloaded options
    183                 if ( version_compare( $this->get_option( 'version' ), '11.0.1', '<' ) ) {
     184                if ( version_compare( $db_version, '11.0.1', '<' ) ) {
    184185                    $value = get_option( $this->id . '_callback_email_sent' );
    185186                    delete_option( $this->id . '_callback_email_sent' );
    186187                    update_option( $this->id . '_callback_email_sent', $value, false );
    187188                }
    188                 // Update routines when upgrading to 11.3 or above - Remove old cron - This is global to the but we do it here
    189                 if ( version_compare( $this->get_option( 'version' ), '11.3', '<' ) ) {
    190                     wp_clear_scheduled_hook( 'wc_ifthen_hourly_cron' );
    191                 }
    192189                // Upgrade on the database - Risky?
    193190                $current_options['version'] = $this->version;
    194191                update_option( 'woocommerce_' . $this->id . '_settings', $current_options );
    195                 $this->debug_log( 'Upgrade to ' . $this->version . ' finished' );
     192                $this->debug_log( 'Upgrade from ' . $db_version . ' to ' . $this->version . ' finished' );
    196193            }
    197194        }
  • multibanco-ifthen-software-gateway-for-woocommerce/tags/11.3.2/class-wc-payshop-ifthen-webdados.php

    r3439612 r3444323  
    165165         */
    166166        private function upgrade() {
    167             if ( version_compare( $this->get_option( 'version' ), $this->version, '<' ) ) {
     167            $db_version = $this->get_option( 'version' );
     168            if ( version_compare( $db_version, $this->version, '<' ) ) {
    168169                $current_options = get_option( 'woocommerce_' . $this->id . '_settings', '' );
    169170                if ( ! is_array( $current_options ) ) {
     
    171172                }
    172173                // Upgrade
    173                 $this->debug_log( 'Upgrade to ' . $this->version . ' started' );
     174                $this->debug_log( 'Upgrade from ' . $db_version . ' to ' . $this->version . ' started' );
    174175                // Specific versions upgrades should be here
    175176                // Update routines when upgrading to 11.0.1 or above - Fix some autoloaded options
    176                 if ( version_compare( $this->get_option( 'version' ), '11.0.1', '<' ) ) {
     177                if ( version_compare( $db_version, '11.0.1', '<' ) ) {
    177178                    $value = get_option( $this->id . '_callback_email_sent' );
    178179                    delete_option( $this->id . '_callback_email_sent' );
     
    182183                $current_options['version'] = $this->version;
    183184                update_option( 'woocommerce_' . $this->id . '_settings', $current_options );
    184                 $this->debug_log( 'Upgrade to ' . $this->version . ' finished' );
     185                $this->debug_log( 'Upgrade from ' . $db_version . ' to ' . $this->version . ' finished' );
    185186            }
    186187        }
  • multibanco-ifthen-software-gateway-for-woocommerce/tags/11.3.2/multibanco_ifthen_for_woocommerce.php

    r3440233 r3444323  
    44 * Plugin URI:           https://www.webdados.pt/wordpress/plugins/multibanco-ifthen-software-gateway-woocommerce-wordpress/
    55 * Description:          Secure WooCommerce payments with Multibanco, MB WAY, Credit card, Apple Pay, Google Pay, Payshop, Cofidis, and PIX via ifthenpay’s payment gateway.
    6  * Version:              11.3.1
     6 * Version:              11.3.2
    77 * Author:               Naked Cat Plugins (by Webdados)
    88 * Author URI:           https://nakedcatplugins.com
  • multibanco-ifthen-software-gateway-for-woocommerce/tags/11.3.2/readme.txt

    r3440233 r3444323  
    55Tested up to: 6.9
    66Requires PHP: 7.2
    7 Stable tag: 11.3.1
     7Stable tag: 11.3.2
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    256256== Changelog ==
    257257
     258= 11.3.2 - 2026-01-21 =
     259* [FIX] Add an empty function to the `wc_ifthen_hourly_cron` scheduled action to avoid loop issues on Action Scheduler, introduced on 11.3.0, and clear its failed logs (Thanks BestSites.pt for reporting)
     260* [DEV] Move global upgrade routines from the Multibanco to the main plugin class
     261
    258262= 11.3.1 - 2026-01-15 =
    259 * [DEV] Remove unnecessary development folders from repository
     263* [DEV] Remove unnecessary development folders from the repository
    260264
    261265= 11.3.0 - 2026-01-14 =
  • multibanco-ifthen-software-gateway-for-woocommerce/trunk/class-wc-cofidispay-ifthen-webdados.php

    r3439612 r3444323  
    175175         */
    176176        private function upgrade() {
    177             if ( version_compare( $this->get_option( 'version' ), $this->version, '<' ) ) {
     177            $db_version = $this->get_option( 'version' );
     178            if ( version_compare( $db_version, $this->version, '<' ) ) {
    178179                $current_options = get_option( 'woocommerce_' . $this->id . '_settings', '' );
    179180                if ( ! is_array( $current_options ) ) {
     
    181182                }
    182183                // Upgrade
    183                 $this->debug_log( 'Upgrade to ' . $this->version . ' started' );
     184                $this->debug_log( 'Upgrade from ' . $db_version . ' to ' . $this->version . ' started' );
    184185                // Specific versions upgrades should be here
    185186                // Update routines when upgrading to 11.0.1 or above - Fix some autoloaded options
    186                 if ( version_compare( $this->get_option( 'version' ), '11.0.1', '<' ) ) {
     187                if ( version_compare( $db_version, '11.0.1', '<' ) ) {
    187188                    $value = get_option( $this->id . '_callback_email_sent' );
    188189                    delete_option( $this->id . '_callback_email_sent' );
     
    192193                $current_options['version'] = $this->version;
    193194                update_option( 'woocommerce_' . $this->id . '_settings', $current_options );
    194                 $this->debug_log( 'Upgrade to ' . $this->version . ' finished' );
     195                $this->debug_log( 'Upgrade from ' . $db_version . ' to ' . $this->version . ' finished' );
    195196            }
    196197        }
  • multibanco-ifthen-software-gateway-for-woocommerce/trunk/class-wc-creditcard-ifthen-webdados.php

    r3439612 r3444323  
    170170         */
    171171        private function upgrade() {
    172             if ( version_compare( $this->get_option( 'version' ), $this->version, '<' ) ) {
     172            $db_version = $this->get_option( 'version' );
     173            if ( version_compare( $db_version, $this->version, '<' ) ) {
    173174                $current_options = get_option( 'woocommerce_' . $this->id . '_settings', '' );
    174175                if ( ! is_array( $current_options ) ) {
     
    176177                }
    177178                // Upgrade
    178                 $this->debug_log( 'Upgrade to ' . $this->version . ' started' );
     179                $this->debug_log( 'Upgrade from ' . $db_version . ' to ' . $this->version . ' started' );
    179180                // Specific versions upgrades should be here
    180181                // Update routines when upgrading to 11.0.1 or above - Fix some autoloaded options
    181                 if ( version_compare( $this->get_option( 'version' ), '11.0.1', '<' ) ) {
     182                if ( version_compare( $db_version, '11.0.1', '<' ) ) {
    182183                    $value = get_option( $this->id . '_callback_email_sent' );
    183184                    delete_option( $this->id . '_callback_email_sent' );
     
    187188                $current_options['version'] = $this->version;
    188189                update_option( 'woocommerce_' . $this->id . '_settings', $current_options );
    189                 $this->debug_log( 'Upgrade to ' . $this->version . ' finished' );
     190                $this->debug_log( 'Upgrade from ' . $db_version . ' to ' . $this->version . ' finished' );
    190191            }
    191192        }
  • multibanco-ifthen-software-gateway-for-woocommerce/trunk/class-wc-gateway-ifthen-webdados.php

    r3381310 r3444323  
    181181         */
    182182        private function upgrade() {
    183             if ( version_compare( $this->get_option( 'version' ), $this->version, '<' ) ) {
     183            $db_version = $this->get_option( 'version' );
     184            if ( version_compare( $db_version, $this->version, '<' ) ) {
    184185                $current_options = get_option( 'woocommerce_' . $this->id . '_settings', '' );
    185186                if ( ! is_array( $current_options ) ) {
     
    187188                }
    188189                // Upgrade
    189                 $this->debug_log( 'Upgrade to ' . $this->version . ' started' );
     190                $this->debug_log( 'Upgrade from ' . $db_version . ' to ' . $this->version . ' started' );
    190191                // Specific versions upgrades should be here
    191192                // Upgrade on the database - Risky?
    192193                $current_options['version'] = $this->version;
    193194                update_option( 'woocommerce_' . $this->id . '_settings', $current_options );
    194                 $this->debug_log( 'Upgrade to ' . $this->version . ' finished' );
     195                $this->debug_log( 'Upgrade from ' . $db_version . ' to ' . $this->version . ' finished' );
    195196            }
    196197        }
  • multibanco-ifthen-software-gateway-for-woocommerce/trunk/class-wc-ifthen-webdados.php

    r3439612 r3444323  
    1717
    1818    /* IDs */
     19    public $id                = 'ifthen_for_woocommerce'; // Plugin ID
    1920    public $multibanco_id     = 'multibanco_ifthen_for_woocommerce';
    2021    public $mbway_id          = 'mbway_ifthen_for_woocommerce';
     
    134135     */
    135136    public function __construct( $version ) {
     137        // Check version
    136138        $this->version           = $version;
    137139        $this->pro_add_on_active = function_exists( 'WC_IfthenPay_Pro' );
     
    237239            home_url( '/wc-api/WC_GatewayReturn_IfThen_Webdados/' )
    238240        );
     241        // Upgrade
     242        $this->upgrade();
    239243        // Hooks
    240244        $this->init_hooks();
     
    252256        }
    253257        return self::$_instance;
     258    }
     259
     260    /**
     261     * Upgrades (if needed)
     262     */
     263    private function upgrade() {
     264        $db_version = get_option( $this->id . '_version', '' );
     265        if ( version_compare( $db_version, $this->version, '<' ) ) {
     266            $this->debug_log( $this->id, 'Upgrade from ' . $db_version . ' to ' . $this->version . ' started' );
     267            // Update routines when upgrading to 11.3 or above - Remove old cron
     268            if ( version_compare( $db_version, '11.3', '<' ) ) {
     269                wp_clear_scheduled_hook( 'wc_ifthen_hourly_cron' );
     270            }
     271            // Update routines when upgrading to 11.3.2 or above - Clear Action Scheduler errors
     272            if ( version_compare( $db_version, '11.3.2', '<' ) ) {
     273                // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
     274                global $wpdb;
     275                // Get action IDs for wc_ifthen_hourly_cron with failed status
     276                $failed_action_ids = $wpdb->get_col(
     277                    $wpdb->prepare(
     278                        "SELECT action_id FROM {$wpdb->prefix}actionscheduler_actions
     279                        WHERE hook = %s AND status = 'failed'",
     280                        'wc_ifthen_hourly_cron'
     281                    )
     282                );
     283                if ( ! empty( $failed_action_ids ) ) {
     284                    // Delete the failed actions
     285                    $wpdb->query(
     286                        $wpdb->prepare(
     287                            "DELETE FROM {$wpdb->prefix}actionscheduler_actions
     288                            WHERE hook = %s AND status = 'failed'",
     289                            'wc_ifthen_hourly_cron'
     290                        )
     291                    );
     292                    // Delete associated logs
     293                    $ids_placeholder = implode( ',', array_fill( 0, count( $failed_action_ids ), '%d' ) );
     294                    $wpdb->query(
     295                        $wpdb->prepare(
     296                            "DELETE FROM {$wpdb->prefix}actionscheduler_logs
     297                            WHERE action_id IN ($ids_placeholder)", // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
     298                            $failed_action_ids
     299                        )
     300                    );
     301                    $this->debug_log( $this->id, 'Cleared ' . count( $failed_action_ids ) . ' failed Action Scheduler entries for wc_ifthen_hourly_cron' );
     302                } else {
     303                    $this->debug_log( $this->id, 'No failed Action Scheduler entries found for wc_ifthen_hourly_cron' );
     304                }
     305                // phpcs:enable
     306            }
     307            update_option( $this->id . '_version', $this->version );
     308            $this->debug_log( $this->id, 'Upgrade from ' . $db_version . ' to ' . $this->version . ' finished' );
     309        }
    254310    }
    255311
     
    307363            }
    308364        );
     365        add_action( 'wc_ifthen_hourly_cron', array( $this, 'action_scheduler_do_nothing' ) );
    309366        // Cancel orders with expired references - Multibanco (after_setup_theme so it runs after theme's functions.php file)
    310367        add_action(
     
    482539     * Debug / Log
    483540     *
    484      * @param string $gateway_id    The payment gateway ID.
     541     * @param string $gateway_id    The payment gateway ID or the main plugin ID.
    485542     * @param string $message       The message to debug.
    486543     * @param string $level         The debug level.
     
    40274084        }
    40284085    }
     4086
     4087    /**
     4088     * Action scheduler task that does nothing
     4089     *
     4090     * Used to keep the Action Scheduler running and not looping
     4091     */
     4092    public function action_scheduler_do_nothing() {
     4093        // Do nothing - Make sure the task does not fail for lack of a hook
     4094    }
    40294095}
  • multibanco-ifthen-software-gateway-for-woocommerce/trunk/class-wc-mbway-ifthen-webdados.php

    r3439612 r3444323  
    176176         */
    177177        private function upgrade() {
    178             if ( version_compare( $this->get_option( 'version' ), $this->version, '<' ) ) {
     178            $db_version = $this->get_option( 'version' );
     179            if ( version_compare( $db_version, $this->version, '<' ) ) {
    179180                $current_options = get_option( 'woocommerce_' . $this->id . '_settings', '' );
    180181                if ( ! is_array( $current_options ) ) {
     
    182183                }
    183184                // Upgrade
    184                 $this->debug_log( 'Upgrade to ' . $this->version . ' started' );
     185                $this->debug_log( 'Upgrade from ' . $db_version . ' to ' . $this->version . ' started' );
    185186                // Specific versions upgrades should be here
    186187                // Update routines when upgrading to 11.0.1 or above - Fix some autoloaded options
    187                 if ( version_compare( $this->get_option( 'version' ), '11.0.1', '<' ) ) {
     188                if ( version_compare( $db_version, '11.0.1', '<' ) ) {
    188189                    $value = get_option( $this->id . '_callback_email_sent' );
    189190                    delete_option( $this->id . '_callback_email_sent' );
     
    193194                $current_options['version'] = $this->version;
    194195                update_option( 'woocommerce_' . $this->id . '_settings', $current_options );
    195                 $this->debug_log( 'Upgrade to ' . $this->version . ' finished' );
     196                $this->debug_log( 'Upgrade from ' . $db_version . ' to ' . $this->version . ' finished' );
    196197            }
    197198        }
  • multibanco-ifthen-software-gateway-for-woocommerce/trunk/class-wc-multibanco-ifthen-webdados.php

    r3439612 r3444323  
    172172         */
    173173        private function upgrade() {
    174             if ( version_compare( $this->get_option( 'version' ), $this->version, '<' ) ) {
     174            $db_version = $this->get_option( 'version' );
     175            if ( version_compare( $db_version, $this->version, '<' ) ) {
    175176                $current_options = get_option( 'woocommerce_' . $this->id . '_settings', '' );
    176177                if ( ! is_array( $current_options ) ) {
     
    178179                }
    179180                // Upgrade
    180                 $this->debug_log( 'Upgrade to ' . $this->version . ' started' );
     181                $this->debug_log( 'Upgrade from ' . $db_version . ' to ' . $this->version . ' started' );
    181182                // Specific versions upgrades should be here
    182183                // Update routines when upgrading to 11.0.1 or above - Fix some autoloaded options
    183                 if ( version_compare( $this->get_option( 'version' ), '11.0.1', '<' ) ) {
     184                if ( version_compare( $db_version, '11.0.1', '<' ) ) {
    184185                    $value = get_option( $this->id . '_callback_email_sent' );
    185186                    delete_option( $this->id . '_callback_email_sent' );
    186187                    update_option( $this->id . '_callback_email_sent', $value, false );
    187188                }
    188                 // Update routines when upgrading to 11.3 or above - Remove old cron - This is global to the but we do it here
    189                 if ( version_compare( $this->get_option( 'version' ), '11.3', '<' ) ) {
    190                     wp_clear_scheduled_hook( 'wc_ifthen_hourly_cron' );
    191                 }
    192189                // Upgrade on the database - Risky?
    193190                $current_options['version'] = $this->version;
    194191                update_option( 'woocommerce_' . $this->id . '_settings', $current_options );
    195                 $this->debug_log( 'Upgrade to ' . $this->version . ' finished' );
     192                $this->debug_log( 'Upgrade from ' . $db_version . ' to ' . $this->version . ' finished' );
    196193            }
    197194        }
  • multibanco-ifthen-software-gateway-for-woocommerce/trunk/class-wc-payshop-ifthen-webdados.php

    r3439612 r3444323  
    165165         */
    166166        private function upgrade() {
    167             if ( version_compare( $this->get_option( 'version' ), $this->version, '<' ) ) {
     167            $db_version = $this->get_option( 'version' );
     168            if ( version_compare( $db_version, $this->version, '<' ) ) {
    168169                $current_options = get_option( 'woocommerce_' . $this->id . '_settings', '' );
    169170                if ( ! is_array( $current_options ) ) {
     
    171172                }
    172173                // Upgrade
    173                 $this->debug_log( 'Upgrade to ' . $this->version . ' started' );
     174                $this->debug_log( 'Upgrade from ' . $db_version . ' to ' . $this->version . ' started' );
    174175                // Specific versions upgrades should be here
    175176                // Update routines when upgrading to 11.0.1 or above - Fix some autoloaded options
    176                 if ( version_compare( $this->get_option( 'version' ), '11.0.1', '<' ) ) {
     177                if ( version_compare( $db_version, '11.0.1', '<' ) ) {
    177178                    $value = get_option( $this->id . '_callback_email_sent' );
    178179                    delete_option( $this->id . '_callback_email_sent' );
     
    182183                $current_options['version'] = $this->version;
    183184                update_option( 'woocommerce_' . $this->id . '_settings', $current_options );
    184                 $this->debug_log( 'Upgrade to ' . $this->version . ' finished' );
     185                $this->debug_log( 'Upgrade from ' . $db_version . ' to ' . $this->version . ' finished' );
    185186            }
    186187        }
  • multibanco-ifthen-software-gateway-for-woocommerce/trunk/multibanco_ifthen_for_woocommerce.php

    r3440233 r3444323  
    44 * Plugin URI:           https://www.webdados.pt/wordpress/plugins/multibanco-ifthen-software-gateway-woocommerce-wordpress/
    55 * Description:          Secure WooCommerce payments with Multibanco, MB WAY, Credit card, Apple Pay, Google Pay, Payshop, Cofidis, and PIX via ifthenpay’s payment gateway.
    6  * Version:              11.3.1
     6 * Version:              11.3.2
    77 * Author:               Naked Cat Plugins (by Webdados)
    88 * Author URI:           https://nakedcatplugins.com
  • multibanco-ifthen-software-gateway-for-woocommerce/trunk/readme.txt

    r3440233 r3444323  
    55Tested up to: 6.9
    66Requires PHP: 7.2
    7 Stable tag: 11.3.1
     7Stable tag: 11.3.2
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    256256== Changelog ==
    257257
     258= 11.3.2 - 2026-01-21 =
     259* [FIX] Add an empty function to the `wc_ifthen_hourly_cron` scheduled action to avoid loop issues on Action Scheduler, introduced on 11.3.0, and clear its failed logs (Thanks BestSites.pt for reporting)
     260* [DEV] Move global upgrade routines from the Multibanco to the main plugin class
     261
    258262= 11.3.1 - 2026-01-15 =
    259 * [DEV] Remove unnecessary development folders from repository
     263* [DEV] Remove unnecessary development folders from the repository
    260264
    261265= 11.3.0 - 2026-01-14 =
Note: See TracChangeset for help on using the changeset viewer.