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 use Automattic\Jetpack\Constants; if (!defined("\x41\102\x53\120\101\x54\x48")) { d..

Decoded Output download

<?php
 use Automattic\Jetpack\Constants; if (!defined("ABSPATH")) { die; } class WC_Plugin_Updates { const VERSION_REQUIRED_HEADER = "WC requires at least"; const VERSION_TESTED_HEADER = "WC tested up to"; protected $new_version = ''; protected $major_untested_plugins = array(); protected function generic_modal_js() { ?>
		<script>
			( function( $ ) {
				// Initialize thickbox.
				tb_init( '.wc-thickbox' );

				var old_tb_position = false;

				// Make the WC thickboxes look good when opened.
				$( '.wc-thickbox' ).on( 'click', function( evt ) {
					var $overlay = $( '#TB_overlay' );
					if ( ! $overlay.length ) {
						$( 'body' ).append( '<div id="TB_overlay"></div><div id="TB_window" class="wc_untested_extensions_modal_container"></div>' );
					} else {
						$( '#TB_window' ).removeClass( 'thickbox-loading' ).addClass( 'wc_untested_extensions_modal_container' );
					}

					// WP overrides the tb_position function. We need to use a different tb_position function than that one.
					// This is based on the original tb_position.
					if ( ! old_tb_position ) {
						old_tb_position = tb_position;
					}
					tb_position = function() {
						$( '#TB_window' ).css( { marginLeft: '-' + parseInt( ( TB_WIDTH / 2 ), 10 ) + 'px', width: TB_WIDTH + 'px' } );
						$( '#TB_window' ).css( { marginTop: '-' + parseInt( ( TB_HEIGHT / 2 ), 10 ) + 'px' } );
					};
				});

				// Reset tb_position to WP default when modal is closed.
				$( 'body' ).on( 'thickbox:removed', function() {
					if ( old_tb_position ) {
						tb_position = old_tb_position;
					}
				});
			})( jQuery );
		</script>
		<?php  } protected function get_extensions_inline_warning_major() { $upgrade_type = "major"; $plugins = $this->major_untested_plugins; $version_parts = explode(".", $this->new_version); $new_version = $version_parts[0] . ".0"; if (empty($plugins)) { return; } $message = sprintf(__("<strong>Heads up!</strong> The versions of the following plugins you're running haven't been tested with WooCommerce %s. Please update them or confirm compatibility before updating WooCommerce, or you may experience issues:", "woocommerce"), $new_version); ob_start(); include __DIR__ . "/views/html-notice-untested-extensions-inline.php"; return ob_get_clean(); } protected function get_extensions_modal_warning() { $version_parts = explode(".", $this->new_version); $new_version = $version_parts[0] . ".0"; $plugins = $this->major_untested_plugins; ob_start(); include __DIR__ . "/views/html-notice-untested-extensions-modal.php"; return ob_get_clean(); } public function get_untested_plugins($new_version, $release) { if ("none" === $release) { return array(); } $extensions = array_merge($this->get_plugins_with_header(self::VERSION_TESTED_HEADER), $this->get_plugins_for_woocommerce()); $untested = array(); $new_version_parts = explode(".", $new_version); $version = $new_version_parts[0]; if ("minor" === $release) { $version .= "." . $new_version_parts[1]; } foreach ($extensions as $file => $plugin) { if (!empty($plugin[self::VERSION_TESTED_HEADER])) { $plugin_version_parts = explode(".", $plugin[self::VERSION_TESTED_HEADER]); if (!is_numeric($plugin_version_parts[0]) || "minor" === $release && !isset($plugin_version_parts[1]) || "minor" === $release && !is_numeric($plugin_version_parts[1])) { continue; } $plugin_version = $plugin_version_parts[0]; if ("minor" === $release) { $plugin_version .= "." . $plugin_version_parts[1]; } if (version_compare($plugin_version, $version, "<")) { $untested[$file] = $plugin; } } else { $plugin[self::VERSION_TESTED_HEADER] = __("unknown", "woocommerce"); $untested[$file] = $plugin; } } return $untested; } protected function get_plugins_with_header($header) { $plugins = get_plugins(); $matches = array(); foreach ($plugins as $file => $plugin) { if (!empty($plugin[$header])) { $matches[$file] = $plugin; } } return apply_filters("woocommerce_get_plugins_with_header", $matches, $header, $plugins); } protected function get_plugins_for_woocommerce() { $plugins = get_plugins(); $matches = array(); foreach ($plugins as $file => $plugin) { if ("WooCommerce" !== $plugin["Name"] && (stristr($plugin["Name"], "woocommerce") || stristr($plugin["Description"], "woocommerce"))) { $matches[$file] = $plugin; } } return apply_filters("woocommerce_get_plugins_for_woocommerce", $matches, $plugins); } } ?>

Did this file decode correctly?

Original Code

<?php
 use Automattic\Jetpack\Constants; if (!defined("\x41\102\x53\120\101\x54\x48")) { die; } class WC_Plugin_Updates { const VERSION_REQUIRED_HEADER = "\x57\103\40\x72\x65\161\165\151\162\145\x73\x20\141\x74\x20\x6c\145\x61\163\x74"; const VERSION_TESTED_HEADER = "\127\x43\40\x74\145\x73\x74\145\x64\40\165\160\40\x74\x6f"; protected $new_version = ''; protected $major_untested_plugins = array(); protected function generic_modal_js() { ?>
		<script>
			( function( $ ) {
				// Initialize thickbox.
				tb_init( '.wc-thickbox' );

				var old_tb_position = false;

				// Make the WC thickboxes look good when opened.
				$( '.wc-thickbox' ).on( 'click', function( evt ) {
					var $overlay = $( '#TB_overlay' );
					if ( ! $overlay.length ) {
						$( 'body' ).append( '<div id="TB_overlay"></div><div id="TB_window" class="wc_untested_extensions_modal_container"></div>' );
					} else {
						$( '#TB_window' ).removeClass( 'thickbox-loading' ).addClass( 'wc_untested_extensions_modal_container' );
					}

					// WP overrides the tb_position function. We need to use a different tb_position function than that one.
					// This is based on the original tb_position.
					if ( ! old_tb_position ) {
						old_tb_position = tb_position;
					}
					tb_position = function() {
						$( '#TB_window' ).css( { marginLeft: '-' + parseInt( ( TB_WIDTH / 2 ), 10 ) + 'px', width: TB_WIDTH + 'px' } );
						$( '#TB_window' ).css( { marginTop: '-' + parseInt( ( TB_HEIGHT / 2 ), 10 ) + 'px' } );
					};
				});

				// Reset tb_position to WP default when modal is closed.
				$( 'body' ).on( 'thickbox:removed', function() {
					if ( old_tb_position ) {
						tb_position = old_tb_position;
					}
				});
			})( jQuery );
		</script>
		<?php  } protected function get_extensions_inline_warning_major() { $upgrade_type = "\155\141\x6a\157\x72"; $plugins = $this->major_untested_plugins; $version_parts = explode("\56", $this->new_version); $new_version = $version_parts[0] . "\56\60"; if (empty($plugins)) { return; } $message = sprintf(__("\74\x73\x74\x72\x6f\156\x67\x3e\110\145\141\x64\163\40\x75\x70\x21\x3c\57\x73\164\x72\157\156\147\x3e\x20\124\150\145\x20\x76\145\x72\x73\151\157\x6e\163\x20\157\146\x20\164\x68\145\x20\x66\x6f\154\154\x6f\167\x69\x6e\x67\40\160\154\165\x67\x69\x6e\x73\x20\171\x6f\x75\x27\162\145\x20\x72\x75\156\x6e\x69\156\147\40\x68\x61\x76\x65\x6e\47\164\x20\142\145\x65\156\x20\164\145\163\x74\x65\144\x20\167\x69\x74\x68\x20\127\157\x6f\x43\157\155\155\x65\x72\143\x65\x20\x25\163\x2e\x20\120\x6c\x65\141\163\x65\x20\165\160\x64\141\x74\x65\x20\164\150\145\155\40\x6f\x72\40\143\x6f\156\x66\151\162\x6d\40\x63\x6f\155\160\141\x74\151\142\151\x6c\151\x74\x79\40\142\145\146\x6f\162\x65\40\165\160\144\x61\x74\x69\156\147\x20\127\x6f\x6f\x43\x6f\155\155\x65\162\143\x65\54\x20\x6f\x72\x20\171\157\165\40\155\x61\171\40\x65\x78\x70\145\162\x69\145\x6e\143\145\40\151\163\x73\x75\x65\163\72", "\x77\157\157\143\x6f\x6d\155\145\162\x63\145"), $new_version); ob_start(); include __DIR__ . "\57\x76\x69\x65\167\163\x2f\150\164\155\154\55\x6e\x6f\164\151\143\145\x2d\x75\x6e\164\x65\x73\x74\145\x64\55\x65\170\x74\145\156\163\x69\157\x6e\163\x2d\151\x6e\x6c\151\x6e\x65\x2e\x70\150\160"; return ob_get_clean(); } protected function get_extensions_modal_warning() { $version_parts = explode("\56", $this->new_version); $new_version = $version_parts[0] . "\56\x30"; $plugins = $this->major_untested_plugins; ob_start(); include __DIR__ . "\x2f\166\151\145\167\163\57\150\164\x6d\154\x2d\x6e\157\164\x69\143\x65\55\x75\156\x74\x65\163\164\x65\x64\55\x65\x78\x74\145\156\163\151\x6f\x6e\163\55\x6d\x6f\x64\141\x6c\56\160\x68\160"; return ob_get_clean(); } public function get_untested_plugins($new_version, $release) { if ("\x6e\x6f\x6e\145" === $release) { return array(); } $extensions = array_merge($this->get_plugins_with_header(self::VERSION_TESTED_HEADER), $this->get_plugins_for_woocommerce()); $untested = array(); $new_version_parts = explode("\56", $new_version); $version = $new_version_parts[0]; if ("\155\151\x6e\157\162" === $release) { $version .= "\x2e" . $new_version_parts[1]; } foreach ($extensions as $file => $plugin) { if (!empty($plugin[self::VERSION_TESTED_HEADER])) { $plugin_version_parts = explode("\56", $plugin[self::VERSION_TESTED_HEADER]); if (!is_numeric($plugin_version_parts[0]) || "\155\151\x6e\x6f\162" === $release && !isset($plugin_version_parts[1]) || "\155\x69\156\x6f\x72" === $release && !is_numeric($plugin_version_parts[1])) { continue; } $plugin_version = $plugin_version_parts[0]; if ("\x6d\x69\x6e\x6f\x72" === $release) { $plugin_version .= "\56" . $plugin_version_parts[1]; } if (version_compare($plugin_version, $version, "\x3c")) { $untested[$file] = $plugin; } } else { $plugin[self::VERSION_TESTED_HEADER] = __("\x75\156\153\x6e\157\167\156", "\167\157\157\x63\x6f\155\x6d\145\162\143\145"); $untested[$file] = $plugin; } } return $untested; } protected function get_plugins_with_header($header) { $plugins = get_plugins(); $matches = array(); foreach ($plugins as $file => $plugin) { if (!empty($plugin[$header])) { $matches[$file] = $plugin; } } return apply_filters("\167\x6f\x6f\143\157\155\x6d\145\x72\143\x65\x5f\147\x65\x74\x5f\x70\154\x75\147\151\156\x73\x5f\167\x69\164\150\137\x68\145\141\144\145\162", $matches, $header, $plugins); } protected function get_plugins_for_woocommerce() { $plugins = get_plugins(); $matches = array(); foreach ($plugins as $file => $plugin) { if ("\127\157\157\x43\157\x6d\x6d\x65\162\143\145" !== $plugin["\x4e\141\155\145"] && (stristr($plugin["\x4e\x61\155\x65"], "\x77\x6f\157\143\157\x6d\x6d\145\162\143\x65") || stristr($plugin["\104\x65\163\x63\162\x69\x70\164\151\157\156"], "\167\157\x6f\143\x6f\x6d\155\x65\x72\x63\145"))) { $matches[$file] = $plugin; } } return apply_filters("\167\157\x6f\143\157\155\155\145\x72\143\x65\x5f\147\145\164\137\x70\x6c\165\147\151\x6e\x73\x5f\146\x6f\x72\137\x77\x6f\x6f\x63\x6f\155\x6d\145\162\143\145", $matches, $plugins); } }

Function Calls

None

Variables

None

Stats

MD5 196447ff818100d6ed97514e13c13631
Eval Count 0
Decode Time 112 ms