PluginProbe ʕ •ᴥ•ʔ
WP Chat App / trunk
WP Chat App vtrunk
3.8.1 3.8.2 trunk 2.6 3.4 3.4.1 3.4.2 3.4.4 3.4.5 3.4.6 3.5 3.6 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.6.9 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.8.0
wp-whatsapp / includes / Plugin.php
wp-whatsapp / includes Last commit date
Support 3 months ago Cross.php 2 months ago Fallback.php 2 years ago Fields.php 1 year ago Helper.php 2 years ago I18n.php 2 years ago Plugin.php 2 months ago Popup.php 3 months ago PostType.php 3 months ago Review.php 1 year ago Settings.php 1 year ago Shortcode.php 2 years ago Upgrade.php 1 year ago
Plugin.php
48 lines
1 <?php
2 namespace NTA_WhatsApp;
3
4 defined( 'ABSPATH' ) || exit;
5 class Plugin {
6 protected static $instance = null;
7
8 public static function getInstance() {
9 if ( null === self::$instance ) {
10 self::$instance = new self();
11 }
12
13 return self::$instance;
14 }
15
16 private function __construct() {
17 }
18
19 public static function activate() {
20 $firstTimeActive = get_option( 'njt_wa_first_time_active' );
21 if ( $firstTimeActive === false ) {
22 $waReview = \NJTWhatsAppReview::get_instance( 'njt_wa', 'WhatsApp Plugin', 'wp-whatsapp' );
23 $waReview->need_update_option( 1 ); // 1 day
24 update_option( 'njt_wa_first_time_active', 1 );
25 }
26
27 $currentVersion = get_option( 'njt_wa_version' );
28 if ( version_compare( NTA_WHATSAPP_VERSION, $currentVersion, '>' ) ) {
29
30 if ( $firstTimeActive !== false ) {
31 $waReview = \NJTWhatsAppReview::get_instance( 'njt_wa', 'WhatsApp Plugin', 'wp-whatsapp' );
32 $waReview->need_update_option( 7 ); // 1 day
33 }
34
35 update_option( 'njt_wa_version', NTA_WHATSAPP_VERSION );
36 }
37
38 // Add capability for administrator
39 $role = get_role( 'administrator' );
40 if ( $role ) {
41 $role->add_cap( 'nta_wa_manage' );
42 }
43 }
44
45 public static function deactivate() {
46 }
47 }
48