HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //proc/self/cwd/wp-content/plugins/woo-stripe-payment/includes/class-wc-stripe-update.php
<?php

defined( 'ABSPATH' ) || exit();

/**
 *
 * @author PaymentPlugins
 * @package Stripe/Classes
 *
 */
class WC_Stripe_Update {

	private static $updates
		= array(
			'3.0.7' => 'update-3.0.7.php',
			'3.1.0' => 'update-3.1.0.php',
			'3.1.1' => 'update-3.1.1.php',
			'3.1.6' => 'update-3.1.6.php',
			'3.1.7' => 'update-3.1.7.php',
			'3.2.8' => 'update-3.2.8.php',
			'3.3.13' => 'update-3.3.13.php',
			'3.3.14' => 'update-3.3.14.php'
		);

	public static function init() {
		add_action( 'init', array( __CLASS__, 'update' ) );
	}

	/**
	 * Performs an update on the plugin if required.
	 */
	public static function update() {
		// if option is not set, make the default version 3.0.6.
		$current_version = get_option( 'stripe_wc_version', '3.0.6' );

		// if database version is less than plugin version, an update might be required.
		if ( version_compare( $current_version, stripe_wc()->version(), '<' ) ) {
			foreach ( self::$updates as $version => $path ) {
				/*
				 * If the current version is less than the version in the loop, then perform upgrade.
				 */
				if ( version_compare( $current_version, $version, '<' ) ) {
					$file = stripe_wc()->plugin_path() . 'includes/updates/' . $path;
					if ( file_exists( $file ) ) {
						include $file;
					}
					$current_version = $version;
					update_option( 'stripe_wc_version', $current_version );
					add_action(
						'admin_notices',
						function () use ( $current_version ) {
							$message = sprintf( __( 'Thank you for updating Stripe for WooCommerce to version %1$s.', 'woo-stripe-payment' ), $current_version );
							if ( ( $text = self::get_messages( $current_version ) ) ) {
								$message .= ' ' . $text;
							}
							printf( '<div class="notice notice-success is-dismissible"><p>%1$s</p></div>', $message );
						}
					);
				}
			}
			// save latest version.
			update_option( 'stripe_wc_version', stripe_wc()->version() );
		}
	}

	public static function get_messages( $version ) {
		$messages = array();

		return isset( $messages[ $version ] ) ? $messages[ $version ] : false;
	}

}

WC_Stripe_Update::init();