Completed
Branch fix-dummy-related-question-qst... (e5efcf)
by
unknown
07:49 queued 03:45
created
core/libraries/messages/EE_Message_Type_Collection.lib.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@
 block discarded – undo
174 174
             $this->rewind();
175 175
             while ($this->valid()) {
176 176
                 echo '<h5 style="color:#2EA2CC;">
177
-                    ' . __CLASS__ . ' class : <span style="color:#E76700">' . esc_html($this->getInfo()) . '</span>
177
+                    ' . __CLASS__.' class : <span style="color:#E76700">'.esc_html($this->getInfo()).'</span>
178 178
                     </h5>';
179 179
                 $this->next();
180 180
             }
Please login to merge, or discard this patch.
Indentation   +137 added lines, -137 removed lines patch added patch discarded remove patch
@@ -13,143 +13,143 @@
 block discarded – undo
13 13
  */
14 14
 class EE_Message_Type_Collection extends EE_Object_Collection
15 15
 {
16
-    /**
17
-     * EE_Message_Type_Collection constructor.
18
-     */
19
-    public function __construct()
20
-    {
21
-        $this->interface = 'EE_message_type';
22
-    }
23
-
24
-
25
-
26
-    /**
27
-     * attaches an object to the Collection
28
-     * and sets any supplied data associated with the current iterator entry
29
-     * by calling EE_Object_Collection::set_info()
30
-     *
31
-     * @param object $object
32
-     * @param mixed  $info
33
-     * @return bool
34
-     */
35
-    public function add($object, $info = ''): bool
36
-    {
37
-        $info = empty($info) && $object instanceof $this->interface ? $object->name : $info;
38
-        return parent::add($object, $info);
39
-    }
40
-
41
-
42
-
43
-    /**
44
-     * Sets the data associated with an object in the Collection
45
-     * if no $info is supplied, then the spl_object_hash() is used
46
-     *
47
-     * @param object $object
48
-     * @param mixed  $info
49
-     * @return bool
50
-     */
51
-    public function set_info($object, $info = ''): bool
52
-    {
53
-        $info = empty($info) && $object instanceof $this->interface ? $object->name : $info;
54
-        return parent::set_info($object, $info);
55
-    }
56
-
57
-
58
-
59
-    /**
60
-     * finds and returns an object in the Collection based on the info that was set using addObject()
61
-     * PLZ NOTE: the pointer is reset to the beginning of the collection before returning
62
-     *
63
-     * @param mixed
64
-     * @return null | object
65
-     */
66
-    public function get_by_info($info = '')
67
-    {
68
-        return parent::get_by_info(str_replace(' ', '_', strtolower($info)));
69
-    }
70
-
71
-
72
-
73
-    /**
74
-     * returns TRUE or FALSE depending on whether the supplied object is within the Collection
75
-     *
76
-     * @param object $object
77
-     * @return bool
78
-     */
79
-    public function has($object): bool
80
-    {
81
-        return parent::has($object);
82
-    }
83
-
84
-
85
-
86
-    /**
87
-     * returns TRUE or FALSE depending on whether the supplied message_type classname is within the Collection
88
-     *
89
-     * @param string $message_type_name
90
-     * @return bool
91
-     */
92
-    public function has_by_name(string $message_type_name): bool
93
-    {
94
-        return $this->get_by_info($message_type_name) instanceof $this->interface;
95
-    }
96
-
97
-
98
-
99
-    /**
100
-     * detaches an object from the Collection
101
-     *
102
-     * @param $object
103
-     * @return bool
104
-     */
105
-    public function remove($object): bool
106
-    {
107
-        return parent::remove($object);
108
-    }
109
-
110
-
111
-
112
-    /**
113
-     * advances pointer to the provided object
114
-     *
115
-     * @param $object
116
-     * @return void
117
-     */
118
-    public function set_current($object)
119
-    {
120
-        parent::set_current($object);
121
-    }
122
-
123
-
124
-
125
-    /**
126
-     * advances pointer to the object whose info matches that which was provided
127
-     *
128
-     * @param $info
129
-     * @return void
130
-     */
131
-    public function set_current_by_info($info)
132
-    {
133
-        parent::set_current_by_info($info);
134
-    }
135
-
136
-
137
-
138
-    /**
139
-     * displays list of collection classes if WP_DEBUG is on
140
-     *
141
-     * @return void
142
-     */
143
-    public function show_collection_classes()
144
-    {
145
-        if (WP_DEBUG) {
146
-            $this->rewind();
147
-            while ($this->valid()) {
148
-                echo '<h5 style="color:#2EA2CC;">
16
+	/**
17
+	 * EE_Message_Type_Collection constructor.
18
+	 */
19
+	public function __construct()
20
+	{
21
+		$this->interface = 'EE_message_type';
22
+	}
23
+
24
+
25
+
26
+	/**
27
+	 * attaches an object to the Collection
28
+	 * and sets any supplied data associated with the current iterator entry
29
+	 * by calling EE_Object_Collection::set_info()
30
+	 *
31
+	 * @param object $object
32
+	 * @param mixed  $info
33
+	 * @return bool
34
+	 */
35
+	public function add($object, $info = ''): bool
36
+	{
37
+		$info = empty($info) && $object instanceof $this->interface ? $object->name : $info;
38
+		return parent::add($object, $info);
39
+	}
40
+
41
+
42
+
43
+	/**
44
+	 * Sets the data associated with an object in the Collection
45
+	 * if no $info is supplied, then the spl_object_hash() is used
46
+	 *
47
+	 * @param object $object
48
+	 * @param mixed  $info
49
+	 * @return bool
50
+	 */
51
+	public function set_info($object, $info = ''): bool
52
+	{
53
+		$info = empty($info) && $object instanceof $this->interface ? $object->name : $info;
54
+		return parent::set_info($object, $info);
55
+	}
56
+
57
+
58
+
59
+	/**
60
+	 * finds and returns an object in the Collection based on the info that was set using addObject()
61
+	 * PLZ NOTE: the pointer is reset to the beginning of the collection before returning
62
+	 *
63
+	 * @param mixed
64
+	 * @return null | object
65
+	 */
66
+	public function get_by_info($info = '')
67
+	{
68
+		return parent::get_by_info(str_replace(' ', '_', strtolower($info)));
69
+	}
70
+
71
+
72
+
73
+	/**
74
+	 * returns TRUE or FALSE depending on whether the supplied object is within the Collection
75
+	 *
76
+	 * @param object $object
77
+	 * @return bool
78
+	 */
79
+	public function has($object): bool
80
+	{
81
+		return parent::has($object);
82
+	}
83
+
84
+
85
+
86
+	/**
87
+	 * returns TRUE or FALSE depending on whether the supplied message_type classname is within the Collection
88
+	 *
89
+	 * @param string $message_type_name
90
+	 * @return bool
91
+	 */
92
+	public function has_by_name(string $message_type_name): bool
93
+	{
94
+		return $this->get_by_info($message_type_name) instanceof $this->interface;
95
+	}
96
+
97
+
98
+
99
+	/**
100
+	 * detaches an object from the Collection
101
+	 *
102
+	 * @param $object
103
+	 * @return bool
104
+	 */
105
+	public function remove($object): bool
106
+	{
107
+		return parent::remove($object);
108
+	}
109
+
110
+
111
+
112
+	/**
113
+	 * advances pointer to the provided object
114
+	 *
115
+	 * @param $object
116
+	 * @return void
117
+	 */
118
+	public function set_current($object)
119
+	{
120
+		parent::set_current($object);
121
+	}
122
+
123
+
124
+
125
+	/**
126
+	 * advances pointer to the object whose info matches that which was provided
127
+	 *
128
+	 * @param $info
129
+	 * @return void
130
+	 */
131
+	public function set_current_by_info($info)
132
+	{
133
+		parent::set_current_by_info($info);
134
+	}
135
+
136
+
137
+
138
+	/**
139
+	 * displays list of collection classes if WP_DEBUG is on
140
+	 *
141
+	 * @return void
142
+	 */
143
+	public function show_collection_classes()
144
+	{
145
+		if (WP_DEBUG) {
146
+			$this->rewind();
147
+			while ($this->valid()) {
148
+				echo '<h5 style="color:#2EA2CC;">
149 149
                     ' . __CLASS__ . ' class : <span style="color:#E76700">' . esc_html($this->getInfo()) . '</span>
150 150
                     </h5>';
151
-                $this->next();
152
-            }
153
-        }
154
-    }
151
+				$this->next();
152
+			}
153
+		}
154
+	}
155 155
 }
Please login to merge, or discard this patch.
libraries/messages/defaults/default/html_receipt_ticket_list.template.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,14 +24,14 @@  discard block
 block discarded – undo
24 24
         <div class="ticket-time-and-place-details">
25 25
             <div class="ticket-time-details">
26 26
                 <h4 class="sub-section-title no-bottom-margin">
27
-                    <img class="icon" src="<?php echo esc_url_raw(EE_IMAGES_URL . 'clock-16x16.png'); ?>">
27
+                    <img class="icon" src="<?php echo esc_url_raw(EE_IMAGES_URL.'clock-16x16.png'); ?>">
28 28
                     <?php esc_html_e('Date/Time:', 'event_espresso'); ?>
29 29
                 </h4>
30 30
                 <ul class="event-dates">[DATETIME_LIST]</ul>
31 31
             </div>
32 32
             <div class="ticket-place-details">
33 33
                 <h4 class="sub-section-title no-bottom-margin">
34
-                    <img class="icon" src="<?php echo esc_url_raw(EE_IMAGES_URL . 'location-pin-16x16.png'); ?>">
34
+                    <img class="icon" src="<?php echo esc_url_raw(EE_IMAGES_URL.'location-pin-16x16.png'); ?>">
35 35
                     <?php esc_html_e('Venue', 'event_espresso'); ?>
36 36
                 </h4>
37 37
                 <ul class="event-venues">
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         </div>
46 46
         <div class="ticket-registrations-area">
47 47
             <h4 class="sub-section-title">
48
-                <img class="icon" src="<?php echo esc_url_raw(EE_IMAGES_URL . 'users-16x16.png'); ?>">
48
+                <img class="icon" src="<?php echo esc_url_raw(EE_IMAGES_URL.'users-16x16.png'); ?>">
49 49
                 <?php esc_html_e("Registration Details", "event_espresso"); ?>
50 50
                 <span class="small-text link">
51 51
                     ( <a class="print_button noPrint" href="[PRIMARY_REGISTRANT_FRONTEND_EDIT_REG_LINK]">
Please login to merge, or discard this patch.
libraries/messages/defaults/default/html_receipt_event_list.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 
7 7
 ?>
8 8
 <h3 class="section-title event-name">
9
-    <img class="icon" src="<?php echo esc_url_raw(EE_IMAGES_URL . 'calendar_year-24x24.png'); ?>">
9
+    <img class="icon" src="<?php echo esc_url_raw(EE_IMAGES_URL.'calendar_year-24x24.png'); ?>">
10 10
     <?php esc_html_e("Event Name:", "event_espresso") ?>
11 11
     <span class="plain-text">[EVENT_NAME]</span>
12 12
     <span class="small-text link">
Please login to merge, or discard this patch.
libraries/messages/defaults/default/html_receipt_attendee_list.template.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,11 +8,11 @@
 block discarded – undo
8 8
 <li class="ticket-registration">
9 9
     <table class="registration-details">
10 10
         <tr class="odd">
11
-            <th><?php	_e('Attendee', 'event_espresso');?></th>
11
+            <th><?php	_e('Attendee', 'event_espresso'); ?></th>
12 12
             <td>[FNAME] [LNAME] ([ATTENDEE_EMAIL])</td>
13 13
         </tr>
14 14
         <tr>
15
-            <th><?php esc_html_e("Registration Code:", "event_espresso");?></th>
15
+            <th><?php esc_html_e("Registration Code:", "event_espresso"); ?></th>
16 16
             <td>[REGISTRATION_CODE] - <span class="[REGISTRATION_STATUS_ID]">[REGISTRATION_STATUS_LABEL]</span></td>
17 17
         </tr>
18 18
     </table>
Please login to merge, or discard this patch.
core/libraries/messages/EE_Messenger_Collection.lib.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -189,7 +189,7 @@
 block discarded – undo
189 189
             $this->rewind();
190 190
             while ($this->valid()) {
191 191
                 echo '<h5 style="color:#2EA2CC;">
192
-                    ' . __CLASS__ . ' class : . <span style="color:#E76700">' . esc_html($this->getInfo()) . '</span>
192
+                    ' . __CLASS__.' class : . <span style="color:#E76700">'.esc_html($this->getInfo()).'</span>
193 193
                     </h5>';
194 194
                 $this->next();
195 195
             }
Please login to merge, or discard this patch.
Indentation   +122 added lines, -122 removed lines patch added patch discarded remove patch
@@ -13,128 +13,128 @@
 block discarded – undo
13 13
  */
14 14
 class EE_Messenger_Collection extends EE_Object_Collection
15 15
 {
16
-    /**
17
-     * EE_Messenger_Collection constructor.
18
-     */
19
-    public function __construct()
20
-    {
21
-        $this->interface = 'EE_messenger';
22
-    }
23
-
24
-
25
-
26
-    /**
27
-     * attaches an object to the Collection
28
-     * and sets any supplied data associated with the current iterator entry
29
-     * by calling EE_Object_Collection::set_info()
30
-     *
31
-     * @param object $object
32
-     * @param mixed  $info
33
-     * @return bool
34
-     */
35
-    public function add($object, $info = ''): bool
36
-    {
37
-        $info = empty($info) && $object instanceof $this->interface ? $object->name : $info;
38
-        return parent::add($object, $info);
39
-    }
40
-
41
-
42
-
43
-    /**
44
-     * Sets the data associated with an object in the Collection
45
-     * if no $info is supplied, then the spl_object_hash() is used
46
-     *
47
-     * @param object $object
48
-     * @param array|int|string $info
49
-     * @return bool
50
-     */
51
-    public function set_info($object, $info = ''): bool
52
-    {
53
-        $info = empty($info) && $object instanceof $this->interface ? $object->name : $info;
54
-        return parent::set_info($object, $info);
55
-    }
56
-
57
-
58
-
59
-    /**
60
-     * finds and returns an object in the Collection based on the info that was set using addObject()
61
-     * PLZ NOTE: the pointer is reset to the beginning of the collection before returning
62
-     *
63
-     * @param mixed
64
-     * @return null | object
65
-     */
66
-    public function get_by_info($info = '')
67
-    {
68
-        return parent::get_by_info(str_replace(' ', '_', strtolower($info)));
69
-    }
70
-
71
-
72
-
73
-    /**
74
-     * returns TRUE or FALSE depending on whether the supplied object is within the Collection
75
-     *
76
-     * @param object $object
77
-     * @return bool
78
-     */
79
-    public function has($object): bool
80
-    {
81
-        return parent::has($object);
82
-    }
83
-
84
-
85
-
86
-    /**
87
-     * returns TRUE or FALSE depending on whether the supplied messenger name is within the Collection
88
-     *
89
-     * @param string $messenger_name
90
-     * @return bool
91
-     */
92
-    public function has_by_name(string $messenger_name): bool
93
-    {
94
-        return $this->get_by_info($messenger_name) instanceof $this->interface;
95
-    }
96
-
97
-
98
-
99
-    /**
100
-     * detaches an object from the Collection
101
-     *
102
-     * @param $object
103
-     * @return bool
104
-     */
105
-    public function remove($object): bool
106
-    {
107
-        return parent::remove($object);
108
-    }
109
-
110
-
111
-
112
-    /**
113
-     * current object from the Collection
114
-     *
115
-     * @return EE_messenger
116
-     */
117
-    public function current(): EE_messenger
118
-    {
119
-        return parent::current();
120
-    }
121
-
122
-
123
-    /**
124
-     * displays list of collection classes if WP_DEBUG is on
125
-     *
126
-     * @return void
127
-     */
128
-    public function show_collection_classes()
129
-    {
130
-        if (WP_DEBUG) {
131
-            $this->rewind();
132
-            while ($this->valid()) {
133
-                echo '<h5 style="color:#2EA2CC;">
16
+	/**
17
+	 * EE_Messenger_Collection constructor.
18
+	 */
19
+	public function __construct()
20
+	{
21
+		$this->interface = 'EE_messenger';
22
+	}
23
+
24
+
25
+
26
+	/**
27
+	 * attaches an object to the Collection
28
+	 * and sets any supplied data associated with the current iterator entry
29
+	 * by calling EE_Object_Collection::set_info()
30
+	 *
31
+	 * @param object $object
32
+	 * @param mixed  $info
33
+	 * @return bool
34
+	 */
35
+	public function add($object, $info = ''): bool
36
+	{
37
+		$info = empty($info) && $object instanceof $this->interface ? $object->name : $info;
38
+		return parent::add($object, $info);
39
+	}
40
+
41
+
42
+
43
+	/**
44
+	 * Sets the data associated with an object in the Collection
45
+	 * if no $info is supplied, then the spl_object_hash() is used
46
+	 *
47
+	 * @param object $object
48
+	 * @param array|int|string $info
49
+	 * @return bool
50
+	 */
51
+	public function set_info($object, $info = ''): bool
52
+	{
53
+		$info = empty($info) && $object instanceof $this->interface ? $object->name : $info;
54
+		return parent::set_info($object, $info);
55
+	}
56
+
57
+
58
+
59
+	/**
60
+	 * finds and returns an object in the Collection based on the info that was set using addObject()
61
+	 * PLZ NOTE: the pointer is reset to the beginning of the collection before returning
62
+	 *
63
+	 * @param mixed
64
+	 * @return null | object
65
+	 */
66
+	public function get_by_info($info = '')
67
+	{
68
+		return parent::get_by_info(str_replace(' ', '_', strtolower($info)));
69
+	}
70
+
71
+
72
+
73
+	/**
74
+	 * returns TRUE or FALSE depending on whether the supplied object is within the Collection
75
+	 *
76
+	 * @param object $object
77
+	 * @return bool
78
+	 */
79
+	public function has($object): bool
80
+	{
81
+		return parent::has($object);
82
+	}
83
+
84
+
85
+
86
+	/**
87
+	 * returns TRUE or FALSE depending on whether the supplied messenger name is within the Collection
88
+	 *
89
+	 * @param string $messenger_name
90
+	 * @return bool
91
+	 */
92
+	public function has_by_name(string $messenger_name): bool
93
+	{
94
+		return $this->get_by_info($messenger_name) instanceof $this->interface;
95
+	}
96
+
97
+
98
+
99
+	/**
100
+	 * detaches an object from the Collection
101
+	 *
102
+	 * @param $object
103
+	 * @return bool
104
+	 */
105
+	public function remove($object): bool
106
+	{
107
+		return parent::remove($object);
108
+	}
109
+
110
+
111
+
112
+	/**
113
+	 * current object from the Collection
114
+	 *
115
+	 * @return EE_messenger
116
+	 */
117
+	public function current(): EE_messenger
118
+	{
119
+		return parent::current();
120
+	}
121
+
122
+
123
+	/**
124
+	 * displays list of collection classes if WP_DEBUG is on
125
+	 *
126
+	 * @return void
127
+	 */
128
+	public function show_collection_classes()
129
+	{
130
+		if (WP_DEBUG) {
131
+			$this->rewind();
132
+			while ($this->valid()) {
133
+				echo '<h5 style="color:#2EA2CC;">
134 134
                     ' . __CLASS__ . ' class : . <span style="color:#E76700">' . esc_html($this->getInfo()) . '</span>
135 135
                     </h5>';
136
-                $this->next();
137
-            }
138
-        }
139
-    }
136
+				$this->next();
137
+			}
138
+		}
139
+	}
140 140
 }
Please login to merge, or discard this patch.
core/EE_Maintenance_Mode.core.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     public static function instance()
60 60
     {
61 61
         // check if class object is instantiated
62
-        if (! self::$_instance instanceof EE_Maintenance_Mode) {
62
+        if ( ! self::$_instance instanceof EE_Maintenance_Mode) {
63 63
             self::$_instance = new self();
64 64
         }
65 65
         return self::$_instance;
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
      */
185 185
     public static function disable_frontend_for_maintenance()
186 186
     {
187
-        return (! is_admin() && EE_Maintenance_Mode::instance()->level());
187
+        return ( ! is_admin() && EE_Maintenance_Mode::instance()->level());
188 188
     }
189 189
 
190 190
 
@@ -199,14 +199,14 @@  discard block
 block discarded – undo
199 199
         ) {
200 200
             wp_register_style(
201 201
                 'espresso_default',
202
-                EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css',
202
+                EE_GLOBAL_ASSETS_URL.'css/espresso_default.css',
203 203
                 ['dashicons'],
204 204
                 EVENT_ESPRESSO_VERSION
205 205
             );
206 206
             wp_enqueue_style('espresso_default');
207 207
             wp_register_script(
208 208
                 'espresso_core',
209
-                EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js',
209
+                EE_GLOBAL_ASSETS_URL.'scripts/espresso_core.js',
210 210
                 ['jquery'],
211 211
                 EVENT_ESPRESSO_VERSION,
212 212
                 true
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
     public static function template_include()
227 227
     {
228 228
         // shut 'er down for maintenance ? then don't use any of our templates for our endpoints
229
-        return get_template_directory() . '/index.php';
229
+        return get_template_directory().'/index.php';
230 230
     }
231 231
 
232 232
 
@@ -278,10 +278,10 @@  discard block
 block discarded – undo
278 278
                 ),
279 279
                 '<div id="ee-m-mode-admin-notice-dv" class="ee-really-important-notice-dv"><a class="close-espresso-notice" title="',
280 280
                 '"><span class="dashicons dashicons-no"></span></a><p>',
281
-                ' &raquo; <a href="' . add_query_arg(
281
+                ' &raquo; <a href="'.add_query_arg(
282 282
                     ['page' => 'espresso_maintenance_settings'],
283 283
                     admin_url('admin.php')
284
-                ) . '">',
284
+                ).'">',
285 285
                 '</a></p></div>'
286 286
             );
287 287
         }
Please login to merge, or discard this patch.
Indentation   +334 added lines, -334 removed lines patch added patch discarded remove patch
@@ -15,340 +15,340 @@
 block discarded – undo
15 15
  */
16 16
 class EE_Maintenance_Mode implements ResettableInterface
17 17
 {
18
-    /**
19
-     * constants available to client code for interpreting the values of EE_Maintenance_Mode::level().
20
-     * level_0_not_in_maintenance means the site is NOT in maintenance mode (so everything's normal)
21
-     */
22
-    const level_0_not_in_maintenance = 0;
23
-
24
-    /**
25
-     * level_1_frontend_only_maintenance means that the site's frontend EE code should be completely disabled
26
-     * but the admin backend should be running as normal. Maybe an admin can view the frontend though
27
-     */
28
-    const level_1_frontend_only_maintenance = 1;
29
-
30
-    /**
31
-     * level_2_complete_maintenance means the frontend AND EE backend code are disabled. The only system running
32
-     * is the maintenance mode stuff, which will require users to update all addons, and then finish running all
33
-     * migration scripts before taking the site out of maintenance mode
34
-     */
35
-    const level_2_complete_maintenance = 2;
36
-
37
-    /**
38
-     * the name of the option which stores the current level of maintenance mode
39
-     */
40
-    const option_name_maintenance_mode = 'ee_maintenance_mode';
41
-
42
-
43
-    /**
44
-     * @var EE_Maintenance_Mode $_instance
45
-     */
46
-    private static $_instance;
47
-
48
-    /**
49
-     * @var EE_Registry $EE
50
-     */
51
-    protected $EE;
52
-
53
-
54
-    /**
55
-     * @singleton method used to instantiate class object
56
-     * @return EE_Maintenance_Mode
57
-     */
58
-    public static function instance()
59
-    {
60
-        // check if class object is instantiated
61
-        if (! self::$_instance instanceof EE_Maintenance_Mode) {
62
-            self::$_instance = new self();
63
-        }
64
-        return self::$_instance;
65
-    }
66
-
67
-
68
-    /**
69
-     * Resets maintenance mode (mostly just re-checks whether we should be in maintenance mode)
70
-     *
71
-     * @return EE_Maintenance_Mode
72
-     * @throws EE_Error
73
-     */
74
-    public static function reset()
75
-    {
76
-        self::instance()->set_maintenance_mode_if_db_old();
77
-        return self::instance();
78
-    }
79
-
80
-
81
-    /**
82
-     *private constructor to prevent direct creation
83
-     */
84
-    private function __construct()
85
-    {
86
-        // if M-Mode level 2 is engaged, we still need basic assets loaded
87
-        add_action('wp_enqueue_scripts', [$this, 'load_assets_required_for_m_mode']);
88
-        // shut 'er down for maintenance ?
89
-        add_filter('the_content', [$this, 'the_content'], 2);
90
-        // add powered by EE msg
91
-        add_action('shutdown', [$this, 'display_maintenance_mode_notice'], 10);
92
-    }
93
-
94
-
95
-    /**
96
-     * retrieves the maintenance mode option value from the db
97
-     *
98
-     * @return int
99
-     */
100
-    public function real_level()
101
-    {
102
-        return (int) get_option(self::option_name_maintenance_mode, EE_Maintenance_Mode::level_0_not_in_maintenance);
103
-    }
104
-
105
-
106
-    /**
107
-     * Returns whether the models reportedly are able to run queries or not
108
-     * (ie, if the system thinks their tables are present and up-to-date).
109
-     *
110
-     * @return boolean
111
-     */
112
-    public function models_can_query()
113
-    {
114
-        return $this->real_level() !== EE_Maintenance_Mode::level_2_complete_maintenance;
115
-    }
116
-
117
-
118
-    /**
119
-     * Determines whether we're in maintenance mode and what level. However, while the site
120
-     * is in level 1 maintenance, and an admin visits the frontend, this function makes it appear
121
-     * to them as if teh site isn't in maintenance mode.
122
-     * EE_Maintenance_Mode::level_0_not_in_maintenance => not in maintenance mode (in normal mode)
123
-     * EE_Maintenance_Mode::level_1_frontend_only_maintenance=> frontend-only maintenance mode
124
-     * EE_Maintenance_Mode::level_2_complete_maintenance => frontend and backend maintenance mode
125
-     *
126
-     * @return int
127
-     */
128
-    public function level()
129
-    {
130
-        $maintenance_mode_level = $this->real_level();
131
-        // if this is an admin request, we'll be honest... except if it's ajax, because that might be from the frontend
132
-        if (
133
-            $maintenance_mode_level === EE_Maintenance_Mode::level_1_frontend_only_maintenance// we're in level 1
134
-            && ((defined('DOING_AJAX') && DOING_AJAX) || ! is_admin()) // on non-ajax frontend requests
135
-            && current_user_can('administrator') // when the user is an admin
136
-        ) {
137
-            $maintenance_mode_level = EE_Maintenance_Mode::level_0_not_in_maintenance;
138
-        }
139
-        return $maintenance_mode_level;
140
-    }
141
-
142
-
143
-    /**
144
-     * Determines if we need to put EE in maintenance mode because the database needs updating
145
-     *
146
-     * @return boolean true if DB is old and maintenance mode was triggered; false otherwise
147
-     * @throws EE_Error
148
-     */
149
-    public function set_maintenance_mode_if_db_old()
150
-    {
151
-        LoaderFactory::getLoader()->getShared('Data_Migration_Manager');
152
-        if (EE_Data_Migration_Manager::instance()->check_for_applicable_data_migration_scripts()) {
153
-            update_option(self::option_name_maintenance_mode, self::level_2_complete_maintenance);
154
-            return true;
155
-        }
156
-        if ($this->level() === self::level_2_complete_maintenance) {
157
-            // we also want to handle the opposite: if the site is mm2, but there aren't any migrations to run
158
-            // then we shouldn't be in mm2. (Maybe an addon got deactivated?)
159
-            update_option(self::option_name_maintenance_mode, self::level_0_not_in_maintenance);
160
-            return false;
161
-        }
162
-        return false;
163
-    }
164
-
165
-
166
-    /**
167
-     * Updates the maintenance level on the site
168
-     *
169
-     * @param int $level
170
-     * @return void
171
-     */
172
-    public function set_maintenance_level($level)
173
-    {
174
-        do_action('AHEE__EE_Maintenance_Mode__set_maintenance_level', $level);
175
-        update_option(self::option_name_maintenance_mode, (int) $level);
176
-    }
177
-
178
-
179
-    /**
180
-     * returns TRUE if M-Mode is engaged and the current request is not for the admin
181
-     *
182
-     * @return bool
183
-     */
184
-    public static function disable_frontend_for_maintenance()
185
-    {
186
-        return (! is_admin() && EE_Maintenance_Mode::instance()->level());
187
-    }
188
-
189
-
190
-    /**
191
-     * @return void
192
-     */
193
-    public function load_assets_required_for_m_mode()
194
-    {
195
-        if (
196
-            $this->real_level() === EE_Maintenance_Mode::level_2_complete_maintenance
197
-            && ! wp_script_is('espresso_core')
198
-        ) {
199
-            wp_register_style(
200
-                'espresso_default',
201
-                EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css',
202
-                ['dashicons'],
203
-                EVENT_ESPRESSO_VERSION
204
-            );
205
-            wp_enqueue_style('espresso_default');
206
-            wp_register_script(
207
-                'espresso_core',
208
-                EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js',
209
-                ['jquery'],
210
-                EVENT_ESPRESSO_VERSION,
211
-                true
212
-            );
213
-            wp_enqueue_script('espresso_core');
214
-        }
215
-    }
216
-
217
-
218
-    /**
219
-     * replacement EE CPT template that displays message notifying site visitors
220
-     * that EE has been temporarily placed into maintenance mode
221
-     * does NOT get called on non-EE-CPT requests
222
-     *
223
-     * @return    string
224
-     */
225
-    public static function template_include()
226
-    {
227
-        // shut 'er down for maintenance ? then don't use any of our templates for our endpoints
228
-        return get_template_directory() . '/index.php';
229
-    }
230
-
231
-
232
-    /**
233
-     * displays message notifying site visitors that EE has been temporarily
234
-     * placed into maintenance mode when post_type != EE CPT
235
-     *
236
-     * @param string $the_content
237
-     * @return string
238
-     */
239
-    public function the_content($the_content)
240
-    {
241
-        // check if M-mode is engaged and for EE shortcode
242
-        if ($this->level() && strpos($the_content, '[ESPRESSO_') !== false) {
243
-            // this can eventually be moved to a template, or edited via admin. But for now...
244
-            $the_content = sprintf(
245
-                esc_html__(
246
-                    '%sMaintenance Mode%sEvent Registration has been temporarily closed while system maintenance is being performed. We\'re sorry for any inconveniences this may have caused. Please try back again later.%s',
247
-                    'event_espresso'
248
-                ),
249
-                '<h3>',
250
-                '</h3><p>',
251
-                '</p>'
252
-            );
253
-        }
254
-        return $the_content;
255
-    }
256
-
257
-
258
-    /**
259
-     * displays message on frontend of site notifying admin that EE has been temporarily placed into maintenance mode
260
-     */
261
-    public function display_maintenance_mode_notice()
262
-    {
263
-        /** @var CurrentPage $current_page */
264
-        $current_page = LoaderFactory::getLoader()->getShared(CurrentPage::class);
265
-        // check if M-mode is engaged and for EE shortcode
266
-        if (
267
-            ! (defined('DOING_AJAX') && DOING_AJAX)
268
-            && $this->real_level()
269
-            && ! is_admin()
270
-            && current_user_can('administrator')
271
-            && $current_page->isEspressoPage()
272
-        ) {
273
-            printf(
274
-                esc_html__(
275
-                    '%sclose%sEvent Registration is currently disabled because Event Espresso has been placed into Maintenance Mode. To change Maintenance Mode settings, click here %sEE Maintenance Mode Admin Page%s',
276
-                    'event_espresso'
277
-                ),
278
-                '<div id="ee-m-mode-admin-notice-dv" class="ee-really-important-notice-dv"><a class="close-espresso-notice" title="',
279
-                '"><span class="dashicons dashicons-no"></span></a><p>',
280
-                ' &raquo; <a href="' . add_query_arg(
281
-                    ['page' => 'espresso_maintenance_settings'],
282
-                    admin_url('admin.php')
283
-                ) . '">',
284
-                '</a></p></div>'
285
-            );
286
-        }
287
-    }
288
-    // espresso-notices important-notice ee-attention
289
-
290
-
291
-    /**
292
-     * override magic methods
293
-     */
294
-    final public function __destruct()
295
-    {
296
-    }
297
-
298
-
299
-    final public function __call($a, $b)
300
-    {
301
-    }
302
-
303
-
304
-    final public function __get($a)
305
-    {
306
-    }
307
-
308
-
309
-    final public function __set($a, $b)
310
-    {
311
-    }
312
-
313
-
314
-    final public function __isset($a)
315
-    {
316
-    }
317
-
318
-
319
-    final public function __unset($a)
320
-    {
321
-    }
322
-
323
-
324
-    final public function __sleep()
325
-    {
326
-        return [];
327
-    }
328
-
329
-
330
-    final public function __wakeup()
331
-    {
332
-    }
333
-
334
-
335
-    final public function __invoke()
336
-    {
337
-    }
338
-
339
-
340
-    final public static function __set_state($a = null)
341
-    {
342
-        return EE_Maintenance_Mode::instance();
343
-    }
344
-
345
-
346
-    final public function __clone()
347
-    {
348
-    }
18
+	/**
19
+	 * constants available to client code for interpreting the values of EE_Maintenance_Mode::level().
20
+	 * level_0_not_in_maintenance means the site is NOT in maintenance mode (so everything's normal)
21
+	 */
22
+	const level_0_not_in_maintenance = 0;
23
+
24
+	/**
25
+	 * level_1_frontend_only_maintenance means that the site's frontend EE code should be completely disabled
26
+	 * but the admin backend should be running as normal. Maybe an admin can view the frontend though
27
+	 */
28
+	const level_1_frontend_only_maintenance = 1;
29
+
30
+	/**
31
+	 * level_2_complete_maintenance means the frontend AND EE backend code are disabled. The only system running
32
+	 * is the maintenance mode stuff, which will require users to update all addons, and then finish running all
33
+	 * migration scripts before taking the site out of maintenance mode
34
+	 */
35
+	const level_2_complete_maintenance = 2;
36
+
37
+	/**
38
+	 * the name of the option which stores the current level of maintenance mode
39
+	 */
40
+	const option_name_maintenance_mode = 'ee_maintenance_mode';
41
+
42
+
43
+	/**
44
+	 * @var EE_Maintenance_Mode $_instance
45
+	 */
46
+	private static $_instance;
47
+
48
+	/**
49
+	 * @var EE_Registry $EE
50
+	 */
51
+	protected $EE;
52
+
53
+
54
+	/**
55
+	 * @singleton method used to instantiate class object
56
+	 * @return EE_Maintenance_Mode
57
+	 */
58
+	public static function instance()
59
+	{
60
+		// check if class object is instantiated
61
+		if (! self::$_instance instanceof EE_Maintenance_Mode) {
62
+			self::$_instance = new self();
63
+		}
64
+		return self::$_instance;
65
+	}
66
+
67
+
68
+	/**
69
+	 * Resets maintenance mode (mostly just re-checks whether we should be in maintenance mode)
70
+	 *
71
+	 * @return EE_Maintenance_Mode
72
+	 * @throws EE_Error
73
+	 */
74
+	public static function reset()
75
+	{
76
+		self::instance()->set_maintenance_mode_if_db_old();
77
+		return self::instance();
78
+	}
79
+
80
+
81
+	/**
82
+	 *private constructor to prevent direct creation
83
+	 */
84
+	private function __construct()
85
+	{
86
+		// if M-Mode level 2 is engaged, we still need basic assets loaded
87
+		add_action('wp_enqueue_scripts', [$this, 'load_assets_required_for_m_mode']);
88
+		// shut 'er down for maintenance ?
89
+		add_filter('the_content', [$this, 'the_content'], 2);
90
+		// add powered by EE msg
91
+		add_action('shutdown', [$this, 'display_maintenance_mode_notice'], 10);
92
+	}
93
+
94
+
95
+	/**
96
+	 * retrieves the maintenance mode option value from the db
97
+	 *
98
+	 * @return int
99
+	 */
100
+	public function real_level()
101
+	{
102
+		return (int) get_option(self::option_name_maintenance_mode, EE_Maintenance_Mode::level_0_not_in_maintenance);
103
+	}
104
+
105
+
106
+	/**
107
+	 * Returns whether the models reportedly are able to run queries or not
108
+	 * (ie, if the system thinks their tables are present and up-to-date).
109
+	 *
110
+	 * @return boolean
111
+	 */
112
+	public function models_can_query()
113
+	{
114
+		return $this->real_level() !== EE_Maintenance_Mode::level_2_complete_maintenance;
115
+	}
116
+
117
+
118
+	/**
119
+	 * Determines whether we're in maintenance mode and what level. However, while the site
120
+	 * is in level 1 maintenance, and an admin visits the frontend, this function makes it appear
121
+	 * to them as if teh site isn't in maintenance mode.
122
+	 * EE_Maintenance_Mode::level_0_not_in_maintenance => not in maintenance mode (in normal mode)
123
+	 * EE_Maintenance_Mode::level_1_frontend_only_maintenance=> frontend-only maintenance mode
124
+	 * EE_Maintenance_Mode::level_2_complete_maintenance => frontend and backend maintenance mode
125
+	 *
126
+	 * @return int
127
+	 */
128
+	public function level()
129
+	{
130
+		$maintenance_mode_level = $this->real_level();
131
+		// if this is an admin request, we'll be honest... except if it's ajax, because that might be from the frontend
132
+		if (
133
+			$maintenance_mode_level === EE_Maintenance_Mode::level_1_frontend_only_maintenance// we're in level 1
134
+			&& ((defined('DOING_AJAX') && DOING_AJAX) || ! is_admin()) // on non-ajax frontend requests
135
+			&& current_user_can('administrator') // when the user is an admin
136
+		) {
137
+			$maintenance_mode_level = EE_Maintenance_Mode::level_0_not_in_maintenance;
138
+		}
139
+		return $maintenance_mode_level;
140
+	}
141
+
142
+
143
+	/**
144
+	 * Determines if we need to put EE in maintenance mode because the database needs updating
145
+	 *
146
+	 * @return boolean true if DB is old and maintenance mode was triggered; false otherwise
147
+	 * @throws EE_Error
148
+	 */
149
+	public function set_maintenance_mode_if_db_old()
150
+	{
151
+		LoaderFactory::getLoader()->getShared('Data_Migration_Manager');
152
+		if (EE_Data_Migration_Manager::instance()->check_for_applicable_data_migration_scripts()) {
153
+			update_option(self::option_name_maintenance_mode, self::level_2_complete_maintenance);
154
+			return true;
155
+		}
156
+		if ($this->level() === self::level_2_complete_maintenance) {
157
+			// we also want to handle the opposite: if the site is mm2, but there aren't any migrations to run
158
+			// then we shouldn't be in mm2. (Maybe an addon got deactivated?)
159
+			update_option(self::option_name_maintenance_mode, self::level_0_not_in_maintenance);
160
+			return false;
161
+		}
162
+		return false;
163
+	}
164
+
165
+
166
+	/**
167
+	 * Updates the maintenance level on the site
168
+	 *
169
+	 * @param int $level
170
+	 * @return void
171
+	 */
172
+	public function set_maintenance_level($level)
173
+	{
174
+		do_action('AHEE__EE_Maintenance_Mode__set_maintenance_level', $level);
175
+		update_option(self::option_name_maintenance_mode, (int) $level);
176
+	}
177
+
178
+
179
+	/**
180
+	 * returns TRUE if M-Mode is engaged and the current request is not for the admin
181
+	 *
182
+	 * @return bool
183
+	 */
184
+	public static function disable_frontend_for_maintenance()
185
+	{
186
+		return (! is_admin() && EE_Maintenance_Mode::instance()->level());
187
+	}
188
+
189
+
190
+	/**
191
+	 * @return void
192
+	 */
193
+	public function load_assets_required_for_m_mode()
194
+	{
195
+		if (
196
+			$this->real_level() === EE_Maintenance_Mode::level_2_complete_maintenance
197
+			&& ! wp_script_is('espresso_core')
198
+		) {
199
+			wp_register_style(
200
+				'espresso_default',
201
+				EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css',
202
+				['dashicons'],
203
+				EVENT_ESPRESSO_VERSION
204
+			);
205
+			wp_enqueue_style('espresso_default');
206
+			wp_register_script(
207
+				'espresso_core',
208
+				EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js',
209
+				['jquery'],
210
+				EVENT_ESPRESSO_VERSION,
211
+				true
212
+			);
213
+			wp_enqueue_script('espresso_core');
214
+		}
215
+	}
216
+
217
+
218
+	/**
219
+	 * replacement EE CPT template that displays message notifying site visitors
220
+	 * that EE has been temporarily placed into maintenance mode
221
+	 * does NOT get called on non-EE-CPT requests
222
+	 *
223
+	 * @return    string
224
+	 */
225
+	public static function template_include()
226
+	{
227
+		// shut 'er down for maintenance ? then don't use any of our templates for our endpoints
228
+		return get_template_directory() . '/index.php';
229
+	}
230
+
231
+
232
+	/**
233
+	 * displays message notifying site visitors that EE has been temporarily
234
+	 * placed into maintenance mode when post_type != EE CPT
235
+	 *
236
+	 * @param string $the_content
237
+	 * @return string
238
+	 */
239
+	public function the_content($the_content)
240
+	{
241
+		// check if M-mode is engaged and for EE shortcode
242
+		if ($this->level() && strpos($the_content, '[ESPRESSO_') !== false) {
243
+			// this can eventually be moved to a template, or edited via admin. But for now...
244
+			$the_content = sprintf(
245
+				esc_html__(
246
+					'%sMaintenance Mode%sEvent Registration has been temporarily closed while system maintenance is being performed. We\'re sorry for any inconveniences this may have caused. Please try back again later.%s',
247
+					'event_espresso'
248
+				),
249
+				'<h3>',
250
+				'</h3><p>',
251
+				'</p>'
252
+			);
253
+		}
254
+		return $the_content;
255
+	}
256
+
257
+
258
+	/**
259
+	 * displays message on frontend of site notifying admin that EE has been temporarily placed into maintenance mode
260
+	 */
261
+	public function display_maintenance_mode_notice()
262
+	{
263
+		/** @var CurrentPage $current_page */
264
+		$current_page = LoaderFactory::getLoader()->getShared(CurrentPage::class);
265
+		// check if M-mode is engaged and for EE shortcode
266
+		if (
267
+			! (defined('DOING_AJAX') && DOING_AJAX)
268
+			&& $this->real_level()
269
+			&& ! is_admin()
270
+			&& current_user_can('administrator')
271
+			&& $current_page->isEspressoPage()
272
+		) {
273
+			printf(
274
+				esc_html__(
275
+					'%sclose%sEvent Registration is currently disabled because Event Espresso has been placed into Maintenance Mode. To change Maintenance Mode settings, click here %sEE Maintenance Mode Admin Page%s',
276
+					'event_espresso'
277
+				),
278
+				'<div id="ee-m-mode-admin-notice-dv" class="ee-really-important-notice-dv"><a class="close-espresso-notice" title="',
279
+				'"><span class="dashicons dashicons-no"></span></a><p>',
280
+				' &raquo; <a href="' . add_query_arg(
281
+					['page' => 'espresso_maintenance_settings'],
282
+					admin_url('admin.php')
283
+				) . '">',
284
+				'</a></p></div>'
285
+			);
286
+		}
287
+	}
288
+	// espresso-notices important-notice ee-attention
289
+
290
+
291
+	/**
292
+	 * override magic methods
293
+	 */
294
+	final public function __destruct()
295
+	{
296
+	}
297
+
298
+
299
+	final public function __call($a, $b)
300
+	{
301
+	}
302
+
303
+
304
+	final public function __get($a)
305
+	{
306
+	}
307
+
308
+
309
+	final public function __set($a, $b)
310
+	{
311
+	}
312
+
313
+
314
+	final public function __isset($a)
315
+	{
316
+	}
317
+
318
+
319
+	final public function __unset($a)
320
+	{
321
+	}
322
+
323
+
324
+	final public function __sleep()
325
+	{
326
+		return [];
327
+	}
328
+
329
+
330
+	final public function __wakeup()
331
+	{
332
+	}
333
+
334
+
335
+	final public function __invoke()
336
+	{
337
+	}
338
+
339
+
340
+	final public static function __set_state($a = null)
341
+	{
342
+		return EE_Maintenance_Mode::instance();
343
+	}
344
+
345
+
346
+	final public function __clone()
347
+	{
348
+	}
349 349
 
350 350
 
351
-    final public static function __callStatic($a, $b)
352
-    {
353
-    }
351
+	final public static function __callStatic($a, $b)
352
+	{
353
+	}
354 354
 }
Please login to merge, or discard this patch.
core/db_models/EEM_System_Status.model.php 2 patches
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -97,9 +97,9 @@  discard block
 block discarded – undo
97 97
         $active_plugins = array_map('strtolower', $active_plugins);
98 98
         $plugin_info = array();
99 99
         foreach ($active_plugins as $plugin) {
100
-                $plugin_data = @get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin);
100
+                $plugin_data = @get_plugin_data(WP_PLUGIN_DIR.'/'.$plugin);
101 101
 
102
-                $plugin_info[ $plugin ] = $plugin_data;
102
+                $plugin_info[$plugin] = $plugin_data;
103 103
         }
104 104
         return $plugin_info;
105 105
     }
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             );
125 125
             $wp_memory_to_display .= '</mark>';
126 126
         } else {
127
-            $wp_memory_to_display = '<mark class="yes">' . size_format($wp_memory_int) . '</mark>';
127
+            $wp_memory_to_display = '<mark class="yes">'.size_format($wp_memory_int).'</mark>';
128 128
         }
129 129
         return array(
130 130
             'name' => get_bloginfo('name', 'display'),
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         $options = EE_Data_Migration_Manager::instance()->get_all_migration_script_options();
164 164
         $presentable_migration_scripts = array();
165 165
         foreach ($options as $option_array) {
166
-            $presentable_migration_scripts[ str_replace(EE_Data_Migration_Manager::data_migration_script_option_prefix, "", $option_array['option_name']) ] = maybe_unserialize($option_array['option_value']);
166
+            $presentable_migration_scripts[str_replace(EE_Data_Migration_Manager::data_migration_script_option_prefix, "", $option_array['option_name'])] = maybe_unserialize($option_array['option_value']);
167 167
         }
168 168
         return $presentable_migration_scripts;
169 169
 //      return get_option(EE_Data_Migration_Manager::data_migrations_option_name);//EE_Data_Migration_Manager::instance()->get_data_migrations_ran();
@@ -189,18 +189,18 @@  discard block
 block discarded – undo
189 189
 
190 190
         $pi = preg_replace(
191 191
             array('#^.*<body>(.*)</body>.*$#ms', '#<h2>PHP License</h2>.*$#ms',
192
-            '#<h1>Configuration</h1>#',  "#\r?\n#", "#</(h1|h2|h3|tr)>#", '# +<#',
192
+            '#<h1>Configuration</h1>#', "#\r?\n#", "#</(h1|h2|h3|tr)>#", '# +<#',
193 193
             "#[ \t]+#", '#&nbsp;#', '#  +#', '# class=".*?"#', '%&#039;%',
194 194
             '#<tr>(?:.*?)" src="(?:.*?)=(.*?)" alt="PHP Logo" /></a>'
195 195
             . '<h1>PHP Version (.*?)</h1>(?:\n+?)</td></tr>#',
196 196
             '#<h1><a href="(?:.*?)\?=(.*?)">PHP Credits</a></h1>#',
197 197
             '#<tr>(?:.*?)" src="(?:.*?)=(.*?)"(?:.*?)Zend Engine (.*?),(?:.*?)</tr>#',
198 198
             "# +#", '#<tr>#', '#</tr>#'),
199
-            array('$1', '', '', '', '</$1>' . "\n", '<', ' ', ' ', ' ', '', ' ',
200
-            '<h2>PHP Configuration</h2>' . "\n" . '<tr><td>PHP Version</td><td>$2</td></tr>' .
201
-            "\n" . '<tr><td>PHP Egg</td><td>$1</td></tr>',
199
+            array('$1', '', '', '', '</$1>'."\n", '<', ' ', ' ', ' ', '', ' ',
200
+            '<h2>PHP Configuration</h2>'."\n".'<tr><td>PHP Version</td><td>$2</td></tr>'.
201
+            "\n".'<tr><td>PHP Egg</td><td>$1</td></tr>',
202 202
             '<tr><td>PHP Credits Egg</td><td>$1</td></tr>',
203
-            '<tr><td>Zend Engine</td><td>$2</td></tr>' . "\n" .
203
+            '<tr><td>Zend Engine</td><td>$2</td></tr>'."\n".
204 204
             '<tr><td>Zend Egg</td><td>$1</td></tr>', ' ', '%S%', '%E%'),
205 205
             ob_get_clean()
206 206
         );
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
             foreach ($askapache as $m) {
221 221
                 $m2 = isset($m[2]) ? $m[2] : null;
222 222
             }
223
-              $pi[ $n ][ $m[1] ] = (!isset($m[3]) || $m2 == $m[3]) ? $m2 : array_slice($m, 2);
223
+              $pi[$n][$m[1]] = ( ! isset($m[3]) || $m2 == $m[3]) ? $m2 : array_slice($m, 2);
224 224
         }
225 225
 
226 226
         return $pi;
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
         if ($response instanceof WP_Error) {
238 238
             $error_string = '';
239 239
             foreach ($response->errors as $short_name => $description_array) {
240
-                $error_string .= "<b>$short_name</b>: " . implode(", ", $description_array);
240
+                $error_string .= "<b>$short_name</b>: ".implode(", ", $description_array);
241 241
             }
242 242
             return $error_string;
243 243
         }
@@ -249,8 +249,8 @@  discard block
 block discarded – undo
249 249
      */
250 250
     public function get_wp_maintenance_mode()
251 251
     {
252
-        $opened = file_exists(ABSPATH . '.maintenance');
253
-        return $opened ? sprintf(esc_html__('%s.maintenance file detected.%s Wordpress may have a failed auto-update which could prevent Event Espresso from updating the database correctly.', 'event_espresso'), '<strong>', '</strong>') : esc_html__('.maintenance file not detected. WordPress is not in maintenance mode.', 'event_espresso')  ;
252
+        $opened = file_exists(ABSPATH.'.maintenance');
253
+        return $opened ? sprintf(esc_html__('%s.maintenance file detected.%s Wordpress may have a failed auto-update which could prevent Event Espresso from updating the database correctly.', 'event_espresso'), '<strong>', '</strong>') : esc_html__('.maintenance file not detected. WordPress is not in maintenance mode.', 'event_espresso');
254 254
     }
255 255
     /**
256 256
      * Whether or not logging is enabled
@@ -258,8 +258,8 @@  discard block
 block discarded – undo
258 258
      */
259 259
     public function get_logging_enabled()
260 260
     {
261
-            $opened = @fopen(EVENT_ESPRESSO_UPLOAD_DIR . '/logs/espresso_log.txt', 'a');
262
-            return $opened ? esc_html__('Log Directory is writable', 'event_espresso') : sprintf(esc_html__('%sLog directory is NOT writable%s', 'event_espresso'), '<mark class="error"', '</mark>') ;
261
+            $opened = @fopen(EVENT_ESPRESSO_UPLOAD_DIR.'/logs/espresso_log.txt', 'a');
262
+            return $opened ? esc_html__('Log Directory is writable', 'event_espresso') : sprintf(esc_html__('%sLog directory is NOT writable%s', 'event_espresso'), '<mark class="error"', '</mark>');
263 263
     }
264 264
     /**
265 265
      *  Whether curl ro fsock works
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
         } elseif ($curl_works) {
277 277
             $status = esc_html__('Your server has cURL enabled, fsockopen is disabled.', 'event_espresso');
278 278
         } else {
279
-            $status = esc_html__('Your server does not have fsockopen or cURL enabled - PayPal IPN and other scripts which communicate with other servers will not work. Contact your hosting provider.', 'event_espresso') . '</mark>';
279
+            $status = esc_html__('Your server does not have fsockopen or cURL enabled - PayPal IPN and other scripts which communicate with other servers will not work. Contact your hosting provider.', 'event_espresso').'</mark>';
280 280
         }
281 281
         return $status;
282 282
     }
Please login to merge, or discard this patch.
Indentation   +283 added lines, -283 removed lines patch added patch discarded remove patch
@@ -5,79 +5,79 @@  discard block
 block discarded – undo
5 5
  */
6 6
 class EEM_System_Status
7 7
 {
8
-    // private instance of the EEM_System_Status object
9
-    protected static $_instance = null;
8
+	// private instance of the EEM_System_Status object
9
+	protected static $_instance = null;
10 10
 
11 11
 
12 12
 
13
-    /**
14
-     *      This function is a singleton method used to instantiate the EEM_Attendee object
15
-     *
16
-     *      @access public
17
-     *      @param string $timezone string representing the timezone we want to set for returned Date Time Strings (and any incoming timezone data that gets saved).  Note this just sends the timezone info to the date time model field objects.  Default is NULL (and will be assumed using the set timezone in the 'timezone_string' wp option)
18
-     *      @return EEM_System_Status
19
-     */
20
-    public static function instance()
21
-    {
13
+	/**
14
+	 *      This function is a singleton method used to instantiate the EEM_Attendee object
15
+	 *
16
+	 *      @access public
17
+	 *      @param string $timezone string representing the timezone we want to set for returned Date Time Strings (and any incoming timezone data that gets saved).  Note this just sends the timezone info to the date time model field objects.  Default is NULL (and will be assumed using the set timezone in the 'timezone_string' wp option)
18
+	 *      @return EEM_System_Status
19
+	 */
20
+	public static function instance()
21
+	{
22 22
 
23
-        // check if instance of EEM_System_Status already exists
24
-        if (self::$_instance === null) {
25
-            // instantiate EEM_System_Status
26
-            self::$_instance = new self();
27
-        }
28
-        return self::$_instance;
29
-    }
30
-    private function __construct()
31
-    {
32
-    }
33
-    /**
34
-     *
35
-     * @return array where each key is a function name on this class, and each value is SOMETHING--
36
-     * it might be a value, an array, or an object
37
-     */
38
-    public function get_system_stati()
39
-    {
40
-        return apply_filters(
41
-            'FHEE__EEM_System_Status__get_system_stati',
42
-            array(
43
-                'ee_version' => $this->get_ee_version(),
44
-                'ee_activation_history' => $this->get_ee_activation_history(),
45
-                'ee_config' => $this->get_ee_config(),
46
-                'ee_migration_history' => $this->get_ee_migration_history(),
47
-                'active_plugins' => $this->get_active_plugins(),
48
-                'wp_settings' => $this->get_wp_settings(),
49
-                'wp_maintenance_mode' => $this->get_wp_maintenance_mode(),
50
-                'https_enabled' => $this->get_https_enabled(),
51
-                'logging_enabled' => $this->get_logging_enabled(),
52
-                'remote_posting' => $this->get_remote_posting(),
53
-                'php_version' => $this->php_version(),
54
-                'php.ini_settings' => $this->get_php_ini_all(),
55
-                'php_info' => $this->get_php_info(),
56
-            ),
57
-            $this
58
-        );
59
-    }
60
-    /**
61
-     *
62
-     * @return string
63
-     */
64
-    public function get_ee_version()
65
-    {
66
-        return espresso_version();
67
-    }
68
-    /**
69
-     *
70
-     * @return string
71
-     */
72
-    public function php_version()
73
-    {
74
-        return phpversion();
75
-    }
76
-    /**
77
-     *
78
-     * @return array, where each key is a plugin name (lower-cased), values are sub-arrays.
79
-     * Sub-arrays like described in wp function get_plugin_data. Ie,     *
80
-     *  'Name' => 'Plugin Name',
23
+		// check if instance of EEM_System_Status already exists
24
+		if (self::$_instance === null) {
25
+			// instantiate EEM_System_Status
26
+			self::$_instance = new self();
27
+		}
28
+		return self::$_instance;
29
+	}
30
+	private function __construct()
31
+	{
32
+	}
33
+	/**
34
+	 *
35
+	 * @return array where each key is a function name on this class, and each value is SOMETHING--
36
+	 * it might be a value, an array, or an object
37
+	 */
38
+	public function get_system_stati()
39
+	{
40
+		return apply_filters(
41
+			'FHEE__EEM_System_Status__get_system_stati',
42
+			array(
43
+				'ee_version' => $this->get_ee_version(),
44
+				'ee_activation_history' => $this->get_ee_activation_history(),
45
+				'ee_config' => $this->get_ee_config(),
46
+				'ee_migration_history' => $this->get_ee_migration_history(),
47
+				'active_plugins' => $this->get_active_plugins(),
48
+				'wp_settings' => $this->get_wp_settings(),
49
+				'wp_maintenance_mode' => $this->get_wp_maintenance_mode(),
50
+				'https_enabled' => $this->get_https_enabled(),
51
+				'logging_enabled' => $this->get_logging_enabled(),
52
+				'remote_posting' => $this->get_remote_posting(),
53
+				'php_version' => $this->php_version(),
54
+				'php.ini_settings' => $this->get_php_ini_all(),
55
+				'php_info' => $this->get_php_info(),
56
+			),
57
+			$this
58
+		);
59
+	}
60
+	/**
61
+	 *
62
+	 * @return string
63
+	 */
64
+	public function get_ee_version()
65
+	{
66
+		return espresso_version();
67
+	}
68
+	/**
69
+	 *
70
+	 * @return string
71
+	 */
72
+	public function php_version()
73
+	{
74
+		return phpversion();
75
+	}
76
+	/**
77
+	 *
78
+	 * @return array, where each key is a plugin name (lower-cased), values are sub-arrays.
79
+	 * Sub-arrays like described in wp function get_plugin_data. Ie,     *
80
+	 *  'Name' => 'Plugin Name',
81 81
         'PluginURI' => 'Plugin URI',
82 82
         'Version' => 'Version',
83 83
         'Description' => 'Description',
@@ -86,231 +86,231 @@  discard block
 block discarded – undo
86 86
         'TextDomain' => 'Text Domain',
87 87
         'DomainPath' => 'Domain Path',
88 88
         'Network' => 'Network',
89
-     */
90
-    public function get_active_plugins()
91
-    {
92
-        $active_plugins = (array) get_option('active_plugins', array());
93
-        if (is_multisite()) {
94
-            $active_plugins = array_merge($active_plugins, get_site_option('active_sitewide_plugins', array()));
95
-        }
96
-        $active_plugins = array_map('strtolower', $active_plugins);
97
-        $plugin_info = array();
98
-        foreach ($active_plugins as $plugin) {
99
-                $plugin_data = @get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin);
89
+	 */
90
+	public function get_active_plugins()
91
+	{
92
+		$active_plugins = (array) get_option('active_plugins', array());
93
+		if (is_multisite()) {
94
+			$active_plugins = array_merge($active_plugins, get_site_option('active_sitewide_plugins', array()));
95
+		}
96
+		$active_plugins = array_map('strtolower', $active_plugins);
97
+		$plugin_info = array();
98
+		foreach ($active_plugins as $plugin) {
99
+				$plugin_data = @get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin);
100 100
 
101
-                $plugin_info[ $plugin ] = $plugin_data;
102
-        }
103
-        return $plugin_info;
104
-    }
101
+				$plugin_info[ $plugin ] = $plugin_data;
102
+		}
103
+		return $plugin_info;
104
+	}
105 105
 
106
-    /**
107
-     *
108
-     * @return array with keys 'home_url' and 'site_url'
109
-     */
110
-    public function get_wp_settings()
111
-    {
112
-        $wp_memory_int = $this->let_to_num(WP_MEMORY_LIMIT);
113
-        if ($wp_memory_int < 67108864) {
114
-            $wp_memory_to_display = '<mark class="error">';
115
-            $wp_memory_to_display .= sprintf(
116
-                esc_html__(
117
-                    '%s - We recommend setting memory to at least 64MB. See: %s Increasing memory allocated to PHP %s',
118
-                    'event_espresso'
119
-                ),
120
-                WP_MEMORY_LIMIT,
121
-                '<a href="http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP">',
122
-                '</a>"'
123
-            );
124
-            $wp_memory_to_display .= '</mark>';
125
-        } else {
126
-            $wp_memory_to_display = '<mark class="yes">' . size_format($wp_memory_int) . '</mark>';
127
-        }
128
-        return array(
129
-            'name' => get_bloginfo('name', 'display'),
130
-            'is_multisite' => is_multisite(),
131
-            'version' =>  get_bloginfo('version', 'display'),
132
-            'home_url' => home_url(),
133
-            'site_url' => site_url(),
134
-            'WP_DEBUG' => WP_DEBUG,
135
-            'permalink_structure' => get_option('permalink_structure'),
136
-            'theme' => wp_get_theme(),
137
-            'gmt_offset' => get_option('gmt_offset'),
138
-            'timezone_string' => get_option('timezone_string'),
139
-            'admin_email' =>  get_bloginfo('admin_email', 'display'),
140
-            'language' => get_bloginfo('language', 'display'),
141
-            'wp_max_upload_size' => size_format(wp_max_upload_size()),
142
-            'wp_memory' => $wp_memory_to_display
143
-            );
144
-    }
106
+	/**
107
+	 *
108
+	 * @return array with keys 'home_url' and 'site_url'
109
+	 */
110
+	public function get_wp_settings()
111
+	{
112
+		$wp_memory_int = $this->let_to_num(WP_MEMORY_LIMIT);
113
+		if ($wp_memory_int < 67108864) {
114
+			$wp_memory_to_display = '<mark class="error">';
115
+			$wp_memory_to_display .= sprintf(
116
+				esc_html__(
117
+					'%s - We recommend setting memory to at least 64MB. See: %s Increasing memory allocated to PHP %s',
118
+					'event_espresso'
119
+				),
120
+				WP_MEMORY_LIMIT,
121
+				'<a href="http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP">',
122
+				'</a>"'
123
+			);
124
+			$wp_memory_to_display .= '</mark>';
125
+		} else {
126
+			$wp_memory_to_display = '<mark class="yes">' . size_format($wp_memory_int) . '</mark>';
127
+		}
128
+		return array(
129
+			'name' => get_bloginfo('name', 'display'),
130
+			'is_multisite' => is_multisite(),
131
+			'version' =>  get_bloginfo('version', 'display'),
132
+			'home_url' => home_url(),
133
+			'site_url' => site_url(),
134
+			'WP_DEBUG' => WP_DEBUG,
135
+			'permalink_structure' => get_option('permalink_structure'),
136
+			'theme' => wp_get_theme(),
137
+			'gmt_offset' => get_option('gmt_offset'),
138
+			'timezone_string' => get_option('timezone_string'),
139
+			'admin_email' =>  get_bloginfo('admin_email', 'display'),
140
+			'language' => get_bloginfo('language', 'display'),
141
+			'wp_max_upload_size' => size_format(wp_max_upload_size()),
142
+			'wp_memory' => $wp_memory_to_display
143
+			);
144
+	}
145 145
 
146
-    /**
147
-     * Gets an array of information about the history of ee versions installed
148
-     * @return array
149
-     */
150
-    public function get_ee_activation_history()
151
-    {
152
-        return get_option('espresso_db_update');
153
-    }
146
+	/**
147
+	 * Gets an array of information about the history of ee versions installed
148
+	 * @return array
149
+	 */
150
+	public function get_ee_activation_history()
151
+	{
152
+		return get_option('espresso_db_update');
153
+	}
154 154
 
155 155
 
156
-    /**
157
-     * Gets an array where keys are ee versions, and their values are arrays indicating all the different times that version was installed
158
-     * @return EE_Data_Migration_Script_Base[]
159
-     */
160
-    public function get_ee_migration_history()
161
-    {
162
-        $options = EE_Data_Migration_Manager::instance()->get_all_migration_script_options();
163
-        $presentable_migration_scripts = array();
164
-        foreach ($options as $option_array) {
165
-            $presentable_migration_scripts[ str_replace(EE_Data_Migration_Manager::data_migration_script_option_prefix, "", $option_array['option_name']) ] = maybe_unserialize($option_array['option_value']);
166
-        }
167
-        return $presentable_migration_scripts;
156
+	/**
157
+	 * Gets an array where keys are ee versions, and their values are arrays indicating all the different times that version was installed
158
+	 * @return EE_Data_Migration_Script_Base[]
159
+	 */
160
+	public function get_ee_migration_history()
161
+	{
162
+		$options = EE_Data_Migration_Manager::instance()->get_all_migration_script_options();
163
+		$presentable_migration_scripts = array();
164
+		foreach ($options as $option_array) {
165
+			$presentable_migration_scripts[ str_replace(EE_Data_Migration_Manager::data_migration_script_option_prefix, "", $option_array['option_name']) ] = maybe_unserialize($option_array['option_value']);
166
+		}
167
+		return $presentable_migration_scripts;
168 168
 //      return get_option(EE_Data_Migration_Manager::data_migrations_option_name);//EE_Data_Migration_Manager::instance()->get_data_migrations_ran();
169
-    }
169
+	}
170 170
 
171
-    /**
172
-     *
173
-     * @return array like EE_Config class
174
-     */
175
-    public function get_ee_config()
176
-    {
177
-        return EE_Config::instance();
178
-    }
171
+	/**
172
+	 *
173
+	 * @return array like EE_Config class
174
+	 */
175
+	public function get_ee_config()
176
+	{
177
+		return EE_Config::instance();
178
+	}
179 179
 
180
-    /**
181
-     * Gets an array of php setup info, pilfered from http://www.php.net/manual/en/function.phpinfo.php#87463
182
-     * @return array like the output of phpinfo(), but in an array
183
-     */
184
-    public function get_php_info()
185
-    {
186
-        ob_start();
187
-        phpinfo(-1);
180
+	/**
181
+	 * Gets an array of php setup info, pilfered from http://www.php.net/manual/en/function.phpinfo.php#87463
182
+	 * @return array like the output of phpinfo(), but in an array
183
+	 */
184
+	public function get_php_info()
185
+	{
186
+		ob_start();
187
+		phpinfo(-1);
188 188
 
189
-        $pi = preg_replace(
190
-            array('#^.*<body>(.*)</body>.*$#ms', '#<h2>PHP License</h2>.*$#ms',
191
-            '#<h1>Configuration</h1>#',  "#\r?\n#", "#</(h1|h2|h3|tr)>#", '# +<#',
192
-            "#[ \t]+#", '#&nbsp;#', '#  +#', '# class=".*?"#', '%&#039;%',
193
-            '#<tr>(?:.*?)" src="(?:.*?)=(.*?)" alt="PHP Logo" /></a>'
194
-            . '<h1>PHP Version (.*?)</h1>(?:\n+?)</td></tr>#',
195
-            '#<h1><a href="(?:.*?)\?=(.*?)">PHP Credits</a></h1>#',
196
-            '#<tr>(?:.*?)" src="(?:.*?)=(.*?)"(?:.*?)Zend Engine (.*?),(?:.*?)</tr>#',
197
-            "# +#", '#<tr>#', '#</tr>#'),
198
-            array('$1', '', '', '', '</$1>' . "\n", '<', ' ', ' ', ' ', '', ' ',
199
-            '<h2>PHP Configuration</h2>' . "\n" . '<tr><td>PHP Version</td><td>$2</td></tr>' .
200
-            "\n" . '<tr><td>PHP Egg</td><td>$1</td></tr>',
201
-            '<tr><td>PHP Credits Egg</td><td>$1</td></tr>',
202
-            '<tr><td>Zend Engine</td><td>$2</td></tr>' . "\n" .
203
-            '<tr><td>Zend Egg</td><td>$1</td></tr>', ' ', '%S%', '%E%'),
204
-            ob_get_clean()
205
-        );
189
+		$pi = preg_replace(
190
+			array('#^.*<body>(.*)</body>.*$#ms', '#<h2>PHP License</h2>.*$#ms',
191
+			'#<h1>Configuration</h1>#',  "#\r?\n#", "#</(h1|h2|h3|tr)>#", '# +<#',
192
+			"#[ \t]+#", '#&nbsp;#', '#  +#', '# class=".*?"#', '%&#039;%',
193
+			'#<tr>(?:.*?)" src="(?:.*?)=(.*?)" alt="PHP Logo" /></a>'
194
+			. '<h1>PHP Version (.*?)</h1>(?:\n+?)</td></tr>#',
195
+			'#<h1><a href="(?:.*?)\?=(.*?)">PHP Credits</a></h1>#',
196
+			'#<tr>(?:.*?)" src="(?:.*?)=(.*?)"(?:.*?)Zend Engine (.*?),(?:.*?)</tr>#',
197
+			"# +#", '#<tr>#', '#</tr>#'),
198
+			array('$1', '', '', '', '</$1>' . "\n", '<', ' ', ' ', ' ', '', ' ',
199
+			'<h2>PHP Configuration</h2>' . "\n" . '<tr><td>PHP Version</td><td>$2</td></tr>' .
200
+			"\n" . '<tr><td>PHP Egg</td><td>$1</td></tr>',
201
+			'<tr><td>PHP Credits Egg</td><td>$1</td></tr>',
202
+			'<tr><td>Zend Engine</td><td>$2</td></tr>' . "\n" .
203
+			'<tr><td>Zend Egg</td><td>$1</td></tr>', ' ', '%S%', '%E%'),
204
+			ob_get_clean()
205
+		);
206 206
 
207
-        $sections = explode('<h2>', strip_tags((string) $pi, '<h2><th><td>'));
208
-        unset($sections[0]);
207
+		$sections = explode('<h2>', strip_tags((string) $pi, '<h2><th><td>'));
208
+		unset($sections[0]);
209 209
 
210
-        $pi = array();
211
-        foreach ($sections as $section) {
212
-            $n = substr($section, 0, strpos($section, '</h2>'));
213
-            preg_match_all(
214
-                '#%S%(?:<td>(.*?)</td>)?(?:<td>(.*?)</td>)?(?:<td>(.*?)</td>)?%E%#',
215
-                $section,
216
-                $askapache,
217
-                PREG_SET_ORDER
218
-            );
219
-            foreach ($askapache as $m) {
220
-                $m2 = isset($m[2]) ? $m[2] : null;
221
-            }
222
-              $pi[ $n ][ $m[1] ] = (!isset($m[3]) || $m2 == $m[3]) ? $m2 : array_slice($m, 2);
223
-        }
210
+		$pi = array();
211
+		foreach ($sections as $section) {
212
+			$n = substr($section, 0, strpos($section, '</h2>'));
213
+			preg_match_all(
214
+				'#%S%(?:<td>(.*?)</td>)?(?:<td>(.*?)</td>)?(?:<td>(.*?)</td>)?%E%#',
215
+				$section,
216
+				$askapache,
217
+				PREG_SET_ORDER
218
+			);
219
+			foreach ($askapache as $m) {
220
+				$m2 = isset($m[2]) ? $m[2] : null;
221
+			}
222
+			  $pi[ $n ][ $m[1] ] = (!isset($m[3]) || $m2 == $m[3]) ? $m2 : array_slice($m, 2);
223
+		}
224 224
 
225
-        return $pi;
226
-    }
225
+		return $pi;
226
+	}
227 227
 
228
-    /**
229
-     * Checks if site responds ot HTTPS
230
-     * @return boolean
231
-     */
232
-    public function get_https_enabled()
233
-    {
234
-        $home = str_replace("http://", "https://", home_url());
235
-        $response = wp_remote_get($home);
236
-        if ($response instanceof WP_Error) {
237
-            $error_string = '';
238
-            foreach ($response->errors as $short_name => $description_array) {
239
-                $error_string .= "<b>$short_name</b>: " . implode(", ", $description_array);
240
-            }
241
-            return $error_string;
242
-        }
243
-        return "ok!";
244
-    }
245
-    /**
246
-     * Whether or not a .maintenance file is detected
247
-     * @return string descripting wp_maintenance_mode status
248
-     */
249
-    public function get_wp_maintenance_mode()
250
-    {
251
-        $opened = file_exists(ABSPATH . '.maintenance');
252
-        return $opened ? sprintf(esc_html__('%s.maintenance file detected.%s Wordpress may have a failed auto-update which could prevent Event Espresso from updating the database correctly.', 'event_espresso'), '<strong>', '</strong>') : esc_html__('.maintenance file not detected. WordPress is not in maintenance mode.', 'event_espresso')  ;
253
-    }
254
-    /**
255
-     * Whether or not logging is enabled
256
-     * @return string descripting logging's status
257
-     */
258
-    public function get_logging_enabled()
259
-    {
260
-            $opened = @fopen(EVENT_ESPRESSO_UPLOAD_DIR . '/logs/espresso_log.txt', 'a');
261
-            return $opened ? esc_html__('Log Directory is writable', 'event_espresso') : sprintf(esc_html__('%sLog directory is NOT writable%s', 'event_espresso'), '<mark class="error"', '</mark>') ;
262
-    }
263
-    /**
264
-     *  Whether curl ro fsock works
265
-     * @return string describing posting's status
266
-     */
267
-    public function get_remote_posting()
268
-    {
269
-        $fsock_works = function_exists('fsockopen');
270
-        $curl_works = function_exists('curl_init');
271
-        if ($fsock_works && $curl_works) {
272
-            $status = esc_html__('Your server has fsockopen and cURL enabled.', 'event_espresso');
273
-        } elseif ($fsock_works) {
274
-            $status = esc_html__('Your server has fsockopen enabled, cURL is disabled.', 'event_espresso');
275
-        } elseif ($curl_works) {
276
-            $status = esc_html__('Your server has cURL enabled, fsockopen is disabled.', 'event_espresso');
277
-        } else {
278
-            $status = esc_html__('Your server does not have fsockopen or cURL enabled - PayPal IPN and other scripts which communicate with other servers will not work. Contact your hosting provider.', 'event_espresso') . '</mark>';
279
-        }
280
-        return $status;
281
-    }
282
-    /**
283
-     * Gets all the php.ini settings
284
-     * @return array
285
-     */
286
-    public function get_php_ini_all()
287
-    {
288
-        return ini_get_all();
289
-    }
290
-    /**
291
-     * Transforms the php.ini notation for numbers (like '2M') to an integer.
292
-     *
293
-     * @param type $size
294
-     * @return int
295
-     */
296
-    public function let_to_num($size)
297
-    {
298
-        $l      = substr($size, -1);
299
-        $ret    = substr($size, 0, -1);
300
-        // phpcs:disable PSR2.ControlStructures.SwitchDeclaration.TerminatingComment
301
-        switch (strtoupper($l)) {
302
-            case 'P':
303
-                $ret *= 1024;
304
-            case 'T':
305
-                $ret *= 1024;
306
-            case 'G':
307
-                $ret *= 1024;
308
-            case 'M':
309
-                $ret *= 1024;
310
-            case 'K':
311
-                $ret *= 1024;
312
-        }
313
-        // phpcs:enable
314
-        return $ret;
315
-    }
228
+	/**
229
+	 * Checks if site responds ot HTTPS
230
+	 * @return boolean
231
+	 */
232
+	public function get_https_enabled()
233
+	{
234
+		$home = str_replace("http://", "https://", home_url());
235
+		$response = wp_remote_get($home);
236
+		if ($response instanceof WP_Error) {
237
+			$error_string = '';
238
+			foreach ($response->errors as $short_name => $description_array) {
239
+				$error_string .= "<b>$short_name</b>: " . implode(", ", $description_array);
240
+			}
241
+			return $error_string;
242
+		}
243
+		return "ok!";
244
+	}
245
+	/**
246
+	 * Whether or not a .maintenance file is detected
247
+	 * @return string descripting wp_maintenance_mode status
248
+	 */
249
+	public function get_wp_maintenance_mode()
250
+	{
251
+		$opened = file_exists(ABSPATH . '.maintenance');
252
+		return $opened ? sprintf(esc_html__('%s.maintenance file detected.%s Wordpress may have a failed auto-update which could prevent Event Espresso from updating the database correctly.', 'event_espresso'), '<strong>', '</strong>') : esc_html__('.maintenance file not detected. WordPress is not in maintenance mode.', 'event_espresso')  ;
253
+	}
254
+	/**
255
+	 * Whether or not logging is enabled
256
+	 * @return string descripting logging's status
257
+	 */
258
+	public function get_logging_enabled()
259
+	{
260
+			$opened = @fopen(EVENT_ESPRESSO_UPLOAD_DIR . '/logs/espresso_log.txt', 'a');
261
+			return $opened ? esc_html__('Log Directory is writable', 'event_espresso') : sprintf(esc_html__('%sLog directory is NOT writable%s', 'event_espresso'), '<mark class="error"', '</mark>') ;
262
+	}
263
+	/**
264
+	 *  Whether curl ro fsock works
265
+	 * @return string describing posting's status
266
+	 */
267
+	public function get_remote_posting()
268
+	{
269
+		$fsock_works = function_exists('fsockopen');
270
+		$curl_works = function_exists('curl_init');
271
+		if ($fsock_works && $curl_works) {
272
+			$status = esc_html__('Your server has fsockopen and cURL enabled.', 'event_espresso');
273
+		} elseif ($fsock_works) {
274
+			$status = esc_html__('Your server has fsockopen enabled, cURL is disabled.', 'event_espresso');
275
+		} elseif ($curl_works) {
276
+			$status = esc_html__('Your server has cURL enabled, fsockopen is disabled.', 'event_espresso');
277
+		} else {
278
+			$status = esc_html__('Your server does not have fsockopen or cURL enabled - PayPal IPN and other scripts which communicate with other servers will not work. Contact your hosting provider.', 'event_espresso') . '</mark>';
279
+		}
280
+		return $status;
281
+	}
282
+	/**
283
+	 * Gets all the php.ini settings
284
+	 * @return array
285
+	 */
286
+	public function get_php_ini_all()
287
+	{
288
+		return ini_get_all();
289
+	}
290
+	/**
291
+	 * Transforms the php.ini notation for numbers (like '2M') to an integer.
292
+	 *
293
+	 * @param type $size
294
+	 * @return int
295
+	 */
296
+	public function let_to_num($size)
297
+	{
298
+		$l      = substr($size, -1);
299
+		$ret    = substr($size, 0, -1);
300
+		// phpcs:disable PSR2.ControlStructures.SwitchDeclaration.TerminatingComment
301
+		switch (strtoupper($l)) {
302
+			case 'P':
303
+				$ret *= 1024;
304
+			case 'T':
305
+				$ret *= 1024;
306
+			case 'G':
307
+				$ret *= 1024;
308
+			case 'M':
309
+				$ret *= 1024;
310
+			case 'K':
311
+				$ret *= 1024;
312
+		}
313
+		// phpcs:enable
314
+		return $ret;
315
+	}
316 316
 }
Please login to merge, or discard this patch.
core/admin/templates/espresso_ratings_request_content.template.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <div class="padding">
2 2
     <p><?php
3
-        esc_html_e(
4
-            'We need your help to continue maintaining and providing this plugin for free. You can help by leaving a positive review in the WordPress plugin directory. 5 star ratings bring Event Espresso Decaf to the attention of more users which increases our support and features for this version of Event Espresso.',
5
-            'event_espresso'
6
-        ); ?></p>
3
+		esc_html_e(
4
+			'We need your help to continue maintaining and providing this plugin for free. You can help by leaving a positive review in the WordPress plugin directory. 5 star ratings bring Event Espresso Decaf to the attention of more users which increases our support and features for this version of Event Espresso.',
5
+			'event_espresso'
6
+		); ?></p>
7 7
     <p><?php esc_html_e('Rate it five stars today!', 'event_espresso'); ?></p><span
8 8
         class="ee-wp-blue dashicons dashicons-star-filled"></span><span
9 9
         class="ee-wp-blue dashicons dashicons-star-filled"></span><span
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
         class="ee-wp-blue dashicons dashicons-star-filled"></span>
13 13
     <p><a class="button button-primary"
14 14
           href="https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Fview%2Fplugin-reviews%2Fevent-espresso-decaf%3Frate%3D5%23postform"><?php
15
-            esc_html_e(
16
-                'Rate It!',
17
-                'event_espresso'
18
-            ); ?></a></p>
15
+			esc_html_e(
16
+				'Rate It!',
17
+				'event_espresso'
18
+			); ?></a></p>
19 19
 </div>
20 20
\ No newline at end of file
Please login to merge, or discard this patch.
templates/admin_general_metabox_contents_espresso_sponsors.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     <a href="https://eventespresso.com/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=event_espresso_highlights_widget&utm_content=banner"
12 12
        target="_blank"
13 13
     >
14
-        <img src="<?php echo esc_url_raw(EE_GLOBAL_ASSETS_URL . 'images/manage-events-faster-240x240.jpg'); ?>" />
14
+        <img src="<?php echo esc_url_raw(EE_GLOBAL_ASSETS_URL.'images/manage-events-faster-240x240.jpg'); ?>" />
15 15
     </a>
16 16
     <p>Visit
17 17
         <a href="https://eventespresso.com/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign
Please login to merge, or discard this patch.