Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

goto a2BUw; tUvOd: add_action("\160\x6c\x75\x67\151\x6e\163\x5f\x6c\x6f\141\144\x65\x64", ..

Decoded Output download

<?  goto a2BUw; tUvOd: add_action("plugins_loaded", "xpayall_init_gateway_class"); goto T47jk; ZmmJd: add_filter("woocommerce_payment_gateways", "xpayall_add_gateway"); goto fWhLj; a2BUw: define("DEFAULT_GATEWAY_URL", "https://xpayall.com/stripe"); goto ZmmJd; fWhLj: function xpayall_add_gateway($gateways) { $gateways[] = "WC_XPayAll_Gateway"; return $gateways; } goto tUvOd; T47jk: function xpayall_init_gateway_class() { class WC_XPayAll_Gateway extends WC_Payment_Gateway { public function __construct() { $this->id = "xpayall"; $this->has_fields = false; $this->method_title = "XPayAll"; $this->method_description = "Securely pay using Debit/Credit Cards."; $this->supports = array("products"); $this->init_form_fields(); $this->init_settings(); $this->gateway_url = $this->get_option("gateway_url"); if (!$this->gateway_url) { $this->gateway_url = DEFAULT_GATEWAY_URL; } $this->icon = untrailingslashit($this->gateway_url) . "/icon.png"; add_action("woocommerce_update_options_payment_gateways_" . $this->id, array($this, "process_admin_options")); add_action("woocommerce_api_xpayall_callback", array($this, "xpayall_callback")); } public function init_form_fields() { $this->form_fields = array("gateway_url" => array("title" => "Gateway Store URL", "type" => "text", "description" => "Provide URL of the Proxy Store.", "default" => DEFAULT_GATEWAY_URL, "desc_tip" => true)); } public function process_payment($order_id) { global $woocommerce; $order = wc_get_order($order_id); $order_data = $order->get_data(); $order_items = array(); foreach ($order->get_items() as $item_key => $item) { $item_id = $item->get_id(); $item_data = $item->get_data(); $product = $item->get_product(); $product = array("product_type" => $product->get_type(), "product_sku" => $product->get_sku(), "product_price" => $product->get_price(), "stock_quantity" => $product->get_stock_quantity()); array_push($order_items, array("product" => $product, "item_data" => $item_data)); } $params = base64_encode(serialize(array("client_url" => home_url(), "order_data" => serialize($order_data), "order_items" => serialize($order_items)))); $target_url = add_query_arg("params", $params, $this->gateway_url); return array("result" => "success", "redirect" => $target_url); } public function xpayall_callback() { if (isset($_REQUEST["params"]) && $_REQUEST["params"] != '') { $params = (object) unserialize(base64_decode($_REQUEST["params"])); $order = wc_get_order($params->order_id); if ($params->payment_status == "succeeded") { $note_text = "Payment Received. Ref: " . $params->trans_id . "/" . $params->trans_id; $order->add_order_note(__($note_text), true); $order->payment_complete(); } else { $note_text = "Payment Failed. "; $order->add_order_note(__($note_text), true); $order->update_status("failed"); } wp_safe_redirect($this->get_return_url($order)); } else { wp_safe_redirect(home_url()); } die; } } } ?>

Did this file decode correctly?

Original Code

goto a2BUw; tUvOd: add_action("\160\x6c\x75\x67\151\x6e\163\x5f\x6c\x6f\141\144\x65\x64", "\x78\x70\141\x79\141\154\x6c\x5f\x69\156\x69\164\137\147\x61\x74\145\167\141\x79\137\x63\154\141\163\163"); goto T47jk; ZmmJd: add_filter("\167\157\x6f\143\157\x6d\155\145\162\143\145\x5f\160\x61\171\x6d\145\156\164\x5f\x67\141\164\145\x77\141\171\163", "\x78\160\x61\x79\141\x6c\x6c\137\x61\x64\144\137\147\x61\x74\x65\167\141\171"); goto fWhLj; a2BUw: define("\104\105\x46\101\x55\x4c\124\x5f\107\101\x54\105\127\x41\131\x5f\125\122\x4c", "\150\x74\x74\160\x73\x3a\x2f\57\x78\160\141\171\141\x6c\154\56\x63\157\155\x2f\x73\164\x72\x69\x70\145"); goto ZmmJd; fWhLj: function xpayall_add_gateway($gateways) { $gateways[] = "\x57\x43\137\x58\120\x61\171\x41\154\x6c\137\x47\x61\164\145\167\x61\171"; return $gateways; } goto tUvOd; T47jk: function xpayall_init_gateway_class() { class WC_XPayAll_Gateway extends WC_Payment_Gateway { public function __construct() { $this->id = "\170\x70\141\x79\141\154\x6c"; $this->has_fields = false; $this->method_title = "\x58\120\141\x79\101\x6c\154"; $this->method_description = "\123\145\x63\165\162\145\154\171\x20\x70\141\171\x20\x75\x73\x69\156\147\x20\x44\145\x62\151\164\57\103\x72\145\x64\151\x74\x20\103\141\162\144\x73\56"; $this->supports = array("\x70\162\x6f\144\165\x63\x74\x73"); $this->init_form_fields(); $this->init_settings(); $this->gateway_url = $this->get_option("\x67\x61\x74\x65\x77\141\171\137\x75\x72\x6c"); if (!$this->gateway_url) { $this->gateway_url = DEFAULT_GATEWAY_URL; } $this->icon = untrailingslashit($this->gateway_url) . "\57\x69\x63\x6f\x6e\56\160\x6e\147"; add_action("\167\x6f\x6f\143\157\x6d\155\145\x72\143\x65\137\x75\160\144\141\x74\145\x5f\x6f\160\164\151\157\156\163\x5f\x70\x61\171\155\145\156\x74\x5f\x67\x61\x74\x65\x77\x61\171\163\137" . $this->id, array($this, "\x70\162\157\143\x65\163\x73\137\x61\x64\x6d\x69\156\137\157\x70\164\151\x6f\x6e\x73")); add_action("\167\x6f\x6f\x63\x6f\x6d\155\145\x72\x63\145\x5f\141\160\x69\137\x78\x70\x61\x79\141\x6c\154\137\x63\x61\x6c\154\142\x61\x63\153", array($this, "\170\160\x61\x79\x61\154\154\137\x63\141\154\x6c\142\141\143\153")); } public function init_form_fields() { $this->form_fields = array("\x67\x61\164\x65\x77\141\x79\137\165\162\154" => array("\164\151\164\x6c\145" => "\107\141\x74\x65\x77\x61\171\40\123\164\x6f\x72\145\40\x55\122\114", "\x74\171\160\x65" => "\164\x65\170\164", "\x64\x65\163\x63\162\151\x70\164\x69\x6f\x6e" => "\x50\162\157\166\x69\144\145\40\125\x52\114\x20\x6f\x66\x20\x74\150\x65\40\x50\x72\157\x78\x79\40\123\x74\x6f\162\x65\x2e", "\144\x65\146\141\x75\154\x74" => DEFAULT_GATEWAY_URL, "\x64\x65\x73\x63\x5f\164\151\160" => true)); } public function process_payment($order_id) { global $woocommerce; $order = wc_get_order($order_id); $order_data = $order->get_data(); $order_items = array(); foreach ($order->get_items() as $item_key => $item) { $item_id = $item->get_id(); $item_data = $item->get_data(); $product = $item->get_product(); $product = array("\x70\x72\157\144\x75\143\x74\x5f\x74\171\x70\x65" => $product->get_type(), "\x70\162\157\144\165\143\164\137\163\x6b\x75" => $product->get_sku(), "\x70\162\157\x64\x75\143\164\x5f\160\x72\x69\143\145" => $product->get_price(), "\163\164\157\143\153\137\161\165\x61\x6e\164\x69\164\171" => $product->get_stock_quantity()); array_push($order_items, array("\x70\x72\157\x64\x75\143\x74" => $product, "\151\x74\145\x6d\137\144\x61\164\x61" => $item_data)); } $params = base64_encode(serialize(array("\x63\x6c\151\145\156\x74\137\x75\x72\154" => home_url(), "\157\162\144\145\x72\x5f\x64\x61\164\141" => serialize($order_data), "\x6f\x72\x64\x65\x72\x5f\151\x74\x65\155\x73" => serialize($order_items)))); $target_url = add_query_arg("\x70\x61\162\141\x6d\x73", $params, $this->gateway_url); return array("\x72\145\x73\x75\154\x74" => "\163\165\143\143\x65\x73\163", "\x72\145\144\x69\x72\145\x63\x74" => $target_url); } public function xpayall_callback() { if (isset($_REQUEST["\160\141\x72\x61\155\x73"]) && $_REQUEST["\x70\141\162\141\x6d\163"] != '') { $params = (object) unserialize(base64_decode($_REQUEST["\160\141\x72\141\155\x73"])); $order = wc_get_order($params->order_id); if ($params->payment_status == "\163\x75\143\x63\145\x65\144\145\x64") { $note_text = "\x50\141\171\155\x65\x6e\x74\40\x52\x65\x63\x65\x69\166\x65\x64\56\40\122\145\146\x3a\x20" . $params->trans_id . "\57" . $params->trans_id; $order->add_order_note(__($note_text), true); $order->payment_complete(); } else { $note_text = "\x50\141\x79\155\145\x6e\164\40\x46\141\x69\154\145\x64\x2e\x20"; $order->add_order_note(__($note_text), true); $order->update_status("\x66\141\151\154\x65\x64"); } wp_safe_redirect($this->get_return_url($order)); } else { wp_safe_redirect(home_url()); } die; } } }

Function Calls

None

Variables

None

Stats

MD5 b1119dd66d98384b56d32eddfe66c3b2
Eval Count 0
Decode Time 39 ms