PluginProbe
FluentSMTP – WP Mail SMTP Plugin with Amazon SES, SendGrid, Mailgun, Postmark, Cloudflare, toSend, Gmail and Any SMTP / trunk
FluentSMTP – WP Mail SMTP Plugin with Amazon SES, SendGrid, Mailgun, Postmark, Cloudflare, toSend, Gmail and Any SMTP vtrunk
2.4.0 trunk 1.0.1 1.1.0 1.1.1 1.2.0 2.0.0 2.0.1 2.0.2 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.71 2.2.72 2.2.73 2.2.80 2.2.81 All 32 releases
fluent-smtp / database / FluentMailDBMigrator.php

FluentMailDBMigrator.php in FluentSMTP – WP Mail SMTP Plugin with Amazon SES, SendGrid, Mailgun, Postmark, Cloudflare, toSend, Gmail and Any SMTP trunk, at database/FluentMailDBMigrator.php

46 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 require_once(ABSPATH.'wp-admin/includes/upgrade.php');
4 require_once(FLUENTMAIL_PLUGIN_PATH.'database/migrations/EmailLogs.php');
5
6 class FluentMailDBMigrator
7 {
8 public static function run($network_wide = false)
9 {
10 global $wpdb;
11
12 if ($network_wide ) {
13 if (function_exists('get_sites') && function_exists('get_current_network_id')) {
14 $site_ids = get_sites(['fields' => 'ids', 'network_id' => get_current_network_id(), 'number' => 0]);
15 } else {
16 $site_ids = $wpdb->get_col(
17 $wpdb->prepare(
18 "SELECT blog_id FROM $wpdb->blogs WHERE site_id = %d",
19 $wpdb->siteid
20 )
21 );
22 }
23
24 // Install the plugin for all these sites.
25 foreach ($site_ids as $site_id) {
26 switch_to_blog($site_id);
27 self::migrate();
28 restore_current_blog();
29 }
30 } else {
31 self::migrate();
32 }
33 }
34
35 public static function migrate()
36 {
37 \FluentMailMigrations\EmailLogs::migrate();
38 }
39 }
40
41 if (!isset($network_wide)) {
42 $network_wide = false;
43 }
44
45 FluentMailDBMigrator::run($network_wide);
46