PluginProbe
FileBird – WordPress Media Library Folders & File Manager / 5.5
FileBird – WordPress Media Library Folders & File Manager v5.5
6.5.8 6.5.7 6.5.5 6.5.4 trunk 4.3.1 5.1.6 5.3 5.3.2 5.4.3 5.4.4 5.4.5 5.5 5.5.3 5.5.5 5.5.8 5.5.8.1 5.6 5.6.1 5.6.2 5.6.3 5.6.4 6.2.3 6.2.5 6.3 All 36 releases
filebird / includes / Plugin.php

Plugin.php in FileBird – WordPress Media Library Folders & File Manager 5.5, at includes/Plugin.php

51 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace FileBird;
3
4 defined( 'ABSPATH' ) || exit;
5
6 use FileBird\Classes\Review;
7 use FileBird\Classes\Schedule as FilebirdSchedule;
8 use FileBird\Install;
9 /**
10 * Plugin activate/deactivate logic
11 */
12 class Plugin {
13 protected static $instance = null;
14
15 public static function getInstance() {
16 if ( null == self::$instance ) {
17 self::$instance = new self();
18 }
19
20 return self::$instance;
21 }
22
23 private function __construct() {
24 }
25
26 public static function prepareRun() {
27 $current_version = get_option( 'fbv_version' );
28 if ( version_compare( NJFB_VERSION, $current_version, '>' ) ) {
29 self::activate();
30 update_option( 'fbv_version', NJFB_VERSION );
31 Review::update_time_display();
32 }
33 }
34
35 /** Plugin activated hook */
36 public static function activate() {
37 $first_time_active = get_option( 'fbv_first_time_active' );
38 if ( $first_time_active === false ) {
39 update_option( 'fbv_is_new_user', 1 );
40 update_option( 'fbv_first_time_active', 1 );
41 }
42 Install::create_tables();
43 FilebirdSchedule::clearSchedule();
44 }
45
46 /** Plugin deactivate hook */
47 public static function deactivate() {
48 FilebirdSchedule::clearSchedule();
49 }
50 }
51