PluginProbe ʕ •ᴥ•ʔ
File Manager Pro – Filester / 2.1.1
File Manager Pro – Filester v2.1.1
2.1.1 trunk 1.6.1 1.7.6 1.8 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9 2.0 2.0.1 2.0.2 2.1.0
filester / includes / Plugin.php
filester / includes Last commit date
File_manager 1 month ago Recommended 1 month ago I18n.php 1 month ago Plugin.php 1 month ago cross.php 1 month ago functions.php 1 month ago index.php 1 month ago
Plugin.php
52 lines
1 <?php
2 namespace NinjaFileManager;
3
4 defined('ABSPATH') || exit;
5 /**
6 * Plugin activate/deactivate logic
7 */
8 class Plugin {
9 protected static $instance = null;
10
11 public static function getInstance() {
12 if (null == self::$instance) {
13 self::$instance = new self;
14 }
15
16 return self::$instance;
17 }
18
19 private function __construct() {
20 add_action('plugins_loaded', array($this, 'loadPluginCross'));
21 }
22
23 public function loadPluginCross() {
24 \FileBirdCross::get_instance('filebird', 'filebird+ninjateam', NJT_FS_BN_PLUGIN_URL, array('filebird/filebird.php', 'filebird-pro/filebird.php'));
25 }
26
27 /** Plugin activated hook */
28 public static function activate() {
29 $first_time_active = get_option('njt_fs_first_time_active');
30 $njt_fs_review = get_option('njt_fs_review');
31
32 if ($first_time_active === false) {
33 update_option('njt_fs_first_time_active', 1);
34 if ($njt_fs_review !== false) return;
35 update_option('njt_fs_review', time() + 3*60*60*24); //After 3 days show
36 }
37
38 $current_version = get_option('njt_fs_version');
39 if ( version_compare(NJT_FS_BN_VERSION, $current_version, '>') ) {
40 $filebirdCross = \FileBirdCross::get_instance('filebird', 'filebird+ninjateam', NJT_FS_BN_PLUGIN_URL, array('filebird/filebird.php', 'filebird-pro/filebird.php'));
41 $filebirdCross->need_update_option();
42 update_option('njt_fs_version', NJT_FS_BN_VERSION);
43 if ($njt_fs_review !== false) return;
44 update_option('njt_fs_review', time() + 3*60*60*24); //After 3 days show
45 }
46 }
47
48 /** Plugin deactivate hook */
49 public static function deactivate() {
50 }
51 }
52