| @@ -2,18 +2,18 @@ | ||
| 2 | 2 | /* |
| 3 | 3 | Plugin Name: WP Reset |
| 4 | 4 | Plugin URI: https://wpreset.com/ |
| 5 | 5 | Description: Reset the entire site or just selected parts while reserving the option to undo by using snapshots. |
| 6 | - Version: 2.08 | |
| 6 | + Version: 2.05 | |
| 7 | 7 | Requires at least: 4.0 |
| 8 | 8 | Requires PHP: 5.2 |
| 9 | - Tested up to: 7.0 | |
| 9 | + Tested up to: 6.8 | |
| 10 | 10 | License: GPLv2 or later |
| 11 | 11 | Author: WebFactory Ltd |
| 12 | 12 | Author URI: https://www.webfactoryltd.com/ |
| 13 | 13 | Text Domain: wp-reset |
| 14 | 14 | |
| 15 | - Copyright 2015 - 2026 WebFactory Ltd (email: wpreset@webfactoryltd.com) | |
| 15 | + Copyright 2015 - 2025 WebFactory Ltd (email: wpreset@webfactoryltd.com) | |
| 16 | 16 | |
| 17 | 17 | This program is free software; you can redistribute it and/or modify |
| 18 | 18 | it under the terms of the GNU General Public License, version 2, as |
| 19 | 19 | published by the Free Software Foundation. |
| @@ -95,9 +95,9 @@ | ||
| 95 | 95 | 'version' => $this->version, |
| 96 | 96 | 'plugin_file' => __FILE__, |
| 97 | 97 | 'plugin_page' => 'tools_page_wp-reset', |
| 98 | 98 | 'skip_hooks' => false, |
| 99 | - 'debug' => false, | |
| 99 | + 'debug' => true, | |
| 100 | 100 | 'js_folder' => plugin_dir_url(__FILE__) . '/js/' |
| 101 | 101 | )); |
| 102 | 102 | |
| 103 | 103 | add_action('admin_menu', array($this, 'admin_menu')); |
| @@ -106,9 +106,9 @@ | ||
| 106 | 106 | add_action('admin_action_wpr_dismiss_notice', array($this, 'action_dismiss_notice')); |
| 107 | 107 | add_action('wp_ajax_wp_reset_dismiss_notice', array($this, 'ajax_dismiss_notice')); |
| 108 | 108 | add_action('wp_ajax_wp_reset_run_tool', array($this, 'ajax_run_tool')); |
| 109 | 109 | add_action('admin_print_scripts', array($this, 'remove_admin_notices')); |
| 110 | - add_action('admin_action_wpr_install_wpcaptcha', array($this, 'install_wpcaptcha')); | |
| 110 | + add_action('admin_action_wpr_install_wpfssl', array($this, 'install_wpfssl')); | |
| 111 | 111 | |
| 112 | 112 | add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'plugin_action_links')); |
| 113 | 113 | add_filter('plugin_row_meta', array($this, 'plugin_meta_links'), 10, 2); |
| 114 | 114 | add_filter('admin_footer_text', array($this, 'admin_footer_text')); |
| @@ -375,9 +375,9 @@ | ||
| 375 | 375 | 'undocumented_error' => __('An undocumented error has occurred. Please refresh the page and try again.', 'wp-reset'), |
| 376 | 376 | 'documented_error' => __('An error has occurred.', 'wp-reset'), |
| 377 | 377 | 'plugin_name' => __('WP Reset', 'wp-reset'), |
| 378 | 378 | 'settings_url' => admin_url('tools.php?page=wp-reset'), |
| 379 | - 'wpcaptcha_install_url' => add_query_arg(array('action' => 'wpr_install_wpcaptcha', '_wpnonce' => wp_create_nonce('install_wpcaptcha'), 'rnd' => wp_rand()), admin_url('admin.php')), | |
| 379 | + 'wpfssl_install_url' => add_query_arg(array('action' => 'wpr_install_wpfssl', '_wpnonce' => wp_create_nonce('install_wpfssl'), 'rnd' => wp_rand()), admin_url('admin.php')), | |
| 380 | 380 | 'icon_url' => $this->plugin_url . 'img/wp-reset-icon.png', |
| 381 | 381 | 'invalid_confirmation' => __('Please type "reset" in the confirmation field.', 'wp-reset'), |
| 382 | 382 | 'invalid_confirmation_title' => __('Invalid confirmation', 'wp-reset'), |
| 383 | 383 | 'cancel_button' => __('Cancel', 'wp-reset'), |
| @@ -593,9 +593,9 @@ | ||
| 593 | 593 | function do_delete_uploads() |
| 594 | 594 | { |
| 595 | 595 | global $wp_filesystem; |
| 596 | 596 | $this->wp_init_filesystem(); |
| 597 | - | |
| 597 | + | |
| 598 | 598 | $upload_dir = wp_get_upload_dir(); |
| 599 | 599 | $this->delete_count = 0; |
| 600 | 600 | |
| 601 | 601 | if ( $wp_filesystem->is_dir( $upload_dir['basedir'] ) ) { |
| @@ -601,9 +601,9 @@ | ||
| 601 | 601 | if ( $wp_filesystem->is_dir( $upload_dir['basedir'] ) ) { |
| 602 | 602 | |
| 603 | 603 | // Get all files and directories in the folder. |
| 604 | 604 | $files = $wp_filesystem->dirlist( $upload_dir['basedir'] ); |
| 605 | - | |
| 605 | + | |
| 606 | 606 | // Loop through the files and delete them. |
| 607 | 607 | foreach ( $files as $file => $details ) { |
| 608 | 608 | $file_path = trailingslashit( $upload_dir['basedir'] ) . $file; |
| 609 | 609 | $wp_filesystem->delete( $file_path, true ); |
| @@ -944,9 +944,9 @@ | ||
| 944 | 944 | ) { |
| 945 | 945 | if(!isset($_GET['slug'])){ |
| 946 | 946 | wp_send_json_success('unknown plugin'); |
| 947 | 947 | } |
| 948 | - | |
| 948 | + | |
| 949 | 949 | $slug = sanitize_text_field(wp_unslash($_GET['slug'])); |
| 950 | 950 | $path = $this->get_plugin_path($slug); |
| 951 | 951 | |
| 952 | 952 | if (false !== ($error = get_transient('wf_install_error_' . $slug))) { |
| @@ -967,9 +967,9 @@ | ||
| 967 | 967 | } elseif ($tool == 'install_plugin') { |
| 968 | 968 | if(!isset($_GET['slug'])){ |
| 969 | 969 | wp_send_json_success('unknown plugin'); |
| 970 | 970 | } |
| 971 | - | |
| 971 | + | |
| 972 | 972 | $slug = sanitize_text_field(wp_unslash($_GET['slug'])); |
| 973 | 973 | |
| 974 | 974 | @include_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 975 | 975 | @include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; |
| @@ -994,9 +994,9 @@ | ||
| 994 | 994 | } elseif ($tool == 'activate_plugin') { |
| 995 | 995 | if(!isset($_GET['slug'])){ |
| 996 | 996 | wp_send_json_success('unknown plugin'); |
| 997 | 997 | } |
| 998 | - | |
| 998 | + | |
| 999 | 999 | $slug = sanitize_text_field(wp_unslash($_GET['slug'])); |
| 1000 | 1000 | |
| 1001 | 1001 | $path = $this->get_plugin_path($slug); |
| 1002 | 1002 | activate_plugin($path); |
| @@ -1192,9 +1192,9 @@ | ||
| 1192 | 1192 | } // do_all_actions |
| 1193 | 1193 | |
| 1194 | 1194 | |
| 1195 | 1195 | /** |
| 1196 | - * Add action links to plugins table, left part | |
| 1196 | + * Add "Open WP Reset Tools" action link to plugins table, left part | |
| 1197 | 1197 | * |
| 1198 | 1198 | * @param array $links Initial list of links. |
| 1199 | 1199 | * |
| 1200 | 1200 | * @return array |
| @@ -1202,11 +1202,8 @@ | ||
| 1202 | 1202 | function plugin_action_links($links) |
| 1203 | 1203 | { |
| 1204 | 1204 | $settings_link = '<a href="' . esc_url(admin_url('tools.php?page=wp-reset')) . '" title="' . esc_attr(__('Open WP Reset Tools', 'wp-reset')) . '">' . esc_html(__('Open WP Reset Tools', 'wp-reset')) . '</a>'; |
| 1205 | 1205 | |
| 1206 | - $upgrade_link = '<a href="' . esc_url(admin_url('tools.php?page=wp-reset#open-pro-dialog')) . '" title="' . esc_attr(__('Get WP Reset PRO', 'wp-reset')) . '"><b>' . esc_html(__('Get PRO', 'wp-reset')) . '</b></a>'; | |
| 1207 | - | |
| 1208 | - array_unshift($links, $upgrade_link); | |
| 1209 | 1206 | array_unshift($links, $settings_link); |
| 1210 | 1207 | |
| 1211 | 1208 | return $links; |
| 1212 | 1209 | } // plugin_action_links |
| @@ -1513,16 +1510,16 @@ | ||
| 1513 | 1510 | <li>White-label Mode + Complete Plugin Rebranding</li> |
| 1514 | 1511 | <li>Licenses & Sites Manager (remote SaaS dashboard)</li> |
| 1515 | 1512 | <li>Friendly email support from plugin developers</li> |
| 1516 | 1513 | </ul>'; |
| 1517 | - echo '<p class="textcenter"><a href="#" data-feature="sidebar-button" class="button-pro-feature button button-primary">Get PRO Now</a></p>'; | |
| 1514 | + echo '<p class="textcenter"><a href="#" data-feature="sidebar-button" class="button-pro-feature button button-primary">Get PRO now</a></p>'; | |
| 1518 | 1515 | echo '</div>'; |
| 1519 | 1516 | |
| 1520 | - if (!defined('WPCAPTCHA_PLUGIN_FILE')) { | |
| 1521 | - echo '<div id="wpcaptcha-ad">'; | |
| 1522 | - echo '<h3 class="textcenter"><b>Having problems with spam or bots? AI scapers giving you troubles?<br><br><u>Fix all your spam problems with one plugin!</u></b></h3>'; | |
| 1523 | - echo '<p class="textcenter"><a href="#" class="textcenter install-wpcaptcha"><img style="max-width: 90%;" src="' . esc_url($this->plugin_url) . '/img/wp-captcha-logo.png" alt="Advanced Google ReCaptcha" title="Advanced Google ReCaptcha"></a></p>'; | |
| 1524 | - echo '<p class="textcenter"><br><a href="#" class="install-wpcaptcha button button-primary">Install & activate the free Google ReCaptcha plugin</a></p><p><a href="https://wordpress.org/plugins/advanced-google-recaptcha/" target="_blank">Advanced Google ReCaptcha</a> is a free WP plugin maintained by the same team as WP Reset. It has <b>+200,000 users, 5-star rating</b>, and is hosted on the official WP repository.</p>'; | |
| 1517 | + if (!defined('WPFSSL_OPTIONS_KEY')) { | |
| 1518 | + echo '<div id="wpfssl-ad">'; | |
| 1519 | + echo '<h3 class="textcenter"><b>Problems with SSL certificate?<br>Moving a site from HTTP to HTTPS?<br>Mixed content giving you troubles?<br><br><u>Fix all SSL problems with one plugin!</u></b></h3>'; | |
| 1520 | + echo '<p class="textcenter"><a href="#" class="textcenter install-wpfssl"><img style="max-width: 90%;" src="' . esc_url($this->plugin_url) . '/img/wp-force-ssl-logo.png" alt="WP Force SSL" title="WP Force SSL"></a></p>'; | |
| 1521 | + echo '<p class="textcenter"><br><a href="#" class="install-wpfssl button button-primary">Install & activate the free WP Force SSL plugin</a></p><p><a href="https://wordpress.org/plugins/wp-force-ssl/" target="_blank">WP Force SSL</a> is a free WP plugin maintained by the same team as this Maintenance plugin. It has <b>+150,000 users, 5-star rating</b>, and is hosted on the official WP repository.</p>'; | |
| 1525 | 1522 | echo '</div>'; |
| 1526 | 1523 | } |
| 1527 | 1524 | echo '</div>'; |
| 1528 | 1525 | |
| @@ -1686,29 +1683,8 @@ | ||
| 1686 | 1683 | $theme_name = '<i>no active theme</i>'; |
| 1687 | 1684 | } |
| 1688 | 1685 | $active_plugins = get_option('active_plugins'); |
| 1689 | 1686 | |
| 1690 | - // nuclear reset | |
| 1691 | - echo '<div class="card">'; | |
| 1692 | - WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Nuclear Site Reset', 'wp-reset'), 'tool-nuclear-reset', array('collapse_button' => true, 'pro' => true))); | |
| 1693 | - echo '<div class="card-body">'; | |
| 1694 | - echo '<p>All data will be deleted or reset (see the <a href="#reset-details" class="scrollto">explanation table</a> for details). All data stored in the database including custom tables with <code>' . esc_html($wpdb->prefix) . '</code> prefix, as well as all files in wp-content, themes and plugins folders. The only thing restored after reset will be your user account so you can log in again, and the basic WP settings like site URL. Please see the <a href="#reset-details" class="scrollto">table above</a> for details.</p>'; | |
| 1695 | - | |
| 1696 | - WP_Reset_Utility::wp_kses_wf($this->get_tool_icons(true, true)); | |
| 1697 | - | |
| 1698 | - if (is_multisite()) { | |
| 1699 | - echo '<p class="mb0 wpmu-error">This tool is <b>not compatible</b> with WP multisite (WPMU). Using it would delete files shared by multiple sites in the WP network.</p>'; | |
| 1700 | - } else { | |
| 1701 | - echo '<p><br><label for="nuclear-reset-reactivate-wpreset"><input type="checkbox" id="nuclear-reset-reactivate-wpreset" value="1" checked> ' . esc_html__('Reactivate WP Reset plugin', 'wp-reset') . '</label></p>'; | |
| 1702 | - | |
| 1703 | - WP_Reset_Utility::wp_kses_wf('<p>' . __('Type <b>reset</b> in the confirmation field to confirm the reset and then click the "Reset WordPress & Delete All Custom Files & Data" button. <b>There is NO UNDO.', 'wp-reset') . '</b></p>'); | |
| 1704 | - | |
| 1705 | - echo '<p class="mb0"><input id="nuclear_reset_confirm" type="text" placeholder="' . esc_html__('Type in "reset"', 'wp-reset') . '" value="" autocomplete="off"> '; | |
| 1706 | - echo '<a class="button button-delete button-pro-feature" href="#">' . esc_html__('Reset WordPress & Delete All Custom Files & Data', 'wp-reset') . ' - <span data-feature="tool-nuclear-reset" class="pro-feature"><span class="pro">PRO</span> tool</span></a></p>'; | |
| 1707 | - } | |
| 1708 | - echo '</div>'; | |
| 1709 | - echo '</div>'; // nuclear reset | |
| 1710 | - | |
| 1711 | 1687 | // options reset |
| 1712 | 1688 | echo '<div class="card">'; |
| 1713 | 1689 | WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Options Reset', 'wp-reset'), 'tool-options-reset', array('collapse_button' => true, 'pro' => true))); |
| 1714 | 1690 | echo '<div class="card-body">'; |
| @@ -1739,8 +1715,29 @@ | ||
| 1739 | 1715 | WP_Reset_Utility::wp_kses_wf($this->get_snapshot_button('reset-wordpress', 'Before resetting the site')); |
| 1740 | 1716 | echo '</p>'; |
| 1741 | 1717 | echo '</div>'; |
| 1742 | 1718 | echo '</div>'; // card reset |
| 1719 | + | |
| 1720 | + // nuclear reset | |
| 1721 | + echo '<div class="card">'; | |
| 1722 | + WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Nuclear Site Reset', 'wp-reset'), 'tool-nuclear-reset', array('collapse_button' => true, 'pro' => true))); | |
| 1723 | + echo '<div class="card-body">'; | |
| 1724 | + echo '<p>All data will be deleted or reset (see the <a href="#reset-details" class="scrollto">explanation table</a> for details). All data stored in the database including custom tables with <code>' . esc_html($wpdb->prefix) . '</code> prefix, as well as all files in wp-content, themes and plugins folders. The only thing restored after reset will be your user account so you can log in again, and the basic WP settings like site URL. Please see the <a href="#reset-details" class="scrollto">table above</a> for details.</p>'; | |
| 1725 | + | |
| 1726 | + WP_Reset_Utility::wp_kses_wf($this->get_tool_icons(true, true)); | |
| 1727 | + | |
| 1728 | + if (is_multisite()) { | |
| 1729 | + echo '<p class="mb0 wpmu-error">This tool is <b>not compatible</b> with WP multisite (WPMU). Using it would delete files shared by multiple sites in the WP network.</p>'; | |
| 1730 | + } else { | |
| 1731 | + echo '<p><br><label for="nuclear-reset-reactivate-wpreset"><input type="checkbox" id="nuclear-reset-reactivate-wpreset" value="1" checked> ' . esc_html__('Reactivate WP Reset plugin', 'wp-reset') . '</label></p>'; | |
| 1732 | + | |
| 1733 | + WP_Reset_Utility::wp_kses_wf('<p>' . __('Type <b>reset</b> in the confirmation field to confirm the reset and then click the "Reset WordPress & Delete All Custom Files & Data" button. <b>There is NO UNDO.', 'wp-reset') . '</b></p>'); | |
| 1734 | + | |
| 1735 | + echo '<p class="mb0"><input id="nuclear_reset_confirm" type="text" placeholder="' . esc_html__('Type in "reset"', 'wp-reset') . '" value="" autocomplete="off"> '; | |
| 1736 | + echo '<a class="button button-delete button-pro-feature" href="#">' . esc_html__('Reset WordPress & Delete All Custom Files & Data', 'wp-reset') . ' - <span data-feature="tool-nuclear-reset" class="pro-feature"><span class="pro">PRO</span> tool</span></a></p>'; | |
| 1737 | + } | |
| 1738 | + echo '</div>'; | |
| 1739 | + echo '</div>'; // nuclear reset | |
| 1743 | 1740 | } // tab_reset |
| 1744 | 1741 | |
| 1745 | 1742 | |
| 1746 | 1743 | /** |
| @@ -2242,9 +2239,9 @@ | ||
| 2242 | 2239 | $out .= '<td class="center">Lifetime Agency License</td>'; |
| 2243 | 2240 | $out .= '</tr>'; |
| 2244 | 2241 | |
| 2245 | 2242 | $out .= '<tr class="prices">'; |
| 2246 | - $out .= '<td class="center"><del>$59 /year</del><br><span>$59</span> <b>/lifetime</b></td>'; | |
| 2243 | + $out .= '<td class="center"><del>$39 /year</del><br><span>$59</span> <b>/lifetime</b></td>'; | |
| 2247 | 2244 | $out .= '<td class="center"><del>$79 /year</del><br><span>$69</span> <b>/lifetime</b></td>'; |
| 2248 | 2245 | $out .= '<td class="center"><del>$119 /year</del><br><span>$149</span> <b>/lifetime</b></td>'; |
| 2249 | 2246 | $out .= '</tr>'; |
| 2250 | 2247 | |
| @@ -2314,9 +2311,10 @@ | ||
| 2314 | 2311 | $out .= '<td><span class="dashicons dashicons-yes"></span>Full Plugin Rebranding</td>'; |
| 2315 | 2312 | $out .= '</tr>'; |
| 2316 | 2313 | |
| 2317 | 2314 | $out .= '<tr>'; |
| 2318 | - $out .= '<td><a class="button button-buy" data-href-org="https://wpreset.com/buy2/?product=personal-free&ref=pricing-table" href="https://wpreset.com/buy2/?product=personal-free&ref=pricing-table" target="_blank">Lifetime License<br>$59 -> BUY NOW</a></td>'; | |
| 2315 | + $out .= '<td><a class="button button-buy" data-href-org="https://wpreset.com/buy2/?product=personal-free&ref=pricing-table" href="https://wpreset.com/buy2/?product=personal-free&ref=pricing-table" target="_blank">Lifetime License<br>$59 -> BUY NOW</a> | |
| 2316 | + <br>or <a class="button-buy" data-href-org="https://wpreset.com/buy2/?product=personal-monthly&ref=pricing-table" href="https://wpreset.com/buy2/?product=personal-monthly&ref=pricing-table" target="_blank">only $6.99 <small>/month</small></a></td>'; | |
| 2319 | 2317 | $out .= '<td><a class="button button-buy" data-href-org="https://wpreset.com/buy2/?product=team-free&ref=pricing-table" href="https://wpreset.com/buy2/?product=team-free&ref=pricing-table" target="_blank">Lifetime License<br>$69 -> BUY NOW</a></td>'; |
| 2320 | 2318 | $out .= '<td><a class="button button-buy" data-href-org="https://wpreset.com/buy2/?product=agency-free&ref=pricing-table" href="https://wpreset.com/buy2/?product=agency-free&ref=pricing-table" target="_blank">Lifetime License<br>$149 -> BUY NOW</a></td>'; |
| 2321 | 2319 | $out .= '</tr>'; |
| 2322 | 2320 | |
| @@ -2321,12 +2319,10 @@ | ||
| 2321 | 2319 | $out .= '</tr>'; |
| 2322 | 2320 | |
| 2323 | 2321 | $out .= '</table>'; |
| 2324 | 2322 | |
| 2325 | - $out .= '<div class="upsell-footer-2">Need the plugin only for a <b>short period of time</b>? <a class="button-buy" target="_blank" data-href-org="https://wpreset.com/buy2/?product=personal-monthly&ref=pricing-table" href="https://wpreset.com/buy2/?product=personal-monthly&ref=pricing-table"><b>Get it for ONLY $9.99</b><small> /month</small></a> & cancel any time!</div>'; | |
| 2323 | + $out .= '<div class="center footer"><b>100% No-Risk Money Back Guarantee!</b> If you don\'t like the plugin over the next 7 days, we will happily refund 100% of your money. No questions asked! Payments are processed by our merchant of records - <a href="https://paddle.com/" target="_blank">Paddle</a>.</div></div>'; | |
| 2326 | 2324 | |
| 2327 | - $out .= '<div class="footer"><b>100% No-Risk Money Back Guarantee!</b> If you don\'t like the plugin over the next 7 days, we will happily refund 100% of your money. No questions asked! Payments are processed by our merchant of records - <a href="https://paddle.com/" target="_blank">Paddle</a>.</div></div>'; | |
| 2328 | - | |
| 2329 | 2325 | return $out; |
| 2330 | 2326 | } // pro_dialog |
| 2331 | 2327 | |
| 2332 | 2328 | |
| @@ -2584,9 +2580,9 @@ | ||
| 2584 | 2580 | } |
| 2585 | 2581 | |
| 2586 | 2582 | $wpdb->wpreset_snapshot_table_name = $table->Name; |
| 2587 | 2583 | $wpdb->wpreset_snapshot_table_copy_name = $uid . '_' . $table->Name; |
| 2588 | - | |
| 2584 | + | |
| 2589 | 2585 | // phpcs:ignore db call warning as we are using uncommon queries |
| 2590 | 2586 | $wpdb->query("OPTIMIZE TABLE " . $wpdb->wpreset_snapshot_table_name); // phpcs:ignore |
| 2591 | 2587 | $wpdb->query("CREATE TABLE " . $wpdb->wpreset_snapshot_table_copy_name . " LIKE " . $wpdb->wpreset_snapshot_table_name); // phpcs:ignore |
| 2592 | 2588 | $wpdb->query("INSERT " . $wpdb->wpreset_snapshot_table_copy_name . " SELECT * FROM " . $wpdb->wpreset_snapshot_table_name); // phpcs:ignore |
| @@ -2657,9 +2653,9 @@ | ||
| 2657 | 2653 | function do_export_snapshot($uid = '') |
| 2658 | 2654 | { |
| 2659 | 2655 | global $wp_filesystem; |
| 2660 | 2656 | $this->wp_init_filesystem(); |
| 2661 | - | |
| 2657 | + | |
| 2662 | 2658 | $snapshots = $this->get_snapshots(); |
| 2663 | 2659 | |
| 2664 | 2660 | if (strlen($uid) != 6) { |
| 2665 | 2661 | return new WP_Error(1, 'Invalid snapshot ID format.'); |
| @@ -3055,19 +3051,19 @@ | ||
| 3055 | 3051 | return $uid; |
| 3056 | 3052 | } // generate_snapshot_uid |
| 3057 | 3053 | |
| 3058 | 3054 | |
| 3059 | - // auto download / install / activate WP Captcha plugin | |
| 3060 | - function install_wpcaptcha() | |
| 3055 | + // auto download / install / activate WP Force SSL plugin | |
| 3056 | + function install_wpfssl() | |
| 3061 | 3057 | { |
| 3062 | - check_ajax_referer('install_wpcaptcha'); | |
| 3058 | + check_ajax_referer('install_wpfssl'); | |
| 3063 | 3059 | |
| 3064 | 3060 | if (false === current_user_can('manage_options')) { |
| 3065 | 3061 | wp_die('Sorry, you have to be an admin to run this action.'); |
| 3066 | 3062 | } |
| 3067 | 3063 | |
| 3068 | - $plugin_slug = 'advanced-google-recaptcha/advanced-google-recaptcha.php'; | |
| 3069 | - $plugin_zip = 'https://downloads.wordpress.org/plugin/advanced-google-recaptcha.latest-stable.zip'; | |
| 3064 | + $plugin_slug = 'wp-force-ssl/wp-force-ssl.php'; | |
| 3065 | + $plugin_zip = 'https://downloads.wordpress.org/plugin/wp-force-ssl.latest-stable.zip'; | |
| 3070 | 3066 | |
| 3071 | 3067 | @include_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 3072 | 3068 | @include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; |
| 3073 | 3069 | @include_once ABSPATH . 'wp-admin/includes/plugin-install.php'; |
| @@ -3082,40 +3078,40 @@ | ||
| 3082 | 3078 | } |
| 3083 | 3079 | </style>'; |
| 3084 | 3080 | |
| 3085 | 3081 | echo '<div style="margin: 20px; color:#444;">'; |
| 3086 | - echo 'If things are not done in a minute <a target="_parent" href="' . esc_url(admin_url('plugin-install.php?s=google%20recaptcha%20webfactory&tab=search&type=term')) . '">install the plugin manually via Plugins page</a><br><br>'; | |
| 3082 | + echo 'If things are not done in a minute <a target="_parent" href="' . esc_url(admin_url('plugin-install.php?s=force%20ssl%20webfactory&tab=search&type=term')) . '">install the plugin manually via Plugins page</a><br><br>'; | |
| 3087 | 3083 | echo 'Starting ...<br><br>'; |
| 3088 | 3084 | |
| 3089 | 3085 | wp_cache_flush(); |
| 3090 | 3086 | $upgrader = new Plugin_Upgrader(); |
| 3091 | - echo 'Check if Advanced Google ReCaptcha is already installed ... <br />'; | |
| 3087 | + echo 'Check if WP Force SSL is already installed ... <br />'; | |
| 3092 | 3088 | if ($this->is_plugin_installed($plugin_slug)) { |
| 3093 | - echo 'Advanced Google ReCaptcha is already installed! <br /><br />Making sure it\'s the latest version.<br />'; | |
| 3089 | + echo 'WP Force SSL is already installed! <br /><br />Making sure it\'s the latest version.<br />'; | |
| 3094 | 3090 | $upgrader->upgrade($plugin_slug); |
| 3095 | 3091 | $installed = true; |
| 3096 | 3092 | } else { |
| 3097 | - echo 'Installing Advanced Google ReCaptcha.<br />'; | |
| 3093 | + echo 'Installing WP Force SSL.<br />'; | |
| 3098 | 3094 | $installed = $upgrader->install($plugin_zip); |
| 3099 | 3095 | } |
| 3100 | 3096 | wp_cache_flush(); |
| 3101 | 3097 | |
| 3102 | 3098 | if (!is_wp_error($installed) && $installed) { |
| 3103 | - echo 'Activating Advanced Google ReCaptcha.<br />'; | |
| 3099 | + echo 'Activating WP Force SSL.<br />'; | |
| 3104 | 3100 | $activate = activate_plugin($plugin_slug); |
| 3105 | 3101 | |
| 3106 | 3102 | if (is_null($activate)) { |
| 3107 | - echo 'Advanced Google ReCaptcha Activated.<br />'; | |
| 3103 | + echo 'WP Force SSL Activated.<br />'; | |
| 3108 | 3104 | |
| 3109 | 3105 | echo '<script>setTimeout(function() { top.location = "tools.php?page=wp-reset"; }, 1000);</script>'; |
| 3110 | 3106 | echo '<br>If you are not redirected in a few seconds - <a href="tools.php?page=wp-reset" target="_parent">click here</a>.'; |
| 3111 | 3107 | } |
| 3112 | 3108 | } else { |
| 3113 | - echo 'Could not install Advanced Google ReCaptcha. You\'ll have to <a target="_parent" href="' . esc_url(admin_url('plugin-install.php?s=google%20recaptcha%20webfactory&tab=search&type=term')) . '">download and install manually</a>.'; | |
| 3109 | + echo 'Could not install WP Force SSL. You\'ll have to <a target="_parent" href="' . esc_url(admin_url('plugin-install.php?s=force%20ssl%20webfactory&tab=search&type=term')) . '">download and install manually</a>.'; | |
| 3114 | 3110 | } |
| 3115 | 3111 | |
| 3116 | 3112 | echo '</div>'; |
| 3117 | - } // install_wpcaptcha | |
| 3113 | + } // install_wpfssl | |
| 3118 | 3114 | |
| 3119 | 3115 | /** |
| 3120 | 3116 | * Initializes the WordPress filesystem. |
| 3121 | 3117 | * |