$34 GRAYBYTE WORDPRESS FILE MANAGER $81

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/bqrcodec/contact.fpt.auto/wp-content/plugins/wp-mail-smtp/src/

HOME
Current File : /home/bqrcodec/contact.fpt.auto/wp-content/plugins/wp-mail-smtp/src//MigrationAbstract.php
<?php

namespace WPMailSMTP;

/**
 * Class MigrationAbstract helps migrate plugin options, DB tables and more.
 *
 * @since 3.0.0
 */
abstract class MigrationAbstract {

	/**
	 * Version of the latest migration.
	 *
	 * @since 3.0.0
	 */
	const DB_VERSION = 1;

	/**
	 * Option key where we save the current migration version.
	 *
	 * @since 3.0.0
	 */
	const OPTION_NAME = 'wp_mail_smtp_migration_version';

	/**
	 * Option key where we save any errors while performing migration.
	 *
	 * @since 3.0.0
	 */
	const ERROR_OPTION_NAME = 'wp_mail_smtp_migration_error';

	/**
	 * Current migration version, received from static::OPTION_NAME WP option
	 *
	 * @since 3.0.0
	 *
	 * @var int
	 */
	protected $cur_ver;

	/**
	 * Migration constructor.
	 *
	 * @since 3.0.0
	 */
	public function __construct() {

		$this->cur_ver = static::get_current_version();
	}

	/**
	 * Initialize migration.
	 *
	 * @since 3.0.0
	 */
	public function init() {

		$this->validate_db();
	}

	/**
	 * Whether migration is enabled.
	 *
	 * @since 3.0.0
	 *
	 * @return bool
	 */
	public static function is_enabled() {

		return true;
	}

	/**
	 * Static on purpose, to get current DB version without __construct() and validation.
	 *
	 * @since 3.0.0
	 *
	 * @return int
	 */
	public static function get_current_version() {

		return (int) get_option( static::OPTION_NAME, 0 );
	}

	/**
	 * Check DB version and update to the latest one.
	 *
	 * @since 3.0.0
	 */
	protected function validate_db() {

		if ( $this->cur_ver < static::DB_VERSION ) {
			$this->run( static::DB_VERSION );
		}
	}

	/**
	 * Update DB version in options table.
	 *
	 * @since 3.0.0
	 *
	 * @param int $version Version number.
	 */
	protected function update_db_ver( $version = 0 ) {

		$version = (int) $version;

		if ( empty( $version ) ) {
			$version = static::DB_VERSION;
		}

		// Autoload it, because this value is checked all the time
		// and no need to request it separately from all autoloaded options.
		update_option( static::OPTION_NAME, $version, true );
	}

	/**
	 * Prevent running the same migration twice.
	 * Run migration only when required.
	 *
	 * @since 3.0.0
	 *
	 * @param int $version The current migration version.
	 */
	protected function maybe_required_older_migrations( $version ) {

		$version = (int) $version;

		if ( ( $version - $this->cur_ver ) > 1 ) {
			$this->run( $version - 1 );
		}
	}

	/**
	 * Actual migration launcher.
	 *
	 * @since 3.0.0
	 *
	 * @param int $version The specified migration version to run.
	 */
	protected function run( $version ) {

		$version = (int) $version;

		if ( method_exists( $this, 'migrate_to_' . $version ) ) {
			$this->{'migrate_to_' . $version}();
		} else {
			if ( WP::in_wp_admin() ) {
				$message = sprintf( /* translators: %1$s - the DB option name, %2$s - WP Mail SMTP, %3$s - error message. */
					esc_html__( 'There was an error while upgrading the %1$s database. Please contact %2$s support with this information: %3$s.', 'wp-mail-smtp' ),
					static::OPTION_NAME,
					'<strong>WP Mail SMTP</strong>',
					'<code>migration from v' . static::get_current_version() . ' to v' . static::DB_VERSION . ' failed. Plugin version: v' . WPMS_PLUGIN_VER . '</code>'
				);

				WP::add_admin_notice( $message, WP::ADMIN_NOTICE_ERROR );
			}
		}
	}
}

Current_dir [ WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
Admin
--
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
Compatibility
--
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
Helpers
--
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
Providers
--
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
Queue
--
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
Reports
--
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
Tasks
--
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
UsageTracking
--
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
AbstractConnection.php
1.09 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
Conflicts.php
14.417 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
Connect.php
9.107 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
Connection.php
0.941 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
ConnectionInterface.php
1.014 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
ConnectionsManager.php
0.747 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
Core.php
33.351 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
DBRepair.php
6.673 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
Debug.php
3.497 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
Geo.php
6.758 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
MailCatcher.php
1.633 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
MailCatcherInterface.php
1.157 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
MailCatcherTrait.php
13.14 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
MailCatcherV6.php
1.474 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
Migration.php
12.107 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
MigrationAbstract.php
3.211 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
Migrations.php
3.592 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
OptimizedEmailSending.php
1.146 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
Options.php
40.816 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
Processor.php
14.034 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
SiteHealth.php
12.63 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
Upgrade.php
1.234 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
Uploads.php
4.632 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
WP.php
18.836 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
WPMailArgs.php
4.442 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755
WPMailInitiator.php
4.38 KB
22 Mar 2024 5.25 PM
bqrcodec / bqrcodec
0755

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF