| @@ -1,18 +1,16 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace Templately\Core; |
| 4 | 4 | |
| 5 | -use Templately\Admin\Roles; | |
| 6 | - | |
| 7 | 5 | class Maintenance { |
| 8 | 6 | /** |
| 9 | 7 | * Init Maintenance |
| 10 | 8 | * |
| 9 | + * @since 2.0.1 | |
| 11 | 10 | * @return void |
| 12 | - * @since 2.0.1 | |
| 13 | 11 | */ |
| 14 | - public static function init() { | |
| 12 | + public static function init(){ | |
| 15 | 13 | register_activation_hook( TEMPLATELY_PLUGIN_BASENAME, [ __CLASS__, 'activation' ] ); |
| 16 | 14 | register_uninstall_hook( TEMPLATELY_PLUGIN_BASENAME, [ __CLASS__, 'uninstall' ] ); |
| 17 | 15 | register_deactivation_hook( TEMPLATELY_PLUGIN_BASENAME, [ __CLASS__, 'deactivation' ] ); |
| 18 | 16 | add_action( 'admin_init', [ __CLASS__, 'maybe_redirect_templately' ] ); |
| @@ -20,35 +18,15 @@ | ||
| 20 | 18 | |
| 21 | 19 | /** |
| 22 | 20 | * Runs on activation |
| 23 | 21 | * |
| 24 | - * @return void | |
| 25 | 22 | * @since 2.0.1 |
| 26 | 23 | */ |
| 27 | 24 | public static function activation( $network_wide ) { |
| 28 | - // Initialize Roles | |
| 29 | - ( new Roles() )->setup(); | |
| 30 | - | |
| 31 | 25 | if ( wp_doing_ajax() ) { |
| 32 | 26 | return; |
| 33 | 27 | } |
| 34 | 28 | |
| 35 | - if ( is_multisite() && $network_wide ) { | |
| 36 | - return; | |
| 37 | - } | |
| 38 | - | |
| 39 | - set_transient( 'templately_activation_redirect', true, MINUTE_IN_SECONDS ); | |
| 40 | - } | |
| 41 | - | |
| 42 | - /** | |
| 43 | - * Runs on activation | |
| 44 | - * | |
| 45 | - * @return void | |
| 46 | - * @since 2.0.1 | |
| 47 | - */ | |
| 48 | - public static function deactivation($network_wide) { | |
| 49 | - // De-initialize Roles | |
| 50 | - ( new Roles() )->setup( true ); | |
| 51 | 29 | if ( is_multisite() && $network_wide ) { |
| 52 | 30 | return; |
| 53 | 31 | } |
| 54 | 32 | |
| @@ -54,16 +32,18 @@ | ||
| 54 | 32 | |
| 55 | 33 | set_transient( 'templately_activation_redirect', true, MINUTE_IN_SECONDS ); |
| 56 | 34 | } |
| 57 | 35 | |
| 36 | + public static function deactivation() { | |
| 37 | + } | |
| 58 | 38 | |
| 59 | 39 | /** |
| 60 | 40 | * Runs on uninstallation. |
| 61 | 41 | * |
| 42 | + * @since 2.0.1 | |
| 62 | 43 | * @return void |
| 63 | - * @since 2.0.1 | |
| 64 | 44 | */ |
| 65 | - public static function uninstall() { | |
| 45 | + public static function uninstall(){ | |
| 66 | 46 | |
| 67 | 47 | } |
| 68 | 48 | |
| 69 | 49 | /** |