@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | 'inactive-plugin' => 'Inactive Plugins', |
38 | 38 | 'setting' => 'Plugin Settings', |
39 | 39 | ]; |
40 | - $systemInfo = array_reduce( array_keys( $details ), function( $carry, $key ) use( $details ) { |
|
40 | + $systemInfo = array_reduce( array_keys( $details ), function( $carry, $key ) use($details) { |
|
41 | 41 | $methodName = glsr( Helper::class )->buildMethodName( 'get-'.$key.'-details' ); |
42 | 42 | if( method_exists( $this, $methodName ) && $systemDetails = $this->$methodName() ) { |
43 | 43 | return $carry.$this->implode( $details[$key], $systemDetails ); |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | { |
55 | 55 | $plugins = get_plugins(); |
56 | 56 | $activePlugins = (array)get_option( 'active_plugins', [] ); |
57 | - $inactive = array_diff_key( $plugins, array_flip( $activePlugins )); |
|
58 | - return $this->normalizePluginList( array_diff_key( $plugins, $inactive )); |
|
57 | + $inactive = array_diff_key( $plugins, array_flip( $activePlugins ) ); |
|
58 | + return $this->normalizePluginList( array_diff_key( $plugins, $inactive ) ); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | public function getInactivePluginDetails() |
80 | 80 | { |
81 | 81 | $activePlugins = (array)get_option( 'active_plugins', [] ); |
82 | - return $this->normalizePluginList( array_diff_key( get_plugins(), array_flip( $activePlugins ))); |
|
82 | + return $this->normalizePluginList( array_diff_key( get_plugins(), array_flip( $activePlugins ) ) ); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -89,9 +89,9 @@ discard block |
||
89 | 89 | { |
90 | 90 | $plugins = array_merge( |
91 | 91 | get_mu_plugins(), |
92 | - get_plugins( '/../'.basename( WPMU_PLUGIN_DIR )) |
|
92 | + get_plugins( '/../'.basename( WPMU_PLUGIN_DIR ) ) |
|
93 | 93 | ); |
94 | - if( empty( $plugins ))return; |
|
94 | + if( empty($plugins) )return; |
|
95 | 95 | return $this->normalizePluginList( $plugins ); |
96 | 96 | } |
97 | 97 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public function getMultisitePluginDetails() |
102 | 102 | { |
103 | - if( !is_multisite() || empty( get_site_option( 'active_sitewide_plugins', [] )))return; |
|
103 | + if( !is_multisite() || empty(get_site_option( 'active_sitewide_plugins', [] )) )return; |
|
104 | 104 | return $this->normalizePluginList( wp_get_active_network_plugins() ); |
105 | 105 | } |
106 | 106 | |
@@ -122,11 +122,11 @@ discard block |
||
122 | 122 | 'Max Input Vars' => ini_get( 'max_input_vars' ), |
123 | 123 | 'Memory Limit' => ini_get( 'memory_limit' ), |
124 | 124 | 'Post Max Size' => ini_get( 'post_max_size' ), |
125 | - 'Session Cookie Path' => esc_html( ini_get( 'session.cookie_path' )), |
|
126 | - 'Session Name' => esc_html( ini_get( 'session.name' )), |
|
127 | - 'Session Save Path' => esc_html( ini_get( 'session.save_path' )), |
|
128 | - 'Session Use Cookies' => var_export( wp_validate_boolean( ini_get( 'session.use_cookies' )), true ), |
|
129 | - 'Session Use Only Cookies' => var_export( wp_validate_boolean( ini_get( 'session.use_only_cookies' )), true ), |
|
125 | + 'Session Cookie Path' => esc_html( ini_get( 'session.cookie_path' ) ), |
|
126 | + 'Session Name' => esc_html( ini_get( 'session.name' ) ), |
|
127 | + 'Session Save Path' => esc_html( ini_get( 'session.save_path' ) ), |
|
128 | + 'Session Use Cookies' => var_export( wp_validate_boolean( ini_get( 'session.use_cookies' ) ), true ), |
|
129 | + 'Session Use Only Cookies' => var_export( wp_validate_boolean( ini_get( 'session.use_only_cookies' ) ), true ), |
|
130 | 130 | 'Upload Max Filesize' => ini_get( 'upload_max_filesize' ), |
131 | 131 | ]; |
132 | 132 | } |
@@ -154,13 +154,13 @@ discard block |
||
154 | 154 | $settings = glsr( OptionManager::class )->get( 'settings', [] ); |
155 | 155 | $settings = $helper->flattenArray( $settings, true ); |
156 | 156 | foreach( ['submissions.recaptcha.key', 'submissions.recaptcha.secret'] as $key ) { |
157 | - if( empty( $settings[$key] ))continue; |
|
157 | + if( empty($settings[$key]) )continue; |
|
158 | 158 | $settings[$key] = str_repeat( '*', 10 ); |
159 | 159 | } |
160 | 160 | $details = []; |
161 | 161 | foreach( $settings as $key => $value ) { |
162 | - if( $helper->startsWith( 'strings', $key ) && $helper->endsWith( 'id', $key ))continue; |
|
163 | - $value = htmlspecialchars( trim( preg_replace('/\s\s+/', '\\n', $value )), ENT_QUOTES, 'UTF-8' ); |
|
162 | + if( $helper->startsWith( 'strings', $key ) && $helper->endsWith( 'id', $key ) )continue; |
|
163 | + $value = htmlspecialchars( trim( preg_replace( '/\s\s+/', '\\n', $value ) ), ENT_QUOTES, 'UTF-8' ); |
|
164 | 164 | $details[$key] = $value; |
165 | 165 | } |
166 | 166 | return $details; |
@@ -231,10 +231,10 @@ discard block |
||
231 | 231 | 'WPE_APIKEY' => 'WP Engine', |
232 | 232 | ]; |
233 | 233 | foreach( $checks as $key => $value ) { |
234 | - if( !$this->isWebhostCheckValid( $key ))continue; |
|
234 | + if( !$this->isWebhostCheckValid( $key ) )continue; |
|
235 | 235 | return $value; |
236 | 236 | } |
237 | - return implode( ',', array_filter( [DB_HOST, filter_input( INPUT_SERVER, 'SERVER_NAME' )] )); |
|
237 | + return implode( ',', array_filter( [DB_HOST, filter_input( INPUT_SERVER, 'SERVER_NAME' )] ) ); |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | /** |
@@ -255,8 +255,8 @@ discard block |
||
255 | 255 | { |
256 | 256 | $plugins = get_plugins(); |
257 | 257 | $activePlugins = (array)get_option( 'active_plugins', [] ); |
258 | - $inactive = $this->normalizePluginList( array_diff_key( $plugins, array_flip( $activePlugins ))); |
|
259 | - $active = $this->normalizePluginList( array_diff_key( $plugins, $inactive )); |
|
258 | + $inactive = $this->normalizePluginList( array_diff_key( $plugins, array_flip( $activePlugins ) ) ); |
|
259 | + $active = $this->normalizePluginList( array_diff_key( $plugins, $inactive ) ); |
|
260 | 260 | return $active + $inactive; |
261 | 261 | } |
262 | 262 | |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | protected function implode( $title, array $details ) |
268 | 268 | { |
269 | 269 | $strings = ['['.$title.']']; |
270 | - $padding = max( array_map( 'strlen', array_keys( $details )) ); |
|
270 | + $padding = max( array_map( 'strlen', array_keys( $details ) ) ); |
|
271 | 271 | $padding = max( [$padding, static::PAD] ); |
272 | 272 | foreach( $details as $key => $value ) { |
273 | 273 | $strings[] = is_string( $key ) |
@@ -91,7 +91,9 @@ discard block |
||
91 | 91 | get_mu_plugins(), |
92 | 92 | get_plugins( '/../'.basename( WPMU_PLUGIN_DIR )) |
93 | 93 | ); |
94 | - if( empty( $plugins ))return; |
|
94 | + if( empty( $plugins )) { |
|
95 | + return; |
|
96 | + } |
|
95 | 97 | return $this->normalizePluginList( $plugins ); |
96 | 98 | } |
97 | 99 | |
@@ -100,7 +102,9 @@ discard block |
||
100 | 102 | */ |
101 | 103 | public function getMultisitePluginDetails() |
102 | 104 | { |
103 | - if( !is_multisite() || empty( get_site_option( 'active_sitewide_plugins', [] )))return; |
|
105 | + if( !is_multisite() || empty( get_site_option( 'active_sitewide_plugins', [] ))) { |
|
106 | + return; |
|
107 | + } |
|
104 | 108 | return $this->normalizePluginList( wp_get_active_network_plugins() ); |
105 | 109 | } |
106 | 110 | |
@@ -154,12 +158,16 @@ discard block |
||
154 | 158 | $settings = glsr( OptionManager::class )->get( 'settings', [] ); |
155 | 159 | $settings = $helper->flattenArray( $settings, true ); |
156 | 160 | foreach( ['submissions.recaptcha.key', 'submissions.recaptcha.secret'] as $key ) { |
157 | - if( empty( $settings[$key] ))continue; |
|
161 | + if( empty( $settings[$key] )) { |
|
162 | + continue; |
|
163 | + } |
|
158 | 164 | $settings[$key] = str_repeat( '*', 10 ); |
159 | 165 | } |
160 | 166 | $details = []; |
161 | 167 | foreach( $settings as $key => $value ) { |
162 | - if( $helper->startsWith( 'strings', $key ) && $helper->endsWith( 'id', $key ))continue; |
|
168 | + if( $helper->startsWith( 'strings', $key ) && $helper->endsWith( 'id', $key )) { |
|
169 | + continue; |
|
170 | + } |
|
163 | 171 | $value = htmlspecialchars( trim( preg_replace('/\s\s+/', '\\n', $value )), ENT_QUOTES, 'UTF-8' ); |
164 | 172 | $details[$key] = $value; |
165 | 173 | } |
@@ -231,7 +239,9 @@ discard block |
||
231 | 239 | 'WPE_APIKEY' => 'WP Engine', |
232 | 240 | ]; |
233 | 241 | foreach( $checks as $key => $value ) { |
234 | - if( !$this->isWebhostCheckValid( $key ))continue; |
|
242 | + if( !$this->isWebhostCheckValid( $key )) { |
|
243 | + continue; |
|
244 | + } |
|
235 | 245 | return $value; |
236 | 246 | } |
237 | 247 | return implode( ',', array_filter( [DB_HOST, filter_input( INPUT_SERVER, 'SERVER_NAME' )] )); |