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 Pelago\Emogrifier\CssInliner; use Pelago\Emogrifier\HtmlProcessor\CssToAttribut..
Decoded Output download
<?php
use Pelago\Emogrifier\CssInliner; use Pelago\Emogrifier\HtmlProcessor\CssToAttributeConverter; use Pelago\Emogrifier\HtmlProcessor\HtmlPruner; goto Vynrb; Vynrb: if (!defined("ABSPATH")) { die; } goto dImdj; dImdj: if (class_exists("WC_Email", false)) { return; } goto kIKrc; kIKrc: class WC_Email extends WC_Settings_API { public $id; public $title; public $enabled; public $description; public $heading = ''; public $subject = ''; public $template_plain; public $template_html; public $template_base; public $recipient; public $object; public $mime_boundary; public $mime_boundary_header; public $sending; protected $manual = false; protected $customer_email = false; public $plain_search = array("/
/", "/&(nbsp|#0*160);/i", "/&(quot|rdquo|ldquo|#0*8220|#0*8221|#0*147|#0*148);/i", "/&(apos|rsquo|lsquo|#0*8216|#0*8217);/i", "/>/i", "/</i", "/�*38;/i", "/&/i", "/&(copy|#0*169);/i", "/&(trade|#0*8482|#0*153);/i", "/&(reg|#0*174);/i", "/&(mdash|#0*151|#0*8212);/i", "/&(ndash|minus|#0*8211|#0*8722);/i", "/&(bull|#0*149|#0*8226);/i", "/&(pound|#0*163);/i", "/&(euro|#0*8364);/i", "/&(dollar|#0*36);/i", "/&[^&\s;]+;/i", "/[ ]{2,}/"); public $plain_replace = array('', " ", """, "'", ">", "<", "&", "&", "(c)", "(tm)", "(R)", "--", "-", "*", "\xc2\243", "EUR", "$", '', " "); protected $placeholders = array(); public $find = array(); public $replace = array(); public $email_type; public function __construct() { $this->placeholders = array_merge(array("{site_title}" => $this->get_blogname(), "{site_address}" => wp_parse_url(home_url(), PHP_URL_HOST), "{site_url}" => wp_parse_url(home_url(), PHP_URL_HOST)), $this->placeholders); $this->init_form_fields(); $this->init_settings(); if (is_null($this->template_base)) { $this->template_base = WC()->plugin_path() . "/templates/"; } $this->email_type = $this->get_option("email_type"); $this->enabled = $this->get_option("enabled"); add_action("phpmailer_init", array($this, "handle_multipart")); add_action("woocommerce_update_options_email_" . $this->id, array($this, "process_admin_options")); } public function handle_multipart($mailer) { if (!$this->sending) { return $mailer; } if ("multipart" === $this->get_email_type()) { $mailer->AltBody = wordwrap(preg_replace($this->plain_search, $this->plain_replace, wp_strip_all_tags($this->get_content_plain()))); } else { $mailer->AltBody = ''; } $this->sending = false; return $mailer; } public function format_string($string) { $find = array_keys($this->placeholders); $replace = array_values($this->placeholders); $find = array_merge((array) $this->find, $find); $replace = array_merge((array) $this->replace, $replace); $find[] = "{blogname}"; $replace[] = $this->get_blogname(); if (has_filter("woocommerce_email_format_string_replace") || has_filter("woocommerce_email_format_string_find")) { $legacy_find = $this->find; $legacy_replace = $this->replace; foreach ($this->placeholders as $find => $replace) { $legacy_key = sanitize_title(str_replace("_", "-", trim($find, "{}"))); $legacy_find[$legacy_key] = $find; $legacy_replace[$legacy_key] = $replace; } $string = str_replace(apply_filters("woocommerce_email_format_string_find", $legacy_find, $this), apply_filters("woocommerce_email_format_string_replace", $legacy_replace, $this), $string); } return apply_filters("woocommerce_email_format_string", str_replace($find, $replace, $string), $this); } public function setup_locale() { $switch_email_locale = apply_filters("woocommerce_allow_switching_email_locale", true, $this); if ($switch_email_locale && $this->is_customer_email() && apply_filters("woocommerce_email_setup_locale", true)) { wc_switch_to_site_locale(); } } public function restore_locale() { $restore_email_locale = apply_filters("woocommerce_allow_restoring_email_locale", true, $this); if ($restore_email_locale && $this->is_customer_email() && apply_filters("woocommerce_email_restore_locale", true)) { wc_restore_locale(); } } public function get_default_subject() { return $this->subject; } public function get_default_heading() { return $this->heading; } public function get_default_additional_content() { return ''; } public function get_additional_content() { return apply_filters("woocommerce_email_additional_content_" . $this->id, $this->format_string($this->get_option("additional_content", $this->get_default_additional_content())), $this->object, $this); } public function get_subject() { return apply_filters("woocommerce_email_subject_" . $this->id, $this->format_string($this->get_option("subject", $this->get_default_subject())), $this->object, $this); } public function get_heading() { return apply_filters("woocommerce_email_heading_" . $this->id, $this->format_string($this->get_option("heading", $this->get_default_heading())), $this->object, $this); } public function get_recipient() { $recipient = apply_filters("woocommerce_email_recipient_" . $this->id, $this->recipient, $this->object, $this); $recipients = array_map("trim", explode(",", $recipient)); $recipients = array_filter($recipients, "is_email"); return implode(", ", $recipients); } public function get_headers() { $header = "Content-Type: " . $this->get_content_type() . "\xd\xa"; if (in_array($this->id, array("new_order", "cancelled_order", "failed_order"), true)) { if ($this->object && $this->object->get_billing_email() && ($this->object->get_billing_first_name() || $this->object->get_billing_last_name())) { $header .= "Reply-to: " . $this->object->get_billing_first_name() . " " . $this->object->get_billing_last_name() . " <" . $this->object->get_billing_email() . ">
"; } } elseif ($this->get_from_address() && $this->get_from_name()) { $header .= "Reply-to: " . $this->get_from_name() . " <" . $this->get_from_address() . ">
\xa"; } return apply_filters("woocommerce_email_headers", $header, $this->id, $this->object, $this); } public function get_attachments() { return apply_filters("woocommerce_email_attachments", array(), $this->id, $this->object, $this); } public function get_email_type() { return $this->email_type && class_exists("DOMDocument") ? $this->email_type : "plain"; } public function get_content_type($default_content_type = '') { switch ($this->get_email_type()) { case "html": $content_type = "text/html"; break; case "multipart": $content_type = "multipart/alternative"; break; default: $content_type = "text/plain"; break; } return apply_filters("woocommerce_email_content_type", $content_type, $this, $default_content_type); } public function get_title() { return apply_filters("woocommerce_email_title", $this->title, $this); } public function get_description() { return apply_filters("woocommerce_email_description", $this->description, $this); } public function get_option($key, $empty_value = null) { $value = parent::get_option($key, $empty_value); return apply_filters("woocommerce_email_get_option", $value, $this, $value, $key, $empty_value); } public function is_enabled() { return apply_filters("woocommerce_email_enabled_" . $this->id, "yes" === $this->enabled, $this->object, $this); } public function is_manual() { return $this->manual; } public function is_customer_email() { return $this->customer_email; } public function get_blogname() { return wp_specialchars_decode(get_option("blogname"), ENT_QUOTES); } public function get_content() { $this->sending = true; if ("plain" === $this->get_email_type()) { $email_content = wordwrap(preg_replace($this->plain_search, $this->plain_replace, wp_strip_all_tags($this->get_content_plain())), 70); } else { $email_content = $this->get_content_html(); } return $email_content; } public function style_inline($content) { if (in_array($this->get_content_type(), array("text/html", "multipart/alternative"), true)) { ob_start(); wc_get_template("emails/email-styles.php"); $css = apply_filters("woocommerce_email_styles", ob_get_clean(), $this); $css_inliner_class = CssInliner::class; if ($this->supports_emogrifier() && class_exists($css_inliner_class)) { try { $css_inliner = CssInliner::fromHtml($content)->inlineCss($css); do_action("woocommerce_emogrifier", $css_inliner, $this); $dom_document = $css_inliner->getDomDocument(); HtmlPruner::fromDomDocument($dom_document)->removeElementsWithDisplayNone(); $content = CssToAttributeConverter::fromDomDocument($dom_document)->convertCssToVisualAttributes()->render(); } catch (Exception $e) { $logger = wc_get_logger(); $logger->error($e->getMessage(), array("source" => "emogrifier")); } } else { $content = "<style type="text/css">" . $css . "</style>" . $content; } } return $content; } protected function supports_emogrifier() { return class_exists("DOMDocument"); } public function get_content_plain() { return ''; } public function get_content_html() { return ''; } public function get_from_name($from_name = '') { $from_name = apply_filters("woocommerce_email_from_name", get_option("woocommerce_email_from_name"), $this, $from_name); return wp_specialchars_decode(esc_html($from_name), ENT_QUOTES); } public function get_from_address($from_email = '') { $from_email = apply_filters("woocommerce_email_from_address", get_option("woocommerce_email_from_address"), $this, $from_email); return sanitize_email($from_email); } public function send($to, $subject, $message, $headers, $attachments) { add_filter("wp_mail_from", array($this, "get_from_address")); add_filter("wp_mail_from_name", array($this, "get_from_name")); add_filter("wp_mail_content_type", array($this, "get_content_type")); $message = apply_filters("woocommerce_mail_content", $this->style_inline($message)); $mail_callback = apply_filters("woocommerce_mail_callback", "wp_mail", $this); $mail_callback_params = apply_filters("woocommerce_mail_callback_params", array($to, wp_specialchars_decode($subject), $message, $headers, $attachments), $this); $return = $mail_callback(...$mail_callback_params); remove_filter("wp_mail_from", array($this, "get_from_address")); remove_filter("wp_mail_from_name", array($this, "get_from_name")); remove_filter("wp_mail_content_type", array($this, "get_content_type")); $this->clear_alt_body_field(); do_action("woocommerce_email_sent", $return, $this->id, $this); return $return; } public function init_form_fields() { $placeholder_text = sprintf(__("Available placeholders: %s", "woocommerce"), "<code>" . esc_html(implode("</code>, <code>", array_keys($this->placeholders))) . "</code>"); $this->form_fields = array("enabled" => array("title" => __("Enable/Disable", "woocommerce"), "type" => "checkbox", "label" => __("Enable this email notification", "woocommerce"), "default" => "yes"), "subject" => array("title" => __("Subject", "woocommerce"), "type" => "text", "desc_tip" => true, "description" => $placeholder_text, "placeholder" => $this->get_default_subject(), "default" => ''), "heading" => array("title" => __("Email heading", "woocommerce"), "type" => "text", "desc_tip" => true, "description" => $placeholder_text, "placeholder" => $this->get_default_heading(), "default" => ''), "additional_content" => array("title" => __("Additional content", "woocommerce"), "description" => __("Text to appear below the main email content.", "woocommerce") . " " . $placeholder_text, "css" => "width:400px; height: 75px;", "placeholder" => __("N/A", "woocommerce"), "type" => "textarea", "default" => $this->get_default_additional_content(), "desc_tip" => true), "email_type" => array("title" => __("Email type", "woocommerce"), "type" => "select", "description" => __("Choose which format of email to send.", "woocommerce"), "default" => "html", "class" => "email_type wc-enhanced-select", "options" => $this->get_email_type_options(), "desc_tip" => true)); } public function get_email_type_options() { $types = array("plain" => __("Plain text", "woocommerce")); if (class_exists("DOMDocument")) { $types["html"] = __("HTML", "woocommerce"); $types["multipart"] = __("Multipart", "woocommerce"); } return $types; } public function process_admin_options() { parent::process_admin_options(); $post_data = $this->get_post_data(); if (isset($post_data["template_html_code"])) { $this->save_template($post_data["template_html_code"], $this->template_html); } if (isset($post_data["template_plain_code"])) { $this->save_template($post_data["template_plain_code"], $this->template_plain); } } public function get_template($type) { $type = basename($type); if ("template_html" === $type) { return $this->template_html; } elseif ("template_plain" === $type) { return $this->template_plain; } return ''; } protected function save_template($template_code, $template_path) { if (current_user_can("edit_themes") && !empty($template_code) && !empty($template_path)) { $saved = false; $file = $this->get_theme_template_file($template_path); $code = wp_unslash($template_code); if (is_writeable($file)) { $f = fopen($file, "w+"); if (false !== $f) { fwrite($f, $code); fclose($f); $saved = true; } } if (!$saved) { $redirect = add_query_arg("wc_error", rawurlencode(__("Could not write to template file.", "woocommerce"))); wp_safe_redirect($redirect); die; } } } public function get_theme_template_file($template) { return get_stylesheet_directory() . "/" . apply_filters("woocommerce_template_directory", "woocommerce", $template) . "/" . $template; } protected function move_template_action($template_type) { $template = $this->get_template($template_type); if (!empty($template)) { $theme_file = $this->get_theme_template_file($template); if (wp_mkdir_p(dirname($theme_file)) && !file_exists($theme_file)) { $core_file = $this->template_base . $template; $template_file = apply_filters("woocommerce_locate_core_template", $core_file, $template, $this->template_base, $this->id); copy($template_file, $theme_file); do_action("woocommerce_copy_email_template", $template_type, $this); ?>
<div class="updated">
<p><?php echo esc_html__("Template file copied to theme.", "woocommerce"); ?>
</p>
</div>
<?php } } } protected function delete_template_action($template_type) { $template = $this->get_template($template_type); if ($template) { if (!empty($template)) { $theme_file = $this->get_theme_template_file($template); if (file_exists($theme_file)) { unlink($theme_file); do_action("woocommerce_delete_email_template", $template_type, $this); ?>
<div class="updated">
<p><?php echo esc_html__("Template file deleted from theme.", "woocommerce"); ?>
</p>
</div>
<?php } } } } protected function admin_actions() { if ((!empty($this->template_html) || !empty($this->template_plain)) && (!empty($_GET["move_template"]) || !empty($_GET["delete_template"])) && "GET" === $_SERVER["REQUEST_METHOD"]) { if (empty($_GET["_wc_email_nonce"]) || !wp_verify_nonce(wc_clean(wp_unslash($_GET["_wc_email_nonce"])), "woocommerce_email_template_nonce")) { wp_die(esc_html__("Action failed. Please refresh the page and retry.", "woocommerce")); } if (!current_user_can("edit_themes")) { wp_die(esc_html__("You don’t have permission to do this.", "woocommerce")); } if (!empty($_GET["move_template"])) { $this->move_template_action(wc_clean(wp_unslash($_GET["move_template"]))); } if (!empty($_GET["delete_template"])) { $this->delete_template_action(wc_clean(wp_unslash($_GET["delete_template"]))); } } } public function admin_options() { $this->admin_actions(); ?>
<h2><?php echo esc_html($this->get_title()); ?>
<?php wc_back_link(__("Return to emails", "woocommerce"), admin_url("admin.php?page=wc-settings&tab=email")); ?>
</h2>
<?php echo wpautop(wp_kses_post($this->get_description())); ?>
<?php do_action("woocommerce_email_settings_before", $this); ?>
<table class="form-table">
<?php $this->generate_settings_html(); ?>
</table>
<?php do_action("woocommerce_email_settings_after", $this); ?>
<?php if (current_user_can("edit_themes") && (!empty($this->template_html) || !empty($this->template_plain))) { ?>
<div id="template">
<?php $templates = array("template_html" => __("HTML template", "woocommerce"), "template_plain" => __("Plain text template", "woocommerce")); foreach ($templates as $template_type => $title) { $template = $this->get_template($template_type); if (empty($template)) { continue; } $local_file = $this->get_theme_template_file($template); $core_file = $this->template_base . $template; $template_file = apply_filters("woocommerce_locate_core_template", $core_file, $template, $this->template_base, $this->id); $template_dir = apply_filters("woocommerce_template_directory", "woocommerce", $template); ?>
<div class="template <?php echo esc_attr($template_type); ?>
">
<h4><?php echo wp_kses_post($title); ?>
</h4>
<?php if (file_exists($local_file)) { ?>
<p>
<a href="#" class="button toggle_editor"></a>
<?php if (is_writable($local_file)) { ?>
<a href="<?php echo esc_url(wp_nonce_url(remove_query_arg(array("move_template", "saved"), add_query_arg("delete_template", $template_type)), "woocommerce_email_template_nonce", "_wc_email_nonce")); ?>
" class="delete_template button">
<?php esc_html_e("Delete template file", "woocommerce"); ?>
</a>
<?php } ?>
<?php printf(esc_html__("This template has been overridden by your theme and can be found in: %s.", "woocommerce"), "<code>" . esc_html(trailingslashit(basename(get_stylesheet_directory())) . $template_dir . "/" . $template) . "</code>"); ?>
</p>
<div class="editor" style="display:none">
<textarea class="code" cols="25" rows="20"
<?php if (!is_writable($local_file)) { ?>
readonly="readonly" disabled="disabled"
<?php } else { ?>
data-name="<?php echo esc_attr($template_type) . "_code"; ?>
"<?php } ?>
><?php echo esc_html(file_get_contents($local_file)); ?>
</textarea>
</div>
<?php } elseif (file_exists($template_file)) { ?>
<p>
<a href="#" class="button toggle_editor"></a>
<?php $emails_dir = get_stylesheet_directory() . "/" . $template_dir . "/emails"; $templates_dir = get_stylesheet_directory() . "/" . $template_dir; $theme_dir = get_stylesheet_directory(); if (is_dir($emails_dir)) { $target_dir = $emails_dir; } elseif (is_dir($templates_dir)) { $target_dir = $templates_dir; } else { $target_dir = $theme_dir; } if (is_writable($target_dir)) { ?>
<a href="<?php echo esc_url(wp_nonce_url(remove_query_arg(array("delete_template", "saved"), add_query_arg("move_template", $template_type)), "woocommerce_email_template_nonce", "_wc_email_nonce")); ?>
" class="button">
<?php esc_html_e("Copy file to theme", "woocommerce"); ?>
</a>
<?php } ?>
<?php printf(esc_html__("To override and edit this email template copy %1$s to your theme folder: %2$s.", "woocommerce"), "<code>" . esc_html(plugin_basename($template_file)) . "</code>", "<code>" . esc_html(trailingslashit(basename(get_stylesheet_directory())) . $template_dir . "/" . $template) . "</code>"); ?>
</p>
<div class="editor" style="display:none">
<textarea class="code" readonly="readonly" disabled="disabled" cols="25" rows="20"><?php echo esc_html(file_get_contents($template_file)); ?>
</textarea>
</div>
<?php } else { ?>
<p><?php esc_html_e("File was not found.", "woocommerce"); ?>
</p>
<?php } ?>
</div>
<?php } ?>
</div>
<?php wc_enqueue_js("jQuery( 'select.email_type' ).on( 'change', function() {\xa\xa\x9\x9 var val = jQuery( this ).val();\xa
jQuery( '.template_plain, .template_html' ).show();
\x9 \x9 if ( val != 'multipart' && val != 'html' ) {
\x9 jQuery('.template_html').hide();
\x9 \x9\x9\x9}
\xa\x9\x9\x9 \x9if ( val != 'multipart' && val != 'plain' ) {\xa \x9\x9\x9 \x9jQuery('.template_plain').hide();
\x9\x9 }
\x9\x9\x9}).trigger( 'change' );\xa
\x9 var view = '" . esc_js(__("View template", "woocommerce")) . "';
\x9\x9 var hide = '" . esc_js(__("Hide template", "woocommerce")) . "';\xa
\x9 jQuery( 'a.toggle_editor' ).text( view ).on( 'click', function() {\xa \x9\x9 var label = hide;
\x9 \x9if ( jQuery( this ).closest(' .template' ).find( '.editor' ).is(':visible') ) {
\x9\x9\x9\x9 \x9var label = view;\xa \x9 }
\xa\x9\x9 jQuery( this ).text( label ).closest(' .template' ).find( '.editor' ).slideToggle();
\x9\x9\x9 return false;\xa \x9\x9\x9} );
\x9\x9\x9 jQuery( 'a.delete_template' ).on( 'click', function() {\xa\x9\x9\x9 if ( window.confirm('" . esc_js(__("Are you sure you want to delete this template file?", "woocommerce")) . "') ) {
\x9 \x9\x9 return true;\xa \x9 \x9 }\xa\xa\x9 return false;\xa \x9\x9});
\x9 \x9jQuery( '.editor textarea' ).on( 'change', function() {
\x9 var name = jQuery( this ).attr( 'data-name' );
\xa \x9\x9 if ( name ) {
\x9\x9 \x9 jQuery( this ).attr( 'name', name );\xa\x9 }\xa\x9\x9\x9 });"); } } private function clear_alt_body_field() : void { global $phpmailer; if ($phpmailer instanceof PHPMailer\PHPMailer\PHPMailer) { $phpmailer->AltBody = ''; } } } ?>
Did this file decode correctly?
Original Code
<?php
use Pelago\Emogrifier\CssInliner; use Pelago\Emogrifier\HtmlProcessor\CssToAttributeConverter; use Pelago\Emogrifier\HtmlProcessor\HtmlPruner; goto Vynrb; Vynrb: if (!defined("\x41\x42\x53\x50\101\x54\110")) { die; } goto dImdj; dImdj: if (class_exists("\x57\103\x5f\x45\155\141\151\154", false)) { return; } goto kIKrc; kIKrc: class WC_Email extends WC_Settings_API { public $id; public $title; public $enabled; public $description; public $heading = ''; public $subject = ''; public $template_plain; public $template_html; public $template_base; public $recipient; public $object; public $mime_boundary; public $mime_boundary_header; public $sending; protected $manual = false; protected $customer_email = false; public $plain_search = array("\x2f\15\57", "\x2f\46\x28\x6e\x62\163\x70\x7c\43\x30\x2a\61\x36\60\51\73\x2f\x69", "\x2f\x26\x28\161\165\x6f\164\x7c\x72\x64\161\x75\x6f\x7c\154\144\x71\x75\157\174\43\x30\x2a\x38\x32\x32\60\x7c\43\x30\52\70\62\x32\x31\174\x23\x30\x2a\61\64\67\174\43\x30\52\x31\x34\x38\x29\x3b\x2f\151", "\57\46\x28\x61\x70\x6f\163\174\162\x73\161\165\x6f\x7c\154\x73\161\165\157\x7c\43\x30\52\70\62\x31\66\174\43\x30\x2a\x38\62\x31\x37\51\73\x2f\151", "\x2f\46\147\x74\x3b\57\151", "\x2f\46\x6c\x74\73\x2f\151", "\57\46\x23\60\x2a\63\70\73\x2f\x69", "\57\46\141\x6d\x70\x3b\57\x69", "\x2f\x26\x28\143\157\160\171\174\43\60\x2a\61\66\71\x29\x3b\x2f\x69", "\x2f\46\x28\164\162\141\x64\x65\174\x23\x30\52\70\64\70\62\174\43\60\x2a\x31\65\63\x29\x3b\57\x69", "\x2f\46\x28\162\145\x67\x7c\43\x30\x2a\61\x37\x34\51\x3b\x2f\151", "\x2f\x26\50\155\144\x61\x73\150\x7c\x23\60\52\61\65\x31\174\x23\60\52\70\62\61\62\x29\x3b\x2f\x69", "\x2f\46\x28\156\x64\x61\163\x68\174\155\151\x6e\165\x73\174\x23\x30\52\70\x32\61\x31\x7c\43\x30\52\x38\x37\62\x32\51\x3b\57\x69", "\x2f\46\50\142\x75\154\154\174\43\x30\x2a\x31\x34\x39\174\x23\60\52\x38\62\62\x36\51\73\57\x69", "\57\x26\x28\160\157\x75\156\x64\x7c\43\x30\x2a\61\66\63\x29\x3b\57\x69", "\57\46\50\x65\x75\162\157\x7c\x23\x30\x2a\x38\63\66\64\51\x3b\x2f\151", "\57\x26\50\x64\x6f\x6c\154\x61\x72\174\43\x30\x2a\63\66\51\73\x2f\x69", "\57\46\x5b\x5e\x26\x5c\x73\x3b\x5d\x2b\73\57\x69", "\57\x5b\x20\x5d\173\x32\x2c\x7d\57"); public $plain_replace = array('', "\40", "\42", "\x27", "\x3e", "\x3c", "\46", "\x26", "\x28\x63\x29", "\50\x74\x6d\x29", "\x28\122\x29", "\55\x2d", "\55", "\52", "\xc2\243", "\105\x55\x52", "\44", '', "\40"); protected $placeholders = array(); public $find = array(); public $replace = array(); public $email_type; public function __construct() { $this->placeholders = array_merge(array("\x7b\x73\151\164\145\137\x74\151\x74\154\x65\x7d" => $this->get_blogname(), "\x7b\163\x69\164\x65\x5f\141\144\x64\x72\145\x73\163\175" => wp_parse_url(home_url(), PHP_URL_HOST), "\x7b\x73\x69\x74\x65\137\x75\162\x6c\175" => wp_parse_url(home_url(), PHP_URL_HOST)), $this->placeholders); $this->init_form_fields(); $this->init_settings(); if (is_null($this->template_base)) { $this->template_base = WC()->plugin_path() . "\x2f\x74\x65\155\160\154\141\164\x65\163\57"; } $this->email_type = $this->get_option("\145\155\141\x69\x6c\x5f\x74\171\160\145"); $this->enabled = $this->get_option("\145\156\x61\142\154\145\144"); add_action("\x70\x68\x70\155\141\x69\x6c\145\162\x5f\151\x6e\151\x74", array($this, "\150\141\156\144\154\145\137\x6d\x75\x6c\164\151\x70\141\162\164")); add_action("\167\157\x6f\143\x6f\x6d\155\x65\x72\143\x65\x5f\x75\x70\144\141\164\x65\137\x6f\x70\164\x69\157\x6e\163\137\x65\x6d\x61\x69\154\137" . $this->id, array($this, "\160\162\x6f\143\x65\x73\163\x5f\x61\144\x6d\151\x6e\137\x6f\160\164\151\157\156\x73")); } public function handle_multipart($mailer) { if (!$this->sending) { return $mailer; } if ("\155\x75\154\x74\151\x70\141\x72\164" === $this->get_email_type()) { $mailer->AltBody = wordwrap(preg_replace($this->plain_search, $this->plain_replace, wp_strip_all_tags($this->get_content_plain()))); } else { $mailer->AltBody = ''; } $this->sending = false; return $mailer; } public function format_string($string) { $find = array_keys($this->placeholders); $replace = array_values($this->placeholders); $find = array_merge((array) $this->find, $find); $replace = array_merge((array) $this->replace, $replace); $find[] = "\173\142\154\x6f\x67\x6e\141\x6d\145\x7d"; $replace[] = $this->get_blogname(); if (has_filter("\167\157\157\x63\x6f\x6d\155\145\x72\143\145\x5f\145\x6d\141\151\154\x5f\146\x6f\x72\x6d\x61\x74\x5f\x73\164\162\x69\x6e\x67\137\162\x65\x70\x6c\x61\143\x65") || has_filter("\167\157\x6f\x63\x6f\155\155\x65\x72\143\145\x5f\145\155\141\x69\x6c\x5f\146\x6f\x72\155\x61\164\137\x73\x74\x72\x69\x6e\x67\x5f\146\x69\156\144")) { $legacy_find = $this->find; $legacy_replace = $this->replace; foreach ($this->placeholders as $find => $replace) { $legacy_key = sanitize_title(str_replace("\137", "\55", trim($find, "\x7b\x7d"))); $legacy_find[$legacy_key] = $find; $legacy_replace[$legacy_key] = $replace; } $string = str_replace(apply_filters("\167\157\x6f\143\157\x6d\x6d\145\x72\x63\145\137\x65\155\141\151\154\x5f\x66\x6f\x72\155\x61\164\x5f\x73\164\162\151\x6e\x67\137\x66\151\x6e\144", $legacy_find, $this), apply_filters("\167\157\x6f\x63\157\155\155\x65\162\x63\x65\137\145\x6d\x61\x69\154\x5f\146\157\162\x6d\141\164\137\x73\x74\162\x69\156\x67\x5f\162\x65\160\x6c\x61\143\145", $legacy_replace, $this), $string); } return apply_filters("\x77\157\x6f\143\157\155\x6d\145\x72\x63\x65\137\145\x6d\141\151\154\137\146\157\162\x6d\x61\x74\137\163\164\162\x69\156\147", str_replace($find, $replace, $string), $this); } public function setup_locale() { $switch_email_locale = apply_filters("\x77\x6f\x6f\143\157\155\x6d\x65\162\143\x65\x5f\141\154\154\x6f\x77\137\x73\167\x69\x74\x63\150\x69\156\x67\x5f\x65\155\141\x69\154\x5f\154\x6f\143\x61\154\145", true, $this); if ($switch_email_locale && $this->is_customer_email() && apply_filters("\167\x6f\157\143\x6f\x6d\x6d\145\x72\x63\x65\137\x65\155\141\151\154\137\x73\x65\164\x75\x70\137\x6c\x6f\143\141\154\x65", true)) { wc_switch_to_site_locale(); } } public function restore_locale() { $restore_email_locale = apply_filters("\x77\x6f\157\143\x6f\x6d\x6d\x65\162\143\145\x5f\141\x6c\x6c\x6f\x77\x5f\162\x65\163\164\157\x72\x69\x6e\147\x5f\145\155\x61\x69\x6c\x5f\154\157\x63\141\154\x65", true, $this); if ($restore_email_locale && $this->is_customer_email() && apply_filters("\x77\157\x6f\143\157\x6d\155\x65\162\143\x65\x5f\145\155\x61\x69\x6c\x5f\162\x65\163\x74\157\x72\145\x5f\x6c\x6f\143\x61\x6c\145", true)) { wc_restore_locale(); } } public function get_default_subject() { return $this->subject; } public function get_default_heading() { return $this->heading; } public function get_default_additional_content() { return ''; } public function get_additional_content() { return apply_filters("\167\157\x6f\x63\x6f\155\x6d\x65\162\143\145\137\145\155\141\151\x6c\137\x61\x64\144\x69\164\x69\157\156\x61\x6c\137\x63\x6f\156\x74\145\156\x74\x5f" . $this->id, $this->format_string($this->get_option("\x61\144\144\x69\164\151\x6f\x6e\x61\154\x5f\143\157\156\x74\x65\x6e\x74", $this->get_default_additional_content())), $this->object, $this); } public function get_subject() { return apply_filters("\167\157\157\x63\x6f\x6d\155\x65\x72\x63\x65\x5f\145\155\x61\151\x6c\137\163\165\142\152\145\143\164\137" . $this->id, $this->format_string($this->get_option("\x73\165\x62\x6a\x65\143\x74", $this->get_default_subject())), $this->object, $this); } public function get_heading() { return apply_filters("\167\157\157\x63\157\155\155\145\162\x63\x65\137\145\x6d\x61\x69\154\x5f\150\145\x61\144\x69\x6e\147\137" . $this->id, $this->format_string($this->get_option("\x68\145\141\x64\151\x6e\147", $this->get_default_heading())), $this->object, $this); } public function get_recipient() { $recipient = apply_filters("\x77\x6f\157\x63\x6f\155\x6d\x65\162\x63\145\x5f\145\155\141\151\x6c\137\162\145\x63\151\160\151\145\x6e\x74\x5f" . $this->id, $this->recipient, $this->object, $this); $recipients = array_map("\x74\162\151\x6d", explode("\x2c", $recipient)); $recipients = array_filter($recipients, "\151\163\137\145\x6d\141\x69\x6c"); return implode("\54\40", $recipients); } public function get_headers() { $header = "\x43\157\156\164\x65\156\164\x2d\x54\171\x70\x65\72\x20" . $this->get_content_type() . "\xd\xa"; if (in_array($this->id, array("\x6e\x65\167\137\157\x72\144\145\x72", "\x63\x61\x6e\143\145\x6c\154\145\x64\137\x6f\x72\144\x65\x72", "\146\141\151\x6c\x65\x64\x5f\157\162\x64\145\162"), true)) { if ($this->object && $this->object->get_billing_email() && ($this->object->get_billing_first_name() || $this->object->get_billing_last_name())) { $header .= "\x52\145\x70\154\171\55\x74\157\72\x20" . $this->object->get_billing_first_name() . "\40" . $this->object->get_billing_last_name() . "\40\x3c" . $this->object->get_billing_email() . "\76\15\12"; } } elseif ($this->get_from_address() && $this->get_from_name()) { $header .= "\122\x65\x70\x6c\171\x2d\x74\x6f\x3a\40" . $this->get_from_name() . "\40\x3c" . $this->get_from_address() . "\76\15\xa"; } return apply_filters("\x77\x6f\x6f\143\x6f\x6d\x6d\145\x72\143\x65\137\x65\155\x61\x69\154\137\x68\145\x61\x64\145\x72\x73", $header, $this->id, $this->object, $this); } public function get_attachments() { return apply_filters("\167\157\157\x63\157\155\x6d\x65\x72\143\145\x5f\145\155\141\151\x6c\x5f\x61\x74\164\x61\x63\x68\155\x65\156\x74\x73", array(), $this->id, $this->object, $this); } public function get_email_type() { return $this->email_type && class_exists("\x44\117\115\x44\157\x63\x75\155\x65\x6e\164") ? $this->email_type : "\x70\x6c\141\x69\156"; } public function get_content_type($default_content_type = '') { switch ($this->get_email_type()) { case "\150\x74\x6d\x6c": $content_type = "\164\x65\x78\x74\57\x68\x74\x6d\x6c"; break; case "\x6d\165\154\x74\x69\x70\141\162\x74": $content_type = "\155\x75\x6c\x74\151\x70\x61\162\x74\57\x61\x6c\164\x65\x72\x6e\x61\164\x69\x76\x65"; break; default: $content_type = "\164\x65\x78\x74\57\x70\154\141\151\x6e"; break; } return apply_filters("\167\x6f\157\143\x6f\155\155\x65\162\x63\x65\x5f\x65\155\141\x69\154\x5f\x63\157\x6e\x74\x65\156\x74\x5f\x74\171\160\x65", $content_type, $this, $default_content_type); } public function get_title() { return apply_filters("\167\157\x6f\143\157\x6d\155\x65\162\x63\145\137\x65\155\141\151\154\x5f\x74\151\x74\154\x65", $this->title, $this); } public function get_description() { return apply_filters("\x77\x6f\157\143\x6f\x6d\x6d\145\162\x63\145\137\x65\155\x61\151\x6c\x5f\x64\145\x73\x63\162\151\x70\x74\151\157\156", $this->description, $this); } public function get_option($key, $empty_value = null) { $value = parent::get_option($key, $empty_value); return apply_filters("\167\157\157\143\157\x6d\155\145\162\143\x65\137\145\x6d\x61\151\154\137\x67\145\164\x5f\157\x70\164\x69\x6f\x6e", $value, $this, $value, $key, $empty_value); } public function is_enabled() { return apply_filters("\x77\157\157\x63\157\x6d\x6d\145\162\x63\145\137\145\155\x61\151\x6c\137\145\156\x61\x62\x6c\x65\x64\x5f" . $this->id, "\171\x65\x73" === $this->enabled, $this->object, $this); } public function is_manual() { return $this->manual; } public function is_customer_email() { return $this->customer_email; } public function get_blogname() { return wp_specialchars_decode(get_option("\x62\x6c\157\x67\156\x61\x6d\145"), ENT_QUOTES); } public function get_content() { $this->sending = true; if ("\160\154\x61\x69\156" === $this->get_email_type()) { $email_content = wordwrap(preg_replace($this->plain_search, $this->plain_replace, wp_strip_all_tags($this->get_content_plain())), 70); } else { $email_content = $this->get_content_html(); } return $email_content; } public function style_inline($content) { if (in_array($this->get_content_type(), array("\x74\145\x78\x74\57\150\164\155\154", "\x6d\x75\x6c\164\151\x70\x61\x72\164\57\x61\154\164\x65\x72\x6e\141\x74\x69\x76\145"), true)) { ob_start(); wc_get_template("\145\155\x61\151\154\x73\x2f\145\x6d\141\151\x6c\55\x73\x74\x79\x6c\145\x73\x2e\x70\150\160"); $css = apply_filters("\x77\x6f\157\143\x6f\155\x6d\145\162\143\x65\137\x65\155\x61\151\x6c\137\163\164\x79\x6c\x65\x73", ob_get_clean(), $this); $css_inliner_class = CssInliner::class; if ($this->supports_emogrifier() && class_exists($css_inliner_class)) { try { $css_inliner = CssInliner::fromHtml($content)->inlineCss($css); do_action("\167\x6f\x6f\x63\157\155\x6d\145\162\x63\145\x5f\x65\x6d\x6f\147\x72\x69\146\151\145\162", $css_inliner, $this); $dom_document = $css_inliner->getDomDocument(); HtmlPruner::fromDomDocument($dom_document)->removeElementsWithDisplayNone(); $content = CssToAttributeConverter::fromDomDocument($dom_document)->convertCssToVisualAttributes()->render(); } catch (Exception $e) { $logger = wc_get_logger(); $logger->error($e->getMessage(), array("\163\x6f\x75\162\x63\145" => "\145\x6d\x6f\x67\x72\151\146\151\145\x72")); } } else { $content = "\x3c\x73\164\171\x6c\x65\40\x74\x79\160\x65\x3d\42\x74\145\170\164\57\143\x73\x73\x22\x3e" . $css . "\74\x2f\163\164\x79\154\x65\76" . $content; } } return $content; } protected function supports_emogrifier() { return class_exists("\x44\x4f\115\x44\157\143\x75\155\145\156\x74"); } public function get_content_plain() { return ''; } public function get_content_html() { return ''; } public function get_from_name($from_name = '') { $from_name = apply_filters("\x77\157\x6f\143\x6f\155\155\145\x72\143\x65\x5f\145\155\141\x69\x6c\137\x66\x72\157\x6d\137\x6e\x61\x6d\145", get_option("\167\157\x6f\x63\x6f\155\155\145\162\x63\x65\x5f\x65\x6d\x61\x69\154\x5f\146\x72\157\x6d\x5f\x6e\141\155\145"), $this, $from_name); return wp_specialchars_decode(esc_html($from_name), ENT_QUOTES); } public function get_from_address($from_email = '') { $from_email = apply_filters("\167\x6f\157\x63\157\x6d\155\x65\162\143\145\x5f\x65\155\141\x69\154\137\146\162\157\155\137\141\x64\144\162\145\x73\163", get_option("\167\157\x6f\x63\157\x6d\155\145\x72\143\145\137\x65\x6d\141\x69\x6c\x5f\x66\162\x6f\x6d\137\141\144\144\162\145\163\x73"), $this, $from_email); return sanitize_email($from_email); } public function send($to, $subject, $message, $headers, $attachments) { add_filter("\x77\160\x5f\155\141\x69\x6c\137\146\x72\157\155", array($this, "\x67\x65\x74\x5f\146\162\157\155\137\141\x64\x64\x72\145\x73\163")); add_filter("\x77\x70\x5f\x6d\141\151\154\x5f\x66\162\157\155\x5f\x6e\141\155\145", array($this, "\147\145\164\137\146\162\x6f\155\x5f\x6e\x61\155\145")); add_filter("\167\160\137\x6d\x61\x69\x6c\x5f\x63\157\x6e\164\145\156\164\x5f\164\x79\x70\145", array($this, "\147\x65\x74\137\x63\157\156\x74\145\x6e\x74\137\164\171\160\145")); $message = apply_filters("\x77\157\157\143\157\x6d\x6d\145\162\143\145\137\x6d\x61\x69\x6c\137\143\157\156\164\145\x6e\164", $this->style_inline($message)); $mail_callback = apply_filters("\x77\x6f\157\x63\157\155\x6d\145\162\x63\145\x5f\155\141\x69\x6c\x5f\x63\x61\x6c\154\142\x61\x63\x6b", "\x77\160\137\155\x61\x69\x6c", $this); $mail_callback_params = apply_filters("\167\x6f\x6f\x63\157\x6d\155\x65\x72\143\x65\x5f\155\141\151\x6c\137\143\x61\154\154\x62\x61\x63\x6b\x5f\160\141\162\x61\x6d\163", array($to, wp_specialchars_decode($subject), $message, $headers, $attachments), $this); $return = $mail_callback(...$mail_callback_params); remove_filter("\x77\x70\x5f\155\x61\x69\x6c\x5f\146\x72\157\155", array($this, "\147\145\164\137\x66\x72\157\155\x5f\141\x64\x64\162\145\x73\x73")); remove_filter("\x77\x70\137\x6d\x61\151\x6c\137\x66\162\157\x6d\x5f\156\141\155\x65", array($this, "\x67\x65\164\137\x66\162\x6f\155\137\x6e\141\x6d\145")); remove_filter("\x77\x70\x5f\155\x61\x69\x6c\x5f\x63\x6f\156\164\x65\x6e\x74\137\164\171\x70\145", array($this, "\x67\145\x74\137\143\x6f\x6e\164\145\x6e\164\x5f\164\171\160\x65")); $this->clear_alt_body_field(); do_action("\x77\157\157\143\x6f\x6d\x6d\145\x72\143\145\x5f\145\155\x61\x69\154\x5f\x73\145\x6e\x74", $return, $this->id, $this); return $return; } public function init_form_fields() { $placeholder_text = sprintf(__("\101\x76\x61\x69\x6c\141\x62\x6c\x65\40\x70\x6c\141\x63\x65\x68\x6f\154\144\145\x72\163\x3a\x20\x25\x73", "\x77\x6f\x6f\x63\157\x6d\155\x65\162\143\x65"), "\x3c\143\157\144\x65\x3e" . esc_html(implode("\x3c\57\x63\157\x64\x65\x3e\x2c\40\x3c\x63\157\144\x65\76", array_keys($this->placeholders))) . "\x3c\x2f\x63\x6f\144\145\x3e"); $this->form_fields = array("\x65\x6e\x61\142\x6c\145\144" => array("\164\x69\x74\154\145" => __("\105\156\141\x62\x6c\145\57\x44\x69\163\141\142\154\145", "\167\157\157\143\157\x6d\x6d\145\162\143\x65"), "\x74\x79\160\145" => "\x63\x68\x65\x63\153\x62\x6f\x78", "\x6c\141\142\x65\154" => __("\105\156\141\142\x6c\x65\40\164\150\x69\x73\x20\145\x6d\141\x69\x6c\x20\156\157\164\151\146\151\143\x61\164\x69\157\156", "\167\x6f\x6f\x63\157\155\x6d\x65\162\143\x65"), "\x64\145\146\x61\165\x6c\x74" => "\171\x65\x73"), "\163\x75\142\x6a\145\x63\x74" => array("\x74\x69\x74\x6c\x65" => __("\123\165\142\152\145\143\x74", "\x77\x6f\157\x63\157\x6d\x6d\145\162\143\145"), "\x74\171\x70\145" => "\x74\x65\170\164", "\x64\x65\x73\x63\137\164\151\160" => true, "\144\145\x73\x63\162\151\x70\164\151\x6f\x6e" => $placeholder_text, "\x70\154\x61\x63\x65\x68\x6f\154\x64\x65\x72" => $this->get_default_subject(), "\x64\145\x66\x61\165\154\164" => ''), "\150\145\141\x64\x69\x6e\147" => array("\164\151\x74\154\145" => __("\105\155\141\151\x6c\40\x68\145\x61\x64\x69\156\x67", "\x77\157\157\x63\157\155\x6d\145\x72\x63\145"), "\164\171\x70\x65" => "\164\145\x78\x74", "\144\145\163\143\x5f\164\151\x70" => true, "\144\x65\163\x63\x72\151\x70\x74\151\x6f\156" => $placeholder_text, "\160\154\141\143\145\150\157\x6c\x64\x65\162" => $this->get_default_heading(), "\144\x65\146\141\165\154\164" => ''), "\141\144\144\x69\164\x69\x6f\156\x61\x6c\x5f\x63\157\x6e\164\145\156\x74" => array("\164\151\164\x6c\145" => __("\101\144\144\x69\x74\151\157\x6e\x61\x6c\40\x63\157\156\164\145\x6e\164", "\167\x6f\x6f\143\x6f\x6d\155\x65\x72\x63\145"), "\144\x65\x73\x63\x72\151\160\x74\151\157\x6e" => __("\124\x65\x78\x74\x20\164\x6f\40\141\160\x70\145\141\162\40\142\145\154\x6f\x77\x20\x74\x68\x65\40\155\141\151\156\40\145\x6d\x61\x69\x6c\x20\143\x6f\x6e\164\145\156\164\x2e", "\167\157\157\143\157\155\155\145\x72\x63\145") . "\x20" . $placeholder_text, "\143\x73\x73" => "\x77\x69\x64\164\150\72\x34\x30\60\160\x78\x3b\40\150\145\151\x67\150\x74\72\x20\x37\65\160\170\x3b", "\x70\154\x61\143\x65\150\157\154\144\x65\162" => __("\x4e\x2f\x41", "\167\157\157\143\x6f\155\155\145\162\143\145"), "\164\171\160\x65" => "\164\x65\170\164\x61\x72\x65\x61", "\144\145\146\141\x75\154\164" => $this->get_default_additional_content(), "\x64\145\163\143\137\x74\151\160" => true), "\x65\155\x61\x69\x6c\137\164\171\160\145" => array("\164\151\164\154\x65" => __("\105\155\x61\151\154\40\x74\x79\160\145", "\167\x6f\157\x63\x6f\x6d\x6d\145\162\x63\x65"), "\164\x79\160\x65" => "\x73\145\154\x65\143\164", "\144\x65\163\x63\x72\151\x70\x74\x69\x6f\156" => __("\x43\x68\157\x6f\163\x65\x20\x77\150\x69\x63\x68\40\x66\157\162\x6d\x61\x74\x20\157\146\x20\x65\x6d\x61\x69\154\40\x74\157\40\163\x65\x6e\x64\56", "\167\x6f\157\143\157\x6d\x6d\x65\162\143\145"), "\x64\145\146\x61\165\154\164" => "\x68\164\x6d\x6c", "\143\154\x61\x73\163" => "\145\x6d\141\x69\154\137\164\171\160\x65\40\167\143\x2d\x65\156\150\x61\x6e\143\145\x64\55\x73\x65\154\145\143\x74", "\157\x70\164\151\157\x6e\163" => $this->get_email_type_options(), "\x64\x65\x73\x63\137\x74\151\160" => true)); } public function get_email_type_options() { $types = array("\x70\154\141\x69\x6e" => __("\120\x6c\141\151\x6e\x20\164\145\170\x74", "\167\157\x6f\143\x6f\155\x6d\x65\x72\143\145")); if (class_exists("\104\117\x4d\x44\x6f\x63\165\155\x65\x6e\x74")) { $types["\x68\164\155\154"] = __("\110\124\x4d\x4c", "\167\157\157\143\x6f\155\155\x65\162\143\x65"); $types["\x6d\165\x6c\x74\x69\x70\141\162\164"] = __("\x4d\x75\x6c\x74\151\160\x61\x72\x74", "\167\157\x6f\x63\157\155\155\x65\162\x63\x65"); } return $types; } public function process_admin_options() { parent::process_admin_options(); $post_data = $this->get_post_data(); if (isset($post_data["\x74\x65\155\160\154\x61\x74\145\137\150\164\x6d\x6c\x5f\x63\x6f\144\145"])) { $this->save_template($post_data["\164\x65\x6d\x70\154\x61\x74\x65\137\150\164\155\154\137\143\157\x64\x65"], $this->template_html); } if (isset($post_data["\164\x65\x6d\x70\x6c\141\164\x65\137\160\x6c\x61\x69\156\x5f\143\157\144\x65"])) { $this->save_template($post_data["\164\x65\155\160\x6c\x61\164\x65\x5f\160\154\141\x69\x6e\137\x63\157\144\x65"], $this->template_plain); } } public function get_template($type) { $type = basename($type); if ("\164\145\155\x70\x6c\141\164\x65\x5f\150\x74\155\x6c" === $type) { return $this->template_html; } elseif ("\164\x65\x6d\x70\x6c\x61\164\x65\137\160\154\141\x69\156" === $type) { return $this->template_plain; } return ''; } protected function save_template($template_code, $template_path) { if (current_user_can("\x65\144\x69\164\137\x74\150\x65\x6d\145\163") && !empty($template_code) && !empty($template_path)) { $saved = false; $file = $this->get_theme_template_file($template_path); $code = wp_unslash($template_code); if (is_writeable($file)) { $f = fopen($file, "\x77\53"); if (false !== $f) { fwrite($f, $code); fclose($f); $saved = true; } } if (!$saved) { $redirect = add_query_arg("\167\x63\x5f\x65\162\x72\157\162", rawurlencode(__("\x43\x6f\x75\154\x64\40\156\x6f\x74\40\167\162\151\164\x65\40\164\157\40\164\145\x6d\x70\x6c\x61\164\145\x20\146\x69\154\145\x2e", "\x77\x6f\x6f\x63\x6f\155\x6d\x65\x72\143\145"))); wp_safe_redirect($redirect); die; } } } public function get_theme_template_file($template) { return get_stylesheet_directory() . "\x2f" . apply_filters("\167\x6f\x6f\143\x6f\155\x6d\x65\162\x63\145\x5f\x74\x65\x6d\160\x6c\141\164\145\137\x64\x69\162\x65\143\164\x6f\x72\x79", "\167\x6f\x6f\143\157\x6d\155\x65\162\143\x65", $template) . "\57" . $template; } protected function move_template_action($template_type) { $template = $this->get_template($template_type); if (!empty($template)) { $theme_file = $this->get_theme_template_file($template); if (wp_mkdir_p(dirname($theme_file)) && !file_exists($theme_file)) { $core_file = $this->template_base . $template; $template_file = apply_filters("\x77\x6f\157\x63\x6f\x6d\x6d\145\x72\x63\145\137\154\157\x63\x61\164\145\137\143\x6f\162\145\x5f\x74\145\x6d\160\154\141\x74\x65", $core_file, $template, $this->template_base, $this->id); copy($template_file, $theme_file); do_action("\167\157\x6f\143\x6f\155\155\145\x72\143\145\x5f\x63\x6f\160\171\x5f\145\155\x61\x69\154\x5f\x74\x65\x6d\x70\x6c\141\x74\145", $template_type, $this); ?>
<div class="updated">
<p><?php echo esc_html__("\124\145\155\160\154\x61\164\145\40\x66\x69\154\x65\x20\143\x6f\160\x69\145\144\40\164\x6f\x20\164\150\145\155\145\56", "\167\x6f\x6f\x63\x6f\155\x6d\x65\x72\143\x65"); ?>
</p>
</div>
<?php } } } protected function delete_template_action($template_type) { $template = $this->get_template($template_type); if ($template) { if (!empty($template)) { $theme_file = $this->get_theme_template_file($template); if (file_exists($theme_file)) { unlink($theme_file); do_action("\167\157\x6f\x63\x6f\155\x6d\x65\162\143\x65\x5f\144\x65\x6c\x65\164\x65\137\x65\155\x61\151\154\137\x74\145\x6d\x70\154\x61\x74\145", $template_type, $this); ?>
<div class="updated">
<p><?php echo esc_html__("\124\145\155\x70\x6c\141\x74\145\40\x66\x69\154\x65\x20\144\x65\x6c\145\164\x65\144\x20\146\x72\x6f\x6d\40\x74\150\145\x6d\x65\56", "\167\157\157\143\x6f\155\155\x65\162\x63\x65"); ?>
</p>
</div>
<?php } } } } protected function admin_actions() { if ((!empty($this->template_html) || !empty($this->template_plain)) && (!empty($_GET["\x6d\x6f\166\x65\x5f\164\x65\x6d\160\x6c\141\164\145"]) || !empty($_GET["\144\x65\154\145\164\x65\x5f\164\x65\155\x70\x6c\141\x74\145"])) && "\107\105\124" === $_SERVER["\122\105\121\x55\x45\123\x54\137\115\x45\124\x48\x4f\104"]) { if (empty($_GET["\x5f\x77\143\x5f\145\155\x61\x69\154\x5f\156\157\x6e\x63\x65"]) || !wp_verify_nonce(wc_clean(wp_unslash($_GET["\137\167\143\137\145\x6d\141\x69\154\x5f\x6e\x6f\156\x63\x65"])), "\x77\x6f\157\x63\x6f\x6d\155\x65\162\x63\145\137\x65\x6d\x61\x69\x6c\137\x74\x65\155\x70\154\141\164\145\x5f\x6e\157\x6e\143\x65")) { wp_die(esc_html__("\x41\143\x74\151\x6f\156\x20\146\x61\x69\x6c\145\144\56\40\x50\x6c\x65\141\x73\x65\40\x72\x65\146\162\145\163\150\x20\x74\150\x65\40\160\141\x67\x65\40\x61\156\x64\x20\x72\x65\164\x72\171\56", "\x77\157\x6f\x63\x6f\155\x6d\145\x72\x63\145")); } if (!current_user_can("\x65\x64\151\164\137\164\150\x65\x6d\145\x73")) { wp_die(esc_html__("\131\x6f\x75\x20\x64\x6f\156\46\x23\x38\62\x31\67\73\x74\40\150\x61\166\145\40\x70\x65\162\155\x69\163\163\151\157\156\x20\x74\x6f\40\x64\157\x20\164\x68\x69\163\56", "\167\x6f\x6f\x63\x6f\155\x6d\145\162\143\x65")); } if (!empty($_GET["\x6d\157\166\145\137\x74\145\x6d\160\x6c\x61\164\145"])) { $this->move_template_action(wc_clean(wp_unslash($_GET["\155\157\166\x65\137\164\x65\155\160\154\x61\164\x65"]))); } if (!empty($_GET["\x64\x65\154\145\x74\145\x5f\x74\145\x6d\x70\154\x61\164\x65"])) { $this->delete_template_action(wc_clean(wp_unslash($_GET["\144\x65\154\x65\164\145\x5f\x74\x65\x6d\x70\154\141\x74\145"]))); } } } public function admin_options() { $this->admin_actions(); ?>
<h2><?php echo esc_html($this->get_title()); ?>
<?php wc_back_link(__("\x52\145\x74\165\162\x6e\40\x74\x6f\x20\x65\x6d\x61\x69\x6c\x73", "\x77\157\157\x63\157\x6d\155\x65\x72\143\x65"), admin_url("\141\x64\x6d\x69\x6e\56\x70\x68\x70\x3f\x70\x61\147\145\75\x77\x63\x2d\x73\x65\164\x74\x69\156\x67\163\x26\x74\141\x62\75\145\155\x61\x69\x6c")); ?>
</h2>
<?php echo wpautop(wp_kses_post($this->get_description())); ?>
<?php do_action("\x77\x6f\x6f\143\x6f\155\x6d\145\162\x63\145\x5f\x65\x6d\141\151\154\137\163\145\x74\164\151\156\147\x73\137\142\145\146\x6f\162\145", $this); ?>
<table class="form-table">
<?php $this->generate_settings_html(); ?>
</table>
<?php do_action("\x77\x6f\157\x63\x6f\x6d\x6d\145\162\143\145\137\x65\155\x61\151\154\x5f\163\145\164\x74\151\x6e\x67\x73\137\141\146\x74\x65\x72", $this); ?>
<?php if (current_user_can("\145\x64\x69\164\137\x74\150\x65\x6d\145\x73") && (!empty($this->template_html) || !empty($this->template_plain))) { ?>
<div id="template">
<?php $templates = array("\x74\x65\x6d\x70\x6c\141\x74\x65\137\150\x74\x6d\x6c" => __("\x48\124\x4d\x4c\x20\164\145\155\160\154\141\x74\x65", "\167\157\x6f\x63\157\155\x6d\x65\162\x63\x65"), "\164\x65\x6d\160\x6c\141\164\145\x5f\x70\154\141\151\156" => __("\120\154\141\x69\x6e\x20\164\x65\x78\164\40\164\x65\155\160\x6c\141\164\145", "\x77\157\157\143\x6f\155\x6d\145\x72\143\x65")); foreach ($templates as $template_type => $title) { $template = $this->get_template($template_type); if (empty($template)) { continue; } $local_file = $this->get_theme_template_file($template); $core_file = $this->template_base . $template; $template_file = apply_filters("\167\157\x6f\143\x6f\x6d\x6d\145\162\x63\145\x5f\154\157\x63\x61\x74\x65\137\x63\157\x72\145\137\x74\x65\x6d\160\154\x61\x74\145", $core_file, $template, $this->template_base, $this->id); $template_dir = apply_filters("\x77\x6f\157\143\157\x6d\155\x65\x72\x63\x65\137\x74\145\x6d\x70\154\141\x74\x65\137\x64\151\x72\x65\x63\164\x6f\x72\x79", "\167\x6f\x6f\143\157\x6d\155\x65\x72\143\145", $template); ?>
<div class="template <?php echo esc_attr($template_type); ?>
">
<h4><?php echo wp_kses_post($title); ?>
</h4>
<?php if (file_exists($local_file)) { ?>
<p>
<a href="#" class="button toggle_editor"></a>
<?php if (is_writable($local_file)) { ?>
<a href="<?php echo esc_url(wp_nonce_url(remove_query_arg(array("\155\x6f\x76\145\x5f\164\145\155\x70\x6c\x61\x74\x65", "\x73\141\x76\145\x64"), add_query_arg("\144\145\x6c\145\x74\145\137\x74\145\155\x70\x6c\x61\x74\x65", $template_type)), "\167\157\157\143\x6f\x6d\x6d\145\x72\143\145\x5f\x65\155\141\151\154\x5f\x74\145\x6d\160\x6c\141\x74\145\x5f\x6e\x6f\x6e\x63\145", "\x5f\167\143\137\145\155\141\151\154\137\156\157\x6e\143\145")); ?>
" class="delete_template button">
<?php esc_html_e("\x44\145\154\145\164\x65\x20\x74\145\155\160\x6c\141\x74\145\x20\x66\x69\154\145", "\167\157\157\143\157\155\155\145\x72\143\x65"); ?>
</a>
<?php } ?>
<?php printf(esc_html__("\x54\x68\151\163\40\164\145\155\x70\x6c\x61\x74\145\40\150\141\163\40\x62\145\x65\156\40\x6f\166\145\x72\162\x69\x64\144\x65\156\40\x62\x79\x20\171\x6f\165\162\40\164\150\x65\x6d\x65\x20\141\x6e\144\x20\x63\141\156\40\142\145\x20\146\157\x75\156\144\40\x69\156\x3a\40\x25\x73\x2e", "\x77\157\x6f\x63\x6f\155\x6d\x65\162\143\x65"), "\74\143\157\144\145\76" . esc_html(trailingslashit(basename(get_stylesheet_directory())) . $template_dir . "\x2f" . $template) . "\74\57\x63\157\144\x65\x3e"); ?>
</p>
<div class="editor" style="display:none">
<textarea class="code" cols="25" rows="20"
<?php if (!is_writable($local_file)) { ?>
readonly="readonly" disabled="disabled"
<?php } else { ?>
data-name="<?php echo esc_attr($template_type) . "\137\143\x6f\144\145"; ?>
"<?php } ?>
><?php echo esc_html(file_get_contents($local_file)); ?>
</textarea>
</div>
<?php } elseif (file_exists($template_file)) { ?>
<p>
<a href="#" class="button toggle_editor"></a>
<?php $emails_dir = get_stylesheet_directory() . "\x2f" . $template_dir . "\x2f\145\155\141\151\x6c\x73"; $templates_dir = get_stylesheet_directory() . "\x2f" . $template_dir; $theme_dir = get_stylesheet_directory(); if (is_dir($emails_dir)) { $target_dir = $emails_dir; } elseif (is_dir($templates_dir)) { $target_dir = $templates_dir; } else { $target_dir = $theme_dir; } if (is_writable($target_dir)) { ?>
<a href="<?php echo esc_url(wp_nonce_url(remove_query_arg(array("\144\x65\x6c\x65\164\145\x5f\164\x65\155\x70\x6c\x61\x74\x65", "\163\141\166\x65\x64"), add_query_arg("\155\157\x76\145\137\164\145\x6d\x70\154\141\x74\x65", $template_type)), "\167\x6f\x6f\x63\x6f\x6d\155\145\162\143\x65\x5f\x65\155\x61\151\x6c\x5f\x74\145\x6d\160\154\x61\164\x65\137\x6e\x6f\156\x63\x65", "\137\167\x63\x5f\x65\x6d\141\x69\154\x5f\x6e\157\x6e\143\145")); ?>
" class="button">
<?php esc_html_e("\103\157\x70\x79\40\x66\x69\154\145\40\x74\x6f\40\164\150\x65\155\145", "\x77\x6f\x6f\x63\157\x6d\x6d\x65\162\143\x65"); ?>
</a>
<?php } ?>
<?php printf(esc_html__("\x54\x6f\40\x6f\x76\x65\x72\162\151\144\145\40\x61\x6e\x64\x20\145\144\x69\x74\40\164\x68\x69\163\x20\x65\155\x61\x69\154\x20\x74\x65\x6d\160\x6c\x61\164\145\x20\x63\x6f\x70\171\x20\x25\x31\44\x73\40\164\157\x20\171\x6f\165\162\40\164\150\x65\x6d\x65\x20\146\x6f\154\144\145\162\x3a\40\x25\62\x24\163\56", "\167\157\x6f\143\x6f\x6d\x6d\x65\x72\x63\x65"), "\x3c\143\x6f\144\145\x3e" . esc_html(plugin_basename($template_file)) . "\74\57\x63\x6f\144\x65\76", "\x3c\x63\x6f\x64\145\x3e" . esc_html(trailingslashit(basename(get_stylesheet_directory())) . $template_dir . "\57" . $template) . "\74\x2f\x63\157\x64\145\x3e"); ?>
</p>
<div class="editor" style="display:none">
<textarea class="code" readonly="readonly" disabled="disabled" cols="25" rows="20"><?php echo esc_html(file_get_contents($template_file)); ?>
</textarea>
</div>
<?php } else { ?>
<p><?php esc_html_e("\x46\x69\154\x65\x20\x77\x61\x73\40\x6e\x6f\164\x20\x66\157\x75\x6e\x64\x2e", "\167\157\x6f\143\x6f\155\155\145\162\x63\x65"); ?>
</p>
<?php } ?>
</div>
<?php } ?>
</div>
<?php wc_enqueue_js("\152\x51\x75\x65\x72\x79\50\x20\x27\163\145\x6c\145\x63\164\56\x65\x6d\x61\151\x6c\x5f\164\x79\160\145\47\x20\51\56\x6f\156\50\40\x27\x63\x68\141\156\147\145\47\54\40\x66\x75\x6e\143\x74\151\x6f\x6e\50\x29\x20\x7b\xa\xa\x9\x9\11\11\11\166\x61\x72\x20\166\141\154\x20\x3d\40\x6a\121\165\x65\x72\x79\x28\40\x74\150\x69\163\40\51\x2e\166\141\x6c\50\51\73\xa\12\11\11\11\11\11\x6a\x51\165\x65\162\x79\50\x20\x27\x2e\164\145\155\x70\154\x61\164\145\x5f\x70\154\x61\x69\156\54\40\56\164\145\155\x70\154\141\x74\145\137\150\x74\155\x6c\x27\40\x29\x2e\x73\x68\x6f\x77\50\x29\x3b\12\12\x9\11\x9\11\11\x69\146\x20\50\x20\166\141\x6c\x20\41\75\x20\47\155\165\x6c\x74\151\x70\x61\162\164\x27\x20\x26\x26\40\x76\141\x6c\40\41\x3d\x20\47\150\x74\155\x6c\x27\x20\51\40\x7b\12\11\11\x9\11\11\11\x6a\121\x75\145\162\x79\50\47\x2e\x74\145\x6d\160\154\141\164\145\x5f\150\164\155\x6c\47\x29\56\x68\x69\144\145\x28\51\x3b\12\x9\11\x9\x9\x9\175\12\xa\x9\x9\x9\11\x9\151\x66\40\x28\x20\166\141\x6c\x20\x21\x3d\40\x27\155\x75\x6c\x74\151\x70\141\162\164\x27\40\46\46\40\x76\141\x6c\x20\x21\x3d\x20\x27\x70\154\141\151\156\x27\x20\x29\40\x7b\xa\11\x9\x9\x9\11\x9\152\x51\x75\x65\162\x79\50\47\56\x74\145\x6d\160\154\x61\x74\x65\137\160\154\x61\151\156\x27\x29\x2e\150\x69\144\x65\50\51\x3b\12\11\11\x9\x9\11\175\12\12\11\x9\x9\x9\x7d\x29\56\x74\x72\x69\x67\147\x65\x72\50\x20\x27\x63\150\x61\156\147\x65\x27\40\x29\x3b\xa\12\11\x9\11\11\166\x61\162\40\x76\x69\145\x77\40\75\40\x27" . esc_js(__("\126\x69\145\167\x20\164\145\155\160\154\141\x74\145", "\167\157\157\x63\x6f\155\x6d\x65\x72\143\145")) . "\x27\73\12\x9\x9\11\11\x76\x61\x72\x20\x68\x69\x64\x65\x20\75\x20\x27" . esc_js(__("\110\x69\x64\x65\40\164\x65\x6d\160\154\x61\164\145", "\x77\x6f\x6f\x63\x6f\155\155\x65\x72\143\145")) . "\47\x3b\xa\12\11\11\x9\11\x6a\121\x75\x65\x72\171\50\x20\x27\141\x2e\x74\157\x67\147\154\x65\137\145\x64\151\x74\157\x72\47\40\x29\56\164\x65\x78\164\50\40\x76\x69\145\167\x20\x29\56\157\x6e\50\x20\47\x63\154\151\x63\x6b\x27\54\x20\146\x75\x6e\143\164\x69\x6f\156\x28\51\40\x7b\xa\11\11\x9\x9\11\x76\x61\162\40\x6c\x61\x62\145\154\x20\75\40\x68\x69\x64\x65\73\12\12\11\x9\11\11\x9\x69\146\x20\x28\x20\152\121\165\x65\x72\171\x28\40\x74\x68\x69\163\40\x29\56\143\x6c\157\163\145\x73\164\x28\x27\x20\x2e\x74\x65\x6d\160\154\141\x74\145\x27\40\x29\56\146\151\x6e\144\50\40\x27\56\x65\x64\x69\x74\x6f\x72\x27\x20\x29\x2e\x69\163\50\47\x3a\x76\x69\163\x69\x62\154\x65\47\x29\40\x29\40\x7b\12\x9\x9\x9\x9\11\x9\x76\x61\162\40\x6c\141\142\145\154\40\75\x20\x76\151\x65\167\x3b\xa\11\11\11\x9\11\x7d\12\xa\x9\x9\11\11\11\152\x51\x75\145\162\x79\x28\x20\x74\x68\x69\163\40\51\x2e\164\145\x78\164\x28\40\x6c\141\142\x65\x6c\40\51\56\x63\154\157\163\145\163\x74\50\x27\40\x2e\x74\145\155\x70\x6c\x61\164\145\47\40\x29\x2e\146\151\156\144\50\40\x27\56\x65\x64\151\x74\157\162\47\x20\51\x2e\163\x6c\151\x64\x65\124\x6f\x67\147\x6c\145\x28\x29\73\12\11\x9\x9\x9\11\x72\145\x74\165\162\156\x20\146\x61\154\x73\145\73\xa\11\x9\x9\x9\x7d\x20\51\73\12\12\x9\x9\x9\11\x6a\121\x75\145\162\171\50\40\x27\x61\56\x64\145\x6c\x65\x74\x65\137\164\145\155\x70\x6c\141\164\x65\x27\x20\51\x2e\x6f\x6e\x28\x20\x27\x63\x6c\x69\143\153\x27\54\x20\146\165\x6e\x63\x74\x69\157\156\x28\x29\40\x7b\xa\x9\x9\x9\11\11\x69\x66\x20\50\40\x77\151\156\x64\x6f\x77\x2e\x63\x6f\x6e\146\151\x72\x6d\x28\x27" . esc_js(__("\x41\162\x65\x20\x79\157\x75\40\x73\x75\162\x65\x20\x79\157\x75\40\x77\x61\156\x74\x20\164\157\x20\144\145\x6c\x65\x74\145\x20\164\150\x69\x73\40\x74\145\155\x70\154\141\164\x65\x20\x66\151\x6c\145\77", "\167\157\x6f\143\x6f\x6d\155\x65\162\143\x65")) . "\x27\x29\40\x29\40\x7b\12\x9\11\x9\x9\11\11\x72\145\x74\165\162\156\x20\x74\x72\165\x65\73\xa\11\x9\11\x9\11\175\xa\xa\x9\11\11\11\11\162\145\164\x75\162\156\x20\146\141\154\163\x65\73\xa\11\11\x9\x9\175\x29\73\12\12\x9\11\11\x9\x6a\x51\165\x65\162\x79\50\40\x27\x2e\x65\x64\151\164\x6f\x72\40\x74\x65\170\164\x61\x72\145\x61\x27\x20\51\x2e\x6f\156\50\x20\47\143\x68\141\x6e\147\x65\x27\54\x20\x66\x75\x6e\143\x74\x69\x6f\156\50\x29\x20\173\12\11\11\x9\11\11\166\x61\162\x20\x6e\x61\x6d\145\x20\75\40\x6a\x51\165\145\x72\171\50\40\164\150\151\x73\x20\51\x2e\141\x74\x74\x72\50\40\x27\144\141\164\141\55\156\x61\155\145\x27\40\x29\73\12\xa\11\x9\x9\11\11\151\x66\40\x28\x20\156\x61\x6d\x65\x20\x29\40\x7b\12\x9\x9\11\11\x9\11\152\x51\x75\145\x72\x79\x28\40\x74\150\x69\163\x20\51\x2e\141\164\x74\162\50\x20\47\x6e\141\155\x65\47\54\x20\x6e\141\155\145\x20\x29\73\xa\x9\11\11\11\11\x7d\xa\x9\x9\x9\11\x7d\51\x3b"); } } private function clear_alt_body_field() : void { global $phpmailer; if ($phpmailer instanceof PHPMailer\PHPMailer\PHPMailer) { $phpmailer->AltBody = ''; } } }
Function Calls
| None |
Stats
| MD5 | 66cd631581a958149410c2eccf7ab9e1 |
| Eval Count | 0 |
| Decode Time | 118 ms |