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

Signing you up...

Thank you for signing up!

PHP Decode

function check_license() { $license = trim(get_option($this->theme_slug . "\..

Decoded Output download

<?  function check_license() 
    { 
        $license = trim(get_option($this->theme_slug . "_license_key")); 
        $strings = $this->strings; 
        $api_params = array("edd_action" => "check_license", "license" => $license, "item_name" => urlencode($this->item_name), "url" => home_url("/")); 
        $response = $this->get_api_response($api_params); 
        if (is_wp_error($response) || 200 !== wp_remote_retrieve_response_code($response)) { 
            if (is_wp_error($response)) { 
                $message = $response->get_error_message(); 
                if (strpos($message, "Could not resolve host") !== false) { 
                    $message = esc_html__("Could not connect to license server", TEXT_DOMAIN); 
                } 
            } else { 
                $message = $strings["license-status-unknown"]; 
            } 
        } else { 
            $license_data = json_decode(wp_remote_retrieve_body($response)); 
            if (!isset($license_data->license)) { 
                $message = $strings["license-status-unknown"]; 
                return $message; 
            } 
            if ($license_data && isset($license_data->license)) { 
                update_option($this->theme_slug . "_license_key_status", $license_data->license); 
            } 
            $expires = false; 
            if (isset($license_data->expires) && "lifetime" != $license_data->expires) { 
                $expires = date_i18n(get_option("date_format"), strtotime($license_data->expires, current_time("timestamp"))); 
                $renew_link = "<a href="" . esc_url($this->get_renewal_link()) . "" target="_blank">" . $strings["renew"] . "</a>"; 
            } elseif (isset($license_data->expires) && "lifetime" == $license_data->expires) { 
                $expires = "lifetime"; 
            } 
            $site_count = isset($license_data->site_count) ? $license_data->site_count : ''; 
            $customer_name = isset($license_data->customer_name) ? $license_data->customer_name : ''; 
            $customer_email = isset($license_data->customer_email) ? $license_data->customer_email : ''; 
            $license_limit = isset($license_data->license_limit) ? $license_data->license_limit : ''; 
            if (0 == $license_limit) { 
                $license_limit = $strings["unlimited"]; 
            } 
            if ($license_data->license == "valid") { 
                $message = $strings["license-key-is-active"] . " "; 
                if (isset($expires) && "lifetime" != $expires) { 
                    $message .= " <br>" . sprintf($strings["expires%s"], $expires) . " "; 
                } 
                if (isset($expires) && "lifetime" == $expires) { 
                    $message .= " <br>" . $strings["expires-never"]; 
                } 
                if ($site_count && $license_limit) { 
                    $message .= " <br> " . sprintf($strings["%1$s/%2$-sites"], $site_count, $license_limit); 
                } 
                if ($customer_name && $license_limit) { 
                    $message .= " <br> " . sprintf($strings["customer-name-%1$s"], $customer_name, $license_limit); 
                } 
                if ($customer_email && $license_limit) { 
                    $message .= " <br> " . sprintf($strings["customer-email-%1$s"], $customer_email, $license_limit); 
                } 
            } else { 
                if ($license_data->license == "expired") { 
                    if ($expires) { 
                        $message = " <br>" . sprintf($strings["license-key-expired-%s"], $expires); 
                    } else { 
                        $message = $strings["license-key-expired"]; 
                    } 
                    if ($renew_link) { 
                        $message .= " " . $renew_link; 
                    } 
                } else { 
                    if ($license_data->license == "invalid") { 
                        $message = $strings["license-keys-do-not-match"]; 
                    } else { 
                        if ($license_data->license == "inactive") { 
                            $message = $strings["license-is-inactive"]; 
                        } else { 
                            if ($license_data->license == "disabled") { 
                                $message = $strings["license-key-is-disabled"]; 
                            } else { 
                                if ($license_data->license == "site_inactive") { 
                                    $message = $strings["site-is-inactive"]; 
                                } else { 
                                    $message = $strings["license-status-unknown"]; 
                                } 
                            } 
                        } 
                    } 
                } 
            } 
        } 
        return $message; 
    } ?>

Did this file decode correctly?

Original Code

function check_license()
    {
        $license = trim(get_option($this->theme_slug . "\x5f\154\x69\143\145\156\x73\145\137\153\145\x79"));
        $strings = $this->strings;
        $api_params = array("\145\144\144\137\141\143\x74\151\x6f\156" => "\143\150\145\143\153\137\x6c\x69\143\145\156\x73\145", "\x6c\151\143\145\156\163\145" => $license, "\x69\164\145\x6d\137\x6e\x61\x6d\x65" => urlencode($this->item_name), "\x75\x72\x6c" => home_url("\x2f"));
        $response = $this->get_api_response($api_params);
        if (is_wp_error($response) || 200 !== wp_remote_retrieve_response_code($response)) {
            if (is_wp_error($response)) {
                $message = $response->get_error_message();
                if (strpos($message, "\x43\157\165\x6c\144\40\156\x6f\164\40\162\145\x73\x6f\x6c\166\145\x20\150\157\x73\164") !== false) {
                    $message = esc_html__("\103\157\x75\x6c\x64\x20\x6e\157\x74\x20\143\157\x6e\x6e\x65\x63\164\x20\x74\x6f\40\x6c\151\143\145\x6e\x73\x65\40\x73\x65\x72\x76\145\x72", TEXT_DOMAIN);
                }
            } else {
                $message = $strings["\154\x69\x63\145\x6e\x73\x65\x2d\x73\164\x61\164\x75\x73\55\165\x6e\x6b\156\x6f\x77\156"];
            }
        } else {
            $license_data = json_decode(wp_remote_retrieve_body($response));
            if (!isset($license_data->license)) {
                $message = $strings["\154\x69\x63\x65\x6e\x73\145\55\163\164\141\x74\165\163\55\165\156\x6b\156\157\167\x6e"];
                return $message;
            }
            if ($license_data && isset($license_data->license)) {
                update_option($this->theme_slug . "\137\x6c\x69\x63\x65\156\163\x65\137\x6b\x65\171\137\163\x74\x61\x74\x75\x73", $license_data->license);
            }
            $expires = false;
            if (isset($license_data->expires) && "\154\x69\146\145\x74\151\x6d\x65" != $license_data->expires) {
                $expires = date_i18n(get_option("\144\141\164\x65\137\146\157\162\155\141\x74"), strtotime($license_data->expires, current_time("\164\x69\155\145\x73\x74\141\x6d\x70")));
                $renew_link = "\74\x61\x20\150\x72\x65\x66\x3d\42" . esc_url($this->get_renewal_link()) . "\x22\40\x74\141\x72\x67\x65\164\75\x22\x5f\142\x6c\x61\156\x6b\42\76" . $strings["\162\145\x6e\145\x77"] . "\x3c\x2f\141\x3e";
            } elseif (isset($license_data->expires) && "\154\151\146\145\x74\x69\155\145" == $license_data->expires) {
                $expires = "\154\151\146\145\164\x69\x6d\x65";
            }
            $site_count = isset($license_data->site_count) ? $license_data->site_count : '';
            $customer_name = isset($license_data->customer_name) ? $license_data->customer_name : '';
            $customer_email = isset($license_data->customer_email) ? $license_data->customer_email : '';
            $license_limit = isset($license_data->license_limit) ? $license_data->license_limit : '';
            if (0 == $license_limit) {
                $license_limit = $strings["\165\x6e\x6c\151\x6d\x69\164\x65\144"];
            }
            if ($license_data->license == "\x76\141\x6c\151\x64") {
                $message = $strings["\x6c\151\143\x65\x6e\163\145\55\153\145\171\x2d\x69\163\55\141\x63\x74\151\x76\145"] . "\40";
                if (isset($expires) && "\154\151\146\145\164\x69\x6d\x65" != $expires) {
                    $message .= "\40\74\142\x72\76" . sprintf($strings["\x65\x78\x70\151\162\145\163\x25\x73"], $expires) . "\40";
                }
                if (isset($expires) && "\x6c\151\146\145\x74\x69\155\145" == $expires) {
                    $message .= "\40\74\142\x72\x3e" . $strings["\x65\x78\x70\151\162\x65\163\x2d\x6e\145\x76\x65\162"];
                }
                if ($site_count && $license_limit) {
                    $message .= "\40\74\x62\x72\x3e\40" . sprintf($strings["\45\61\x24\x73\x2f\45\x32\44\55\x73\x69\164\x65\x73"], $site_count, $license_limit);
                }
                if ($customer_name && $license_limit) {
                    $message .= "\40\x3c\x62\162\76\x20" . sprintf($strings["\x63\x75\163\164\x6f\155\x65\x72\55\156\x61\155\145\x2d\x25\61\44\x73"], $customer_name, $license_limit);
                }
                if ($customer_email && $license_limit) {
                    $message .= "\40\74\142\162\x3e\40" . sprintf($strings["\143\x75\163\x74\x6f\155\x65\x72\x2d\x65\x6d\141\151\x6c\55\45\x31\44\x73"], $customer_email, $license_limit);
                }
            } else {
                if ($license_data->license == "\145\170\160\151\x72\x65\x64") {
                    if ($expires) {
                        $message = "\40\x3c\142\x72\x3e" . sprintf($strings["\154\x69\x63\145\156\163\x65\x2d\x6b\x65\171\x2d\x65\x78\x70\x69\x72\x65\144\x2d\x25\x73"], $expires);
                    } else {
                        $message = $strings["\154\151\143\x65\x6e\163\145\x2d\153\x65\x79\55\x65\x78\x70\x69\x72\x65\144"];
                    }
                    if ($renew_link) {
                        $message .= "\x20" . $renew_link;
                    }
                } else {
                    if ($license_data->license == "\151\156\166\x61\154\151\144") {
                        $message = $strings["\154\x69\x63\145\x6e\x73\x65\x2d\x6b\145\171\163\55\144\157\55\x6e\157\x74\55\x6d\141\164\x63\x68"];
                    } else {
                        if ($license_data->license == "\151\x6e\141\x63\164\x69\x76\x65") {
                            $message = $strings["\x6c\x69\x63\x65\x6e\163\x65\x2d\x69\163\55\x69\156\141\x63\x74\x69\166\x65"];
                        } else {
                            if ($license_data->license == "\144\x69\163\x61\x62\x6c\145\x64") {
                                $message = $strings["\154\151\x63\x65\x6e\x73\145\x2d\x6b\x65\x79\55\151\163\55\144\x69\x73\x61\x62\x6c\145\144"];
                            } else {
                                if ($license_data->license == "\x73\151\x74\145\137\151\x6e\x61\x63\164\x69\166\x65") {
                                    $message = $strings["\x73\x69\164\145\55\151\x73\55\x69\156\x61\143\164\151\166\145"];
                                } else {
                                    $message = $strings["\154\x69\143\145\156\163\x65\x2d\x73\164\x61\x74\x75\x73\55\165\x6e\x6b\x6e\x6f\167\156"];
                                }
                            }
                        }
                    }
                }
            }
        }
        return $message;
    }

Function Calls

None

Variables

None

Stats

MD5 64d54ac5f51a4e7c7a8856443ace2669
Eval Count 0
Decode Time 73 ms