Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php /** * This file is a part of the miniorange-saml-20-single-sign-on plugin. * ..
Decoded Output download
<?php
/**
* This file is a part of the miniorange-saml-20-single-sign-on plugin.
*
* @link https://plugins.miniorange.com/
* @author miniOrange
* @package miniorange-saml-20-single-sign-on
*/
namespace MOSAML\LicenseLibrary;
define("MO_LICENSE_LIBRARY_PATH", plugin_dir_url(__FILE__));
use MOSAML\LicenseLibrary\Classes\Mo_License_Constants;
use MOSAML\LicenseLibrary\Classes\Mo_License_Dao;
use MOSAML\LicenseLibrary\Exceptions\Mo_License_Grace_Expired_Exception;
use MOSAML\LicenseLibrary\Exceptions\Mo_License_Invalid_Expiry_Date_Exception;
use MOSAML\LicenseLibrary\Exceptions\Mo_License_Missing_Customer_Email_Exception;
use MOSAML\LicenseLibrary\Exceptions\Mo_License_Missing_License_Key_Exception;
use MOSAML\LicenseLibrary\Exceptions\Mo_License_Missing_Or_Invalid_Customer_Key_Exception;
use MOSAML\LicenseLibrary\Exceptions\Mo_License_Unknown_Error_Exception;
use MOSAML\LicenseLibrary\Utils\Mo_License_Actions_Utility;
use MOSAML\LicenseLibrary\Utils\Mo_License_Service_Utility;
if (defined("ABSPATH")) {
goto pz;
}
exit;
pz:
class Mo_License_Service
{
public static function is_license_expired()
{
try {
Mo_License_Service_Utility::check_customer_login_and_license();
$pu = Mo_License_Service_Utility::is_license_grace_expired();
} catch (Mo_License_Grace_Expired_Exception $XJ) {
return Mo_License_Service_Utility::return_true_with_code($XJ::MESSAGE);
} catch (Mo_License_Invalid_Expiry_Date_Exception $XJ) {
return Mo_License_Service_Utility::return_true_with_code($XJ::MESSAGE);
} catch (Mo_License_Missing_License_Key_Exception $XJ) {
return Mo_License_Service_Utility::return_true_with_code($XJ::MESSAGE);
} catch (Mo_License_Missing_Customer_Email_Exception $XJ) {
return Mo_License_Service_Utility::return_true_with_code($XJ::MESSAGE);
} catch (Mo_License_Missing_Or_Invalid_Customer_Key_Exception $XJ) {
return Mo_License_Service_Utility::return_true_with_code($XJ::MESSAGE);
} catch (Mo_License_Unknown_Error_Exception $XJ) {
return Mo_License_Service_Utility::return_true_with_code($XJ::MESSAGE);
}
return Mo_License_Service_Utility::return_false_with_code($pu["CODE"]);
}
public static function is_customer_license_verified()
{
try {
Mo_License_Service_Utility::check_customer_login_and_license();
} catch (Mo_License_Missing_Customer_Email_Exception $XJ) {
return false;
} catch (Mo_License_Missing_Or_Invalid_Customer_Key_Exception $XJ) {
return false;
} catch (Mo_License_Missing_License_Key_Exception $XJ) {
return false;
}
return true;
}
public static function is_customer_logged_into_plugin()
{
try {
Mo_License_Service_Utility::check_customer_login();
} catch (Mo_License_Missing_Customer_Email_Exception $XJ) {
return false;
} catch (Mo_License_Missing_Or_Invalid_Customer_Key_Exception $XJ) {
return false;
}
return true;
}
public static function get_html_disabled_status($S6 = true)
{
if ($S6) {
goto F1;
}
$M3 = self::is_customer_license_verified();
goto Fw;
F1:
$ax = self::is_license_expired();
$M3 = !$ax["STATUS"];
Fw:
if (!(false === $M3)) {
goto ls;
}
return "disabled";
ls:
return '';
}
public static function refresh_license_expiry()
{
$FP = Mo_License_Actions_Utility::fetch_license_expiry_date();
if (!$FP) {
goto g2;
}
self::update_license_expiry($FP);
return $FP;
g2:
return false;
}
public static function mo_check_admin_referer($SN = -1, $lU = "_wpnonce", $S6 = true)
{
$ze = check_admin_referer($SN, $lU);
$ax = false;
if ($S6) {
goto GW;
}
$M3 = self::is_customer_license_verified();
goto bm;
GW:
$ax = self::is_license_expired();
$M3 = !$ax["STATUS"];
bm:
if (!(!$M3 || !$ze)) {
goto q0;
}
wp_die(esc_html(Mo_License_Constants::ADMIN_ERROR_MESSAGE));
q0:
return true;
}
public static function mo_check_ajax_referer($Xw = -1, $lU = false, $w4 = true, $S6 = true)
{
if ($S6) {
goto V2;
}
$M3 = self::is_customer_license_verified();
goto N0;
V2:
$ax = self::is_license_expired();
$M3 = !$ax["STATUS"];
N0:
$mj = check_ajax_referer($Xw, $lU, $w4);
if (!(!$M3 || !$mj)) {
goto MP;
}
wp_send_json_error(array("message" => "Invalid License Key."), 403);
exit;
MP:
wp_send_json_success(array("message" => "Referer verified successfully."), 200);
}
public static function get_expiry_remaining_days($FP)
{
$Ip = strtotime($FP);
$Q0 = strtotime(gmdate("Y-m-d"));
$zV = $Ip - $Q0;
$Yg = floor($zV / (60 * 60 * 24));
return $Yg;
}
public static function get_grace_days_left($FP)
{
$Yg = self::get_expiry_remaining_days($FP);
if (!($Yg > 0)) {
goto S4;
}
return false;
S4:
return Mo_License_Config::GRACE_PERIOD_DAYS + $Yg;
}
public static function get_disable_date($FP)
{
return gmdate("M d, Y", strtotime($FP . "+" . Mo_License_Config::GRACE_PERIOD_DAYS . " days"));
}
public static function get_expiry_date()
{
$bN = Mo_License_Service_Utility::mo_decrypt_data(Mo_License_Dao::mo_get_option(Mo_License_Constants::LICENSE_EXPIRY_DATE_OPTION));
if ($bN) {
goto px;
}
$bN = Mo_License_Actions_Utility::fetch_license_expiry_date();
if ($bN) {
goto EE;
}
$bN = Mo_License_Constants::EPOCH_DATE;
EE:
self::update_license_expiry($bN);
px:
return $bN;
}
public static function get_formatted_license_expiry_date($SA)
{
try {
$Iy = new \DateTime($SA);
$w7 = $Iy->getTimestamp();
$SA = gmdate("F j, Y", $w7);
return $SA;
} catch (\Exception $XJ) {
return $SA;
}
}
public static function is_customer_license_valid($U8 = false, $S6 = true)
{
if ($S6) {
goto kI;
}
$M3 = self::is_customer_license_verified();
goto Hb;
kI:
$ax = self::is_license_expired();
$M3 = !$ax["STATUS"];
Hb:
if (!(true === $M3)) {
goto pB;
}
return $U8 ? '' : true;
pB:
return $U8 ? "disabled" : false;
}
public static function update_license_expiry($FP)
{
Mo_License_Dao::mo_update_option(Mo_License_Constants::LICENSE_EXPIRY_DATE_OPTION, Mo_License_Service_Utility::mo_encrypt_data(self::get_formatted_license_expiry_date($FP)));
$lt = self::is_license_expired();
if (true === $lt["STATUS"]) {
goto ci;
}
if (!Mo_License_Dao::mo_get_option(Mo_License_Constants::LICENSE_EXPIRED_OPTION)) {
goto KE;
}
self::reset_license_values();
KE:
goto Fm;
ci:
Mo_License_Dao::mo_update_option(Mo_License_Constants::LICENSE_EXPIRED_OPTION, true);
Fm:
}
public static function reset_license_values()
{
$Jj = Mo_License_Constants::get_constants();
foreach ($Jj as $ns => $Hr) {
if (!(strpos($ns, "OPTION") !== false)) {
goto gS;
}
delete_option($Hr);
gS:
zS:
}
Z_:
}
}
?>
Did this file decode correctly?
Original Code
<?php
/**
* This file is a part of the miniorange-saml-20-single-sign-on plugin.
*
* @link https://plugins.miniorange.com/
* @author miniOrange
* @package miniorange-saml-20-single-sign-on
*/
namespace MOSAML\LicenseLibrary;
define("\115\117\x5f\x4c\x49\103\105\116\123\105\x5f\x4c\x49\102\122\x41\122\x59\137\x50\101\x54\110", plugin_dir_url(__FILE__));
use MOSAML\LicenseLibrary\Classes\Mo_License_Constants;
use MOSAML\LicenseLibrary\Classes\Mo_License_Dao;
use MOSAML\LicenseLibrary\Exceptions\Mo_License_Grace_Expired_Exception;
use MOSAML\LicenseLibrary\Exceptions\Mo_License_Invalid_Expiry_Date_Exception;
use MOSAML\LicenseLibrary\Exceptions\Mo_License_Missing_Customer_Email_Exception;
use MOSAML\LicenseLibrary\Exceptions\Mo_License_Missing_License_Key_Exception;
use MOSAML\LicenseLibrary\Exceptions\Mo_License_Missing_Or_Invalid_Customer_Key_Exception;
use MOSAML\LicenseLibrary\Exceptions\Mo_License_Unknown_Error_Exception;
use MOSAML\LicenseLibrary\Utils\Mo_License_Actions_Utility;
use MOSAML\LicenseLibrary\Utils\Mo_License_Service_Utility;
if (defined("\x41\102\x53\x50\x41\x54\x48")) {
goto pz;
}
exit;
pz:
class Mo_License_Service
{
public static function is_license_expired()
{
try {
Mo_License_Service_Utility::check_customer_login_and_license();
$pu = Mo_License_Service_Utility::is_license_grace_expired();
} catch (Mo_License_Grace_Expired_Exception $XJ) {
return Mo_License_Service_Utility::return_true_with_code($XJ::MESSAGE);
} catch (Mo_License_Invalid_Expiry_Date_Exception $XJ) {
return Mo_License_Service_Utility::return_true_with_code($XJ::MESSAGE);
} catch (Mo_License_Missing_License_Key_Exception $XJ) {
return Mo_License_Service_Utility::return_true_with_code($XJ::MESSAGE);
} catch (Mo_License_Missing_Customer_Email_Exception $XJ) {
return Mo_License_Service_Utility::return_true_with_code($XJ::MESSAGE);
} catch (Mo_License_Missing_Or_Invalid_Customer_Key_Exception $XJ) {
return Mo_License_Service_Utility::return_true_with_code($XJ::MESSAGE);
} catch (Mo_License_Unknown_Error_Exception $XJ) {
return Mo_License_Service_Utility::return_true_with_code($XJ::MESSAGE);
}
return Mo_License_Service_Utility::return_false_with_code($pu["\x43\117\x44\105"]);
}
public static function is_customer_license_verified()
{
try {
Mo_License_Service_Utility::check_customer_login_and_license();
} catch (Mo_License_Missing_Customer_Email_Exception $XJ) {
return false;
} catch (Mo_License_Missing_Or_Invalid_Customer_Key_Exception $XJ) {
return false;
} catch (Mo_License_Missing_License_Key_Exception $XJ) {
return false;
}
return true;
}
public static function is_customer_logged_into_plugin()
{
try {
Mo_License_Service_Utility::check_customer_login();
} catch (Mo_License_Missing_Customer_Email_Exception $XJ) {
return false;
} catch (Mo_License_Missing_Or_Invalid_Customer_Key_Exception $XJ) {
return false;
}
return true;
}
public static function get_html_disabled_status($S6 = true)
{
if ($S6) {
goto F1;
}
$M3 = self::is_customer_license_verified();
goto Fw;
F1:
$ax = self::is_license_expired();
$M3 = !$ax["\123\124\101\x54\x55\123"];
Fw:
if (!(false === $M3)) {
goto ls;
}
return "\144\151\163\x61\x62\154\x65\x64";
ls:
return '';
}
public static function refresh_license_expiry()
{
$FP = Mo_License_Actions_Utility::fetch_license_expiry_date();
if (!$FP) {
goto g2;
}
self::update_license_expiry($FP);
return $FP;
g2:
return false;
}
public static function mo_check_admin_referer($SN = -1, $lU = "\137\x77\160\x6e\157\156\143\145", $S6 = true)
{
$ze = check_admin_referer($SN, $lU);
$ax = false;
if ($S6) {
goto GW;
}
$M3 = self::is_customer_license_verified();
goto bm;
GW:
$ax = self::is_license_expired();
$M3 = !$ax["\123\124\x41\124\125\x53"];
bm:
if (!(!$M3 || !$ze)) {
goto q0;
}
wp_die(esc_html(Mo_License_Constants::ADMIN_ERROR_MESSAGE));
q0:
return true;
}
public static function mo_check_ajax_referer($Xw = -1, $lU = false, $w4 = true, $S6 = true)
{
if ($S6) {
goto V2;
}
$M3 = self::is_customer_license_verified();
goto N0;
V2:
$ax = self::is_license_expired();
$M3 = !$ax["\x53\x54\101\124\125\123"];
N0:
$mj = check_ajax_referer($Xw, $lU, $w4);
if (!(!$M3 || !$mj)) {
goto MP;
}
wp_send_json_error(array("\x6d\x65\163\163\x61\x67\x65" => "\111\156\166\141\154\x69\x64\40\114\151\x63\145\x6e\x73\x65\x20\113\x65\x79\56"), 403);
exit;
MP:
wp_send_json_success(array("\155\x65\163\163\141\x67\145" => "\122\x65\x66\x65\162\x65\x72\40\x76\145\162\151\146\151\145\x64\x20\163\x75\143\x63\x65\x73\163\x66\x75\x6c\154\171\x2e"), 200);
}
public static function get_expiry_remaining_days($FP)
{
$Ip = strtotime($FP);
$Q0 = strtotime(gmdate("\x59\55\x6d\x2d\x64"));
$zV = $Ip - $Q0;
$Yg = floor($zV / (60 * 60 * 24));
return $Yg;
}
public static function get_grace_days_left($FP)
{
$Yg = self::get_expiry_remaining_days($FP);
if (!($Yg > 0)) {
goto S4;
}
return false;
S4:
return Mo_License_Config::GRACE_PERIOD_DAYS + $Yg;
}
public static function get_disable_date($FP)
{
return gmdate("\115\40\x64\54\x20\131", strtotime($FP . "\x2b" . Mo_License_Config::GRACE_PERIOD_DAYS . "\40\x64\141\x79\x73"));
}
public static function get_expiry_date()
{
$bN = Mo_License_Service_Utility::mo_decrypt_data(Mo_License_Dao::mo_get_option(Mo_License_Constants::LICENSE_EXPIRY_DATE_OPTION));
if ($bN) {
goto px;
}
$bN = Mo_License_Actions_Utility::fetch_license_expiry_date();
if ($bN) {
goto EE;
}
$bN = Mo_License_Constants::EPOCH_DATE;
EE:
self::update_license_expiry($bN);
px:
return $bN;
}
public static function get_formatted_license_expiry_date($SA)
{
try {
$Iy = new \DateTime($SA);
$w7 = $Iy->getTimestamp();
$SA = gmdate("\x46\x20\x6a\54\x20\131", $w7);
return $SA;
} catch (\Exception $XJ) {
return $SA;
}
}
public static function is_customer_license_valid($U8 = false, $S6 = true)
{
if ($S6) {
goto kI;
}
$M3 = self::is_customer_license_verified();
goto Hb;
kI:
$ax = self::is_license_expired();
$M3 = !$ax["\123\124\101\124\x55\123"];
Hb:
if (!(true === $M3)) {
goto pB;
}
return $U8 ? '' : true;
pB:
return $U8 ? "\x64\x69\x73\141\142\154\145\x64" : false;
}
public static function update_license_expiry($FP)
{
Mo_License_Dao::mo_update_option(Mo_License_Constants::LICENSE_EXPIRY_DATE_OPTION, Mo_License_Service_Utility::mo_encrypt_data(self::get_formatted_license_expiry_date($FP)));
$lt = self::is_license_expired();
if (true === $lt["\123\x54\101\124\125\123"]) {
goto ci;
}
if (!Mo_License_Dao::mo_get_option(Mo_License_Constants::LICENSE_EXPIRED_OPTION)) {
goto KE;
}
self::reset_license_values();
KE:
goto Fm;
ci:
Mo_License_Dao::mo_update_option(Mo_License_Constants::LICENSE_EXPIRED_OPTION, true);
Fm:
}
public static function reset_license_values()
{
$Jj = Mo_License_Constants::get_constants();
foreach ($Jj as $ns => $Hr) {
if (!(strpos($ns, "\117\x50\124\x49\117\116") !== false)) {
goto gS;
}
delete_option($Hr);
gS:
zS:
}
Z_:
}
}
Function Calls
None |
Stats
MD5 | 4005ebbcb9765bec3f0bfadfcb0b2008 |
Eval Count | 0 |
Decode Time | 95 ms |