Passed
Push — feature/rebusify ( 67b08f...0fe5b2 )
by Paul
08:12 queued 04:10
created
plugin/Modules/Upgrader/Upgrade_4_0_0.php 2 patches
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -9,58 +9,58 @@
 block discarded – undo
9 9
 
10 10
 class Upgrade_4_0_0
11 11
 {
12
-    public function __construct()
13
-    {
14
-        $this->migrateSettings();
15
-        $this->protectMetaKeys();
16
-        $this->deleteSessions();
17
-        delete_transient(Application::ID.'_cloudflare_ips');
18
-    }
12
+	public function __construct()
13
+	{
14
+		$this->migrateSettings();
15
+		$this->protectMetaKeys();
16
+		$this->deleteSessions();
17
+		delete_transient(Application::ID.'_cloudflare_ips');
18
+	}
19 19
 
20
-    /**
21
-     * @return void
22
-     */
23
-    public function deleteSessions()
24
-    {
25
-        global $wpdb;
26
-        $wpdb->query("
20
+	/**
21
+	 * @return void
22
+	 */
23
+	public function deleteSessions()
24
+	{
25
+		global $wpdb;
26
+		$wpdb->query("
27 27
             DELETE
28 28
             FROM {$wpdb->options}
29 29
             WHERE option_name LIKE '_glsr_session%'
30 30
         ");
31
-    }
31
+	}
32 32
 
33
-    /**
34
-     * @return void
35
-     */
36
-    public function migrateSettings()
37
-    {
38
-        if ($settings = get_option(OptionManager::databaseKey(3))) {
39
-            $multilingual = 'yes' == glsr(Helper::class)->dataGet($settings, 'settings.general.support.polylang')
40
-                ? 'polylang'
41
-                : '';
42
-            $settings = glsr(Helper::class)->dataSet($settings, 'settings.general.multilingual', $multilingual);
43
-            $settings = glsr(Helper::class)->dataSet($settings, 'settings.submissions.blacklist.integration', '');
44
-            unset($settings['settings']['general']['support']);
45
-            update_option(OptionManager::databaseKey(4), $settings);
46
-        }
47
-    }
33
+	/**
34
+	 * @return void
35
+	 */
36
+	public function migrateSettings()
37
+	{
38
+		if ($settings = get_option(OptionManager::databaseKey(3))) {
39
+			$multilingual = 'yes' == glsr(Helper::class)->dataGet($settings, 'settings.general.support.polylang')
40
+				? 'polylang'
41
+				: '';
42
+			$settings = glsr(Helper::class)->dataSet($settings, 'settings.general.multilingual', $multilingual);
43
+			$settings = glsr(Helper::class)->dataSet($settings, 'settings.submissions.blacklist.integration', '');
44
+			unset($settings['settings']['general']['support']);
45
+			update_option(OptionManager::databaseKey(4), $settings);
46
+		}
47
+	}
48 48
 
49
-    /**
50
-     * @return void
51
-     */
52
-    public function protectMetaKeys()
53
-    {
54
-        global $wpdb;
55
-        $keys = array_keys(glsr(CreateReviewDefaults::class)->defaults());
56
-        $keys = implode("','", $keys);
57
-        $postType = Application::POST_TYPE;
58
-        $wpdb->query("
49
+	/**
50
+	 * @return void
51
+	 */
52
+	public function protectMetaKeys()
53
+	{
54
+		global $wpdb;
55
+		$keys = array_keys(glsr(CreateReviewDefaults::class)->defaults());
56
+		$keys = implode("','", $keys);
57
+		$postType = Application::POST_TYPE;
58
+		$wpdb->query("
59 59
             UPDATE {$wpdb->postmeta} pm
60 60
             INNER JOIN {$wpdb->posts} p ON p.id = pm.post_id
61 61
             SET pm.meta_key = CONCAT('_', pm.meta_key)
62 62
             WHERE pm.meta_key IN ('{$keys}')
63 63
             AND p.post_type = '{$postType}'
64 64
         ");
65
-    }
65
+	}
66 66
 }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
         $this->migrateSettings();
15 15
         $this->protectMetaKeys();
16 16
         $this->deleteSessions();
17
-        delete_transient(Application::ID.'_cloudflare_ips');
17
+        delete_transient( Application::ID.'_cloudflare_ips' );
18 18
     }
19 19
 
20 20
     /**
@@ -23,11 +23,11 @@  discard block
 block discarded – undo
23 23
     public function deleteSessions()
24 24
     {
25 25
         global $wpdb;
26
-        $wpdb->query("
26
+        $wpdb->query( "
27 27
             DELETE
28 28
             FROM {$wpdb->options}
29 29
             WHERE option_name LIKE '_glsr_session%'
30
-        ");
30
+        " );
31 31
     }
32 32
 
33 33
     /**
@@ -35,14 +35,14 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public function migrateSettings()
37 37
     {
38
-        if ($settings = get_option(OptionManager::databaseKey(3))) {
39
-            $multilingual = 'yes' == glsr(Helper::class)->dataGet($settings, 'settings.general.support.polylang')
38
+        if( $settings = get_option( OptionManager::databaseKey( 3 ) ) ) {
39
+            $multilingual = 'yes' == glsr( Helper::class )->dataGet( $settings, 'settings.general.support.polylang' )
40 40
                 ? 'polylang'
41 41
                 : '';
42
-            $settings = glsr(Helper::class)->dataSet($settings, 'settings.general.multilingual', $multilingual);
43
-            $settings = glsr(Helper::class)->dataSet($settings, 'settings.submissions.blacklist.integration', '');
42
+            $settings = glsr( Helper::class )->dataSet( $settings, 'settings.general.multilingual', $multilingual );
43
+            $settings = glsr( Helper::class )->dataSet( $settings, 'settings.submissions.blacklist.integration', '' );
44 44
             unset($settings['settings']['general']['support']);
45
-            update_option(OptionManager::databaseKey(4), $settings);
45
+            update_option( OptionManager::databaseKey( 4 ), $settings );
46 46
         }
47 47
     }
48 48
 
@@ -52,15 +52,15 @@  discard block
 block discarded – undo
52 52
     public function protectMetaKeys()
53 53
     {
54 54
         global $wpdb;
55
-        $keys = array_keys(glsr(CreateReviewDefaults::class)->defaults());
56
-        $keys = implode("','", $keys);
55
+        $keys = array_keys( glsr( CreateReviewDefaults::class )->defaults() );
56
+        $keys = implode( "','", $keys );
57 57
         $postType = Application::POST_TYPE;
58
-        $wpdb->query("
58
+        $wpdb->query( "
59 59
             UPDATE {$wpdb->postmeta} pm
60 60
             INNER JOIN {$wpdb->posts} p ON p.id = pm.post_id
61 61
             SET pm.meta_key = CONCAT('_', pm.meta_key)
62 62
             WHERE pm.meta_key IN ('{$keys}')
63 63
             AND p.post_type = '{$postType}'
64
-        ");
64
+        " );
65 65
     }
66 66
 }
Please login to merge, or discard this patch.