@@ -3,7 +3,7 @@ |
||
| 3 | 3 | defined( 'WP_UNINSTALL_PLUGIN' ) || die; |
| 4 | 4 | |
| 5 | 5 | require_once __DIR__.'/site-reviews.php'; |
| 6 | -if( !GL_Plugin_Check_v1::isValid( array( 'wordpress' => '4.7.0' )))return; |
|
| 6 | +if( !GL_Plugin_Check_v1::isValid( array( 'wordpress' => '4.7.0' ) ) )return; |
|
| 7 | 7 | |
| 8 | 8 | delete_option( GeminiLabs\SiteReviews\Database\OptionManager::databaseKey() ); |
| 9 | 9 | delete_option( 'widget_'.glsr()->id.'_site-reviews' ); |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | public function defaults() |
| 14 | 14 | { |
| 15 | 15 | $settings = $this->settings(); |
| 16 | - return array_combine( array_keys( $settings ), array_column( $settings, 'default' )); |
|
| 16 | + return array_combine( array_keys( $settings ), array_column( $settings, 'default' ) ); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | /** |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | protected function normalize( array $settings ) |
| 54 | 54 | { |
| 55 | 55 | array_walk( $settings, function( &$setting ) { |
| 56 | - if( isset( $setting['default'] ))return; |
|
| 56 | + if( isset($setting['default']) )return; |
|
| 57 | 57 | $setting['default'] = ''; |
| 58 | 58 | }); |
| 59 | 59 | return $settings; |
@@ -59,9 +59,9 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | public function __call( $method, $args ) |
| 61 | 61 | { |
| 62 | - $instance = new static( $this->globals ); |
|
| 62 | + $instance = new static($this->globals); |
|
| 63 | 63 | $instance->setTagFromMethod( $method ); |
| 64 | - call_user_func_array( [$instance, 'normalize'], $args += ['',''] ); |
|
| 64 | + call_user_func_array( [$instance, 'normalize'], $args += ['', ''] ); |
|
| 65 | 65 | $tags = array_merge( static::TAGS_FORM, static::TAGS_STRUCTURE, static::TAGS_TEXT ); |
| 66 | 66 | $generatedTag = in_array( $instance->tag, $tags ) |
| 67 | 67 | ? $instance->buildTag() |
@@ -85,8 +85,8 @@ discard block |
||
| 85 | 85 | 'render' => 'is_bool', |
| 86 | 86 | 'tag' => 'is_string', |
| 87 | 87 | ]; |
| 88 | - if( !isset( $properties[$property] ) |
|
| 89 | - || empty( array_filter( [$value], $properties[$property] )) |
|
| 88 | + if( !isset($properties[$property]) |
|
| 89 | + || empty(array_filter( [$value], $properties[$property] )) |
|
| 90 | 90 | )return; |
| 91 | 91 | $this->$property = $value; |
| 92 | 92 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | public function getOpeningTag() |
| 106 | 106 | { |
| 107 | - $attributes = glsr( Attributes::class )->{$this->tag}( $this->args )->toString(); |
|
| 107 | + $attributes = glsr( Attributes::class )->{$this->tag}($this->args)->toString(); |
|
| 108 | 108 | return '<'.trim( $this->tag.' '.$attributes ).'>'; |
| 109 | 109 | } |
| 110 | 110 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | protected function buildCustomField() |
| 115 | 115 | { |
| 116 | 116 | $className = glsr( Helper::class )->buildClassName( $this->tag, __NAMESPACE__.'\Fields' ); |
| 117 | - if( !class_exists( $className )) { |
|
| 117 | + if( !class_exists( $className ) ) { |
|
| 118 | 118 | glsr_log()->error( 'Field missing: '.$className ); |
| 119 | 119 | return; |
| 120 | 120 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | */ |
| 127 | 127 | protected function buildDefaultTag( $text = '' ) |
| 128 | 128 | { |
| 129 | - if( empty( $text )) { |
|
| 129 | + if( empty($text) ) { |
|
| 130 | 130 | $text = $this->args['text']; |
| 131 | 131 | } |
| 132 | 132 | return $this->getOpeningTag().$text.$this->getClosingTag(); |
@@ -137,8 +137,8 @@ discard block |
||
| 137 | 137 | */ |
| 138 | 138 | protected function buildFieldDescription() |
| 139 | 139 | { |
| 140 | - if( empty( $this->args['description'] ))return; |
|
| 141 | - if( !empty( $this->globals['is_widget'] )) { |
|
| 140 | + if( empty($this->args['description']) )return; |
|
| 141 | + if( !empty($this->globals['is_widget']) ) { |
|
| 142 | 142 | return $this->small( $this->args['description'] ); |
| 143 | 143 | } |
| 144 | 144 | return $this->p( $this->args['description'], ['class' => 'description'] ); |
@@ -149,10 +149,10 @@ discard block |
||
| 149 | 149 | */ |
| 150 | 150 | protected function buildFormInput() |
| 151 | 151 | { |
| 152 | - if( !in_array( $this->args['type'], ['checkbox', 'radio'] )) { |
|
| 152 | + if( !in_array( $this->args['type'], ['checkbox', 'radio'] ) ) { |
|
| 153 | 153 | return $this->buildFormLabel().$this->getOpeningTag(); |
| 154 | 154 | } |
| 155 | - return empty( $this->args['options'] ) |
|
| 155 | + return empty($this->args['options']) |
|
| 156 | 156 | ? $this->buildFormInputChoice() |
| 157 | 157 | : $this->buildFormInputMultiChoice(); |
| 158 | 158 | } |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | protected function buildFormInputMultiChoice() |
| 172 | 172 | { |
| 173 | 173 | if( $this->args['type'] == 'checkbox' ) { |
| 174 | - $this->args['name'].= '[]'; |
|
| 174 | + $this->args['name'] .= '[]'; |
|
| 175 | 175 | } |
| 176 | 176 | // glsr_log( $this->args ); |
| 177 | 177 | $options = array_reduce( array_keys( $this->args['options'] ), function( $carry, $key ) { |
@@ -180,12 +180,12 @@ discard block |
||
| 180 | 180 | 'name' => $this->args['name'], |
| 181 | 181 | 'text' => $this->args['options'][$key], |
| 182 | 182 | 'value' => $key, |
| 183 | - ])); |
|
| 183 | + ]) ); |
|
| 184 | 184 | }); |
| 185 | 185 | return $this->ul( $options, [ |
| 186 | 186 | 'class' => $this->args['class'], |
| 187 | 187 | 'id' => $this->args['id'], |
| 188 | - ]); |
|
| 188 | + ] ); |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | /** |
@@ -193,11 +193,11 @@ discard block |
||
| 193 | 193 | */ |
| 194 | 194 | protected function buildFormLabel() |
| 195 | 195 | { |
| 196 | - if( empty( $this->args['label'] ) || $this->args['type'] == 'hidden' )return; |
|
| 197 | - return $this->label([ |
|
| 196 | + if( empty($this->args['label']) || $this->args['type'] == 'hidden' )return; |
|
| 197 | + return $this->label( [ |
|
| 198 | 198 | 'for' => $this->args['id'], |
| 199 | 199 | 'text' => $this->args['label'], |
| 200 | - ]); |
|
| 200 | + ] ); |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | /** |
@@ -214,11 +214,11 @@ discard block |
||
| 214 | 214 | protected function buildFormSelectOptions() |
| 215 | 215 | { |
| 216 | 216 | return array_reduce( array_keys( $this->args['options'] ), function( $carry, $key ) { |
| 217 | - return $carry.$this->option([ |
|
| 217 | + return $carry.$this->option( [ |
|
| 218 | 218 | 'selected' => $this->args['value'] == $key, |
| 219 | 219 | 'text' => $this->args['options'][$key], |
| 220 | 220 | 'value' => $key, |
| 221 | - ]); |
|
| 221 | + ] ); |
|
| 222 | 222 | }); |
| 223 | 223 | } |
| 224 | 224 | |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | */ |
| 236 | 236 | protected function buildTag() |
| 237 | 237 | { |
| 238 | - if( !in_array( $this->tag, static::TAGS_FORM )) { |
|
| 238 | + if( !in_array( $this->tag, static::TAGS_FORM ) ) { |
|
| 239 | 239 | return $this->buildDefaultTag(); |
| 240 | 240 | } |
| 241 | 241 | return call_user_func( [$this, 'buildForm'.ucfirst( $this->tag )] ).$this->buildFieldDescription(); |
@@ -247,13 +247,13 @@ discard block |
||
| 247 | 247 | */ |
| 248 | 248 | protected function normalize( ...$params ) |
| 249 | 249 | { |
| 250 | - if( is_string( $params[0] ) || is_numeric( $params[0] )) { |
|
| 250 | + if( is_string( $params[0] ) || is_numeric( $params[0] ) ) { |
|
| 251 | 251 | $this->setNameOrTextAttributeForTag( $params[0] ); |
| 252 | 252 | } |
| 253 | - if( is_array( $params[0] )) { |
|
| 253 | + if( is_array( $params[0] ) ) { |
|
| 254 | 254 | $this->args += $params[0]; |
| 255 | 255 | } |
| 256 | - else if( is_array( $params[1] )) { |
|
| 256 | + else if( is_array( $params[1] ) ) { |
|
| 257 | 257 | $this->args += $params[1]; |
| 258 | 258 | } |
| 259 | 259 | $this->args = glsr( BuilderDefaults::class )->merge( $this->args ); |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | protected function setTagFromMethod( $method ) |
| 279 | 279 | { |
| 280 | 280 | $this->tag = strtolower( $method ); |
| 281 | - if( in_array( $this->tag, static::INPUT_TYPES )) { |
|
| 281 | + if( in_array( $this->tag, static::INPUT_TYPES ) ) { |
|
| 282 | 282 | $this->args['type'] = $this->tag; |
| 283 | 283 | $this->tag = 'input'; |
| 284 | 284 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | 'is_multi' => false, |
| 24 | 24 | 'is_valid' => true, |
| 25 | 25 | 'path' => '', |
| 26 | - ]); |
|
| 26 | + ] ); |
|
| 27 | 27 | $this->normalize(); |
| 28 | 28 | } |
| 29 | 29 | |
@@ -40,10 +40,10 @@ discard block |
||
| 40 | 40 | return glsr( Template::class )->build( 'partials/settings/form-table-row', [ |
| 41 | 41 | 'context' => [ |
| 42 | 42 | 'class' => $this->getFieldClass(), |
| 43 | - 'field' => glsr( Builder::class )->{$this->field['type']}( $this->field ), |
|
| 43 | + 'field' => glsr( Builder::class )->{$this->field['type']}($this->field), |
|
| 44 | 44 | 'label' => glsr( Builder::class )->label( $this->field['legend'], ['for' => $this->field['id']] ), |
| 45 | 45 | ], |
| 46 | - ]); |
|
| 46 | + ] ); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -63,11 +63,11 @@ discard block |
||
| 63 | 63 | 'context' => [ |
| 64 | 64 | 'class' => $this->getFieldClass(), |
| 65 | 65 | 'depends_on' => $this->getFieldDependsOn(), |
| 66 | - 'field' => glsr( Builder::class )->{$this->field['type']}( $this->field ), |
|
| 66 | + 'field' => glsr( Builder::class )->{$this->field['type']}($this->field), |
|
| 67 | 67 | 'label' => glsr( Builder::class )->label( $this->field['legend'], ['for' => $this->field['id']] ), |
| 68 | 68 | 'legend' => $this->field['legend'], |
| 69 | 69 | ], |
| 70 | - ]); |
|
| 70 | + ] ); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | /** |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | protected function getFieldDefault() |
| 87 | 87 | { |
| 88 | - return isset( $this->field['default'] ) |
|
| 88 | + return isset($this->field['default']) |
|
| 89 | 89 | ? $this->field['default'] |
| 90 | 90 | : ''; |
| 91 | 91 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | */ |
| 96 | 96 | protected function getFieldDependsOn() |
| 97 | 97 | { |
| 98 | - return !empty( $this->field['depends_on'] ) |
|
| 98 | + return !empty($this->field['depends_on']) |
|
| 99 | 99 | ? $this->field['depends_on'] |
| 100 | 100 | : ''; |
| 101 | 101 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | $path, |
| 112 | 112 | glsr( Helper::class )->getPathValue( $path, glsr()->defaults ) |
| 113 | 113 | ); |
| 114 | - if( is_array( $expectedValue )) { |
|
| 114 | + if( is_array( $expectedValue ) ) { |
|
| 115 | 115 | return !in_array( $optionValue, $expectedValue ); |
| 116 | 116 | } |
| 117 | 117 | return $optionValue != $expectedValue; |
@@ -128,13 +128,13 @@ discard block |
||
| 128 | 128 | 'label', 'name', 'type', |
| 129 | 129 | ]; |
| 130 | 130 | foreach( $requiredValues as $value ) { |
| 131 | - if( isset( $this->field[$value] ))continue; |
|
| 131 | + if( isset($this->field[$value]) )continue; |
|
| 132 | 132 | $missingValues[] = $value; |
| 133 | 133 | $isValid = $this->field['is_valid'] = false; |
| 134 | 134 | } |
| 135 | - if( !empty( $missingValues )) { |
|
| 135 | + if( !empty($missingValues) ) { |
|
| 136 | 136 | glsr_log() |
| 137 | - ->warning( 'Field is missing: '.implode( ', ', $missingValues )) |
|
| 137 | + ->warning( 'Field is missing: '.implode( ', ', $missingValues ) ) |
|
| 138 | 138 | ->info( $this->field ); |
| 139 | 139 | } |
| 140 | 140 | return $isValid; |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $field = $this->field; |
| 150 | 150 | foreach( $field as $key => $value ) { |
| 151 | 151 | $methodName = glsr( Helper::class )->buildMethodName( $key, 'normalize' ); |
| 152 | - if( !method_exists( $this, $methodName ))continue; |
|
| 152 | + if( !method_exists( $this, $methodName ) )continue; |
|
| 153 | 153 | $this->$methodName(); |
| 154 | 154 | } |
| 155 | 155 | $this->normalizeFieldId(); |
@@ -162,13 +162,13 @@ discard block |
||
| 162 | 162 | */ |
| 163 | 163 | protected function normalizeDependsOn() |
| 164 | 164 | { |
| 165 | - if( empty( $this->field['depends_on'] ) || !is_array( $this->field['depends_on'] ))return; |
|
| 165 | + if( empty($this->field['depends_on']) || !is_array( $this->field['depends_on'] ) )return; |
|
| 166 | 166 | $path = key( $this->field['depends_on'] ); |
| 167 | 167 | $value = $this->field['depends_on'][$path]; |
| 168 | - $this->field['depends_on'] = json_encode([ |
|
| 168 | + $this->field['depends_on'] = json_encode( [ |
|
| 169 | 169 | 'name' => glsr( Helper::class )->convertPathToName( $path, OptionManager::databaseKey() ), |
| 170 | 170 | 'value' => $value, |
| 171 | - ], JSON_HEX_APOS|JSON_HEX_QUOT ); |
|
| 171 | + ], JSON_HEX_APOS | JSON_HEX_QUOT ); |
|
| 172 | 172 | $this->field['is_hidden'] = $this->isFieldHidden( $path, $value ); |
| 173 | 173 | } |
| 174 | 174 | |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | */ |
| 178 | 178 | protected function normalizeFieldId() |
| 179 | 179 | { |
| 180 | - if( isset( $this->field['id'] ))return; |
|
| 180 | + if( isset($this->field['id']) )return; |
|
| 181 | 181 | $this->field['id'] = glsr( Helper::class )->convertNameToId( $this->field['name'] ); |
| 182 | 182 | } |
| 183 | 183 | |
@@ -187,10 +187,10 @@ discard block |
||
| 187 | 187 | protected function normalizeFieldType() |
| 188 | 188 | { |
| 189 | 189 | $className = glsr( Helper::class )->buildClassName( $this->field['type'], 'Modules\Html\Fields' ); |
| 190 | - if( class_exists( $className )) { |
|
| 190 | + if( class_exists( $className ) ) { |
|
| 191 | 191 | $this->field = array_merge( $this->field, glsr( $className )->defaults() ); |
| 192 | 192 | } |
| 193 | - if( in_array( $this->field['type'], static::MULTI_FIELD_TYPES )) { |
|
| 193 | + if( in_array( $this->field['type'], static::MULTI_FIELD_TYPES ) ) { |
|
| 194 | 194 | $this->field['is_multi'] = true; |
| 195 | 195 | } |
| 196 | 196 | } |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | */ |
| 201 | 201 | protected function normalizeFieldValue() |
| 202 | 202 | { |
| 203 | - if( isset( $this->field['value'] ))return; |
|
| 203 | + if( isset($this->field['value']) )return; |
|
| 204 | 204 | $this->field['value'] = glsr( OptionManager::class )->get( |
| 205 | 205 | $this->field['path'], |
| 206 | 206 | $this->getFieldDefault() |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | protected function normalizeLabel() |
| 214 | 214 | { |
| 215 | 215 | $this->field['legend'] = $this->field['label']; |
| 216 | - unset( $this->field['label'] ); |
|
| 216 | + unset($this->field['label']); |
|
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | /** |
@@ -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 ); |
| 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( 'translations', $key ) && $helper->endsWith( 'id', $key ))continue; |
|
| 163 | - $value = htmlspecialchars( trim( preg_replace('/\s\s+/', '\\n', $value )), ENT_QUOTES, 'UTF-8' ); |
|
| 162 | + if( $helper->startsWith( 'translations', $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; |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | return $value; |
| 241 | 241 | } |
| 242 | 242 | } |
| 243 | - return implode( ',', array_filter( [DB_HOST, $serverName] )); |
|
| 243 | + return implode( ',', array_filter( [DB_HOST, $serverName] ) ); |
|
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | /** |
@@ -261,8 +261,8 @@ discard block |
||
| 261 | 261 | { |
| 262 | 262 | $plugins = get_plugins(); |
| 263 | 263 | $activePlugins = (array)get_option( 'active_plugins', [] ); |
| 264 | - $inactive = $this->normalizePluginList( array_diff_key( $plugins, array_flip( $activePlugins ))); |
|
| 265 | - $active = $this->normalizePluginList( array_diff_key( $plugins, $inactive )); |
|
| 264 | + $inactive = $this->normalizePluginList( array_diff_key( $plugins, array_flip( $activePlugins ) ) ); |
|
| 265 | + $active = $this->normalizePluginList( array_diff_key( $plugins, $inactive ) ); |
|
| 266 | 266 | return $active + $inactive; |
| 267 | 267 | } |
| 268 | 268 | |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | protected function implode( $title, array $details ) |
| 274 | 274 | { |
| 275 | 275 | $strings = ['['.$title.']']; |
| 276 | - $padding = max( array_map( 'strlen', array_keys( $details )) ); |
|
| 276 | + $padding = max( array_map( 'strlen', array_keys( $details ) ) ); |
|
| 277 | 277 | $padding = max( [$padding, static::PAD] ); |
| 278 | 278 | foreach( $details as $key => $value ) { |
| 279 | 279 | $strings[] = is_string( $key ) |