| 1 |
<?php |
| 2 |
|
| 3 |
/* |
| 4 |
Plugin Name: Advanced WP Reset |
| 5 |
Plugin URI: https://sigmaplugin.com/ |
| 6 |
Description: The ultimate solution for resetting your WordPress database or specific components to their default settings using the advanced reset features. |
| 7 |
Version: 2.0.6 |
| 8 |
Requires at least: 4.0 |
| 9 |
Author: SigmaPlugin |
| 10 |
Author URI: https://sigmaplugin.com/ |
| 11 |
Text Domain: advanced-wp-reset |
| 12 |
Domain Path: /languages/ |
| 13 |
License: GPLv2 or later |
| 14 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html |
| 15 |
*/ |
| 16 |
|
| 17 |
if ( defined("AWR_IS_PRO_VERSION") and AWR_IS_PRO_VERSION === 1 ) { |
| 18 |
|
| 19 |
|
| 20 |
// Ensure the needed functions are available |
| 21 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 22 |
|
| 23 |
// Show warning |
| 24 |
add_action('admin_notices', 'awr_activation_warning' ); |
| 25 |
|
| 26 |
// For not showing "Plugin activated". |
| 27 |
add_filter('wp_redirect', 'awr_custom_plugin_activation_redirect', 10, 2); |
| 28 |
|
| 29 |
// Deactivate the plugin |
| 30 |
deactivate_plugins(plugin_basename(__FILE__)); |
| 31 |
|
| 32 |
|
| 33 |
} else { |
| 34 |
|
| 35 |
require_once 'advanced-wp-reset.class.php'; |
| 36 |
require_once 'free-config.inc.php'; |
| 37 |
require_once 'config.inc.php'; |
| 38 |
|
| 39 |
if ( class_exists ( 'AWR_Application' ) ){ |
| 40 |
$awr_object = new AWR_Application(); |
| 41 |
|
| 42 |
// Activation |
| 43 |
register_activation_hook ( __FILE__, array ( $awr_object, 'activate' ) ); |
| 44 |
|
| 45 |
// Deactivation |
| 46 |
register_deactivation_hook ( __FILE__, array ( $awr_object, 'deactivate' ) ); |
| 47 |
} |
| 48 |
|
| 49 |
} |
| 50 |
|
| 51 |
function awr_activation_warning() { |
| 52 |
?> |
| 53 |
<div class="notice notice-warning is-dismissible"> |
| 54 |
<p><?php _e('You already have <b>Advanced WP Reset PRO</b>, which includes all the features of the free version. If you wish to activate the free version for any reason, please deactivate the PRO version first and then activate the free version.', 'advanced-wp-reset'); ?></p> |
| 55 |
</div> |
| 56 |
<?php |
| 57 |
} |
| 58 |
|
| 59 |
function awr_custom_plugin_activation_redirect($location, $status) { |
| 60 |
return remove_query_arg('activate', $location); |
| 61 |
} |