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 declare (strict_types=1); namespace OneTeamSoftware\WC\Shipping; use OneTeamSoftwa..
Decoded Output download
<?php
declare (strict_types=1); namespace OneTeamSoftware\WC\Shipping; use OneTeamSoftware\Parcel\Fitter; use OneTeamSoftware\Parcel\Packer as ParcelPacker; use OneTeamSoftware\WC\Parcel\Packer; use OneTeamSoftware\WC\Shipping\Builder\OrderBuilder; use OneTeamSoftware\WC\Shipping\Hooks\SettingsFormPro as SettingsFormProHooks; use OneTeamSoftware\WC\Shipping\Hooks\Shipping as ShippingHooks; use OneTeamSoftware\WP\PluginLife\Client\Client; class PluginPro extends Plugin { protected $shippingHooks; protected $orderShipments; protected $shipmentNotifier; protected $orderCompleter; protected $shipmentMetaBox; protected $adminOrders; protected $orderBuilder; protected $vendorSettingsLoader; protected $templatesPath; protected $pluginLifeClient; protected $areProFeaturesRegistered; public function __construct(string $BqShx, string $TBXvb, string $duCrL, string $SCzaW = null, callable $c8RZy) { parent::__construct($BqShx, $TBXvb, $duCrL, $SCzaW, $c8RZy); $this->templatesPath = dirname($this->pluginPath) . "/templates/"; $this->pluginLifeClient = new Client($this->pluginPath); $this->adapterHooks = null; $this->shippingHooks = null; $this->orderShipments = null; $this->shipmentNotifier = null; $this->orderCompleter = null; $this->shipmentMetaBox = null; $this->adminOrders = null; $this->orderBuilder = null; $this->vendorSettingsLoader = null; $this->areProFeaturesRegistered = false; } public function register() : void { if (false === is_plugin_active("woocommerce/woocommerce.php")) { return; } parent::register(); $this->activateFreePlugin(); add_filter($this->id . "_init_form_fields", [$this, "updateFormFields"], 1, 1); add_action("woocommerce_settings_saved", [$this, "onSettingsSaved"]); $this->registerProFeatures(); } public function updateFormFields(array $Y4ua0) : array { $JY9eb = array_search("enabled", array_keys($Y4ua0), true) + 1; $Y4ua0 = array_slice($Y4ua0, 0, $JY9eb, true) + ["licenseKey" => ["type" => "text", "title" => __("License Key", $this->id), "default" => '', "description" => __("A valid license key is required for plugin to work", $this->id)]] + array_slice($Y4ua0, $JY9eb, count($Y4ua0) - $JY9eb, true); return $Y4ua0; } public function onSettingsSaved() : void { if (isset($_GET["page"]) && isset($_GET["section"]) && "wc-settings" === $_GET["page"] && $this->id === $_GET["section"]) { $aHtSv = $this->isActivated(); $this->loadSettings(); $this->pluginLifeClient->clearCache(); if ($this->isActivated() !== $aHtSv) { header("Refresh:1"); } } } public function isActivated() : bool { return $this->pluginLifeClient->validate(); } public function initSettingsFormHooks() : void { if (!$this->isActivated()) { parent::initSettingsFormHooks(); return; } $this->settingsFormHooks = new SettingsFormProHooks($this->id, $this->cache); $this->settingsFormHooks->register(); } public function getPlugins(array $FRpYc) : array { if ($this->isActivated()) { $FRpYc[$this->id] = $this->title; } return $FRpYc; } public function setSettings(array $DoROW) : void { $this->settings = array_merge($this->pluginSettings, $DoROW); $this->logger->debug(__FILE__, 234, "setSettings, settings: %s", print_r($this->settings, true)); $this->syncSettings(); } protected function loadSettings() : void { parent::loadSettings(); $this->makeSettingsBackwardCompatible(); $this->syncSettings(); $this->pluginLifeClient->setData(["license_key" => $this->settings["licenseKey"]]); } protected function makeSettingsBackwardCompatible() : void { if (empty($this->settings["defaultDomesticService"]) && false === empty($this->settings["defaultServiceForBulkShipmentCreation"])) { $this->settings["defaultDomesticService"] = $this->settings["defaultServiceForBulkShipmentCreation"]; } if (empty($this->settings["defaultInternationService"]) && false === empty($this->settings["defaultBulkInternationService"])) { $this->settings["defaultInternationService"] = $this->settings["defaultBulkInternationService"]; } } protected function registerProFeatures() : void { if (!$this->isActivated()) { return; } $this->vendorSettingsLoader = new VendorSettingsLoader($this->id, $this->logger, new AdminUserChecker()); $this->shippingHooks = new ShippingHooks($this->id, $this->adapter, $this->logger, $this->parcelPacker, $this->shipmentBuilder, $this->orderBuilder, $this->vendorSettingsLoader, $this->settings); $this->shippingHooks->register(); $this->orderShipments = new OrderShipments($this->id, $this->logger); $this->shipmentNotifier = new ShipmentNotifier($this->id, $this->logger); $this->shipmentNotifier->register(); $this->orderCompleter = new OrderCompleter($this->id, $this->logger); $this->orderCompleter->register(); $this->shipmentMetaBox = new ShipmentMetaBox($this->id, $this->pluginPath, $this->logger, $this->cache, $this->vendorSettingsLoader, $this->settings, $this->version); $this->shipmentMetaBox->register(); (new LabelLoaderPage($this->id, $this->pluginPath))->register(); (new CustomerOrders($this->id, $this->templatesPath, $this->orderShipments))->register(); (new CustomerEmails($this->id, $this->templatesPath, $this->orderShipments))->register(); if ($this->adapter->getFeatures()->hasGetShipmentFeature()) { new UpdateShipmentsCronTask($this->id, $this->adapter, $this->logger, $this->settings); } if ($this->adapter->getFeatures()->hasGetShipmentsFeature()) { new ImportShipmentsCronTask($this->id, $this->adapter, $this->logger, $this->settings); } if ($this->adapter->getFeatures()->hasCreateOrderFeature()) { new CreateOrdersCronTask($this->id, $this->logger, $this->settings); } $this->adminOrders = new AdminOrders($this->id, $this->pluginPath, $this->logger, $this->settings, $this->version); $this->adminOrders->register(); add_filter("\OneTeamSoftware\WooCommerce\Shipping\PluginPro::getPlugins", [$this, "getPlugins"], 1, 1); add_action($this->id . "_setSettings", [$this, "setSettings"], 1, 1); $this->areProFeaturesRegistered = true; } protected function syncSettings() : void { parent::syncSettings(); if (!$this->areProFeaturesRegistered) { return; } $this->vendorSettingsLoader->withUseVendorSettings("yes" === $this->settings["useVendorSettings"])->withSettings($this->settings); $this->orderShipments->setCompletedStatuses($this->adapter->getTypes()->getCompletedStatuses()->toArray()); $this->shipmentMetaBox->setSettings($this->settings); $this->adminOrders->setSettings($this->settings); $this->shippingHooks->setSettings($this->settings); if (empty($this->settings["notifyForStatus"])) { $this->settings["notifyForStatus"] = []; } $this->shipmentNotifier->setNotifyForStatuses($this->settings["notifyForStatus"]); if (empty($this->settings["completeOrderForStatuses"])) { $this->settings["completeOrderForStatuses"] = []; } $this->orderCompleter->setCompleteOrderForStatuses($this->settings["completeOrderForStatuses"]); do_action($this->id . "_setShippingMethodSettings", $this->settings); } protected function activateFreePlugin() : void { if (!function_exists("is_plugin_active")) { require_once ABSPATH . "wp-admin/includes/plugin.php"; } $zgxmC = preg_replace("/-pro([\/\.])/", "$1", plugin_basename($this->pluginPath)); if (file_exists(WP_PLUGIN_DIR . "/" . $zgxmC) && !is_plugin_active($zgxmC)) { activate_plugin($zgxmC); } } protected function initParcelPacker() : void { if (!$this->isActivated()) { parent::initParcelPacker(); return; } $this->parcelPacker = new Packer($this->logger, new ParcelPacker($this->logger, new Fitter($this->logger)), $this->weightConverter, $this->dimensionConverter); } protected function initBuilders() : void { parent::initBuilders(); $this->orderBuilder = new OrderBuilder($this->addressBuilder, $this->dimensionsBuilder, $this->weightBuilder, $this->itemsBuilder, $this->itemsAlterer, $this->itemAlterer, $this->formSettingsBuilder, $this->currency); } }
?>
Did this file decode correctly?
Original Code
<?php
declare (strict_types=1); namespace OneTeamSoftware\WC\Shipping; use OneTeamSoftware\Parcel\Fitter; use OneTeamSoftware\Parcel\Packer as ParcelPacker; use OneTeamSoftware\WC\Parcel\Packer; use OneTeamSoftware\WC\Shipping\Builder\OrderBuilder; use OneTeamSoftware\WC\Shipping\Hooks\SettingsFormPro as SettingsFormProHooks; use OneTeamSoftware\WC\Shipping\Hooks\Shipping as ShippingHooks; use OneTeamSoftware\WP\PluginLife\Client\Client; class PluginPro extends Plugin { protected $shippingHooks; protected $orderShipments; protected $shipmentNotifier; protected $orderCompleter; protected $shipmentMetaBox; protected $adminOrders; protected $orderBuilder; protected $vendorSettingsLoader; protected $templatesPath; protected $pluginLifeClient; protected $areProFeaturesRegistered; public function __construct(string $BqShx, string $TBXvb, string $duCrL, string $SCzaW = null, callable $c8RZy) { parent::__construct($BqShx, $TBXvb, $duCrL, $SCzaW, $c8RZy); $this->templatesPath = dirname($this->pluginPath) . "\x2f\x74\x65\155\x70\x6c\x61\164\145\x73\x2f"; $this->pluginLifeClient = new Client($this->pluginPath); $this->adapterHooks = null; $this->shippingHooks = null; $this->orderShipments = null; $this->shipmentNotifier = null; $this->orderCompleter = null; $this->shipmentMetaBox = null; $this->adminOrders = null; $this->orderBuilder = null; $this->vendorSettingsLoader = null; $this->areProFeaturesRegistered = false; } public function register() : void { if (false === is_plugin_active("\x77\x6f\157\143\x6f\x6d\155\145\x72\x63\x65\57\167\x6f\x6f\x63\157\x6d\x6d\145\x72\143\x65\x2e\x70\150\x70")) { return; } parent::register(); $this->activateFreePlugin(); add_filter($this->id . "\x5f\151\156\151\164\x5f\x66\x6f\x72\155\x5f\x66\x69\145\x6c\144\x73", [$this, "\165\x70\x64\x61\164\145\x46\157\162\x6d\106\x69\145\154\x64\163"], 1, 1); add_action("\x77\157\157\143\157\155\x6d\x65\162\143\x65\x5f\163\x65\x74\x74\x69\x6e\x67\163\137\163\x61\166\x65\x64", [$this, "\157\156\123\145\164\164\x69\x6e\x67\163\x53\x61\166\x65\x64"]); $this->registerProFeatures(); } public function updateFormFields(array $Y4ua0) : array { $JY9eb = array_search("\145\x6e\141\x62\154\145\144", array_keys($Y4ua0), true) + 1; $Y4ua0 = array_slice($Y4ua0, 0, $JY9eb, true) + ["\154\x69\x63\145\156\163\145\x4b\x65\x79" => ["\164\171\160\145" => "\164\x65\170\x74", "\x74\x69\x74\154\145" => __("\x4c\151\143\x65\156\x73\145\40\113\x65\x79", $this->id), "\x64\145\x66\x61\x75\154\x74" => '', "\x64\x65\x73\x63\x72\151\x70\164\151\157\156" => __("\x41\x20\x76\141\154\151\144\x20\x6c\x69\x63\145\156\x73\145\x20\153\145\x79\40\151\163\x20\162\145\161\165\151\x72\x65\144\x20\x66\157\162\40\x70\154\165\147\151\156\x20\164\157\40\x77\157\162\x6b", $this->id)]] + array_slice($Y4ua0, $JY9eb, count($Y4ua0) - $JY9eb, true); return $Y4ua0; } public function onSettingsSaved() : void { if (isset($_GET["\160\x61\147\145"]) && isset($_GET["\163\145\x63\164\151\157\x6e"]) && "\x77\143\x2d\163\145\164\x74\151\x6e\x67\x73" === $_GET["\x70\141\147\145"] && $this->id === $_GET["\x73\145\143\164\151\x6f\x6e"]) { $aHtSv = $this->isActivated(); $this->loadSettings(); $this->pluginLifeClient->clearCache(); if ($this->isActivated() !== $aHtSv) { header("\122\x65\x66\162\145\x73\x68\72\x31"); } } } public function isActivated() : bool { return $this->pluginLifeClient->validate(); } public function initSettingsFormHooks() : void { if (!$this->isActivated()) { parent::initSettingsFormHooks(); return; } $this->settingsFormHooks = new SettingsFormProHooks($this->id, $this->cache); $this->settingsFormHooks->register(); } public function getPlugins(array $FRpYc) : array { if ($this->isActivated()) { $FRpYc[$this->id] = $this->title; } return $FRpYc; } public function setSettings(array $DoROW) : void { $this->settings = array_merge($this->pluginSettings, $DoROW); $this->logger->debug(__FILE__, 234, "\x73\145\x74\123\145\164\164\x69\156\x67\163\x2c\40\163\x65\164\164\151\x6e\x67\163\72\40\45\x73", print_r($this->settings, true)); $this->syncSettings(); } protected function loadSettings() : void { parent::loadSettings(); $this->makeSettingsBackwardCompatible(); $this->syncSettings(); $this->pluginLifeClient->setData(["\154\151\x63\x65\x6e\163\x65\137\153\x65\171" => $this->settings["\154\151\x63\145\x6e\163\x65\x4b\x65\x79"]]); } protected function makeSettingsBackwardCompatible() : void { if (empty($this->settings["\x64\145\x66\x61\165\154\164\104\157\x6d\145\x73\x74\151\x63\123\145\162\166\x69\x63\x65"]) && false === empty($this->settings["\144\145\x66\141\x75\x6c\x74\x53\x65\x72\166\151\x63\145\106\x6f\x72\102\x75\154\153\x53\x68\151\x70\155\145\156\164\x43\x72\x65\x61\x74\x69\157\156"])) { $this->settings["\144\145\x66\141\165\154\164\104\157\155\145\x73\164\x69\143\x53\145\x72\166\x69\143\145"] = $this->settings["\x64\x65\x66\141\165\x6c\164\x53\145\x72\x76\151\x63\x65\106\157\x72\102\x75\154\153\123\x68\151\x70\155\x65\x6e\x74\103\162\x65\x61\164\151\x6f\x6e"]; } if (empty($this->settings["\144\145\146\141\165\154\164\111\156\164\145\x72\156\x61\164\x69\x6f\156\x53\x65\x72\x76\x69\x63\x65"]) && false === empty($this->settings["\144\x65\x66\x61\165\x6c\164\x42\165\154\x6b\111\156\164\x65\x72\156\x61\164\x69\x6f\x6e\123\x65\162\x76\151\x63\145"])) { $this->settings["\144\145\x66\x61\x75\x6c\x74\111\156\164\x65\162\x6e\x61\x74\151\157\x6e\x53\x65\x72\x76\x69\x63\x65"] = $this->settings["\x64\x65\x66\141\165\154\x74\102\x75\x6c\153\111\x6e\x74\145\162\156\141\x74\x69\x6f\156\x53\145\162\x76\x69\143\145"]; } } protected function registerProFeatures() : void { if (!$this->isActivated()) { return; } $this->vendorSettingsLoader = new VendorSettingsLoader($this->id, $this->logger, new AdminUserChecker()); $this->shippingHooks = new ShippingHooks($this->id, $this->adapter, $this->logger, $this->parcelPacker, $this->shipmentBuilder, $this->orderBuilder, $this->vendorSettingsLoader, $this->settings); $this->shippingHooks->register(); $this->orderShipments = new OrderShipments($this->id, $this->logger); $this->shipmentNotifier = new ShipmentNotifier($this->id, $this->logger); $this->shipmentNotifier->register(); $this->orderCompleter = new OrderCompleter($this->id, $this->logger); $this->orderCompleter->register(); $this->shipmentMetaBox = new ShipmentMetaBox($this->id, $this->pluginPath, $this->logger, $this->cache, $this->vendorSettingsLoader, $this->settings, $this->version); $this->shipmentMetaBox->register(); (new LabelLoaderPage($this->id, $this->pluginPath))->register(); (new CustomerOrders($this->id, $this->templatesPath, $this->orderShipments))->register(); (new CustomerEmails($this->id, $this->templatesPath, $this->orderShipments))->register(); if ($this->adapter->getFeatures()->hasGetShipmentFeature()) { new UpdateShipmentsCronTask($this->id, $this->adapter, $this->logger, $this->settings); } if ($this->adapter->getFeatures()->hasGetShipmentsFeature()) { new ImportShipmentsCronTask($this->id, $this->adapter, $this->logger, $this->settings); } if ($this->adapter->getFeatures()->hasCreateOrderFeature()) { new CreateOrdersCronTask($this->id, $this->logger, $this->settings); } $this->adminOrders = new AdminOrders($this->id, $this->pluginPath, $this->logger, $this->settings, $this->version); $this->adminOrders->register(); add_filter("\x5c\x4f\156\x65\x54\x65\x61\155\x53\x6f\x66\164\x77\x61\162\x65\x5c\127\x6f\157\x43\x6f\155\155\145\x72\143\145\134\123\150\x69\160\160\x69\156\x67\x5c\x50\x6c\165\x67\x69\x6e\x50\162\x6f\72\72\147\x65\x74\x50\154\x75\x67\x69\156\x73", [$this, "\x67\145\164\120\x6c\165\147\x69\156\x73"], 1, 1); add_action($this->id . "\x5f\163\x65\164\x53\145\x74\164\x69\x6e\x67\x73", [$this, "\163\145\164\x53\x65\x74\164\x69\x6e\x67\163"], 1, 1); $this->areProFeaturesRegistered = true; } protected function syncSettings() : void { parent::syncSettings(); if (!$this->areProFeaturesRegistered) { return; } $this->vendorSettingsLoader->withUseVendorSettings("\171\x65\163" === $this->settings["\165\x73\145\x56\145\x6e\x64\157\162\x53\x65\x74\x74\151\x6e\x67\163"])->withSettings($this->settings); $this->orderShipments->setCompletedStatuses($this->adapter->getTypes()->getCompletedStatuses()->toArray()); $this->shipmentMetaBox->setSettings($this->settings); $this->adminOrders->setSettings($this->settings); $this->shippingHooks->setSettings($this->settings); if (empty($this->settings["\156\x6f\x74\151\146\171\106\157\162\x53\x74\141\x74\165\163"])) { $this->settings["\156\x6f\164\151\146\171\x46\x6f\x72\x53\x74\141\x74\165\x73"] = []; } $this->shipmentNotifier->setNotifyForStatuses($this->settings["\x6e\x6f\164\151\146\x79\x46\x6f\x72\123\164\141\164\x75\x73"]); if (empty($this->settings["\x63\157\x6d\160\154\x65\164\145\117\x72\x64\145\x72\x46\x6f\x72\x53\164\141\164\x75\x73\145\x73"])) { $this->settings["\x63\x6f\x6d\160\154\x65\164\x65\117\162\x64\x65\x72\x46\157\x72\123\x74\x61\164\165\163\145\x73"] = []; } $this->orderCompleter->setCompleteOrderForStatuses($this->settings["\x63\x6f\x6d\x70\x6c\145\164\145\x4f\162\x64\145\162\106\157\162\x53\164\x61\164\x75\163\145\163"]); do_action($this->id . "\x5f\x73\x65\164\x53\x68\x69\x70\x70\x69\x6e\x67\115\145\x74\x68\x6f\144\x53\145\x74\x74\x69\x6e\x67\x73", $this->settings); } protected function activateFreePlugin() : void { if (!function_exists("\151\x73\x5f\160\154\x75\x67\151\156\137\141\143\x74\x69\166\145")) { require_once ABSPATH . "\x77\x70\x2d\141\144\155\x69\156\x2f\151\156\x63\x6c\x75\144\145\x73\57\x70\154\x75\147\151\x6e\x2e\x70\x68\x70"; } $zgxmC = preg_replace("\x2f\x2d\160\162\157\x28\x5b\x5c\57\x5c\56\x5d\x29\x2f", "\x24\x31", plugin_basename($this->pluginPath)); if (file_exists(WP_PLUGIN_DIR . "\x2f" . $zgxmC) && !is_plugin_active($zgxmC)) { activate_plugin($zgxmC); } } protected function initParcelPacker() : void { if (!$this->isActivated()) { parent::initParcelPacker(); return; } $this->parcelPacker = new Packer($this->logger, new ParcelPacker($this->logger, new Fitter($this->logger)), $this->weightConverter, $this->dimensionConverter); } protected function initBuilders() : void { parent::initBuilders(); $this->orderBuilder = new OrderBuilder($this->addressBuilder, $this->dimensionsBuilder, $this->weightBuilder, $this->itemsBuilder, $this->itemsAlterer, $this->itemAlterer, $this->formSettingsBuilder, $this->currency); } }
Function Calls
None |
Stats
MD5 | 9936c8f0e2a7ad573d025f6eed83096f |
Eval Count | 0 |
Decode Time | 79 ms |