PluginProbe ʕ •ᴥ•ʔ
Easy HTTPS Redirection (SSL) / 2.0.1
Easy HTTPS Redirection (SSL) v2.0.1
trunk 1.5 1.6 1.8 1.9.1 1.9.2 2.0.0 2.0.1
https-redirection / classes / ehssl-installation.php
https-redirection / classes Last commit date
utilities 2 days ago ehssl-config.php 1 year ago ehssl-cronjob.php 1 year ago ehssl-custom-post-types.php 1 year ago ehssl-debug-logger.php 1 year ago ehssl-email-handler.php 1 year ago ehssl-init-time-tasks.php 2 days ago ehssl-installation.php 2 days ago ehssl-non-https-resources-scan-result-table.php 2 days ago ehssl-non-https-resources-scan-update.php 2 days ago ehssl-rules-helper.php 2 days ago ehssl-ssl-certificate.php 1 year ago index.php 1 year ago
ehssl-installation.php
64 lines
1 <?php
2 /**
3 * The installation class that handles the installation and upgrade tasks.
4 */
5 class EHSSL_Installation {
6
7 /*
8 * This function is capable of handing both single site or multi-site install and upgrade all in one.
9 */
10 public static function run_safe_installer() {
11 global $wpdb;
12
13 //Do this if multi-site setup
14 if (function_exists('is_multisite') && is_multisite()) {
15 // check if it is a network activation - if so, run the activation function for each blog id
16 if (isset($_GET['networkwide']) && ($_GET['networkwide'] == 1)) {
17 $old_blog = $wpdb->blogid;
18 // Get all blog ids
19 $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
20 foreach ($blogids as $blog_id) {
21 switch_to_blog($blog_id);
22 self::installer();
23 }
24 switch_to_blog($old_blog);
25 return;
26 }
27 }
28
29 //Do this if single site standard install
30 self::installer();
31 }
32
33 public static function installer() {
34 global $wpdb;
35
36 require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
37
38 $charset_collate = '';
39 if (!empty($wpdb->charset)) {
40 $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
41 } else {
42 $charset_collate = "DEFAULT CHARSET=utf8";
43 }
44 if (!empty($wpdb->collate)) {
45 $charset_collate .= " COLLATE $wpdb->collate";
46 }
47
48 //The members table
49 $sql = "CREATE TABLE {$wpdb->prefix}ehssl_resource_scan_tbl (
50 id bigint(20) unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
51 source_table varchar(100) NOT NULL,
52 source_uid varchar(255) NOT NULL,
53 cols_map text DEFAULT NULL,
54 meta_map text DEFAULT NULL,
55 fixed bool DEFAULT false
56 ) {$charset_collate};";
57
58 dbDelta($sql);
59
60 //Save the current DB version
61 update_option("ehssl_db_version", EASY_HTTPS_SSL_DB_VERSION);
62 }
63 }
64