@@ -26,6 +26,6 @@ |
||
26 | 26 | */ |
27 | 27 | |
28 | 28 | // If uninstall not called from WordPress, then exit. |
29 | -if (! defined('WP_UNINSTALL_PLUGIN')) { |
|
29 | +if (!defined('WP_UNINSTALL_PLUGIN')) { |
|
30 | 30 | exit; |
31 | 31 | } |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function __construct() |
51 | 51 | { |
52 | - $this->actions = []; |
|
53 | - $this->filters = []; |
|
52 | + $this->actions=[ ]; |
|
53 | + $this->filters=[ ]; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | * @param int $priority Optional. The priority at which the function should be fired. Default is 10. |
65 | 65 | * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1. |
66 | 66 | */ |
67 | - public function add_action($hook, $component, $callback, $priority = 10, $accepted_args = 1) |
|
67 | + public function add_action($hook, $component, $callback, $priority=10, $accepted_args=1) |
|
68 | 68 | { |
69 | - $this->actions = $this->add($this->actions, $hook, $component, $callback, $priority, $accepted_args); |
|
69 | + $this->actions=$this->add($this->actions, $hook, $component, $callback, $priority, $accepted_args); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | private function add($hooks, $hook, $component, $callback, $priority, $accepted_args) |
89 | 89 | { |
90 | - $hooks[] = [ |
|
90 | + $hooks[ ]=[ |
|
91 | 91 | 'hook' => $hook, |
92 | 92 | 'component' => $component, |
93 | 93 | 'callback' => $callback, |
@@ -109,9 +109,9 @@ discard block |
||
109 | 109 | * @param int $priority Optional. The priority at which the function should be fired. Default is 10. |
110 | 110 | * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1 |
111 | 111 | */ |
112 | - public function add_filter($hook, $component, $callback, $priority = 10, $accepted_args = 1) |
|
112 | + public function add_filter($hook, $component, $callback, $priority=10, $accepted_args=1) |
|
113 | 113 | { |
114 | - $this->filters = $this->add($this->filters, $hook, $component, $callback, $priority, $accepted_args); |
|
114 | + $this->filters=$this->add($this->filters, $hook, $component, $callback, $priority, $accepted_args); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -122,13 +122,13 @@ discard block |
||
122 | 122 | public function run() |
123 | 123 | { |
124 | 124 | foreach ($this->filters as $hook) { |
125 | - add_filter($hook['hook'], [ $hook['component'], $hook['callback'] ], $hook['priority'], |
|
126 | - $hook['accepted_args']); |
|
125 | + add_filter($hook[ 'hook' ], [ $hook[ 'component' ], $hook[ 'callback' ] ], $hook[ 'priority' ], |
|
126 | + $hook[ 'accepted_args' ]); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | foreach ($this->actions as $hook) { |
130 | - add_action($hook['hook'], [ $hook['component'], $hook['callback'] ], $hook['priority'], |
|
131 | - $hook['accepted_args']); |
|
130 | + add_action($hook[ 'hook' ], [ $hook[ 'component' ], $hook[ 'callback' ] ], $hook[ 'priority' ], |
|
131 | + $hook[ 'accepted_args' ]); |
|
132 | 132 | } |
133 | 133 | } |
134 | 134 | } |
@@ -36,11 +36,11 @@ |
||
36 | 36 | |
37 | 37 | flush_rewrite_rules(); |
38 | 38 | |
39 | - $opts = []; |
|
40 | - $options = WordPress_Security_Txt_Admin::get_options_list(); |
|
39 | + $opts=[ ]; |
|
40 | + $options=WordPress_Security_Txt_Admin::get_options_list(); |
|
41 | 41 | |
42 | 42 | foreach ($options as $option) { |
43 | - $opts[ $option[0] ] = $option[2]; |
|
43 | + $opts[ $option[ 0 ] ]=$option[ 2 ]; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | update_option('wordpress-security-txt-options', $opts); |
@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function __construct($plugin_name, $version) |
60 | 60 | { |
61 | - $this->plugin_name = $plugin_name; |
|
62 | - $this->version = $version; |
|
63 | - $this->options = $this::get_options($plugin_name); |
|
61 | + $this->plugin_name=$plugin_name; |
|
62 | + $this->version=$version; |
|
63 | + $this->options=$this::get_options($plugin_name); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * |
69 | 69 | * @param string $plugin_name The name of the plugin. |
70 | 70 | */ |
71 | - public static function get_options($plugin_name = 'wordpress-security-txt') |
|
71 | + public static function get_options($plugin_name='wordpress-security-txt') |
|
72 | 72 | { |
73 | 73 | return get_option($plugin_name . '-options'); |
74 | 74 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public function enqueue_styles() |
82 | 82 | { |
83 | - wp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__) . 'css/' . $this->plugin_name . '-admin.css', [], |
|
83 | + wp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__) . 'css/' . $this->plugin_name . '-admin.css', [ ], |
|
84 | 84 | $this->version, 'all'); |
85 | 85 | } |
86 | 86 | |
@@ -93,14 +93,14 @@ discard block |
||
93 | 93 | { |
94 | 94 | wp_enqueue_script($this->plugin_name . '-repeater', |
95 | 95 | plugin_dir_url(__FILE__) . 'js/' . $this->plugin_name . '-repeater.min.js', |
96 | - ['jquery', 'jquery-ui-core', 'jquery-ui-sortable'], $this->version, true); |
|
96 | + [ 'jquery', 'jquery-ui-core', 'jquery-ui-sortable' ], $this->version, true); |
|
97 | 97 | |
98 | 98 | wp_enqueue_script($this->plugin_name . '-validator', |
99 | 99 | plugin_dir_url(__FILE__) . 'js/' . $this->plugin_name . '-validator.js', |
100 | - ['jquery'], $this->version, true); |
|
100 | + [ 'jquery' ], $this->version, true); |
|
101 | 101 | |
102 | 102 | wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/' . $this->plugin_name . '-admin.js', |
103 | - ['jquery'], $this->version, true); |
|
103 | + [ 'jquery' ], $this->version, true); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -112,13 +112,13 @@ discard block |
||
112 | 112 | { |
113 | 113 | add_options_page( |
114 | 114 | __('security.txt', $this->plugin_name), __('security.txt', $this->plugin_name), |
115 | - 'manage_options', $this->plugin_name, [$this, 'display_settings_page'] |
|
115 | + 'manage_options', $this->plugin_name, [ $this, 'display_settings_page' ] |
|
116 | 116 | ); |
117 | 117 | |
118 | 118 | add_submenu_page( |
119 | 119 | 'options-general.php', |
120 | 120 | __('security.txt Help', $this->plugin_name), __('security.txt Help', $this->plugin_name), |
121 | - 'manage_options', $this->plugin_name . '-help', [$this, 'display_help_page'] |
|
121 | + 'manage_options', $this->plugin_name . '-help', [ $this, 'display_help_page' ] |
|
122 | 122 | ); |
123 | 123 | |
124 | 124 | remove_submenu_page('options-general.php', 'wordpress-security-txt-help'); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | add_settings_section( |
158 | 158 | $this->plugin_name . '-general', |
159 | 159 | apply_filters($this->plugin_name . 'section-title-general', esc_html__('General', $this->plugin_name)), |
160 | - [$this, 'section_general'], |
|
160 | + [ $this, 'section_general' ], |
|
161 | 161 | $this->plugin_name |
162 | 162 | ); |
163 | 163 | |
@@ -165,21 +165,21 @@ discard block |
||
165 | 165 | $this->plugin_name . '-directives', |
166 | 166 | apply_filters($this->plugin_name . 'section-title-directives', |
167 | 167 | esc_html__('Directives', $this->plugin_name)), |
168 | - [$this, 'section_directives'], |
|
168 | + [ $this, 'section_directives' ], |
|
169 | 169 | $this->plugin_name |
170 | 170 | ); |
171 | 171 | |
172 | 172 | add_settings_section( |
173 | 173 | $this->plugin_name . '-library', |
174 | 174 | apply_filters($this->plugin_name . 'section-title-library', esc_html__('Library', $this->plugin_name)), |
175 | - [$this, 'section_library'], |
|
175 | + [ $this, 'section_library' ], |
|
176 | 176 | $this->plugin_name |
177 | 177 | ); |
178 | 178 | |
179 | 179 | add_settings_section( |
180 | 180 | $this->plugin_name . '-debug', |
181 | 181 | apply_filters($this->plugin_name . 'section-title-debug', esc_html__('Debug', $this->plugin_name)), |
182 | - [$this, 'section_debug'], |
|
182 | + [ $this, 'section_debug' ], |
|
183 | 183 | $this->plugin_name |
184 | 184 | ); |
185 | 185 | } |
@@ -261,9 +261,9 @@ discard block |
||
261 | 261 | public function register_settings() |
262 | 262 | { |
263 | 263 | register_setting( |
264 | - $this->plugin_name,// . '-options', |
|
264 | + $this->plugin_name, // . '-options', |
|
265 | 265 | $this->plugin_name . '-options', |
266 | - [$this, 'validate_options'] |
|
266 | + [ $this, 'validate_options' ] |
|
267 | 267 | ); |
268 | 268 | } |
269 | 269 | |
@@ -271,17 +271,17 @@ discard block |
||
271 | 271 | { |
272 | 272 | WordPress_Security_Txt_Public::cache_clear(); |
273 | 273 | |
274 | - $valid = []; |
|
275 | - $options = $this->get_options_list(); |
|
274 | + $valid=[ ]; |
|
275 | + $options=$this->get_options_list(); |
|
276 | 276 | |
277 | 277 | foreach ($options as $option) { |
278 | - $name = $option[0]; |
|
279 | - $type = $option[1]; |
|
278 | + $name=$option[ 0 ]; |
|
279 | + $type=$option[ 1 ]; |
|
280 | 280 | |
281 | - if ($type == 'repeater' && is_array($option[2])) { |
|
281 | + if ($type == 'repeater' && is_array($option[ 2 ])) { |
|
282 | 282 | $this->validate_repeater($input, $valid); |
283 | 283 | } else { |
284 | - $valid[$option[0]] = $this->sanitizer($type, isset($input[$name]) ? $input[$name] : null); |
|
284 | + $valid[ $option[ 0 ] ]=$this->sanitizer($type, isset($input[ $name ]) ? $input[ $name ] : null); |
|
285 | 285 | } |
286 | 286 | } |
287 | 287 | |
@@ -290,22 +290,22 @@ discard block |
||
290 | 290 | |
291 | 291 | private function validate_repeater($input, &$valid) |
292 | 292 | { |
293 | - $clean = []; |
|
293 | + $clean=[ ]; |
|
294 | 294 | |
295 | - foreach ($option[2] as $field) { |
|
296 | - foreach ($input[$field[0]] as $data) { |
|
295 | + foreach ($option[ 2 ] as $field) { |
|
296 | + foreach ($input[ $field[ 0 ] ] as $data) { |
|
297 | 297 | if (!empty($data)) { |
298 | - $clean[$field[0]][] = $this->sanitizer($field[1], $data); |
|
298 | + $clean[ $field[ 0 ] ][ ]=$this->sanitizer($field[ 1 ], $data); |
|
299 | 299 | } |
300 | 300 | } |
301 | 301 | } |
302 | 302 | |
303 | - $count = 10; |
|
303 | + $count=10; |
|
304 | 304 | |
305 | - for ($i = 0; $i < $count; $i++) { |
|
305 | + for ($i=0; $i < $count; $i++) { |
|
306 | 306 | foreach ($clean as $field_name => $field) { |
307 | - if (isset($valid[$option[0]][$i])) { |
|
308 | - $valid[$option[0]][$i][$field_name] = $field[$i]; |
|
307 | + if (isset($valid[ $option[ 0 ] ][ $i ])) { |
|
308 | + $valid[ $option[ 0 ] ][ $i ][ $field_name ]=$field[ $i ]; |
|
309 | 309 | } |
310 | 310 | } |
311 | 311 | } |
@@ -318,19 +318,19 @@ discard block |
||
318 | 318 | */ |
319 | 319 | public static function get_options_list() |
320 | 320 | { |
321 | - $options = []; |
|
322 | - |
|
323 | - $options[] = ['enable', 'checkbox', true]; |
|
324 | - $options[] = ['redirect', 'checkbox', true]; |
|
325 | - $options[] = ['menu', 'checkbox', true]; |
|
326 | - $options[] = ['contact', 'text', get_bloginfo('admin_email')]; |
|
327 | - $options[] = ['encryption', 'textarea', null]; |
|
328 | - $options[] = ['acknowledgement', 'text', null]; |
|
329 | - $options[] = ['disclosure', 'select', 'default']; |
|
330 | - $options[] = ['cache', 'checkbox', true]; |
|
331 | - $options[] = ['credits', 'checkbox', true]; |
|
332 | - $options[] = ['statistics', 'checkbox', false]; |
|
333 | - $options[] = ['debug', 'checkbox', false]; |
|
321 | + $options=[ ]; |
|
322 | + |
|
323 | + $options[ ]=[ 'enable', 'checkbox', true ]; |
|
324 | + $options[ ]=[ 'redirect', 'checkbox', true ]; |
|
325 | + $options[ ]=[ 'menu', 'checkbox', true ]; |
|
326 | + $options[ ]=[ 'contact', 'text', get_bloginfo('admin_email') ]; |
|
327 | + $options[ ]=[ 'encryption', 'textarea', null ]; |
|
328 | + $options[ ]=[ 'acknowledgement', 'text', null ]; |
|
329 | + $options[ ]=[ 'disclosure', 'select', 'default' ]; |
|
330 | + $options[ ]=[ 'cache', 'checkbox', true ]; |
|
331 | + $options[ ]=[ 'credits', 'checkbox', true ]; |
|
332 | + $options[ ]=[ 'statistics', 'checkbox', false ]; |
|
333 | + $options[ ]=[ 'debug', 'checkbox', false ]; |
|
334 | 334 | |
335 | 335 | return $options; |
336 | 336 | } |
@@ -357,8 +357,8 @@ discard block |
||
357 | 357 | public function link_row($links, $file) |
358 | 358 | { |
359 | 359 | if (WORDPRESS_SECURITY_TXT_FILE === $file) { |
360 | - $links[] = '<a href="http://twitter.com/austinheap">@austinheap</a>'; |
|
361 | - $links[] = '<a href="http://twitter.com/EdOverflow">@EdOverflow</a>'; |
|
360 | + $links[ ]='<a href="http://twitter.com/austinheap">@austinheap</a>'; |
|
361 | + $links[ ]='<a href="http://twitter.com/EdOverflow">@EdOverflow</a>'; |
|
362 | 362 | } |
363 | 363 | |
364 | 364 | return $links; |
@@ -375,11 +375,11 @@ discard block |
||
375 | 375 | */ |
376 | 376 | public function link_settings($links) |
377 | 377 | { |
378 | - $links[] = sprintf('<a href="%s">%s</a>', |
|
378 | + $links[ ]=sprintf('<a href="%s">%s</a>', |
|
379 | 379 | esc_url(admin_url('options-general.php?page=' . $this->plugin_name)), |
380 | 380 | esc_html__('Settings', $this->plugin_name)); |
381 | 381 | |
382 | - $links[] = sprintf('<a href="%s">%s</a>', |
|
382 | + $links[ ]=sprintf('<a href="%s">%s</a>', |
|
383 | 383 | esc_url(admin_url('options-general.php?page=' . $this->plugin_name . '-help')), |
384 | 384 | esc_html__('Help', $this->plugin_name)); |
385 | 385 | |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | public function admin_bar() |
396 | 396 | { |
397 | 397 | global $wp_admin_bar; |
398 | - if (isset($this->options['menu']) && $this->options['menu']) { |
|
398 | + if (isset($this->options[ 'menu' ]) && $this->options[ 'menu' ]) { |
|
399 | 399 | $wp_admin_bar->add_menu([ |
400 | 400 | 'id' => $this->plugin_name . '_root_toolbar', |
401 | 401 | 'title' => __('security.txt', $this->plugin_name), |
@@ -33,7 +33,7 @@ |
||
33 | 33 | 'primary', |
34 | 34 | 'wordpress-security-txt[submit]', |
35 | 35 | false, |
36 | - ['disabled' => 'disabled'] |
|
36 | + [ 'disabled' => 'disabled' ] |
|
37 | 37 | ); |
38 | 38 | |
39 | 39 | ?> |
@@ -10,43 +10,43 @@ |
||
10 | 10 | * @subpackage WordPress_Security_Txt/admin/partials |
11 | 11 | */ |
12 | 12 | |
13 | -if (! empty($atts['label'])) { |
|
13 | +if (!empty($atts[ 'label' ])) { |
|
14 | 14 | ?> |
15 | - <label for="<?php echo esc_attr($atts['id']); ?>"> |
|
16 | - <?php esc_html_e($atts['label'], 'employees'); ?>: |
|
15 | + <label for="<?php echo esc_attr($atts[ 'id' ]); ?>"> |
|
16 | + <?php esc_html_e($atts[ 'label' ], 'employees'); ?>: |
|
17 | 17 | </label> |
18 | 18 | <?php |
19 | 19 | } |
20 | 20 | |
21 | 21 | ?> |
22 | 22 | <select |
23 | - aria-label="<?php esc_attr(_e($atts['aria'], $this->plugin_name)); ?>" |
|
24 | - class="<?php echo esc_attr($atts['class']); ?>" |
|
25 | - id="<?php echo esc_attr($atts['id']); ?>" |
|
26 | - name="<?php echo esc_attr($atts['name']); ?>"> |
|
23 | + aria-label="<?php esc_attr(_e($atts[ 'aria' ], $this->plugin_name)); ?>" |
|
24 | + class="<?php echo esc_attr($atts[ 'class' ]); ?>" |
|
25 | + id="<?php echo esc_attr($atts[ 'id' ]); ?>" |
|
26 | + name="<?php echo esc_attr($atts[ 'name' ]); ?>"> |
|
27 | 27 | <?php |
28 | 28 | |
29 | - if (! empty($atts['blank'])) { |
|
29 | + if (!empty($atts[ 'blank' ])) { |
|
30 | 30 | ?> |
31 | - <option value><?php esc_html_e($atts['blank'], $this->plugin_name); ?></option> |
|
31 | + <option value><?php esc_html_e($atts[ 'blank' ], $this->plugin_name); ?></option> |
|
32 | 32 | <?php |
33 | 33 | } |
34 | 34 | |
35 | - foreach ($atts['selections'] as $selection) { |
|
35 | + foreach ($atts[ 'selections' ] as $selection) { |
|
36 | 36 | if (is_array($selection)) { |
37 | - $label = $selection['label']; |
|
38 | - $value = $selection['value']; |
|
37 | + $label=$selection[ 'label' ]; |
|
38 | + $value=$selection[ 'value' ]; |
|
39 | 39 | } else { |
40 | - $label = strtolower($selection); |
|
41 | - $value = strtolower($selection); |
|
40 | + $label=strtolower($selection); |
|
41 | + $value=strtolower($selection); |
|
42 | 42 | } ?> |
43 | 43 | <option value="<?php echo esc_attr($value); ?>" |
44 | - <?php selected($atts['value'], $value); ?>> |
|
44 | + <?php selected($atts[ 'value' ], $value); ?>> |
|
45 | 45 | <?php esc_html_e($label, $this->plugin_name); ?></option> |
46 | 46 | <?php |
47 | 47 | } |
48 | 48 | |
49 | 49 | ?> |
50 | 50 | </select> |
51 | -<span class="description"><?php esc_html_e($atts['description'], $this->plugin_name); ?></span> |
|
51 | +<span class="description"><?php esc_html_e($atts[ 'description' ], $this->plugin_name); ?></span> |
|
52 | 52 | </label> |
@@ -25,17 +25,17 @@ discard block |
||
25 | 25 | <ul id="wordpress-security-txt-sections[debug][database]"> |
26 | 26 | <?php |
27 | 27 | foreach (WordPress_Security_Txt_Admin::get_options($this->plugin_name) as $key => $value) { |
28 | - if (! is_null($value)) { |
|
28 | + if (!is_null($value)) { |
|
29 | 29 | switch (gettype($value)) { |
30 | 30 | case 'boolean': |
31 | - $value = $value ? 'true' : 'false'; |
|
31 | + $value=$value ? 'true' : 'false'; |
|
32 | 32 | break; |
33 | 33 | } |
34 | 34 | } |
35 | 35 | |
36 | 36 | if (is_array($value)) { |
37 | 37 | ?> |
38 | - <li><strong><?php echo $key; ?></strong>: <?php if (! is_null($value)) { |
|
38 | + <li><strong><?php echo $key; ?></strong>: <?php if (!is_null($value)) { |
|
39 | 39 | ?> |
40 | 40 | <code>[count: <?php echo count($value); ?>]</code> <?php |
41 | 41 | } ?> |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | foreach ($value as $sub_key => $sub_value) { |
46 | 46 | if (is_array($sub_value)) { |
47 | 47 | ?> |
48 | - <li><strong><?php echo $sub_key; ?></strong>: <?php if (! is_null($sub_value)) { |
|
48 | + <li><strong><?php echo $sub_key; ?></strong>: <?php if (!is_null($sub_value)) { |
|
49 | 49 | ?> |
50 | 50 | <code>[count: <?php echo count($sub_value); ?>]</code> <?php |
51 | 51 | } ?> |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | if (is_array($sub_sub_value)) { |
58 | 58 | ?> |
59 | 59 | <li> |
60 | - <strong><?php echo $sub_sub_key; ?></strong>: <?php if (! is_null($sub_sub_value)) { |
|
60 | + <strong><?php echo $sub_sub_key; ?></strong>: <?php if (!is_null($sub_sub_value)) { |
|
61 | 61 | ?> |
62 | 62 | <code>[count: <?php echo count($sub_sub_value); ?> |
63 | 63 | ]</code> <?php |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | } else { |
76 | 76 | ?> |
77 | 77 | <li> |
78 | - <strong><?php echo $sub_sub_key; ?></strong>: <?php if (! is_null($sub_sub_value)) { |
|
78 | + <strong><?php echo $sub_sub_key; ?></strong>: <?php if (!is_null($sub_sub_value)) { |
|
79 | 79 | ?> |
80 | 80 | <code><?php echo $sub_sub_value; ?></code> <?php |
81 | 81 | } ?> |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | <?php |
89 | 89 | } else { |
90 | 90 | ?> |
91 | - <li><strong><?php echo $key; ?></strong>: <?php if (! is_null($value)) { |
|
91 | + <li><strong><?php echo $key; ?></strong>: <?php if (!is_null($value)) { |
|
92 | 92 | ?> |
93 | 93 | <code><?php echo $value; ?></code> <?php |
94 | 94 | } ?> |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | <?php |
103 | 103 | } else { |
104 | 104 | ?> |
105 | - <li><strong><?php echo $key; ?></strong>: <?php if (! is_null($value)) { |
|
105 | + <li><strong><?php echo $key; ?></strong>: <?php if (!is_null($value)) { |
|
106 | 106 | ?> |
107 | 107 | <code><?php echo strlen($value) > 255 ? substr($value, 0, 36) : $value; ?></code><?php echo strlen($value) > 255 ? '...' : ''; ?> <?php |
108 | 108 | } ?>(<em><?php echo gettype($value); ?></em>) |
@@ -117,13 +117,13 @@ discard block |
||
117 | 117 | <p>Details for plugin cache on the WordPress filesystem <code><?php echo get_temp_dir(); ?></code> for <code>wordpress-security-txt</code>: |
118 | 118 | </p> |
119 | 119 | <ul id="wordpress-security-txt-sections[debug][cache]"> |
120 | - <li><strong>Enabled</strong>: <?php if (! is_null($this->options['cache'])) { |
|
120 | + <li><strong>Enabled</strong>: <?php if (!is_null($this->options[ 'cache' ])) { |
|
121 | 121 | ?> |
122 | - <code><?php echo $this->options['cache'] ? 'true' : 'false'; ?></code> <?php |
|
122 | + <code><?php echo $this->options[ 'cache' ] ? 'true' : 'false'; ?></code> <?php |
|
123 | 123 | } ?> |
124 | - (<em><?php echo gettype($this->options['debug']); ?></em>) |
|
124 | + (<em><?php echo gettype($this->options[ 'debug' ]); ?></em>) |
|
125 | 125 | </li> |
126 | - <?php if (isset($this->options['cache']) && $this->options['cache']) { |
|
126 | + <?php if (isset($this->options[ 'cache' ]) && $this->options[ 'cache' ]) { |
|
127 | 127 | ?> |
128 | 128 | <li><strong>Location</strong>: <code><?php echo WordPress_Security_Txt_Public::cache_file(); ?></code></li> |
129 | 129 | <li><strong>Cleared</strong>: |
@@ -10,20 +10,20 @@ |
||
10 | 10 | * @subpackage WordPress_Security_Txt/admin/partials |
11 | 11 | */ |
12 | 12 | |
13 | -if (! empty($atts['label'])) { |
|
14 | - ?><label for="<?php echo esc_attr($atts['id']); ?>"><?php esc_html_e($atts['label'], 'wordpress-security-txt'); ?> |
|
13 | +if (!empty($atts[ 'label' ])) { |
|
14 | + ?><label for="<?php echo esc_attr($atts[ 'id' ]); ?>"><?php esc_html_e($atts[ 'label' ], 'wordpress-security-txt'); ?> |
|
15 | 15 | : </label><?php |
16 | 16 | } |
17 | 17 | |
18 | 18 | ?><textarea |
19 | - class="<?php echo esc_attr($atts['class']); ?>" |
|
20 | - cols="<?php echo esc_attr($atts['cols']); ?>" |
|
21 | - id="<?php echo esc_attr($atts['id']); ?>" |
|
22 | - placeholder="<?php echo esc_attr($atts['placeholder']); ?>" |
|
23 | - name="<?php echo esc_attr($atts['name']); ?>" |
|
24 | - rows="<?php echo esc_attr($atts['rows']); ?>"><?php |
|
19 | + class="<?php echo esc_attr($atts[ 'class' ]); ?>" |
|
20 | + cols="<?php echo esc_attr($atts[ 'cols' ]); ?>" |
|
21 | + id="<?php echo esc_attr($atts[ 'id' ]); ?>" |
|
22 | + placeholder="<?php echo esc_attr($atts[ 'placeholder' ]); ?>" |
|
23 | + name="<?php echo esc_attr($atts[ 'name' ]); ?>" |
|
24 | + rows="<?php echo esc_attr($atts[ 'rows' ]); ?>"><?php |
|
25 | 25 | |
26 | - echo esc_textarea($atts['value']); |
|
26 | + echo esc_textarea($atts[ 'value' ]); |
|
27 | 27 | |
28 | 28 | ?></textarea> |
29 | -<span class="description"><?php esc_html_e($atts['description'], 'wordpress-security-txt'); ?></span> |
|
29 | +<span class="description"><?php esc_html_e($atts[ 'description' ], 'wordpress-security-txt'); ?></span> |
@@ -19,19 +19,19 @@ discard block |
||
19 | 19 | <ul class="repeaters"> |
20 | 20 | <?php |
21 | 21 | |
22 | - for ($i = 0; $i <= $count; $i++) { |
|
22 | + for ($i=0; $i <= $count; $i++) { |
|
23 | 23 | if ($i === $count) { |
24 | - $setatts['class'] .= ' hidden'; |
|
24 | + $setatts[ 'class' ].=' hidden'; |
|
25 | 25 | } |
26 | 26 | |
27 | - if (! empty($repeater[$i][$setatts['title-field']])) { |
|
28 | - $setatts['label-header'] = $repeater[$i][$setatts['title-field']]; |
|
27 | + if (!empty($repeater[ $i ][ $setatts[ 'title-field' ] ])) { |
|
28 | + $setatts[ 'label-header' ]=$repeater[ $i ][ $setatts[ 'title-field' ] ]; |
|
29 | 29 | } ?> |
30 | - <li class="<?php echo esc_attr($setatts['class']); ?>"> |
|
30 | + <li class="<?php echo esc_attr($setatts[ 'class' ]); ?>"> |
|
31 | 31 | <div class="handle"> |
32 | - <span class="title-repeater"><?php echo esc_html($setatts['label-header']); ?></span> |
|
32 | + <span class="title-repeater"><?php echo esc_html($setatts[ 'label-header' ]); ?></span> |
|
33 | 33 | <button aria-expanded="true" class="btn-edit" type="button"> |
34 | - <span class="screen-reader-text"><?php echo esc_html($setatts['label-edit']); ?></span> |
|
34 | + <span class="screen-reader-text"><?php echo esc_html($setatts[ 'label-edit' ]); ?></span> |
|
35 | 35 | <span class="toggle-arrow"></span> |
36 | 36 | </button> |
37 | 37 | </div> |
@@ -39,14 +39,14 @@ discard block |
||
39 | 39 | <div class="wrap-fields"> |
40 | 40 | <?php |
41 | 41 | |
42 | - foreach ($setatts['fields'] as $fieldcount => $field) { |
|
42 | + foreach ($setatts[ 'fields' ] as $fieldcount => $field) { |
|
43 | 43 | foreach ($field as $type => $atts) { |
44 | - if (! empty($repeater) && ! empty($repeater[$i][$atts['id']])) { |
|
45 | - $atts['value'] = $repeater[$i][$atts['id']]; |
|
44 | + if (!empty($repeater) && !empty($repeater[ $i ][ $atts[ 'id' ] ])) { |
|
45 | + $atts[ 'value' ]=$repeater[ $i ][ $atts[ 'id' ] ]; |
|
46 | 46 | } |
47 | 47 | |
48 | - $atts['id'] .= '[]'; |
|
49 | - $atts['name'] .= '[]'; ?><p class="wrap-field"><?php |
|
48 | + $atts[ 'id' ].='[]'; |
|
49 | + $atts[ 'name' ].='[]'; ?><p class="wrap-field"><?php |
|
50 | 50 | |
51 | 51 | require plugin_dir_path(__FILE__) . $this->plugin_name . '-field-' . $type . '.php'; ?> |
52 | 52 | </p> |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | <span> |
60 | 60 | <?php |
61 | 61 | echo esc_html(apply_filters($this->plugin_name . '-repeater-remove-link-label', |
62 | - $setatts['label-remove'])); ?> |
|
62 | + $setatts[ 'label-remove' ])); ?> |
|
63 | 63 | </span> |
64 | 64 | </a> |
65 | 65 | </div> |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | <span id="status"></span> |
73 | 73 | <a class="button" href="#" id="add-repeater"> |
74 | 74 | <?php |
75 | - echo esc_html(apply_filters($this->plugin_name . '-repeater-more-link-label', $setatts['label-add'])); |
|
75 | + echo esc_html(apply_filters($this->plugin_name . '-repeater-more-link-label', $setatts[ 'label-add' ])); |
|
76 | 76 | ?> |
77 | 77 | </a> |
78 | 78 | </div> |