| 1 |
<?php |
| 2 |
namespace NjtNotificationBar; |
| 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_NOFI_PLUGIN_URL, array('filebird/filebird.php', 'filebird-pro/filebird.php')); |
| 25 |
} |
| 26 |
|
| 27 |
/** Plugin activated hook */ |
| 28 |
public static function activate() { |
| 29 |
|
| 30 |
$first_time_active = get_option('njt_nofi_first_time_active'); |
| 31 |
$njt_nofi_review = get_option('njt_nofi_review'); |
| 32 |
|
| 33 |
if ($first_time_active === false) { |
| 34 |
update_option('njt_nofi_first_time_active', 1); |
| 35 |
if ($njt_nofi_review !== false) return; |
| 36 |
update_option('njt_nofi_review', time() + 3*60*60*24); //After 3 days show |
| 37 |
} |
| 38 |
} |
| 39 |
|
| 40 |
/** Plugin deactivate hook */ |
| 41 |
public static function deactivate() { |
| 42 |
} |
| 43 |
} |