@@ -2,7 +2,7 @@ |
||
| 2 | 2 | <td class="glsr-string-td1 column-primary"> |
| 3 | 3 | <p>{{ data.s1 }}</p> |
| 4 | 4 | <p class="row-actions"> |
| 5 | - <span class="delete"><a href="#{{ data.index }}" class="delete" aria-label="<?= __( 'Delete translation string', 'site-reviews' );?>"><?= __( 'Delete', 'site-reviews' ); ?></a></span> |
|
| 5 | + <span class="delete"><a href="#{{ data.index }}" class="delete" aria-label="<?= __( 'Delete translation string', 'site-reviews' ); ?>"><?= __( 'Delete', 'site-reviews' ); ?></a></span> |
|
| 6 | 6 | </p> |
| 7 | 7 | <button type="button" class="toggle-row"> |
| 8 | 8 | <span class="screen-reader-text"><?= __( 'Show custom translation', 'site-reviews' ); ?></span> |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | </ul> |
| 21 | 21 | </div> |
| 22 | 22 | |
| 23 | - <?php if( current_user_can( $taxonomy->cap->edit_terms )) : ?> |
|
| 23 | + <?php if( current_user_can( $taxonomy->cap->edit_terms ) ) : ?> |
|
| 24 | 24 | <div id="<?= $tax_name; ?>-adder" class="wp-hidden-children"> |
| 25 | 25 | <a id="<?= $tax_name; ?>-add-toggle" href="#<?= $tax_name; ?>-add" class="hide-if-no-js taxonomy-add-new"> |
| 26 | 26 | <?= sprintf( '+ %s', $taxonomy->labels->add_new_item ); ?> |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | <label class="screen-reader-text" for="new<?= $tax_name; ?>"><?= $taxonomy->labels->add_new_item; ?></label> |
| 30 | 30 | <input type="text" name="new<?= $tax_name; ?>" id="new<?= $tax_name; ?>" class="form-required form-input-tip" value="<?= esc_attr( $taxonomy->labels->new_item_name ); ?>" aria-required="true"/> |
| 31 | 31 | <input type="button" id="<?= $tax_name; ?>-add-submit" data-wp-lists="add:<?= $tax_name; ?>checklist:<?= $tax_name; ?>-add" class="button category-add-submit" value="<?= esc_attr( $taxonomy->labels->add_new_item ); ?>" /> |
| 32 | - <?php wp_nonce_field( 'add-' . $tax_name, '_ajax_nonce-add-' . $tax_name, false ); ?> |
|
| 32 | + <?php wp_nonce_field( 'add-'.$tax_name, '_ajax_nonce-add-'.$tax_name, false ); ?> |
|
| 33 | 33 | <span id="<?= $tax_name; ?>-ajax-response"></span> |
| 34 | 34 | </div> |
| 35 | 35 | </div> |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php defined( 'WPINC' ) || die; |
| 2 | 2 | |
| 3 | -include trailingslashit(__DIR__).'header.php'; |
|
| 4 | -include trailingslashit(__DIR__).'body.php'; |
|
| 5 | -include trailingslashit(__DIR__).'footer.php'; |
|
| 3 | +include trailingslashit( __DIR__ ).'header.php'; |
|
| 4 | +include trailingslashit( __DIR__ ).'body.php'; |
|
| 5 | +include trailingslashit( __DIR__ ).'footer.php'; |
|
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | $this->message = $this->buildHtmlMessage( $email ); |
| 44 | 44 | $this->subject = $email['subject']; |
| 45 | 45 | $this->to = $email['to']; |
| 46 | - add_action( 'phpmailer_init', [ $this, 'buildPlainTextMessage'] ); |
|
| 46 | + add_action( 'phpmailer_init', [$this, 'buildPlainTextMessage'] ); |
|
| 47 | 47 | return $this; |
| 48 | 48 | } |
| 49 | 49 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | */ |
| 84 | 84 | public function buildPlainTextMessage( $phpmailer ) |
| 85 | 85 | { |
| 86 | - if( $phpmailer->ContentType === 'text/plain' || !empty( $phpmailer->AltBody ))return; |
|
| 86 | + if( $phpmailer->ContentType === 'text/plain' || !empty($phpmailer->AltBody) )return; |
|
| 87 | 87 | $message = $this->stripHtmlTags( $phpmailer->Body ); |
| 88 | 88 | $phpmailer->AltBody = apply_filters( 'site-reviews/email/message', $message, 'text', $this ); |
| 89 | 89 | } |
@@ -99,10 +99,10 @@ discard block |
||
| 99 | 99 | 'from', |
| 100 | 100 | 'reply-to', |
| 101 | 101 | ]; |
| 102 | - $headers = array_intersect_key( $email, array_flip( $allowed )); |
|
| 102 | + $headers = array_intersect_key( $email, array_flip( $allowed ) ); |
|
| 103 | 103 | $headers = array_filter( $headers ); |
| 104 | 104 | foreach( $headers as $key => $value ) { |
| 105 | - unset( $headers[ $key ] ); |
|
| 105 | + unset($headers[$key]); |
|
| 106 | 106 | $headers[] = "{$key}: {$value}"; |
| 107 | 107 | } |
| 108 | 108 | $headers[] = 'Content-Type: text/html'; |
@@ -114,16 +114,16 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | protected function buildHtmlMessage( $email ) |
| 116 | 116 | { |
| 117 | - $template = trim( glsr( OptionManager::class )->get( 'settings.general.notification_message' )); |
|
| 118 | - if( !empty( $template )) { |
|
| 117 | + $template = trim( glsr( OptionManager::class )->get( 'settings.general.notification_message' ) ); |
|
| 118 | + if( !empty($template) ) { |
|
| 119 | 119 | $message = glsr( Template::class )->interpolate( $template, $email['template-tags'] ); |
| 120 | 120 | } |
| 121 | 121 | else if( $email['template'] ) { |
| 122 | 122 | $message = glsr( Template::class )->build( 'templates/'.$email['template'], [ |
| 123 | 123 | 'context' => $email['template-tags'], |
| 124 | - ]); |
|
| 124 | + ] ); |
|
| 125 | 125 | } |
| 126 | - if( !isset( $message )) { |
|
| 126 | + if( !isset($message) ) { |
|
| 127 | 127 | $message = $email['message']; |
| 128 | 128 | } |
| 129 | 129 | $message = $email['before'].$message.$email['after']; |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | $message = str_replace( ']]>', ']]>', $message ); |
| 135 | 135 | $message = glsr( Template::class )->build( 'partials/email/index', [ |
| 136 | 136 | 'context' => ['message' => $message], |
| 137 | - ]); |
|
| 137 | + ] ); |
|
| 138 | 138 | return apply_filters( 'site-reviews/email/message', stripslashes( $message ), 'html', $this ); |
| 139 | 139 | } |
| 140 | 140 | |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | 'to' => '', |
| 161 | 161 | ]; |
| 162 | 162 | $email = shortcode_atts( $defaults, $email ); |
| 163 | - if( empty( $email['reply-to'] )) { |
|
| 163 | + if( empty($email['reply-to']) ) { |
|
| 164 | 164 | $email['reply-to'] = $email['from']; |
| 165 | 165 | } |
| 166 | 166 | return apply_filters( 'site-reviews/email/compose', $email, $this ); |
@@ -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' ); |
@@ -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 | /** |
@@ -21,11 +21,11 @@ discard block |
||
| 21 | 21 | return $input; |
| 22 | 22 | } |
| 23 | 23 | $triggered = true; |
| 24 | - if( !is_array( $input )) { |
|
| 24 | + if( !is_array( $input ) ) { |
|
| 25 | 25 | $input = ['settings' => []]; |
| 26 | 26 | } |
| 27 | 27 | if( key( $input ) == 'settings' ) { |
| 28 | - glsr( Notice::class )->addSuccess( __( 'Settings updated.', 'site-reviews' )); |
|
| 28 | + glsr( Notice::class )->addSuccess( __( 'Settings updated.', 'site-reviews' ) ); |
|
| 29 | 29 | } |
| 30 | 30 | $options = array_replace_recursive( glsr( OptionManager::class )->all(), $input ); |
| 31 | 31 | $options = $this->sanitizeSubmissions( $input, $options ); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | { |
| 42 | 42 | register_setting( Application::ID.'-settings', OptionManager::databaseKey(), [ |
| 43 | 43 | 'sanitize_callback' => [$this, 'callbackRegisterSettings'], |
| 44 | - ]); |
|
| 44 | + ] ); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -49,9 +49,9 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | protected function sanitizeSubmissions( array $input, array $options ) |
| 51 | 51 | { |
| 52 | - if( isset( $input['settings']['submissions'] )) { |
|
| 52 | + if( isset($input['settings']['submissions']) ) { |
|
| 53 | 53 | $inputForm = $input['settings']['submissions']; |
| 54 | - $options['settings']['submissions']['required'] = isset( $inputForm['required'] ) |
|
| 54 | + $options['settings']['submissions']['required'] = isset($inputForm['required']) |
|
| 55 | 55 | ? $inputForm['required'] |
| 56 | 56 | : []; |
| 57 | 57 | } |
@@ -63,13 +63,13 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | protected function sanitizeTranslations( array $input, array $options ) |
| 65 | 65 | { |
| 66 | - if( isset( $input['settings']['strings'] )) { |
|
| 67 | - $options['settings']['strings'] = array_values( array_filter( $input['settings']['strings'] )); |
|
| 66 | + if( isset($input['settings']['strings']) ) { |
|
| 67 | + $options['settings']['strings'] = array_values( array_filter( $input['settings']['strings'] ) ); |
|
| 68 | 68 | array_walk( $options['settings']['strings'], function( &$string ) { |
| 69 | - if( isset( $string['s2'] )) { |
|
| 69 | + if( isset($string['s2']) ) { |
|
| 70 | 70 | $string['s2'] = wp_strip_all_tags( $string['s2'] ); |
| 71 | 71 | } |
| 72 | - if( isset( $string['p2'] )) { |
|
| 72 | + if( isset($string['p2']) ) { |
|
| 73 | 73 | $string['p2'] = wp_strip_all_tags( $string['p2'] ); |
| 74 | 74 | } |
| 75 | 75 | }); |
@@ -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; |
@@ -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 ) |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | : $this->$method( $id ); |
| 24 | 24 | return glsr( Template::class )->build( 'pages/settings/'.$id, [ |
| 25 | 25 | 'context' => $context, |
| 26 | - ]); |
|
| 26 | + ] ); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /** |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | protected function getSettingFields( $path ) |
| 42 | 42 | { |
| 43 | 43 | $settings = glsr( DefaultsManager::class )->settings(); |
| 44 | - return array_filter( $settings, function( $key ) use( $path ) { |
|
| 44 | + return array_filter( $settings, function( $key ) use($path) { |
|
| 45 | 45 | return glsr( Helper::class )->startsWith( $path, $key ); |
| 46 | 46 | }, ARRAY_FILTER_USE_KEY ); |
| 47 | 47 | } |
@@ -52,11 +52,11 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | protected function getTemplateContext( $id ) |
| 54 | 54 | { |
| 55 | - $fields = $this->getSettingFields( $this->normalizeSettingPath( $id )); |
|
| 55 | + $fields = $this->getSettingFields( $this->normalizeSettingPath( $id ) ); |
|
| 56 | 56 | $rows = ''; |
| 57 | 57 | foreach( $fields as $name => $field ) { |
| 58 | 58 | $field = wp_parse_args( $field, ['name' => $name] ); |
| 59 | - $rows.= (new Field( $field ))->build(); |
|
| 59 | + $rows .= (new Field( $field ))->build(); |
|
| 60 | 60 | } |
| 61 | 61 | return [ |
| 62 | 62 | 'rows' => $rows, |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | protected function getTemplateContextForTranslations() |
| 70 | 70 | { |
| 71 | 71 | $translations = glsr( Translator::class )->renderAll(); |
| 72 | - $class = empty( $translations ) |
|
| 72 | + $class = empty($translations) |
|
| 73 | 73 | ? 'glsr-hidden' |
| 74 | 74 | : ''; |
| 75 | 75 | return [ |