<?php namespace WPMailSMTP; /** * Class Upgrade helps upgrade plugin options and similar tasks when the * occasion arises. * * @since 1.1.0 */ class Upgrade { /** * Upgrade constructor. * * @since 1.1.0 */ public function __construct() {} /** * Run upgrades. * * @since 4.0.0 */ public function run() { $upgrades = $this->upgrades(); if ( empty( $upgrades ) ) { return; } // Run any available upgrades. foreach ( $upgrades as $upgrade ) { $this->{$upgrade}(); } // Update version post upgrade(s). update_option( 'wp_mail_smtp_version', WPMS_PLUGIN_VER ); } /** * Whether we need to perform an upgrade. * * @since 1.1.0 * * @return array */ protected function upgrades() { $version = get_option( 'wp_mail_smtp_version' ); $upgrades = array(); // Version 1.1.0 upgrade; prior to this the option was not available. if ( empty( $version ) ) { $upgrades[] = 'v110_upgrade'; } return $upgrades; } /** * Upgrade routine for v1.1.0. * * Set SMTPAutoTLS to true. * * @since 1.1.0 */ public function v110_upgrade() { // Enable SMTPAutoTLS option. $values = [ 'smtp' => [ 'autotls' => true, ], ]; Options::init()->set( $values, false, false ); } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
Admin | Folder | 0755 |
|
|
Compatibility | Folder | 0755 |
|
|
Helpers | Folder | 0755 |
|
|
Providers | Folder | 0755 |
|
|
Queue | Folder | 0755 |
|
|
Reports | Folder | 0755 |
|
|
Tasks | Folder | 0755 |
|
|
UsageTracking | Folder | 0755 |
|
|
AbstractConnection.php | File | 1.09 KB | 0644 |
|
Conflicts.php | File | 14.42 KB | 0644 |
|
Connect.php | File | 9.11 KB | 0644 |
|
Connection.php | File | 964 B | 0644 |
|
ConnectionInterface.php | File | 1.01 KB | 0644 |
|
ConnectionsManager.php | File | 765 B | 0644 |
|
Core.php | File | 33.45 KB | 0644 |
|
DBRepair.php | File | 6.29 KB | 0644 |
|
Debug.php | File | 3.5 KB | 0644 |
|
Geo.php | File | 6.76 KB | 0644 |
|
MailCatcher.php | File | 1.63 KB | 0644 |
|
MailCatcherInterface.php | File | 1.16 KB | 0644 |
|
MailCatcherTrait.php | File | 13.14 KB | 0644 |
|
MailCatcherV6.php | File | 1.47 KB | 0644 |
|
Migration.php | File | 12.11 KB | 0644 |
|
MigrationAbstract.php | File | 3.21 KB | 0644 |
|
Migrations.php | File | 3.59 KB | 0644 |
|
OptimizedEmailSending.php | File | 1.15 KB | 0644 |
|
Options.php | File | 43.52 KB | 0644 |
|
Processor.php | File | 14.06 KB | 0644 |
|
SiteHealth.php | File | 12.63 KB | 0644 |
|
Upgrade.php | File | 1.23 KB | 0644 |
|
Uploads.php | File | 5.44 KB | 0644 |
|
WP.php | File | 18.84 KB | 0644 |
|
WPMailArgs.php | File | 4.44 KB | 0644 |
|
WPMailInitiator.php | File | 4.38 KB | 0644 |
|