|
Server : LiteSpeed System : Linux premium92.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 User : rbnsfqys ( 805) PHP Version : 8.1.33 Disable Function : NONE Directory : /home/rbnsfqys/ali.rbn.services/wp-content/plugins/Repairplugin-pro/ |
<?php
if(!class_exists("RP_EnhancedLocationsAddon")) {
class RP_EnhancedLocationsAddon {
public $plugin_file=WP_REPAIR_PLUGIN_FILE;
public $responseObj;
public $licenseMessage;
public $showMessage=false;
public static $constructorCalled = FALSE;
public static $licenseObject = NULL;
public function __construct() {
if (self::$constructorCalled === TRUE) {
return;
}
self::$constructorCalled = TRUE;
$licenseKey=rp_get_option("Repairplugin_el_lic_Key","");
$liceEmail=rp_get_option( "Repairplugin_el_lic_email","");
RepairpluginEnhanced::addOnDelete(function(){
rp_delete_option("Repairplugin_el_lic_Key");
});
if( !empty( $licenseKey ) ) {
if(RepairpluginEnhanced::CheckWPPlugin($licenseKey,$liceEmail,$this->licenseMessage,$this->responseObj,WP_REPAIR_PLUGIN_FILE)){
define('WP_REPAIR_ENHANCED_LICENSE_OBJECT', TRUE);
self::$licenseObject = $this->responseObj;
}else{
define('WP_REPAIR_REQUIRE_ENHANCED_LICENSE', TRUE);
if(!empty($licenseKey) && !empty($this->licenseMessage)){
define('WP_REPAIR_ENHANCED_LICENSE_MESSAGE', $this->licenseMessage);
}
rp_update_option("Repairplugin_el_lic_Key","");
}
} else {
define('WP_REPAIR_REQUIRE_ENHANCED_LICENSE', TRUE);
}
}
public static function activate_license( $licenseKey = '', $liceEmail = '' ) {
if( !self::$constructorCalled ) {
// call the constructor
new RP_EnhancedLocationsAddon();
}
if( rp_get_option('Repairplugin_el_lic_Key', FALSE) === FALSE ) {
// add
rp_add_option('Repairplugin_el_lic_Key', $licenseKey);
} else {
// update
rp_update_option('Repairplugin_el_lic_Key', $licenseKey);
}
if( rp_get_option('Repairplugin_el_lic_email', FALSE) === FALSE ) {
// add
rp_add_option('Repairplugin_el_lic_email', $liceEmail);
} else {
// update
rp_update_option('Repairplugin_el_lic_email', $liceEmail);
}
}
public static function deactivate_license() {
if( !self::$constructorCalled ) {
// call the constructor
new RP_EnhancedLocationsAddon();
}
$message="";
if(RepairpluginEnhanced::RemoveLicenseKey(WP_REPAIR_PLUGIN_FILE,$message)){
}
rp_update_option("Repairplugin_el_lic_Key","");
}
public static function is_active() {
if( !self::$constructorCalled ) {
// call the constructor
new RP_EnhancedLocationsAddon();
}
return !defined("WP_REPAIR_REQUIRE_ENHANCED_LICENSE") && !empty( rp_get_option("Repairplugin_el_lic_Key","") ) && !empty( self::$licenseObject );
}
public static function get_limit() {
if( !self::$constructorCalled ) {
// call the constructor
new RP_EnhancedLocationsAddon();
}
if( !self::is_active() || empty( self::$licenseObject ) ) {
return 0;
}
// RepairPlugin Enhanced Locations UNL Month
// RepairPlugin Enhanced Locations 100 Month
// RepairPlugin Enhanced Locations 50 Month
// RepairPlugin Enhanced Locations 25 Month
// RepairPlugin Enhanced Locations 10 Month
// RepairPlugin Enhanced Locations 5 Month
$license_title = strtolower( self::$licenseObject->license_title ?? '' );
if( strpos( $license_title , 'unl' ) !== FALSE ) {
return false;
}
$target = array('100', '50', '25', '10', '5');
foreach( $target as $t ) {
if( strpos( $license_title , $t ) !== FALSE ) {
return (int) $t;
}
}
return 0;
}
}
}