| @@ -4,11 +4,12 @@ | ||
| 4 | 4 | require_once dirname( __FILE__ ) . '/troubleshoot.php'; |
| 5 | 5 | $app = pd_troubleshoot(); |
| 6 | 6 | |
| 7 | 7 | // check if we're attempting to restore the site |
| 8 | -if (isset($_GET['restore'])) { | |
| 9 | - if($app->delete_maintenance_file()){ | |
| 10 | - wp_redirect(home_url()); | |
| 8 | +// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Emergency restore link; delete_maintenance_file() enforces an is_user_logged_in() + manage_options capability check before acting. | |
| 9 | +if ( isset( $_GET['restore'] ) ) { | |
| 10 | + if ( $app->delete_maintenance_file() ) { | |
| 11 | + wp_safe_redirect( home_url() ); | |
| 11 | 12 | exit; |
| 12 | 13 | } |
| 13 | 14 | } |
| 14 | 15 | |
| @@ -18,11 +19,13 @@ | ||
| 18 | 19 | <html> |
| 19 | 20 | <head> |
| 20 | 21 | <meta charset="utf-8"> |
| 21 | 22 | <title>Plugin Detective</title> |
| 23 | + <?php // phpcs:disable WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet -- Standalone troubleshooter page rendered outside WordPress; wp_enqueue_style()/wp_head() are unavailable here. ?> | |
| 22 | 24 | <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic"> |
| 23 | 25 | <link rel="stylesheet" href="//fonts.googleapis.com/icon?family=Material+Icons"> |
| 24 | - <link href="<?php echo $app->url('app/dist/static/css/app.css' ); ?>" rel="stylesheet"> | |
| 26 | + <link href="<?php echo esc_url( $app->url( 'app/dist/static/css/app.css' ) ); ?>" rel="stylesheet"> | |
| 27 | + <?php // phpcs:enable WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet ?> | |
| 25 | 28 | </head> |
| 26 | 29 | <body> |
| 27 | 30 | <div id="app"></div> |
| 28 | 31 | |
| @@ -29,9 +32,11 @@ | ||
| 29 | 32 | <script type='text/javascript'> |
| 30 | 33 | var app = <?php echo json_encode( $app->get_api_params() ); ?>; |
| 31 | 34 | var pd_translations = <?php echo json_encode( $app->get_translations() ); ?>; |
| 32 | 35 | </script> |
| 33 | - <script type=text/javascript src="<?php echo $app->url('app/dist/static/js/manifest.js' ).'?v='.PD_Troubleshoot::VERSION; ?>"></script> | |
| 34 | - <script type=text/javascript src="<?php echo $app->url('app/dist/static/js/chunk-vendors.js' ).'?v='.PD_Troubleshoot::VERSION; ?>"></script> | |
| 35 | - <script type=text/javascript src="<?php echo $app->url('app/dist/static/js/app.js' ).'?v='.PD_Troubleshoot::VERSION; ?>"></script> | |
| 36 | + <?php // phpcs:disable WordPress.WP.EnqueuedResources.NonEnqueuedScript -- Standalone troubleshooter page rendered outside WordPress; wp_enqueue_script()/wp_footer() are unavailable here. ?> | |
| 37 | + <script type=text/javascript src="<?php echo esc_url( $app->url( 'app/dist/static/js/manifest.js' ) . '?v=' . PD_Troubleshoot::VERSION ); ?>"></script> | |
| 38 | + <script type=text/javascript src="<?php echo esc_url( $app->url( 'app/dist/static/js/chunk-vendors.js' ) . '?v=' . PD_Troubleshoot::VERSION ); ?>"></script> | |
| 39 | + <script type=text/javascript src="<?php echo esc_url( $app->url( 'app/dist/static/js/app.js' ) . '?v=' . PD_Troubleshoot::VERSION ); ?>"></script> | |
| 40 | + <?php // phpcs:enable WordPress.WP.EnqueuedResources.NonEnqueuedScript ?> | |
| 36 | 41 | </body> |
| 37 | 42 | </html> |