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\WooCommerce\Internal\DataStores\Orders\DataSynchronizer; use Automat..

Decoded Output download

<?php
 use Automattic\WooCommerce\Internal\DataStores\Orders\DataSynchronizer; use Automattic\WooCommerce\Utilities\StringUtil; goto l9CDT; g2n2P: function wc_get_order_id_by_order_key($order_key) { $data_store = WC_Data_Store::load("order"); return $data_store->get_order_id_by_order_key($order_key); } goto CvOol; seBLg: function wc_processing_order_count() { return wc_orders_count("processing"); } goto F17JG; KTfjS: add_action("woocommerce_trash_order", "wc_update_total_sales_counts"); goto rV6l7; TLjcT: add_action("woocommerce_order_status_processing_to_cancelled", "wc_update_total_sales_counts"); goto sW1cO; b72AQ: function wc_create_refund($args = array()) { $default_args = array("amount" => 0, "reason" => null, "order_id" => 0, "refund_id" => 0, "line_items" => array(), "refund_payment" => false, "restock_items" => false); try { $args = wp_parse_args($args, $default_args); $order = wc_get_order($args["order_id"]); if (!$order) { throw new Exception(__("Invalid order ID.", "woocommerce")); } $remaining_refund_amount = $order->get_remaining_refund_amount(); $remaining_refund_items = $order->get_remaining_refund_items(); $refund_item_count = 0; $refund = new WC_Order_Refund($args["refund_id"]); if (0 > $args["amount"] || $args["amount"] > $remaining_refund_amount) { throw new Exception(__("Invalid refund amount.", "woocommerce")); } $refund->set_currency($order->get_currency()); $refund->set_amount($args["amount"]); $refund->set_parent_id(absint($args["order_id"])); $refund->set_refunded_by(get_current_user_id() ? get_current_user_id() : 1); $refund->set_prices_include_tax($order->get_prices_include_tax()); if (!is_null($args["reason"])) { $refund->set_reason($args["reason"]); } if (is_array($args["line_items"]) && count($args["line_items"]) > 0) { $items = $order->get_items(array("line_item", "fee", "shipping")); foreach ($items as $item_id => $item) { if (!isset($args["line_items"][$item_id])) { continue; } $qty = isset($args["line_items"][$item_id]["qty"]) ? $args["line_items"][$item_id]["qty"] : 0; $refund_total = $args["line_items"][$item_id]["refund_total"]; $refund_tax = isset($args["line_items"][$item_id]["refund_tax"]) ? array_filter((array) $args["line_items"][$item_id]["refund_tax"]) : array(); if (empty($qty) && empty($refund_total) && empty($args["line_items"][$item_id]["refund_tax"])) { continue; } $class = get_class($item); $refunded_item = new $class($item); $refunded_item->set_id(0); $refunded_item->add_meta_data("_refunded_item_id", $item_id, true); $refunded_item->set_total(wc_format_refund_total($refund_total)); $refunded_item->set_taxes(array("total" => array_map("wc_format_refund_total", $refund_tax), "subtotal" => array_map("wc_format_refund_total", $refund_tax))); if (is_callable(array($refunded_item, "set_subtotal"))) { $refunded_item->set_subtotal(wc_format_refund_total($refund_total)); } if (is_callable(array($refunded_item, "set_quantity"))) { $refunded_item->set_quantity($qty * -1); } $refund->add_item($refunded_item); $refund_item_count += $qty; } } $refund->update_taxes(); $refund->calculate_totals(false); $refund->set_total($args["amount"] * -1); if (isset($args["date_created"])) { $refund->set_date_created($args["date_created"]); } do_action("woocommerce_create_refund", $refund, $args); if ($refund->save()) { if ($args["refund_payment"]) { $result = wc_refund_payment($order, $refund->get_amount(), $refund->get_reason()); if (is_wp_error($result)) { $refund->delete(); return $result; } $refund->set_refunded_payment(true); $refund->save(); } if ($args["restock_items"]) { wc_restock_refunded_items($order, $args["line_items"]); } if ((bool) apply_filters("woocommerce_order_is_partially_refunded", $remaining_refund_amount - $args["amount"] > 0 || $order->has_free_item() && $remaining_refund_items - $refund_item_count > 0, $order->get_id(), $refund->get_id())) { do_action("woocommerce_order_partially_refunded", $order->get_id(), $refund->get_id()); } else { do_action("woocommerce_order_fully_refunded", $order->get_id(), $refund->get_id()); $parent_status = apply_filters("woocommerce_order_fully_refunded_status", "refunded", $order->get_id(), $refund->get_id()); if ($parent_status) { $order->update_status($parent_status); } } } $order->set_date_modified(time()); $order->save(); do_action("woocommerce_refund_created", $refund->get_id(), $args); do_action("woocommerce_order_refunded", $order->get_id(), $refund->get_id()); } catch (Exception $e) { if (isset($refund) && is_a($refund, "WC_Order_Refund")) { $refund->delete(true); } return new WP_Error("error", $e->getMessage()); } return $refund; } goto aVBFt; aVBFt: function wc_refund_payment($order, $amount, $reason = '') { try { if (!is_a($order, "WC_Order")) { throw new Exception(__("Invalid order.", "woocommerce")); } $gateway_controller = WC_Payment_Gateways::instance(); $all_gateways = $gateway_controller->payment_gateways(); $payment_method = $order->get_payment_method(); $gateway = isset($all_gateways[$payment_method]) ? $all_gateways[$payment_method] : false; if (!$gateway) { throw new Exception(__("The payment gateway for this order does not exist.", "woocommerce")); } if (!$gateway->supports("refunds")) { throw new Exception(__("The payment gateway for this order does not support automatic refunds.", "woocommerce")); } $result = $gateway->process_refund($order->get_id(), $amount, $reason); if (!$result) { throw new Exception(__("An error occurred while attempting to create the refund using the payment gateway API.", "woocommerce")); } if (is_wp_error($result)) { throw new Exception($result->get_error_message()); } return true; } catch (Exception $e) { return new WP_Error("error", $e->getMessage()); } } goto WQxBk; G536D: function wc_get_order_statuses() { $order_statuses = array("wc-pending" => _x("Pending payment", "Order status", "woocommerce"), "wc-processing" => _x("Processing", "Order status", "woocommerce"), "wc-on-hold" => _x("On hold", "Order status", "woocommerce"), "wc-completed" => _x("Completed", "Order status", "woocommerce"), "wc-cancelled" => _x("Cancelled", "Order status", "woocommerce"), "wc-refunded" => _x("Refunded", "Order status", "woocommerce"), "wc-failed" => _x("Failed", "Order status", "woocommerce")); return apply_filters("wc_order_statuses", $order_statuses); } goto jn3qg; sW1cO: add_action("woocommerce_order_status_on-hold_to_cancelled", "wc_update_total_sales_counts"); goto KTfjS; YybMa: function wc_get_order_status_name($status) { $statuses = wc_get_order_statuses(); $status = "wc-" === substr($status, 0, 3) ? substr($status, 3) : $status; $status = isset($statuses["wc-" . $status]) ? $statuses["wc-" . $status] : $status; return $status; } goto qHCW0; WQxBk: function wc_restock_refunded_items($order, $refunded_line_items) { if (!apply_filters("woocommerce_can_restock_refunded_items", true, $order, $refunded_line_items)) { return; } $line_items = $order->get_items(); foreach ($line_items as $item_id => $item) { if (!isset($refunded_line_items[$item_id], $refunded_line_items[$item_id]["qty"])) { continue; } $product = $item->get_product(); $item_stock_reduced = $item->get_meta("_reduced_stock", true); $restock_refunded_items = (int) $item->get_meta("_restock_refunded_items", true); $qty_to_refund = $refunded_line_items[$item_id]["qty"]; if (!$item_stock_reduced || !$qty_to_refund || !$product || !$product->managing_stock()) { continue; } $old_stock = $product->get_stock_quantity(); $new_stock = wc_update_product_stock($product, $qty_to_refund, "increase"); $item_stock_reduced = $item_stock_reduced - $qty_to_refund; $item->update_meta_data("_reduced_stock", $item_stock_reduced); $item->update_meta_data("_restock_refunded_items", $qty_to_refund + $restock_refunded_items); $restock_note = sprintf(__("Item #%1$s stock increased from %2$s to %3$s.", "woocommerce"), $product->get_id(), $old_stock, $new_stock); $restock_note = apply_filters("woocommerce_refund_restock_note", $restock_note, $old_stock, $new_stock, $order, $product); $order->add_order_note($restock_note); $item->save(); do_action("woocommerce_restock_refunded_item", $product->get_id(), $old_stock, $new_stock, $order, $product); } } goto qQQN3; lijVB: function wc_get_orders($args) { $map_legacy = array("numberposts" => "limit", "post_type" => "type", "post_status" => "status", "post_parent" => "parent", "author" => "customer", "email" => "billing_email", "posts_per_page" => "limit", "paged" => "page"); foreach ($map_legacy as $from => $to) { if (isset($args[$from])) { $args[$to] = $args[$from]; } } $date_before = false; $date_after = false; if (!empty($args["date_before"])) { $datetime = wc_string_to_datetime($args["date_before"]); $date_before = strpos($args["date_before"], ":") ? $datetime->getOffsetTimestamp() : $datetime->date("Y-m-d"); } if (!empty($args["date_after"])) { $datetime = wc_string_to_datetime($args["date_after"]); $date_after = strpos($args["date_after"], ":") ? $datetime->getOffsetTimestamp() : $datetime->date("Y-m-d"); } if ($date_before && $date_after) { $args["date_created"] = $date_after . "..." . $date_before; } elseif ($date_before) { $args["date_created"] = "<" . $date_before; } elseif ($date_after) { $args["date_created"] = ">" . $date_after; } $query = new WC_Order_Query($args); return $query->get_orders(); } goto Po7gT; Asx1V: function wc_downloadable_file_permission($download_id, $product, $order, $qty = 1, $item = null) { if (is_numeric($product)) { $product = wc_get_product($product); } $download = new WC_Customer_Download(); $download->set_download_id($download_id); $download->set_product_id($product->get_id()); $download->set_user_id($order->get_customer_id()); $download->set_order_id($order->get_id()); $download->set_user_email($order->get_billing_email()); $download->set_order_key($order->get_order_key()); $download->set_downloads_remaining(0 > $product->get_download_limit() ? '' : $product->get_download_limit() * $qty); $download->set_access_granted(time()); $download->set_download_count(0); $expiry = $product->get_download_expiry(); if ($expiry > 0) { $from_date = $order->get_date_completed() ? $order->get_date_completed()->format("Y-m-d") : current_time("mysql", true); $download->set_access_expires(strtotime($from_date . " + " . $expiry . " DAY")); } $download = apply_filters("woocommerce_downloadable_file_permission", $download, $product, $order, $qty, $item); return $download->save(); } goto sY06Q; lSb56: function wc_get_payment_gateway_by_order($order) { if (WC()->payment_gateways()) { $payment_gateways = WC()->payment_gateways()->payment_gateways(); } else { $payment_gateways = array(); } if (!is_object($order)) { $order_id = absint($order); $order = wc_get_order($order_id); } return is_a($order, "WC_Order") && isset($payment_gateways[$order->get_payment_method()]) ? $payment_gateways[$order->get_payment_method()] : false; } goto Ns2Sq; F17JG: function wc_orders_count($status, string $type = '') { $count = 0; $legacy_statuses = array("draft", "trash"); $valid_statuses = array_merge(array_keys(wc_get_order_statuses()), $legacy_statuses); $status = !in_array($status, $legacy_statuses, true) && 0 !== strpos($status, "wc-") ? "wc-" . $status : $status; $valid_types = wc_get_order_types("order-count"); $type = trim($type); if (!in_array($status, $valid_statuses, true) || $type && !in_array($type, $valid_types, true)) { return 0; } $cache_key = WC_Cache_Helper::get_cache_prefix("orders") . $status . $type; $cached_count = wp_cache_get($cache_key, "counts"); if (false !== $cached_count) { return $cached_count; } $types_for_count = $type ? array($type) : $valid_types; foreach ($types_for_count as $type) { $data_store = WC_Data_Store::load("shop_order" === $type ? "order" : $type); if ($data_store) { $count += $data_store->get_order_count($status); } } wp_cache_set($cache_key, $count, "counts"); return $count; } goto Asx1V; mqhnG: add_action("woocommerce_order_status_completed", "wc_downloadable_product_permissions"); goto e6HRa; HcCNi: add_action("woocommerce_order_status_pending", "wc_update_coupon_usage_counts"); goto Oqw0n; l9CDT: defined("ABSPATH") || die; goto lijVB; s3jUB: function wc_sanitize_order_id($order_id) { return (int) filter_var($order_id, FILTER_SANITIZE_NUMBER_INT); } goto Sg3Is; wp9W1: function wc_get_is_pending_statuses() { return apply_filters("woocommerce_order_is_pending_statuses", array("pending")); } goto YybMa; JYfF1: function wc_delete_shop_order_transients($order = 0) { if (is_numeric($order)) { $order = wc_get_order($order); } $reports = WC_Admin_Reports::get_reports(); $transients_to_clear = array("wc_admin_report"); foreach ($reports as $report_group) { foreach ($report_group["reports"] as $report_key => $report) { $transients_to_clear[] = "wc_report_" . $report_key; } } foreach ($transients_to_clear as $transient) { delete_transient($transient); } if (is_a($order, "WC_Order")) { $order_id = $order->get_id(); delete_user_meta($order->get_customer_id(), "_money_spent"); delete_user_meta($order->get_customer_id(), "_order_count"); delete_user_meta($order->get_customer_id(), "_last_order"); } else { $order_id = 0; } WC_Cache_Helper::get_transient_version("orders", true); WC_Cache_Helper::invalidate_cache_group("orders"); do_action("woocommerce_delete_shop_order_transients", $order_id); } goto MTADP; zNV1W: add_action("woocommerce_order_status_on-hold", "wc_update_coupon_usage_counts"); goto gcUT_; uxzSD: function wc_get_order_notes($args) { $key_mapping = array("limit" => "number", "order_id" => "post_id", "order__in" => "post__in", "order__not_in" => "post__not_in"); foreach ($key_mapping as $query_key => $db_key) { if (isset($args[$query_key])) { $args[$db_key] = $args[$query_key]; unset($args[$query_key]); } } $orderby_mapping = array("date_created" => "comment_date", "date_created_gmt" => "comment_date_gmt", "id" => "comment_ID"); $args["orderby"] = !empty($args["orderby"]) && in_array($args["orderby"], array("date_created", "date_created_gmt", "id"), true) ? $orderby_mapping[$args["orderby"]] : "comment_ID"; if (isset($args["type"]) && "customer" === $args["type"]) { $args["meta_query"] = array(array("key" => "is_customer_note", "value" => 1, "compare" => "=")); } elseif (isset($args["type"]) && "internal" === $args["type"]) { $args["meta_query"] = array(array("key" => "is_customer_note", "compare" => "NOT EXISTS")); } $args["type"] = "order_note"; $args["status"] = "approve"; unset($args["count"], $args["fields"]); remove_filter("comments_clauses", array("WC_Comments", "exclude_order_comments"), 10, 1); $notes = get_comments($args); add_filter("comments_clauses", array("WC_Comments", "exclude_order_comments"), 10, 1); return array_filter(array_map("wc_get_order_note", $notes)); } goto n9PYg; ifjlf: function wc_update_total_sales_counts($order_id) { $order = wc_get_order($order_id); if (!$order) { return; } $recorded_sales = $order->get_data_store()->get_recorded_sales($order); $reflected_order = in_array($order->get_status(), array("cancelled", "trash"), true); if (!$reflected_order && "woocommerce_before_delete_order" === current_action()) { $reflected_order = true; } if ($recorded_sales xor $reflected_order) { return; } $operation = $recorded_sales && $reflected_order ? "decrease" : "increase"; if (count($order->get_items()) > 0) { foreach ($order->get_items() as $item) { $product_id = $item->get_product_id(); if ($product_id) { $data_store = WC_Data_Store::load("product"); $data_store->update_product_sales($product_id, absint($item->get_quantity()), $operation); } } } if ("decrease" === $operation) { $order->get_data_store()->set_recorded_sales($order, false); } else { $order->get_data_store()->set_recorded_sales($order, true); } do_action("woocommerce_recorded_sales", $order_id); } goto u3GzZ; qQQN3: function wc_get_tax_class_by_tax_id($tax_id) { global $wpdb; return $wpdb->get_var($wpdb->prepare("SELECT tax_rate_class FROM {$wpdb->prefix}woocommerce_tax_rates WHERE tax_rate_id = %d", $tax_id)); } goto lSb56; s4c1N: add_action("woocommerce_cancel_unpaid_orders", "wc_cancel_unpaid_orders"); goto s3jUB; LLqk8: add_action("woocommerce_order_status_completed_to_cancelled", "wc_update_total_sales_counts"); goto TLjcT; w0Gui: function wc_register_order_type($type, $args = array()) { if (post_type_exists($type)) { return false; } global $wc_order_types; if (!is_array($wc_order_types)) { $wc_order_types = array(); } if (is_wp_error(register_post_type($type, $args))) { return false; } $order_type_args = array("exclude_from_orders_screen" => false, "add_order_meta_boxes" => true, "exclude_from_order_count" => false, "exclude_from_order_views" => false, "exclude_from_order_webhooks" => false, "exclude_from_order_reports" => false, "exclude_from_order_sales_reports" => false, "class_name" => "WC_Order"); $args = array_intersect_key($args, $order_type_args); $args = wp_parse_args($args, $order_type_args); $wc_order_types[$type] = $args; return true; } goto seBLg; ho2lM: add_action("woocommerce_before_delete_order", "wc_update_total_sales_counts"); goto YXUjE; Dyx6z: function wc_get_is_paid_statuses() { return apply_filters("woocommerce_order_is_paid_statuses", array("processing", "completed")); } goto wp9W1; Sg3Is: add_filter("woocommerce_shortcode_order_tracking_order_id", "wc_sanitize_order_id"); goto chgir; rjwt1: function wc_cancel_unpaid_orders() { $held_duration = get_option("woocommerce_hold_stock_minutes"); wp_clear_scheduled_hook("woocommerce_cancel_unpaid_orders"); $cancel_unpaid_interval = apply_filters("woocommerce_cancel_unpaid_orders_interval_minutes", absint($held_duration)); wp_schedule_single_event(time() + absint($cancel_unpaid_interval) * 60, "woocommerce_cancel_unpaid_orders"); if ($held_duration < 1 || "yes" !== get_option("woocommerce_manage_stock")) { return; } $data_store = WC_Data_Store::load("order"); $unpaid_orders = $data_store->get_unpaid_orders(strtotime("-" . absint($held_duration) . " MINUTES", current_time("timestamp"))); if ($unpaid_orders) { foreach ($unpaid_orders as $unpaid_order) { $order = wc_get_order($unpaid_order); if (apply_filters("woocommerce_cancel_unpaid_order", "checkout" === $order->get_created_via(), $order)) { $order->update_status("cancelled", __("Unpaid order cancelled - time limit reached.", "woocommerce")); } } } } goto s4c1N; eYVLO: add_action("woocommerce_order_status_processing", "wc_update_total_sales_counts"); goto r39gD; r39gD: add_action("woocommerce_order_status_on-hold", "wc_update_total_sales_counts"); goto LLqk8; Po7gT: function wc_get_order($the_order = false) { if (!did_action("woocommerce_after_register_post_type")) { wc_doing_it_wrong(__FUNCTION__, "wc_get_order should not be called before post types are registered (woocommerce_after_register_post_type action)", "2.5"); return false; } return WC()->order_factory->get_order($the_order); } goto G536D; TssdE: add_action("woocommerce_order_status_refunded", "wc_order_fully_refunded"); goto Au6YC; n9PYg: function wc_create_order_note($order_id, $note, $is_customer_note = false, $added_by_user = false) { $order = wc_get_order($order_id); if (!$order) { return new WP_Error("invalid_order_id", __("Invalid order ID.", "woocommerce"), array("status" => 400)); } return $order->add_order_note($note, (int) $is_customer_note, $added_by_user); } goto mpnZj; MTADP: function wc_ship_to_billing_address_only() { return "billing_only" === get_option("woocommerce_ship_to_destination"); } goto b72AQ; CvOol: function wc_get_order_types($for = '') { global $wc_order_types; if (!is_array($wc_order_types)) { $wc_order_types = array(); } $order_types = array(); switch ($for) { case "order-count": foreach ($wc_order_types as $type => $args) { if (!$args["exclude_from_order_count"]) { $order_types[] = $type; } } break; case "order-meta-boxes": foreach ($wc_order_types as $type => $args) { if ($args["add_order_meta_boxes"]) { $order_types[] = $type; } } break; case "view-orders": foreach ($wc_order_types as $type => $args) { if (!$args["exclude_from_order_views"]) { $order_types[] = $type; } } break; case "reports": foreach ($wc_order_types as $type => $args) { if (!$args["exclude_from_order_reports"]) { $order_types[] = $type; } } break; case "sales-reports": foreach ($wc_order_types as $type => $args) { if (!$args["exclude_from_order_sales_reports"]) { $order_types[] = $type; } } break; case "order-webhooks": foreach ($wc_order_types as $type => $args) { if (!$args["exclude_from_order_webhooks"]) { $order_types[] = $type; } } break; case "cot-migration": foreach ($wc_order_types as $type => $args) { if (DataSynchronizer::PLACEHOLDER_ORDER_POST_TYPE !== $type) { $order_types[] = $type; } } break; case "admin-menu": $order_types = array_intersect(array_keys($wc_order_types), get_post_types(array("show_ui" => true, "show_in_menu" => "woocommerce"))); break; default: $order_types = array_keys($wc_order_types); break; } return apply_filters("wc_order_types", $order_types, $for); } goto koOyS; qHCW0: function wc_generate_order_key($key = '') { if ('' === $key) { $key = wp_generate_password(13, false); } return "wc_" . apply_filters("woocommerce_generate_order_key", "order_" . $key); } goto g2n2P; Ns2Sq: function wc_order_fully_refunded($order_id) { $order = wc_get_order($order_id); $max_refund = wc_format_decimal($order->get_total() - $order->get_total_refunded()); if (!$max_refund) { return; } wc_switch_to_site_locale(); wc_create_refund(array("amount" => $max_refund, "reason" => __("Order fully refunded.", "woocommerce"), "order_id" => $order_id, "line_items" => array())); wc_restore_locale(); $order->add_order_note(__("Order status set to refunded. To return funds to the customer you will need to issue a refund through your payment gateway.", "woocommerce")); } goto TssdE; u3GzZ: add_action("woocommerce_order_status_completed", "wc_update_total_sales_counts"); goto eYVLO; e6HRa: add_action("woocommerce_order_status_processing", "wc_downloadable_product_permissions"); goto JYfF1; sY06Q: function wc_downloadable_product_permissions($order_id, $force = false) { $order = wc_get_order($order_id); if (!$order || $order->get_data_store()->get_download_permissions_granted($order) && !$force) { return; } if ($order->has_status("processing") && "no" === get_option("woocommerce_downloads_grant_access_after_payment")) { return; } if (count($order->get_items()) > 0) { foreach ($order->get_items() as $item) { $product = $item->get_product(); if ($product && $product->exists() && $product->is_downloadable()) { $downloads = $product->get_downloads(); foreach (array_keys($downloads) as $download_id) { wc_downloadable_file_permission($download_id, $product, $order, $item->get_quantity(), $item); } } } } $order->get_data_store()->set_download_permissions_granted($order, true); do_action("woocommerce_grant_product_download_permissions", $order_id); } goto mqhnG; jn3qg: function wc_is_order_status($maybe_status) { $order_statuses = wc_get_order_statuses(); return isset($order_statuses[$maybe_status]); } goto Dyx6z; YXUjE: function wc_update_coupon_usage_counts($order_id) { $order = wc_get_order($order_id); if (!$order) { return; } $has_recorded = $order->get_data_store()->get_recorded_coupon_usage_counts($order); if ($order->has_status("cancelled") && $has_recorded) { $action = "reduce"; $order->get_data_store()->set_recorded_coupon_usage_counts($order, false); } elseif (!$order->has_status("cancelled") && !$has_recorded) { $action = "increase"; $order->get_data_store()->set_recorded_coupon_usage_counts($order, true); } elseif ($order->has_status("cancelled")) { $order->get_data_store()->release_held_coupons($order, true); return; } else { return; } if (count($order->get_coupon_codes()) > 0) { foreach ($order->get_coupon_codes() as $code) { if (StringUtil::is_null_or_whitespace($code)) { continue; } $coupon = new WC_Coupon($code); $used_by = $order->get_user_id(); if (!$used_by) { $used_by = $order->get_billing_email(); } switch ($action) { case "reduce": $coupon->decrease_usage_count($used_by); break; case "increase": $coupon->increase_usage_count($used_by, $order); break; } } $order->get_data_store()->release_held_coupons($order, true); } } goto HcCNi; gcUT_: add_action("woocommerce_order_status_cancelled", "wc_update_coupon_usage_counts"); goto rjwt1; Oqw0n: add_action("woocommerce_order_status_completed", "wc_update_coupon_usage_counts"); goto BUJXU; BUJXU: add_action("woocommerce_order_status_processing", "wc_update_coupon_usage_counts"); goto zNV1W; Au6YC: function wc_order_search($term) { $data_store = WC_Data_Store::load("order"); return $data_store->search_orders(str_replace("Order #", '', wc_clean($term))); } goto ifjlf; koOyS: function wc_get_order_type($type) { global $wc_order_types; if (isset($wc_order_types[$type])) { return $wc_order_types[$type]; } return false; } goto w0Gui; chgir: function wc_get_order_note($data) { if (is_numeric($data)) { $data = get_comment($data); } if (!is_a($data, "WP_Comment")) { return null; } return (object) apply_filters("woocommerce_get_order_note", array("id" => (int) $data->comment_ID, "date_created" => wc_string_to_datetime($data->comment_date), "content" => $data->comment_content, "customer_note" => (bool) get_comment_meta($data->comment_ID, "is_customer_note", true), "added_by" => __("WooCommerce", "woocommerce") === $data->comment_author ? "system" : $data->comment_author), $data); } goto uxzSD; rV6l7: add_action("woocommerce_untrash_order", "wc_update_total_sales_counts"); goto ho2lM; mpnZj: function wc_delete_order_note($note_id) { return wp_delete_comment($note_id, true); } ?>

Did this file decode correctly?

Original Code

<?php
 use Automattic\WooCommerce\Internal\DataStores\Orders\DataSynchronizer; use Automattic\WooCommerce\Utilities\StringUtil; goto l9CDT; g2n2P: function wc_get_order_id_by_order_key($order_key) { $data_store = WC_Data_Store::load("\x6f\x72\144\145\x72"); return $data_store->get_order_id_by_order_key($order_key); } goto CvOol; seBLg: function wc_processing_order_count() { return wc_orders_count("\160\x72\157\x63\x65\x73\163\151\156\x67"); } goto F17JG; KTfjS: add_action("\167\x6f\157\x63\x6f\x6d\155\x65\162\x63\x65\137\164\x72\141\x73\x68\x5f\157\162\x64\145\x72", "\167\143\137\165\160\x64\x61\164\145\137\164\x6f\164\141\x6c\x5f\163\141\x6c\145\x73\x5f\143\157\165\156\x74\x73"); goto rV6l7; TLjcT: add_action("\x77\157\x6f\143\x6f\155\x6d\145\x72\x63\x65\x5f\x6f\162\x64\145\x72\137\163\164\x61\164\165\x73\x5f\x70\162\157\x63\x65\x73\x73\x69\x6e\x67\x5f\164\x6f\x5f\143\x61\x6e\143\145\x6c\154\x65\144", "\167\143\x5f\165\x70\144\141\x74\145\x5f\x74\157\164\x61\154\x5f\x73\141\154\145\163\137\x63\157\x75\156\164\163"); goto sW1cO; b72AQ: function wc_create_refund($args = array()) { $default_args = array("\x61\x6d\157\x75\x6e\164" => 0, "\162\145\x61\163\157\156" => null, "\157\x72\144\x65\162\x5f\151\144" => 0, "\x72\x65\x66\165\156\x64\137\151\144" => 0, "\x6c\151\156\145\x5f\151\164\145\x6d\x73" => array(), "\x72\145\146\165\x6e\x64\137\160\141\x79\x6d\145\x6e\164" => false, "\x72\145\163\x74\x6f\143\x6b\137\151\164\x65\155\163" => false); try { $args = wp_parse_args($args, $default_args); $order = wc_get_order($args["\157\162\144\145\x72\x5f\151\x64"]); if (!$order) { throw new Exception(__("\x49\x6e\166\x61\154\x69\x64\40\157\162\144\x65\x72\40\111\x44\56", "\x77\x6f\x6f\x63\x6f\155\155\145\162\x63\x65")); } $remaining_refund_amount = $order->get_remaining_refund_amount(); $remaining_refund_items = $order->get_remaining_refund_items(); $refund_item_count = 0; $refund = new WC_Order_Refund($args["\x72\145\x66\x75\156\144\137\151\x64"]); if (0 > $args["\141\x6d\x6f\165\156\x74"] || $args["\x61\155\x6f\165\x6e\x74"] > $remaining_refund_amount) { throw new Exception(__("\111\x6e\x76\141\154\151\144\40\x72\x65\x66\x75\x6e\144\40\141\155\157\165\x6e\164\56", "\x77\x6f\157\x63\x6f\155\155\x65\x72\x63\145")); } $refund->set_currency($order->get_currency()); $refund->set_amount($args["\141\x6d\157\x75\156\x74"]); $refund->set_parent_id(absint($args["\157\162\144\x65\x72\x5f\151\x64"])); $refund->set_refunded_by(get_current_user_id() ? get_current_user_id() : 1); $refund->set_prices_include_tax($order->get_prices_include_tax()); if (!is_null($args["\162\x65\x61\x73\x6f\x6e"])) { $refund->set_reason($args["\x72\x65\141\163\157\x6e"]); } if (is_array($args["\154\151\156\145\137\151\x74\x65\x6d\x73"]) && count($args["\x6c\x69\156\x65\137\151\x74\x65\155\x73"]) > 0) { $items = $order->get_items(array("\x6c\151\x6e\x65\137\x69\x74\145\155", "\x66\145\145", "\163\x68\x69\x70\x70\x69\156\147")); foreach ($items as $item_id => $item) { if (!isset($args["\154\151\156\145\137\x69\x74\145\155\x73"][$item_id])) { continue; } $qty = isset($args["\x6c\151\x6e\x65\x5f\x69\164\x65\155\163"][$item_id]["\161\164\171"]) ? $args["\154\151\x6e\x65\137\x69\164\145\x6d\x73"][$item_id]["\161\x74\x79"] : 0; $refund_total = $args["\x6c\151\x6e\x65\137\x69\x74\x65\x6d\163"][$item_id]["\x72\x65\146\165\x6e\x64\137\164\157\x74\141\x6c"]; $refund_tax = isset($args["\154\151\x6e\x65\137\x69\164\x65\155\163"][$item_id]["\x72\x65\x66\x75\x6e\x64\x5f\164\141\x78"]) ? array_filter((array) $args["\154\151\x6e\x65\x5f\151\164\145\155\163"][$item_id]["\x72\x65\146\x75\x6e\x64\x5f\164\x61\170"]) : array(); if (empty($qty) && empty($refund_total) && empty($args["\154\151\156\145\137\x69\x74\145\155\163"][$item_id]["\162\145\x66\165\156\x64\x5f\x74\x61\170"])) { continue; } $class = get_class($item); $refunded_item = new $class($item); $refunded_item->set_id(0); $refunded_item->add_meta_data("\137\x72\145\x66\165\x6e\144\145\144\137\151\x74\x65\x6d\x5f\x69\x64", $item_id, true); $refunded_item->set_total(wc_format_refund_total($refund_total)); $refunded_item->set_taxes(array("\x74\157\x74\141\x6c" => array_map("\167\x63\x5f\146\x6f\162\x6d\x61\164\x5f\x72\x65\146\x75\156\x64\x5f\x74\157\x74\141\x6c", $refund_tax), "\x73\165\142\x74\157\x74\x61\x6c" => array_map("\x77\143\x5f\x66\x6f\162\155\141\x74\x5f\x72\x65\x66\165\156\144\x5f\x74\157\x74\x61\x6c", $refund_tax))); if (is_callable(array($refunded_item, "\x73\145\164\137\163\x75\x62\x74\x6f\164\x61\x6c"))) { $refunded_item->set_subtotal(wc_format_refund_total($refund_total)); } if (is_callable(array($refunded_item, "\163\145\164\137\161\x75\141\x6e\x74\151\164\x79"))) { $refunded_item->set_quantity($qty * -1); } $refund->add_item($refunded_item); $refund_item_count += $qty; } } $refund->update_taxes(); $refund->calculate_totals(false); $refund->set_total($args["\141\155\x6f\x75\x6e\x74"] * -1); if (isset($args["\144\x61\x74\x65\137\143\x72\145\x61\164\x65\x64"])) { $refund->set_date_created($args["\x64\141\x74\145\x5f\143\162\x65\x61\x74\x65\144"]); } do_action("\167\x6f\157\143\x6f\x6d\155\x65\162\143\145\x5f\x63\x72\x65\x61\164\x65\137\x72\x65\x66\x75\x6e\x64", $refund, $args); if ($refund->save()) { if ($args["\x72\x65\x66\x75\x6e\x64\x5f\160\x61\x79\x6d\x65\156\x74"]) { $result = wc_refund_payment($order, $refund->get_amount(), $refund->get_reason()); if (is_wp_error($result)) { $refund->delete(); return $result; } $refund->set_refunded_payment(true); $refund->save(); } if ($args["\162\x65\x73\x74\157\143\x6b\x5f\151\x74\145\x6d\x73"]) { wc_restock_refunded_items($order, $args["\x6c\151\x6e\x65\x5f\x69\x74\x65\x6d\163"]); } if ((bool) apply_filters("\167\157\157\x63\157\155\155\x65\x72\143\145\x5f\157\162\x64\x65\x72\x5f\x69\x73\137\x70\141\162\x74\151\141\154\154\171\x5f\x72\145\146\165\156\x64\145\144", $remaining_refund_amount - $args["\141\x6d\x6f\x75\156\x74"] > 0 || $order->has_free_item() && $remaining_refund_items - $refund_item_count > 0, $order->get_id(), $refund->get_id())) { do_action("\x77\x6f\157\143\157\x6d\155\145\162\x63\145\x5f\157\x72\144\145\162\x5f\x70\141\162\x74\x69\141\154\x6c\171\137\162\145\146\x75\156\x64\x65\144", $order->get_id(), $refund->get_id()); } else { do_action("\167\x6f\157\143\x6f\x6d\x6d\x65\162\143\145\x5f\x6f\162\x64\145\162\137\x66\165\154\x6c\171\x5f\162\145\x66\165\x6e\144\x65\x64", $order->get_id(), $refund->get_id()); $parent_status = apply_filters("\167\x6f\x6f\x63\157\x6d\x6d\145\162\x63\x65\137\x6f\162\x64\145\x72\x5f\146\165\x6c\x6c\171\x5f\x72\145\x66\x75\156\x64\145\x64\137\x73\x74\x61\x74\x75\x73", "\162\x65\x66\165\156\144\145\x64", $order->get_id(), $refund->get_id()); if ($parent_status) { $order->update_status($parent_status); } } } $order->set_date_modified(time()); $order->save(); do_action("\x77\x6f\157\x63\x6f\x6d\155\145\162\x63\x65\x5f\x72\x65\146\x75\156\x64\x5f\x63\162\x65\x61\164\145\144", $refund->get_id(), $args); do_action("\x77\157\157\x63\x6f\x6d\155\145\x72\143\145\137\157\x72\x64\x65\x72\137\x72\x65\x66\165\x6e\x64\x65\x64", $order->get_id(), $refund->get_id()); } catch (Exception $e) { if (isset($refund) && is_a($refund, "\127\103\137\x4f\x72\144\145\162\137\x52\x65\146\165\156\x64")) { $refund->delete(true); } return new WP_Error("\x65\x72\x72\x6f\x72", $e->getMessage()); } return $refund; } goto aVBFt; aVBFt: function wc_refund_payment($order, $amount, $reason = '') { try { if (!is_a($order, "\x57\x43\x5f\x4f\x72\x64\x65\x72")) { throw new Exception(__("\x49\x6e\x76\141\154\151\144\x20\157\x72\x64\x65\162\x2e", "\167\157\x6f\x63\x6f\x6d\x6d\x65\x72\x63\145")); } $gateway_controller = WC_Payment_Gateways::instance(); $all_gateways = $gateway_controller->payment_gateways(); $payment_method = $order->get_payment_method(); $gateway = isset($all_gateways[$payment_method]) ? $all_gateways[$payment_method] : false; if (!$gateway) { throw new Exception(__("\x54\x68\x65\x20\x70\141\171\155\145\x6e\164\x20\x67\x61\164\x65\167\x61\171\x20\x66\x6f\162\40\164\150\x69\163\x20\157\162\144\x65\162\40\x64\x6f\x65\163\x20\x6e\157\164\40\145\170\x69\x73\164\x2e", "\x77\157\x6f\143\x6f\155\155\x65\x72\143\145")); } if (!$gateway->supports("\162\x65\146\x75\x6e\x64\x73")) { throw new Exception(__("\x54\x68\145\40\160\141\x79\x6d\x65\x6e\164\40\147\141\164\x65\x77\141\171\x20\x66\157\x72\40\164\x68\151\163\40\157\x72\144\145\162\40\x64\157\x65\x73\40\x6e\157\164\x20\163\x75\x70\160\157\162\164\x20\x61\165\164\x6f\x6d\x61\x74\151\x63\40\x72\x65\x66\165\156\x64\x73\56", "\x77\x6f\x6f\143\157\x6d\155\145\x72\143\x65")); } $result = $gateway->process_refund($order->get_id(), $amount, $reason); if (!$result) { throw new Exception(__("\x41\x6e\40\x65\162\162\x6f\162\40\x6f\x63\143\x75\162\162\145\x64\x20\167\x68\x69\x6c\145\40\141\x74\x74\x65\155\x70\164\151\156\147\40\x74\157\x20\x63\x72\145\x61\164\145\x20\x74\150\x65\40\162\145\x66\165\156\x64\x20\x75\163\151\156\147\x20\164\150\x65\x20\x70\141\171\155\x65\156\x74\40\x67\x61\164\x65\167\x61\x79\40\x41\x50\x49\56", "\x77\x6f\x6f\x63\x6f\155\x6d\145\x72\143\145")); } if (is_wp_error($result)) { throw new Exception($result->get_error_message()); } return true; } catch (Exception $e) { return new WP_Error("\145\162\162\157\162", $e->getMessage()); } } goto WQxBk; G536D: function wc_get_order_statuses() { $order_statuses = array("\167\143\x2d\x70\145\x6e\144\x69\156\x67" => _x("\120\145\x6e\144\x69\156\x67\40\x70\x61\171\155\145\156\x74", "\117\x72\144\145\162\40\x73\164\x61\164\x75\163", "\x77\157\157\143\157\155\x6d\x65\162\x63\x65"), "\x77\x63\55\160\x72\157\x63\145\x73\163\x69\156\147" => _x("\x50\162\157\x63\x65\163\x73\151\156\147", "\x4f\162\x64\x65\162\40\163\164\x61\x74\165\x73", "\x77\157\157\143\157\155\155\145\162\143\145"), "\167\143\x2d\157\156\x2d\x68\157\154\x64" => _x("\117\x6e\40\x68\x6f\x6c\x64", "\117\162\144\x65\162\40\163\164\141\x74\x75\x73", "\x77\157\x6f\x63\157\155\155\x65\x72\143\145"), "\x77\143\55\143\x6f\155\160\154\x65\x74\145\144" => _x("\x43\x6f\155\x70\154\x65\164\x65\144", "\117\162\x64\145\162\40\x73\x74\141\x74\165\163", "\x77\x6f\157\143\157\x6d\x6d\145\x72\143\x65"), "\x77\x63\x2d\x63\141\156\143\x65\154\x6c\x65\144" => _x("\103\x61\156\x63\145\154\154\x65\144", "\117\162\x64\145\x72\40\x73\x74\x61\x74\165\x73", "\167\x6f\157\x63\x6f\155\x6d\x65\162\x63\145"), "\x77\x63\55\162\145\146\165\x6e\x64\145\x64" => _x("\x52\145\146\x75\156\x64\x65\x64", "\x4f\162\x64\145\162\x20\163\x74\x61\x74\x75\163", "\x77\157\157\x63\x6f\x6d\155\x65\x72\x63\x65"), "\167\x63\55\x66\x61\151\154\x65\x64" => _x("\106\141\151\154\145\144", "\117\162\144\x65\x72\x20\x73\x74\x61\164\x75\x73", "\x77\157\x6f\x63\157\155\155\145\x72\x63\145")); return apply_filters("\x77\143\137\x6f\162\x64\145\x72\x5f\163\x74\x61\x74\165\x73\x65\163", $order_statuses); } goto jn3qg; sW1cO: add_action("\x77\x6f\x6f\x63\157\x6d\x6d\145\x72\x63\145\x5f\157\162\x64\x65\162\x5f\x73\164\x61\164\165\163\137\157\x6e\55\x68\157\x6c\144\137\x74\x6f\x5f\143\141\156\x63\x65\154\x6c\x65\x64", "\167\143\137\x75\x70\x64\x61\164\x65\x5f\x74\157\164\141\154\137\x73\141\x6c\145\x73\x5f\143\157\165\156\164\x73"); goto KTfjS; YybMa: function wc_get_order_status_name($status) { $statuses = wc_get_order_statuses(); $status = "\167\143\x2d" === substr($status, 0, 3) ? substr($status, 3) : $status; $status = isset($statuses["\x77\x63\x2d" . $status]) ? $statuses["\x77\143\x2d" . $status] : $status; return $status; } goto qHCW0; WQxBk: function wc_restock_refunded_items($order, $refunded_line_items) { if (!apply_filters("\x77\157\157\143\157\155\x6d\145\x72\x63\x65\x5f\143\141\156\137\x72\145\163\164\x6f\143\153\137\x72\145\146\x75\x6e\144\145\144\137\151\x74\145\155\x73", true, $order, $refunded_line_items)) { return; } $line_items = $order->get_items(); foreach ($line_items as $item_id => $item) { if (!isset($refunded_line_items[$item_id], $refunded_line_items[$item_id]["\161\x74\171"])) { continue; } $product = $item->get_product(); $item_stock_reduced = $item->get_meta("\x5f\162\145\x64\165\143\x65\x64\137\x73\x74\157\x63\153", true); $restock_refunded_items = (int) $item->get_meta("\137\162\145\163\x74\157\143\153\x5f\x72\x65\146\165\x6e\144\145\x64\x5f\x69\x74\x65\x6d\163", true); $qty_to_refund = $refunded_line_items[$item_id]["\x71\164\x79"]; if (!$item_stock_reduced || !$qty_to_refund || !$product || !$product->managing_stock()) { continue; } $old_stock = $product->get_stock_quantity(); $new_stock = wc_update_product_stock($product, $qty_to_refund, "\151\156\x63\x72\x65\141\163\x65"); $item_stock_reduced = $item_stock_reduced - $qty_to_refund; $item->update_meta_data("\137\x72\145\x64\165\x63\145\144\x5f\x73\x74\157\x63\x6b", $item_stock_reduced); $item->update_meta_data("\137\162\x65\163\164\157\143\153\137\162\x65\x66\165\x6e\144\x65\x64\137\x69\x74\x65\155\x73", $qty_to_refund + $restock_refunded_items); $restock_note = sprintf(__("\111\x74\145\155\x20\x23\45\61\x24\x73\x20\x73\164\x6f\x63\153\40\151\156\x63\162\145\x61\x73\145\144\x20\146\162\x6f\155\40\45\62\x24\163\40\x74\157\x20\x25\63\44\163\x2e", "\x77\157\x6f\143\157\x6d\x6d\x65\x72\143\145"), $product->get_id(), $old_stock, $new_stock); $restock_note = apply_filters("\x77\157\157\143\x6f\155\155\145\x72\x63\x65\137\162\145\x66\165\x6e\144\137\162\145\163\x74\157\143\153\137\x6e\x6f\164\145", $restock_note, $old_stock, $new_stock, $order, $product); $order->add_order_note($restock_note); $item->save(); do_action("\x77\157\157\x63\157\155\x6d\145\x72\143\145\137\x72\x65\163\x74\157\143\153\x5f\x72\x65\x66\x75\156\144\145\x64\137\x69\x74\x65\155", $product->get_id(), $old_stock, $new_stock, $order, $product); } } goto qQQN3; lijVB: function wc_get_orders($args) { $map_legacy = array("\x6e\165\x6d\x62\145\162\160\157\x73\x74\163" => "\154\151\x6d\x69\x74", "\160\x6f\163\164\x5f\x74\171\x70\145" => "\x74\171\160\x65", "\160\x6f\x73\x74\x5f\x73\164\x61\164\165\163" => "\163\x74\141\x74\165\163", "\x70\x6f\163\164\x5f\160\141\162\145\156\164" => "\x70\x61\162\x65\x6e\164", "\x61\165\x74\x68\157\x72" => "\x63\165\x73\164\157\155\x65\x72", "\x65\x6d\x61\151\x6c" => "\x62\x69\x6c\x6c\x69\x6e\147\137\x65\155\x61\x69\x6c", "\160\157\x73\x74\x73\x5f\160\x65\x72\137\160\141\147\x65" => "\x6c\151\x6d\x69\x74", "\160\x61\147\145\144" => "\x70\141\147\145"); foreach ($map_legacy as $from => $to) { if (isset($args[$from])) { $args[$to] = $args[$from]; } } $date_before = false; $date_after = false; if (!empty($args["\144\141\x74\145\x5f\x62\145\146\157\x72\145"])) { $datetime = wc_string_to_datetime($args["\x64\141\164\x65\137\142\x65\x66\157\x72\x65"]); $date_before = strpos($args["\144\x61\x74\145\x5f\142\145\x66\x6f\x72\x65"], "\72") ? $datetime->getOffsetTimestamp() : $datetime->date("\x59\x2d\x6d\x2d\144"); } if (!empty($args["\144\141\x74\145\x5f\x61\x66\x74\x65\162"])) { $datetime = wc_string_to_datetime($args["\x64\141\x74\145\137\x61\x66\164\x65\x72"]); $date_after = strpos($args["\x64\x61\164\x65\x5f\x61\146\164\145\x72"], "\x3a") ? $datetime->getOffsetTimestamp() : $datetime->date("\131\x2d\155\55\x64"); } if ($date_before && $date_after) { $args["\144\x61\x74\x65\137\x63\162\145\141\x74\145\144"] = $date_after . "\x2e\x2e\56" . $date_before; } elseif ($date_before) { $args["\x64\x61\164\145\137\x63\162\145\x61\164\x65\x64"] = "\x3c" . $date_before; } elseif ($date_after) { $args["\x64\141\164\145\137\143\x72\x65\x61\164\145\x64"] = "\x3e" . $date_after; } $query = new WC_Order_Query($args); return $query->get_orders(); } goto Po7gT; Asx1V: function wc_downloadable_file_permission($download_id, $product, $order, $qty = 1, $item = null) { if (is_numeric($product)) { $product = wc_get_product($product); } $download = new WC_Customer_Download(); $download->set_download_id($download_id); $download->set_product_id($product->get_id()); $download->set_user_id($order->get_customer_id()); $download->set_order_id($order->get_id()); $download->set_user_email($order->get_billing_email()); $download->set_order_key($order->get_order_key()); $download->set_downloads_remaining(0 > $product->get_download_limit() ? '' : $product->get_download_limit() * $qty); $download->set_access_granted(time()); $download->set_download_count(0); $expiry = $product->get_download_expiry(); if ($expiry > 0) { $from_date = $order->get_date_completed() ? $order->get_date_completed()->format("\x59\x2d\155\55\144") : current_time("\x6d\171\x73\161\x6c", true); $download->set_access_expires(strtotime($from_date . "\x20\x2b\40" . $expiry . "\x20\104\101\x59")); } $download = apply_filters("\167\x6f\157\x63\x6f\155\x6d\x65\x72\143\x65\x5f\144\157\167\156\x6c\x6f\141\x64\x61\142\154\145\137\146\x69\154\145\x5f\x70\x65\162\155\151\x73\x73\151\157\x6e", $download, $product, $order, $qty, $item); return $download->save(); } goto sY06Q; lSb56: function wc_get_payment_gateway_by_order($order) { if (WC()->payment_gateways()) { $payment_gateways = WC()->payment_gateways()->payment_gateways(); } else { $payment_gateways = array(); } if (!is_object($order)) { $order_id = absint($order); $order = wc_get_order($order_id); } return is_a($order, "\x57\103\x5f\x4f\162\144\145\x72") && isset($payment_gateways[$order->get_payment_method()]) ? $payment_gateways[$order->get_payment_method()] : false; } goto Ns2Sq; F17JG: function wc_orders_count($status, string $type = '') { $count = 0; $legacy_statuses = array("\x64\x72\x61\146\x74", "\x74\x72\x61\x73\x68"); $valid_statuses = array_merge(array_keys(wc_get_order_statuses()), $legacy_statuses); $status = !in_array($status, $legacy_statuses, true) && 0 !== strpos($status, "\x77\x63\55") ? "\x77\x63\x2d" . $status : $status; $valid_types = wc_get_order_types("\x6f\162\x64\x65\162\x2d\143\157\165\156\x74"); $type = trim($type); if (!in_array($status, $valid_statuses, true) || $type && !in_array($type, $valid_types, true)) { return 0; } $cache_key = WC_Cache_Helper::get_cache_prefix("\157\x72\x64\x65\162\x73") . $status . $type; $cached_count = wp_cache_get($cache_key, "\143\x6f\x75\x6e\164\x73"); if (false !== $cached_count) { return $cached_count; } $types_for_count = $type ? array($type) : $valid_types; foreach ($types_for_count as $type) { $data_store = WC_Data_Store::load("\163\x68\157\160\137\157\162\144\x65\162" === $type ? "\x6f\162\x64\x65\162" : $type); if ($data_store) { $count += $data_store->get_order_count($status); } } wp_cache_set($cache_key, $count, "\x63\157\x75\x6e\x74\x73"); return $count; } goto Asx1V; mqhnG: add_action("\167\157\157\x63\x6f\x6d\x6d\x65\x72\143\145\137\157\x72\144\x65\x72\x5f\163\x74\141\164\x75\x73\x5f\143\157\x6d\160\x6c\145\164\x65\144", "\167\x63\x5f\x64\157\167\x6e\154\x6f\x61\x64\141\x62\x6c\x65\x5f\160\x72\x6f\x64\165\143\164\137\x70\x65\x72\x6d\x69\x73\163\x69\x6f\156\163"); goto e6HRa; HcCNi: add_action("\x77\157\x6f\x63\157\155\155\145\162\x63\x65\137\x6f\x72\144\145\162\137\163\x74\x61\164\165\163\137\x70\145\x6e\x64\151\156\x67", "\x77\143\x5f\165\x70\x64\141\164\145\137\x63\157\165\x70\x6f\x6e\x5f\165\x73\141\x67\145\x5f\143\x6f\x75\156\x74\x73"); goto Oqw0n; l9CDT: defined("\x41\102\123\120\x41\124\x48") || die; goto lijVB; s3jUB: function wc_sanitize_order_id($order_id) { return (int) filter_var($order_id, FILTER_SANITIZE_NUMBER_INT); } goto Sg3Is; wp9W1: function wc_get_is_pending_statuses() { return apply_filters("\x77\x6f\x6f\x63\157\155\x6d\x65\x72\143\x65\137\157\162\144\145\162\137\151\163\x5f\x70\x65\156\x64\151\x6e\x67\137\163\x74\141\x74\x75\x73\145\x73", array("\x70\x65\x6e\x64\x69\x6e\147")); } goto YybMa; JYfF1: function wc_delete_shop_order_transients($order = 0) { if (is_numeric($order)) { $order = wc_get_order($order); } $reports = WC_Admin_Reports::get_reports(); $transients_to_clear = array("\167\x63\137\x61\x64\155\x69\156\x5f\x72\145\x70\157\162\x74"); foreach ($reports as $report_group) { foreach ($report_group["\162\x65\x70\x6f\x72\x74\x73"] as $report_key => $report) { $transients_to_clear[] = "\167\x63\137\162\145\160\157\x72\164\x5f" . $report_key; } } foreach ($transients_to_clear as $transient) { delete_transient($transient); } if (is_a($order, "\x57\103\137\117\x72\144\145\162")) { $order_id = $order->get_id(); delete_user_meta($order->get_customer_id(), "\137\x6d\x6f\x6e\x65\171\137\163\x70\x65\156\164"); delete_user_meta($order->get_customer_id(), "\x5f\x6f\162\144\145\162\x5f\x63\x6f\165\156\x74"); delete_user_meta($order->get_customer_id(), "\137\154\x61\x73\164\137\x6f\x72\144\x65\x72"); } else { $order_id = 0; } WC_Cache_Helper::get_transient_version("\x6f\x72\144\145\x72\x73", true); WC_Cache_Helper::invalidate_cache_group("\x6f\x72\x64\x65\x72\x73"); do_action("\167\x6f\x6f\143\157\x6d\155\145\162\x63\x65\x5f\x64\145\154\x65\x74\x65\x5f\163\x68\x6f\x70\x5f\157\x72\144\145\162\x5f\x74\162\141\156\163\x69\145\156\164\x73", $order_id); } goto MTADP; zNV1W: add_action("\167\157\157\x63\157\x6d\155\x65\x72\143\145\137\157\x72\144\145\162\x5f\x73\164\141\x74\165\x73\137\157\x6e\55\x68\157\154\x64", "\167\143\137\165\160\x64\x61\164\145\137\143\x6f\x75\x70\x6f\x6e\x5f\x75\x73\141\x67\145\x5f\x63\157\x75\x6e\x74\163"); goto gcUT_; uxzSD: function wc_get_order_notes($args) { $key_mapping = array("\154\151\155\x69\164" => "\156\165\x6d\x62\x65\x72", "\157\x72\144\x65\162\x5f\151\x64" => "\x70\x6f\163\x74\x5f\151\x64", "\x6f\162\x64\145\162\x5f\x5f\151\156" => "\x70\157\163\x74\137\137\151\156", "\157\x72\144\145\162\137\x5f\156\x6f\x74\x5f\x69\x6e" => "\160\x6f\163\164\x5f\x5f\156\x6f\164\x5f\151\x6e"); foreach ($key_mapping as $query_key => $db_key) { if (isset($args[$query_key])) { $args[$db_key] = $args[$query_key]; unset($args[$query_key]); } } $orderby_mapping = array("\144\141\x74\145\x5f\143\162\x65\x61\164\145\x64" => "\x63\157\x6d\155\x65\156\x74\137\144\141\164\145", "\x64\141\164\145\x5f\x63\162\x65\141\x74\x65\144\x5f\147\x6d\x74" => "\x63\x6f\x6d\155\145\x6e\x74\137\144\141\164\x65\x5f\x67\x6d\x74", "\151\x64" => "\143\x6f\x6d\x6d\x65\156\x74\137\x49\104"); $args["\x6f\x72\x64\x65\x72\x62\x79"] = !empty($args["\157\162\x64\145\162\142\x79"]) && in_array($args["\x6f\x72\x64\x65\162\142\x79"], array("\x64\141\164\x65\137\x63\162\x65\x61\x74\x65\144", "\x64\x61\164\x65\x5f\143\162\x65\x61\164\x65\x64\x5f\x67\155\x74", "\151\x64"), true) ? $orderby_mapping[$args["\x6f\x72\x64\x65\162\142\171"]] : "\x63\x6f\x6d\155\145\x6e\x74\137\x49\104"; if (isset($args["\x74\171\160\145"]) && "\143\165\x73\x74\x6f\155\x65\x72" === $args["\x74\171\160\145"]) { $args["\155\x65\164\x61\x5f\x71\165\x65\162\x79"] = array(array("\153\145\171" => "\x69\163\137\143\165\163\164\x6f\x6d\145\x72\137\156\x6f\x74\145", "\166\141\x6c\x75\x65" => 1, "\x63\157\155\160\x61\x72\x65" => "\75")); } elseif (isset($args["\x74\171\x70\145"]) && "\151\x6e\x74\145\162\x6e\141\x6c" === $args["\164\x79\x70\145"]) { $args["\155\x65\164\141\137\161\165\145\162\171"] = array(array("\153\145\x79" => "\151\x73\x5f\143\x75\x73\164\x6f\155\145\x72\137\x6e\157\164\x65", "\143\x6f\155\160\x61\x72\x65" => "\116\x4f\124\40\x45\130\111\123\124\123")); } $args["\x74\x79\160\x65"] = "\x6f\162\144\x65\162\137\156\157\x74\x65"; $args["\x73\x74\x61\x74\x75\x73"] = "\x61\x70\160\x72\157\166\x65"; unset($args["\143\x6f\x75\x6e\164"], $args["\x66\x69\145\x6c\x64\x73"]); remove_filter("\x63\157\x6d\x6d\x65\x6e\164\x73\137\143\x6c\x61\x75\x73\145\x73", array("\127\103\x5f\x43\x6f\x6d\155\x65\x6e\164\x73", "\145\170\x63\154\x75\x64\145\x5f\x6f\162\144\x65\162\137\x63\157\x6d\x6d\145\156\164\163"), 10, 1); $notes = get_comments($args); add_filter("\x63\x6f\x6d\x6d\145\x6e\x74\163\137\x63\x6c\141\x75\x73\x65\163", array("\127\x43\x5f\103\157\155\x6d\145\x6e\x74\163", "\145\170\x63\154\165\144\145\x5f\x6f\x72\144\x65\x72\x5f\x63\x6f\x6d\155\x65\156\x74\x73"), 10, 1); return array_filter(array_map("\167\143\137\147\x65\x74\x5f\157\162\x64\145\162\x5f\x6e\x6f\x74\145", $notes)); } goto n9PYg; ifjlf: function wc_update_total_sales_counts($order_id) { $order = wc_get_order($order_id); if (!$order) { return; } $recorded_sales = $order->get_data_store()->get_recorded_sales($order); $reflected_order = in_array($order->get_status(), array("\143\141\x6e\143\145\x6c\154\x65\x64", "\164\162\141\x73\x68"), true); if (!$reflected_order && "\x77\157\x6f\x63\x6f\155\x6d\145\x72\x63\145\x5f\x62\145\x66\x6f\x72\x65\x5f\144\x65\154\145\x74\145\137\x6f\x72\144\145\x72" === current_action()) { $reflected_order = true; } if ($recorded_sales xor $reflected_order) { return; } $operation = $recorded_sales && $reflected_order ? "\x64\x65\x63\x72\x65\141\x73\145" : "\151\156\x63\162\145\141\x73\x65"; if (count($order->get_items()) > 0) { foreach ($order->get_items() as $item) { $product_id = $item->get_product_id(); if ($product_id) { $data_store = WC_Data_Store::load("\x70\x72\157\144\x75\143\x74"); $data_store->update_product_sales($product_id, absint($item->get_quantity()), $operation); } } } if ("\x64\145\143\x72\145\x61\163\145" === $operation) { $order->get_data_store()->set_recorded_sales($order, false); } else { $order->get_data_store()->set_recorded_sales($order, true); } do_action("\167\x6f\x6f\143\157\155\x6d\x65\x72\143\x65\x5f\x72\x65\143\x6f\162\x64\x65\144\137\x73\141\154\145\x73", $order_id); } goto u3GzZ; qQQN3: function wc_get_tax_class_by_tax_id($tax_id) { global $wpdb; return $wpdb->get_var($wpdb->prepare("\x53\105\114\105\103\124\40\x74\x61\170\137\x72\x61\x74\145\137\x63\x6c\x61\163\163\40\x46\122\117\115\x20{$wpdb->prefix}\167\x6f\x6f\x63\157\155\155\x65\162\x63\145\x5f\164\x61\170\x5f\x72\x61\x74\145\163\x20\x57\x48\x45\122\x45\40\x74\x61\x78\137\162\141\x74\x65\x5f\x69\x64\x20\75\40\45\x64", $tax_id)); } goto lSb56; s4c1N: add_action("\167\157\x6f\143\157\155\155\x65\x72\x63\x65\137\143\x61\x6e\x63\145\154\x5f\165\x6e\x70\141\151\x64\x5f\x6f\162\144\x65\162\x73", "\167\143\x5f\x63\141\156\x63\145\154\x5f\x75\156\160\141\x69\144\137\157\162\x64\x65\x72\163"); goto s3jUB; LLqk8: add_action("\167\x6f\157\143\157\155\155\x65\162\143\x65\137\157\162\144\145\x72\x5f\x73\x74\141\x74\x75\163\x5f\x63\x6f\x6d\160\154\x65\164\145\x64\137\x74\x6f\x5f\x63\x61\156\143\x65\154\x6c\x65\x64", "\x77\143\137\x75\160\x64\141\164\145\137\x74\157\x74\141\154\137\x73\141\x6c\x65\163\137\143\x6f\165\156\164\163"); goto TLjcT; w0Gui: function wc_register_order_type($type, $args = array()) { if (post_type_exists($type)) { return false; } global $wc_order_types; if (!is_array($wc_order_types)) { $wc_order_types = array(); } if (is_wp_error(register_post_type($type, $args))) { return false; } $order_type_args = array("\145\170\x63\x6c\165\144\145\137\146\162\x6f\155\137\157\x72\x64\x65\x72\x73\137\163\x63\162\x65\145\156" => false, "\141\x64\x64\x5f\x6f\x72\144\x65\162\x5f\x6d\145\164\x61\137\142\157\x78\x65\x73" => true, "\145\x78\143\x6c\165\x64\145\x5f\x66\162\x6f\155\137\x6f\x72\144\x65\x72\137\143\157\165\156\164" => false, "\145\170\143\x6c\x75\144\145\x5f\146\x72\157\155\x5f\157\x72\x64\145\x72\137\x76\x69\145\167\163" => false, "\145\x78\143\154\165\144\x65\137\146\x72\x6f\155\137\x6f\162\144\x65\162\x5f\167\145\x62\150\157\x6f\x6b\163" => false, "\145\x78\x63\x6c\x75\144\x65\137\146\x72\157\x6d\137\x6f\x72\144\145\x72\x5f\x72\145\x70\x6f\162\164\163" => false, "\145\x78\143\154\165\144\145\x5f\x66\162\157\x6d\x5f\157\x72\x64\145\162\137\163\141\x6c\145\x73\137\162\145\160\157\162\164\x73" => false, "\143\154\141\x73\163\137\x6e\x61\155\x65" => "\127\103\137\x4f\162\x64\x65\162"); $args = array_intersect_key($args, $order_type_args); $args = wp_parse_args($args, $order_type_args); $wc_order_types[$type] = $args; return true; } goto seBLg; ho2lM: add_action("\167\157\x6f\143\x6f\x6d\155\145\x72\x63\145\137\x62\145\x66\157\x72\x65\x5f\144\x65\154\x65\x74\x65\x5f\x6f\x72\x64\x65\162", "\167\x63\x5f\x75\160\x64\x61\x74\145\137\x74\x6f\x74\141\154\137\x73\x61\154\145\x73\x5f\143\157\x75\x6e\164\163"); goto YXUjE; Dyx6z: function wc_get_is_paid_statuses() { return apply_filters("\167\157\157\143\x6f\155\155\145\162\x63\145\x5f\157\162\144\x65\162\137\x69\x73\137\160\x61\151\144\137\163\x74\141\164\x75\x73\145\x73", array("\160\x72\x6f\x63\x65\163\x73\x69\x6e\x67", "\143\157\155\x70\x6c\145\164\x65\x64")); } goto wp9W1; Sg3Is: add_filter("\x77\157\x6f\143\x6f\x6d\x6d\145\162\x63\145\x5f\163\150\157\x72\164\x63\x6f\144\x65\x5f\157\162\x64\145\162\x5f\164\162\x61\143\153\x69\156\147\137\157\162\144\145\162\137\x69\144", "\167\143\137\163\x61\156\x69\164\151\x7a\x65\x5f\157\162\144\145\x72\137\x69\144"); goto chgir; rjwt1: function wc_cancel_unpaid_orders() { $held_duration = get_option("\x77\157\x6f\x63\157\x6d\155\145\x72\x63\145\137\x68\x6f\154\x64\x5f\163\x74\157\x63\153\x5f\155\x69\156\x75\164\145\163"); wp_clear_scheduled_hook("\167\157\157\143\x6f\x6d\155\145\162\143\145\x5f\143\141\x6e\x63\145\154\137\x75\x6e\160\141\151\144\137\x6f\x72\144\145\x72\163"); $cancel_unpaid_interval = apply_filters("\x77\x6f\x6f\x63\x6f\155\155\x65\162\143\145\137\143\141\156\143\145\x6c\x5f\x75\156\x70\x61\x69\x64\x5f\157\162\144\x65\x72\x73\137\151\156\164\x65\x72\x76\x61\154\137\155\x69\x6e\165\164\x65\x73", absint($held_duration)); wp_schedule_single_event(time() + absint($cancel_unpaid_interval) * 60, "\167\x6f\x6f\x63\x6f\x6d\x6d\145\x72\x63\145\x5f\143\141\156\x63\x65\x6c\137\x75\156\x70\x61\151\x64\137\x6f\x72\x64\145\x72\163"); if ($held_duration < 1 || "\171\x65\x73" !== get_option("\x77\x6f\157\143\157\x6d\x6d\145\162\x63\145\x5f\x6d\x61\x6e\x61\147\x65\137\163\x74\x6f\143\153")) { return; } $data_store = WC_Data_Store::load("\157\x72\x64\145\x72"); $unpaid_orders = $data_store->get_unpaid_orders(strtotime("\55" . absint($held_duration) . "\40\115\111\116\x55\124\105\x53", current_time("\164\151\x6d\x65\x73\164\141\x6d\x70"))); if ($unpaid_orders) { foreach ($unpaid_orders as $unpaid_order) { $order = wc_get_order($unpaid_order); if (apply_filters("\x77\157\x6f\x63\157\155\155\x65\162\x63\x65\x5f\x63\141\156\143\x65\154\x5f\165\x6e\160\x61\151\144\x5f\x6f\x72\x64\145\x72", "\x63\150\145\143\153\x6f\165\x74" === $order->get_created_via(), $order)) { $order->update_status("\x63\x61\x6e\x63\x65\x6c\x6c\145\144", __("\125\156\160\x61\x69\144\x20\157\162\x64\x65\x72\x20\143\141\x6e\143\145\154\x6c\x65\144\40\x2d\40\x74\x69\155\x65\40\x6c\x69\x6d\151\x74\x20\x72\145\141\x63\x68\x65\144\x2e", "\167\157\x6f\x63\157\155\155\145\162\143\145")); } } } } goto s4c1N; eYVLO: add_action("\x77\157\157\x63\157\x6d\155\145\x72\143\145\x5f\157\162\x64\145\162\x5f\163\x74\141\164\x75\x73\137\x70\x72\157\x63\145\x73\x73\x69\156\x67", "\x77\x63\137\165\x70\144\x61\164\145\x5f\164\x6f\x74\x61\154\137\x73\141\154\x65\x73\137\x63\157\x75\x6e\x74\x73"); goto r39gD; r39gD: add_action("\x77\157\157\x63\157\155\155\145\x72\x63\145\x5f\157\x72\x64\145\162\137\163\x74\x61\164\165\x73\x5f\x6f\156\55\150\157\154\x64", "\x77\x63\x5f\165\x70\x64\x61\x74\x65\137\164\x6f\164\x61\x6c\x5f\x73\x61\x6c\x65\163\137\x63\157\165\x6e\x74\163"); goto LLqk8; Po7gT: function wc_get_order($the_order = false) { if (!did_action("\x77\157\157\x63\157\155\155\x65\162\x63\x65\x5f\x61\x66\164\145\x72\x5f\x72\145\x67\151\163\x74\x65\x72\x5f\160\x6f\163\x74\137\x74\171\160\145")) { wc_doing_it_wrong(__FUNCTION__, "\x77\143\137\147\145\x74\137\157\162\x64\145\x72\40\x73\x68\x6f\165\x6c\144\40\156\157\164\x20\x62\x65\40\143\x61\154\154\x65\144\40\142\x65\146\x6f\162\x65\x20\x70\157\163\164\40\x74\x79\x70\145\163\x20\141\162\x65\x20\162\145\x67\x69\163\164\145\162\x65\x64\40\50\167\x6f\157\x63\157\155\x6d\x65\162\143\145\137\141\x66\164\145\x72\137\162\x65\147\151\163\x74\145\162\x5f\160\x6f\x73\x74\137\x74\x79\160\x65\40\141\143\x74\x69\x6f\156\x29", "\62\x2e\x35"); return false; } return WC()->order_factory->get_order($the_order); } goto G536D; TssdE: add_action("\167\x6f\x6f\143\x6f\155\x6d\145\x72\143\x65\137\157\x72\x64\x65\x72\137\163\x74\x61\164\165\x73\x5f\162\145\x66\x75\156\144\145\x64", "\167\x63\x5f\x6f\x72\144\x65\162\137\x66\x75\x6c\154\171\x5f\162\x65\x66\165\x6e\144\145\x64"); goto Au6YC; n9PYg: function wc_create_order_note($order_id, $note, $is_customer_note = false, $added_by_user = false) { $order = wc_get_order($order_id); if (!$order) { return new WP_Error("\x69\156\166\x61\154\151\x64\x5f\x6f\162\x64\145\162\137\151\144", __("\111\x6e\166\x61\x6c\151\x64\x20\157\162\x64\x65\162\x20\x49\x44\56", "\167\157\157\x63\157\155\155\145\x72\143\145"), array("\x73\x74\141\164\165\163" => 400)); } return $order->add_order_note($note, (int) $is_customer_note, $added_by_user); } goto mpnZj; MTADP: function wc_ship_to_billing_address_only() { return "\142\x69\154\x6c\x69\x6e\x67\137\157\x6e\x6c\x79" === get_option("\167\157\157\143\157\x6d\x6d\145\162\x63\x65\137\163\150\151\x70\x5f\164\x6f\x5f\x64\x65\163\164\x69\x6e\x61\164\151\x6f\156"); } goto b72AQ; CvOol: function wc_get_order_types($for = '') { global $wc_order_types; if (!is_array($wc_order_types)) { $wc_order_types = array(); } $order_types = array(); switch ($for) { case "\157\x72\x64\145\x72\55\143\x6f\165\x6e\164": foreach ($wc_order_types as $type => $args) { if (!$args["\145\x78\143\x6c\165\x64\x65\x5f\x66\162\157\x6d\x5f\157\x72\144\x65\x72\137\x63\157\165\x6e\164"]) { $order_types[] = $type; } } break; case "\157\x72\144\x65\162\55\x6d\x65\164\141\55\x62\157\x78\145\x73": foreach ($wc_order_types as $type => $args) { if ($args["\x61\144\x64\137\x6f\162\144\x65\162\x5f\x6d\x65\x74\141\137\142\157\x78\x65\x73"]) { $order_types[] = $type; } } break; case "\166\151\145\x77\55\157\162\x64\x65\x72\x73": foreach ($wc_order_types as $type => $args) { if (!$args["\x65\170\143\154\x75\x64\x65\137\x66\162\x6f\155\137\x6f\x72\x64\145\x72\x5f\166\151\145\167\x73"]) { $order_types[] = $type; } } break; case "\x72\x65\160\x6f\x72\164\x73": foreach ($wc_order_types as $type => $args) { if (!$args["\145\170\x63\154\165\x64\x65\137\x66\x72\x6f\155\x5f\x6f\x72\x64\145\162\x5f\162\x65\x70\157\x72\164\x73"]) { $order_types[] = $type; } } break; case "\163\x61\154\x65\x73\x2d\x72\x65\x70\x6f\x72\x74\163": foreach ($wc_order_types as $type => $args) { if (!$args["\145\x78\143\154\x75\x64\145\137\x66\162\x6f\155\x5f\157\162\x64\x65\162\137\163\141\x6c\145\163\x5f\x72\x65\x70\x6f\162\164\163"]) { $order_types[] = $type; } } break; case "\x6f\162\x64\145\x72\x2d\167\x65\142\150\157\157\153\x73": foreach ($wc_order_types as $type => $args) { if (!$args["\x65\170\x63\154\165\144\x65\137\x66\162\x6f\x6d\x5f\157\162\x64\145\162\x5f\x77\145\142\150\157\157\153\x73"]) { $order_types[] = $type; } } break; case "\143\157\x74\55\x6d\x69\x67\x72\x61\164\x69\x6f\156": foreach ($wc_order_types as $type => $args) { if (DataSynchronizer::PLACEHOLDER_ORDER_POST_TYPE !== $type) { $order_types[] = $type; } } break; case "\x61\144\155\151\x6e\55\x6d\145\x6e\x75": $order_types = array_intersect(array_keys($wc_order_types), get_post_types(array("\163\150\157\x77\x5f\165\x69" => true, "\163\150\157\x77\137\x69\156\x5f\155\145\156\165" => "\x77\x6f\x6f\143\x6f\155\155\145\162\143\x65"))); break; default: $order_types = array_keys($wc_order_types); break; } return apply_filters("\x77\143\137\157\162\144\145\x72\137\x74\x79\160\x65\163", $order_types, $for); } goto koOyS; qHCW0: function wc_generate_order_key($key = '') { if ('' === $key) { $key = wp_generate_password(13, false); } return "\167\143\x5f" . apply_filters("\167\x6f\157\143\157\155\155\x65\x72\143\145\x5f\147\145\156\x65\x72\141\x74\x65\137\157\x72\x64\x65\162\x5f\153\145\x79", "\157\x72\144\145\x72\x5f" . $key); } goto g2n2P; Ns2Sq: function wc_order_fully_refunded($order_id) { $order = wc_get_order($order_id); $max_refund = wc_format_decimal($order->get_total() - $order->get_total_refunded()); if (!$max_refund) { return; } wc_switch_to_site_locale(); wc_create_refund(array("\x61\155\157\x75\x6e\x74" => $max_refund, "\162\x65\x61\163\157\x6e" => __("\x4f\162\x64\x65\162\x20\146\165\x6c\x6c\171\40\x72\145\146\x75\156\x64\x65\x64\56", "\x77\157\x6f\143\157\155\x6d\145\x72\143\145"), "\x6f\x72\144\145\162\137\x69\x64" => $order_id, "\x6c\151\156\x65\137\151\x74\145\x6d\x73" => array())); wc_restore_locale(); $order->add_order_note(__("\x4f\x72\x64\x65\x72\x20\x73\164\x61\x74\x75\x73\x20\x73\145\164\x20\164\157\40\162\x65\x66\165\x6e\x64\x65\144\56\x20\124\157\40\162\x65\x74\165\x72\156\x20\146\x75\x6e\x64\163\x20\164\157\x20\164\x68\x65\x20\x63\x75\163\x74\157\155\145\x72\x20\171\x6f\x75\x20\x77\x69\x6c\154\40\x6e\145\145\x64\x20\x74\x6f\40\151\x73\163\165\x65\40\141\x20\x72\145\x66\x75\x6e\144\40\x74\x68\162\x6f\x75\147\150\40\x79\x6f\165\x72\40\x70\141\x79\155\x65\x6e\164\40\x67\x61\x74\145\167\141\x79\x2e", "\x77\x6f\157\143\x6f\155\155\145\162\143\x65")); } goto TssdE; u3GzZ: add_action("\x77\157\157\x63\157\x6d\x6d\145\162\143\x65\137\x6f\162\x64\x65\x72\137\x73\x74\141\164\165\163\137\143\x6f\155\x70\x6c\145\x74\x65\144", "\167\x63\x5f\165\x70\144\x61\x74\145\137\x74\157\164\141\154\x5f\x73\141\x6c\x65\x73\137\143\x6f\165\156\x74\x73"); goto eYVLO; e6HRa: add_action("\167\x6f\x6f\x63\x6f\155\x6d\x65\162\143\x65\x5f\x6f\x72\x64\145\x72\x5f\163\164\x61\164\165\x73\x5f\160\162\x6f\x63\145\x73\x73\x69\x6e\x67", "\x77\143\x5f\x64\x6f\x77\156\154\157\x61\144\141\142\154\145\x5f\x70\162\x6f\144\x75\x63\x74\137\160\x65\162\155\151\x73\163\151\x6f\156\163"); goto JYfF1; sY06Q: function wc_downloadable_product_permissions($order_id, $force = false) { $order = wc_get_order($order_id); if (!$order || $order->get_data_store()->get_download_permissions_granted($order) && !$force) { return; } if ($order->has_status("\x70\x72\x6f\x63\x65\163\x73\x69\x6e\x67") && "\x6e\x6f" === get_option("\x77\157\x6f\x63\157\x6d\155\x65\162\x63\145\x5f\144\x6f\167\x6e\x6c\x6f\141\x64\163\137\x67\x72\x61\x6e\x74\137\141\143\x63\145\163\x73\x5f\x61\x66\164\x65\x72\137\x70\x61\x79\x6d\145\156\164")) { return; } if (count($order->get_items()) > 0) { foreach ($order->get_items() as $item) { $product = $item->get_product(); if ($product && $product->exists() && $product->is_downloadable()) { $downloads = $product->get_downloads(); foreach (array_keys($downloads) as $download_id) { wc_downloadable_file_permission($download_id, $product, $order, $item->get_quantity(), $item); } } } } $order->get_data_store()->set_download_permissions_granted($order, true); do_action("\x77\157\x6f\x63\x6f\155\155\145\162\143\x65\137\x67\162\141\156\164\137\160\162\157\x64\165\143\x74\x5f\x64\157\167\156\154\157\141\x64\137\x70\145\162\x6d\151\x73\x73\x69\x6f\x6e\163", $order_id); } goto mqhnG; jn3qg: function wc_is_order_status($maybe_status) { $order_statuses = wc_get_order_statuses(); return isset($order_statuses[$maybe_status]); } goto Dyx6z; YXUjE: function wc_update_coupon_usage_counts($order_id) { $order = wc_get_order($order_id); if (!$order) { return; } $has_recorded = $order->get_data_store()->get_recorded_coupon_usage_counts($order); if ($order->has_status("\x63\x61\156\143\145\x6c\154\x65\x64") && $has_recorded) { $action = "\x72\x65\x64\165\143\145"; $order->get_data_store()->set_recorded_coupon_usage_counts($order, false); } elseif (!$order->has_status("\x63\141\x6e\x63\x65\x6c\154\x65\x64") && !$has_recorded) { $action = "\x69\x6e\143\162\x65\x61\163\145"; $order->get_data_store()->set_recorded_coupon_usage_counts($order, true); } elseif ($order->has_status("\x63\141\x6e\143\x65\154\154\x65\x64")) { $order->get_data_store()->release_held_coupons($order, true); return; } else { return; } if (count($order->get_coupon_codes()) > 0) { foreach ($order->get_coupon_codes() as $code) { if (StringUtil::is_null_or_whitespace($code)) { continue; } $coupon = new WC_Coupon($code); $used_by = $order->get_user_id(); if (!$used_by) { $used_by = $order->get_billing_email(); } switch ($action) { case "\x72\x65\x64\x75\x63\x65": $coupon->decrease_usage_count($used_by); break; case "\151\x6e\x63\162\x65\141\x73\x65": $coupon->increase_usage_count($used_by, $order); break; } } $order->get_data_store()->release_held_coupons($order, true); } } goto HcCNi; gcUT_: add_action("\167\157\x6f\x63\157\155\x6d\x65\x72\143\145\x5f\157\x72\144\x65\162\137\163\x74\141\164\x75\x73\x5f\x63\x61\x6e\143\145\x6c\154\145\x64", "\167\143\x5f\165\x70\x64\141\x74\145\x5f\x63\x6f\x75\x70\x6f\156\137\x75\163\141\x67\145\x5f\143\x6f\x75\156\164\163"); goto rjwt1; Oqw0n: add_action("\167\x6f\157\x63\157\x6d\155\x65\x72\143\x65\x5f\157\162\x64\x65\x72\x5f\x73\x74\x61\164\165\x73\137\143\157\155\x70\x6c\145\164\x65\144", "\x77\x63\137\x75\160\x64\x61\164\x65\137\143\157\165\x70\x6f\156\x5f\x75\163\141\147\145\137\143\157\x75\156\164\163"); goto BUJXU; BUJXU: add_action("\x77\x6f\x6f\x63\x6f\155\155\x65\162\x63\x65\137\157\162\144\x65\162\x5f\x73\164\141\164\x75\x73\137\160\x72\157\x63\x65\163\x73\x69\156\147", "\x77\x63\x5f\165\160\x64\x61\164\x65\x5f\x63\x6f\x75\x70\x6f\x6e\x5f\165\x73\141\x67\145\x5f\x63\x6f\165\x6e\164\x73"); goto zNV1W; Au6YC: function wc_order_search($term) { $data_store = WC_Data_Store::load("\157\162\x64\145\x72"); return $data_store->search_orders(str_replace("\x4f\162\144\x65\x72\40\x23", '', wc_clean($term))); } goto ifjlf; koOyS: function wc_get_order_type($type) { global $wc_order_types; if (isset($wc_order_types[$type])) { return $wc_order_types[$type]; } return false; } goto w0Gui; chgir: function wc_get_order_note($data) { if (is_numeric($data)) { $data = get_comment($data); } if (!is_a($data, "\x57\x50\137\103\x6f\155\155\145\156\x74")) { return null; } return (object) apply_filters("\167\157\157\143\x6f\x6d\155\145\162\x63\145\x5f\147\145\164\137\157\x72\x64\145\162\x5f\156\x6f\164\145", array("\151\x64" => (int) $data->comment_ID, "\144\141\x74\145\x5f\143\x72\x65\141\x74\145\144" => wc_string_to_datetime($data->comment_date), "\143\x6f\x6e\164\145\156\164" => $data->comment_content, "\143\x75\163\x74\157\x6d\x65\x72\x5f\x6e\x6f\164\145" => (bool) get_comment_meta($data->comment_ID, "\151\163\137\143\165\x73\x74\x6f\155\x65\162\137\156\x6f\x74\145", true), "\x61\144\x64\x65\144\137\142\x79" => __("\x57\157\157\103\x6f\x6d\155\x65\162\x63\145", "\x77\157\x6f\143\x6f\155\155\145\162\x63\145") === $data->comment_author ? "\163\x79\163\164\145\x6d" : $data->comment_author), $data); } goto uxzSD; rV6l7: add_action("\x77\x6f\157\x63\157\x6d\155\145\x72\143\145\x5f\165\156\164\x72\141\163\150\137\157\162\x64\x65\x72", "\x77\143\137\x75\x70\144\141\164\x65\x5f\x74\157\x74\141\154\x5f\x73\141\x6c\x65\163\x5f\143\x6f\x75\156\164\x73"); goto ho2lM; mpnZj: function wc_delete_order_note($note_id) { return wp_delete_comment($note_id, true); }

Function Calls

None

Variables

None

Stats

MD5 ec79e39dcd630773e8465c81dd08c8bb
Eval Count 0
Decode Time 112 ms