@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | * @access private |
| 63 | 63 | * @var array $available_fields The fields this class can build. |
| 64 | 64 | */ |
| 65 | - private static $available_fields = [ |
|
| 65 | + private static $available_fields=[ |
|
| 66 | 66 | 'enable', |
| 67 | 67 | 'menu', |
| 68 | 68 | 'redirect', |
@@ -87,10 +87,10 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | public function __construct($plugin_name, $version, $options) |
| 89 | 89 | { |
| 90 | - $this->plugin_name = $plugin_name; |
|
| 91 | - $this->version = $version; |
|
| 92 | - $this->options = $options; |
|
| 93 | - $this->builder = new WordPress_Security_Txt_Builder($this->plugin_name, $this->version, $this->options); |
|
| 90 | + $this->plugin_name=$plugin_name; |
|
| 91 | + $this->version=$version; |
|
| 92 | + $this->options=$options; |
|
| 93 | + $this->builder=new WordPress_Security_Txt_Builder($this->plugin_name, $this->version, $this->options); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /** |
@@ -149,13 +149,13 @@ discard block |
||
| 149 | 149 | add_settings_field( |
| 150 | 150 | 'enable', |
| 151 | 151 | apply_filters($this->plugin_name . 'label-enable', esc_html__('Enable', $this->plugin_name)), |
| 152 | - [$this->builder, 'checkbox'], |
|
| 152 | + [ $this->builder, 'checkbox' ], |
|
| 153 | 153 | $this->plugin_name, |
| 154 | 154 | $this->plugin_name . '-general', |
| 155 | 155 | [ |
| 156 | 156 | 'description' => 'Serve ' . get_site_url() . '/.well-known/security.txt on your WordPress site.', |
| 157 | 157 | 'id' => 'enable', |
| 158 | - 'value' => isset($this->options['enable']) ? $this->options['enable'] : false, |
|
| 158 | + 'value' => isset($this->options[ 'enable' ]) ? $this->options[ 'enable' ] : false, |
|
| 159 | 159 | ] |
| 160 | 160 | ); |
| 161 | 161 | } |
@@ -170,13 +170,13 @@ discard block |
||
| 170 | 170 | add_settings_field( |
| 171 | 171 | 'menu', |
| 172 | 172 | apply_filters($this->plugin_name . 'label-menu', esc_html__('Menu', $this->plugin_name)), |
| 173 | - [$this->builder, 'checkbox'], |
|
| 173 | + [ $this->builder, 'checkbox' ], |
|
| 174 | 174 | $this->plugin_name, |
| 175 | 175 | $this->plugin_name . '-general', |
| 176 | 176 | [ |
| 177 | 177 | 'description' => 'Show security.txt menu at the top of the WordPress admin interface. You should turn this off after you have the plugin configured.', |
| 178 | 178 | 'id' => 'menu', |
| 179 | - 'value' => isset($this->options['menu']) ? $this->options['menu'] : false, |
|
| 179 | + 'value' => isset($this->options[ 'menu' ]) ? $this->options[ 'menu' ] : false, |
|
| 180 | 180 | ] |
| 181 | 181 | ); |
| 182 | 182 | } |
@@ -191,14 +191,14 @@ discard block |
||
| 191 | 191 | add_settings_field( |
| 192 | 192 | 'redirect', |
| 193 | 193 | apply_filters($this->plugin_name . 'label-redirect', esc_html__('Redirect', $this->plugin_name)), |
| 194 | - [$this->builder, 'checkbox'], |
|
| 194 | + [ $this->builder, 'checkbox' ], |
|
| 195 | 195 | $this->plugin_name, |
| 196 | 196 | $this->plugin_name . '-general', |
| 197 | 197 | [ |
| 198 | 198 | 'description' => 'Redirect requests for ' . get_site_url() . '/security.txt to ' . get_site_url() . '/.well-known/security.txt.', |
| 199 | 199 | 'id' => 'redirect', |
| 200 | 200 | 'class' => 'hide-when-disabled', |
| 201 | - 'value' => isset($this->options['redirect']) ? $this->options['redirect'] : false, |
|
| 201 | + 'value' => isset($this->options[ 'redirect' ]) ? $this->options[ 'redirect' ] : false, |
|
| 202 | 202 | ] |
| 203 | 203 | ); |
| 204 | 204 | } |
@@ -213,14 +213,14 @@ discard block |
||
| 213 | 213 | add_settings_field( |
| 214 | 214 | 'contact', |
| 215 | 215 | apply_filters($this->plugin_name . 'label-contact', esc_html__('Contact', $this->plugin_name)), |
| 216 | - [$this->builder, 'text'], |
|
| 216 | + [ $this->builder, 'text' ], |
|
| 217 | 217 | $this->plugin_name, |
| 218 | 218 | $this->plugin_name . '-directives', |
| 219 | 219 | [ |
| 220 | 220 | 'description' => 'Your contact address. Valid formats: e-mail, URL, phone number. (Required)', |
| 221 | 221 | 'id' => 'contact', |
| 222 | 222 | 'class' => 'text widefat hide-when-disabled', |
| 223 | - 'value' => isset($this->options['contact']) ? $this->options['contact'] : false, |
|
| 223 | + 'value' => isset($this->options[ 'contact' ]) ? $this->options[ 'contact' ] : false, |
|
| 224 | 224 | 'placeholder' => get_bloginfo('admin_email'), |
| 225 | 225 | ] |
| 226 | 226 | ); |
@@ -236,14 +236,14 @@ discard block |
||
| 236 | 236 | add_settings_field( |
| 237 | 237 | 'encryption', |
| 238 | 238 | apply_filters($this->plugin_name . 'label-encryption', esc_html__('Encryption', $this->plugin_name)), |
| 239 | - [$this->builder, 'textarea'], |
|
| 239 | + [ $this->builder, 'textarea' ], |
|
| 240 | 240 | $this->plugin_name, |
| 241 | 241 | $this->plugin_name . '-directives', |
| 242 | 242 | [ |
| 243 | 243 | 'description' => 'Your GPG public key. (Optional)', |
| 244 | 244 | 'id' => 'encryption', |
| 245 | 245 | 'class' => 'large-text hide-when-disabled', |
| 246 | - 'value' => isset($this->options['encryption']) ? $this->options['encryption'] : false, |
|
| 246 | + 'value' => isset($this->options[ 'encryption' ]) ? $this->options[ 'encryption' ] : false, |
|
| 247 | 247 | 'rows' => 5, |
| 248 | 248 | ] |
| 249 | 249 | ); |
@@ -259,23 +259,23 @@ discard block |
||
| 259 | 259 | add_settings_field( |
| 260 | 260 | 'disclosure', |
| 261 | 261 | apply_filters($this->plugin_name . 'label-disclosure', esc_html__('Disclosure', $this->plugin_name)), |
| 262 | - [$this->builder, 'select'], |
|
| 262 | + [ $this->builder, 'select' ], |
|
| 263 | 263 | $this->plugin_name, |
| 264 | 264 | $this->plugin_name . '-directives', |
| 265 | 265 | [ |
| 266 | 266 | 'description' => 'Your disclosure policy. (Optional)', |
| 267 | 267 | 'id' => 'disclosure', |
| 268 | 268 | 'class' => 'widefat hide-when-disabled', |
| 269 | - 'value' => isset($this->options['disclosure']) ? $this->options['disclosure'] : 'default', |
|
| 269 | + 'value' => isset($this->options[ 'disclosure' ]) ? $this->options[ 'disclosure' ] : 'default', |
|
| 270 | 270 | 'selections' => [ |
| 271 | - ['value' => 'default', |
|
| 272 | - 'label' => 'Default — do not include the "Disclosure" directive'], |
|
| 273 | - ['value' => 'full', |
|
| 274 | - 'label' => 'Full — you will fully disclose reports after the issue has been resolved'], |
|
| 275 | - ['value' => 'partial', |
|
| 276 | - 'label' => 'Partial — you will partially disclose reports after the issue has been resolved'], |
|
| 277 | - ['value' => 'none', |
|
| 278 | - 'label' => 'None — you do not want to disclose reports after the issue has been resolved'], |
|
| 271 | + [ 'value' => 'default', |
|
| 272 | + 'label' => 'Default — do not include the "Disclosure" directive' ], |
|
| 273 | + [ 'value' => 'full', |
|
| 274 | + 'label' => 'Full — you will fully disclose reports after the issue has been resolved' ], |
|
| 275 | + [ 'value' => 'partial', |
|
| 276 | + 'label' => 'Partial — you will partially disclose reports after the issue has been resolved' ], |
|
| 277 | + [ 'value' => 'none', |
|
| 278 | + 'label' => 'None — you do not want to disclose reports after the issue has been resolved' ], |
|
| 279 | 279 | ], |
| 280 | 280 | ] |
| 281 | 281 | ); |
@@ -292,14 +292,14 @@ discard block |
||
| 292 | 292 | 'acknowledgement', |
| 293 | 293 | apply_filters($this->plugin_name . 'label-acknowledgement', |
| 294 | 294 | esc_html__('Acknowledgement', $this->plugin_name)), |
| 295 | - [$this->builder, 'text'], |
|
| 295 | + [ $this->builder, 'text' ], |
|
| 296 | 296 | $this->plugin_name, |
| 297 | 297 | $this->plugin_name . '-directives', |
| 298 | 298 | [ |
| 299 | 299 | 'description' => 'Your acknowledgements URL. (Optional)', |
| 300 | 300 | 'id' => 'acknowledgement', |
| 301 | 301 | 'class' => 'text widefat hide-when-disabled', |
| 302 | - 'value' => isset($this->options['acknowledgement']) ? $this->options['acknowledgement'] : false, |
|
| 302 | + 'value' => isset($this->options[ 'acknowledgement' ]) ? $this->options[ 'acknowledgement' ] : false, |
|
| 303 | 303 | 'placeholder' => get_site_url() . '/security-hall-of-fame/', |
| 304 | 304 | ] |
| 305 | 305 | ); |
@@ -315,14 +315,14 @@ discard block |
||
| 315 | 315 | add_settings_field( |
| 316 | 316 | 'cache', |
| 317 | 317 | apply_filters($this->plugin_name . 'label-cache', esc_html__('Cache', $this->plugin_name)), |
| 318 | - [$this->builder, 'checkbox'], |
|
| 318 | + [ $this->builder, 'checkbox' ], |
|
| 319 | 319 | $this->plugin_name, |
| 320 | 320 | $this->plugin_name . '-library', |
| 321 | 321 | [ |
| 322 | 322 | 'description' => 'Enable cacheing of your security.txt file.', |
| 323 | 323 | 'id' => 'cache', |
| 324 | 324 | 'class' => 'hide-when-disabled', |
| 325 | - 'value' => isset($this->options['cache']) ? $this->options['cache'] : false, |
|
| 325 | + 'value' => isset($this->options[ 'cache' ]) ? $this->options[ 'cache' ] : false, |
|
| 326 | 326 | ] |
| 327 | 327 | ); |
| 328 | 328 | } |
@@ -337,14 +337,14 @@ discard block |
||
| 337 | 337 | add_settings_field( |
| 338 | 338 | 'credits', |
| 339 | 339 | apply_filters($this->plugin_name . 'label-credits', esc_html__('Credits', $this->plugin_name)), |
| 340 | - [$this->builder, 'checkbox'], |
|
| 340 | + [ $this->builder, 'checkbox' ], |
|
| 341 | 341 | $this->plugin_name, |
| 342 | 342 | $this->plugin_name . '-library', |
| 343 | 343 | [ |
| 344 | 344 | 'description' => 'Enable credits at the bottom of your security.txt file.', |
| 345 | 345 | 'id' => 'credits', |
| 346 | 346 | 'class' => 'hide-when-disabled', |
| 347 | - 'value' => isset($this->options['credits']) ? $this->options['credits'] : false, |
|
| 347 | + 'value' => isset($this->options[ 'credits' ]) ? $this->options[ 'credits' ] : false, |
|
| 348 | 348 | ] |
| 349 | 349 | ); |
| 350 | 350 | } |
@@ -359,14 +359,14 @@ discard block |
||
| 359 | 359 | add_settings_field( |
| 360 | 360 | 'statistics', |
| 361 | 361 | apply_filters($this->plugin_name . 'label-statistics', esc_html__('Statistics', $this->plugin_name)), |
| 362 | - [$this->builder, 'checkbox'], |
|
| 362 | + [ $this->builder, 'checkbox' ], |
|
| 363 | 363 | $this->plugin_name, |
| 364 | 364 | $this->plugin_name . '-library', |
| 365 | 365 | [ |
| 366 | 366 | 'description_raw' => 'Allow anonymous collection of plugin usage statistics. <a href="?page=wordpress-security-txt-help#statistics">Learn more</a> about what is collected and how the data is used.', |
| 367 | 367 | 'id' => 'statistics', |
| 368 | 368 | 'class' => 'hide-when-disabled', |
| 369 | - 'value' => isset($this->options['statistics']) ? $this->options['statistics'] : false, |
|
| 369 | + 'value' => isset($this->options[ 'statistics' ]) ? $this->options[ 'statistics' ] : false, |
|
| 370 | 370 | ] |
| 371 | 371 | ); |
| 372 | 372 | } |
@@ -381,14 +381,14 @@ discard block |
||
| 381 | 381 | add_settings_field( |
| 382 | 382 | 'debug', |
| 383 | 383 | apply_filters($this->plugin_name . 'label-debug', esc_html__('Debug', $this->plugin_name)), |
| 384 | - [$this->builder, 'checkbox'], |
|
| 384 | + [ $this->builder, 'checkbox' ], |
|
| 385 | 385 | $this->plugin_name, |
| 386 | 386 | $this->plugin_name . '-library', |
| 387 | 387 | [ |
| 388 | 388 | 'description' => 'Enable debug at the bottom of your security.txt file & this page.', |
| 389 | 389 | 'id' => 'debug', |
| 390 | 390 | 'class' => 'hide-when-disabled', |
| 391 | - 'value' => isset($this->options['debug']) ? $this->options['debug'] : false, |
|
| 391 | + 'value' => isset($this->options[ 'debug' ]) ? $this->options[ 'debug' ] : false, |
|
| 392 | 392 | ] |
| 393 | 393 | ); |
| 394 | 394 | } |
@@ -10,16 +10,16 @@ |
||
| 10 | 10 | * @subpackage WordPress_Security_Txt/admin/partials |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | -?><label for="<?php echo esc_attr($atts['id']); ?>"> |
|
| 13 | +?><label for="<?php echo esc_attr($atts[ 'id' ]); ?>"> |
|
| 14 | 14 | <input aria-role="checkbox" |
| 15 | - <?php checked(1, $atts['value'], true); ?> |
|
| 16 | - class="<?php echo esc_attr($atts['class']); ?>" |
|
| 17 | - id="<?php echo esc_attr($atts['id']); ?>" |
|
| 18 | - name="<?php echo esc_attr($atts['name']); ?>" |
|
| 15 | + <?php checked(1, $atts[ 'value' ], true); ?> |
|
| 16 | + class="<?php echo esc_attr($atts[ 'class' ]); ?>" |
|
| 17 | + id="<?php echo esc_attr($atts[ 'id' ]); ?>" |
|
| 18 | + name="<?php echo esc_attr($atts[ 'name' ]); ?>" |
|
| 19 | 19 | type="checkbox" |
| 20 | 20 | value="1"/> |
| 21 | - <span class="description"><?php if (!empty($atts['description_raw'])) { |
|
| 22 | - print $atts['description_raw']; } else { |
|
| 23 | - esc_html_e($atts['description'], 'wordpress-security-txt'); |
|
| 21 | + <span class="description"><?php if (!empty($atts[ 'description_raw' ])) { |
|
| 22 | + print $atts[ 'description_raw' ]; } else { |
|
| 23 | + esc_html_e($atts[ 'description' ], 'wordpress-security-txt'); |
|
| 24 | 24 | } ?></span> |
| 25 | 25 | </label> |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | * @subpackage WordPress_Security_Txt/admin/partials |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | -$links = [ |
|
| 13 | +$links=[ |
|
| 14 | 14 | 'repo' => 'https://github.com/austinheap/wordpress-security-txt', |
| 15 | 15 | 'issues' => 'https://github.com/austinheap/laravel-security-txt/issues', |
| 16 | 16 | 'pulls' => 'https://github.com/austinheap/laravel-security-txt/pulls', |
@@ -27,14 +27,14 @@ discard block |
||
| 27 | 27 | <h3><a name="overview"></a>Overview</h3> |
| 28 | 28 | <p> |
| 29 | 29 | You are running <code>wordpress-security-txt v<?php echo WORDPRESS_SECURITY_TXT_VERSION ?></code>. Please |
| 30 | - report any issues you encounter via the <a href="<?php echo $links['issues']; ?>">GitHub issues tracker</a>. |
|
| 31 | - If you'd like to contribute to this plugin, <a href="<?php echo $links['pulls']; ?>">pull requests</a> are |
|
| 32 | - welcome. For more information please see <a href="<?php echo $links['contributing']; ?>">CONTRIBUTING.md</a>. |
|
| 30 | + report any issues you encounter via the <a href="<?php echo $links[ 'issues' ]; ?>">GitHub issues tracker</a>. |
|
| 31 | + If you'd like to contribute to this plugin, <a href="<?php echo $links[ 'pulls' ]; ?>">pull requests</a> are |
|
| 32 | + welcome. For more information please see <a href="<?php echo $links[ 'contributing' ]; ?>">CONTRIBUTING.md</a>. |
|
| 33 | 33 | </p> |
| 34 | 34 | <h3><a name="specification"></a>Specification</h3> |
| 35 | 35 | <p> |
| 36 | 36 | This version of the plugin implements the <code>security.txt</code> |
| 37 | - <a href="<?php echo $links['specification']; ?>">specification</a> as follows: |
|
| 37 | + <a href="<?php echo $links[ 'specification' ]; ?>">specification</a> as follows: |
|
| 38 | 38 | </p> |
| 39 | 39 | <div class="specification"> |
| 40 | 40 | <pre><?php echo htmlspecialchars(file_get_contents(plugin_dir_path(__FILE__) . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'SPECIFICATION.txt')); ?></pre> |
@@ -179,7 +179,7 @@ |
||
| 179 | 179 | $this->loader->add_action('admin_init', $plugin_admin, 'register_sections'); |
| 180 | 180 | $this->loader->add_action('admin_init', $plugin_admin, 'register_fields'); |
| 181 | 181 | $this->loader->add_filter('plugin_action_links_' . WORDPRESS_SECURITY_TXT_FILE, $plugin_admin, |
| 182 | - 'link_settings'); |
|
| 182 | + 'link_settings'); |
|
| 183 | 183 | $this->loader->add_action('plugin_row_meta', $plugin_admin, 'link_row', 10, 2); |
| 184 | 184 | $this->loader->add_action('wp_before_admin_bar_render', $plugin_admin, 'admin_bar'); |
| 185 | 185 | } |
@@ -70,11 +70,11 @@ discard block |
||
| 70 | 70 | public function __construct() |
| 71 | 71 | { |
| 72 | 72 | if (defined('WORDPRESS_SECURITY_TXT_VERSION')) { |
| 73 | - $this->version = WORDPRESS_SECURITY_TXT_VERSION; |
|
| 73 | + $this->version=WORDPRESS_SECURITY_TXT_VERSION; |
|
| 74 | 74 | } else { |
| 75 | - $this->version = '1.0.0'; |
|
| 75 | + $this->version='1.0.0'; |
|
| 76 | 76 | } |
| 77 | - $this->plugin_name = 'wordpress-security-txt'; |
|
| 77 | + $this->plugin_name='wordpress-security-txt'; |
|
| 78 | 78 | |
| 79 | 79 | $this->load_dependencies(); |
| 80 | 80 | $this->set_locale(); |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | */ |
| 140 | 140 | require_once plugin_dir_path(dirname(__FILE__)) . 'public/class-wordpress-security-txt-public.php'; |
| 141 | 141 | |
| 142 | - $this->loader = new WordPress_Security_Txt_Loader(); |
|
| 142 | + $this->loader=new WordPress_Security_Txt_Loader(); |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | /** |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | */ |
| 154 | 154 | private function set_locale() |
| 155 | 155 | { |
| 156 | - $plugin_i18n = new WordPress_Security_Txt_i18n(); |
|
| 156 | + $plugin_i18n=new WordPress_Security_Txt_i18n(); |
|
| 157 | 157 | |
| 158 | 158 | $this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain'); |
| 159 | 159 | } |
@@ -167,9 +167,9 @@ discard block |
||
| 167 | 167 | */ |
| 168 | 168 | private function define_admin_hooks() |
| 169 | 169 | { |
| 170 | - $plugin_admin = new WordPress_Security_Txt_Admin($this->get_plugin_name(), $this->get_version()); |
|
| 170 | + $plugin_admin=new WordPress_Security_Txt_Admin($this->get_plugin_name(), $this->get_version()); |
|
| 171 | 171 | |
| 172 | - if (isset($_GET['page']) && ($_GET['page'] == 'wordpress-security-txt' || $_GET['page'] == 'wordpress-security-txt-help')) { |
|
| 172 | + if (isset($_GET[ 'page' ]) && ($_GET[ 'page' ] == 'wordpress-security-txt' || $_GET[ 'page' ] == 'wordpress-security-txt-help')) { |
|
| 173 | 173 | $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles'); |
| 174 | 174 | $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts'); |
| 175 | 175 | } |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | */ |
| 217 | 217 | private function define_public_hooks() |
| 218 | 218 | { |
| 219 | - $plugin_public = new WordPress_Security_Txt_Public($this->get_plugin_name(), $this->get_version()); |
|
| 219 | + $plugin_public=new WordPress_Security_Txt_Public($this->get_plugin_name(), $this->get_version()); |
|
| 220 | 220 | |
| 221 | 221 | $this->loader->add_action('plugins_loaded', $plugin_public, 'route'); |
| 222 | 222 | } |
@@ -227,14 +227,14 @@ discard block |
||
| 227 | 227 | * @since 1.0.0 |
| 228 | 228 | * @return void |
| 229 | 229 | */ |
| 230 | - public static function event($name, $version = WORDPRESS_SECURITY_TXT_VERSION) |
|
| 230 | + public static function event($name, $version=WORDPRESS_SECURITY_TXT_VERSION) |
|
| 231 | 231 | { |
| 232 | - $options = WordPress_Security_Txt_Admin::get_options(); |
|
| 232 | + $options=WordPress_Security_Txt_Admin::get_options(); |
|
| 233 | 233 | |
| 234 | - if (isset($options['statistics']) && $options['statistics']) { |
|
| 235 | - $cache_file = WordPress_Security_Txt_Public::cache_file(); |
|
| 236 | - $cache_readable = is_readable($cache_file); |
|
| 237 | - $payload = [ |
|
| 234 | + if (isset($options[ 'statistics' ]) && $options[ 'statistics' ]) { |
|
| 235 | + $cache_file=WordPress_Security_Txt_Public::cache_file(); |
|
| 236 | + $cache_readable=is_readable($cache_file); |
|
| 237 | + $payload=[ |
|
| 238 | 238 | 'name' => $name, |
| 239 | 239 | 'version' => $version, |
| 240 | 240 | 'url' => get_site_url(), |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | 'mtime' => is_readable($cache_file) ? filemtime($cache_file) : null, |
| 245 | 245 | ], |
| 246 | 246 | ]; |
| 247 | - $result = wp_remote_post('https://austinheap.com/projects/wordpress-security-txt/', $payload); |
|
| 247 | + $result=wp_remote_post('https://austinheap.com/projects/wordpress-security-txt/', $payload); |
|
| 248 | 248 | |
| 249 | 249 | unset($result); |
| 250 | 250 | } |