| @@ -125,10 +125,8 @@ | ||
| 125 | 125 | |
| 126 | 126 | // auto download / install / activate WPR plugin |
| 127 | 127 | function install_wpr() |
| 128 | 128 | { |
| 129 | - check_ajax_referer('install_wpr'); | |
| 130 | - | |
| 131 | 129 | if (false === current_user_can('administrator')) { |
| 132 | 130 | wp_die('Sorry, you have to be an admin to run this action.'); |
| 133 | 131 | } |
| 134 | 132 | |
| @@ -149,9 +147,9 @@ | ||
| 149 | 147 | } |
| 150 | 148 | </style>'; |
| 151 | 149 | |
| 152 | 150 | echo '<div style="margin: 20px; color:#444;">'; |
| 153 | - echo 'If things are not done in a minute <a target="_parent" href="' . esc_url(admin_url('plugin-install.php?s=wp-reset&tab=search&type=term')) . '">install the plugin manually via Plugins page</a><br><br>'; | |
| 151 | + echo 'If things are not done in a minute <a target="_parent" href="' . admin_url('plugin-install.php?s=wp-reset&tab=search&type=term') . '">install the plugin manually via Plugins page</a><br><br>'; | |
| 154 | 152 | echo 'Starting ...<br><br>'; |
| 155 | 153 | |
| 156 | 154 | wp_cache_flush(); |
| 157 | 155 | $upgrader = new Plugin_Upgrader(); |
| @@ -176,9 +174,9 @@ | ||
| 176 | 174 | echo '<script>setTimeout(function() { top.location = "tools.php?page=wp-reset"; }, 1000);</script>'; |
| 177 | 175 | echo '<br>If you are not redirected in a few seconds - <a href="tools.php?page=wp-reset" target="_parent">click here</a>.'; |
| 178 | 176 | } |
| 179 | 177 | } else { |
| 180 | - echo 'Could not install WP Reset. You\'ll have to <a target="_parent" href="' . esc_url(admin_url('plugin-install.php?s=wp-reset&tab=search&type=term')) . '">download and install manually</a>.'; | |
| 178 | + echo 'Could not install WP Reset. You\'ll have to <a target="_parent" href="' . admin_url('plugin-install.php?s=wp-reset&tab=search&type=term') . '">download and install manually</a>.'; | |
| 181 | 179 | } |
| 182 | 180 | |
| 183 | 181 | echo '</div>'; |
| 184 | 182 | } // install_wpr |
| @@ -221,9 +219,9 @@ | ||
| 221 | 219 | |
| 222 | 220 | private function handle_after_reset() |
| 223 | 221 | { |
| 224 | 222 | if (empty($this->request['db-reset-reactivate-theme-data'])) { |
| 225 | - wp_safe_redirect(admin_url()); | |
| 223 | + wp_redirect(admin_url()); | |
| 226 | 224 | exit; |
| 227 | 225 | } |
| 228 | 226 | |
| 229 | 227 | $this->notice_success = __('The selected tables were reset', 'wordpress-database-reset'); |
| @@ -340,9 +338,9 @@ | ||
| 340 | 338 | return array( |
| 341 | 339 | 'confirmAlert' => __('Are you sure you want to continue? There is NO UNDO!', 'wordpress-database-reset'), |
| 342 | 340 | 'selectTable' => __('Select Tables', 'wordpress-database-reset'), |
| 343 | 341 | 'selectOneTable' => __('Please select at least one table to reset.', 'wordpress-database-reset'), |
| 344 | - 'wprInstallUrl' => add_query_arg(array('action' => 'install_wpr', '_wpnonce' => wp_create_nonce('install_wpr')), admin_url('admin.php')), | |
| 342 | + 'wprInstallUrl' => add_query_arg(array('action' => 'install_wpr'), admin_url('admin.php')), | |
| 345 | 343 | 'wprDialogTitle' => '<img alt="WP Reset" title="WP Reset" src="' . plugins_url('assets/images/wp-reset-logo.png', DB_RESET_FILE) . '">', |
| 346 | 344 | ); |
| 347 | 345 | } |
| 348 | 346 | } |