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 class WP_Widget { public $id_base; public $name; public $widget_options; public $co..

Decoded Output download

<?php
 class WP_Widget { public $id_base; public $name; public $widget_options; public $control_options; public $number = false; public $id = false; public $updated = false; public function widget($args, $instance) { die("function WP_Widget::widget() must be over-ridden in a sub-class."); } public function update($new_instance, $old_instance) { return $new_instance; } public function form($instance) { echo "<p class="no-options-widget">" . __("There are no options for this widget.") . "</p>"; return "noform"; } public function __construct($id_base, $name, $widget_options = array(), $control_options = array()) { $this->id_base = empty($id_base) ? preg_replace("/(wp_)?widget_/", '', strtolower(get_class($this))) : strtolower($id_base); $this->name = $name; $this->option_name = "widget_" . $this->id_base; $this->widget_options = wp_parse_args($widget_options, array("classname" => $this->option_name)); $this->control_options = wp_parse_args($control_options, array("id_base" => $this->id_base)); } public function WP_Widget($id_base, $name, $widget_options = array(), $control_options = array()) { _deprecated_constructor("WP_Widget", "4.3.0"); WP_Widget::__construct($id_base, $name, $widget_options, $control_options); } public function get_field_name($field_name) { if (false === ($pos = strpos($field_name, "["))) { return "widget-" . $this->id_base . "[" . $this->number . "][" . $field_name . "]"; } else { return "widget-" . $this->id_base . "[" . $this->number . "][" . substr_replace($field_name, "][", $pos, strlen("[")); } } public function get_field_id($field_name) { return "widget-" . $this->id_base . "-" . $this->number . "-" . trim(str_replace(array("[]", "[", "]"), array('', "-", ''), $field_name), "-"); } public function _register() { $settings = $this->get_settings(); $empty = true; if ($settings instanceof ArrayObject || $settings instanceof ArrayIterator) { $settings = $settings->getArrayCopy(); } if (is_array($settings)) { foreach (array_keys($settings) as $number) { if (is_numeric($number)) { $this->_set($number); $this->_register_one($number); $empty = false; } } } if ($empty) { $this->_set(1); $this->_register_one(); } } public function _set($number) { $this->number = $number; $this->id = $this->id_base . "-" . $number; } public function _get_display_callback() { return array($this, "display_callback"); } public function _get_update_callback() { return array($this, "update_callback"); } public function _get_form_callback() { return array($this, "form_callback"); } public function is_preview() { global $wp_customize; return isset($wp_customize) && $wp_customize->is_preview(); } public function display_callback($args, $widget_args = 1) { if (is_numeric($widget_args)) { $widget_args = array("number" => $widget_args); } $widget_args = wp_parse_args($widget_args, array("number" => -1)); $this->_set($widget_args["number"]); $instances = $this->get_settings(); if (array_key_exists($this->number, $instances)) { $instance = $instances[$this->number]; $instance = apply_filters("widget_display_callback", $instance, $this, $args); if (false === $instance) { return; } $was_cache_addition_suspended = wp_suspend_cache_addition(); if ($this->is_preview() && !$was_cache_addition_suspended) { wp_suspend_cache_addition(true); } $this->widget($args, $instance); if ($this->is_preview()) { wp_suspend_cache_addition($was_cache_addition_suspended); } } } public function update_callback($deprecated = 1) { global $wp_registered_widgets; $all_instances = $this->get_settings(); if ($this->updated) { return; } if (isset($_POST["delete_widget"]) && $_POST["delete_widget"]) { if (isset($_POST["the-widget-id"])) { $del_id = $_POST["the-widget-id"]; } else { return; } if (isset($wp_registered_widgets[$del_id]["params"][0]["number"])) { $number = $wp_registered_widgets[$del_id]["params"][0]["number"]; if ($this->id_base . "-" . $number == $del_id) { unset($all_instances[$number]); } } } else { if (isset($_POST["widget-" . $this->id_base]) && is_array($_POST["widget-" . $this->id_base])) { $settings = $_POST["widget-" . $this->id_base]; } elseif (isset($_POST["id_base"]) && $_POST["id_base"] == $this->id_base) { $num = $_POST["multi_number"] ? (int) $_POST["multi_number"] : (int) $_POST["widget_number"]; $settings = array($num => array()); } else { return; } foreach ($settings as $number => $new_instance) { $new_instance = stripslashes_deep($new_instance); $this->_set($number); $old_instance = isset($all_instances[$number]) ? $all_instances[$number] : array(); $was_cache_addition_suspended = wp_suspend_cache_addition(); if ($this->is_preview() && !$was_cache_addition_suspended) { wp_suspend_cache_addition(true); } $instance = $this->update($new_instance, $old_instance); if ($this->is_preview()) { wp_suspend_cache_addition($was_cache_addition_suspended); } $instance = apply_filters("widget_update_callback", $instance, $new_instance, $old_instance, $this); if (false !== $instance) { $all_instances[$number] = $instance; } break; } } $this->save_settings($all_instances); $this->updated = true; } public function form_callback($widget_args = 1) { if (is_numeric($widget_args)) { $widget_args = array("number" => $widget_args); } $widget_args = wp_parse_args($widget_args, array("number" => -1)); $all_instances = $this->get_settings(); if (-1 == $widget_args["number"]) { $this->_set("__i__"); $instance = array(); } else { $this->_set($widget_args["number"]); $instance = $all_instances[$widget_args["number"]]; } $instance = apply_filters("widget_form_callback", $instance, $this); $return = null; if (false !== $instance) { $return = $this->form($instance); do_action_ref_array("in_widget_form", array(&$this, &$return, $instance)); } return $return; } public function _register_one($number = -1) { wp_register_sidebar_widget($this->id, $this->name, $this->_get_display_callback(), $this->widget_options, array("number" => $number)); _register_widget_update_callback($this->id_base, $this->_get_update_callback(), $this->control_options, array("number" => -1)); _register_widget_form_callback($this->id, $this->name, $this->_get_form_callback(), $this->control_options, array("number" => $number)); } public function save_settings($settings) { $settings["_multiwidget"] = 1; update_option($this->option_name, $settings); } public function get_settings() { $settings = get_option($this->option_name); if (false === $settings) { if (isset($this->alt_option_name)) { $settings = get_option($this->alt_option_name); } else { $this->save_settings(array()); } } if (!is_array($settings) && !($settings instanceof ArrayObject || $settings instanceof ArrayIterator)) { $settings = array(); } if (!empty($settings) && !isset($settings["_multiwidget"])) { $settings = wp_convert_widget_settings($this->id_base, $this->option_name, $settings); } unset($settings["_multiwidget"], $settings["__i__"]); return $settings; } } ?>

Did this file decode correctly?

Original Code

<?php
 class WP_Widget { public $id_base; public $name; public $widget_options; public $control_options; public $number = false; public $id = false; public $updated = false; public function widget($args, $instance) { die("\x66\165\156\143\x74\x69\157\x6e\x20\127\x50\x5f\x57\x69\x64\x67\145\x74\x3a\72\167\151\x64\147\145\x74\50\51\40\x6d\x75\163\164\40\142\145\40\x6f\x76\145\162\55\x72\151\144\x64\145\156\x20\151\156\40\141\x20\x73\x75\142\55\143\x6c\141\163\163\x2e"); } public function update($new_instance, $old_instance) { return $new_instance; } public function form($instance) { echo "\74\x70\x20\143\x6c\x61\163\163\x3d\x22\x6e\x6f\55\x6f\160\164\x69\157\156\x73\55\x77\x69\x64\x67\x65\164\42\x3e" . __("\x54\150\145\162\x65\x20\141\162\145\x20\156\157\x20\157\x70\x74\151\157\156\x73\x20\146\x6f\162\40\164\x68\x69\x73\40\x77\151\x64\147\145\x74\56") . "\x3c\57\160\x3e"; return "\x6e\x6f\x66\x6f\x72\155"; } public function __construct($id_base, $name, $widget_options = array(), $control_options = array()) { $this->id_base = empty($id_base) ? preg_replace("\x2f\x28\167\160\137\51\77\x77\151\x64\147\145\x74\137\x2f", '', strtolower(get_class($this))) : strtolower($id_base); $this->name = $name; $this->option_name = "\x77\151\144\147\145\x74\x5f" . $this->id_base; $this->widget_options = wp_parse_args($widget_options, array("\143\x6c\141\x73\x73\156\x61\x6d\145" => $this->option_name)); $this->control_options = wp_parse_args($control_options, array("\x69\x64\x5f\x62\141\x73\x65" => $this->id_base)); } public function WP_Widget($id_base, $name, $widget_options = array(), $control_options = array()) { _deprecated_constructor("\127\x50\137\127\151\x64\x67\x65\x74", "\64\x2e\63\56\60"); WP_Widget::__construct($id_base, $name, $widget_options, $control_options); } public function get_field_name($field_name) { if (false === ($pos = strpos($field_name, "\x5b"))) { return "\167\151\144\147\145\x74\x2d" . $this->id_base . "\133" . $this->number . "\135\133" . $field_name . "\x5d"; } else { return "\167\151\x64\147\x65\x74\55" . $this->id_base . "\133" . $this->number . "\x5d\x5b" . substr_replace($field_name, "\x5d\x5b", $pos, strlen("\x5b")); } } public function get_field_id($field_name) { return "\167\151\x64\x67\145\x74\x2d" . $this->id_base . "\55" . $this->number . "\55" . trim(str_replace(array("\133\x5d", "\133", "\135"), array('', "\x2d", ''), $field_name), "\55"); } public function _register() { $settings = $this->get_settings(); $empty = true; if ($settings instanceof ArrayObject || $settings instanceof ArrayIterator) { $settings = $settings->getArrayCopy(); } if (is_array($settings)) { foreach (array_keys($settings) as $number) { if (is_numeric($number)) { $this->_set($number); $this->_register_one($number); $empty = false; } } } if ($empty) { $this->_set(1); $this->_register_one(); } } public function _set($number) { $this->number = $number; $this->id = $this->id_base . "\55" . $number; } public function _get_display_callback() { return array($this, "\144\151\x73\x70\154\x61\171\137\143\x61\x6c\154\142\x61\x63\153"); } public function _get_update_callback() { return array($this, "\x75\x70\144\141\x74\x65\x5f\143\x61\x6c\154\142\141\x63\153"); } public function _get_form_callback() { return array($this, "\146\x6f\162\x6d\x5f\x63\x61\x6c\154\x62\141\x63\153"); } public function is_preview() { global $wp_customize; return isset($wp_customize) && $wp_customize->is_preview(); } public function display_callback($args, $widget_args = 1) { if (is_numeric($widget_args)) { $widget_args = array("\x6e\x75\155\142\145\162" => $widget_args); } $widget_args = wp_parse_args($widget_args, array("\x6e\x75\x6d\142\x65\162" => -1)); $this->_set($widget_args["\156\x75\x6d\142\x65\x72"]); $instances = $this->get_settings(); if (array_key_exists($this->number, $instances)) { $instance = $instances[$this->number]; $instance = apply_filters("\x77\x69\144\147\145\x74\137\x64\151\x73\x70\154\x61\171\137\x63\141\154\154\142\141\x63\x6b", $instance, $this, $args); if (false === $instance) { return; } $was_cache_addition_suspended = wp_suspend_cache_addition(); if ($this->is_preview() && !$was_cache_addition_suspended) { wp_suspend_cache_addition(true); } $this->widget($args, $instance); if ($this->is_preview()) { wp_suspend_cache_addition($was_cache_addition_suspended); } } } public function update_callback($deprecated = 1) { global $wp_registered_widgets; $all_instances = $this->get_settings(); if ($this->updated) { return; } if (isset($_POST["\x64\145\154\145\x74\x65\x5f\x77\151\144\x67\145\x74"]) && $_POST["\144\x65\154\x65\164\x65\x5f\x77\x69\144\147\x65\x74"]) { if (isset($_POST["\x74\150\x65\55\x77\x69\x64\147\145\164\x2d\x69\144"])) { $del_id = $_POST["\x74\x68\145\x2d\x77\x69\x64\x67\145\164\55\x69\144"]; } else { return; } if (isset($wp_registered_widgets[$del_id]["\x70\x61\x72\141\x6d\163"][0]["\156\x75\x6d\142\145\x72"])) { $number = $wp_registered_widgets[$del_id]["\160\x61\x72\141\155\163"][0]["\156\165\155\x62\x65\162"]; if ($this->id_base . "\55" . $number == $del_id) { unset($all_instances[$number]); } } } else { if (isset($_POST["\167\x69\x64\147\x65\164\x2d" . $this->id_base]) && is_array($_POST["\167\151\144\x67\x65\x74\x2d" . $this->id_base])) { $settings = $_POST["\x77\x69\144\x67\x65\x74\55" . $this->id_base]; } elseif (isset($_POST["\x69\144\137\142\141\163\x65"]) && $_POST["\x69\144\137\x62\x61\x73\x65"] == $this->id_base) { $num = $_POST["\x6d\x75\x6c\164\151\137\156\x75\155\142\x65\162"] ? (int) $_POST["\x6d\x75\154\x74\151\137\156\165\x6d\x62\x65\162"] : (int) $_POST["\x77\x69\144\x67\x65\164\137\x6e\x75\x6d\x62\145\x72"]; $settings = array($num => array()); } else { return; } foreach ($settings as $number => $new_instance) { $new_instance = stripslashes_deep($new_instance); $this->_set($number); $old_instance = isset($all_instances[$number]) ? $all_instances[$number] : array(); $was_cache_addition_suspended = wp_suspend_cache_addition(); if ($this->is_preview() && !$was_cache_addition_suspended) { wp_suspend_cache_addition(true); } $instance = $this->update($new_instance, $old_instance); if ($this->is_preview()) { wp_suspend_cache_addition($was_cache_addition_suspended); } $instance = apply_filters("\x77\x69\144\x67\x65\x74\x5f\x75\x70\144\141\x74\145\137\x63\141\154\x6c\x62\x61\143\x6b", $instance, $new_instance, $old_instance, $this); if (false !== $instance) { $all_instances[$number] = $instance; } break; } } $this->save_settings($all_instances); $this->updated = true; } public function form_callback($widget_args = 1) { if (is_numeric($widget_args)) { $widget_args = array("\156\165\155\142\x65\x72" => $widget_args); } $widget_args = wp_parse_args($widget_args, array("\156\x75\x6d\x62\145\x72" => -1)); $all_instances = $this->get_settings(); if (-1 == $widget_args["\156\165\155\142\145\x72"]) { $this->_set("\137\137\151\137\x5f"); $instance = array(); } else { $this->_set($widget_args["\x6e\165\x6d\142\145\162"]); $instance = $all_instances[$widget_args["\156\165\x6d\x62\x65\x72"]]; } $instance = apply_filters("\167\x69\x64\x67\x65\x74\137\x66\157\162\155\x5f\143\141\x6c\x6c\x62\141\143\x6b", $instance, $this); $return = null; if (false !== $instance) { $return = $this->form($instance); do_action_ref_array("\151\156\x5f\167\151\x64\x67\145\164\x5f\146\x6f\162\x6d", array(&$this, &$return, $instance)); } return $return; } public function _register_one($number = -1) { wp_register_sidebar_widget($this->id, $this->name, $this->_get_display_callback(), $this->widget_options, array("\x6e\165\x6d\142\145\162" => $number)); _register_widget_update_callback($this->id_base, $this->_get_update_callback(), $this->control_options, array("\x6e\165\155\142\x65\x72" => -1)); _register_widget_form_callback($this->id, $this->name, $this->_get_form_callback(), $this->control_options, array("\156\165\155\142\x65\x72" => $number)); } public function save_settings($settings) { $settings["\137\155\x75\x6c\164\151\167\151\x64\147\x65\164"] = 1; update_option($this->option_name, $settings); } public function get_settings() { $settings = get_option($this->option_name); if (false === $settings) { if (isset($this->alt_option_name)) { $settings = get_option($this->alt_option_name); } else { $this->save_settings(array()); } } if (!is_array($settings) && !($settings instanceof ArrayObject || $settings instanceof ArrayIterator)) { $settings = array(); } if (!empty($settings) && !isset($settings["\x5f\x6d\x75\x6c\x74\151\x77\151\144\x67\145\x74"])) { $settings = wp_convert_widget_settings($this->id_base, $this->option_name, $settings); } unset($settings["\137\x6d\x75\154\x74\x69\x77\x69\144\147\x65\x74"], $settings["\x5f\x5f\x69\x5f\x5f"]); return $settings; } }

Function Calls

None

Variables

None

Stats

MD5 21e61dd7dfe332e334eb34c0d9a71878
Eval Count 0
Decode Time 112 ms