PluginProbe ʕ •ᴥ•ʔ
WP Mail SMTP by WPForms – The Most Popular SMTP and Email Log Plugin / 4.7.1
WP Mail SMTP by WPForms – The Most Popular SMTP and Email Log Plugin v4.7.1
0.9.6 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 1.5.2 1.6.0 1.6.2 1.7.0 1.7.1 1.8.0 1.8.1 1.9.0 2.0.0 2.0.1 2.1.1 2.2.1 2.3.1 2.4.0 2.5.0 2.5.1 2.6.0 2.7.0 2.8.0 2.9.0 3.0.1 3.0.2 3.0.3 3.1.0 3.10.0 3.11.0 3.11.1 3.2.0 3.2.1 3.3.0 3.4.0 3.5.0 3.5.1 3.5.2 3.6.1 3.7.0 3.8.0 3.8.2 3.9.0 4.0.1 4.1.0 4.1.1 4.2.0 4.3.0 4.4.0 4.5.0 4.6.0 4.7.0 4.7.1 4.8.0 trunk 0.10.0 0.10.1 0.11.1 0.11.2 0.3.1 0.3.2 0.4 0.4.1 0.4.2 0.5.0 0.5.1 0.5.2 0.6 0.7 0.8 0.8.2 0.8.3 0.8.4 0.8.5 0.8.6 0.8.7 0.9.0 0.9.1 0.9.2 0.9.3 0.9.4 0.9.5
wp-mail-smtp / src / Upgrade.php
wp-mail-smtp / src Last commit date
Admin 6 months ago Compatibility 6 months ago Helpers 6 months ago Providers 6 months ago Queue 6 months ago Reports 6 months ago Tasks 6 months ago UsageTracking 6 months ago AbstractConnection.php 6 months ago Conflicts.php 6 months ago Connect.php 6 months ago Connection.php 6 months ago ConnectionInterface.php 6 months ago ConnectionsManager.php 6 months ago Core.php 6 months ago DBRepair.php 6 months ago Debug.php 6 months ago Geo.php 6 months ago MailCatcher.php 6 months ago MailCatcherInterface.php 6 months ago MailCatcherTrait.php 6 months ago MailCatcherV6.php 6 months ago Migration.php 6 months ago MigrationAbstract.php 6 months ago Migrations.php 6 months ago OptimizedEmailSending.php 6 months ago Options.php 6 months ago Processor.php 6 months ago SiteHealth.php 6 months ago Upgrade.php 6 months ago Uploads.php 6 months ago WP.php 6 months ago WPMailArgs.php 6 months ago WPMailInitiator.php 6 months ago
Upgrade.php
92 lines
1 <?php
2
3 namespace WPMailSMTP;
4
5 /**
6 * Class Upgrade helps upgrade plugin options and similar tasks when the
7 * occasion arises.
8 *
9 * @since 1.1.0
10 */
11 class Upgrade {
12
13 /**
14 * Upgrade constructor.
15 *
16 * @since 1.1.0
17 */
18 public function __construct() { }
19
20 /**
21 * Run upgrades.
22 *
23 * @since 4.0.0
24 */
25 public function run() {
26
27 $upgrades = $this->upgrades();
28
29 if ( empty( $upgrades ) ) {
30 return;
31 }
32
33 // Run any available upgrades.
34 foreach ( $upgrades as $upgrade ) {
35 if ( is_callable( $upgrade ) ) {
36 $upgrade();
37 }
38 }
39
40 // Update version post upgrade(s).
41 update_option( 'wp_mail_smtp_version', WPMS_PLUGIN_VER );
42 }
43
44 /**
45 * Whether we need to perform an upgrade.
46 *
47 * @since 1.1.0
48 *
49 * @return array
50 */
51 protected function upgrades() {
52
53 $version = get_option( 'wp_mail_smtp_version' );
54
55 /**
56 * Filters the list of upgrade callbacks to run.
57 *
58 * @since 4.4.0
59 *
60 * @param array $upgrades List of upgrade callbacks to run.
61 * @param string $version Latest installed version of the plugin.
62 */
63 $upgrades = apply_filters( 'wp_mail_smtp_upgrade_upgrades', [], $version );
64
65 // Version 1.1.0 upgrade; prior to this the option was not available.
66 if ( empty( $version ) ) {
67 $upgrades[] = [ $this, 'v110_upgrade' ];
68 }
69
70 return $upgrades;
71 }
72
73 /**
74 * Upgrade routine for v1.1.0.
75 *
76 * Set SMTPAutoTLS to true.
77 *
78 * @since 1.1.0
79 */
80 public function v110_upgrade() {
81
82 // Enable SMTPAutoTLS option.
83 $values = [
84 'smtp' => [
85 'autotls' => true,
86 ],
87 ];
88
89 Options::init()->set( $values, false, false );
90 }
91 }
92