| @@ -1,28 +1,42 @@ | ||
| 1 | -<?php | |
| 2 | -// define( 'WP_DEBUG', false ); | |
| 3 | -// ini_set( 'display_errors', false ); | |
| 4 | -require_once dirname( __FILE__ ) . '/troubleshoot.php'; | |
| 5 | -$app = pd_troubleshoot(); | |
| 6 | - | |
| 7 | -?> | |
| 8 | -<!DOCTYPE html> | |
| 9 | -<html> | |
| 10 | - <head> | |
| 11 | - <meta charset="utf-8"> | |
| 12 | - <title>Plugin Detective</title> | |
| 13 | - <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic"> | |
| 14 | - <link rel="stylesheet" href="//fonts.googleapis.com/icon?family=Material+Icons"> | |
| 15 | - <link href="<?php echo $app->url('app/dist/static/css/app.css' ); ?>" rel="stylesheet"> | |
| 16 | - </head> | |
| 17 | - <body> | |
| 18 | - <div id="app"></div> | |
| 19 | - | |
| 20 | - <script type='text/javascript'> | |
| 21 | - var app = <?php echo json_encode( $app->get_api_params() ); ?>; | |
| 22 | - var pd_translations = <?php echo json_encode( $app->get_translations() ); ?>; | |
| 23 | - </script> | |
| 24 | - <script type=text/javascript src="<?php echo $app->url('app/dist/static/js/manifest.js' ).'?v='.PD_Troubleshoot::VERSION; ?>"></script> | |
| 25 | - <script type=text/javascript src="<?php echo $app->url('app/dist/static/js/vendor.js' ).'?v='.PD_Troubleshoot::VERSION; ?>"></script> | |
| 26 | - <script type=text/javascript src="<?php echo $app->url('app/dist/static/js/app.js' ).'?v='.PD_Troubleshoot::VERSION; ?>"></script> | |
| 27 | - </body> | |
| 28 | -</html> | |
| 1 | +<?php | |
| 2 | +// define( 'WP_DEBUG', false ); | |
| 3 | +// ini_set( 'display_errors', false ); | |
| 4 | +require_once dirname( __FILE__ ) . '/troubleshoot.php'; | |
| 5 | +$app = pd_troubleshoot(); | |
| 6 | + | |
| 7 | +// check if we're attempting to restore the site | |
| 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() ); | |
| 12 | + exit; | |
| 13 | + } | |
| 14 | +} | |
| 15 | + | |
| 16 | + | |
| 17 | +?> | |
| 18 | +<!DOCTYPE html> | |
| 19 | +<html> | |
| 20 | + <head> | |
| 21 | + <meta charset="utf-8"> | |
| 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. ?> | |
| 24 | + <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic"> | |
| 25 | + <link rel="stylesheet" href="//fonts.googleapis.com/icon?family=Material+Icons"> | |
| 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 ?> | |
| 28 | + </head> | |
| 29 | + <body> | |
| 30 | + <div id="app"></div> | |
| 31 | + | |
| 32 | + <script type='text/javascript'> | |
| 33 | + var app = <?php echo json_encode( $app->get_api_params() ); ?>; | |
| 34 | + var pd_translations = <?php echo json_encode( $app->get_translations() ); ?>; | |
| 35 | + </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 ?> | |
| 41 | + </body> | |
| 42 | +</html> | |