Completed
Branch 973/fix-visible-recaptcha (0580c7)
by
unknown
03:03 queued 30s
created
core/EE_Network_Config.core.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     public static function instance()
40 40
     {
41 41
         // check if class object is instantiated, and instantiated properly
42
-        if (! self::$_instance instanceof EE_Network_Config) {
42
+        if ( ! self::$_instance instanceof EE_Network_Config) {
43 43
             self::$_instance = new self();
44 44
         }
45 45
         return self::$_instance;
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
         // need to bust cache for comparing original if this is a multisite install
137 137
         if (is_multisite()) {
138 138
             global $current_site;
139
-            $cache_key = $current_site->id . ':ee_network_config';
139
+            $cache_key = $current_site->id.':ee_network_config';
140 140
             wp_cache_delete($cache_key, 'site-options');
141 141
         }
142 142
 
Please login to merge, or discard this patch.
Indentation   +197 added lines, -197 removed lines patch added patch discarded remove patch
@@ -14,180 +14,180 @@  discard block
 block discarded – undo
14 14
 final class EE_Network_Config
15 15
 {
16 16
 
17
-    /**
18
-     * @var EE_Network_Config $_instance
19
-     */
20
-    private static $_instance;
21
-
22
-    /**
23
-     * addons can add their specific network_config objects to this property
24
-     *
25
-     * @var EE_Config_Base[] $addons
26
-     */
27
-    public $addons;
28
-
29
-    /**
30
-     * @var EE_Network_Core_Config $core
31
-     */
32
-    public $core;
33
-
34
-
35
-    /**
36
-     * @singleton method used to instantiate class object
37
-     * @return EE_Network_Config instance
38
-     */
39
-    public static function instance()
40
-    {
41
-        // check if class object is instantiated, and instantiated properly
42
-        if (! self::$_instance instanceof EE_Network_Config) {
43
-            self::$_instance = new self();
44
-        }
45
-        return self::$_instance;
46
-    }
47
-
48
-
49
-    /**
50
-     * class constructor
51
-     */
52
-    private function __construct()
53
-    {
54
-        do_action('AHEE__EE_Network_Config__construct__begin', $this);
55
-        // set defaults
56
-        $this->core = apply_filters('FHEE__EE_Network_Config___construct__core', new EE_Network_Core_Config());
57
-        $this->addons = array();
58
-
59
-        $this->_load_config();
60
-
61
-        // construct__end hook
62
-        do_action('AHEE__EE_Network_Config__construct__end', $this);
63
-    }
64
-
65
-
66
-    /**
67
-     * load EE Network Config options
68
-     *
69
-     * @return void
70
-     */
71
-    private function _load_config()
72
-    {
73
-        // load network config start hook
74
-        do_action('AHEE__EE_Network_Config___load_config__start', $this);
75
-        $config = $this->get_config();
76
-        foreach ($config as $config_prop => $settings) {
77
-            if ($config_prop === 'core' && ! $settings instanceof EE_Network_Core_Config) {
78
-                $core = new EE_Network_Core_Config();
79
-                foreach ($settings as $prop => $setting) {
80
-                    if (property_exists($core, $prop)) {
81
-                        $core->{$prop} = $setting;
82
-                    }
83
-                }
84
-                $settings = $core;
85
-                add_filter('FHEE__EE_Network_Config___load_config__update_network_config', '__return_true');
86
-            }
87
-            if (is_object($settings) && property_exists($this, $config_prop)) {
88
-                $this->{$config_prop} = apply_filters(
89
-                    'FHEE__EE_Network_Config___load_config__config_settings',
90
-                    $settings,
91
-                    $config_prop,
92
-                    $this
93
-                );
94
-                if (method_exists($settings, 'populate')) {
95
-                    $this->{$config_prop}->populate();
96
-                }
97
-                if (method_exists($settings, 'do_hooks')) {
98
-                    $this->{$config_prop}->do_hooks();
99
-                }
100
-            }
101
-        }
102
-        if (apply_filters('FHEE__EE_Network_Config___load_config__update_network_config', false)) {
103
-            $this->update_config();
104
-        }
105
-
106
-        // load network config end hook
107
-        do_action('AHEE__EE_Network_Config___load_config__end', $this);
108
-    }
109
-
110
-
111
-    /**
112
-     * get_config
113
-     *
114
-     * @return array of network config stuff
115
-     */
116
-    public function get_config()
117
-    {
118
-        // grab network configuration
119
-        $CFG = get_site_option('ee_network_config', array());
120
-        $CFG = apply_filters('FHEE__EE_Network_Config__get_config__CFG', $CFG);
121
-        return $CFG;
122
-    }
123
-
124
-
125
-    /**
126
-     * update_config
127
-     *
128
-     * @param bool $add_success
129
-     * @param bool $add_error
130
-     * @return bool success
131
-     */
132
-    public function update_config($add_success = false, $add_error = true)
133
-    {
134
-        do_action('AHEE__EE_Network_Config__update_config__begin', $this);
135
-
136
-        // need to bust cache for comparing original if this is a multisite install
137
-        if (is_multisite()) {
138
-            global $current_site;
139
-            $cache_key = $current_site->id . ':ee_network_config';
140
-            wp_cache_delete($cache_key, 'site-options');
141
-        }
142
-
143
-        // we have to compare existing saved config with config in memory because if there is no difference that means
144
-        // that the method executed fine but there just was no update.  WordPress doesn't distinguish between false because
145
-        // there were 0 records updated because of no change vs false because some error produced problems with the update.
146
-        $original = get_site_option('ee_network_config');
147
-
148
-        if ($original == $this) {
149
-            return true;
150
-        }
151
-        // update
152
-        $saved = update_site_option('ee_network_config', $this);
153
-
154
-        do_action('AHEE__EE_Network_Config__update_config__end', $this, $saved);
155
-        // if config remains the same or was updated successfully
156
-        if ($saved) {
157
-            if ($add_success) {
158
-                $msg = is_multisite() ? esc_html__(
159
-                    'The Event Espresso Network Configuration Settings have been successfully updated.',
160
-                    'event_espresso'
161
-                ) : esc_html__('Extra Event Espresso Configuration settings were successfully updated.', 'event_espresso');
162
-                EE_Error::add_success($msg);
163
-            }
164
-            return true;
165
-        }
166
-        if ($add_error) {
167
-            $msg = is_multisite() ? esc_html__(
168
-                'The Event Espresso Network Configuration Settings were not updated.',
169
-                'event_espresso'
170
-            ) : esc_html__('Extra Event Espresso Network Configuration settings were not updated.', 'event_espresso');
171
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
172
-        }
173
-        return false;
174
-    }
175
-
176
-
177
-    /**
178
-     * __sleep
179
-     *
180
-     * @return array
181
-     */
182
-    public function __sleep()
183
-    {
184
-        return apply_filters(
185
-            'FHEE__EE_Network_Config__sleep',
186
-            array(
187
-                'core',
188
-            )
189
-        );
190
-    }
17
+	/**
18
+	 * @var EE_Network_Config $_instance
19
+	 */
20
+	private static $_instance;
21
+
22
+	/**
23
+	 * addons can add their specific network_config objects to this property
24
+	 *
25
+	 * @var EE_Config_Base[] $addons
26
+	 */
27
+	public $addons;
28
+
29
+	/**
30
+	 * @var EE_Network_Core_Config $core
31
+	 */
32
+	public $core;
33
+
34
+
35
+	/**
36
+	 * @singleton method used to instantiate class object
37
+	 * @return EE_Network_Config instance
38
+	 */
39
+	public static function instance()
40
+	{
41
+		// check if class object is instantiated, and instantiated properly
42
+		if (! self::$_instance instanceof EE_Network_Config) {
43
+			self::$_instance = new self();
44
+		}
45
+		return self::$_instance;
46
+	}
47
+
48
+
49
+	/**
50
+	 * class constructor
51
+	 */
52
+	private function __construct()
53
+	{
54
+		do_action('AHEE__EE_Network_Config__construct__begin', $this);
55
+		// set defaults
56
+		$this->core = apply_filters('FHEE__EE_Network_Config___construct__core', new EE_Network_Core_Config());
57
+		$this->addons = array();
58
+
59
+		$this->_load_config();
60
+
61
+		// construct__end hook
62
+		do_action('AHEE__EE_Network_Config__construct__end', $this);
63
+	}
64
+
65
+
66
+	/**
67
+	 * load EE Network Config options
68
+	 *
69
+	 * @return void
70
+	 */
71
+	private function _load_config()
72
+	{
73
+		// load network config start hook
74
+		do_action('AHEE__EE_Network_Config___load_config__start', $this);
75
+		$config = $this->get_config();
76
+		foreach ($config as $config_prop => $settings) {
77
+			if ($config_prop === 'core' && ! $settings instanceof EE_Network_Core_Config) {
78
+				$core = new EE_Network_Core_Config();
79
+				foreach ($settings as $prop => $setting) {
80
+					if (property_exists($core, $prop)) {
81
+						$core->{$prop} = $setting;
82
+					}
83
+				}
84
+				$settings = $core;
85
+				add_filter('FHEE__EE_Network_Config___load_config__update_network_config', '__return_true');
86
+			}
87
+			if (is_object($settings) && property_exists($this, $config_prop)) {
88
+				$this->{$config_prop} = apply_filters(
89
+					'FHEE__EE_Network_Config___load_config__config_settings',
90
+					$settings,
91
+					$config_prop,
92
+					$this
93
+				);
94
+				if (method_exists($settings, 'populate')) {
95
+					$this->{$config_prop}->populate();
96
+				}
97
+				if (method_exists($settings, 'do_hooks')) {
98
+					$this->{$config_prop}->do_hooks();
99
+				}
100
+			}
101
+		}
102
+		if (apply_filters('FHEE__EE_Network_Config___load_config__update_network_config', false)) {
103
+			$this->update_config();
104
+		}
105
+
106
+		// load network config end hook
107
+		do_action('AHEE__EE_Network_Config___load_config__end', $this);
108
+	}
109
+
110
+
111
+	/**
112
+	 * get_config
113
+	 *
114
+	 * @return array of network config stuff
115
+	 */
116
+	public function get_config()
117
+	{
118
+		// grab network configuration
119
+		$CFG = get_site_option('ee_network_config', array());
120
+		$CFG = apply_filters('FHEE__EE_Network_Config__get_config__CFG', $CFG);
121
+		return $CFG;
122
+	}
123
+
124
+
125
+	/**
126
+	 * update_config
127
+	 *
128
+	 * @param bool $add_success
129
+	 * @param bool $add_error
130
+	 * @return bool success
131
+	 */
132
+	public function update_config($add_success = false, $add_error = true)
133
+	{
134
+		do_action('AHEE__EE_Network_Config__update_config__begin', $this);
135
+
136
+		// need to bust cache for comparing original if this is a multisite install
137
+		if (is_multisite()) {
138
+			global $current_site;
139
+			$cache_key = $current_site->id . ':ee_network_config';
140
+			wp_cache_delete($cache_key, 'site-options');
141
+		}
142
+
143
+		// we have to compare existing saved config with config in memory because if there is no difference that means
144
+		// that the method executed fine but there just was no update.  WordPress doesn't distinguish between false because
145
+		// there were 0 records updated because of no change vs false because some error produced problems with the update.
146
+		$original = get_site_option('ee_network_config');
147
+
148
+		if ($original == $this) {
149
+			return true;
150
+		}
151
+		// update
152
+		$saved = update_site_option('ee_network_config', $this);
153
+
154
+		do_action('AHEE__EE_Network_Config__update_config__end', $this, $saved);
155
+		// if config remains the same or was updated successfully
156
+		if ($saved) {
157
+			if ($add_success) {
158
+				$msg = is_multisite() ? esc_html__(
159
+					'The Event Espresso Network Configuration Settings have been successfully updated.',
160
+					'event_espresso'
161
+				) : esc_html__('Extra Event Espresso Configuration settings were successfully updated.', 'event_espresso');
162
+				EE_Error::add_success($msg);
163
+			}
164
+			return true;
165
+		}
166
+		if ($add_error) {
167
+			$msg = is_multisite() ? esc_html__(
168
+				'The Event Espresso Network Configuration Settings were not updated.',
169
+				'event_espresso'
170
+			) : esc_html__('Extra Event Espresso Network Configuration settings were not updated.', 'event_espresso');
171
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
172
+		}
173
+		return false;
174
+	}
175
+
176
+
177
+	/**
178
+	 * __sleep
179
+	 *
180
+	 * @return array
181
+	 */
182
+	public function __sleep()
183
+	{
184
+		return apply_filters(
185
+			'FHEE__EE_Network_Config__sleep',
186
+			array(
187
+				'core',
188
+			)
189
+		);
190
+	}
191 191
 }
192 192
 
193 193
 
@@ -197,27 +197,27 @@  discard block
 block discarded – undo
197 197
 class EE_Network_Core_Config extends EE_Config_Base
198 198
 {
199 199
 
200
-    /**
201
-     * PUE site license key
202
-     *
203
-     * @var string $site_license_key
204
-     */
205
-    public $site_license_key;
206
-
207
-    /**
208
-     * This indicates whether messages system processing should be done on the same request or not.
209
-     *
210
-     * @var boolean $do_messages_on_same_request
211
-     */
212
-    public $do_messages_on_same_request;
213
-
214
-
215
-    /**
216
-     * EE_Network_Core_Config constructor.
217
-     */
218
-    public function __construct()
219
-    {
220
-        $this->site_license_key = '';
221
-        $this->do_messages_on_same_request = false;
222
-    }
200
+	/**
201
+	 * PUE site license key
202
+	 *
203
+	 * @var string $site_license_key
204
+	 */
205
+	public $site_license_key;
206
+
207
+	/**
208
+	 * This indicates whether messages system processing should be done on the same request or not.
209
+	 *
210
+	 * @var boolean $do_messages_on_same_request
211
+	 */
212
+	public $do_messages_on_same_request;
213
+
214
+
215
+	/**
216
+	 * EE_Network_Core_Config constructor.
217
+	 */
218
+	public function __construct()
219
+	{
220
+		$this->site_license_key = '';
221
+		$this->do_messages_on_same_request = false;
222
+	}
223 223
 }
Please login to merge, or discard this patch.
core/domain/entities/route_match/MatchAnyRouteSpecification.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -14,19 +14,19 @@
 block discarded – undo
14 14
 class MatchAnyRouteSpecification extends MultiRouteSpecification
15 15
 {
16 16
 
17
-    /**
18
-     * returns true if current request matches specification
19
-     *
20
-     * @since 4.9.71.p
21
-     * @return boolean
22
-     */
23
-    public function isMatchingRoute()
24
-    {
25
-        foreach ($this->specifications as $specification) {
26
-            if ($specification->isMatchingRoute()) {
27
-                return true;
28
-            }
29
-        }
30
-        return false;
31
-    }
17
+	/**
18
+	 * returns true if current request matches specification
19
+	 *
20
+	 * @since 4.9.71.p
21
+	 * @return boolean
22
+	 */
23
+	public function isMatchingRoute()
24
+	{
25
+		foreach ($this->specifications as $specification) {
26
+			if ($specification->isMatchingRoute()) {
27
+				return true;
28
+			}
29
+		}
30
+		return false;
31
+	}
32 32
 }
Please login to merge, or discard this patch.
entities/route_match/specifications/admin/WordPressPageEditorAddNew.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,15 +14,15 @@
 block discarded – undo
14 14
  */
15 15
 class WordPressPageEditorAddNew extends RouteMatchSpecification
16 16
 {
17
-    /**
18
-     * returns true if current request matches specification
19
-     *
20
-     * @since 4.9.71.p
21
-     * @return boolean
22
-     */
23
-    public function isMatchingRoute()
24
-    {
25
-        return strpos($this->request->requestUri(), 'wp-admin/post-new.php') !== false
26
-            && $this->request->getRequestParam('post_type', 'post') === 'page';
27
-    }
17
+	/**
18
+	 * returns true if current request matches specification
19
+	 *
20
+	 * @since 4.9.71.p
21
+	 * @return boolean
22
+	 */
23
+	public function isMatchingRoute()
24
+	{
25
+		return strpos($this->request->requestUri(), 'wp-admin/post-new.php') !== false
26
+			&& $this->request->getRequestParam('post_type', 'post') === 'page';
27
+	}
28 28
 }
Please login to merge, or discard this patch.
entities/route_match/specifications/admin/WordPressPostsEditorAddNew.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,15 +14,15 @@
 block discarded – undo
14 14
  */
15 15
 class WordPressPostsEditorAddNew extends RouteMatchSpecification
16 16
 {
17
-    /**
18
-     * returns true if current request matches specification
19
-     *
20
-     * @since 4.9.71.p
21
-     * @return boolean
22
-     */
23
-    public function isMatchingRoute()
24
-    {
25
-        return strpos($this->request->requestUri(), 'wp-admin/post-new.php') !== false
26
-            && $this->request->getRequestParam('post_type', 'post') === 'post';
27
-    }
17
+	/**
18
+	 * returns true if current request matches specification
19
+	 *
20
+	 * @since 4.9.71.p
21
+	 * @return boolean
22
+	 */
23
+	public function isMatchingRoute()
24
+	{
25
+		return strpos($this->request->requestUri(), 'wp-admin/post-new.php') !== false
26
+			&& $this->request->getRequestParam('post_type', 'post') === 'post';
27
+	}
28 28
 }
Please login to merge, or discard this patch.
entities/route_match/specifications/admin/WordPressPostsListTable.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,15 +14,15 @@
 block discarded – undo
14 14
  */
15 15
 class WordPressPostsListTable extends RouteMatchSpecification
16 16
 {
17
-    /**
18
-     * returns true if current request matches specification
19
-     *
20
-     * @since 4.9.71.p
21
-     * @return boolean
22
-     */
23
-    public function isMatchingRoute()
24
-    {
25
-        return strpos($this->request->requestUri(), 'wp-admin/edit.php') !== false
26
-            && $this->request->getRequestParam('post_type', 'post') === 'post';
27
-    }
17
+	/**
18
+	 * returns true if current request matches specification
19
+	 *
20
+	 * @since 4.9.71.p
21
+	 * @return boolean
22
+	 */
23
+	public function isMatchingRoute()
24
+	{
25
+		return strpos($this->request->requestUri(), 'wp-admin/edit.php') !== false
26
+			&& $this->request->getRequestParam('post_type', 'post') === 'post';
27
+	}
28 28
 }
Please login to merge, or discard this patch.
entities/route_match/specifications/admin/WordPressPageEditorEdit.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -15,23 +15,23 @@
 block discarded – undo
15 15
  */
16 16
 class WordPressPageEditorEdit extends RouteMatchSpecification
17 17
 {
18
-    /**
19
-     * returns true if current request matches specification
20
-     *
21
-     * @since 4.9.71.p
22
-     * @return boolean
23
-     */
24
-    public function isMatchingRoute()
25
-    {
26
-        global $post;
27
-        return strpos($this->request->requestUri(), 'wp-admin/post.php') !== false
28
-            && (
29
-                $this->request->getRequestParam('post_type', 'post') === 'page'
30
-                || (
31
-                    $post instanceof WP_Post
32
-                    && $post->post_type === 'page'
33
-                )
34
-            )
35
-            && $this->request->getRequestParam('action') === 'edit';
36
-    }
18
+	/**
19
+	 * returns true if current request matches specification
20
+	 *
21
+	 * @since 4.9.71.p
22
+	 * @return boolean
23
+	 */
24
+	public function isMatchingRoute()
25
+	{
26
+		global $post;
27
+		return strpos($this->request->requestUri(), 'wp-admin/post.php') !== false
28
+			&& (
29
+				$this->request->getRequestParam('post_type', 'post') === 'page'
30
+				|| (
31
+					$post instanceof WP_Post
32
+					&& $post->post_type === 'page'
33
+				)
34
+			)
35
+			&& $this->request->getRequestParam('action') === 'edit';
36
+	}
37 37
 }
Please login to merge, or discard this patch.
entities/route_match/specifications/admin/EspressoEventEditorEdit.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,15 +14,15 @@
 block discarded – undo
14 14
  */
15 15
 class EspressoEventEditorEdit extends RouteMatchSpecification
16 16
 {
17
-    /**
18
-     * returns true if current request matches specification
19
-     *
20
-     * @since 4.9.71.p
21
-     * @return boolean
22
-     */
23
-    public function isMatchingRoute()
24
-    {
25
-        return $this->request->getRequestParam('page') === 'espresso_events'
26
-            && $this->request->getRequestParam('action') === 'edit';
27
-    }
17
+	/**
18
+	 * returns true if current request matches specification
19
+	 *
20
+	 * @since 4.9.71.p
21
+	 * @return boolean
22
+	 */
23
+	public function isMatchingRoute()
24
+	{
25
+		return $this->request->getRequestParam('page') === 'espresso_events'
26
+			&& $this->request->getRequestParam('action') === 'edit';
27
+	}
28 28
 }
Please login to merge, or discard this patch.
entities/route_match/specifications/admin/EspressoEventEditorAddNew.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,15 +14,15 @@
 block discarded – undo
14 14
  */
15 15
 class EspressoEventEditorAddNew extends RouteMatchSpecification
16 16
 {
17
-    /**
18
-     * returns true if current request matches specification
19
-     *
20
-     * @since 4.9.71.p
21
-     * @return boolean
22
-     */
23
-    public function isMatchingRoute()
24
-    {
25
-        return $this->request->getRequestParam('page') === 'espresso_events'
26
-            && $this->request->getRequestParam('action') === 'create_new';
27
-    }
17
+	/**
18
+	 * returns true if current request matches specification
19
+	 *
20
+	 * @since 4.9.71.p
21
+	 * @return boolean
22
+	 */
23
+	public function isMatchingRoute()
24
+	{
25
+		return $this->request->getRequestParam('page') === 'espresso_events'
26
+			&& $this->request->getRequestParam('action') === 'create_new';
27
+	}
28 28
 }
Please login to merge, or discard this patch.
entities/route_match/specifications/admin/EspressoVenueEditorEdit.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,15 +14,15 @@
 block discarded – undo
14 14
  */
15 15
 class EspressoVenueEditorEdit extends RouteMatchSpecification
16 16
 {
17
-    /**
18
-     * returns true if current request matches specification
19
-     *
20
-     * @since 4.9.71.p
21
-     * @return boolean
22
-     */
23
-    public function isMatchingRoute()
24
-    {
25
-        return $this->request->getRequestParam('page') === 'espresso_venues'
26
-            && $this->request->getRequestParam('action') === 'edit';
27
-    }
17
+	/**
18
+	 * returns true if current request matches specification
19
+	 *
20
+	 * @since 4.9.71.p
21
+	 * @return boolean
22
+	 */
23
+	public function isMatchingRoute()
24
+	{
25
+		return $this->request->getRequestParam('page') === 'espresso_venues'
26
+			&& $this->request->getRequestParam('action') === 'edit';
27
+	}
28 28
 }
Please login to merge, or discard this patch.