Recommended
1 year ago
Support
1 year ago
Cross.php
1 year ago
Fallback.php
1 year ago
Fields.php
1 year ago
Helper.php
1 year ago
I18n.php
1 year ago
Plugin.php
1 year ago
Popup.php
1 year ago
PostType.php
1 year ago
Review.php
1 year ago
Settings.php
1 year ago
Shortcode.php
1 year ago
Upgrade.php
1 year ago
Plugin.php
46 lines
| 1 | <?php |
| 2 | namespace NTA_WhatsApp; |
| 3 | |
| 4 | use FileBirdCross; |
| 5 | |
| 6 | defined( 'ABSPATH' ) || exit; |
| 7 | class Plugin { |
| 8 | protected static $instance = null; |
| 9 | |
| 10 | public static function getInstance() { |
| 11 | if ( null === self::$instance ) { |
| 12 | self::$instance = new self(); |
| 13 | } |
| 14 | |
| 15 | return self::$instance; |
| 16 | } |
| 17 | |
| 18 | private function __construct() { |
| 19 | } |
| 20 | |
| 21 | public static function activate() { |
| 22 | $firstTimeActive = get_option( 'njt_wa_first_time_active' ); |
| 23 | if ( $firstTimeActive === false ) { |
| 24 | $waReview = \NJTWhatsAppReview::get_instance( 'njt_wa', 'WhatsApp Plugin', 'wp-whatsapp' ); |
| 25 | $waReview->need_update_option( 1 ); // 1 day |
| 26 | update_option( 'njt_wa_first_time_active', 1 ); |
| 27 | } |
| 28 | |
| 29 | $currentVersion = get_option( 'njt_wa_version' ); |
| 30 | if ( version_compare( NTA_WHATSAPP_VERSION, $currentVersion, '>' ) ) { |
| 31 | $filebirdCross = \FileBirdCross::get_instance( 'filebird', 'filebird+ninjateam', NTA_WHATSAPP_PLUGIN_URL, array( 'filebird/filebird.php', 'filebird-pro/filebird.php' ) ); |
| 32 | $filebirdCross->need_update_option(); |
| 33 | |
| 34 | if ( $firstTimeActive !== false ) { |
| 35 | $waReview = \NJTWhatsAppReview::get_instance( 'njt_wa', 'WhatsApp Plugin', 'wp-whatsapp' ); |
| 36 | $waReview->need_update_option( 7 ); // 1 day |
| 37 | } |
| 38 | |
| 39 | update_option( 'njt_wa_version', NTA_WHATSAPP_VERSION ); |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | public static function deactivate() { |
| 44 | } |
| 45 | } |
| 46 |