HEX
Server: Apache/2.4.65 (Debian)
System: Linux kubikelcreative 5.10.0-35-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64
User: www-data (33)
PHP: 8.4.13
Disabled: NONE
Upload Files
File: /var/www/indoadvisory/wp/wp-content/plugins/whatsapp-for-wordpress-/includes/Plugin.php
<?php
namespace NTA_WhatsApp;

defined( 'ABSPATH' ) || exit;
class Plugin {
	protected static $instance = null;

	public static function getInstance() {
		if ( null == self::$instance ) {
			self::$instance = new self();
		}

		return self::$instance;
	}

	private function __construct() {
	}

	public static function activate() {
		$firstTimeActive = get_option( 'njt_wa_first_time_active' );
		if ( $firstTimeActive === false ) {
			$waReview = \NJTWhatsAppReview::get_instance( 'njt_wa', 'WhatsApp Plugin', 'ninjateam-whatsapp' );
			$waReview->need_update_option( 1 ); // 1 day
			update_option( 'njt_wa_first_time_active', 1 );
		}

		$currentVersion = get_option( 'njt_wa_version' );
		if ( version_compare( NTA_WHATSAPP_VERSION, $currentVersion, '>' ) ) {
			// $filebirdCross = \FileBirdCross::get_instance('filebird', 'filebird+ninjateam', NTA_WHATSAPP_PLUGIN_URL, array('filebird/filebird.php', 'filebird-pro/filebird.php'));
			// $filebirdCross->need_update_option();

			if ( $firstTimeActive !== false ) {
				$waReview = \NJTWhatsAppReview::get_instance( 'njt_wa', 'WhatsApp Plugin', 'ninjateam-whatsapp' );
				$waReview->need_update_option( 7 ); // 1 day
			}

			update_option( 'njt_wa_version', NTA_WHATSAPP_VERSION );
		}

		// Add capability for administrator
		$role = get_role( 'administrator' );
		if ( $role ) {
			$role->add_cap( 'nta_wa_manage' );
		}
	}

	public static function deactivate() {
	}
}