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

Signing you up...

Thank you for signing up!

PHP Decode

goto cAWDv; cAWDv: class dreamlove_ps { const DREAM_URL = "\x68\164\164\x70\163\x3a\x2f\..

Decoded Output download

<?   
goto cAWDv; cAWDv: class dreamlove_ps { const DREAM_URL = "https://store.dreamlove.es/webservices/orderservice_wsdl.php"; public function __construct() { register_activation_hook(__FILE__, array($this, "dream_plugin_activate")); add_action("admin_enqueue_scripts", array($this, "dream_enqueue_scripts")); add_action("admin_init", array($this, "dream_before_plugin_activate")); add_action("admin_print_styles", array($this, "dream_add_stylesheet")); add_action("woocommerce_product_options_inventory_product_data", array($this, "add_barcode")); add_action("woocommerce_admin_process_product_object", array($this, "add_barcode_save")); add_action("woocommerce_variation_options_inventory", array($this, "add_barcode_variation"), 10, 3); add_action("woocommerce_save_product_variation", array($this, "add_barcode_variation_save"), 10, 2); add_action("woocommerce_product_options_inventory_product_data", array($this, "add_costprice")); add_action("woocommerce_admin_process_product_object", array($this, "add_costprice_save")); add_action("woocommerce_variation_options_inventory", array($this, "add_costprice_variation"), 10, 3); add_action("woocommerce_save_product_variation", array($this, "add_costprice_variation_save"), 10, 2); add_action("woocommerce_product_options_inventory_product_data", array($this, "add_dreamid")); add_action("woocommerce_admin_process_product_object", array($this, "add_dreamid_save")); add_action("woocommerce_variation_options_inventory", array($this, "add_dreamid_variation"), 10, 3); add_action("woocommerce_save_product_variation", array($this, "add_dreamid_variation_save"), 10, 2); add_action("woocommerce_product_options_inventory_product_data", array($this, "add_int_id")); add_action("woocommerce_admin_process_product_object", array($this, "add_int_id_save")); add_action("woocommerce_order_status_changed", array($this, "payment_complete"), 10, 3); add_action("woocommerce_checkout_create_order", array($this, "add_order_creation_time"), 10, 2); add_action("woocommerce_thankyou", array($this, "my_custom_order_complete")); add_action("admin_notices", array($this, "dreamlove_ps_add_banner")); add_action("woocommerce_add_to_cart", array($this, "actualizar_stock_de_producto"), 10, 6); $this->dream_init_actions(); load_plugin_textdomain("dreamlove_ps", false, dirname(plugin_basename(__FILE__)) . "/languages"); } public function dream_before_plugin_activate() { if (is_admin() && current_user_can("activate_plugins") && !is_plugin_active("woocommerce/woocommerce.php")) { add_action("admin_notices", array($this, "dream_plugin_notice")); deactivate_plugins(plugin_basename(__FILE__)); if (isset($_GET["activate"])) { unset($_GET["activate"]); } } } public function dreamlove_ps_add_banner() { $screen = get_current_screen(); if ($screen->parent_base !== "dream-settings") { return; } echo "<div class="dreamlove_ps-banner dreamlove_ps"><img src="" . plugin_dir_url(__FILE__) . "assets/dreamlove_wb.png" alt="Logo" class="dreamlove_ps-logo"><div class="dreamlove_ps-banner-text"><h1 class="dreamlove_ps-title">Sync</h1><p class="dreamlove_ps-subtitle"><a href="https://www.dreamlove.eu" target="_blank">www.dreamlove.eu</a> - <a href="mailto:>[email protected]" target="_blank">[email protected]</a> - <a href="tel:+34955630377" target="_blank">+34 955 63 03 77</a></p></div></div>"; $dream_st = get_option("dreamlove_acc_status"); $dream_name = get_option("dreamlove_acc_name"); $dream_bl = get_option("dreamlove_acc_bl"); $dream_lastc = get_option("dreamlove_acc_lastc"); $fecha_formateada = date("d/m/Y H:i", $dream_lastc); $dream_blt = $dream_bl . "\342\202\254"; $dream_bt = "<button class='dreamlove_ps button_ps refresh'><a class='balance_link' href='https://store.dreamlove.es/gestionsaldos/' target='_blank'>" . __("Add balance", "dreamlove_ps") . "</a></button>"; if ($dream_bl < 50) { $dream_blt = "<span class='error'>" . $dream_blt . "</span><br/><span></span>"; } $message = ''; if ($dream_st == 1) { $message = __("Your License is Activated", "dreamlove_ps") . "<br/>" . __("Registered as", "dreamlove_ps") . " " . $dream_name . "<br/>" . __("Available balance", "dreamlove_ps") . " " . $dream_blt . "<br/>" . __("Last check", "dreamlove_ps") . " " . $fecha_formateada . "<br/>"; } else { $message = __("Your licence is Deactivated. <br/>Please contact", "dreamlove_ps") . " <a href="mailto:>[email protected]" target="_blank">[email protected]</a> " . __("to activate the account", "dreamlove_ps"); } echo "<div class="dreamlove_ps-subbanner dreamlove_ps"><img src="" . plugin_dir_url(__FILE__) . "assets/ico_dreamlove.png" alt="Icon" class="dreamlove_ps-icon"><br><span>" . $message . "</span><br/><div class="dreamlove_ps cont_buttons">" . $dream_bt . "<input type="submit" value="" . __("Refresh", "dreamlove_ps") . "" class="dreamlove_ps button_ps refresh dream-refresh_ws"></div></div>"; } public function dream_plugin_notice() { if (!class_exists("Woocommerce")) { echo "<div class="notice notice-warning is-dismissible">
\x9			<p>" . __("Plugin could not be activated. Please install and activate Woocommerce Plugin, to enable DL Importer Plugin.", "wp-advance-bank-transfer-feature-extension") . "</p>
\x9	\x9</div>"; } } public function dream_plugin_activate() { $this->generate_user_activation_key(); } public function generate_user_activation_key() { $site_domain = $_SERVER["HTTP_HOST"]; $site_domain = str_replace("www.", '', $site_domain); $s_data = "dreamlove_ps_"; $dd = implode('', unpack("C*", $s_data)); $nd = implode('', unpack("C*", $site_domain)); $userd = $dd ^ $nd; $eu = base64_encode($userd); update_option("dreamlove_ps_t", $eu); } public function dream_enqueue_scripts() { wp_enqueue_script("jquery"); wp_enqueue_script("dream-js", plugin_dir_url(__FILE__) . "assets/js/scripts.js", array("jquery"), 1.1, true); wp_localize_script("dlp-js", "dream_script", array("ajax_url" => admin_url("admin-ajax.php"))); } public function dream_add_stylesheet() { wp_enqueue_style("dream-style", plugins_url("assets/css/style.css", __FILE__)); } private function dream_init_actions() { add_action("admin_menu", array($this, "dream_menu_setup")); add_action("wp_ajax_dream_create_cats", array($this, "dream_create_cats")); add_action("wp_ajax_nopriv_dream_create_cats", array($this, "dream_create_cats")); add_action("wp_ajax_dream_init_import", array($this, "dream_init_import")); add_action("wp_ajax_nopriv_dream_init_import", array($this, "dream_init_import")); add_action("wp_ajax_dream_info", array($this, "dream_info")); add_action("wp_ajax_nopriv_dream_info", array($this, "dream_info")); add_action("wp_ajax_dream_create_menu", array($this, "dream_create_menu")); add_action("wp_ajax_nopriv_dream_create_menu", array($this, "dream_create_menu")); add_action("wp_ajax_dream_clean_mapping", array($this, "dream_clean_mapping")); add_action("wp_ajax_nopriv_dream_clean_mapping", array($this, "dream_clean_mapping")); add_action("wp_ajax_dream_delete_all", array($this, "dream_delete_all")); add_action("wp_ajax_nopriv_dream_delete_all", array($this, "dream_delete_all")); add_action("wp_ajax_dream_delete_draft", array($this, "dream_delete_draft")); add_action("wp_ajax_nopriv_dream_delete_draft", array($this, "dream_delete_draft")); add_action("wp_ajax_dream_delete_duplicate", array($this, "dream_delete_duplicate")); add_action("wp_ajax_nopriv_dream_delete_duplicate", array($this, "dream_delete_duplicate")); add_action("wp_ajax_dream_translate", array($this, "dream_translate")); add_action("wp_ajax_nopriv_dream_translate", array($this, "dream_translate")); add_action("wp_ajax_dream_option", array($this, "dream_option")); add_action("wp_ajax_nopriv_dream_option", array($this, "dream_option")); add_action("wp_ajax_dream_force_stop_import", array($this, "dream_force_stop_import")); add_action("wp_ajax_nopriv_dream_force_stop_import", array($this, "dream_force_stop_import")); add_action("wp_ajax_dream_save_general_option_settings", array($this, "dream_save_general_option_settings")); add_action("wp_ajax_nopriv_dream_save_general_option_settings", array($this, "dream_save_general_option_settings")); add_action("wp_ajax_dream_token", array($this, "dream_token")); add_action("wp_ajax_nopriv_dream_token", array($this, "dream_token")); add_action("wp_ajax_dream_cleantemp", array($this, "dream_cleantemp")); add_action("wp_ajax_nopriv_dream_cleantemp", array($this, "dream_cleantemp")); add_action("wp_ajax_dream_refresh_ws", array($this, "dream_refresh_ws")); add_action("wp_ajax_nopriv_dream_refresh_ws", array($this, "dream_refresh_ws")); add_action("wp_ajax_dream_user_api_key_submission", array($this, "dream_user_api_key_submission")); add_action("wp_ajax_nopriv_dream_user_api_key_submission", array($this, "dream_user_api_key_submission")); add_action("wp_ajax_dream_wc_xml_map_categories", array($this, "dream_wc_xml_map_categories")); add_action("wp_ajax_nopriv_dream_wc_xml_map_categories", array($this, "dream_wc_xml_map_categories")); add_action("wp_ajax_dream_wc_xml_map_filters", array($this, "dream_wc_xml_map_filters")); add_action("wp_ajax_nopriv_dream_wc_xml_map_filters", array($this, "dream_wc_xml_map_filters")); add_action("wp_ajax_dream_get_product_list", array($this, "dream_get_product_list")); add_action("wp_ajax_nopriv_dream_get_product_list", array($this, "dream_get_product_list")); add_action("wp_ajax_dream_shipping_map", array($this, "dream_shipping_map")); add_action("wp_ajax_nopriv_dream_shipping_map", array($this, "dream_shipping_map")); add_action("wp_ajax_dream_pay_map", array($this, "dream_pay_map")); add_action("wp_ajax_nopriv_dream_pay_map", array($this, "dream_pay_map")); add_action("wp_ajax_dream_resend", array($this, "dream_resend")); add_action("wp_ajax_nopriv_dream_resend", array($this, "dream_resend")); add_action("wp_ajax_dream_resendagain", array($this, "dream_resendagain")); add_action("wp_ajax_nopriv_dream_resendagain", array($this, "dream_resendagain")); } public function dream_menu_setup() { add_menu_page(__("Settings", "dreamlove_ps"), __("DreamLove Sync", "dreamlove_ps"), "manage_options", "dream-settings", array($this, "dream_settings"), plugin_dir_url(__FILE__) . "assets/ico_dream.png"); add_submenu_page("dream-settings", __("Settings", "dreamlove_ps"), __("Settings", "dreamlove_ps"), "manage_options", "dream-settings", array($this, "dream_settings")); add_submenu_page("dream-settings", __("Mapping", "dreamlove_ps"), __("Mapping", "dreamlove_ps"), "manage_options", "dream-mapping", array($this, "dream_mapping")); add_submenu_page("dream-settings", __("Filters", "dreamlove_ps"), __("Filters", "dreamlove_ps"), "manage_options", "dream-filters", array($this, "dream_filters")); add_submenu_page("dream-settings", __("Sync", "dreamlove_ps"), __("Sync", "dreamlove_ps"), "manage_options", "dream-imports", array($this, "dream_products_import")); add_submenu_page("dream-settings", __("Couriers", "dreamlove_ps"), __("Couriers", "dreamlove_ps"), "manage_options", "dream-couriers", array($this, "dream_couriers")); add_submenu_page("dream-settings", __("Payment Methods", "dreamlove_ps"), __("Payment Methods", "dreamlove_ps"), "manage_options", "dream-payment-methods", array($this, "dream_payment_methods")); add_submenu_page("dream-settings", __("Historic Orders", "dreamlove_ps"), __("Historic Orders", "dreamlove_ps"), "manage_options", "dream-historic-orders", array($this, "dream_historic_orders")); add_submenu_page("dream-settings", __("Requirements", "dreamlove_ps"), __("Requirements", "dreamlove_ps"), "manage_options", "dream-requirements", array($this, "dream_requirements")); add_submenu_page("dream-settings", __("Activation", "dreamlove_ps"), __("Activation", "dreamlove_ps"), "manage_options", "dream-activation", array($this, "dream_activation")); } public function dream_user_api_key_submission() { $udd = htmlspecialchars_decode($_POST["user_api_key"]); update_option("dreamlove_ps_wo_user", $_POST["webuser"]); update_option("dreamlove_ps_wo_pass", $_POST["passuser"]); update_option("dreamlove_ps_wo_email", $_POST["emailuser"]); $dreamlove_ps_t = get_option("dreamlove_ps_t"); $user_key_message = __("Activated successfully.", "dreamlove_ps"); switch ($dreamlove_ps_t) { case $udd: update_option("dreampa", true); break; default: $user_key_message = __("Key incorrect.", "dreamlove_ps"); update_option("dreampa", false); break; } $response = $this->dream_spck(true); if ($response > 0) { $user_key_message = __("User, password or email no valid.", "dreamlove_ps"); } echo $user_key_message; die; } public function convert_iso_2_to_3($iso2) { $countries = array(array("id" => 4, "name" => "Afghanistan", "alpha2" => "af", "alpha3" => "afg"), array("id" => 8, "name" => "Albania", "alpha2" => "al", "alpha3" => "alb"), array("id" => 12, "name" => "Algeria", "alpha2" => "dz", "alpha3" => "dza"), array("id" => 20, "name" => "Andorra", "alpha2" => "ad", "alpha3" => "and"), array("id" => 24, "name" => "Angola", "alpha2" => "ao", "alpha3" => "ago"), array("id" => 28, "name" => "Antigua and Barbuda", "alpha2" => "ag", "alpha3" => "atg"), array("id" => 32, "name" => "Argentina", "alpha2" => "ar", "alpha3" => "arg"), array("id" => 51, "name" => "Armenia", "alpha2" => "am", "alpha3" => "arm"), array("id" => 36, "name" => "Australia", "alpha2" => "au", "alpha3" => "aus"), array("id" => 40, "name" => "Austria", "alpha2" => "at", "alpha3" => "aut"), array("id" => 31, "name" => "Azerbaijan", "alpha2" => "az", "alpha3" => "aze"), array("id" => 44, "name" => "Bahamas", "alpha2" => "bs", "alpha3" => "bhs"), array("id" => 48, "name" => "Bahrain", "alpha2" => "bh", "alpha3" => "bhr"), array("id" => 50, "name" => "Bangladesh", "alpha2" => "bd", "alpha3" => "bgd"), array("id" => 52, "name" => "Barbados", "alpha2" => "bb", "alpha3" => "brb"), array("id" => 112, "name" => "Belarus", "alpha2" => "by", "alpha3" => "blr"), array("id" => 56, "name" => "Belgium", "alpha2" => "be", "alpha3" => "bel"), array("id" => 84, "name" => "Belize", "alpha2" => "bz", "alpha3" => "blz"), array("id" => 204, "name" => "Benin", "alpha2" => "bj", "alpha3" => "ben"), array("id" => 64, "name" => "Bhutan", "alpha2" => "bt", "alpha3" => "btn"), array("id" => 68, "name" => "Bolivia (Plurinational State of)", "alpha2" => "bo", "alpha3" => "bol"), array("id" => 70, "name" => "Bosnia and Herzegovina", "alpha2" => "ba", "alpha3" => "bih"), array("id" => 72, "name" => "Botswana", "alpha2" => "bw", "alpha3" => "bwa"), array("id" => 76, "name" => "Brazil", "alpha2" => "br", "alpha3" => "bra"), array("id" => 96, "name" => "Brunei Darussalam", "alpha2" => "bn", "alpha3" => "brn"), array("id" => 100, "name" => "Bulgaria", "alpha2" => "bg", "alpha3" => "bgr"), array("id" => 854, "name" => "Burkina Faso", "alpha2" => "bf", "alpha3" => "bfa"), array("id" => 108, "name" => "Burundi", "alpha2" => "bi", "alpha3" => "bdi"), array("id" => 132, "name" => "Cabo Verde", "alpha2" => "cv", "alpha3" => "cpv"), array("id" => 116, "name" => "Cambodia", "alpha2" => "kh", "alpha3" => "khm"), array("id" => 120, "name" => "Cameroon", "alpha2" => "cm", "alpha3" => "cmr"), array("id" => 124, "name" => "Canada", "alpha2" => "ca", "alpha3" => "can"), array("id" => 140, "name" => "Central African Republic", "alpha2" => "cf", "alpha3" => "caf"), array("id" => 148, "name" => "Chad", "alpha2" => "td", "alpha3" => "tcd"), array("id" => 152, "name" => "Chile", "alpha2" => "cl", "alpha3" => "chl"), array("id" => 156, "name" => "China", "alpha2" => "cn", "alpha3" => "chn"), array("id" => 170, "name" => "Colombia", "alpha2" => "co", "alpha3" => "col"), array("id" => 174, "name" => "Comoros", "alpha2" => "km", "alpha3" => "com"), array("id" => 178, "name" => "Congo", "alpha2" => "cg", "alpha3" => "cog"), array("id" => 180, "name" => "Congo, Democratic Republic of the", "alpha2" => "cd", "alpha3" => "cod"), array("id" => 188, "name" => "Costa Rica", "alpha2" => "cr", "alpha3" => "cri"), array("id" => 384, "name" => "C\303\xb4te d'Ivoire", "alpha2" => "ci", "alpha3" => "civ"), array("id" => 191, "name" => "Croatia", "alpha2" => "hr", "alpha3" => "hrv"), array("id" => 192, "name" => "Cuba", "alpha2" => "cu", "alpha3" => "cub"), array("id" => 196, "name" => "Cyprus", "alpha2" => "cy", "alpha3" => "cyp"), array("id" => 203, "name" => "Czechia", "alpha2" => "cz", "alpha3" => "cze"), array("id" => 208, "name" => "Denmark", "alpha2" => "dk", "alpha3" => "dnk"), array("id" => 262, "name" => "Djibouti", "alpha2" => "dj", "alpha3" => "dji"), array("id" => 212, "name" => "Dominica", "alpha2" => "dm", "alpha3" => "dma"), array("id" => 214, "name" => "Dominican Republic", "alpha2" => "do", "alpha3" => "dom"), array("id" => 218, "name" => "Ecuador", "alpha2" => "ec", "alpha3" => "ecu"), array("id" => 818, "name" => "Egypt", "alpha2" => "eg", "alpha3" => "egy"), array("id" => 222, "name" => "El Salvador", "alpha2" => "sv", "alpha3" => "slv"), array("id" => 226, "name" => "Equatorial Guinea", "alpha2" => "gq", "alpha3" => "gnq"), array("id" => 232, "name" => "Eritrea", "alpha2" => "er", "alpha3" => "eri"), array("id" => 233, "name" => "Estonia", "alpha2" => "ee", "alpha3" => "est"), array("id" => 748, "name" => "Eswatini", "alpha2" => "sz", "alpha3" => "swz"), array("id" => 231, "name" => "Ethiopia", "alpha2" => "et", "alpha3" => "eth"), array("id" => 242, "name" => "Fiji", "alpha2" => "fj", "alpha3" => "fji"), array("id" => 246, "name" => "Finland", "alpha2" => "fi", "alpha3" => "fin"), array("id" => 250, "name" => "France", "alpha2" => "fr", "alpha3" => "fra"), array("id" => 266, "name" => "Gabon", "alpha2" => "ga", "alpha3" => "gab"), array("id" => 270, "name" => "Gambia", "alpha2" => "gm", "alpha3" => "gmb"), array("id" => 268, "name" => "Georgia", "alpha2" => "ge", "alpha3" => "geo"), array("id" => 276, "name" => "Germany", "alpha2" => "de", "alpha3" => "deu"), array("id" => 288, "name" => "Ghana", "alpha2" => "gh", "alpha3" => "gha"), array("id" => 300, "name" => "Greece", "alpha2" => "gr", "alpha3" => "grc"), array("id" => 308, "name" => "Grenada", "alpha2" => "gd", "alpha3" => "grd"), array("id" => 320, "name" => "Guatemala", "alpha2" => "gt", "alpha3" => "gtm"), array("id" => 324, "name" => "Guinea", "alpha2" => "gn", "alpha3" => "gin"), array("id" => 624, "name" => "Guinea-Bissau", "alpha2" => "gw", "alpha3" => "gnb"), array("id" => 328, "name" => "Guyana", "alpha2" => "gy", "alpha3" => "guy"), array("id" => 332, "name" => "Haiti", "alpha2" => "ht", "alpha3" => "hti"), array("id" => 340, "name" => "Honduras", "alpha2" => "hn", "alpha3" => "hnd"), array("id" => 348, "name" => "Hungary", "alpha2" => "hu", "alpha3" => "hun"), array("id" => 352, "name" => "Iceland", "alpha2" => "is", "alpha3" => "isl"), array("id" => 356, "name" => "India", "alpha2" => "in", "alpha3" => "ind"), array("id" => 360, "name" => "Indonesia", "alpha2" => "id", "alpha3" => "idn"), array("id" => 364, "name" => "Iran (Islamic Republic of)", "alpha2" => "ir", "alpha3" => "irn"), array("id" => 368, "name" => "Iraq", "alpha2" => "iq", "alpha3" => "irq"), array("id" => 372, "name" => "Ireland", "alpha2" => "ie", "alpha3" => "irl"), array("id" => 376, "name" => "Israel", "alpha2" => "il", "alpha3" => "isr"), array("id" => 380, "name" => "Italy", "alpha2" => "it", "alpha3" => "ita"), array("id" => 388, "name" => "Jamaica", "alpha2" => "jm", "alpha3" => "jam"), array("id" => 392, "name" => "Japan", "alpha2" => "jp", "alpha3" => "jpn"), array("id" => 400, "name" => "Jordan", "alpha2" => "jo", "alpha3" => "jor"), array("id" => 398, "name" => "Kazakhstan", "alpha2" => "kz", "alpha3" => "kaz"), array("id" => 404, "name" => "Kenya", "alpha2" => "ke", "alpha3" => "ken"), array("id" => 296, "name" => "Kiribati", "alpha2" => "ki", "alpha3" => "kir"), array("id" => 408, "name" => "Korea (Democratic People's Republic of)", "alpha2" => "kp", "alpha3" => "prk"), array("id" => 410, "name" => "Korea, Republic of", "alpha2" => "kr", "alpha3" => "kor"), array("id" => 414, "name" => "Kuwait", "alpha2" => "kw", "alpha3" => "kwt"), array("id" => 417, "name" => "Kyrgyzstan", "alpha2" => "kg", "alpha3" => "kgz"), array("id" => 418, "name" => "Lao People's Democratic Republic", "alpha2" => "la", "alpha3" => "lao"), array("id" => 428, "name" => "Latvia", "alpha2" => "lv", "alpha3" => "lva"), array("id" => 422, "name" => "Lebanon", "alpha2" => "lb", "alpha3" => "lbn"), array("id" => 426, "name" => "Lesotho", "alpha2" => "ls", "alpha3" => "lso"), array("id" => 430, "name" => "Liberia", "alpha2" => "lr", "alpha3" => "lbr"), array("id" => 434, "name" => "Libya", "alpha2" => "ly", "alpha3" => "lby"), array("id" => 438, "name" => "Liechtenstein", "alpha2" => "li", "alpha3" => "lie"), array("id" => 440, "name" => "Lithuania", "alpha2" => "lt", "alpha3" => "ltu"), array("id" => 442, "name" => "Luxembourg", "alpha2" => "lu", "alpha3" => "lux"), array("id" => 450, "name" => "Madagascar", "alpha2" => "mg", "alpha3" => "mdg"), array("id" => 454, "name" => "Malawi", "alpha2" => "mw", "alpha3" => "mwi"), array("id" => 458, "name" => "Malaysia", "alpha2" => "my", "alpha3" => "mys"), array("id" => 462, "name" => "Maldives", "alpha2" => "mv", "alpha3" => "mdv"), array("id" => 466, "name" => "Mali", "alpha2" => "ml", "alpha3" => "mli"), array("id" => 470, "name" => "Malta", "alpha2" => "mt", "alpha3" => "mlt"), array("id" => 584, "name" => "Marshall Islands", "alpha2" => "mh", "alpha3" => "mhl"), array("id" => 478, "name" => "Mauritania", "alpha2" => "mr", "alpha3" => "mrt"), array("id" => 480, "name" => "Mauritius", "alpha2" => "mu", "alpha3" => "mus"), array("id" => 484, "name" => "Mexico", "alpha2" => "mx", "alpha3" => "mex"), array("id" => 583, "name" => "Micronesia (Federated States of)", "alpha2" => "fm", "alpha3" => "fsm"), array("id" => 498, "name" => "Moldova, Republic of", "alpha2" => "md", "alpha3" => "mda"), array("id" => 492, "name" => "Monaco", "alpha2" => "mc", "alpha3" => "mco"), array("id" => 496, "name" => "Mongolia", "alpha2" => "mn", "alpha3" => "mng"), array("id" => 499, "name" => "Montenegro", "alpha2" => "me", "alpha3" => "mne"), array("id" => 504, "name" => "Morocco", "alpha2" => "ma", "alpha3" => "mar"), array("id" => 508, "name" => "Mozambique", "alpha2" => "mz", "alpha3" => "moz"), array("id" => 104, "name" => "Myanmar", "alpha2" => "mm", "alpha3" => "mmr"), array("id" => 516, "name" => "Namibia", "alpha2" => "na", "alpha3" => "nam"), array("id" => 520, "name" => "Nauru", "alpha2" => "nr", "alpha3" => "nru"), array("id" => 524, "name" => "Nepal", "alpha2" => "np", "alpha3" => "npl"), array("id" => 528, "name" => "Netherlands", "alpha2" => "nl", "alpha3" => "nld"), array("id" => 554, "name" => "New Zealand", "alpha2" => "nz", "alpha3" => "nzl"), array("id" => 558, "name" => "Nicaragua", "alpha2" => "ni", "alpha3" => "nic"), array("id" => 562, "name" => "Niger", "alpha2" => "ne", "alpha3" => "ner"), array("id" => 566, "name" => "Nigeria", "alpha2" => "ng", "alpha3" => "nga"), array("id" => 807, "name" => "North Macedonia", "alpha2" => "mk", "alpha3" => "mkd"), array("id" => 578, "name" => "Norway", "alpha2" => "no", "alpha3" => "nor"), array("id" => 512, "name" => "Oman", "alpha2" => "om", "alpha3" => "omn"), array("id" => 586, "name" => "Pakistan", "alpha2" => "pk", "alpha3" => "pak"), array("id" => 585, "name" => "Palau", "alpha2" => "pw", "alpha3" => "plw"), array("id" => 591, "name" => "Panama", "alpha2" => "pa", "alpha3" => "pan"), array("id" => 598, "name" => "Papua New Guinea", "alpha2" => "pg", "alpha3" => "png"), array("id" => 600, "name" => "Paraguay", "alpha2" => "py", "alpha3" => "pry"), array("id" => 604, "name" => "Peru", "alpha2" => "pe", "alpha3" => "per"), array("id" => 608, "name" => "Philippines", "alpha2" => "ph", "alpha3" => "phl"), array("id" => 616, "name" => "Poland", "alpha2" => "pl", "alpha3" => "pol"), array("id" => 620, "name" => "Portugal", "alpha2" => "pt", "alpha3" => "prt"), array("id" => 634, "name" => "Qatar", "alpha2" => "qa", "alpha3" => "qat"), array("id" => 642, "name" => "Romania", "alpha2" => "ro", "alpha3" => "rom"), array("id" => 643, "name" => "Russian Federation", "alpha2" => "ru", "alpha3" => "rus"), array("id" => 646, "name" => "Rwanda", "alpha2" => "rw", "alpha3" => "rwa"), array("id" => 659, "name" => "Saint Kitts and Nevis", "alpha2" => "kn", "alpha3" => "kna"), array("id" => 662, "name" => "Saint Lucia", "alpha2" => "lc", "alpha3" => "lca"), array("id" => 670, "name" => "Saint Vincent and the Grenadines", "alpha2" => "vc", "alpha3" => "vct"), array("id" => 882, "name" => "Samoa", "alpha2" => "ws", "alpha3" => "wsm"), array("id" => 674, "name" => "San Marino", "alpha2" => "sm", "alpha3" => "smr"), array("id" => 678, "name" => "Sao Tome and Principe", "alpha2" => "st", "alpha3" => "stp"), array("id" => 682, "name" => "Saudi Arabia", "alpha2" => "sa", "alpha3" => "sau"), array("id" => 686, "name" => "Senegal", "alpha2" => "sn", "alpha3" => "sen"), array("id" => 688, "name" => "Serbia", "alpha2" => "rs", "alpha3" => "srb"), array("id" => 690, "name" => "Seychelles", "alpha2" => "sc", "alpha3" => "syc"), array("id" => 694, "name" => "Sierra Leone", "alpha2" => "sl", "alpha3" => "sle"), array("id" => 702, "name" => "Singapore", "alpha2" => "sg", "alpha3" => "sgp"), array("id" => 703, "name" => "Slovakia", "alpha2" => "sk", "alpha3" => "svk"), array("id" => 705, "name" => "Slovenia", "alpha2" => "si", "alpha3" => "svn"), array("id" => 90, "name" => "Solomon Islands", "alpha2" => "sb", "alpha3" => "slb"), array("id" => 706, "name" => "Somalia", "alpha2" => "so", "alpha3" => "som"), array("id" => 710, "name" => "South Africa", "alpha2" => "za", "alpha3" => "zaf"), array("id" => 728, "name" => "South Sudan", "alpha2" => "ss", "alpha3" => "ssd"), array("id" => 724, "name" => "Spain", "alpha2" => "es", "alpha3" => "esp"), array("id" => 144, "name" => "Sri Lanka", "alpha2" => "lk", "alpha3" => "lka"), array("id" => 729, "name" => "Sudan", "alpha2" => "sd", "alpha3" => "sdn"), array("id" => 740, "name" => "Suriname", "alpha2" => "sr", "alpha3" => "sur"), array("id" => 752, "name" => "Sweden", "alpha2" => "se", "alpha3" => "swe"), array("id" => 756, "name" => "Switzerland", "alpha2" => "ch", "alpha3" => "che"), array("id" => 760, "name" => "Syrian Arab Republic", "alpha2" => "sy", "alpha3" => "syr"), array("id" => 762, "name" => "Tajikistan", "alpha2" => "tj", "alpha3" => "tjk"), array("id" => 834, "name" => "Tanzania, United Republic of", "alpha2" => "tz", "alpha3" => "tza"), array("id" => 764, "name" => "Thailand", "alpha2" => "th", "alpha3" => "tha"), array("id" => 626, "name" => "Timor-Leste", "alpha2" => "tl", "alpha3" => "tls"), array("id" => 768, "name" => "Togo", "alpha2" => "tg", "alpha3" => "tgo"), array("id" => 776, "name" => "Tonga", "alpha2" => "to", "alpha3" => "ton"), array("id" => 780, "name" => "Trinidad and Tobago", "alpha2" => "tt", "alpha3" => "tto"), array("id" => 788, "name" => "Tunisia", "alpha2" => "tn", "alpha3" => "tun"), array("id" => 792, "name" => "Turkey", "alpha2" => "tr", "alpha3" => "tur"), array("id" => 795, "name" => "Turkmenistan", "alpha2" => "tm", "alpha3" => "tkm"), array("id" => 798, "name" => "Tuvalu", "alpha2" => "tv", "alpha3" => "tuv"), array("id" => 800, "name" => "Uganda", "alpha2" => "ug", "alpha3" => "uga"), array("id" => 804, "name" => "Ukraine", "alpha2" => "ua", "alpha3" => "ukr"), array("id" => 784, "name" => "United Arab Emirates", "alpha2" => "ae", "alpha3" => "are"), array("id" => 826, "name" => "United Kingdom of Great Britain and Northern Ireland", "alpha2" => "gb", "alpha3" => "gbr"), array("id" => 840, "name" => "United States of America", "alpha2" => "us", "alpha3" => "usa"), array("id" => 858, "name" => "Uruguay", "alpha2" => "uy", "alpha3" => "ury"), array("id" => 860, "name" => "Uzbekistan", "alpha2" => "uz", "alpha3" => "uzb"), array("id" => 548, "name" => "Vanuatu", "alpha2" => "vu", "alpha3" => "vut"), array("id" => 862, "name" => "Venezuela (Bolivarian Republic of)", "alpha2" => "ve", "alpha3" => "ven"), array("id" => 704, "name" => "Viet Nam", "alpha2" => "vn", "alpha3" => "vnm"), array("id" => 887, "name" => "Yemen", "alpha2" => "ye", "alpha3" => "yem"), array("id" => 894, "name" => "Zambia", "alpha2" => "zm", "alpha3" => "zmb"), array("id" => 716, "name" => "Zimbabwe", "alpha2" => "zw", "alpha3" => "zwe")); foreach ($countries as $key => $value) { if (strtoupper($value["alpha2"]) == $iso2) { return strtoupper($value["alpha3"]); } } } public function dream_couriers() { $def_selected = ''; $def_checked = ''; $dreamlove_ps_t = get_option("dreampa") && get_option("dreamlove_acc_status") == 1; if ($dreamlove_ps_t) { $response = $this->dream_spck(false); $delivery_zones = WC_Shipping_Zones::get_zones(); $LShip = array(); foreach ((array) $delivery_zones as $key => $the_zone) { foreach ($the_zone["shipping_methods"] as $the_zones) { $zcost = 0; if (isset($the_zones->cost)) { $zcost = $the_zones->cost; } array_push($LShip, array("id" => $the_zone["id"], "zname" => $the_zone["zone_name"], "sname" => $the_zones->title, "scost" => $zcost, "mid" => $the_zones->instance_id)); } } $couriers = $this->dream_wo_retrieve_couriers(); $couriers = $this->XtoA($couriers["shippingFees"])["sf"]; if (file_exists(plugin_dir_path(__FILE__) . "cain")) { echo "<pre>"; print_r($couriers); echo "</pre>"; } require "assets/views/dream_couriers_mapping_page.php"; } else { require "assets/views/dream_user_activation_page.php"; } } public function dream_payment_methods() { $dreamlove_ps_t = get_option("dreampa") && get_option("dreamlove_acc_status") == 1; if ($dreamlove_ps_t) { $response = $this->dream_spck(false); $paymetns = $this->dream_wo_retrieve_payments_methods(); $pd = $this->XtoA($paymetns["paymentDocuments"])["pd"]; $gateways = WC()->payment_gateways->get_available_payment_gateways(); $enabled_gateways = array(); if ($gateways) { foreach ($gateways as $gateway) { if ($gateway->enabled == "yes") { array_push($enabled_gateways, array("id" => $gateway->id, "name" => $gateway->title, "mname" => $gateway->method_title)); } } } require "assets/views/dream_payments_methods_page.php"; } else { require "assets/views/dream_user_activation_page.php"; } } public function XtoA($string) { $xml = htmlspecialchars_decode($string); $xml = simplexml_load_string($xml, "SimpleXMLElement", LIBXML_NOCDATA); $encode = json_encode($xml); return json_decode($encode, true); } public function dream_wo_connect() { $dream_wo_url = dreamlove_ps::DREAM_URL; $dreamlove_ps_wo_user = get_option("dreamlove_ps_wo_user"); $dreamlove_ps_wo_pass = get_option("dreamlove_ps_wo_pass"); $clientArgs = array("trace" => 1, "connection_timeout" => 30, "soap_version" => "SOAP_1_1", "encoding" => "utf-8", "cache_wsdl" => WSDL_CACHE_NONE); $sClient = new SoapClient($dream_wo_url, $clientArgs); $sKeys = array("Username" => $dreamlove_ps_wo_user, "Password" => $dreamlove_ps_wo_pass); $headers = new SoapHeader($dream_wo_url, "UserCredentials", $sKeys); $sClient->__setSoapHeaders(array($headers)); return $sClient; } public function dream_wo_retrieve_payments_methods() { $dream_wo_url = dreamlove_ps::DREAM_URL; $dreamlove_ps_wo_user = get_option("dreamlove_ps_wo_user"); $dreamlove_ps_wo_pass = get_option("dreamlove_ps_wo_pass"); $client = $this->dream_wo_connect(); $getPaymentFiles_response = $client->getPaymentFiles("basic", $dreamlove_ps_wo_user, $dreamlove_ps_wo_pass); return $getPaymentFiles_response; } public function dream_wo_retrieve_couriers() { $dream_wo_url = dreamlove_ps::DREAM_URL; $dreamlove_ps_wo_user = get_option("dreamlove_ps_wo_user"); $dreamlove_ps_wo_pass = get_option("dreamlove_ps_wo_pass"); $client = $this->dream_wo_connect(); $getLogisticsFiles_response = $client->getLogisticsFiles("basic", $dreamlove_ps_wo_user, $dreamlove_ps_wo_pass); return $getLogisticsFiles_response; } public function dream_wo_new_order($order_id) { $dream_wo_url = dreamlove_ps::DREAM_URL; $dreamlove_ps_wo_user = get_option("dreamlove_ps_wo_user"); $dreamlove_ps_wo_pass = get_option("dreamlove_ps_wo_pass"); $order_xml = ''; $client = $this->dream_wo_connect(); $newOrder_response = $client->newOrder("basic", $dreamlove_ps_wo_user, $dreamlove_ps_wo_pass, $order_id, $order_xml); return $newOrder_response; } public function mi_funcion_antes_de_agregar() { error_log("Producto a\303\261adido al carrito: "); } public function actualizar_stock_de_producto($cart_item_key, $product_id, $quantity, $variation_id, $variation, $cart_item_data) { $dream_update_cart_stock = get_option("dream_update_cart_stock"); if ($dream_update_cart_stock == "yes") { if ($variation_id) { $stock_externo = $this->obtener_stock_de_fuente_externa($variation_id); $this->actualizar_stock_woocommerce($variation_id, $stock_externo); } else { $stock_externo = $this->obtener_stock_de_fuente_externa($product_id); $this->actualizar_stock_woocommerce($product_id, $stock_externo); } } } public function actualizar_stock_woocommerce($product_id, $stock_externo) { $product = wc_get_product($product_id); $isdream = $product->get_meta("_dreamid", true); if ($product && $product->managing_stock() && !empty($isdream)) { $product->set_stock_quantity($stock_externo); if ($stock_externo <= 0) { $product->set_stock_status("outofstock"); } else { $product->set_stock_status("instock"); } $product->save(); } } public function obtener_stock_de_fuente_externa($product_id) { $prodid = get_post_meta($product_id, "_dreamid", true); if (!empty($prodid)) { $dream_wo_url = dreamlove_ps::DREAM_URL; $dreamlove_ps_wo_user = get_option("dreamlove_ps_wo_user"); $dreamlove_ps_wo_pass = get_option("dreamlove_ps_wo_pass"); $resource_string = "productIdFormat_dreamloveid"; $client = $this->dream_wo_connect(); try { $getBasicProductInfo_response = $client->getBasicProductInfo("basic", $dreamlove_ps_wo_user, $dreamlove_ps_wo_pass, $resource_string, $prodid, 0, 1); if (file_exists(plugin_dir_path(__FILE__) . "cain")) { echo "getBasicProductInfo_response:<pre>"; print_r($getBasicProductInfo_response); echo "</pre>"; } } catch (SoapFault $fault) { if (file_exists(plugin_dir_path(__FILE__) . "cain")) { echo "SoapFault 002:<pre>" . $fault->getMessage() . "<pre><br />\xa"; } } if ($getBasicProductInfo_response["available"] == 1) { $rstock = $getBasicProductInfo_response["availableStock"]; if ($rstock > 50) { $rstock = 50; } return $rstock; } else { return 0; } } } public function dream_wo_send_order($order_id, $resend = false) { if (!get_option("dream_flag_send_xml")) { return; } $order = new WC_Order($order_id); $cart_items = $order->get_items(); $billing_first_name = $order->get_billing_first_name(); $billing_last_name = $order->get_billing_last_name(); $billing_phone = $order->get_billing_phone(); $billing_email = $order->get_billing_email(); $billing_address_1 = $order->get_billing_address_1(); $billing_address_2 = $order->get_billing_address_2(); $billing_postcode = $order->get_billing_postcode(); $billing_city = $order->get_billing_city(); $billing_country = $order->get_billing_country(); $state = $order->get_billing_state(); $billing_state = WC()->countries->get_states($billing_country)[$state]; $customer_id = $order->get_customer_id(); $order_number = $order->get_order_number(); $date_created = $order->get_date_created(); $payment_method = $order->get_payment_method(); $payment_method_title = $order->get_payment_method_title(); $shipping_first_name = $order->get_shipping_first_name(); $shipping_last_name = $order->get_shipping_last_name(); $shipping_address_1 = $order->get_shipping_address_1(); $shipping_address_2 = $order->get_shipping_address_2(); $shipping_city = $order->get_shipping_city(); $sstate = $order->get_shipping_state(); $shipping_postcode = $order->get_shipping_postcode(); $shipping_country = $order->get_shipping_country(); $shipping_state = WC()->countries->get_states($shipping_country)[$sstate]; $cart_tax = $order->get_cart_tax(); $order_total = $order->get_formatted_order_total(); $total_tax_refunded = $order->get_total_tax_refunded(); $billing_vat_number = get_post_meta($order_id, "_billing_vat_number", true); $order_key = get_post_meta($order_id, "_order_key", true); $order_taxes_total = $order->get_tax_totals(); $ttax = 0; foreach ($order_taxes_total as $key => $value) { $ttax = $ttax + $value->amount; } $order_ftotal = $order->get_total(); $sname = ''; $smf = ''; $sm = $order->get_shipping_method(); if (get_option("map_shipping") != '') { $svmap = get_option("map_shipping"); foreach ($svmap as $key => $value) { if ($sm == $value["sname"]) { $smf = $value["code"]; $sname = $value["name"]; break; } } } $pm = ''; $pmt = ''; $iscr = ''; if (get_option("map_pay") != '') { $svmap = get_option("map_pay"); foreach ($svmap as $key => $value) { if ($payment_method == $value["id"]) { $pm = $value["code"]; $pmt = $value["name"]; if ($value["cr"] == "true") { $prevtotal = 0; foreach ($cart_items as $item) { $prod_quantity = $item["quantity"]; $product_variation_id = $item["variation_id"]; if ($product_variation_id) { $product = wc_get_product($item["variation_id"]); } else { $product = wc_get_product($item["product_id"]); } $isdream = $product->get_meta("_dreamid", true); if (empty($isdream)) { continue; } $prod_price_tax = wc_get_price_including_tax($product); $prevtotal = $prevtotal + $prod_price_tax * $prod_quantity; } $iscr = $prevtotal; } break; } } } if (empty($pmt)) { $pm = "006"; $pmt = "TARJETA"; } if ($resend) { $order_number = $order_number . "-" . mt_rand(1000, 9999); } $order_data = array("buyer_full_name" => $shipping_first_name . " " . $shipping_last_name, "billing_first_name" => $billing_first_name, "billing_last_name" => $billing_last_name, "billing_phone" => $billing_phone, "billing_email" => $billing_email, "billing_address" => $billing_address_1 . " " . $billing_address_2, "billing_postcode" => $billing_postcode, "billing_city" => $billing_city, "billing_country" => $billing_country, "billing_state" => $billing_state, "customer_id" => $customer_id, "order_number" => $order_number, "order_key" => $order_key, "date_created" => $date_created, "payment_method_title" => $pmt, "payment_method" => $pm, "shipping_first_name" => $shipping_first_name, "shipping_last_name" => $shipping_last_name, "shipping_phone" => $billing_phone, "shipping_email" => $billing_email, "shipping_address" => $shipping_address_1 . " " . $shipping_address_2, "shipping_city" => $shipping_city, "shipping_state" => $shipping_state, "shipping_postcode" => $shipping_postcode, "shipping_country" => $shipping_country, "cart_tax" => $cart_tax, "order_total" => $order_total, "total_tax_refunded" => $total_tax_refunded, "billing_vat_number" => $billing_vat_number, "shipping_method" => $smf, "order_items" => $cart_items, "order_taxes_total" => $ttax, "order_ftotal" => $order_ftotal, "order_tax_rate" => "21", "iscr" => $iscr); $dreamemail = get_option("dreamlove_ps_wo_email"); $skip = false; $emsg = ''; if ($dreamemail == $billing_email) { $emsg = __("The email address cannot be the same as the one used in the dreamlove account.", "dreamlove_ps"); $skip = true; } $rstatus = "-1"; $rdesc = __("Error in settings", "dreamlove_ps"); $rdl = "-1"; if (!$skip) { $generated_xml = $this->generate_xml($order_data); $x = simplexml_load_file($generated_xml)->asXML(); if (!empty($pmt) && !empty($smf) && !empty($generated_xml)) { $dreamlove_ps_wo_user = get_option("dreamlove_ps_wo_user"); $dreamlove_ps_wo_pass = get_option("dreamlove_ps_wo_pass"); $client = $this->dream_wo_connect(); $response = $client->newOrder("basic", $dreamlove_ps_wo_user, $dreamlove_ps_wo_pass, $order_number, mb_convert_encoding($x, "UTF-8", "auto")); $rstatus = $response["status"]; $rdesc = $response["errorDescription"]; $rdl = $response["dreamloveOrderId"]; $rtrack = $response["tracking_number"]; } if ($rstatus == 1) { $rdesc = __("Order sent successfully, Tracking Number:", "dreamlove_ps") . " " . $rtrack; $order->update_status("completed"); $email_cliente = $order->get_billing_email(); $tracking_number = $rtrack; $empresa = strtolower($sname); if (stripos($empresa, "seur") !== false) { $enlace = "https://www.seur.com/miseur/mis-envios/detalle?tracking=" . $tracking_number; } elseif (stripos($empresa, "dhl") !== false) { $enlace = "https://www.dhl.com/es-es/home/tracking/tracking-express.html?submit=1&tracking-id=" . $tracking_number; } elseif (stripos($empresa, "nacex") !== false) { $enlace = "http://www.nacex.es/seguimientoDetalle.do?agencia_origen=4145&numero_albaran=" . $tracking_number; } elseif (stripos($empresa, "mrw") !== false) { $enlace = "https://www.mrw.es/seguimiento_envios/MRW_historico_nacional.asp?enviament=" . $tracking_number; } elseif (stripos($empresa, "correos express") !== false || stripos($empresa, "correos") !== false) { $enlace = "https://s.correosexpress.com/search?s=" . $tracking_number; } elseif (stripos($empresa, "asigna") !== false) { $enlace = "https://web.asigna.es/apps/tracking/"; } elseif (stripos($empresa, "ups") !== false) { $enlace = "https://www.ups.com/track?tracknum=" . $tracking_number . "&loc=en_US&requester=ST/trackdetails"; } else { $enlace = ''; } $order->update_meta_data("_tracking_number", $tracking_number); $order->update_meta_data("_tracking_url", $enlace); $order->save(); $base_location = wc_get_base_location(); $country = $base_location["country"]; $subject = __("Your order has been completed and is on its way", "dreamlove_ps"); $message = sprintf(__("Dear customer, your order #%s has been shipped and is on its way. 
                    Your tracking number is: <strong>%s</strong>. \xa                    You can track your order at the following link: <a href="%s">Track your order</a>", "dreamlove_ps"), $order->get_order_number(), $tracking_number, $enlace); $email_heading = __("Your order tracking information", "dreamlove_ps"); $mailer = WC()->mailer(); $email_content = $mailer->wrap_message($email_heading, $message); $headers = "Content-Type: text/html; charset=UTF-8"; $mailer->send($email_cliente, $subject, $email_content, $headers); } } else { $rdesc = $emsg; } $order->update_meta_data("dlres", $rstatus); $order->update_meta_data("dlinfo", $rdesc); $order->update_meta_data("dreamid", $rdl); $order->update_meta_data("dltracking", $rtrack); $order->add_order_note($rdesc); $order->save(); } public function add_order_creation_time($order, $data) { $order->update_meta_data("_creation_time", time()); } public function dream_resend() { if (isset($_POST["order_id"])) { $order_id = $_POST["order_id"]; $this->dream_wo_send_order($order_id); echo "1"; } } public function dream_resendagain() { if (isset($_POST["order_id"])) { $order_id = $_POST["order_id"]; $this->dream_wo_send_order($order_id, true); echo "1"; } } public function my_custom_order_complete($order_id) { if (!$order_id) { return; } $order = wc_get_order($order_id); $key = $order->get_status(); if (get_option("dream_flag_status_" . $key)) { $this->dream_wo_send_order($order_id); } else { if (get_option("dream_flag_status_wc-" . $key)) { $this->dream_wo_send_order($order_id); } } } public function payment_complete($a, $old_status, $new_status) { $order = new WC_Order($a); $creation_time = $order->get_meta("_creation_time"); if (!$creation_time) { $creation_time = time(); } $time_since_creation = time() - $creation_time; if ($time_since_creation > 60) { $key = $order->get_status(); if (get_option("dream_flag_status_" . $key)) { $this->dream_wo_send_order($a); } else { if (get_option("dream_flag_status_wc-" . $key)) { $this->dream_wo_send_order($a); } } } } public function generate_xml($order_data) { $uploads = wp_upload_dir(); $extract_path = $uploads["basedir"] . "/dream"; if (!file_exists($extract_path)) { mkdir($extract_path, 493, true); } $xml_path = $extract_path . "/xml/"; if (!file_exists($xml_path)) { mkdir($xml_path, 484, true); } $date = date("Y-m-d H:i:s", strtotime($order_data["date_created"])); $delivery_date = date("Y-m-d H:i:s", strtotime($date . " +1 day")); $date_created = date("Y-m-d H:i:s", strtotime($order_data["date_created"])); $xml_file_name = $xml_path . "/xml_" . $order_data["order_number"] . ".xml"; $xml = new SimpleXMLExtended("<GesioOrder/>"); $xml->addChild("FileHeader"); $xml->FileHeader->addChild("SchemaVersion", "1.0"); $xml->FileHeader->addChild("Plataforma", "1"); $xml->FileHeader->addChild("Batch"); $xml->FileHeader->Batch->addChild("OrdersCount", "1"); $xml->FileHeader->Batch->addChild("OrderCurrencyCode", ''); $xml->addChild("Parties"); $xml->Parties->addChild("BuyerParty"); $xml->Parties->BuyerParty->addChild("TaxIdentification"); $xml->Parties->BuyerParty->TaxIdentification->addChild("TaxIdentificationNumber", $order_data["billing_vat_number"]); $xml->Parties->BuyerParty->addChild("Individual"); $xml->Parties->BuyerParty->Individual->addChild("Name"); $xml->Parties->BuyerParty->Individual->Name->addCData($order_data["billing_first_name"]); $xml->Parties->BuyerParty->Individual->addChild("FirstSurname"); $xml->Parties->BuyerParty->Individual->FirstSurname->addCData($order_data["billing_last_name"]); $xml->Parties->BuyerParty->Individual->addChild("PhoneNumber"); $xml->Parties->BuyerParty->Individual->PhoneNumber->addCData($order_data["billing_phone"]); $xml->Parties->BuyerParty->Individual->addChild("EmailAddress"); $xml->Parties->BuyerParty->Individual->EmailAddress->addCData($order_data["billing_email"]); $xml->Parties->BuyerParty->Individual->addChild("GlobalAddress"); $xml->Parties->BuyerParty->Individual->GlobalAddress->addChild("Address"); $xml->Parties->BuyerParty->Individual->GlobalAddress->Address->addCData($order_data["billing_address"]); $xml->Parties->BuyerParty->Individual->GlobalAddress->addChild("PostCode", $order_data["billing_postcode"]); $xml->Parties->BuyerParty->Individual->GlobalAddress->addChild("Town"); $xml->Parties->BuyerParty->Individual->GlobalAddress->Town->addCData($order_data["billing_city"]); $xml->Parties->BuyerParty->Individual->GlobalAddress->addChild("Province"); if ($order_data["billing_state"] == NULL) { $xml->Parties->BuyerParty->Individual->GlobalAddress->Province->addCData("NO"); } else { $xml->Parties->BuyerParty->Individual->GlobalAddress->Province->addCData($order_data["billing_state"]); } $xml->Parties->BuyerParty->Individual->GlobalAddress->addChild("CountryCode"); if ($this->convert_iso_2_to_3($order_data["shipping_country"]) == "PRT" && str_contains(strtolower($order_data["billing_state"]), "madeira")) { $xml->Parties->BuyerParty->Individual->GlobalAddress->CountryCode = "MADE"; } elseif ($this->convert_iso_2_to_3($order_data["shipping_country"]) == "PRT" && str_contains(strtolower($order_data["billing_state"]), "a\xc3\xa7ores")) { $xml->Parties->BuyerParty->Individual->GlobalAddress->CountryCode = "AZO"; } else { $xml->Parties->BuyerParty->Individual->GlobalAddress->CountryCode = $this->convert_iso_2_to_3($order_data["billing_country"]); } $xml->addChild("Order"); $xml->Order->addChild("OrderHeader"); $xml->Order->OrderHeader->addChild("UserIdentifier", $order_data["customer_id"]); $xml->Order->OrderHeader->addChild("OrderIdentifier"); $xml->Order->OrderHeader->OrderIdentifier->addCData($order_data["order_number"]); $xml->Order->OrderHeader->addChild("OrderNumber"); $xml->Order->OrderHeader->OrderNumber->addCData($order_data["order_number"]); $xml->Order->OrderHeader->addChild("OrderDescription")->addCData(''); $xml->Order->OrderHeader->addChild("comment")->addCData(''); $xml->Order->OrderHeader->addChild("DesiredDeliveryDate", $delivery_date); $xml->Order->OrderHeader->addChild("StartDate", $date_created); $xml->Order->OrderHeader->addChild("ShippingAddress"); $xml->Order->OrderHeader->ShippingAddress->addChild("GlobalAddress"); $xml->Order->OrderHeader->ShippingAddress->GlobalAddress->addChild("Address"); $xml->Order->OrderHeader->ShippingAddress->GlobalAddress->Address->addCData($order_data["shipping_address"]); $xml->Order->OrderHeader->ShippingAddress->GlobalAddress->addChild("PostCode", $order_data["shipping_postcode"]); $xml->Order->OrderHeader->ShippingAddress->GlobalAddress->addChild("Town"); $xml->Order->OrderHeader->ShippingAddress->GlobalAddress->Town->addCData($order_data["shipping_city"]); $xml->Order->OrderHeader->ShippingAddress->GlobalAddress->addChild("Province"); if ($order_data["shipping_state"] == NULL) { $xml->Order->OrderHeader->ShippingAddress->GlobalAddress->Province->addCData("NO"); } else { $xml->Order->OrderHeader->ShippingAddress->GlobalAddress->Province->addCData($order_data["shipping_state"]); } $xml->Order->OrderHeader->ShippingAddress->GlobalAddress->addChild("CountryCode"); if ($this->convert_iso_2_to_3($order_data["shipping_country"]) == "PRT" && str_contains(strtolower($order_data["shipping_state"]), "madeira")) { $xml->Order->OrderHeader->ShippingAddress->GlobalAddress->CountryCode = "MADE"; } elseif ($this->convert_iso_2_to_3($order_data["shipping_country"]) == "PRT" && str_contains(strtolower($order_data["shipping_state"]), "a\xc3\xa7ores")) { $xml->Order->OrderHeader->ShippingAddress->GlobalAddress->CountryCode = "AZO"; } else { $xml->Order->OrderHeader->ShippingAddress->GlobalAddress->CountryCode = $this->convert_iso_2_to_3($order_data["shipping_country"]); } $xml->Order->OrderHeader->addChild("ShippingDetails"); $xml->Order->OrderHeader->ShippingDetails->addChild("ShippingModeCode", $order_data["shipping_method"]); $xml->Order->OrderHeader->addChild("BuyerContactData"); $xml->Order->OrderHeader->BuyerContactData->addChild("OrderContact"); $xml->Order->OrderHeader->BuyerContactData->OrderContact->addChild("ContactData"); $xml->Order->OrderHeader->BuyerContactData->OrderContact->ContactData->addChild("FullName"); $xml->Order->OrderHeader->BuyerContactData->OrderContact->ContactData->addChild("PhoneNumber"); $xml->Order->OrderHeader->BuyerContactData->OrderContact->ContactData->addChild("EmailAddress"); $xml->Order->OrderHeader->BuyerContactData->OrderContact->ContactData->FullName->addCData($order_data["buyer_full_name"]); $xml->Order->OrderHeader->BuyerContactData->OrderContact->ContactData->PhoneNumber = $order_data["shipping_phone"]; $xml->Order->OrderHeader->BuyerContactData->OrderContact->ContactData->EmailAddress->addCData($order_data["billing_email"]); $xml->Order->OrderHeader->addChild("GeneralDiscounts"); $xml->Order->OrderHeader->addChild("dropshipping"); $xml->Order->OrderHeader->dropshipping->addChild("es_dropshipping", "1"); $xml->Order->OrderHeader->dropshipping->addChild("importcontra_dropshipping", $order_data["iscr"]); $xml->Order->addChild("OrderIssueData"); $xml->Order->OrderIssueData->addChild("IssueDate", date("Y-m-d")); $xml->Order->addChild("TaxesOutputs"); $xml->Order->TaxesOutputs->addChild("Tax"); $xml->Order->TaxesOutputs->Tax->addChild("TaxType")->addCData($order_data["order_tax_rate"]); $xml->Order->TaxesOutputs->Tax->addChild("TaxRate", $order_data["order_tax_rate"]); $xml->Order->TaxesOutputs->Tax->addChild("TaxableBase"); $xml->Order->TaxesOutputs->Tax->TaxableBase->addChild("TotalAmount", $order_data["order_ftotal"]); $xml->Order->TaxesOutputs->Tax->addChild("TaxAmount"); $xml->Order->TaxesOutputs->Tax->TaxAmount->addChild("TotalAmount", floatval($order_data["order_taxes_total"])); $total_wo_tax = floatval($order_data["order_ftotal"]) - floatval($order_data["order_taxes_total"]); $xml->Order->addChild("OrderTotals"); $xml->Order->OrderTotals->addChild("TotalGrossAmountBeforeTaxes", $total_wo_tax); $xml->Order->OrderTotals->addChild("TotalTaxOutputs", floatval($order_data["order_taxes_total"])); $xml->Order->OrderTotals->addChild("OrderTotal", $order_data["order_ftotal"]); $xml->Order->addChild("Items"); foreach ($order_data["order_items"] as $item) { $product_id = $item["product_id"]; $prod_quantity = $item["quantity"]; $product_variation_id = $item["variation_id"]; if ($product_variation_id) { $product = wc_get_product($item["variation_id"]); } else { $product = wc_get_product($item["product_id"]); } $prod_sku = $product->get_sku(); $isdream = $product->get_meta("_dreamid", true); if (empty($isdream)) { continue; } $prod_title = $product->get_name(); $prod_desc = $product->get_short_description(); $prod_price = $product->get_price(); $prod_price_tax = wc_get_price_including_tax($product); $prod_tax_name = $item["tax_class"]; $tax_amount = $prod_price_tax - $prod_price; $tax_por = round(($prod_price_tax / $prod_price - 1) * 100, 2); $xitems = $xml->Order->Items->addChild("OrderLine"); $xitems->addChild("OrderLineClass", "PRO"); $xitems->addChild("ProductReference")->addCData($prod_sku); $xitems->addChild("ProductDescription")->addCData($prod_title); $xitems->addChild("ItemDescription")->addCData($prod_desc); $xitems->addChild("Quantity", $prod_quantity); $xitems->addChild("UnitPriceWithoutTax", $prod_price); $xitems->addChild("TotalCost", $prod_price_tax); $xitems->addChild("TaxesOutputs"); $xitems->TaxesOutputs->addChild("Tax"); $xitems->TaxesOutputs->Tax->addChild("TaxType")->addCData($prod_tax_name); $xitems->TaxesOutputs->Tax->addChild("TaxRate", $tax_por); $xitems->TaxesOutputs->Tax->addChild("TaxableBase")->addChild("TotalAmount", $prod_price * $prod_quantity); $xitems->TaxesOutputs->Tax->addChild("TaxAmount")->addChild("TotalAmount", $tax_amount * $prod_quantity); } $xml->formatXML(); $xml->saveXML($xml_file_name); return $xml_file_name; } public function dream_pay_map() { if (isset($_POST["dream_wc_map_pay_id"]) && $_POST["dream_wc_pay_name"] && $_POST["dream_map_pay_code"]) { $dream_wc_map_pay_id = $_POST["dream_wc_map_pay_id"]; $dream_wc_pay_name = $_POST["dream_wc_pay_name"]; $dream_map_pay_code = $_POST["dream_map_pay_code"]; $dream_map_pay_name = $_POST["dream_map_pay_name"]; $dream_map_payc_id = $_POST["dream_map_payc_id"]; $arr_count = count($_POST["dream_wc_map_pay_id"]); $arr_map_pay = array(); for ($i = 0; $i < $arr_count; $i++) { array_push($arr_map_pay, array("id" => $dream_wc_map_pay_id[$i], "sname" => $dream_wc_pay_name[$i], "code" => $dream_map_pay_code[$i], "name" => $dream_map_pay_name[$i], "cr" => $dream_map_payc_id[$i])); } $mapping_updated = update_option("map_pay", $arr_map_pay); echo $mapping_updated; } } public function dream_historic_orders() { $dreamlove_ps_t = get_option("dreampa") && get_option("dreamlove_acc_status") == 1; if ($dreamlove_ps_t) { $response = $this->dream_spck(false); require "assets/views/dream_historic_page.php"; } else { require "assets/views/dream_user_activation_page.php"; } } public function dream_shipping_map() { if (isset($_POST["dream_wc_map_shipping_id"]) && $_POST["dream_wc_shipping_name"] && $_POST["dream_map_shipping_code"]) { $dream_wc_map_shipping_id = $_POST["dream_wc_map_shipping_id"]; $dream_wc_shipping_name = $_POST["dream_wc_shipping_name"]; $dream_map_shipping_code = $_POST["dream_map_shipping_code"]; $dream_map_shipping_name = $_POST["dream_map_shipping_name"]; $arr_count = count($_POST["dream_wc_map_shipping_id"]); $arr_map_shipping = array(); for ($i = 0; $i < $arr_count; $i++) { array_push($arr_map_shipping, array("id" => $dream_wc_map_shipping_id[$i], "sname" => $dream_wc_shipping_name[$i], "code" => $dream_map_shipping_code[$i], "name" => $dream_map_shipping_name[$i])); } $mapping_updated = update_option("map_shipping", $arr_map_shipping); echo $mapping_updated; } } public function dream_spck($force = false) { $lastck = get_option("dreamlove_acc_lastc", 0); $response = 0; if ($force || $lastck + 3600 < time()) { $dream_wo_url = dreamlove_ps::DREAM_URL; $dreamlove_ps_wo_user = get_option("dreamlove_ps_wo_user"); $dreamlove_ps_wo_pass = get_option("dreamlove_ps_wo_pass"); $dream_wo_email = get_option("dreamlove_ps_wo_email"); $clientArgs = array("trace" => 1, "connection_timeout" => 30, "soap_version" => "SOAP_1_1", "encoding" => "utf-8", "cache_wsdl" => WSDL_CACHE_NONE); $client = new SoapClient($dream_wo_url, $clientArgs); $sKeys = array("Username" => $dreamlove_ps_wo_user, "Password" => $dreamlove_ps_wo_pass); $headers = new SoapHeader($dream_wo_url, "UserCredentials", $sKeys); $client->__setSoapHeaders(array($headers)); if (file_exists(plugin_dir_path(__FILE__) . "vat")) { $getBasicCustomerInfo_response = $client->getBasicCustomerInfo("basic", $dreamlove_ps_wo_user, $dreamlove_ps_wo_pass, $dream_wo_email, "vatNumber"); } else { if (file_exists(plugin_dir_path(__FILE__) . "gesio")) { $getBasicCustomerInfo_response = $client->getBasicCustomerInfo("basic", $dreamlove_ps_wo_user, $dreamlove_ps_wo_pass, $dream_wo_email, "gesioId"); } else { $getBasicCustomerInfo_response = $client->getBasicCustomerInfo("basic", $dreamlove_ps_wo_user, $dreamlove_ps_wo_pass, $dream_wo_email, "emailAddress"); } } if (file_exists(plugin_dir_path(__FILE__) . "cain")) { print_r($getBasicCustomerInfo_response); } if (empty($getBasicCustomerInfo_response["errorCode"])) { update_option("dreamlove_acc_status", $getBasicCustomerInfo_response["status"]); update_option("dreamlove_acc_name", $getBasicCustomerInfo_response["name"]); update_option("dreamlove_acc_bl", $getBasicCustomerInfo_response["balancePurse"]); update_option("dreamlove_acc_lastc", time()); } else { if ($getBasicCustomerInfo_response["errorCode"] == 101) { update_option("dreamlove_acc_status", $getBasicCustomerInfo_response["status"]); update_option("dreamlove_acc_name", ''); update_option("dreamlove_acc_bl", 0); update_option("dreamlove_acc_lastc", time()); $response = $getBasicCustomerInfo_response["errorCode"]; } else { update_option("dreamlove_acc_status", 0); update_option("dreamlove_acc_name", ''); update_option("dreamlove_acc_bl", 0); update_option("dreamlove_acc_lastc", time()); $response = $getBasicCustomerInfo_response["errorCode"]; } } } return $response; } public function dream_activation() { require "assets/views/dream_user_activation_page.php"; } public function dream_settings() { $dreamlove_ps_t = get_option("dreampa") && get_option("dreamlove_acc_status") == 1; if ($dreamlove_ps_t) { $response = $this->dream_spck(false); require "assets/views/dream_settings_page.php"; } else { require "assets/views/dream_user_activation_page.php"; } } public function dream_token() { $bytes = random_bytes(20); $token = bin2hex($bytes); update_option("dream_update_xml_token", $token); } public function dream_refresh_ws() { $response = $this->dream_spck(true); } public function dream_requirements() { require "assets/views/dream_requirements_page.php"; } public function dream_save_general_option_settings() { $updated = false; $dream_xml_zip_lang = $_POST["dream_xml_zip_lang"]; $dream_cron = $_POST["update_cron"]; $dream_btax = $_POST["dream_btax"]; $dream_img_options = $_POST["img_options"]; $dream_update_prod_price = $_POST["prod_price"]; $dream_update_price_val = $_POST["update_price_val"]; $dream_update_import = $_POST["update_import"]; $dream_update_newp = $_POST["update_newp"]; $dream_update_title = $_POST["update_title"]; $dream_update_desc = $_POST["update_desc"]; $dream_update_excerpt = $_POST["update_excerpt"]; $dream_update_stock = $_POST["update_stock"]; $dream_update_cost_price = $_POST["update_cost_price"]; $dream_update_taxes = $_POST["dream_update_taxes"]; $dream_update_categories = $_POST["update_categories"]; $dream_update_categories_new = $_POST["update_categories_new"]; $dream_update_categories_sale = $_POST["update_categories_sale"]; $dream_update_brands = $_POST["update_brands"]; $dream_update_images = $_POST["update_images"]; $dream_update_discontinued_pv = $_POST["update_discontinued_prod_variants"]; $dream_price_iva_incl = $_POST["dream_price_iva_incl"]; $dream_update_cart_stock = $_POST["dream_update_cart_stock"]; $dream_flag_send_xml = $_POST["dream_flag_send_xml"]; $order = wc_get_order_statuses(); foreach ($order as $key => $value) { update_option("dream_flag_status_{$key}", $_POST["dream_flag_status_{$key}"]); } if ($dream_xml_zip_lang == "spanish") { $dream_update_xml_url = "https://store.dreamlove.es/dyndata/exportaciones/csvzip/catalog_1_50_125_2_eb10a792c0336bc695e2b0ec29d88402_xml.zip"; } else { if ($dream_xml_zip_lang == "english") { $dream_update_xml_url = "https://store.dreamlove.es/dyndata/exportaciones/csvzip/catalog_1_51_125_2_8964ad7838ce7787975ab7a21a3787ff_xml.zip"; } else { if ($dream_xml_zip_lang == "french") { $dream_update_xml_url = "https://store.dreamlove.es/dyndata/exportaciones/csvzip/catalog_1_52_125_2_dd65d46c9efc3d9364272c55399d5b56_xml.zip"; } else { if ($dream_xml_zip_lang == "italian") { $dream_update_xml_url = "https://store.dreamlove.es/dyndata/exportaciones/csvzip/catalog_1_54_125_2_815d4711f0229e78fe2df863d5d4a80f_xml.zip"; } else { if ($dream_xml_zip_lang == "german") { $dream_update_xml_url = "https://store.dreamlove.es/dyndata/exportaciones/csvzip/catalog_1_53_125_2_ee457f06864bdce94e116a76f7be041b_xml.zip"; } else { if ($dream_xml_zip_lang == "portuguese") { $dream_update_xml_url = "https://store.dreamlove.es/dyndata/exportaciones/csvzip/catalog_1_55_125_2_206b68c6599e190d0042493122d3fb63_xml.zip"; } else { $dream_update_xml_url = "https://store.dreamlove.es/dyndata/exportaciones/csvzip/catalog_1_50_125_2_eb10a792c0336bc695e2b0ec29d88402_xml.zip"; } } } } } } update_option("dream_update_xml_url", $dream_update_xml_url); update_option("dream_xml_zip_lang", $dream_xml_zip_lang); update_option("dream_cron", $dream_cron); update_option("dream_btax", $dream_btax); update_option("dream_img_options", $dream_img_options); update_option("dream_update_prod_price", $dream_update_prod_price); update_option("dream_update_price_val", $dream_update_price_val); update_option("dream_update_import", $dream_update_import); update_option("dream_update_newp", $dream_update_newp); update_option("dream_update_title", $dream_update_title); update_option("dream_update_desc", $dream_update_desc); update_option("dream_update_excerpt", $dream_update_excerpt); update_option("dream_update_stock", $dream_update_stock); update_option("dream_update_cost_price", $dream_update_cost_price); update_option("dream_update_taxes", $dream_update_taxes); update_option("dream_update_categories", $dream_update_categories); update_option("dream_update_categories_sale", $dream_update_categories_sale); update_option("dream_update_categories_new", $dream_update_categories_new); update_option("dream_update_brands", $dream_update_brands); update_option("dream_update_images", $dream_update_images); update_option("dream_update_discontinued_pv", $dream_update_discontinued_pv); update_option("dream_price_iva_incl", $dream_price_iva_incl); update_option("dream_update_cart_stock", $dream_update_cart_stock); update_option("dream_flag_send_xml", $dream_flag_send_xml); update_option("dream_last_save", time()); echo true; die; } public function dream_mapping() { $dreamlove_ps_t = get_option("dreampa") && get_option("dreamlove_acc_status") == 1; $def_selected = ''; $def_checked = ''; if ($dreamlove_ps_t) { $response = $this->dream_spck(false); if (trim(get_option("dream_update_xml_url")) != '') { $obj_xml_categories = $this->dream_list_cats_xml(); $wc_shop_categories = $this->dream_wc_shop_categories(); } require "assets/views/dream_mapping_page.php"; } else { require "assets/views/dream_user_activation_page.php"; } } public function dream_filters() { $dreamlove_ps_t = get_option("dreampa") && get_option("dreamlove_acc_status") == 1; $def_selected = ''; $def_checked = ''; if ($dreamlove_ps_t) { $response = $this->dream_spck(false); if (trim(get_option("dream_update_xml_url")) != '') { $result = $this->dream_load_filters(); $obj_xml_categories = $result["obj_xml_categories"]; $arr_xml_products = $result["arr_xml_products"]; $arr_xml_brand = $result["arr_xml_brand"]; } require "assets/views/dream_filter_page.php"; } else { require "assets/views/dream_user_activation_page.php"; } } public function dream_wc_shop_categories() { $arr_prod_cat = array(); $orderby = "name"; $order = "asc"; $hide_empty = false; $cat_args = array("orderby" => $orderby, "order" => $order, "hide_empty" => $hide_empty); $product_categories = get_terms("product_cat", $cat_args); foreach ($product_categories as $prod_cat) { array_push($arr_prod_cat, array("gid" => "0", "slug" => $prod_cat->slug, "name" => $prod_cat->name)); } return $arr_prod_cat; } public function dream_get_all_xml_categories() { $obj_xml_categories = $this->dream_list_cats_xml(); return $obj_xml_categories; } public function dream_list_cats_xml() { if (trim(get_option("dream_update_xml_url")) != '') { $xml = $this->ss_load_xml_file(); $list = array(); foreach ($xml->product as $key => $product) { $prod_categories = $product->categories; foreach ($prod_categories->category as $cat_vals) { $name = (string) $cat_vals; $slug = $this->clean_text(sanitize_title(strtolower($cat_vals))); $gid = (int) $cat_vals["gesioid"]; $acat = array("gid" => $gid, "name" => $name, "slug" => $slug); array_push($list, $acat); } } $lista = $this->unique_multidim_array($list, "gid"); array_multisort($lista); return $lista; } else { return array(); } } public function dream_load_filters() { if (trim(get_option("dream_update_xml_url")) != '') { $xml = $this->ss_load_xml_file(); $marcas = array(); $cates = array(); foreach ($xml->product as $key => $product) { $prod_categories = $product->categories; $prod_sku = strval($product->public_id); $prod_title = strval($product->title); $arr_xml_products[] = array($prod_sku, $prod_title); $hierarchy = (string) $product->brand_hierarchy; $hierarchy = str_replace("'", " ", $hierarchy); $prod_brand = array("name" => $hierarchy); array_push($marcas, $prod_brand); foreach ($prod_categories->category as $cat_vals) { $name = (string) $cat_vals; $slug = $this->clean_text(sanitize_title(strtolower($cat_vals))); $gid = (int) $cat_vals["gesioid"]; $acat = array("gid" => $gid, "name" => $name, "slug" => $slug); array_push($cates, $acat); } } $arr_xml_brand = $this->unique_multidim_array($marcas, "name"); array_multisort($arr_xml_brand); $obj_xml_categories = $this->unique_multidim_array($cates, "gid"); array_multisort($obj_xml_categories); return array("obj_xml_categories" => $obj_xml_categories, "arr_xml_products" => $arr_xml_products, "arr_xml_brand" => $arr_xml_brand); } else { return array("obj_xml_categories" => array(), "arr_xml_products" => array(), "arr_xml_brand" => array()); } } public function unique_multidim_array($array, $key) { $temp_array = array(); $i = 0; $key_array = array(); foreach ($array as $val) { if (!in_array($val[$key], $key_array)) { $key_array[$i] = $val[$key]; $temp_array[$i] = $val; } $i++; } return $temp_array; } public function ss_load_xml_file() { $xml_url = get_option("dream_update_xml_url", true); $dlp_simplexml = ''; $last_save = get_option("dream_last_save"); $last_dw = get_option("dream_last_xml_dw", 0); if ($last_save > $last_dw || time() > $last_dw + 3600) { if (!filter_var($xml_url, FILTER_VALIDATE_URL)) { echo "Invalid URL
\xa"; } else { $uploads = wp_upload_dir(); $extract_path = $uploads["basedir"] . "/dream"; if (!file_exists($extract_path)) { mkdir($extract_path, 493, true); } $extracted_xmls = $extract_path . "/xml/"; if (!file_exists($extracted_xmls)) { mkdir($extracted_xmls, 484, true); } $extract_dir = $extract_path . "/zip/"; if (!file_exists($extract_dir)) { mkdir($extract_dir, 484, true); } $dlp_new_xml_zip = $extract_dir . "/xml_products.zip"; $file = file_put_contents($dlp_new_xml_zip, fopen($xml_url, "r")); if ($file) { $zip = new ZipArchive(); if ($zip->open($dlp_new_xml_zip) != "true") { echo "Unable to open the Zip File.
"; } else { $zip->extractTo($extracted_xmls); $zip->close(); $dlp_simplexml = simplexml_load_file($extracted_xmls . "xml_001.xml"); update_option("dream_last_xml_dw", time()); return $dlp_simplexml; } } return $dlp_simplexml; } } else { $uploads = wp_upload_dir(); $extract_path = $uploads["basedir"] . "/dream"; $extracted_xmls = $extract_path . "/xml/"; $dlp_simplexml = simplexml_load_file($extracted_xmls . "xml_001.xml"); return $dlp_simplexml; } } public function dream_wc_xml_map_categories() { if (isset($_POST["dream_wc_shop_categories"]) && $_POST["dream_xml_prod_categories"] && $_POST["dream_wc_shop_categories_name"]) { $dream_wc_shop_categories = $_POST["dream_wc_shop_categories"]; $dream_xml_prod_categories = $_POST["dream_xml_prod_categories"]; $dream_xml_prod_categories_slug = $_POST["dream_xml_prod_categories_slug"]; $dream_wc_shop_categories_name = $_POST["dream_wc_shop_categories_name"]; $arr_count = count($_POST["dream_wc_shop_categories"]); $arr_map_categories = array(); for ($i = 0; $i < $arr_count; $i++) { array_push($arr_map_categories, array("gid" => $dream_xml_prod_categories[$i], "xslug" => $dream_xml_prod_categories_slug[$i], "slug" => $dream_wc_shop_categories[$i], "name" => $dream_wc_shop_categories_name[$i])); } $mapping_updated = update_option("map_product_categories", $arr_map_categories); if (isset($_POST["dream_map_cat"])) { $dream_map_cat = (int) $_POST["dream_map_cat"]; update_option("dream_map_cat", $dream_map_cat); } if (isset($_POST["dream_filter_cat"])) { $dream_filter_cat = (int) $_POST["dream_filter_cat"]; update_option("dream_filter_cat", $dream_filter_cat); } if (isset($_POST["dream_filter_prod"])) { $dream_filter_prod = (int) $_POST["dream_filter_prod"]; update_option("dream_filter_prod", $dream_filter_prod); } if (isset($_POST["dream_filter_brand"])) { $dream_filter_brand = (int) $_POST["dream_filter_brand"]; update_option("dream_filter_brand", $dream_filter_brand); } if (isset($_POST["dream_indluded_cat_key"])) { $dream_indluded_cat_key = $_POST["dream_indluded_cat_key"]; update_option("dream_indluded_cat_key", $dream_indluded_cat_key); } if (isset($_POST["dream_excluded_cat_key"])) { $dream_excluded_cat_key = $_POST["dream_excluded_cat_key"]; update_option("dream_excluded_cat_key", $dream_excluded_cat_key); } if (isset($_POST["dream_indluded_prod_key"])) { $dream_indluded_prod_key = $_POST["dream_indluded_prod_key"]; update_option("dream_indluded_prod_key", $dream_indluded_prod_key); } if (isset($_POST["dream_excluded_prod_key"])) { $dream_excluded_prod_key = $_POST["dream_excluded_prod_key"]; update_option("dream_excluded_prod_key", $dream_excluded_prod_key); } if (isset($_POST["dream_indluded_brand_key"])) { $dream_indluded_brand_key = $_POST["dream_indluded_brand_key"]; update_option("dream_indluded_brand_key", $dream_indluded_brand_key); } if (isset($_POST["dream_excluded_brand_key"])) { $dream_excluded_brand_key = $_POST["dream_excluded_brand_key"]; update_option("dream_excluded_brand_key", $dream_excluded_brand_key); } echo $mapping_updated; } } public function dream_wc_xml_map_filters() { if (isset($_POST["dream_filter_cat"])) { $dream_filter_cat = (int) $_POST["dream_filter_cat"]; update_option("dream_filter_cat", $dream_filter_cat); } if (isset($_POST["dream_filter_prod"])) { $dream_filter_prod = (int) $_POST["dream_filter_prod"]; update_option("dream_filter_prod", $dream_filter_prod); } if (isset($_POST["dream_filter_brand"])) { $dream_filter_brand = (int) $_POST["dream_filter_brand"]; update_option("dream_filter_brand", $dream_filter_brand); } if (isset($_POST["dream_indluded_cat_key"])) { $dream_indluded_cat_key = $_POST["dream_indluded_cat_key"]; update_option("dream_indluded_cat_key", $dream_indluded_cat_key); } if (isset($_POST["dream_excluded_cat_key"])) { $dream_excluded_cat_key = $_POST["dream_excluded_cat_key"]; update_option("dream_excluded_cat_key", $dream_excluded_cat_key); } if (isset($_POST["dream_indluded_prod_key"])) { $dream_indluded_prod_key = $_POST["dream_indluded_prod_key"]; update_option("dream_indluded_prod_key", $dream_indluded_prod_key); } if (isset($_POST["dream_excluded_prod_key"])) { $dream_excluded_prod_key = $_POST["dream_excluded_prod_key"]; update_option("dream_excluded_prod_key", $dream_excluded_prod_key); } if (isset($_POST["dream_indluded_brand_key"])) { $dream_indluded_brand_key = $_POST["dream_indluded_brand_key"]; update_option("dream_indluded_brand_key", $dream_indluded_brand_key); } if (isset($_POST["dream_excluded_brand_key"])) { $dream_excluded_brand_key = $_POST["dream_excluded_brand_key"]; update_option("dream_excluded_brand_key", $dream_excluded_brand_key); } echo true; } public function dream_get_mapped_categories() { $map_product_categories = get_option("map_product_categories"); if ($_POST["is_ajax"]) { echo json_encode($map_product_categories); die; } else { return $map_product_categories; } } public function dream_get_all_xml_products() { $uploads = wp_upload_dir(); $extract_path = $uploads["basedir"] . "/dream"; if (!file_exists($extract_path)) { mkdir($extract_path, 493, true); } $extracted_xmls = $extract_path . "/xml/"; if (!file_exists($extracted_xmls)) { mkdir($extracted_xmls, 484, true); } $extract_dir = $extract_path . "/zip/"; if (!file_exists($extract_dir)) { mkdir($extract_dir, 484, true); } $dlp_new_xml_filepath = $extracted_xmls . "xml_001.xml"; if (file_exists($dlp_new_xml_filepath)) { $dlp_simplexml = simplexml_load_file($extracted_xmls . "xml_001.xml"); if ($dlp_simplexml) { $prod_category = array(); $prod_count = 0; $total_prod_count = 0; foreach ($dlp_simplexml->product as $key => $xml_product) { $prod_sku = strval($xml_product->public_id); $prod_title = strval($xml_product->title); $arr_products[] = array($prod_sku, $prod_title); } $arr_products_chunks = $arr_products; } else { $arr_products_chunks = array(); } } else { $arr_products_chunks = array(); } return $arr_products_chunks; } public function dream_get_product_list() { $arr_products = $this->dream_get_all_xml_products(); return $arr_products; } public function dream_get_brand_list() { if (trim(get_option("dream_update_xml_url")) != '') { $xml = $this->ss_load_xml_file(); $list = array(); foreach ($xml->product as $key => $product) { $hierarchy = (string) $product->brand_hierarchy; $hierarchy = str_replace("'", " ", $hierarchy); $prod_brand = array("name" => $hierarchy); array_push($list, $prod_brand); } $lista = $this->unique_multidim_array($list, "name"); array_multisort($lista); return $lista; } else { return array(); } } public function dream_products_import() { $dreamlove_ps_t = get_option("dreampa") && get_option("dreamlove_acc_status") == 1; if ($dreamlove_ps_t) { $response = $this->dream_spck(false); require "assets/views/dream_products_import_page.php"; } else { require "assets/views/dream_user_activation_page.php"; } } public function dream_create_cats() { $xml_url = get_option("dream_update_xml_url", true); if (!filter_var($xml_url, FILTER_VALIDATE_URL)) { echo "Invalid URL\xd
"; } else { $uploads = wp_upload_dir(); $extract_path = $uploads["basedir"] . "/dl"; if (!file_exists($extract_path)) { mkdir($extract_path, 493, true); } $extracted_xmls = $extract_path . "/xml/"; if (!file_exists($extracted_xmls)) { mkdir($extracted_xmls, 484, true); } $extract_dir = $extract_path . "/zip/"; if (!file_exists($extract_dir)) { mkdir($extract_dir, 484, true); } $dlp_new_xml_zip = $extract_dir . "/xml_products.zip"; $file = file_put_contents($dlp_new_xml_zip, fopen($xml_url, "r")); if ($file) { $zip = new ZipArchive(); if ($zip->open($dlp_new_xml_zip) != "true") { echo "Unable to open the Zip File.\xd
"; } else { $zip->extractTo($extracted_xmls); $zip->close(); $dlp_simplexml = simplexml_load_file($extracted_xmls . "xml_001.xml"); if (!$dlp_simplexml) { echo "Unable to fetch file details.\xd\xa"; } else { $total_count = count($dlp_simplexml->product); foreach ($dlp_simplexml->product as $key => $dlpi_xml_product) { $prod_categories = $dlpi_xml_product->categories; foreach ($prod_categories->category as $cat_vals) { $cat_valsa = str_replace(array("<![CDATA[", "]]>"), array('', ''), $cat_vals); $cat_valse = explode("|", $cat_vals); $total = count($cat_valse); if (!term_exists($this->clean_text(sanitize_title($cat_vals)), "product_cat")) { if (count($cat_valse) > 1) { $TSlug = $cat_valse[0]; for ($i = 1; $i < count($cat_valse); $i++) { $padre = $this->clean_text($cat_valse[$i - 1]); $term_s = get_term_by("slug", $this->clean_text(sanitize_title($TSlug)), "product_cat"); if (!$term_s) { $term_s = wp_insert_term($this->clean_text(strval($padre)), "product_cat", array("slug" => $this->clean_text(sanitize_title(strtolower($TSlug))))); $term_id = $term_s["term_id"]; } else { $term_id = $term_s->term_id; } $TSlug .= "|" . $cat_valse[$i]; $hijo = $this->clean_text($cat_valse[$i]); if (!term_exists(sanitize_title($TSlug), "product_cat")) { $term = $this->Create_Cats_Parent($term_id, $hijo, $TSlug); } else { $term = get_term_by("slug", $this->clean_text(sanitize_title($TSlug)), "product_cat"); } } } else { $term = wp_insert_term($this->clean_text(strval($cat_valse[$total - 1])), "product_cat", array("slug" => $this->clean_text(sanitize_title(strtolower($cat_vals))))); } } else { if (count($cat_valse) > 1) { $TSlug = $cat_valse[0]; for ($i = 1; $i < count($cat_valse); $i++) { $padre = $this->clean_text($cat_valse[$i - 1]); $term_s = get_term_by("slug", $this->clean_text(sanitize_title($TSlug)), "product_cat"); if (!$term_s) { $term_s = wp_insert_term($this->clean_text(strval($padre)), "product_cat", array("slug" => $this->clean_text(sanitize_title(strtolower($TSlug))))); $term_id = $term_s["term_id"]; } else { $term_id = $term_s->term_id; } $TSlug .= "|" . $cat_valse[$i]; $hijo = $this->clean_text($cat_valse[$i]); if (!term_exists(sanitize_title($TSlug), "product_cat")) { $term = $this->Create_Cats_Parent($term_id, $hijo, $TSlug); } else { $term = get_term_by("slug", $this->clean_text(sanitize_title($TSlug)), "product_cat"); } } } else { $term = get_term_by("slug", $this->clean_text(sanitize_title($cat_valse[$total - 1])), "product_cat"); if (!$term) { $term = wp_insert_term($this->clean_text(strval($cat_valse[$total - 1])), "product_cat", array("slug" => $this->clean_text(sanitize_title(strtolower($cat_vals))))); } } } } } $xmlzip_files = glob($extract_path . "/*"); foreach ($xmlzip_files as $file) { if (is_file($file)) { unlink($file); } } } } } } } public function dream_init_import() { require_once "dreamtask.php"; $this->dream_info(); } public function dream_translate() { $string = $_POST["translate"]; echo _e($string, "dreamlove_ps"); } public function dream_option() { $option = $_POST["option"]; $value = $_POST["value"]; update_option($option, $value); } public function dream_cleantemp() { $directorio = plugin_dir_path(__FILE__) . "/check"; if (is_dir($directorio)) { $archivos = scandir($directorio); foreach ($archivos as $archivo) { if ($archivo != "." && $archivo != "..") { $rutaCompleta = $directorio . "/" . $archivo; if (is_file($rutaCompleta)) { unlink($rutaCompleta); } } } } } public function dream_info() { $cprocess = get_option("count_process", 0); $response = "{"; $counter = get_option("total_product_ip", 0); $total = get_option("total_product_xml", 0); $status = get_option("status_import"); $init = get_option("start_import_date", ''); $inittime = get_option("start_import_time", ''); $last = get_option("last_update_import_date", ''); $end = get_option("end_import_date", ''); $next = get_option("next_import"); $lastsku = get_option("last_sku", ''); if ($next != '') { $next = date("d/m/Y - H:i:s", $next); } $response .= ""progress":"" . $counter . "","; $response .= ""total":"" . $total . "","; $response .= ""status":"" . $status . "","; $response .= ""lastsku":"" . $lastsku . "","; $response .= ""last":"" . $last . "","; $response .= ""start":"" . $init . "","; $response .= ""end":"" . $end . "","; $response .= ""cprocess":"" . $cprocess . "","; $response .= ""next":"" . $next . "","; $response .= ""starttime":"" . $inittime . """; $response .= "}"; echo $response; } public function Create_Cats_Parent($pTerm, $Name, $SName) { $slug = $this->clean_text(sanitize_title(strtolower($SName))); $term = wp_insert_term($Name, "product_cat", array("slug" => $slug, "parent" => intval($pTerm))); return $term; } public function clean_text($texto, $limpiezaHtml = true, $limiteCaracteres = null) { $texto = trim($texto); $texto = html_entity_decode($texto); $texto = trim(preg_replace("/\t+/", '', $texto)); $texto = addslashes($texto); if ($limpiezaHtml) { $texto = strip_tags($texto); } $texto = preg_replace("/[\x{200B}-\x{200D}]/u", '', $texto); $texto = preg_replace("/[\x{200B}-\x{200D}\x{FEFF}]/u", '', $texto); $texto = str_replace("\342\x80\x8c", '', $texto); $texto = str_replace("&#8203;", '', $texto); $texto = str_replace(array("
\xa", "\xa", "\xd"), "<br>", $texto); $texto = str_replace("\\r", "<br>", $texto); $texto = str_replace("\r", "<br>", $texto); $texto = str_replace("\xd", "<br>", $texto); $texto = str_replace("onclick", "id", $texto); $texto = str_replace(array("\", "\302\250", "\302\xba", "\342\x80\x93", "~", "|", "\xc2\267", "&", "\302\xbf", "^", "\302\xa8", "\xc2\xb4", "#"), '', $texto); $texto = str_replace(array("\", "\xe2\x80\x99"), '', $texto); if ($limiteCaracteres > 0) { $texto = substr($texto, 0, $limiteCaracteres); } return $texto; } public function dream_force_stop_import() { $rutaArchivo = plugin_dir_path(__FILE__) . "/stop.txt"; if (file_exists($rutaArchivo)) { echo "El archivo ya existe.
"; } try { $archivo = fopen($rutaArchivo, "w"); if ($archivo === false) { throw new Exception("No se pudo crear o abrir el archivo."); } fclose($archivo); echo "El archivo ha sido creado exitosamente.
"; } catch (Exception $e) { echo "Error al crear el archivo: " . $e->getMessage() . "\xa"; } } public function sort_terms_hierarchically(array &$cats, array &$into, $parentId = 0) { foreach ($cats as $i => $cat) { if ($cat->parent == $parentId) { $into[$cat->term_id] = $cat; unset($cats[$i]); } } foreach ($into as $topCat) { $topCat->children = array(); $this->sort_terms_hierarchically($cats, $topCat->children, $topCat->term_id); } } public function dream_create_menu() { $categories = get_terms("product_cat", array("hide_empty" => false)); $categoryHierarchy = array(); $this->sort_terms_hierarchically($categories, $categoryHierarchy); $menuname = "Dream_Menu"; $menu_exists = wp_get_nav_menu_object($menuname); if (!$menu_exists) { $menu_id = wp_create_nav_menu($menuname); $this->addMenu($categoryHierarchy, $menu_id); } else { wp_delete_nav_menu($menuname); $menu_id = wp_create_nav_menu($menuname); $this->addMenu($categoryHierarchy, $menu_id); } echo 1; } public function dream_clean_mapping() { update_option("map_product_categories", ''); echo 1; } public function addMenu($list, $menu_id) { foreach ($list as $cat) { $parent = 0; if ($cat->parent > 0) { $parent = $this->FindMenuItemID($menu_id, $cat->parent); } wp_update_nav_menu_item($menu_id, 0, array("menu-item-title" => $cat->name, "menu-item-object" => "product_cat", "menu-item-object-id" => $cat->term_id, "menu-item-parent-id" => $parent, "menu-item-type" => "taxonomy", "menu-item-status" => "publish")); if (count($cat->children) > 0) { $this->addMenu($cat->children, $menu_id); } } } public function FindMenuItemID($menu, $seek) { $menu_items = wp_get_nav_menu_items($menu); foreach ((array) $menu_items as $key => $menu_item) { if ($menu_item->object_id == $seek) { return $menu_item->ID; } } return 0; } public function variation_query($posts, $query = false) { if (is_search() && !is_admin()) { $ignoreIds = array(0); foreach ($posts as $post) { $ignoreIds[] = $post->ID; } $matchedSku = $this->get_parent_post_by_sku(get_search_query(), $ignoreIds); if ($matchedSku) { foreach ($matchedSku as $product_id) { $posts[] = get_post($product_id->post_id); } } return $posts; } return $posts; } public function get_parent_post_by_sku($sku, $ignoreIds) { global $wpdb, $wp_query; if ($sku == '') { return array(0); } $wmplEnabled = false; if (defined("WPML_TM_VERSION") && defined("WPML_ST_VERSION") && class_exists("woocommerce_wpml")) { $wmplEnabled = true; $languageCode = "ES_es"; } $results = array(); $ignoreIdsForMySql = implode(",", $ignoreIds); $variationsSql = "
              SELECT p.post_parent as post_id FROM {$wpdb->posts} as p
              join {$wpdb->postmeta} pm\xa              on p.ID = pm.post_id\xa              and (pm.meta_key='_sku' or pm.meta_key='_barcode')\xa              and pm.meta_value LIKE '%{$sku}%'\xa              join {$wpdb->postmeta} visibility
              on p.post_parent = visibility.post_id    \xa              and visibility.meta_key = '_visibility'
              and visibility.meta_value <> 'hidden'\xa                "; if ($wmplEnabled) { $variationsSql .= "join " . $wpdb->prefix . "icl_translations t on\xa             t.element_id = p.post_parent
             and t.element_type = 'post_product'\xa             and t.language_code = '{$languageCode}'"; } $variationsSql .= "
              where 1
              AND p.post_parent <> 0\xa              and p.ID not in ({$ignoreIdsForMySql})\xa              and p.post_status = 'publish'\xa              group by p.post_parent\xa              "; $variations = $wpdb->get_results($variationsSql); foreach ($variations as $post) { $ignoreIds[] = $post->post_id; } $ignoreIdsForMySql = implode(",", $ignoreIds); $regularProductsSql = "SELECT p.ID as post_id FROM {$wpdb->posts} as p\xa            join {$wpdb->postmeta} pm
            on p.ID = pm.post_id\xa            and (pm.meta_key='_sku' or pm.meta_key='_barcode')\xa            AND pm.meta_value LIKE '%{$sku}%' 
            join {$wpdb->postmeta} visibility
            on p.ID = visibility.post_id    
            and visibility.meta_key = '_visibility'
            and visibility.meta_value <> 'hidden'"; if ($wmplEnabled) { $regularProductsSql .= "join " . $wpdb->prefix . "icl_translations t on
             t.element_id = p.ID
             and t.element_type = 'post_product'
             and t.language_code = '{$languageCode}'"; } $regularProductsSql .= "where 1
            and (p.post_parent = 0 or p.post_parent is null)\xa            and p.ID not in ({$ignoreIdsForMySql})\xa            and p.post_status = 'publish'
            group by p.ID"; $regular_products = $wpdb->get_results($regularProductsSql); $results = array_merge($variations, $regular_products); $wp_query->found_posts += sizeof($results); return $results; } public function add_barcode() { woocommerce_wp_text_input(array("id" => "_barcode", "label" => __("Barcode", "dreamlove_ps"), "placeholder" => "Scan Barcode", "desc_tip" => "true", "description" => __("Scan the product's barcode.", "dreamlove_ps"))); } public function add_barcode_variation($loop, $variation_data, $variation) { echo "<div class="options_group form-row form-row-full">"; woocommerce_wp_text_input(array("id" => "_barcode[" . $variation->ID . "]", "label" => __("Barcode", "dreamlove_ps"), "placeholder" => "Scan Barcode", "desc_tip" => true, "description" => __("Scan the product's barcode.", "woocommerce"), "value" => get_post_meta($variation->ID, "_barcode", true))); echo "</div>"; } public function add_barcode_variation_save($post_id) { $woocommerce_text_field = $_POST["_barcode"][$post_id]; update_post_meta($post_id, "_barcode", esc_attr($woocommerce_text_field)); } public function add_barcode_save($product) { if (isset($_POST["_barcode"])) { $product->update_meta_data("_barcode", sanitize_text_field($_POST["_barcode"])); } else { $product->delete_meta_data("_barcode"); } } public function add_costprice() { woocommerce_wp_text_input(array("id" => "_costprice", "label" => __("Cost Price", "dreamlove_ps"), "placeholder" => "Cost Price", "desc_tip" => "true", "description" => __("Product cost price", "dreamlove_ps"))); } public function add_costprice_save($product) { if (isset($_POST["_costprice"])) { $product->update_meta_data("_costprice", sanitize_text_field($_POST["_costprice"])); } else { $product->delete_meta_data("_costprice"); } } public function add_costprice_variation($loop, $variation_data, $variation) { echo "<div class="options_group form-row form-row-full">"; woocommerce_wp_text_input(array("id" => "_costprice[" . $variation->ID . "]", "label" => __("Cost Price", "dreamlove_ps"), "placeholder" => "Cost Price", "desc_tip" => true, "description" => __("product cost price", "woocommerce"), "value" => get_post_meta($variation->ID, "_costprice", true))); echo "</div>"; } public function add_costprice_variation_save($post_id) { $woocommerce_text_field = $_POST["_costprice"][$post_id]; update_post_meta($post_id, "_costprice", esc_attr($woocommerce_text_field)); } public function add_dreamid() { woocommerce_wp_text_input(array("id" => "_dreamid", "label" => __("DreamLove ID", "dreamlove_ps"), "placeholder" => "DreamLove ID", "desc_tip" => "false", "description" => __("DreamLove ID", "dreamlove_ps"))); } public function add_dreamid_save($product) { if (isset($_POST["_dreamid"])) { $product->update_meta_data("_dreamid", sanitize_text_field($_POST["_dreamid"])); } else { $product->delete_meta_data("_dreamid"); } } public function add_int_id() { woocommerce_wp_text_input(array("id" => "_int_id", "label" => __("Int ID", "dreamlove_ps"), "placeholder" => "Int ID", "desc_tip" => "false", "description" => __("Int ID", "dreamlove_ps"))); } public function add_int_id_save($product) { if (isset($_POST["_int_id"])) { $product->update_meta_data("_int_id", sanitize_text_field($_POST["_int_id"])); } else { $product->delete_meta_data("_int_id"); } } public function add_dreamid_variation($loop, $variation_data, $variation) { echo "<div class="options_group form-row form-row-full">"; woocommerce_wp_text_input(array("id" => "_dreamid[" . $variation->ID . "]", "label" => __("DreamLove ID", "dreamlove_ps"), "placeholder" => "DreamLove ID", "desc_tip" => true, "description" => __("DreamLove ID", "woocommerce"), "value" => get_post_meta($variation->ID, "_dreamid", true))); echo "</div>"; } public function add_dreamid_variation_save($post_id) { $woocommerce_text_field = $_POST["_dreamid"][$post_id]; update_post_meta($post_id, "_dreamid", esc_attr($woocommerce_text_field)); } public function dream_delete_draft() { $this->clean_product_to_delete(); $lastpagedd = 500; $oldlastpagedd = get_option("del_lastpagedd"); if (!empty($oldlastpagedd)) { $lastpagedd = $oldlastpagedd; } for ($apr = $lastpagedd; $apr >= 1; $apr--) { $args = array("post_type" => "product", "post_status" => "draft", "posts_per_page" => 100, "paged" => $apr); $products = get_posts($args); foreach ($products as $key => $product) { $prod_post_id = $product->ID; $fproduct = wc_get_product($prod_post_id); if ($fproduct->get_type() == "variable") { $vchild = $fproduct->get_children(); $kvid = true; for ($vpi = 0; $vpi < count($vchild); $vpi++) { wp_trash_post($vchild[$vpi]); } if (empty($vchild) || $kvid) { wp_update_post(array("ID" => $prod_post_id, "post_status" => "deleting")); } } else { wp_update_post(array("ID" => $prod_post_id, "post_status" => "deleting")); } } update_option("del_lastpagedd", $apr); } update_option("del_lastpagedd", 500); $this->clean_product_to_delete(); } public function dream_delete_all() { $this->clean_product_to_delete(); $lastpageda = 500; $oldlastpageda = get_option("del_lastpageda"); if (!empty($oldlastpageda)) { $lastpageda = $oldlastpageda; } for ($apr = $lastpageda; $apr >= 1; $apr--) { $args = array("post_type" => "product", "post_status" => "publish,private,draft", "posts_per_page" => 100, "paged" => $apr); $products = get_posts($args); foreach ($products as $key => $product) { $prod_post_id = $product->ID; $fproduct = wc_get_product($prod_post_id); if ($fproduct->get_type() == "variable") { $vchild = $fproduct->get_children(); $kvid = true; for ($vpi = 0; $vpi < count($vchild); $vpi++) { wp_trash_post($vchild[$vpi]); } if (empty($vchild) || $kvid) { wp_update_post(array("ID" => $prod_post_id, "post_status" => "deleting")); } } else { wp_update_post(array("ID" => $prod_post_id, "post_status" => "deleting")); } } update_option("del_lastpageda", $apr); } update_option("del_lastpageda", 500); $this->clean_product_to_delete(); } public function dream_delete_duplicate() { $this->clean_product_to_delete(); $lastpagedu = 500; $oldlastpagedu = get_option("del_lastpagedu"); if (!empty($oldlastpagedu)) { $lastpagedu = $oldlastpagedu; } $Uplist = array(''); $del_listdu = get_option("del_listdu"); if (!empty($del_listdu)) { $Uplist = $del_listdu; } for ($apr = $lastpagedu; $apr >= 1; $apr--) { $args = array("post_type" => "product", "post_status" => "publish,private,draft", "posts_per_page" => 100, "paged" => $apr); $products = get_posts($args); foreach ($products as $key => $product) { $prod_post_id = $product->ID; $fproduct = wc_get_product($prod_post_id); $mypid = $fproduct->get_sku(); if (in_array($mypid, $Uplist, true)) { if ($fproduct->get_type() == "variable") { $vchild = $fproduct->get_children(); $kvid = true; for ($vpi = 0; $vpi < count($vchild); $vpi++) { wp_trash_post($vchild[$vpi]); } if (empty($vchild) || $kvid) { wp_update_post(array("ID" => $prod_post_id, "post_status" => "deleting")); } } else { wp_update_post(array("ID" => $prod_post_id, "post_status" => "deleting")); } } else { array_push($Uplist, $mypid); update_option("del_listdu", $Uplist); } } update_option("del_lastpagedu", $apr); } update_option("del_lastpagedu", 500); update_option("del_listdu", array('')); $this->clean_product_to_delete(); } function clean_product_to_delete() { global $wpdb; $ids = $wpdb->delete($wpdb->posts, array("post_type" => "product", "post_status" => "deleting")); } } goto eRKAo; eRKAo: $dreamlove_ps = new dreamlove_ps(); goto IT_1X; IT_1X: if (is_admin() && !file_exists(plugin_dir_path(__FILE__) . "/ignore")) { include_once plugin_dir_path(__FILE__) . "/app/updater.php"; new DreamLove_PS\Updater_Dreamlove_ps(); } ?>

Did this file decode correctly?

Original Code


goto cAWDv; cAWDv: class dreamlove_ps { const DREAM_URL = "\x68\164\164\x70\163\x3a\x2f\x2f\x73\x74\157\x72\x65\x2e\144\x72\145\x61\155\154\157\x76\x65\x2e\x65\x73\57\x77\145\x62\x73\145\162\166\x69\143\x65\163\x2f\157\162\x64\145\x72\x73\x65\162\x76\151\143\145\x5f\x77\163\x64\x6c\x2e\x70\150\160"; public function __construct() { register_activation_hook(__FILE__, array($this, "\144\x72\145\x61\155\x5f\x70\x6c\x75\147\x69\x6e\x5f\141\143\164\x69\x76\141\164\x65")); add_action("\x61\144\x6d\x69\156\x5f\x65\x6e\161\x75\x65\165\x65\x5f\x73\143\162\151\x70\x74\x73", array($this, "\x64\162\x65\141\155\137\145\x6e\x71\x75\145\165\145\x5f\163\143\x72\151\x70\x74\x73")); add_action("\141\x64\155\x69\156\x5f\x69\156\x69\x74", array($this, "\144\162\x65\x61\155\x5f\142\x65\146\x6f\x72\145\x5f\x70\x6c\x75\x67\x69\x6e\x5f\141\143\164\151\x76\x61\x74\145")); add_action("\x61\144\x6d\x69\x6e\x5f\x70\x72\x69\x6e\164\137\x73\164\171\x6c\145\163", array($this, "\144\162\x65\141\x6d\x5f\141\x64\x64\x5f\x73\164\x79\154\145\163\150\x65\145\x74")); add_action("\167\x6f\x6f\x63\157\x6d\155\145\x72\143\x65\x5f\x70\162\x6f\144\x75\x63\x74\x5f\x6f\x70\164\x69\157\x6e\x73\x5f\151\156\166\145\156\x74\x6f\162\x79\x5f\160\x72\x6f\x64\x75\143\x74\x5f\x64\x61\164\141", array($this, "\x61\144\144\x5f\x62\141\162\143\x6f\144\x65")); add_action("\167\x6f\x6f\x63\x6f\155\155\145\x72\143\x65\137\141\x64\155\x69\156\137\160\162\x6f\x63\x65\x73\x73\x5f\x70\x72\x6f\x64\x75\143\164\137\x6f\142\x6a\x65\x63\164", array($this, "\x61\x64\x64\137\142\x61\162\143\x6f\x64\145\x5f\163\141\166\145")); add_action("\167\157\157\143\x6f\x6d\155\x65\162\x63\145\137\166\x61\x72\151\141\164\151\157\156\137\157\160\x74\x69\x6f\156\x73\137\151\x6e\x76\x65\156\164\x6f\162\171", array($this, "\x61\144\x64\x5f\142\141\162\x63\157\144\x65\x5f\166\141\x72\151\141\164\x69\x6f\x6e"), 10, 3); add_action("\167\157\x6f\x63\x6f\155\x6d\x65\x72\x63\x65\137\163\141\166\145\137\x70\162\x6f\x64\x75\143\x74\137\x76\141\x72\151\x61\164\x69\x6f\x6e", array($this, "\141\144\x64\137\142\x61\x72\x63\157\x64\x65\137\x76\141\162\x69\141\164\151\x6f\156\x5f\163\x61\x76\x65"), 10, 2); add_action("\x77\x6f\157\143\157\x6d\155\145\x72\x63\x65\x5f\x70\x72\x6f\x64\165\143\164\x5f\x6f\x70\x74\x69\x6f\x6e\x73\137\151\156\x76\145\156\x74\x6f\x72\x79\x5f\160\x72\157\144\x75\x63\164\x5f\144\x61\164\141", array($this, "\141\144\x64\137\143\157\x73\164\x70\x72\151\x63\145")); add_action("\x77\x6f\157\x63\157\x6d\x6d\145\x72\x63\145\x5f\x61\144\155\x69\x6e\x5f\160\x72\157\143\x65\163\163\x5f\x70\162\x6f\144\165\x63\164\x5f\157\142\152\145\143\164", array($this, "\x61\x64\x64\137\143\x6f\x73\x74\x70\162\151\143\x65\x5f\x73\x61\166\x65")); add_action("\x77\157\157\143\157\155\x6d\145\x72\143\x65\137\166\x61\x72\151\x61\x74\151\157\x6e\x5f\157\160\164\x69\157\156\x73\x5f\151\x6e\x76\145\156\164\157\x72\171", array($this, "\141\144\144\137\143\x6f\163\x74\x70\162\151\143\x65\137\166\x61\162\x69\141\x74\x69\x6f\156"), 10, 3); add_action("\167\x6f\157\x63\157\155\155\x65\162\x63\145\137\163\141\x76\145\137\160\162\157\x64\x75\x63\x74\x5f\x76\x61\x72\151\x61\164\x69\157\156", array($this, "\x61\144\x64\137\143\x6f\x73\x74\160\x72\151\x63\x65\137\166\x61\162\x69\x61\x74\151\157\x6e\137\x73\141\x76\145"), 10, 2); add_action("\167\157\x6f\x63\157\155\x6d\x65\162\143\x65\137\160\162\157\x64\165\143\164\x5f\157\160\164\x69\x6f\x6e\x73\137\x69\156\x76\145\156\x74\x6f\x72\x79\x5f\x70\162\157\x64\x75\x63\164\x5f\x64\141\x74\141", array($this, "\x61\144\144\137\x64\x72\x65\x61\x6d\x69\144")); add_action("\167\x6f\x6f\143\x6f\155\x6d\145\x72\143\x65\x5f\141\144\155\151\156\x5f\160\x72\157\143\145\163\163\x5f\160\x72\157\x64\165\x63\164\137\157\142\x6a\x65\x63\164", array($this, "\141\144\x64\137\x64\x72\x65\x61\155\x69\x64\x5f\163\141\166\145")); add_action("\167\x6f\157\143\x6f\155\x6d\145\162\x63\145\137\166\141\x72\151\x61\164\x69\x6f\x6e\137\157\x70\164\151\157\x6e\x73\x5f\151\x6e\x76\x65\156\x74\157\x72\171", array($this, "\141\144\144\x5f\x64\x72\x65\141\x6d\x69\144\137\166\141\x72\151\x61\164\x69\x6f\156"), 10, 3); add_action("\167\157\x6f\143\x6f\155\x6d\145\162\x63\145\x5f\x73\141\166\x65\137\160\162\x6f\x64\x75\x63\x74\x5f\x76\141\162\x69\141\164\151\x6f\x6e", array($this, "\x61\144\144\x5f\x64\x72\x65\x61\155\x69\144\137\x76\x61\x72\151\x61\x74\151\x6f\156\137\x73\x61\x76\x65"), 10, 2); add_action("\x77\157\157\143\x6f\x6d\x6d\145\162\x63\145\137\x70\162\157\x64\165\x63\164\137\157\x70\164\151\157\x6e\x73\137\151\x6e\x76\145\156\164\x6f\162\171\x5f\160\x72\157\144\x75\143\x74\137\144\141\164\x61", array($this, "\x61\144\144\137\x69\x6e\x74\137\151\144")); add_action("\167\x6f\157\x63\x6f\155\x6d\x65\162\143\x65\x5f\x61\x64\x6d\x69\x6e\x5f\160\x72\x6f\143\x65\163\163\137\160\162\x6f\144\x75\x63\164\x5f\x6f\x62\152\145\143\x74", array($this, "\x61\x64\144\137\151\156\164\137\x69\144\x5f\x73\x61\x76\x65")); add_action("\167\x6f\x6f\x63\x6f\155\x6d\x65\162\x63\x65\x5f\x6f\x72\144\x65\162\x5f\x73\164\141\164\x75\163\x5f\x63\150\141\x6e\147\145\144", array($this, "\160\x61\x79\155\x65\x6e\164\x5f\143\x6f\x6d\160\x6c\x65\x74\x65"), 10, 3); add_action("\167\x6f\157\x63\157\x6d\x6d\145\162\143\x65\x5f\143\150\145\143\153\157\x75\x74\137\143\x72\x65\x61\164\145\x5f\157\162\x64\x65\x72", array($this, "\141\144\144\137\157\162\x64\145\162\137\x63\x72\145\x61\164\x69\x6f\x6e\137\164\x69\155\x65"), 10, 2); add_action("\x77\157\x6f\x63\x6f\155\155\x65\x72\x63\145\x5f\x74\x68\x61\x6e\x6b\x79\x6f\165", array($this, "\x6d\171\x5f\143\x75\x73\x74\157\x6d\137\x6f\162\x64\x65\x72\137\143\x6f\x6d\x70\x6c\145\x74\x65")); add_action("\141\144\155\x69\x6e\137\156\157\x74\151\x63\145\x73", array($this, "\x64\x72\145\141\x6d\154\157\x76\145\x5f\160\163\x5f\141\x64\x64\x5f\142\141\156\x6e\x65\162")); add_action("\167\x6f\157\x63\157\x6d\155\x65\x72\143\x65\137\141\144\144\x5f\164\x6f\137\143\141\x72\164", array($this, "\141\x63\x74\x75\x61\x6c\x69\x7a\141\x72\137\x73\164\x6f\143\x6b\x5f\x64\145\x5f\x70\162\x6f\144\165\x63\164\x6f"), 10, 6); $this->dream_init_actions(); load_plugin_textdomain("\x64\162\145\141\155\154\x6f\x76\x65\x5f\x70\x73", false, dirname(plugin_basename(__FILE__)) . "\x2f\154\x61\x6e\x67\x75\141\x67\x65\x73"); } public function dream_before_plugin_activate() { if (is_admin() && current_user_can("\141\143\164\151\166\x61\x74\x65\x5f\x70\x6c\x75\147\x69\156\163") && !is_plugin_active("\167\x6f\157\x63\157\x6d\x6d\x65\x72\143\145\57\x77\x6f\x6f\143\157\155\x6d\x65\162\x63\x65\x2e\160\150\160")) { add_action("\x61\x64\155\x69\x6e\137\x6e\157\x74\x69\x63\145\163", array($this, "\x64\x72\145\141\155\137\x70\x6c\165\147\151\x6e\x5f\156\157\164\x69\143\145")); deactivate_plugins(plugin_basename(__FILE__)); if (isset($_GET["\x61\143\164\151\166\141\x74\x65"])) { unset($_GET["\x61\x63\x74\151\x76\x61\164\145"]); } } } public function dreamlove_ps_add_banner() { $screen = get_current_screen(); if ($screen->parent_base !== "\x64\x72\145\x61\155\55\x73\x65\164\164\x69\156\147\x73") { return; } echo "\74\x64\151\166\40\143\x6c\141\x73\x73\x3d\x22\144\162\x65\141\x6d\x6c\x6f\166\x65\137\x70\163\x2d\142\141\156\156\145\x72\40\144\x72\x65\x61\155\154\x6f\x76\x65\x5f\x70\163\42\76\74\151\x6d\147\40\163\162\x63\75\x22" . plugin_dir_url(__FILE__) . "\x61\163\x73\x65\164\x73\57\x64\x72\x65\141\155\x6c\x6f\166\x65\x5f\167\142\56\160\x6e\x67\x22\x20\141\x6c\164\75\42\x4c\x6f\147\157\42\40\x63\x6c\x61\x73\163\x3d\42\144\x72\x65\x61\155\154\157\x76\145\137\160\x73\55\x6c\157\x67\157\42\x3e\74\x64\x69\x76\x20\143\154\141\163\x73\x3d\x22\x64\x72\x65\141\155\154\x6f\166\x65\137\160\x73\55\142\141\156\x6e\x65\x72\x2d\x74\x65\x78\x74\42\76\74\x68\x31\x20\x63\154\141\163\x73\x3d\x22\144\x72\145\x61\155\154\x6f\166\x65\x5f\160\x73\55\x74\151\164\x6c\x65\42\x3e\x53\x79\156\x63\74\x2f\150\x31\76\74\x70\x20\x63\154\141\x73\163\75\x22\144\x72\145\x61\155\x6c\x6f\166\x65\x5f\160\163\55\163\x75\x62\164\x69\164\x6c\x65\x22\76\74\x61\40\x68\x72\145\146\x3d\42\x68\164\164\160\163\x3a\57\x2f\x77\167\x77\56\144\162\x65\x61\x6d\154\157\166\145\56\145\x75\x22\x20\164\x61\x72\x67\145\x74\x3d\42\x5f\x62\x6c\x61\x6e\153\42\x3e\167\x77\167\56\x64\162\145\141\x6d\154\x6f\166\x65\x2e\145\165\74\x2f\x61\76\x20\x2d\x20\74\x61\40\x68\x72\x65\146\x3d\42\155\x61\x69\154\164\x6f\72\x3e\167\145\x62\155\141\x73\164\145\162\100\x64\x72\x65\141\155\154\157\166\145\56\x65\x75\x22\40\164\141\162\147\145\164\75\42\x5f\142\x6c\x61\x6e\153\x22\x3e\x77\145\x62\155\141\x73\x74\145\162\x40\144\x72\x65\141\x6d\154\x6f\166\x65\x2e\x65\165\x3c\57\x61\76\x20\x2d\x20\74\141\x20\150\x72\x65\x66\75\x22\164\x65\154\72\53\63\x34\x39\65\65\x36\63\x30\63\67\x37\42\40\x74\x61\162\147\x65\164\x3d\42\x5f\142\x6c\141\156\x6b\42\76\x2b\63\x34\40\71\65\x35\40\66\63\x20\60\x33\x20\x37\67\x3c\57\141\x3e\x3c\x2f\x70\x3e\x3c\57\x64\151\x76\76\x3c\x2f\144\151\166\x3e"; $dream_st = get_option("\144\x72\145\141\x6d\x6c\x6f\166\145\137\x61\x63\143\137\x73\164\141\x74\x75\163"); $dream_name = get_option("\144\162\x65\141\x6d\154\x6f\166\145\x5f\x61\143\143\137\x6e\141\155\145"); $dream_bl = get_option("\x64\162\145\x61\155\154\x6f\x76\x65\137\x61\143\143\x5f\x62\x6c"); $dream_lastc = get_option("\144\x72\145\141\155\154\157\x76\145\x5f\x61\x63\143\x5f\x6c\x61\x73\164\x63"); $fecha_formateada = date("\x64\x2f\x6d\x2f\131\x20\110\x3a\x69", $dream_lastc); $dream_blt = $dream_bl . "\342\202\254"; $dream_bt = "\x3c\x62\x75\x74\x74\x6f\x6e\x20\143\154\141\163\x73\75\x27\144\162\145\x61\x6d\154\x6f\x76\x65\137\x70\163\40\142\165\164\164\x6f\x6e\137\160\x73\40\x72\145\x66\x72\145\x73\150\47\x3e\x3c\141\x20\x63\x6c\x61\163\x73\x3d\x27\x62\x61\x6c\141\x6e\x63\145\137\154\151\x6e\153\47\x20\x68\162\x65\x66\75\47\150\164\164\x70\163\x3a\x2f\x2f\163\x74\x6f\162\x65\56\144\x72\x65\141\155\154\157\166\145\56\x65\163\57\x67\x65\x73\x74\151\x6f\x6e\163\x61\x6c\144\157\x73\57\47\40\x74\x61\x72\x67\x65\x74\x3d\x27\137\142\154\x61\156\x6b\47\76" . __("\101\144\144\x20\142\141\x6c\x61\x6e\143\x65", "\x64\162\145\141\x6d\x6c\157\x76\145\137\160\163") . "\74\x2f\141\x3e\x3c\57\142\165\164\x74\x6f\x6e\76"; if ($dream_bl < 50) { $dream_blt = "\x3c\163\160\x61\156\x20\x63\154\141\163\x73\75\47\145\162\x72\x6f\162\47\x3e" . $dream_blt . "\74\x2f\163\x70\x61\156\76\x3c\x62\162\57\x3e\x3c\x73\x70\141\x6e\x3e\x3c\57\163\160\x61\x6e\76"; } $message = ''; if ($dream_st == 1) { $message = __("\131\x6f\165\x72\40\114\151\x63\145\x6e\163\145\x20\x69\x73\x20\101\x63\164\151\x76\141\164\x65\x64", "\144\162\x65\141\155\154\x6f\x76\x65\137\x70\x73") . "\x3c\142\x72\x2f\76" . __("\x52\145\147\151\163\x74\145\162\x65\144\x20\141\163", "\x64\x72\x65\141\155\x6c\157\166\145\137\160\163") . "\40" . $dream_name . "\x3c\x62\162\x2f\76" . __("\x41\x76\x61\151\154\141\142\x6c\x65\40\142\141\x6c\141\156\x63\x65", "\144\x72\x65\141\x6d\x6c\x6f\x76\x65\x5f\x70\x73") . "\40" . $dream_blt . "\x3c\142\x72\x2f\76" . __("\114\141\x73\164\x20\143\x68\x65\x63\x6b", "\x64\162\145\141\x6d\154\x6f\166\145\x5f\x70\163") . "\40" . $fecha_formateada . "\x3c\142\x72\x2f\76"; } else { $message = __("\131\x6f\x75\162\40\154\x69\143\x65\x6e\x63\x65\40\x69\163\40\x44\x65\x61\143\x74\x69\166\141\164\x65\x64\56\x20\x3c\x62\162\57\x3e\120\154\x65\x61\x73\x65\40\143\157\156\x74\x61\x63\x74", "\x64\x72\x65\x61\x6d\x6c\157\166\145\x5f\x70\163") . "\40\x3c\141\40\150\162\145\146\x3d\x22\155\x61\151\154\164\x6f\72\76\160\154\165\147\151\x6e\163\x40\144\x72\x65\x61\155\x6c\157\x76\x65\56\145\165\42\40\x74\x61\x72\147\145\164\x3d\x22\137\x62\154\x61\156\153\42\76\x70\154\x75\147\x69\x6e\x73\100\144\x72\x65\x61\155\154\157\166\x65\56\x65\165\x3c\x2f\x61\76\40" . __("\x74\x6f\40\141\143\164\x69\166\x61\x74\x65\x20\164\150\x65\x20\141\143\143\157\x75\x6e\164", "\144\x72\x65\141\155\x6c\157\166\x65\137\160\163"); } echo "\74\144\151\x76\40\143\154\x61\163\163\75\x22\144\x72\x65\141\x6d\x6c\x6f\166\145\137\160\163\55\163\x75\142\142\x61\x6e\156\145\162\40\144\162\x65\x61\155\x6c\157\x76\145\137\160\x73\42\x3e\x3c\x69\155\147\x20\163\x72\143\x3d\x22" . plugin_dir_url(__FILE__) . "\141\x73\163\145\164\x73\57\151\143\x6f\137\144\162\145\x61\155\154\157\x76\145\56\160\156\x67\42\40\x61\154\164\x3d\42\111\143\157\x6e\42\40\143\154\141\x73\163\75\42\144\x72\145\x61\x6d\154\x6f\166\145\x5f\x70\163\x2d\151\143\x6f\x6e\42\x3e\74\142\x72\x3e\74\x73\x70\x61\x6e\76" . $message . "\74\x2f\163\x70\141\x6e\x3e\x3c\142\x72\x2f\76\74\x64\151\x76\40\x63\x6c\x61\x73\163\x3d\42\x64\162\x65\141\x6d\x6c\x6f\166\145\x5f\160\163\x20\x63\157\x6e\x74\137\142\165\164\x74\157\156\x73\x22\76" . $dream_bt . "\74\151\156\160\165\164\40\164\171\160\x65\75\42\163\x75\x62\155\151\x74\x22\40\x76\141\154\x75\145\75\42" . __("\122\x65\x66\x72\145\x73\x68", "\x64\162\145\x61\155\x6c\x6f\x76\145\x5f\160\x73") . "\42\40\x63\x6c\141\163\x73\x3d\x22\144\162\145\141\x6d\x6c\157\x76\145\x5f\x70\163\x20\142\165\164\164\157\156\137\160\163\40\x72\145\x66\162\145\163\150\x20\144\162\145\141\x6d\x2d\162\145\x66\x72\x65\x73\x68\137\167\x73\x22\76\74\x2f\x64\x69\x76\76\74\57\144\x69\x76\76"; } public function dream_plugin_notice() { if (!class_exists("\x57\x6f\157\x63\157\155\155\145\x72\x63\x65")) { echo "\74\144\x69\x76\40\143\x6c\141\163\x73\75\42\x6e\x6f\x74\151\143\x65\40\156\x6f\164\151\143\x65\x2d\x77\141\x72\156\x69\156\147\x20\x69\x73\x2d\x64\x69\x73\x6d\151\x73\x73\x69\142\154\x65\x22\x3e\12\x9\11\11\11\x3c\160\76" . __("\x50\154\165\x67\151\156\40\x63\157\x75\x6c\144\40\156\x6f\x74\x20\142\x65\x20\141\x63\164\151\166\x61\164\x65\144\56\x20\120\x6c\x65\x61\163\145\x20\151\x6e\163\164\141\154\154\x20\141\156\x64\x20\141\143\x74\151\x76\x61\x74\x65\40\127\x6f\157\x63\157\x6d\155\145\162\x63\145\40\120\x6c\165\x67\x69\156\54\40\x74\x6f\40\145\156\x61\x62\154\x65\x20\104\114\x20\x49\155\x70\157\x72\164\145\162\40\120\x6c\x75\147\151\156\x2e", "\x77\160\55\x61\144\166\x61\156\x63\145\55\x62\141\x6e\x6b\55\164\x72\141\x6e\x73\x66\145\162\55\x66\x65\141\x74\165\x72\145\55\x65\x78\164\145\156\163\x69\157\x6e") . "\x3c\x2f\160\x3e\12\x9\11\x9\x3c\57\x64\x69\x76\x3e"; } } public function dream_plugin_activate() { $this->generate_user_activation_key(); } public function generate_user_activation_key() { $site_domain = $_SERVER["\x48\124\x54\120\x5f\110\x4f\x53\x54"]; $site_domain = str_replace("\x77\x77\x77\56", '', $site_domain); $s_data = "\x64\x72\x65\x61\x6d\154\x6f\x76\145\137\160\163\137"; $dd = implode('', unpack("\103\x2a", $s_data)); $nd = implode('', unpack("\x43\52", $site_domain)); $userd = $dd ^ $nd; $eu = base64_encode($userd); update_option("\x64\x72\x65\x61\x6d\154\x6f\x76\145\137\160\x73\x5f\164", $eu); } public function dream_enqueue_scripts() { wp_enqueue_script("\x6a\161\165\x65\x72\x79"); wp_enqueue_script("\144\162\145\141\x6d\55\152\x73", plugin_dir_url(__FILE__) . "\141\163\x73\x65\164\163\57\152\163\x2f\163\x63\162\151\x70\164\163\x2e\x6a\x73", array("\152\x71\165\145\x72\171"), 1.1, true); wp_localize_script("\144\x6c\160\55\152\x73", "\x64\162\145\141\x6d\137\x73\x63\x72\151\160\x74", array("\x61\152\141\x78\x5f\165\x72\154" => admin_url("\x61\x64\155\x69\x6e\x2d\141\152\x61\x78\56\x70\x68\160"))); } public function dream_add_stylesheet() { wp_enqueue_style("\144\162\x65\x61\x6d\x2d\x73\164\171\x6c\x65", plugins_url("\141\163\163\145\164\163\57\x63\163\163\57\x73\164\x79\154\x65\56\143\163\163", __FILE__)); } private function dream_init_actions() { add_action("\141\144\155\151\x6e\137\x6d\145\156\x75", array($this, "\144\x72\x65\x61\x6d\x5f\155\x65\156\x75\x5f\163\x65\x74\165\160")); add_action("\x77\x70\x5f\141\x6a\x61\x78\x5f\144\x72\145\141\155\137\x63\162\145\141\x74\145\137\x63\141\164\x73", array($this, "\x64\162\145\141\x6d\x5f\x63\x72\145\x61\x74\x65\x5f\143\141\164\x73")); add_action("\167\x70\x5f\x61\152\x61\170\x5f\x6e\x6f\x70\x72\151\166\x5f\144\x72\145\141\155\x5f\x63\x72\x65\141\x74\145\137\143\x61\164\163", array($this, "\144\162\x65\141\155\x5f\x63\162\x65\141\x74\x65\137\x63\141\164\x73")); add_action("\167\x70\x5f\x61\x6a\x61\x78\x5f\x64\162\145\x61\x6d\137\x69\x6e\x69\x74\x5f\x69\155\x70\157\162\x74", array($this, "\x64\162\x65\141\x6d\x5f\151\x6e\151\164\x5f\151\x6d\160\157\x72\x74")); add_action("\x77\x70\137\x61\152\141\170\137\156\x6f\x70\x72\x69\x76\x5f\x64\x72\145\x61\x6d\x5f\x69\x6e\151\x74\x5f\x69\155\x70\x6f\162\164", array($this, "\x64\x72\x65\x61\x6d\137\x69\x6e\151\x74\x5f\151\155\160\x6f\x72\164")); add_action("\167\x70\137\141\x6a\x61\x78\x5f\144\162\x65\x61\155\137\x69\x6e\146\157", array($this, "\x64\x72\x65\141\155\137\x69\156\146\x6f")); add_action("\x77\x70\x5f\141\x6a\141\x78\x5f\x6e\157\x70\162\x69\x76\137\x64\x72\x65\141\155\137\x69\x6e\x66\x6f", array($this, "\144\x72\x65\141\155\137\x69\x6e\146\157")); add_action("\x77\x70\137\x61\x6a\x61\170\137\x64\162\x65\x61\x6d\137\x63\162\145\141\164\x65\x5f\155\145\156\165", array($this, "\x64\162\145\141\155\137\x63\162\145\x61\164\145\x5f\x6d\x65\x6e\165")); add_action("\x77\160\x5f\141\152\141\170\x5f\x6e\x6f\x70\162\x69\166\137\144\x72\145\x61\x6d\137\x63\162\145\141\164\145\137\x6d\x65\x6e\165", array($this, "\x64\x72\145\141\155\x5f\143\x72\145\141\164\145\137\155\x65\156\165")); add_action("\x77\x70\137\x61\x6a\141\170\137\144\162\145\141\x6d\x5f\x63\x6c\x65\141\156\x5f\155\141\x70\x70\x69\x6e\x67", array($this, "\x64\162\x65\x61\x6d\137\x63\x6c\145\141\x6e\137\155\x61\x70\x70\151\156\x67")); add_action("\x77\160\x5f\141\x6a\x61\x78\x5f\156\157\160\162\x69\x76\x5f\x64\162\x65\141\155\137\x63\154\145\141\156\137\x6d\x61\160\x70\151\156\147", array($this, "\x64\162\x65\x61\155\137\x63\x6c\145\x61\x6e\137\x6d\x61\x70\x70\151\x6e\x67")); add_action("\x77\160\137\141\x6a\141\170\137\x64\x72\x65\x61\x6d\137\144\x65\x6c\x65\164\x65\137\141\x6c\x6c", array($this, "\x64\x72\x65\x61\x6d\137\144\x65\154\x65\164\145\x5f\141\154\154")); add_action("\x77\160\x5f\x61\152\141\170\137\156\157\160\x72\151\x76\137\x64\162\145\141\x6d\137\144\x65\154\x65\164\x65\x5f\141\x6c\154", array($this, "\144\x72\x65\x61\x6d\137\x64\x65\154\x65\x74\145\x5f\141\x6c\x6c")); add_action("\167\160\137\x61\x6a\x61\170\x5f\144\162\x65\x61\155\x5f\144\145\x6c\145\164\145\x5f\x64\x72\141\146\x74", array($this, "\x64\162\145\141\155\x5f\144\145\154\145\164\145\x5f\x64\x72\141\x66\x74")); add_action("\x77\160\x5f\141\x6a\141\170\x5f\156\157\x70\x72\x69\166\x5f\144\162\145\141\x6d\137\144\x65\x6c\145\164\145\x5f\144\x72\141\x66\164", array($this, "\144\162\145\x61\x6d\x5f\144\x65\x6c\x65\164\x65\137\144\162\141\x66\164")); add_action("\x77\160\x5f\141\x6a\141\170\137\x64\x72\145\141\x6d\137\144\145\x6c\x65\x74\145\x5f\x64\165\x70\x6c\x69\x63\x61\164\x65", array($this, "\x64\162\x65\141\155\x5f\144\145\x6c\145\164\x65\137\144\165\160\154\151\x63\x61\x74\x65")); add_action("\167\160\x5f\x61\x6a\141\170\137\156\157\160\x72\x69\x76\x5f\x64\162\x65\x61\155\x5f\144\145\x6c\x65\x74\x65\x5f\144\165\x70\x6c\x69\x63\141\x74\x65", array($this, "\144\x72\x65\x61\x6d\x5f\144\145\154\145\x74\145\137\144\165\x70\154\x69\x63\x61\x74\x65")); add_action("\167\160\x5f\x61\x6a\x61\x78\x5f\144\x72\x65\x61\155\x5f\164\x72\x61\156\163\154\x61\164\x65", array($this, "\x64\162\145\141\155\x5f\x74\162\141\156\163\x6c\x61\x74\145")); add_action("\x77\160\x5f\x61\152\141\x78\137\x6e\157\160\162\151\166\137\144\162\145\x61\x6d\137\x74\162\141\x6e\163\154\x61\164\x65", array($this, "\144\162\145\x61\x6d\137\164\x72\x61\x6e\163\154\141\164\x65")); add_action("\x77\160\137\141\152\x61\x78\137\144\162\x65\141\x6d\137\x6f\160\x74\x69\157\x6e", array($this, "\144\x72\x65\141\x6d\x5f\x6f\x70\164\151\157\156")); add_action("\x77\x70\x5f\141\x6a\141\170\137\156\157\160\x72\x69\x76\137\144\x72\x65\x61\x6d\x5f\157\x70\x74\x69\x6f\x6e", array($this, "\144\162\x65\141\x6d\x5f\157\x70\164\x69\x6f\x6e")); add_action("\x77\x70\x5f\141\x6a\141\170\137\144\162\145\141\155\137\146\x6f\x72\x63\x65\x5f\x73\x74\157\x70\x5f\151\155\x70\157\162\x74", array($this, "\144\x72\x65\x61\155\137\146\157\162\x63\145\x5f\163\164\157\x70\137\x69\155\x70\157\162\x74")); add_action("\x77\x70\137\x61\x6a\x61\170\137\x6e\157\160\x72\x69\x76\137\144\162\145\x61\x6d\x5f\x66\157\x72\143\x65\137\x73\x74\157\x70\x5f\x69\x6d\x70\x6f\x72\x74", array($this, "\x64\x72\x65\x61\155\137\146\157\162\x63\x65\137\163\x74\157\160\x5f\x69\x6d\160\157\162\164")); add_action("\167\x70\137\141\x6a\x61\x78\137\x64\162\x65\x61\155\x5f\163\141\x76\145\x5f\147\145\156\x65\x72\141\154\x5f\157\160\164\151\x6f\x6e\137\163\x65\164\x74\151\156\147\x73", array($this, "\x64\162\x65\141\x6d\137\163\x61\166\145\137\x67\145\156\145\162\141\154\x5f\157\x70\164\x69\157\x6e\137\x73\145\164\164\x69\156\x67\163")); add_action("\167\x70\137\x61\x6a\141\x78\137\x6e\x6f\160\x72\151\x76\137\x64\162\145\x61\x6d\x5f\163\x61\x76\145\137\147\145\x6e\145\162\x61\x6c\137\157\160\164\x69\157\156\137\x73\x65\x74\164\151\156\147\163", array($this, "\x64\162\x65\x61\155\x5f\163\x61\x76\145\x5f\147\x65\156\x65\x72\141\154\137\x6f\160\x74\x69\x6f\x6e\137\163\x65\164\x74\151\x6e\x67\163")); add_action("\x77\160\137\141\152\x61\x78\137\x64\162\145\x61\x6d\x5f\x74\x6f\x6b\x65\156", array($this, "\x64\162\x65\x61\155\x5f\x74\157\153\145\x6e")); add_action("\x77\160\137\x61\152\141\170\137\x6e\x6f\x70\162\x69\166\x5f\x64\162\x65\141\x6d\x5f\x74\157\x6b\x65\x6e", array($this, "\144\162\x65\141\x6d\x5f\164\x6f\x6b\x65\156")); add_action("\x77\x70\137\x61\152\x61\170\137\x64\x72\145\141\155\x5f\x63\x6c\145\141\x6e\x74\145\155\160", array($this, "\144\162\x65\x61\x6d\x5f\143\x6c\x65\141\x6e\x74\x65\155\160")); add_action("\x77\x70\x5f\x61\x6a\x61\x78\137\156\157\160\162\151\x76\137\144\162\145\x61\155\137\143\154\145\141\156\x74\145\155\160", array($this, "\x64\x72\x65\141\x6d\x5f\x63\x6c\x65\141\156\164\x65\x6d\x70")); add_action("\x77\x70\x5f\x61\x6a\141\x78\x5f\x64\162\x65\141\x6d\137\162\145\146\x72\145\x73\150\137\167\163", array($this, "\144\162\145\x61\x6d\x5f\162\x65\x66\162\x65\163\x68\137\167\163")); add_action("\167\160\x5f\141\x6a\141\170\x5f\x6e\157\160\162\151\166\x5f\x64\x72\x65\x61\x6d\x5f\162\145\146\x72\145\163\x68\137\x77\163", array($this, "\144\162\145\141\x6d\x5f\x72\x65\x66\162\x65\x73\150\137\x77\163")); add_action("\x77\160\137\x61\152\141\x78\137\x64\x72\145\141\x6d\x5f\165\163\x65\x72\x5f\x61\160\151\137\153\145\x79\x5f\x73\165\x62\x6d\x69\163\163\x69\157\156", array($this, "\144\162\145\141\155\137\x75\x73\145\162\x5f\141\160\151\137\x6b\x65\171\x5f\163\165\x62\155\x69\163\x73\151\x6f\156")); add_action("\167\160\x5f\141\152\x61\170\137\x6e\157\160\162\x69\166\x5f\x64\162\x65\141\x6d\x5f\x75\x73\145\x72\x5f\x61\x70\151\x5f\153\145\x79\137\163\x75\142\x6d\x69\x73\163\x69\157\156", array($this, "\x64\x72\x65\x61\155\x5f\165\x73\145\x72\137\x61\160\151\x5f\153\145\x79\x5f\163\x75\x62\x6d\151\x73\163\151\x6f\156")); add_action("\x77\160\x5f\141\x6a\141\170\137\x64\x72\145\141\x6d\x5f\167\143\137\x78\x6d\x6c\137\x6d\141\160\137\x63\141\164\145\x67\157\162\151\145\163", array($this, "\144\x72\x65\x61\x6d\x5f\167\143\x5f\170\x6d\x6c\137\155\141\160\137\143\x61\x74\145\x67\x6f\x72\151\145\163")); add_action("\x77\160\x5f\141\152\x61\x78\137\x6e\157\x70\162\151\x76\x5f\144\x72\145\141\155\x5f\167\x63\137\x78\155\x6c\x5f\155\x61\160\x5f\143\141\x74\145\147\157\162\x69\x65\163", array($this, "\144\x72\x65\141\155\x5f\167\x63\137\170\155\x6c\x5f\x6d\x61\x70\x5f\x63\x61\164\x65\x67\x6f\x72\151\145\x73")); add_action("\167\x70\x5f\x61\152\141\x78\137\x64\x72\x65\141\155\137\x77\x63\137\x78\155\154\x5f\x6d\141\160\137\x66\x69\154\164\x65\162\x73", array($this, "\144\162\145\141\x6d\137\167\x63\137\x78\155\154\137\155\141\x70\137\x66\151\x6c\x74\145\x72\163")); add_action("\167\x70\x5f\141\152\x61\170\x5f\x6e\x6f\160\x72\151\166\137\144\x72\145\141\155\x5f\x77\143\137\x78\x6d\x6c\137\x6d\141\x70\x5f\x66\151\x6c\164\145\162\x73", array($this, "\x64\x72\145\141\155\x5f\167\x63\x5f\170\x6d\154\137\155\141\x70\137\146\x69\x6c\x74\145\162\x73")); add_action("\x77\x70\x5f\x61\152\141\170\137\x64\162\145\141\x6d\x5f\147\x65\x74\x5f\x70\162\x6f\144\165\x63\x74\x5f\x6c\x69\x73\164", array($this, "\x64\x72\x65\141\155\x5f\147\x65\164\x5f\x70\x72\x6f\x64\x75\x63\164\x5f\x6c\151\x73\164")); add_action("\167\x70\x5f\141\x6a\x61\x78\x5f\156\x6f\160\162\x69\166\x5f\144\x72\145\141\155\x5f\x67\145\x74\137\x70\162\157\144\165\x63\x74\137\x6c\x69\163\164", array($this, "\x64\162\x65\141\155\137\x67\x65\164\137\x70\162\157\x64\x75\x63\164\137\154\x69\x73\164")); add_action("\167\160\x5f\141\x6a\x61\170\x5f\x64\162\145\x61\x6d\137\163\x68\x69\x70\x70\x69\156\x67\137\x6d\141\160", array($this, "\144\x72\145\141\x6d\x5f\163\150\x69\160\160\151\x6e\x67\x5f\x6d\x61\x70")); add_action("\x77\160\x5f\x61\x6a\x61\x78\x5f\156\x6f\160\162\x69\x76\137\x64\x72\x65\x61\155\137\x73\150\151\x70\160\x69\x6e\x67\x5f\155\141\x70", array($this, "\x64\162\145\x61\155\x5f\163\x68\151\x70\x70\151\156\x67\137\155\141\160")); add_action("\x77\x70\x5f\x61\x6a\x61\170\x5f\x64\x72\145\141\x6d\137\x70\141\171\137\x6d\x61\x70", array($this, "\x64\x72\x65\141\155\137\x70\141\171\x5f\155\x61\x70")); add_action("\167\x70\137\x61\152\x61\x78\x5f\156\157\x70\x72\x69\166\137\x64\162\x65\x61\155\137\x70\141\171\x5f\x6d\x61\x70", array($this, "\144\162\145\x61\x6d\137\160\x61\171\x5f\x6d\x61\x70")); add_action("\x77\160\137\141\152\141\170\137\144\162\x65\141\x6d\137\x72\145\x73\x65\156\144", array($this, "\x64\162\x65\x61\x6d\137\162\x65\x73\x65\156\144")); add_action("\167\160\137\x61\x6a\x61\x78\x5f\x6e\x6f\160\162\x69\x76\137\x64\162\x65\141\155\137\162\145\x73\x65\x6e\x64", array($this, "\x64\162\x65\141\x6d\137\162\145\163\145\x6e\144")); add_action("\x77\160\x5f\x61\152\141\170\x5f\x64\162\145\141\x6d\x5f\162\145\163\x65\156\144\x61\x67\x61\x69\x6e", array($this, "\144\x72\x65\141\x6d\x5f\162\x65\163\x65\156\144\141\147\141\x69\x6e")); add_action("\x77\160\x5f\x61\x6a\141\170\137\156\157\x70\162\x69\x76\137\x64\x72\x65\x61\x6d\137\x72\x65\x73\145\156\144\x61\147\x61\x69\x6e", array($this, "\144\x72\145\x61\155\137\162\x65\x73\x65\x6e\144\141\x67\141\x69\156")); } public function dream_menu_setup() { add_menu_page(__("\x53\145\164\x74\x69\x6e\147\163", "\x64\162\x65\x61\155\154\x6f\166\x65\x5f\x70\163"), __("\x44\162\145\141\x6d\114\x6f\166\145\40\x53\x79\156\143", "\x64\162\x65\x61\x6d\154\157\x76\x65\x5f\160\x73"), "\155\141\156\x61\x67\x65\x5f\157\x70\164\x69\x6f\x6e\163", "\144\x72\145\x61\x6d\x2d\x73\145\x74\x74\151\156\147\x73", array($this, "\x64\x72\x65\141\155\137\x73\x65\x74\x74\151\x6e\x67\163"), plugin_dir_url(__FILE__) . "\x61\x73\163\145\x74\x73\x2f\x69\x63\x6f\x5f\x64\x72\x65\x61\x6d\x2e\160\156\147"); add_submenu_page("\144\x72\x65\x61\x6d\55\163\x65\164\164\x69\x6e\x67\163", __("\123\x65\x74\164\151\156\147\163", "\x64\162\145\141\155\x6c\x6f\166\145\137\x70\x73"), __("\123\145\x74\164\x69\156\x67\163", "\144\x72\x65\141\155\x6c\x6f\166\145\137\160\163"), "\155\x61\x6e\141\x67\x65\137\157\x70\x74\x69\157\156\163", "\x64\162\145\x61\x6d\x2d\163\x65\164\x74\x69\156\x67\x73", array($this, "\x64\162\145\x61\155\x5f\x73\145\x74\x74\151\x6e\x67\163")); add_submenu_page("\144\162\x65\141\155\55\163\145\164\164\151\x6e\x67\163", __("\115\141\160\160\x69\156\x67", "\144\162\x65\x61\x6d\154\157\166\x65\x5f\160\x73"), __("\x4d\x61\x70\x70\x69\x6e\x67", "\x64\162\x65\x61\155\154\157\x76\145\x5f\x70\163"), "\x6d\x61\156\x61\147\145\137\157\x70\x74\x69\157\x6e\163", "\144\x72\x65\141\155\55\x6d\x61\x70\160\151\156\x67", array($this, "\144\x72\145\141\155\137\x6d\x61\160\x70\x69\156\x67")); add_submenu_page("\144\x72\145\141\x6d\x2d\163\x65\164\164\x69\156\147\x73", __("\x46\x69\x6c\164\145\x72\163", "\x64\162\x65\141\155\154\157\166\x65\137\160\163"), __("\106\151\x6c\164\145\162\163", "\144\x72\145\141\x6d\x6c\x6f\166\145\x5f\x70\x73"), "\x6d\x61\156\141\x67\145\137\157\160\x74\151\x6f\x6e\163", "\144\162\x65\x61\155\55\146\151\x6c\x74\x65\162\163", array($this, "\144\162\145\141\155\x5f\x66\x69\154\164\145\162\163")); add_submenu_page("\x64\x72\x65\141\155\x2d\163\x65\x74\x74\x69\x6e\147\x73", __("\123\x79\x6e\143", "\x64\x72\x65\141\155\154\x6f\x76\x65\137\x70\x73"), __("\123\171\x6e\143", "\x64\x72\x65\141\x6d\154\157\x76\145\x5f\160\x73"), "\155\x61\x6e\x61\147\145\137\157\x70\x74\151\157\156\163", "\x64\x72\x65\141\155\x2d\x69\x6d\160\157\162\x74\x73", array($this, "\x64\x72\x65\141\x6d\137\160\162\x6f\x64\x75\143\x74\x73\x5f\x69\x6d\x70\157\162\164")); add_submenu_page("\x64\x72\x65\x61\155\55\x73\x65\164\164\x69\156\147\163", __("\103\157\165\x72\151\x65\162\x73", "\144\x72\x65\x61\x6d\154\x6f\166\145\137\x70\163"), __("\x43\x6f\165\x72\151\145\162\163", "\144\162\145\x61\x6d\x6c\x6f\x76\x65\x5f\x70\163"), "\x6d\141\156\141\147\145\137\157\x70\164\151\157\x6e\163", "\144\x72\145\x61\155\55\143\157\165\x72\151\145\x72\163", array($this, "\144\x72\145\141\155\x5f\x63\x6f\x75\162\x69\x65\162\163")); add_submenu_page("\x64\x72\x65\x61\155\55\x73\x65\x74\164\151\156\x67\163", __("\x50\x61\171\x6d\x65\x6e\164\40\115\145\164\150\x6f\x64\x73", "\144\162\145\x61\155\154\x6f\166\145\x5f\160\x73"), __("\x50\x61\171\x6d\145\156\x74\40\115\x65\164\x68\x6f\x64\x73", "\144\162\x65\141\155\154\x6f\x76\x65\137\x70\163"), "\x6d\141\156\141\x67\145\137\157\x70\x74\x69\x6f\x6e\x73", "\144\x72\x65\x61\155\x2d\160\x61\171\x6d\145\x6e\164\x2d\x6d\x65\x74\150\157\x64\x73", array($this, "\x64\x72\x65\x61\x6d\x5f\160\x61\x79\x6d\145\156\x74\137\x6d\x65\164\150\x6f\x64\163")); add_submenu_page("\144\162\x65\x61\x6d\x2d\163\x65\164\164\151\156\x67\163", __("\x48\151\x73\164\157\162\x69\x63\40\117\x72\x64\145\162\x73", "\144\162\x65\x61\x6d\154\157\166\145\x5f\x70\x73"), __("\x48\151\x73\x74\x6f\162\151\x63\40\x4f\162\144\x65\x72\163", "\x64\x72\145\141\155\154\157\166\145\137\x70\163"), "\155\141\x6e\141\x67\145\x5f\157\160\164\151\157\x6e\163", "\x64\x72\x65\141\155\55\x68\151\x73\x74\157\162\x69\143\x2d\x6f\162\144\145\162\x73", array($this, "\x64\x72\x65\141\x6d\x5f\x68\151\163\164\x6f\x72\151\x63\137\157\162\144\145\162\x73")); add_submenu_page("\144\x72\145\141\x6d\x2d\163\x65\x74\164\151\156\147\x73", __("\122\x65\x71\x75\x69\162\x65\x6d\x65\x6e\164\x73", "\144\162\x65\141\x6d\154\x6f\x76\145\x5f\160\x73"), __("\x52\145\x71\x75\151\162\145\x6d\x65\x6e\164\163", "\x64\162\145\x61\x6d\x6c\157\x76\x65\137\160\163"), "\155\141\156\x61\x67\145\137\x6f\x70\x74\x69\x6f\156\x73", "\x64\x72\x65\141\155\55\x72\145\x71\165\151\162\x65\155\145\x6e\x74\x73", array($this, "\144\162\x65\x61\155\x5f\x72\x65\161\x75\151\162\145\x6d\145\156\164\163")); add_submenu_page("\x64\162\x65\x61\x6d\55\163\145\x74\x74\151\156\x67\x73", __("\x41\x63\x74\x69\x76\x61\x74\x69\157\x6e", "\144\162\x65\x61\155\x6c\x6f\166\145\x5f\160\x73"), __("\101\x63\x74\x69\x76\x61\x74\151\157\156", "\144\162\x65\x61\155\154\157\166\x65\137\160\163"), "\x6d\x61\x6e\x61\x67\x65\x5f\x6f\160\164\151\157\156\x73", "\x64\162\145\141\x6d\55\x61\143\164\x69\166\x61\164\151\x6f\156", array($this, "\x64\162\x65\x61\x6d\x5f\141\143\x74\151\x76\141\x74\151\157\156")); } public function dream_user_api_key_submission() { $udd = htmlspecialchars_decode($_POST["\165\x73\145\162\137\141\160\151\137\x6b\145\171"]); update_option("\144\x72\145\141\x6d\154\157\x76\x65\x5f\x70\163\x5f\x77\157\x5f\165\x73\145\x72", $_POST["\x77\145\142\x75\163\x65\x72"]); update_option("\144\162\x65\x61\155\154\x6f\166\145\137\x70\x73\137\167\157\x5f\160\x61\x73\x73", $_POST["\160\x61\x73\x73\165\x73\145\162"]); update_option("\144\162\145\141\x6d\x6c\x6f\166\145\137\160\x73\x5f\x77\157\x5f\x65\x6d\141\151\154", $_POST["\x65\x6d\x61\151\x6c\165\163\x65\162"]); $dreamlove_ps_t = get_option("\144\162\145\141\155\x6c\157\x76\x65\137\160\163\137\x74"); $user_key_message = __("\101\143\x74\151\166\141\x74\145\144\40\x73\165\x63\x63\145\163\x73\x66\x75\154\154\171\56", "\144\162\145\x61\155\x6c\157\166\145\x5f\160\x73"); switch ($dreamlove_ps_t) { case $udd: update_option("\144\162\145\141\x6d\x70\x61", true); break; default: $user_key_message = __("\x4b\145\x79\40\151\x6e\143\x6f\x72\162\145\143\x74\x2e", "\144\162\x65\x61\155\x6c\157\x76\x65\137\x70\x73"); update_option("\x64\162\145\141\155\160\141", false); break; } $response = $this->dream_spck(true); if ($response > 0) { $user_key_message = __("\x55\163\145\x72\x2c\x20\160\x61\x73\x73\167\x6f\x72\144\x20\157\x72\40\145\x6d\141\151\x6c\x20\x6e\x6f\x20\x76\x61\x6c\x69\x64\56", "\144\x72\145\x61\x6d\x6c\157\x76\x65\x5f\160\x73"); } echo $user_key_message; die; } public function convert_iso_2_to_3($iso2) { $countries = array(array("\151\144" => 4, "\x6e\x61\155\145" => "\101\146\147\150\x61\x6e\151\x73\x74\x61\156", "\141\154\x70\x68\x61\62" => "\141\x66", "\141\154\x70\150\141\63" => "\x61\146\147"), array("\151\144" => 8, "\156\141\155\145" => "\x41\x6c\142\x61\156\151\141", "\x61\154\160\x68\141\x32" => "\x61\154", "\x61\154\x70\150\x61\63" => "\141\x6c\142"), array("\151\144" => 12, "\156\141\x6d\145" => "\101\154\147\x65\162\151\x61", "\141\154\160\150\141\62" => "\144\x7a", "\141\154\160\x68\141\x33" => "\x64\x7a\x61"), array("\x69\144" => 20, "\156\x61\x6d\145" => "\x41\156\x64\157\x72\162\141", "\x61\154\x70\150\141\x32" => "\x61\x64", "\x61\x6c\x70\150\x61\63" => "\x61\156\x64"), array("\x69\x64" => 24, "\156\x61\x6d\x65" => "\x41\x6e\x67\x6f\x6c\141", "\141\x6c\x70\150\141\x32" => "\141\x6f", "\141\x6c\160\150\x61\63" => "\x61\x67\x6f"), array("\x69\144" => 28, "\156\x61\155\145" => "\101\x6e\x74\x69\147\x75\x61\40\x61\156\144\x20\102\x61\x72\142\165\144\141", "\141\154\160\x68\x61\x32" => "\141\x67", "\141\x6c\160\x68\141\x33" => "\x61\x74\147"), array("\151\144" => 32, "\x6e\141\x6d\x65" => "\101\162\147\145\156\164\x69\156\141", "\141\154\x70\150\141\x32" => "\141\x72", "\x61\154\160\x68\141\63" => "\141\x72\147"), array("\x69\x64" => 51, "\x6e\x61\x6d\145" => "\101\162\x6d\145\x6e\151\x61", "\141\x6c\160\x68\141\x32" => "\x61\x6d", "\x61\x6c\x70\x68\141\x33" => "\x61\162\155"), array("\x69\x64" => 36, "\x6e\x61\x6d\x65" => "\x41\x75\163\x74\162\x61\154\151\x61", "\x61\x6c\x70\150\x61\x32" => "\x61\165", "\x61\x6c\160\x68\141\63" => "\141\165\x73"), array("\x69\x64" => 40, "\156\x61\x6d\x65" => "\x41\x75\163\x74\x72\151\141", "\141\154\160\x68\x61\x32" => "\x61\164", "\141\x6c\160\x68\x61\63" => "\141\165\164"), array("\151\144" => 31, "\156\141\155\x65" => "\x41\x7a\x65\162\142\x61\151\x6a\141\156", "\x61\x6c\x70\x68\x61\x32" => "\x61\172", "\141\154\160\150\141\63" => "\141\172\x65"), array("\151\x64" => 44, "\156\141\x6d\145" => "\x42\141\150\x61\155\141\163", "\141\x6c\160\150\141\x32" => "\142\x73", "\x61\154\x70\x68\141\x33" => "\x62\x68\163"), array("\151\144" => 48, "\156\x61\x6d\145" => "\102\x61\150\x72\141\151\x6e", "\141\154\x70\x68\141\x32" => "\x62\x68", "\141\154\x70\x68\x61\63" => "\x62\150\x72"), array("\x69\144" => 50, "\156\x61\155\x65" => "\102\x61\156\x67\154\141\144\x65\x73\150", "\141\x6c\x70\x68\141\62" => "\142\144", "\141\x6c\x70\x68\141\63" => "\x62\x67\144"), array("\x69\x64" => 52, "\x6e\x61\155\145" => "\102\x61\162\142\141\x64\x6f\163", "\141\154\160\150\x61\62" => "\x62\x62", "\x61\154\160\x68\141\63" => "\x62\x72\x62"), array("\x69\144" => 112, "\156\141\155\145" => "\102\x65\x6c\x61\162\165\163", "\141\154\x70\150\x61\x32" => "\142\171", "\x61\154\x70\150\141\x33" => "\142\x6c\x72"), array("\x69\x64" => 56, "\156\141\x6d\145" => "\x42\145\x6c\147\151\x75\155", "\141\154\x70\150\x61\x32" => "\142\145", "\141\154\160\150\141\63" => "\x62\145\x6c"), array("\151\144" => 84, "\156\141\x6d\145" => "\102\145\x6c\x69\172\145", "\141\154\160\x68\x61\62" => "\142\x7a", "\x61\x6c\160\150\x61\63" => "\x62\154\172"), array("\151\x64" => 204, "\156\141\155\145" => "\102\x65\x6e\x69\156", "\141\x6c\x70\x68\x61\x32" => "\142\152", "\x61\154\x70\150\141\x33" => "\x62\145\x6e"), array("\151\x64" => 64, "\x6e\141\155\x65" => "\x42\150\x75\x74\x61\x6e", "\x61\x6c\160\x68\x61\x32" => "\x62\x74", "\141\154\160\150\141\63" => "\x62\x74\156"), array("\151\144" => 68, "\x6e\141\x6d\x65" => "\102\157\154\x69\166\151\x61\40\50\120\x6c\165\162\151\156\141\x74\151\157\156\x61\154\x20\123\x74\141\164\145\40\157\x66\x29", "\141\x6c\160\150\x61\x32" => "\x62\x6f", "\141\x6c\x70\x68\141\x33" => "\142\157\x6c"), array("\x69\x64" => 70, "\x6e\x61\155\x65" => "\x42\x6f\163\156\x69\x61\40\x61\156\144\40\110\145\162\172\x65\147\x6f\x76\151\156\141", "\x61\x6c\x70\150\x61\x32" => "\142\x61", "\141\x6c\x70\150\x61\x33" => "\142\151\150"), array("\151\144" => 72, "\x6e\141\x6d\145" => "\102\x6f\x74\163\x77\x61\156\x61", "\x61\x6c\x70\x68\141\62" => "\x62\x77", "\141\154\x70\150\141\63" => "\142\167\x61"), array("\151\144" => 76, "\x6e\141\155\145" => "\102\162\141\x7a\x69\x6c", "\141\x6c\x70\150\141\62" => "\x62\x72", "\x61\154\x70\150\x61\x33" => "\x62\162\x61"), array("\151\x64" => 96, "\156\141\155\145" => "\102\x72\x75\156\145\x69\x20\x44\x61\162\165\x73\x73\141\154\141\x6d", "\141\x6c\x70\150\141\x32" => "\142\x6e", "\141\x6c\160\150\141\x33" => "\142\x72\x6e"), array("\151\144" => 100, "\156\x61\155\145" => "\102\x75\x6c\147\141\x72\151\x61", "\141\x6c\x70\x68\x61\62" => "\142\x67", "\141\x6c\160\150\x61\63" => "\x62\x67\x72"), array("\151\x64" => 854, "\156\x61\x6d\x65" => "\x42\x75\x72\153\151\x6e\141\x20\106\141\x73\157", "\x61\154\160\x68\x61\62" => "\x62\146", "\x61\154\x70\x68\x61\63" => "\x62\x66\x61"), array("\x69\144" => 108, "\x6e\141\155\x65" => "\102\165\x72\165\156\x64\x69", "\141\154\x70\150\x61\x32" => "\x62\x69", "\x61\x6c\x70\150\141\x33" => "\x62\144\151"), array("\151\144" => 132, "\156\141\155\x65" => "\x43\141\x62\157\40\x56\x65\162\144\145", "\141\x6c\x70\150\141\62" => "\143\166", "\x61\x6c\x70\x68\x61\x33" => "\x63\x70\166"), array("\151\144" => 116, "\156\141\155\145" => "\103\141\x6d\x62\157\x64\151\x61", "\141\154\x70\x68\x61\x32" => "\153\150", "\x61\x6c\160\150\x61\x33" => "\x6b\150\155"), array("\x69\144" => 120, "\156\x61\x6d\145" => "\103\x61\x6d\x65\162\157\x6f\156", "\141\154\x70\150\141\x32" => "\143\155", "\141\154\x70\x68\141\x33" => "\x63\x6d\x72"), array("\x69\144" => 124, "\x6e\x61\x6d\x65" => "\x43\x61\156\x61\144\x61", "\x61\154\x70\150\x61\x32" => "\x63\141", "\141\x6c\160\150\x61\63" => "\x63\x61\156"), array("\x69\x64" => 140, "\x6e\x61\x6d\145" => "\103\x65\156\164\162\141\x6c\x20\x41\146\162\x69\143\141\x6e\x20\122\x65\160\165\x62\154\151\143", "\x61\154\x70\150\141\62" => "\143\x66", "\x61\154\x70\x68\x61\63" => "\x63\141\146"), array("\151\x64" => 148, "\x6e\x61\x6d\145" => "\x43\x68\x61\144", "\x61\154\x70\x68\141\62" => "\x74\x64", "\x61\x6c\x70\150\141\x33" => "\164\143\x64"), array("\x69\144" => 152, "\156\141\x6d\145" => "\x43\x68\151\x6c\x65", "\x61\154\160\x68\141\x32" => "\143\x6c", "\x61\x6c\x70\x68\x61\63" => "\x63\150\154"), array("\x69\x64" => 156, "\x6e\141\x6d\145" => "\x43\150\x69\x6e\141", "\141\x6c\x70\150\141\x32" => "\143\156", "\141\x6c\x70\150\141\x33" => "\x63\150\x6e"), array("\151\144" => 170, "\x6e\141\155\x65" => "\x43\x6f\x6c\x6f\155\142\x69\141", "\x61\154\160\x68\141\x32" => "\143\157", "\141\x6c\x70\x68\x61\x33" => "\143\x6f\154"), array("\x69\x64" => 174, "\156\x61\155\x65" => "\103\x6f\155\x6f\162\x6f\x73", "\141\x6c\x70\150\x61\62" => "\x6b\x6d", "\x61\x6c\x70\x68\141\63" => "\143\x6f\x6d"), array("\151\x64" => 178, "\156\x61\x6d\x65" => "\103\x6f\x6e\x67\157", "\141\x6c\160\x68\141\x32" => "\143\x67", "\141\154\x70\150\141\x33" => "\x63\157\147"), array("\151\x64" => 180, "\x6e\141\x6d\x65" => "\x43\157\x6e\147\157\x2c\x20\104\x65\155\x6f\143\x72\x61\164\x69\143\40\122\145\160\165\142\154\x69\x63\40\157\x66\x20\164\x68\145", "\141\154\x70\x68\141\x32" => "\143\144", "\141\154\x70\150\141\x33" => "\x63\x6f\x64"), array("\x69\x64" => 188, "\x6e\x61\155\145" => "\x43\x6f\x73\x74\x61\x20\122\151\x63\x61", "\x61\x6c\x70\x68\x61\x32" => "\x63\x72", "\141\154\160\x68\x61\63" => "\143\162\x69"), array("\x69\144" => 384, "\156\x61\x6d\x65" => "\103\303\xb4\x74\145\40\144\x27\111\x76\x6f\151\x72\x65", "\x61\x6c\160\150\x61\62" => "\x63\x69", "\141\x6c\160\150\x61\x33" => "\143\151\166"), array("\151\144" => 191, "\156\141\x6d\x65" => "\x43\162\x6f\x61\x74\151\141", "\141\x6c\160\x68\x61\62" => "\x68\162", "\x61\x6c\160\150\x61\63" => "\x68\x72\166"), array("\151\144" => 192, "\156\141\x6d\x65" => "\103\x75\142\141", "\141\x6c\160\150\141\x32" => "\143\165", "\x61\154\x70\x68\141\63" => "\x63\x75\142"), array("\x69\144" => 196, "\x6e\141\x6d\145" => "\x43\x79\160\x72\x75\163", "\141\154\160\x68\x61\62" => "\143\x79", "\x61\x6c\x70\150\x61\x33" => "\x63\171\160"), array("\151\144" => 203, "\x6e\141\155\145" => "\103\172\145\x63\x68\x69\141", "\x61\154\x70\x68\x61\x32" => "\143\172", "\141\154\x70\150\x61\63" => "\x63\172\145"), array("\151\144" => 208, "\156\141\x6d\x65" => "\104\145\156\x6d\x61\x72\x6b", "\141\x6c\160\x68\141\62" => "\x64\153", "\x61\x6c\160\150\141\x33" => "\x64\x6e\x6b"), array("\151\144" => 262, "\x6e\141\x6d\x65" => "\104\152\x69\x62\x6f\165\164\x69", "\x61\154\x70\x68\141\x32" => "\144\152", "\141\x6c\x70\150\141\63" => "\144\152\151"), array("\x69\144" => 212, "\156\x61\x6d\x65" => "\x44\157\x6d\x69\x6e\151\x63\x61", "\x61\154\x70\150\x61\x32" => "\144\155", "\x61\154\160\150\x61\x33" => "\x64\155\x61"), array("\151\144" => 214, "\x6e\x61\155\145" => "\104\x6f\x6d\151\156\x69\143\141\156\40\122\145\160\x75\142\x6c\x69\x63", "\x61\154\160\x68\x61\x32" => "\144\x6f", "\x61\x6c\x70\x68\x61\x33" => "\144\x6f\x6d"), array("\x69\x64" => 218, "\x6e\x61\155\145" => "\x45\143\x75\141\x64\x6f\x72", "\x61\x6c\160\150\141\x32" => "\x65\143", "\x61\154\x70\150\141\x33" => "\145\143\165"), array("\151\144" => 818, "\x6e\141\155\x65" => "\105\x67\171\160\164", "\x61\x6c\160\150\141\62" => "\145\x67", "\x61\154\x70\150\x61\63" => "\x65\x67\171"), array("\x69\144" => 222, "\x6e\x61\155\x65" => "\x45\x6c\x20\123\x61\x6c\166\141\x64\157\x72", "\141\154\x70\x68\141\62" => "\x73\166", "\x61\154\x70\x68\x61\x33" => "\163\x6c\x76"), array("\x69\144" => 226, "\x6e\141\155\x65" => "\105\x71\165\141\164\157\162\151\x61\154\40\107\x75\151\156\x65\141", "\x61\154\160\150\141\x32" => "\147\x71", "\x61\x6c\160\150\x61\63" => "\147\156\x71"), array("\151\x64" => 232, "\x6e\141\155\x65" => "\x45\162\x69\164\x72\145\x61", "\141\x6c\160\150\x61\62" => "\x65\162", "\141\x6c\x70\x68\141\63" => "\145\162\x69"), array("\x69\x64" => 233, "\x6e\141\155\x65" => "\x45\163\x74\157\156\151\141", "\141\x6c\160\x68\141\62" => "\x65\x65", "\141\154\160\150\x61\x33" => "\x65\x73\164"), array("\x69\x64" => 748, "\x6e\x61\155\145" => "\x45\163\x77\141\164\151\156\151", "\x61\154\x70\150\141\62" => "\x73\172", "\x61\x6c\160\150\x61\x33" => "\163\167\172"), array("\151\x64" => 231, "\156\x61\x6d\145" => "\105\x74\150\151\157\x70\151\141", "\x61\154\x70\150\x61\x32" => "\145\x74", "\141\154\160\150\x61\63" => "\145\x74\x68"), array("\x69\144" => 242, "\x6e\141\x6d\x65" => "\106\151\x6a\151", "\141\x6c\x70\150\x61\62" => "\x66\x6a", "\141\x6c\160\150\141\x33" => "\x66\152\x69"), array("\151\144" => 246, "\156\141\x6d\x65" => "\106\x69\x6e\154\141\x6e\x64", "\x61\154\160\x68\x61\x32" => "\x66\151", "\141\x6c\x70\150\x61\x33" => "\x66\x69\156"), array("\x69\144" => 250, "\156\x61\155\145" => "\106\162\x61\156\143\145", "\141\154\160\x68\x61\62" => "\146\162", "\x61\154\160\x68\x61\x33" => "\146\162\x61"), array("\151\144" => 266, "\x6e\141\x6d\x65" => "\x47\x61\x62\x6f\156", "\141\154\160\150\x61\62" => "\x67\x61", "\x61\x6c\160\x68\141\63" => "\x67\141\x62"), array("\x69\x64" => 270, "\x6e\141\155\145" => "\107\x61\155\x62\151\x61", "\x61\x6c\160\150\x61\x32" => "\x67\155", "\x61\x6c\x70\x68\x61\63" => "\x67\155\142"), array("\x69\144" => 268, "\x6e\x61\x6d\x65" => "\107\x65\x6f\x72\147\x69\x61", "\x61\x6c\x70\150\141\62" => "\x67\145", "\141\x6c\160\150\141\x33" => "\147\145\157"), array("\x69\144" => 276, "\156\x61\155\x65" => "\x47\x65\162\155\141\x6e\171", "\x61\x6c\160\150\x61\x32" => "\x64\x65", "\141\x6c\160\x68\141\x33" => "\x64\x65\165"), array("\151\144" => 288, "\156\x61\155\x65" => "\107\150\x61\156\141", "\141\x6c\160\x68\141\62" => "\147\150", "\x61\x6c\x70\150\x61\63" => "\147\x68\x61"), array("\x69\144" => 300, "\156\x61\x6d\x65" => "\107\162\x65\145\x63\x65", "\x61\154\160\150\x61\x32" => "\x67\162", "\x61\154\160\150\x61\x33" => "\x67\x72\x63"), array("\151\144" => 308, "\156\141\x6d\x65" => "\x47\162\x65\156\x61\x64\x61", "\x61\x6c\x70\x68\141\x32" => "\x67\x64", "\x61\154\160\x68\x61\x33" => "\x67\162\144"), array("\151\144" => 320, "\156\141\155\x65" => "\107\165\141\164\x65\x6d\x61\x6c\141", "\x61\x6c\160\150\x61\x32" => "\147\x74", "\141\x6c\160\150\141\x33" => "\147\164\155"), array("\x69\x64" => 324, "\156\x61\155\145" => "\x47\x75\x69\156\145\141", "\x61\154\160\150\141\62" => "\147\156", "\141\154\x70\x68\141\63" => "\147\x69\156"), array("\x69\144" => 624, "\156\x61\x6d\x65" => "\x47\165\151\156\x65\x61\55\x42\151\x73\163\x61\165", "\x61\x6c\x70\x68\x61\62" => "\x67\167", "\141\154\160\x68\x61\x33" => "\x67\156\x62"), array("\151\x64" => 328, "\156\141\155\x65" => "\x47\165\171\141\156\141", "\x61\x6c\160\x68\141\x32" => "\x67\x79", "\x61\x6c\160\150\x61\x33" => "\x67\165\x79"), array("\x69\144" => 332, "\x6e\141\155\x65" => "\110\141\151\164\x69", "\141\154\160\150\141\x32" => "\x68\x74", "\x61\154\x70\x68\x61\63" => "\150\164\x69"), array("\x69\x64" => 340, "\x6e\141\x6d\145" => "\x48\157\x6e\144\x75\162\x61\163", "\141\x6c\160\150\141\62" => "\150\x6e", "\x61\x6c\160\x68\x61\63" => "\150\x6e\x64"), array("\x69\144" => 348, "\156\141\x6d\x65" => "\x48\x75\x6e\147\141\x72\x79", "\141\x6c\160\150\141\62" => "\x68\165", "\x61\x6c\x70\x68\141\63" => "\x68\x75\156"), array("\x69\x64" => 352, "\x6e\x61\x6d\x65" => "\111\x63\145\x6c\141\x6e\x64", "\141\154\160\x68\141\x32" => "\151\x73", "\x61\x6c\160\x68\x61\x33" => "\151\163\x6c"), array("\x69\144" => 356, "\x6e\141\x6d\x65" => "\111\156\144\x69\141", "\141\x6c\160\x68\141\62" => "\151\x6e", "\x61\x6c\160\x68\141\x33" => "\151\x6e\144"), array("\151\144" => 360, "\156\x61\x6d\145" => "\111\x6e\144\157\156\145\163\x69\141", "\x61\x6c\x70\x68\x61\x32" => "\x69\x64", "\x61\154\x70\x68\x61\63" => "\151\x64\x6e"), array("\151\x64" => 364, "\x6e\141\155\145" => "\x49\x72\141\x6e\x20\x28\111\x73\x6c\141\x6d\151\143\40\x52\x65\160\x75\142\154\x69\x63\x20\x6f\146\51", "\x61\x6c\x70\150\x61\62" => "\x69\162", "\x61\154\x70\150\x61\x33" => "\151\x72\156"), array("\151\144" => 368, "\156\141\155\x65" => "\111\x72\x61\161", "\x61\154\160\150\141\62" => "\151\x71", "\141\x6c\x70\x68\x61\63" => "\151\162\x71"), array("\x69\x64" => 372, "\156\x61\155\x65" => "\111\x72\145\x6c\141\156\x64", "\141\x6c\x70\x68\141\62" => "\151\145", "\x61\154\160\x68\x61\x33" => "\151\162\154"), array("\x69\x64" => 376, "\x6e\x61\x6d\145" => "\111\x73\x72\141\145\x6c", "\141\154\x70\150\141\62" => "\151\x6c", "\141\x6c\x70\150\141\x33" => "\x69\x73\x72"), array("\x69\144" => 380, "\x6e\x61\155\x65" => "\x49\164\x61\x6c\x79", "\141\154\x70\150\141\x32" => "\x69\x74", "\141\x6c\x70\x68\x61\x33" => "\x69\164\141"), array("\151\144" => 388, "\x6e\x61\x6d\145" => "\x4a\x61\x6d\141\151\143\x61", "\x61\154\x70\150\x61\62" => "\x6a\x6d", "\x61\x6c\160\x68\x61\63" => "\x6a\x61\x6d"), array("\x69\x64" => 392, "\156\x61\x6d\145" => "\112\x61\x70\x61\156", "\141\x6c\160\150\141\x32" => "\152\x70", "\x61\154\x70\150\x61\x33" => "\x6a\x70\x6e"), array("\x69\x64" => 400, "\156\x61\155\145" => "\112\x6f\162\x64\141\x6e", "\x61\x6c\160\x68\141\62" => "\152\x6f", "\141\154\160\x68\x61\x33" => "\x6a\x6f\x72"), array("\x69\x64" => 398, "\x6e\141\155\145" => "\113\141\x7a\x61\153\x68\x73\x74\x61\x6e", "\x61\x6c\160\150\x61\x32" => "\153\172", "\141\x6c\x70\x68\141\63" => "\153\141\x7a"), array("\151\144" => 404, "\156\x61\155\x65" => "\x4b\x65\156\x79\141", "\141\x6c\160\x68\141\x32" => "\x6b\x65", "\x61\x6c\x70\150\141\x33" => "\x6b\145\156"), array("\151\144" => 296, "\156\x61\x6d\x65" => "\113\x69\x72\x69\142\141\164\151", "\141\x6c\160\150\141\62" => "\153\x69", "\141\154\160\150\141\63" => "\x6b\x69\x72"), array("\x69\144" => 408, "\156\x61\x6d\145" => "\113\157\x72\x65\x61\40\50\104\145\x6d\157\143\162\141\x74\x69\x63\40\120\145\157\160\x6c\x65\x27\163\x20\x52\145\160\165\x62\154\x69\143\40\x6f\146\x29", "\141\x6c\x70\150\x61\x32" => "\153\x70", "\141\154\160\x68\141\x33" => "\x70\162\x6b"), array("\x69\144" => 410, "\x6e\141\155\145" => "\113\157\162\x65\141\54\40\x52\x65\160\x75\142\154\x69\x63\x20\x6f\146", "\x61\154\160\x68\141\62" => "\153\162", "\x61\154\x70\x68\x61\x33" => "\x6b\x6f\x72"), array("\x69\144" => 414, "\x6e\141\155\145" => "\x4b\165\167\141\151\x74", "\141\x6c\x70\150\141\x32" => "\153\167", "\141\154\160\150\x61\63" => "\x6b\167\x74"), array("\x69\x64" => 417, "\x6e\x61\x6d\x65" => "\113\171\x72\x67\x79\x7a\x73\x74\x61\156", "\x61\154\x70\x68\x61\x32" => "\x6b\147", "\141\154\160\150\141\63" => "\x6b\147\172"), array("\x69\144" => 418, "\x6e\141\x6d\145" => "\114\141\157\40\x50\x65\157\160\154\x65\x27\163\x20\104\x65\x6d\x6f\143\162\141\164\151\143\40\x52\145\160\x75\x62\154\x69\x63", "\x61\x6c\160\150\141\x32" => "\x6c\141", "\141\x6c\160\x68\x61\63" => "\x6c\141\157"), array("\x69\144" => 428, "\156\141\155\145" => "\114\x61\164\x76\151\x61", "\x61\x6c\160\150\141\62" => "\154\166", "\x61\154\160\x68\141\63" => "\154\166\141"), array("\x69\x64" => 422, "\x6e\x61\155\145" => "\114\145\x62\x61\156\x6f\x6e", "\x61\x6c\x70\150\141\62" => "\154\x62", "\141\154\160\x68\x61\x33" => "\154\142\x6e"), array("\x69\x64" => 426, "\x6e\x61\155\x65" => "\114\x65\163\x6f\164\x68\157", "\x61\154\x70\x68\141\62" => "\x6c\x73", "\141\154\160\150\x61\63" => "\154\x73\157"), array("\x69\x64" => 430, "\156\x61\x6d\x65" => "\114\x69\142\x65\162\151\x61", "\141\x6c\160\150\141\x32" => "\x6c\x72", "\141\154\160\x68\x61\x33" => "\x6c\142\x72"), array("\151\144" => 434, "\156\141\155\145" => "\x4c\151\142\x79\x61", "\141\154\160\150\x61\x32" => "\154\171", "\x61\154\x70\x68\141\x33" => "\154\142\171"), array("\151\144" => 438, "\156\141\155\x65" => "\114\151\x65\143\150\x74\145\x6e\163\164\x65\x69\156", "\141\x6c\x70\150\141\x32" => "\x6c\151", "\141\x6c\160\150\141\x33" => "\154\151\x65"), array("\151\x64" => 440, "\x6e\141\x6d\145" => "\x4c\151\x74\150\165\141\156\x69\141", "\x61\x6c\160\x68\141\x32" => "\154\164", "\141\x6c\160\x68\141\63" => "\x6c\x74\x75"), array("\x69\x64" => 442, "\156\141\x6d\145" => "\114\165\170\145\155\x62\x6f\x75\162\x67", "\141\154\x70\150\x61\62" => "\x6c\x75", "\141\154\x70\150\141\x33" => "\x6c\x75\170"), array("\x69\x64" => 450, "\x6e\x61\155\x65" => "\x4d\141\144\x61\147\x61\163\x63\141\162", "\x61\x6c\x70\150\141\x32" => "\x6d\x67", "\141\154\160\150\x61\x33" => "\155\x64\147"), array("\x69\x64" => 454, "\x6e\141\x6d\x65" => "\115\141\x6c\x61\167\x69", "\x61\x6c\160\150\x61\62" => "\x6d\167", "\141\154\x70\x68\x61\63" => "\155\x77\x69"), array("\151\144" => 458, "\156\x61\x6d\x65" => "\x4d\x61\154\x61\171\x73\x69\x61", "\141\x6c\x70\150\x61\x32" => "\155\x79", "\141\x6c\x70\x68\x61\x33" => "\x6d\x79\x73"), array("\151\144" => 462, "\156\x61\x6d\x65" => "\115\141\x6c\x64\151\166\145\x73", "\141\x6c\160\150\x61\x32" => "\155\x76", "\141\154\x70\150\141\x33" => "\155\144\x76"), array("\x69\x64" => 466, "\x6e\141\155\x65" => "\115\x61\154\151", "\141\154\160\150\x61\62" => "\x6d\x6c", "\x61\x6c\x70\150\141\x33" => "\155\x6c\151"), array("\x69\144" => 470, "\156\x61\155\x65" => "\115\141\154\x74\x61", "\141\x6c\x70\150\x61\62" => "\x6d\x74", "\x61\154\x70\x68\x61\63" => "\155\154\x74"), array("\151\x64" => 584, "\156\x61\x6d\145" => "\115\141\x72\163\x68\141\x6c\x6c\x20\111\163\x6c\x61\x6e\x64\163", "\x61\x6c\x70\x68\141\x32" => "\155\x68", "\141\154\160\x68\x61\x33" => "\155\x68\154"), array("\x69\144" => 478, "\156\x61\155\x65" => "\x4d\141\x75\x72\x69\164\141\156\x69\x61", "\141\x6c\160\150\x61\62" => "\155\x72", "\x61\x6c\x70\x68\x61\x33" => "\x6d\x72\x74"), array("\151\144" => 480, "\x6e\x61\155\145" => "\115\141\x75\162\x69\164\151\165\163", "\141\154\x70\x68\141\62" => "\155\165", "\141\154\x70\x68\x61\x33" => "\155\165\x73"), array("\x69\x64" => 484, "\156\141\x6d\x65" => "\x4d\145\170\x69\x63\157", "\x61\x6c\160\150\x61\x32" => "\155\170", "\x61\x6c\160\150\x61\63" => "\155\145\170"), array("\x69\144" => 583, "\156\x61\155\x65" => "\x4d\151\143\x72\157\156\x65\x73\x69\141\40\x28\x46\145\x64\145\162\x61\164\x65\144\x20\123\x74\141\x74\x65\163\40\157\x66\51", "\141\154\160\x68\141\62" => "\146\155", "\x61\x6c\x70\150\141\x33" => "\x66\163\155"), array("\x69\144" => 498, "\x6e\141\155\145" => "\x4d\x6f\x6c\x64\157\166\141\x2c\x20\x52\x65\x70\165\x62\154\151\143\40\x6f\146", "\x61\x6c\x70\x68\141\62" => "\155\x64", "\x61\154\x70\150\141\63" => "\155\144\141"), array("\151\x64" => 492, "\x6e\141\155\x65" => "\115\157\156\141\143\157", "\x61\154\160\150\x61\x32" => "\x6d\143", "\x61\154\160\150\x61\63" => "\x6d\143\x6f"), array("\151\x64" => 496, "\156\141\x6d\x65" => "\115\157\x6e\x67\x6f\154\151\x61", "\x61\x6c\160\150\141\x32" => "\155\156", "\x61\154\160\150\141\63" => "\x6d\x6e\x67"), array("\x69\x64" => 499, "\156\x61\155\x65" => "\x4d\x6f\x6e\x74\145\x6e\145\147\162\x6f", "\141\154\160\x68\141\62" => "\155\145", "\141\154\x70\x68\141\63" => "\x6d\156\145"), array("\x69\144" => 504, "\x6e\x61\x6d\x65" => "\x4d\x6f\x72\x6f\143\x63\157", "\x61\154\x70\150\x61\x32" => "\x6d\141", "\x61\154\160\x68\141\63" => "\155\141\x72"), array("\x69\x64" => 508, "\156\x61\x6d\x65" => "\x4d\157\x7a\x61\155\x62\x69\161\x75\x65", "\x61\x6c\160\x68\141\x32" => "\x6d\x7a", "\141\x6c\x70\x68\x61\x33" => "\155\157\x7a"), array("\151\x64" => 104, "\x6e\141\x6d\145" => "\x4d\x79\141\156\x6d\141\162", "\141\154\160\150\141\x32" => "\x6d\155", "\x61\154\x70\150\x61\x33" => "\x6d\x6d\x72"), array("\151\144" => 516, "\156\141\155\x65" => "\x4e\x61\x6d\x69\142\x69\141", "\141\154\x70\150\141\62" => "\156\141", "\x61\154\160\150\141\x33" => "\x6e\141\x6d"), array("\x69\x64" => 520, "\x6e\x61\155\145" => "\x4e\x61\x75\x72\x75", "\x61\154\160\150\141\x32" => "\x6e\x72", "\x61\154\160\x68\141\x33" => "\156\x72\165"), array("\151\144" => 524, "\x6e\x61\155\145" => "\116\x65\160\141\x6c", "\x61\154\x70\x68\x61\62" => "\156\160", "\x61\154\x70\150\141\x33" => "\156\160\x6c"), array("\x69\x64" => 528, "\156\141\155\x65" => "\x4e\145\164\x68\x65\162\x6c\x61\x6e\144\x73", "\x61\x6c\x70\150\x61\62" => "\x6e\154", "\141\x6c\x70\150\x61\x33" => "\x6e\x6c\144"), array("\x69\144" => 554, "\156\x61\155\145" => "\x4e\x65\x77\40\x5a\x65\x61\154\x61\x6e\144", "\141\154\160\x68\x61\62" => "\156\172", "\141\154\x70\x68\141\63" => "\156\x7a\154"), array("\151\x64" => 558, "\x6e\x61\155\145" => "\116\151\x63\141\x72\141\147\x75\141", "\141\x6c\160\x68\x61\62" => "\156\151", "\x61\154\160\x68\x61\63" => "\x6e\151\143"), array("\x69\x64" => 562, "\156\x61\x6d\145" => "\x4e\151\x67\145\x72", "\x61\x6c\x70\150\141\62" => "\156\x65", "\141\x6c\160\x68\141\63" => "\156\x65\162"), array("\151\x64" => 566, "\x6e\x61\x6d\x65" => "\x4e\x69\x67\145\162\151\x61", "\x61\x6c\160\x68\x61\62" => "\x6e\147", "\141\x6c\160\150\x61\63" => "\156\147\x61"), array("\x69\x64" => 807, "\x6e\141\155\x65" => "\116\x6f\x72\164\150\x20\x4d\x61\143\x65\x64\157\156\x69\141", "\x61\154\x70\150\x61\62" => "\x6d\153", "\x61\154\x70\150\141\63" => "\155\x6b\144"), array("\x69\144" => 578, "\x6e\x61\x6d\145" => "\x4e\157\x72\167\x61\171", "\x61\x6c\160\x68\x61\62" => "\156\x6f", "\141\154\x70\150\x61\63" => "\156\157\162"), array("\x69\x64" => 512, "\156\x61\x6d\x65" => "\117\155\x61\156", "\x61\x6c\160\150\x61\62" => "\157\x6d", "\141\x6c\x70\x68\141\63" => "\x6f\155\x6e"), array("\151\x64" => 586, "\x6e\x61\x6d\x65" => "\x50\141\x6b\x69\163\x74\141\156", "\141\154\x70\150\x61\62" => "\x70\x6b", "\141\154\160\x68\141\63" => "\160\x61\153"), array("\x69\144" => 585, "\x6e\141\x6d\x65" => "\x50\x61\154\x61\165", "\141\x6c\160\x68\141\62" => "\x70\167", "\x61\x6c\160\150\x61\63" => "\160\154\167"), array("\151\x64" => 591, "\156\x61\x6d\145" => "\120\x61\x6e\x61\x6d\x61", "\141\x6c\x70\x68\x61\62" => "\x70\x61", "\x61\154\160\x68\x61\x33" => "\160\x61\156"), array("\151\x64" => 598, "\x6e\x61\x6d\x65" => "\120\141\160\165\141\x20\116\x65\x77\x20\x47\x75\x69\x6e\145\x61", "\x61\154\160\x68\x61\62" => "\x70\x67", "\141\x6c\160\x68\x61\x33" => "\160\x6e\x67"), array("\151\x64" => 600, "\156\x61\x6d\x65" => "\x50\141\x72\141\x67\x75\x61\171", "\x61\154\x70\150\141\62" => "\160\171", "\141\x6c\160\x68\141\x33" => "\160\x72\171"), array("\151\x64" => 604, "\x6e\x61\x6d\x65" => "\120\145\x72\x75", "\141\x6c\x70\150\141\62" => "\x70\x65", "\141\x6c\x70\150\x61\x33" => "\x70\x65\x72"), array("\151\144" => 608, "\156\x61\x6d\145" => "\120\150\x69\154\151\x70\160\x69\x6e\x65\x73", "\x61\x6c\160\x68\141\x32" => "\x70\150", "\141\154\x70\x68\x61\63" => "\160\x68\154"), array("\x69\x64" => 616, "\x6e\141\155\x65" => "\120\157\x6c\x61\x6e\x64", "\141\x6c\160\150\x61\x32" => "\x70\154", "\x61\154\x70\x68\x61\x33" => "\160\157\x6c"), array("\151\x64" => 620, "\x6e\x61\x6d\x65" => "\x50\x6f\x72\164\165\147\141\x6c", "\141\154\160\150\141\62" => "\160\164", "\141\x6c\x70\x68\141\x33" => "\160\x72\164"), array("\x69\144" => 634, "\x6e\x61\x6d\145" => "\x51\141\164\141\x72", "\x61\154\x70\x68\x61\x32" => "\161\x61", "\x61\x6c\160\x68\141\63" => "\161\x61\x74"), array("\x69\144" => 642, "\156\x61\x6d\145" => "\x52\157\155\x61\x6e\151\x61", "\x61\x6c\x70\150\x61\x32" => "\x72\x6f", "\x61\x6c\160\150\141\63" => "\x72\x6f\x6d"), array("\151\144" => 643, "\x6e\141\x6d\145" => "\x52\x75\x73\x73\151\141\156\x20\x46\145\144\x65\162\141\x74\x69\x6f\156", "\x61\x6c\160\x68\x61\62" => "\162\165", "\141\x6c\160\150\141\63" => "\x72\x75\163"), array("\x69\144" => 646, "\x6e\141\155\x65" => "\122\x77\141\156\x64\x61", "\x61\x6c\x70\x68\141\62" => "\x72\167", "\141\x6c\x70\x68\141\x33" => "\162\167\141"), array("\151\144" => 659, "\x6e\x61\x6d\145" => "\x53\x61\151\x6e\164\40\113\x69\164\x74\163\x20\141\156\x64\x20\x4e\x65\166\x69\x73", "\x61\x6c\160\150\x61\x32" => "\x6b\156", "\x61\x6c\160\x68\x61\x33" => "\x6b\156\x61"), array("\x69\144" => 662, "\x6e\141\155\x65" => "\123\141\151\x6e\x74\40\114\x75\143\151\x61", "\x61\154\x70\x68\141\x32" => "\154\x63", "\x61\x6c\160\150\141\x33" => "\x6c\x63\141"), array("\x69\x64" => 670, "\x6e\x61\x6d\145" => "\123\141\x69\x6e\164\x20\126\151\x6e\143\145\x6e\x74\x20\141\156\x64\x20\x74\150\145\40\x47\x72\145\x6e\141\x64\151\156\145\163", "\141\154\160\150\x61\62" => "\166\143", "\x61\154\x70\x68\x61\x33" => "\166\143\164"), array("\151\x64" => 882, "\156\x61\x6d\x65" => "\x53\x61\x6d\x6f\x61", "\141\154\160\x68\141\62" => "\x77\163", "\141\154\x70\150\141\x33" => "\x77\x73\x6d"), array("\151\x64" => 674, "\x6e\x61\155\x65" => "\x53\x61\x6e\40\x4d\x61\162\151\x6e\157", "\141\x6c\x70\x68\141\62" => "\163\x6d", "\x61\x6c\x70\x68\x61\63" => "\163\155\162"), array("\151\144" => 678, "\x6e\141\x6d\x65" => "\123\x61\157\x20\x54\157\x6d\x65\x20\x61\156\x64\40\120\162\x69\156\143\x69\x70\x65", "\x61\x6c\160\x68\x61\62" => "\163\164", "\141\x6c\160\150\141\x33" => "\163\164\160"), array("\151\144" => 682, "\156\x61\x6d\x65" => "\123\141\165\x64\x69\x20\101\162\x61\x62\151\x61", "\x61\154\160\x68\x61\62" => "\163\141", "\141\x6c\x70\x68\x61\63" => "\x73\x61\x75"), array("\151\x64" => 686, "\156\x61\155\x65" => "\123\x65\156\x65\x67\141\x6c", "\x61\154\160\150\x61\62" => "\x73\156", "\141\154\x70\x68\x61\63" => "\x73\145\156"), array("\x69\x64" => 688, "\156\141\155\x65" => "\x53\145\x72\142\x69\141", "\141\x6c\x70\150\x61\x32" => "\x72\x73", "\x61\x6c\160\x68\x61\63" => "\163\x72\142"), array("\151\x64" => 690, "\x6e\141\155\145" => "\123\145\x79\x63\x68\x65\x6c\154\145\x73", "\141\154\160\150\141\x32" => "\x73\143", "\141\x6c\160\x68\141\x33" => "\x73\x79\x63"), array("\151\144" => 694, "\156\x61\155\145" => "\x53\151\145\162\x72\141\x20\114\145\x6f\156\145", "\141\154\160\x68\141\x32" => "\x73\x6c", "\x61\154\x70\150\141\x33" => "\163\x6c\145"), array("\151\x64" => 702, "\156\141\155\x65" => "\123\x69\x6e\x67\141\x70\157\x72\x65", "\141\x6c\160\150\x61\62" => "\x73\147", "\x61\x6c\160\150\x61\63" => "\x73\x67\160"), array("\151\144" => 703, "\x6e\x61\155\145" => "\x53\154\x6f\x76\141\153\x69\x61", "\141\x6c\x70\x68\141\62" => "\x73\x6b", "\141\154\x70\150\x61\63" => "\163\166\153"), array("\x69\x64" => 705, "\x6e\141\x6d\x65" => "\x53\x6c\x6f\x76\145\156\x69\141", "\x61\x6c\x70\x68\141\62" => "\163\x69", "\141\154\160\150\x61\63" => "\x73\x76\156"), array("\x69\144" => 90, "\x6e\x61\155\x65" => "\x53\157\154\x6f\x6d\157\x6e\40\111\x73\154\x61\156\x64\163", "\x61\x6c\160\150\x61\62" => "\x73\x62", "\141\154\160\x68\141\63" => "\x73\154\x62"), array("\x69\144" => 706, "\156\141\x6d\145" => "\x53\x6f\x6d\x61\154\x69\141", "\x61\154\x70\150\x61\x32" => "\163\157", "\141\x6c\160\150\x61\63" => "\x73\x6f\x6d"), array("\151\x64" => 710, "\156\x61\155\x65" => "\123\x6f\165\164\x68\x20\x41\x66\162\x69\x63\141", "\x61\154\160\x68\x61\x32" => "\x7a\x61", "\141\x6c\x70\x68\141\63" => "\172\x61\x66"), array("\151\144" => 728, "\156\141\155\145" => "\x53\x6f\x75\x74\x68\40\123\x75\x64\141\156", "\x61\x6c\160\x68\141\x32" => "\163\x73", "\141\x6c\x70\x68\141\63" => "\163\x73\144"), array("\x69\144" => 724, "\x6e\x61\155\x65" => "\x53\160\x61\151\156", "\141\x6c\160\x68\x61\x32" => "\145\163", "\x61\x6c\160\150\141\63" => "\x65\163\160"), array("\151\x64" => 144, "\156\x61\x6d\x65" => "\123\x72\x69\x20\114\x61\x6e\153\x61", "\141\154\160\x68\x61\62" => "\x6c\x6b", "\141\154\x70\150\x61\63" => "\154\x6b\141"), array("\x69\144" => 729, "\156\x61\155\x65" => "\123\x75\144\141\x6e", "\141\154\x70\150\141\62" => "\x73\144", "\x61\154\x70\150\141\x33" => "\163\x64\x6e"), array("\x69\x64" => 740, "\x6e\141\155\145" => "\x53\165\x72\x69\156\141\155\x65", "\141\154\160\150\x61\62" => "\x73\x72", "\141\154\160\150\x61\63" => "\x73\165\162"), array("\x69\x64" => 752, "\x6e\141\x6d\145" => "\x53\167\145\144\145\x6e", "\x61\x6c\160\x68\141\62" => "\x73\145", "\x61\x6c\x70\x68\x61\x33" => "\x73\167\145"), array("\x69\144" => 756, "\x6e\141\155\x65" => "\x53\x77\x69\164\172\x65\x72\154\x61\x6e\144", "\141\154\x70\x68\x61\x32" => "\143\150", "\x61\154\x70\x68\x61\x33" => "\143\150\x65"), array("\x69\x64" => 760, "\x6e\141\155\145" => "\123\171\162\151\x61\156\x20\x41\x72\141\x62\40\122\x65\160\x75\142\x6c\151\x63", "\141\154\x70\150\141\62" => "\x73\x79", "\x61\x6c\160\x68\x61\63" => "\x73\x79\162"), array("\151\144" => 762, "\x6e\x61\x6d\145" => "\124\x61\152\x69\153\151\x73\x74\x61\156", "\x61\154\160\x68\141\x32" => "\164\152", "\141\154\x70\x68\141\63" => "\x74\x6a\153"), array("\x69\x64" => 834, "\156\x61\155\x65" => "\x54\x61\x6e\x7a\141\x6e\x69\x61\54\x20\125\x6e\x69\164\x65\144\40\x52\x65\x70\165\142\x6c\x69\x63\40\157\146", "\141\154\160\150\x61\62" => "\x74\172", "\x61\154\x70\150\141\63" => "\164\172\x61"), array("\151\x64" => 764, "\x6e\141\155\x65" => "\124\150\141\x69\154\x61\x6e\144", "\141\154\160\150\x61\62" => "\x74\x68", "\141\154\x70\150\x61\63" => "\164\x68\x61"), array("\151\144" => 626, "\156\x61\155\145" => "\124\x69\x6d\x6f\x72\x2d\x4c\145\163\x74\x65", "\x61\154\x70\x68\141\62" => "\164\154", "\x61\x6c\160\150\141\x33" => "\x74\154\x73"), array("\151\144" => 768, "\156\141\155\x65" => "\x54\157\147\157", "\x61\154\160\x68\x61\x32" => "\164\x67", "\141\x6c\x70\150\141\x33" => "\x74\x67\x6f"), array("\151\144" => 776, "\x6e\x61\155\x65" => "\124\157\156\147\141", "\141\154\x70\150\141\x32" => "\164\157", "\x61\x6c\160\x68\141\x33" => "\164\157\x6e"), array("\151\144" => 780, "\156\x61\x6d\145" => "\124\162\x69\x6e\x69\144\x61\x64\40\x61\x6e\x64\40\x54\x6f\x62\141\147\x6f", "\x61\x6c\160\150\141\62" => "\x74\x74", "\141\154\x70\x68\141\63" => "\x74\x74\157"), array("\151\x64" => 788, "\156\141\155\145" => "\124\x75\156\151\163\151\141", "\x61\154\x70\x68\141\62" => "\x74\156", "\x61\154\x70\x68\x61\x33" => "\164\165\x6e"), array("\151\144" => 792, "\x6e\141\x6d\145" => "\x54\165\162\153\x65\171", "\141\154\160\x68\141\62" => "\x74\x72", "\x61\154\160\x68\141\x33" => "\x74\x75\x72"), array("\x69\x64" => 795, "\156\141\x6d\145" => "\124\x75\x72\x6b\x6d\145\x6e\x69\x73\164\141\156", "\141\154\160\x68\141\x32" => "\164\155", "\x61\154\x70\150\141\63" => "\x74\x6b\155"), array("\151\144" => 798, "\x6e\x61\155\145" => "\124\165\166\141\154\165", "\x61\x6c\160\x68\x61\62" => "\164\x76", "\141\x6c\x70\150\x61\x33" => "\x74\x75\166"), array("\x69\x64" => 800, "\156\141\155\145" => "\x55\x67\x61\x6e\144\141", "\x61\154\160\x68\141\x32" => "\x75\147", "\x61\x6c\160\150\141\63" => "\x75\147\141"), array("\151\144" => 804, "\156\x61\x6d\x65" => "\x55\x6b\162\x61\151\156\x65", "\x61\x6c\160\x68\141\x32" => "\x75\141", "\x61\154\160\x68\x61\63" => "\x75\x6b\162"), array("\151\x64" => 784, "\156\x61\155\x65" => "\x55\x6e\x69\164\x65\144\40\x41\162\x61\142\x20\x45\x6d\151\162\141\x74\145\163", "\x61\154\x70\x68\141\x32" => "\x61\x65", "\x61\154\x70\x68\x61\63" => "\141\x72\x65"), array("\151\x64" => 826, "\156\x61\x6d\145" => "\x55\156\151\x74\145\x64\x20\x4b\151\156\x67\x64\157\155\40\x6f\x66\40\x47\162\x65\141\x74\x20\102\162\151\x74\141\x69\156\x20\141\x6e\x64\40\116\157\x72\x74\x68\145\x72\x6e\x20\111\x72\x65\154\x61\x6e\144", "\141\154\160\150\141\62" => "\x67\142", "\141\154\160\150\141\63" => "\147\142\162"), array("\x69\x64" => 840, "\x6e\x61\x6d\145" => "\125\x6e\151\164\x65\x64\x20\123\164\141\x74\x65\x73\x20\x6f\x66\40\101\x6d\x65\x72\151\143\141", "\141\x6c\x70\150\x61\62" => "\165\x73", "\141\x6c\x70\x68\x61\x33" => "\165\x73\x61"), array("\x69\x64" => 858, "\156\x61\155\x65" => "\x55\162\x75\147\165\x61\x79", "\141\154\x70\150\141\x32" => "\165\x79", "\141\154\160\150\141\x33" => "\x75\x72\x79"), array("\151\144" => 860, "\x6e\141\155\145" => "\125\x7a\x62\x65\153\x69\x73\164\141\x6e", "\x61\x6c\160\x68\x61\62" => "\x75\x7a", "\x61\154\160\x68\141\63" => "\165\172\x62"), array("\x69\144" => 548, "\156\141\x6d\x65" => "\x56\x61\156\x75\x61\164\165", "\x61\x6c\160\150\141\x32" => "\166\x75", "\x61\154\160\x68\x61\63" => "\166\x75\x74"), array("\x69\144" => 862, "\156\x61\x6d\x65" => "\x56\x65\156\145\x7a\x75\x65\x6c\x61\40\50\x42\157\154\151\x76\x61\x72\x69\141\x6e\x20\x52\145\160\x75\x62\154\x69\143\x20\x6f\x66\x29", "\141\154\x70\x68\x61\62" => "\x76\x65", "\x61\x6c\x70\x68\x61\63" => "\x76\x65\x6e"), array("\x69\144" => 704, "\156\x61\155\145" => "\x56\x69\145\x74\40\116\141\155", "\x61\x6c\x70\x68\141\62" => "\166\x6e", "\x61\x6c\160\x68\141\63" => "\x76\x6e\x6d"), array("\x69\144" => 887, "\156\141\155\x65" => "\131\x65\155\x65\156", "\x61\154\160\x68\x61\62" => "\171\x65", "\141\x6c\160\x68\x61\x33" => "\x79\145\x6d"), array("\151\x64" => 894, "\x6e\141\155\145" => "\x5a\x61\x6d\x62\151\141", "\x61\154\160\150\141\62" => "\172\x6d", "\141\154\160\150\141\x33" => "\172\x6d\x62"), array("\151\x64" => 716, "\x6e\x61\x6d\145" => "\132\x69\x6d\x62\x61\x62\167\x65", "\141\x6c\x70\x68\x61\x32" => "\172\x77", "\x61\154\x70\x68\x61\x33" => "\172\167\145")); foreach ($countries as $key => $value) { if (strtoupper($value["\x61\x6c\160\150\x61\62"]) == $iso2) { return strtoupper($value["\x61\154\160\x68\141\63"]); } } } public function dream_couriers() { $def_selected = ''; $def_checked = ''; $dreamlove_ps_t = get_option("\144\x72\x65\141\155\160\141") && get_option("\144\x72\x65\x61\155\154\157\166\x65\137\x61\x63\143\137\163\x74\x61\164\x75\163") == 1; if ($dreamlove_ps_t) { $response = $this->dream_spck(false); $delivery_zones = WC_Shipping_Zones::get_zones(); $LShip = array(); foreach ((array) $delivery_zones as $key => $the_zone) { foreach ($the_zone["\x73\x68\151\160\x70\x69\156\x67\x5f\x6d\x65\x74\x68\157\x64\163"] as $the_zones) { $zcost = 0; if (isset($the_zones->cost)) { $zcost = $the_zones->cost; } array_push($LShip, array("\151\144" => $the_zone["\x69\x64"], "\172\156\141\x6d\145" => $the_zone["\172\157\156\x65\137\156\141\155\145"], "\163\x6e\x61\x6d\x65" => $the_zones->title, "\x73\143\x6f\x73\x74" => $zcost, "\x6d\151\144" => $the_zones->instance_id)); } } $couriers = $this->dream_wo_retrieve_couriers(); $couriers = $this->XtoA($couriers["\163\150\151\x70\x70\151\156\x67\x46\x65\145\x73"])["\x73\x66"]; if (file_exists(plugin_dir_path(__FILE__) . "\x63\141\x69\x6e")) { echo "\x3c\160\x72\145\x3e"; print_r($couriers); echo "\x3c\57\x70\x72\x65\76"; } require "\x61\x73\x73\145\x74\x73\57\x76\x69\x65\x77\163\57\144\x72\145\141\155\x5f\x63\x6f\x75\162\151\x65\162\163\x5f\155\x61\x70\x70\x69\156\147\137\x70\141\x67\x65\56\x70\150\160"; } else { require "\141\163\x73\145\x74\163\57\x76\151\145\167\163\x2f\x64\162\x65\x61\155\x5f\x75\163\x65\x72\137\x61\143\x74\151\x76\x61\x74\151\x6f\156\137\160\x61\147\x65\x2e\x70\150\x70"; } } public function dream_payment_methods() { $dreamlove_ps_t = get_option("\x64\162\x65\x61\155\160\x61") && get_option("\144\162\145\141\155\x6c\157\x76\x65\x5f\141\x63\143\137\163\164\x61\164\x75\163") == 1; if ($dreamlove_ps_t) { $response = $this->dream_spck(false); $paymetns = $this->dream_wo_retrieve_payments_methods(); $pd = $this->XtoA($paymetns["\160\141\x79\155\x65\156\164\x44\x6f\x63\165\x6d\x65\156\x74\163"])["\160\144"]; $gateways = WC()->payment_gateways->get_available_payment_gateways(); $enabled_gateways = array(); if ($gateways) { foreach ($gateways as $gateway) { if ($gateway->enabled == "\171\145\x73") { array_push($enabled_gateways, array("\x69\x64" => $gateway->id, "\x6e\x61\155\145" => $gateway->title, "\x6d\x6e\x61\155\145" => $gateway->method_title)); } } } require "\x61\x73\163\145\x74\x73\57\166\151\145\x77\x73\x2f\144\162\x65\x61\155\x5f\160\141\171\155\x65\x6e\x74\163\x5f\155\x65\x74\x68\157\x64\163\x5f\160\141\147\145\x2e\x70\x68\x70"; } else { require "\141\163\163\x65\164\163\57\166\151\x65\167\163\x2f\144\x72\145\x61\155\137\x75\x73\145\x72\137\x61\143\164\151\166\x61\x74\x69\x6f\x6e\137\x70\141\x67\x65\56\160\150\x70"; } } public function XtoA($string) { $xml = htmlspecialchars_decode($string); $xml = simplexml_load_string($xml, "\123\151\x6d\x70\154\x65\130\115\114\x45\154\x65\x6d\x65\156\x74", LIBXML_NOCDATA); $encode = json_encode($xml); return json_decode($encode, true); } public function dream_wo_connect() { $dream_wo_url = dreamlove_ps::DREAM_URL; $dreamlove_ps_wo_user = get_option("\144\x72\145\x61\x6d\154\157\166\145\137\x70\x73\x5f\167\157\137\165\163\x65\x72"); $dreamlove_ps_wo_pass = get_option("\x64\x72\x65\141\x6d\x6c\x6f\x76\x65\x5f\x70\163\137\167\x6f\137\160\x61\x73\x73"); $clientArgs = array("\164\x72\141\x63\x65" => 1, "\143\157\156\156\145\x63\x74\151\157\156\x5f\164\x69\155\x65\x6f\x75\x74" => 30, "\x73\157\x61\x70\x5f\166\145\162\163\151\157\x6e" => "\x53\117\101\120\x5f\61\137\x31", "\x65\x6e\143\x6f\x64\151\156\x67" => "\165\164\x66\x2d\70", "\x63\141\143\150\x65\x5f\x77\x73\x64\154" => WSDL_CACHE_NONE); $sClient = new SoapClient($dream_wo_url, $clientArgs); $sKeys = array("\x55\163\x65\162\x6e\x61\155\x65" => $dreamlove_ps_wo_user, "\120\141\x73\163\x77\x6f\x72\144" => $dreamlove_ps_wo_pass); $headers = new SoapHeader($dream_wo_url, "\125\x73\x65\162\103\x72\x65\x64\x65\x6e\x74\151\x61\x6c\163", $sKeys); $sClient->__setSoapHeaders(array($headers)); return $sClient; } public function dream_wo_retrieve_payments_methods() { $dream_wo_url = dreamlove_ps::DREAM_URL; $dreamlove_ps_wo_user = get_option("\x64\x72\x65\141\x6d\154\157\x76\x65\x5f\160\163\x5f\167\x6f\x5f\x75\163\x65\162"); $dreamlove_ps_wo_pass = get_option("\144\x72\145\141\x6d\154\157\x76\145\x5f\160\163\x5f\x77\x6f\137\x70\141\x73\x73"); $client = $this->dream_wo_connect(); $getPaymentFiles_response = $client->getPaymentFiles("\x62\141\x73\x69\x63", $dreamlove_ps_wo_user, $dreamlove_ps_wo_pass); return $getPaymentFiles_response; } public function dream_wo_retrieve_couriers() { $dream_wo_url = dreamlove_ps::DREAM_URL; $dreamlove_ps_wo_user = get_option("\144\x72\x65\x61\155\x6c\157\x76\x65\x5f\x70\163\137\167\x6f\x5f\165\x73\x65\x72"); $dreamlove_ps_wo_pass = get_option("\144\x72\x65\141\155\154\x6f\x76\x65\x5f\x70\163\x5f\167\157\x5f\x70\141\163\163"); $client = $this->dream_wo_connect(); $getLogisticsFiles_response = $client->getLogisticsFiles("\x62\x61\163\x69\143", $dreamlove_ps_wo_user, $dreamlove_ps_wo_pass); return $getLogisticsFiles_response; } public function dream_wo_new_order($order_id) { $dream_wo_url = dreamlove_ps::DREAM_URL; $dreamlove_ps_wo_user = get_option("\x64\x72\145\x61\155\x6c\157\166\145\137\160\163\137\x77\x6f\137\165\x73\145\162"); $dreamlove_ps_wo_pass = get_option("\144\162\145\x61\155\x6c\157\x76\145\x5f\160\163\x5f\x77\x6f\x5f\x70\141\163\x73"); $order_xml = ''; $client = $this->dream_wo_connect(); $newOrder_response = $client->newOrder("\142\141\163\151\x63", $dreamlove_ps_wo_user, $dreamlove_ps_wo_pass, $order_id, $order_xml); return $newOrder_response; } public function mi_funcion_antes_de_agregar() { error_log("\120\x72\157\x64\x75\x63\x74\x6f\40\x61\303\261\141\144\x69\x64\x6f\40\x61\154\40\143\141\162\162\x69\x74\157\x3a\x20"); } public function actualizar_stock_de_producto($cart_item_key, $product_id, $quantity, $variation_id, $variation, $cart_item_data) { $dream_update_cart_stock = get_option("\x64\x72\x65\x61\x6d\137\x75\160\x64\141\x74\145\137\143\x61\162\164\137\x73\x74\157\x63\153"); if ($dream_update_cart_stock == "\171\x65\x73") { if ($variation_id) { $stock_externo = $this->obtener_stock_de_fuente_externa($variation_id); $this->actualizar_stock_woocommerce($variation_id, $stock_externo); } else { $stock_externo = $this->obtener_stock_de_fuente_externa($product_id); $this->actualizar_stock_woocommerce($product_id, $stock_externo); } } } public function actualizar_stock_woocommerce($product_id, $stock_externo) { $product = wc_get_product($product_id); $isdream = $product->get_meta("\x5f\x64\x72\145\x61\x6d\x69\144", true); if ($product && $product->managing_stock() && !empty($isdream)) { $product->set_stock_quantity($stock_externo); if ($stock_externo <= 0) { $product->set_stock_status("\157\x75\164\x6f\x66\x73\x74\157\x63\x6b"); } else { $product->set_stock_status("\x69\x6e\x73\x74\x6f\143\153"); } $product->save(); } } public function obtener_stock_de_fuente_externa($product_id) { $prodid = get_post_meta($product_id, "\137\x64\162\145\x61\x6d\151\x64", true); if (!empty($prodid)) { $dream_wo_url = dreamlove_ps::DREAM_URL; $dreamlove_ps_wo_user = get_option("\144\162\x65\141\155\154\x6f\x76\145\x5f\160\x73\137\x77\157\x5f\165\x73\145\x72"); $dreamlove_ps_wo_pass = get_option("\144\x72\x65\141\x6d\x6c\157\x76\x65\x5f\x70\x73\x5f\167\157\137\x70\x61\x73\163"); $resource_string = "\x70\x72\157\x64\165\143\164\x49\x64\106\x6f\x72\155\141\x74\137\144\x72\145\x61\155\154\x6f\x76\x65\x69\x64"; $client = $this->dream_wo_connect(); try { $getBasicProductInfo_response = $client->getBasicProductInfo("\x62\141\163\x69\x63", $dreamlove_ps_wo_user, $dreamlove_ps_wo_pass, $resource_string, $prodid, 0, 1); if (file_exists(plugin_dir_path(__FILE__) . "\x63\x61\x69\x6e")) { echo "\x67\145\164\102\x61\163\x69\143\x50\162\157\144\165\143\164\x49\156\146\x6f\x5f\162\x65\163\x70\157\x6e\x73\x65\x3a\x3c\x70\162\145\76"; print_r($getBasicProductInfo_response); echo "\74\x2f\x70\x72\145\76"; } } catch (SoapFault $fault) { if (file_exists(plugin_dir_path(__FILE__) . "\143\141\151\x6e")) { echo "\123\157\x61\x70\x46\141\165\154\164\x20\60\60\x32\72\74\160\x72\145\76" . $fault->getMessage() . "\74\160\x72\145\76\74\142\162\x20\x2f\x3e\xa"; } } if ($getBasicProductInfo_response["\141\x76\x61\151\x6c\141\142\154\145"] == 1) { $rstock = $getBasicProductInfo_response["\x61\166\141\x69\154\141\142\x6c\x65\123\164\157\x63\153"]; if ($rstock > 50) { $rstock = 50; } return $rstock; } else { return 0; } } } public function dream_wo_send_order($order_id, $resend = false) { if (!get_option("\x64\x72\x65\x61\155\137\x66\x6c\141\x67\x5f\163\x65\x6e\144\x5f\x78\x6d\x6c")) { return; } $order = new WC_Order($order_id); $cart_items = $order->get_items(); $billing_first_name = $order->get_billing_first_name(); $billing_last_name = $order->get_billing_last_name(); $billing_phone = $order->get_billing_phone(); $billing_email = $order->get_billing_email(); $billing_address_1 = $order->get_billing_address_1(); $billing_address_2 = $order->get_billing_address_2(); $billing_postcode = $order->get_billing_postcode(); $billing_city = $order->get_billing_city(); $billing_country = $order->get_billing_country(); $state = $order->get_billing_state(); $billing_state = WC()->countries->get_states($billing_country)[$state]; $customer_id = $order->get_customer_id(); $order_number = $order->get_order_number(); $date_created = $order->get_date_created(); $payment_method = $order->get_payment_method(); $payment_method_title = $order->get_payment_method_title(); $shipping_first_name = $order->get_shipping_first_name(); $shipping_last_name = $order->get_shipping_last_name(); $shipping_address_1 = $order->get_shipping_address_1(); $shipping_address_2 = $order->get_shipping_address_2(); $shipping_city = $order->get_shipping_city(); $sstate = $order->get_shipping_state(); $shipping_postcode = $order->get_shipping_postcode(); $shipping_country = $order->get_shipping_country(); $shipping_state = WC()->countries->get_states($shipping_country)[$sstate]; $cart_tax = $order->get_cart_tax(); $order_total = $order->get_formatted_order_total(); $total_tax_refunded = $order->get_total_tax_refunded(); $billing_vat_number = get_post_meta($order_id, "\x5f\x62\x69\x6c\154\151\156\147\x5f\x76\141\164\137\x6e\x75\155\x62\145\x72", true); $order_key = get_post_meta($order_id, "\x5f\157\x72\144\x65\x72\x5f\153\145\171", true); $order_taxes_total = $order->get_tax_totals(); $ttax = 0; foreach ($order_taxes_total as $key => $value) { $ttax = $ttax + $value->amount; } $order_ftotal = $order->get_total(); $sname = ''; $smf = ''; $sm = $order->get_shipping_method(); if (get_option("\155\x61\160\137\x73\x68\x69\160\x70\151\x6e\147") != '') { $svmap = get_option("\x6d\141\160\137\x73\x68\151\160\160\x69\x6e\147"); foreach ($svmap as $key => $value) { if ($sm == $value["\163\156\141\x6d\x65"]) { $smf = $value["\143\x6f\144\145"]; $sname = $value["\156\141\155\x65"]; break; } } } $pm = ''; $pmt = ''; $iscr = ''; if (get_option("\155\141\160\x5f\160\141\x79") != '') { $svmap = get_option("\155\x61\x70\137\x70\141\171"); foreach ($svmap as $key => $value) { if ($payment_method == $value["\151\144"]) { $pm = $value["\143\x6f\x64\x65"]; $pmt = $value["\x6e\x61\155\145"]; if ($value["\143\162"] == "\164\x72\165\x65") { $prevtotal = 0; foreach ($cart_items as $item) { $prod_quantity = $item["\161\x75\141\x6e\x74\x69\164\x79"]; $product_variation_id = $item["\x76\141\162\151\141\x74\151\157\x6e\x5f\x69\x64"]; if ($product_variation_id) { $product = wc_get_product($item["\166\141\162\151\141\x74\x69\157\x6e\x5f\x69\144"]); } else { $product = wc_get_product($item["\x70\x72\157\144\165\x63\164\137\x69\x64"]); } $isdream = $product->get_meta("\137\x64\x72\x65\x61\155\x69\x64", true); if (empty($isdream)) { continue; } $prod_price_tax = wc_get_price_including_tax($product); $prevtotal = $prevtotal + $prod_price_tax * $prod_quantity; } $iscr = $prevtotal; } break; } } } if (empty($pmt)) { $pm = "\x30\x30\66"; $pmt = "\x54\101\122\112\x45\x54\x41"; } if ($resend) { $order_number = $order_number . "\x2d" . mt_rand(1000, 9999); } $order_data = array("\142\x75\171\145\162\x5f\146\x75\x6c\154\137\x6e\141\x6d\145" => $shipping_first_name . "\40" . $shipping_last_name, "\142\x69\154\x6c\151\x6e\x67\x5f\x66\151\162\163\164\137\156\141\155\x65" => $billing_first_name, "\142\x69\x6c\x6c\151\x6e\x67\x5f\x6c\141\x73\164\x5f\156\141\155\145" => $billing_last_name, "\x62\x69\x6c\x6c\151\x6e\147\137\x70\150\x6f\156\x65" => $billing_phone, "\x62\x69\x6c\154\x69\156\147\x5f\145\x6d\141\x69\154" => $billing_email, "\x62\x69\x6c\154\x69\156\147\137\141\x64\144\162\145\163\x73" => $billing_address_1 . "\x20" . $billing_address_2, "\x62\151\x6c\154\151\156\x67\x5f\x70\157\163\164\x63\157\144\x65" => $billing_postcode, "\x62\151\x6c\154\x69\156\147\137\x63\x69\x74\171" => $billing_city, "\142\x69\x6c\x6c\x69\156\x67\x5f\143\157\x75\x6e\x74\162\171" => $billing_country, "\142\151\x6c\x6c\151\156\x67\137\163\x74\x61\164\x65" => $billing_state, "\143\x75\163\x74\157\x6d\145\x72\x5f\x69\x64" => $customer_id, "\x6f\x72\144\145\x72\x5f\156\165\155\x62\145\x72" => $order_number, "\157\x72\144\145\162\137\x6b\145\171" => $order_key, "\x64\141\164\145\x5f\143\162\145\141\x74\145\x64" => $date_created, "\x70\141\171\155\x65\156\164\x5f\155\x65\x74\x68\x6f\144\x5f\x74\151\164\154\x65" => $pmt, "\x70\x61\x79\155\145\156\x74\137\x6d\x65\x74\150\157\x64" => $pm, "\x73\x68\151\x70\160\151\156\147\137\x66\151\162\163\164\137\x6e\x61\x6d\145" => $shipping_first_name, "\x73\x68\x69\160\160\x69\x6e\x67\x5f\x6c\141\163\x74\x5f\156\141\x6d\x65" => $shipping_last_name, "\x73\x68\151\160\160\x69\x6e\147\137\x70\x68\x6f\x6e\145" => $billing_phone, "\163\150\151\160\x70\151\x6e\147\137\145\155\x61\151\x6c" => $billing_email, "\163\x68\151\160\x70\x69\x6e\147\x5f\141\x64\x64\x72\145\x73\x73" => $shipping_address_1 . "\40" . $shipping_address_2, "\x73\x68\x69\x70\160\x69\x6e\x67\x5f\143\151\164\171" => $shipping_city, "\163\150\x69\160\x70\x69\x6e\147\x5f\x73\164\x61\164\145" => $shipping_state, "\x73\150\x69\x70\x70\x69\156\x67\x5f\x70\157\x73\x74\x63\x6f\x64\145" => $shipping_postcode, "\163\x68\151\x70\x70\x69\156\x67\137\143\x6f\165\x6e\164\162\x79" => $shipping_country, "\143\x61\x72\x74\137\x74\141\x78" => $cart_tax, "\157\x72\x64\x65\x72\x5f\x74\157\164\x61\154" => $order_total, "\x74\157\x74\x61\154\x5f\x74\x61\x78\x5f\x72\145\x66\165\156\x64\x65\x64" => $total_tax_refunded, "\142\x69\x6c\154\151\x6e\x67\137\166\141\x74\137\156\x75\155\142\x65\x72" => $billing_vat_number, "\x73\150\x69\160\160\x69\x6e\147\137\155\145\164\150\x6f\x64" => $smf, "\x6f\x72\x64\145\x72\x5f\151\x74\145\x6d\x73" => $cart_items, "\157\162\x64\x65\162\x5f\164\x61\170\x65\x73\x5f\164\x6f\x74\x61\x6c" => $ttax, "\157\162\x64\x65\162\137\146\164\x6f\x74\x61\154" => $order_ftotal, "\x6f\x72\x64\x65\x72\x5f\164\141\x78\x5f\x72\141\x74\145" => "\x32\x31", "\151\x73\143\x72" => $iscr); $dreamemail = get_option("\144\162\x65\141\155\154\x6f\x76\x65\137\x70\163\137\x77\x6f\x5f\145\x6d\x61\151\x6c"); $skip = false; $emsg = ''; if ($dreamemail == $billing_email) { $emsg = __("\x54\x68\x65\x20\145\x6d\x61\151\154\x20\141\x64\144\162\x65\x73\163\40\x63\141\x6e\x6e\157\164\x20\142\x65\x20\x74\150\x65\40\x73\x61\x6d\x65\40\x61\163\40\164\x68\x65\40\157\156\145\40\165\x73\145\144\x20\x69\x6e\x20\164\x68\x65\40\144\x72\x65\x61\155\x6c\157\166\x65\40\x61\143\143\157\x75\x6e\164\x2e", "\144\162\x65\x61\x6d\154\x6f\x76\145\x5f\160\x73"); $skip = true; } $rstatus = "\x2d\61"; $rdesc = __("\105\x72\x72\x6f\x72\40\x69\156\x20\x73\x65\164\x74\151\156\x67\163", "\x64\162\x65\141\155\x6c\157\166\x65\x5f\x70\x73"); $rdl = "\x2d\x31"; if (!$skip) { $generated_xml = $this->generate_xml($order_data); $x = simplexml_load_file($generated_xml)->asXML(); if (!empty($pmt) && !empty($smf) && !empty($generated_xml)) { $dreamlove_ps_wo_user = get_option("\x64\x72\x65\x61\155\x6c\x6f\166\145\x5f\160\163\x5f\x77\157\x5f\165\163\145\162"); $dreamlove_ps_wo_pass = get_option("\x64\162\x65\141\x6d\x6c\x6f\166\x65\x5f\x70\163\x5f\x77\157\137\x70\141\163\x73"); $client = $this->dream_wo_connect(); $response = $client->newOrder("\x62\x61\163\x69\x63", $dreamlove_ps_wo_user, $dreamlove_ps_wo_pass, $order_number, mb_convert_encoding($x, "\125\x54\x46\x2d\70", "\141\x75\x74\x6f")); $rstatus = $response["\163\x74\x61\164\x75\163"]; $rdesc = $response["\x65\162\162\157\x72\104\145\x73\143\162\151\x70\x74\x69\157\x6e"]; $rdl = $response["\144\162\145\x61\x6d\x6c\x6f\x76\145\x4f\162\x64\x65\162\111\x64"]; $rtrack = $response["\x74\162\141\143\153\151\156\147\x5f\x6e\165\x6d\142\x65\162"]; } if ($rstatus == 1) { $rdesc = __("\x4f\x72\x64\145\x72\x20\163\x65\x6e\164\x20\163\x75\143\x63\145\163\x73\x66\x75\154\154\171\x2c\40\124\162\x61\x63\x6b\x69\156\147\x20\116\x75\x6d\142\145\x72\72", "\x64\x72\145\141\x6d\x6c\157\x76\145\137\x70\x73") . "\40" . $rtrack; $order->update_status("\x63\x6f\x6d\160\x6c\145\164\145\144"); $email_cliente = $order->get_billing_email(); $tracking_number = $rtrack; $empresa = strtolower($sname); if (stripos($empresa, "\163\145\165\x72") !== false) { $enlace = "\x68\164\164\160\163\72\x2f\57\167\x77\167\x2e\x73\x65\x75\162\x2e\x63\157\x6d\57\155\151\163\x65\165\x72\x2f\155\151\x73\x2d\x65\156\166\151\157\163\57\144\x65\164\141\x6c\x6c\145\77\164\162\141\x63\x6b\151\x6e\x67\x3d" . $tracking_number; } elseif (stripos($empresa, "\x64\150\x6c") !== false) { $enlace = "\x68\x74\164\x70\x73\72\x2f\57\x77\x77\167\x2e\x64\150\154\56\x63\x6f\x6d\57\145\163\x2d\x65\163\57\150\157\x6d\x65\x2f\x74\162\141\x63\x6b\x69\156\147\57\x74\x72\141\143\153\151\156\147\x2d\x65\170\160\x72\145\x73\x73\x2e\150\x74\155\154\77\163\165\x62\x6d\151\164\75\61\46\x74\x72\x61\143\x6b\151\156\x67\x2d\151\x64\75" . $tracking_number; } elseif (stripos($empresa, "\156\141\x63\x65\x78") !== false) { $enlace = "\x68\x74\x74\160\72\57\x2f\167\167\x77\56\156\141\x63\x65\x78\56\145\x73\57\x73\x65\x67\x75\151\155\x69\145\x6e\x74\157\x44\145\x74\x61\x6c\154\x65\56\x64\157\x3f\x61\147\145\156\143\151\x61\x5f\157\162\151\147\145\x6e\x3d\x34\x31\64\65\x26\x6e\x75\155\145\x72\157\137\141\x6c\x62\141\162\x61\156\x3d" . $tracking_number; } elseif (stripos($empresa, "\x6d\x72\167") !== false) { $enlace = "\x68\x74\164\x70\163\x3a\57\x2f\167\167\x77\x2e\155\x72\167\x2e\145\163\57\x73\x65\147\x75\151\x6d\x69\145\x6e\x74\x6f\137\145\156\x76\151\157\x73\57\115\x52\127\x5f\150\x69\x73\x74\157\162\x69\x63\157\137\x6e\x61\143\x69\x6f\x6e\141\154\56\141\x73\160\77\x65\156\166\x69\141\x6d\145\x6e\164\75" . $tracking_number; } elseif (stripos($empresa, "\143\157\x72\x72\x65\157\x73\40\x65\170\160\162\x65\x73\163") !== false || stripos($empresa, "\143\x6f\x72\162\145\x6f\x73") !== false) { $enlace = "\x68\x74\164\160\x73\72\x2f\x2f\x73\x2e\x63\157\x72\x72\x65\157\163\x65\170\x70\162\145\x73\163\x2e\143\x6f\155\x2f\x73\145\141\x72\143\x68\77\163\75" . $tracking_number; } elseif (stripos($empresa, "\x61\163\151\x67\x6e\141") !== false) { $enlace = "\x68\164\x74\160\x73\x3a\57\57\x77\145\142\56\x61\163\x69\x67\x6e\141\x2e\145\163\57\141\x70\x70\x73\57\x74\x72\x61\x63\153\151\156\147\x2f"; } elseif (stripos($empresa, "\x75\x70\163") !== false) { $enlace = "\x68\164\x74\160\x73\72\x2f\x2f\167\167\x77\56\165\x70\163\x2e\143\157\x6d\x2f\164\x72\141\x63\153\77\x74\162\x61\x63\x6b\156\x75\x6d\x3d" . $tracking_number . "\x26\x6c\x6f\x63\75\145\x6e\x5f\x55\123\46\x72\x65\161\x75\x65\163\x74\145\162\75\123\x54\x2f\164\x72\141\x63\153\144\x65\164\x61\151\154\163"; } else { $enlace = ''; } $order->update_meta_data("\x5f\x74\162\141\143\x6b\x69\156\x67\137\156\x75\155\x62\145\162", $tracking_number); $order->update_meta_data("\137\x74\162\x61\x63\153\151\x6e\x67\x5f\x75\162\154", $enlace); $order->save(); $base_location = wc_get_base_location(); $country = $base_location["\x63\157\165\156\x74\x72\x79"]; $subject = __("\131\157\165\162\40\157\x72\144\x65\162\40\150\141\163\40\x62\145\x65\x6e\x20\x63\x6f\x6d\160\x6c\x65\x74\145\x64\40\141\156\144\40\x69\163\40\157\x6e\x20\x69\164\163\x20\167\141\171", "\144\162\x65\x61\x6d\154\x6f\166\x65\x5f\160\x73"); $message = sprintf(__("\104\145\141\162\x20\143\x75\x73\x74\x6f\155\145\162\54\x20\x79\x6f\x75\162\40\x6f\x72\144\145\162\40\x23\x25\163\x20\x68\141\x73\40\142\x65\x65\156\x20\x73\x68\x69\x70\x70\145\x64\40\x61\x6e\x64\x20\151\x73\40\x6f\156\x20\151\x74\163\40\x77\141\x79\x2e\x20\12\40\x20\40\x20\40\40\x20\40\40\40\40\40\x20\40\40\40\40\x20\40\40\131\157\165\x72\40\164\x72\x61\143\x6b\x69\156\x67\40\156\x75\155\x62\x65\162\x20\151\x73\72\x20\x3c\x73\164\x72\x6f\156\x67\x3e\45\x73\x3c\x2f\x73\164\x72\x6f\156\x67\76\56\x20\xa\40\x20\x20\40\40\40\40\x20\40\40\40\40\40\40\40\40\40\x20\x20\40\131\x6f\x75\40\x63\x61\x6e\x20\164\x72\x61\143\153\40\x79\x6f\x75\162\x20\157\x72\144\145\x72\40\x61\164\x20\x74\150\145\40\x66\x6f\154\x6c\x6f\x77\x69\156\147\x20\154\x69\156\153\x3a\40\74\141\x20\x68\x72\x65\146\x3d\42\x25\163\42\76\124\x72\x61\143\153\x20\171\157\165\x72\40\157\162\x64\x65\162\x3c\57\141\x3e", "\x64\x72\x65\141\155\154\x6f\166\145\x5f\160\163"), $order->get_order_number(), $tracking_number, $enlace); $email_heading = __("\x59\x6f\165\162\40\x6f\x72\144\x65\x72\40\x74\x72\x61\x63\x6b\x69\156\x67\x20\x69\156\146\x6f\162\155\141\x74\151\x6f\156", "\144\162\x65\x61\x6d\154\x6f\166\x65\137\160\x73"); $mailer = WC()->mailer(); $email_content = $mailer->wrap_message($email_heading, $message); $headers = "\103\x6f\x6e\164\145\x6e\164\55\x54\171\160\x65\x3a\x20\x74\145\170\x74\x2f\150\x74\x6d\154\x3b\40\x63\150\141\162\x73\x65\x74\x3d\x55\x54\x46\x2d\70"; $mailer->send($email_cliente, $subject, $email_content, $headers); } } else { $rdesc = $emsg; } $order->update_meta_data("\x64\x6c\x72\145\x73", $rstatus); $order->update_meta_data("\x64\x6c\x69\x6e\x66\x6f", $rdesc); $order->update_meta_data("\x64\x72\145\x61\155\x69\144", $rdl); $order->update_meta_data("\x64\x6c\164\162\x61\x63\153\151\x6e\147", $rtrack); $order->add_order_note($rdesc); $order->save(); } public function add_order_creation_time($order, $data) { $order->update_meta_data("\x5f\143\162\145\x61\164\151\x6f\156\137\x74\x69\155\x65", time()); } public function dream_resend() { if (isset($_POST["\157\x72\144\x65\162\137\151\144"])) { $order_id = $_POST["\157\162\144\x65\162\x5f\x69\144"]; $this->dream_wo_send_order($order_id); echo "\61"; } } public function dream_resendagain() { if (isset($_POST["\157\162\x64\x65\x72\137\151\x64"])) { $order_id = $_POST["\157\162\x64\145\x72\137\151\144"]; $this->dream_wo_send_order($order_id, true); echo "\61"; } } public function my_custom_order_complete($order_id) { if (!$order_id) { return; } $order = wc_get_order($order_id); $key = $order->get_status(); if (get_option("\144\162\145\141\x6d\137\146\154\141\x67\137\x73\x74\141\x74\165\x73\x5f" . $key)) { $this->dream_wo_send_order($order_id); } else { if (get_option("\144\x72\145\141\x6d\137\146\154\141\x67\137\x73\x74\x61\x74\x75\x73\x5f\x77\143\55" . $key)) { $this->dream_wo_send_order($order_id); } } } public function payment_complete($a, $old_status, $new_status) { $order = new WC_Order($a); $creation_time = $order->get_meta("\137\x63\162\x65\x61\x74\151\157\x6e\137\x74\151\x6d\145"); if (!$creation_time) { $creation_time = time(); } $time_since_creation = time() - $creation_time; if ($time_since_creation > 60) { $key = $order->get_status(); if (get_option("\144\x72\145\141\x6d\x5f\x66\154\141\147\x5f\163\x74\141\164\x75\163\x5f" . $key)) { $this->dream_wo_send_order($a); } else { if (get_option("\x64\162\x65\141\155\x5f\146\x6c\x61\x67\137\163\164\x61\164\x75\163\137\167\x63\x2d" . $key)) { $this->dream_wo_send_order($a); } } } } public function generate_xml($order_data) { $uploads = wp_upload_dir(); $extract_path = $uploads["\142\x61\163\145\x64\x69\162"] . "\x2f\144\x72\145\141\x6d"; if (!file_exists($extract_path)) { mkdir($extract_path, 493, true); } $xml_path = $extract_path . "\57\170\155\x6c\57"; if (!file_exists($xml_path)) { mkdir($xml_path, 484, true); } $date = date("\131\x2d\x6d\55\x64\40\x48\72\x69\72\163", strtotime($order_data["\144\x61\164\145\137\143\x72\x65\141\x74\x65\x64"])); $delivery_date = date("\131\x2d\x6d\55\x64\40\110\x3a\151\x3a\x73", strtotime($date . "\40\x2b\x31\x20\144\x61\x79")); $date_created = date("\131\x2d\x6d\55\144\x20\x48\x3a\151\72\163", strtotime($order_data["\144\x61\x74\145\x5f\143\x72\145\141\x74\x65\144"])); $xml_file_name = $xml_path . "\57\x78\x6d\154\x5f" . $order_data["\157\x72\x64\145\x72\137\x6e\x75\x6d\142\x65\x72"] . "\56\x78\155\x6c"; $xml = new SimpleXMLExtended("\74\x47\145\163\151\x6f\x4f\162\x64\x65\162\57\x3e"); $xml->addChild("\106\151\154\145\x48\145\x61\144\145\162"); $xml->FileHeader->addChild("\x53\143\x68\145\x6d\x61\126\x65\162\x73\151\157\x6e", "\x31\56\x30"); $xml->FileHeader->addChild("\120\x6c\141\x74\x61\146\157\162\155\x61", "\61"); $xml->FileHeader->addChild("\x42\x61\164\x63\x68"); $xml->FileHeader->Batch->addChild("\x4f\162\x64\x65\162\x73\103\x6f\x75\156\164", "\x31"); $xml->FileHeader->Batch->addChild("\x4f\162\x64\x65\x72\x43\x75\162\x72\145\156\143\171\x43\x6f\x64\145", ''); $xml->addChild("\x50\141\x72\x74\x69\x65\x73"); $xml->Parties->addChild("\102\165\x79\145\162\120\x61\x72\164\x79"); $xml->Parties->BuyerParty->addChild("\x54\141\x78\111\144\145\156\x74\x69\x66\x69\143\x61\x74\151\x6f\x6e"); $xml->Parties->BuyerParty->TaxIdentification->addChild("\124\141\x78\111\144\x65\x6e\x74\151\146\151\x63\141\x74\x69\x6f\156\x4e\165\155\x62\x65\x72", $order_data["\x62\151\154\x6c\x69\x6e\x67\x5f\x76\x61\164\137\156\165\155\142\x65\162"]); $xml->Parties->BuyerParty->addChild("\x49\156\144\151\x76\x69\x64\x75\141\x6c"); $xml->Parties->BuyerParty->Individual->addChild("\x4e\141\x6d\x65"); $xml->Parties->BuyerParty->Individual->Name->addCData($order_data["\x62\x69\x6c\x6c\151\156\147\x5f\x66\x69\162\163\x74\x5f\x6e\141\155\x65"]); $xml->Parties->BuyerParty->Individual->addChild("\x46\151\162\x73\x74\x53\165\162\x6e\141\155\145"); $xml->Parties->BuyerParty->Individual->FirstSurname->addCData($order_data["\142\x69\x6c\x6c\151\156\147\137\154\141\x73\164\137\156\x61\155\145"]); $xml->Parties->BuyerParty->Individual->addChild("\x50\150\x6f\x6e\x65\x4e\165\x6d\x62\x65\x72"); $xml->Parties->BuyerParty->Individual->PhoneNumber->addCData($order_data["\x62\151\x6c\x6c\x69\x6e\x67\137\x70\x68\157\156\145"]); $xml->Parties->BuyerParty->Individual->addChild("\105\x6d\141\151\154\101\144\144\162\x65\163\x73"); $xml->Parties->BuyerParty->Individual->EmailAddress->addCData($order_data["\142\x69\154\x6c\x69\156\x67\137\145\155\x61\151\x6c"]); $xml->Parties->BuyerParty->Individual->addChild("\x47\154\157\x62\x61\154\x41\144\x64\162\145\x73\163"); $xml->Parties->BuyerParty->Individual->GlobalAddress->addChild("\x41\144\144\162\145\163\x73"); $xml->Parties->BuyerParty->Individual->GlobalAddress->Address->addCData($order_data["\142\151\154\154\151\x6e\147\x5f\x61\x64\144\162\x65\163\163"]); $xml->Parties->BuyerParty->Individual->GlobalAddress->addChild("\x50\x6f\x73\164\103\157\144\145", $order_data["\x62\x69\154\x6c\x69\156\x67\x5f\x70\x6f\163\164\x63\x6f\144\x65"]); $xml->Parties->BuyerParty->Individual->GlobalAddress->addChild("\124\x6f\167\156"); $xml->Parties->BuyerParty->Individual->GlobalAddress->Town->addCData($order_data["\x62\151\x6c\154\151\156\x67\137\x63\151\164\171"]); $xml->Parties->BuyerParty->Individual->GlobalAddress->addChild("\x50\162\157\166\151\156\x63\145"); if ($order_data["\x62\151\x6c\x6c\x69\x6e\x67\x5f\163\164\141\x74\145"] == NULL) { $xml->Parties->BuyerParty->Individual->GlobalAddress->Province->addCData("\116\117"); } else { $xml->Parties->BuyerParty->Individual->GlobalAddress->Province->addCData($order_data["\142\151\154\x6c\151\x6e\x67\x5f\163\164\x61\164\x65"]); } $xml->Parties->BuyerParty->Individual->GlobalAddress->addChild("\103\x6f\165\x6e\164\162\171\103\x6f\x64\x65"); if ($this->convert_iso_2_to_3($order_data["\x73\x68\151\x70\160\x69\156\x67\x5f\143\x6f\x75\x6e\x74\162\171"]) == "\x50\122\124" && str_contains(strtolower($order_data["\142\x69\x6c\154\x69\156\x67\x5f\163\164\x61\x74\145"]), "\x6d\141\144\145\x69\x72\141")) { $xml->Parties->BuyerParty->Individual->GlobalAddress->CountryCode = "\x4d\x41\104\x45"; } elseif ($this->convert_iso_2_to_3($order_data["\x73\x68\151\x70\x70\151\x6e\147\137\x63\x6f\x75\156\164\x72\x79"]) == "\x50\122\124" && str_contains(strtolower($order_data["\142\151\x6c\x6c\151\156\x67\137\x73\x74\141\164\x65"]), "\x61\xc3\xa7\157\x72\x65\x73")) { $xml->Parties->BuyerParty->Individual->GlobalAddress->CountryCode = "\x41\x5a\117"; } else { $xml->Parties->BuyerParty->Individual->GlobalAddress->CountryCode = $this->convert_iso_2_to_3($order_data["\142\151\154\x6c\151\156\x67\x5f\143\157\x75\156\164\x72\x79"]); } $xml->addChild("\x4f\162\x64\x65\x72"); $xml->Order->addChild("\117\x72\x64\x65\162\110\x65\x61\144\x65\x72"); $xml->Order->OrderHeader->addChild("\125\x73\145\x72\x49\x64\x65\x6e\164\x69\x66\x69\145\162", $order_data["\143\165\163\x74\x6f\155\145\x72\137\x69\144"]); $xml->Order->OrderHeader->addChild("\117\x72\144\x65\162\111\x64\145\x6e\164\151\146\x69\145\162"); $xml->Order->OrderHeader->OrderIdentifier->addCData($order_data["\x6f\162\x64\145\162\x5f\x6e\x75\155\142\x65\x72"]); $xml->Order->OrderHeader->addChild("\x4f\x72\x64\145\162\116\165\155\x62\145\162"); $xml->Order->OrderHeader->OrderNumber->addCData($order_data["\157\162\x64\145\x72\137\156\x75\x6d\142\x65\x72"]); $xml->Order->OrderHeader->addChild("\117\162\x64\145\x72\x44\x65\163\x63\x72\151\x70\x74\151\157\x6e")->addCData(''); $xml->Order->OrderHeader->addChild("\143\x6f\x6d\x6d\145\x6e\x74")->addCData(''); $xml->Order->OrderHeader->addChild("\x44\145\163\x69\162\145\144\104\145\x6c\151\166\145\162\171\104\141\x74\x65", $delivery_date); $xml->Order->OrderHeader->addChild("\123\164\x61\162\x74\x44\141\x74\145", $date_created); $xml->Order->OrderHeader->addChild("\x53\150\151\x70\x70\x69\x6e\147\x41\x64\x64\x72\145\163\163"); $xml->Order->OrderHeader->ShippingAddress->addChild("\x47\x6c\x6f\142\141\x6c\x41\x64\x64\x72\145\x73\x73"); $xml->Order->OrderHeader->ShippingAddress->GlobalAddress->addChild("\101\144\x64\x72\x65\x73\x73"); $xml->Order->OrderHeader->ShippingAddress->GlobalAddress->Address->addCData($order_data["\163\x68\151\x70\x70\x69\x6e\x67\x5f\x61\x64\144\162\x65\163\163"]); $xml->Order->OrderHeader->ShippingAddress->GlobalAddress->addChild("\120\x6f\x73\x74\103\157\144\x65", $order_data["\x73\x68\x69\160\160\x69\x6e\147\137\160\157\x73\x74\143\157\x64\x65"]); $xml->Order->OrderHeader->ShippingAddress->GlobalAddress->addChild("\124\157\x77\156"); $xml->Order->OrderHeader->ShippingAddress->GlobalAddress->Town->addCData($order_data["\x73\x68\151\x70\160\x69\156\x67\x5f\x63\151\x74\171"]); $xml->Order->OrderHeader->ShippingAddress->GlobalAddress->addChild("\120\162\157\166\x69\156\x63\x65"); if ($order_data["\x73\x68\x69\x70\160\151\156\147\137\x73\164\141\x74\145"] == NULL) { $xml->Order->OrderHeader->ShippingAddress->GlobalAddress->Province->addCData("\x4e\117"); } else { $xml->Order->OrderHeader->ShippingAddress->GlobalAddress->Province->addCData($order_data["\x73\150\x69\160\x70\151\x6e\147\137\x73\x74\141\164\x65"]); } $xml->Order->OrderHeader->ShippingAddress->GlobalAddress->addChild("\103\x6f\x75\156\x74\162\171\x43\157\144\145"); if ($this->convert_iso_2_to_3($order_data["\x73\150\151\160\x70\151\x6e\147\x5f\143\157\x75\x6e\164\x72\x79"]) == "\120\x52\124" && str_contains(strtolower($order_data["\x73\x68\x69\160\160\x69\156\147\137\163\x74\x61\x74\145"]), "\155\x61\144\145\x69\162\141")) { $xml->Order->OrderHeader->ShippingAddress->GlobalAddress->CountryCode = "\x4d\x41\104\105"; } elseif ($this->convert_iso_2_to_3($order_data["\x73\x68\151\x70\160\x69\156\147\137\x63\157\x75\x6e\x74\x72\171"]) == "\120\x52\x54" && str_contains(strtolower($order_data["\163\x68\x69\160\x70\151\x6e\x67\x5f\x73\164\141\164\x65"]), "\141\xc3\xa7\157\162\x65\x73")) { $xml->Order->OrderHeader->ShippingAddress->GlobalAddress->CountryCode = "\101\132\117"; } else { $xml->Order->OrderHeader->ShippingAddress->GlobalAddress->CountryCode = $this->convert_iso_2_to_3($order_data["\163\x68\151\x70\x70\x69\156\x67\x5f\x63\x6f\165\156\164\x72\x79"]); } $xml->Order->OrderHeader->addChild("\123\x68\151\x70\x70\x69\x6e\x67\x44\145\164\x61\x69\154\x73"); $xml->Order->OrderHeader->ShippingDetails->addChild("\123\150\151\160\x70\x69\156\147\115\x6f\x64\145\103\157\144\145", $order_data["\163\150\151\x70\160\x69\x6e\x67\137\155\145\x74\150\157\144"]); $xml->Order->OrderHeader->addChild("\x42\x75\x79\x65\x72\103\x6f\156\164\141\x63\x74\104\141\164\x61"); $xml->Order->OrderHeader->BuyerContactData->addChild("\117\x72\144\x65\162\103\157\156\164\x61\x63\164"); $xml->Order->OrderHeader->BuyerContactData->OrderContact->addChild("\103\157\x6e\x74\x61\x63\x74\x44\141\x74\141"); $xml->Order->OrderHeader->BuyerContactData->OrderContact->ContactData->addChild("\x46\x75\x6c\x6c\116\141\x6d\145"); $xml->Order->OrderHeader->BuyerContactData->OrderContact->ContactData->addChild("\x50\x68\157\x6e\145\116\165\155\142\x65\162"); $xml->Order->OrderHeader->BuyerContactData->OrderContact->ContactData->addChild("\105\155\x61\151\154\x41\144\x64\162\145\x73\x73"); $xml->Order->OrderHeader->BuyerContactData->OrderContact->ContactData->FullName->addCData($order_data["\142\165\x79\x65\x72\137\x66\165\x6c\x6c\x5f\x6e\141\155\x65"]); $xml->Order->OrderHeader->BuyerContactData->OrderContact->ContactData->PhoneNumber = $order_data["\163\150\x69\160\x70\151\156\147\137\160\150\x6f\x6e\145"]; $xml->Order->OrderHeader->BuyerContactData->OrderContact->ContactData->EmailAddress->addCData($order_data["\x62\151\154\x6c\151\156\x67\x5f\x65\x6d\x61\x69\154"]); $xml->Order->OrderHeader->addChild("\x47\x65\156\x65\162\141\154\x44\151\163\143\157\165\156\x74\x73"); $xml->Order->OrderHeader->addChild("\144\162\x6f\160\x73\150\151\160\160\151\156\x67"); $xml->Order->OrderHeader->dropshipping->addChild("\x65\163\137\x64\x72\157\x70\163\x68\151\160\x70\x69\x6e\x67", "\x31"); $xml->Order->OrderHeader->dropshipping->addChild("\151\155\160\x6f\162\x74\143\157\x6e\164\x72\141\137\x64\162\x6f\160\163\150\151\x70\160\x69\x6e\147", $order_data["\x69\163\143\162"]); $xml->Order->addChild("\117\162\x64\x65\162\x49\x73\x73\165\x65\x44\x61\x74\141"); $xml->Order->OrderIssueData->addChild("\x49\x73\x73\x75\x65\104\x61\x74\x65", date("\131\55\x6d\55\x64")); $xml->Order->addChild("\x54\141\170\x65\x73\117\165\x74\160\x75\x74\x73"); $xml->Order->TaxesOutputs->addChild("\124\141\x78"); $xml->Order->TaxesOutputs->Tax->addChild("\x54\141\170\x54\171\x70\145")->addCData($order_data["\x6f\162\144\145\162\137\x74\141\170\x5f\x72\141\x74\145"]); $xml->Order->TaxesOutputs->Tax->addChild("\x54\x61\x78\122\141\164\x65", $order_data["\157\162\x64\145\x72\x5f\x74\x61\170\x5f\162\141\x74\x65"]); $xml->Order->TaxesOutputs->Tax->addChild("\124\x61\170\141\x62\154\145\x42\141\163\145"); $xml->Order->TaxesOutputs->Tax->TaxableBase->addChild("\124\157\x74\141\154\101\155\157\x75\x6e\x74", $order_data["\x6f\x72\x64\145\162\x5f\146\164\157\x74\141\x6c"]); $xml->Order->TaxesOutputs->Tax->addChild("\124\x61\x78\x41\x6d\x6f\x75\156\164"); $xml->Order->TaxesOutputs->Tax->TaxAmount->addChild("\x54\x6f\164\141\154\101\155\157\x75\156\x74", floatval($order_data["\x6f\162\x64\x65\x72\137\164\x61\x78\145\x73\137\164\157\164\x61\x6c"])); $total_wo_tax = floatval($order_data["\157\x72\144\145\162\137\146\x74\x6f\164\x61\154"]) - floatval($order_data["\x6f\162\144\145\x72\137\164\x61\170\x65\x73\137\164\157\x74\141\x6c"]); $xml->Order->addChild("\117\162\144\145\162\x54\x6f\164\141\x6c\x73"); $xml->Order->OrderTotals->addChild("\124\157\x74\x61\154\107\162\x6f\163\x73\101\155\x6f\165\156\x74\102\145\x66\x6f\x72\145\x54\x61\170\145\163", $total_wo_tax); $xml->Order->OrderTotals->addChild("\x54\157\164\x61\154\124\141\x78\117\165\x74\160\165\x74\x73", floatval($order_data["\157\x72\x64\145\x72\x5f\164\141\170\x65\x73\x5f\x74\157\164\x61\x6c"])); $xml->Order->OrderTotals->addChild("\117\x72\144\x65\162\124\x6f\164\x61\154", $order_data["\157\162\x64\x65\162\137\x66\164\x6f\x74\x61\x6c"]); $xml->Order->addChild("\111\164\145\x6d\x73"); foreach ($order_data["\157\162\144\x65\162\x5f\x69\164\x65\155\x73"] as $item) { $product_id = $item["\160\x72\157\144\x75\x63\164\x5f\151\x64"]; $prod_quantity = $item["\x71\x75\141\x6e\164\x69\x74\x79"]; $product_variation_id = $item["\x76\141\162\151\141\164\151\157\156\137\x69\144"]; if ($product_variation_id) { $product = wc_get_product($item["\x76\x61\x72\151\141\x74\x69\x6f\x6e\137\x69\144"]); } else { $product = wc_get_product($item["\160\162\x6f\x64\165\143\x74\x5f\x69\x64"]); } $prod_sku = $product->get_sku(); $isdream = $product->get_meta("\x5f\144\162\145\x61\155\151\x64", true); if (empty($isdream)) { continue; } $prod_title = $product->get_name(); $prod_desc = $product->get_short_description(); $prod_price = $product->get_price(); $prod_price_tax = wc_get_price_including_tax($product); $prod_tax_name = $item["\164\141\x78\137\x63\x6c\x61\x73\163"]; $tax_amount = $prod_price_tax - $prod_price; $tax_por = round(($prod_price_tax / $prod_price - 1) * 100, 2); $xitems = $xml->Order->Items->addChild("\x4f\x72\144\145\x72\114\151\x6e\145"); $xitems->addChild("\117\162\144\145\162\x4c\x69\156\145\x43\x6c\x61\x73\x73", "\x50\122\x4f"); $xitems->addChild("\x50\162\x6f\144\x75\143\x74\x52\x65\146\x65\162\145\x6e\x63\x65")->addCData($prod_sku); $xitems->addChild("\120\x72\157\144\x75\x63\164\104\145\163\143\x72\151\x70\x74\x69\x6f\x6e")->addCData($prod_title); $xitems->addChild("\x49\x74\145\155\104\145\163\143\x72\x69\160\x74\x69\x6f\156")->addCData($prod_desc); $xitems->addChild("\121\165\x61\156\x74\151\164\171", $prod_quantity); $xitems->addChild("\125\156\x69\164\120\162\x69\143\x65\x57\x69\164\150\x6f\x75\x74\124\x61\170", $prod_price); $xitems->addChild("\124\x6f\164\141\x6c\x43\x6f\x73\164", $prod_price_tax); $xitems->addChild("\124\x61\170\x65\x73\x4f\x75\x74\160\165\164\163"); $xitems->TaxesOutputs->addChild("\124\x61\170"); $xitems->TaxesOutputs->Tax->addChild("\124\x61\170\x54\x79\x70\145")->addCData($prod_tax_name); $xitems->TaxesOutputs->Tax->addChild("\124\x61\x78\x52\x61\x74\x65", $tax_por); $xitems->TaxesOutputs->Tax->addChild("\124\x61\170\x61\x62\x6c\x65\x42\141\163\x65")->addChild("\x54\157\x74\141\154\x41\x6d\157\165\x6e\x74", $prod_price * $prod_quantity); $xitems->TaxesOutputs->Tax->addChild("\124\x61\170\101\155\157\x75\156\164")->addChild("\124\157\x74\141\x6c\101\155\157\165\x6e\x74", $tax_amount * $prod_quantity); } $xml->formatXML(); $xml->saveXML($xml_file_name); return $xml_file_name; } public function dream_pay_map() { if (isset($_POST["\144\x72\145\x61\x6d\x5f\167\x63\137\155\141\160\x5f\160\141\171\x5f\151\144"]) && $_POST["\144\162\x65\141\x6d\x5f\167\143\137\160\x61\x79\x5f\x6e\141\x6d\x65"] && $_POST["\144\x72\145\x61\155\x5f\155\x61\x70\137\x70\x61\x79\137\x63\157\x64\145"]) { $dream_wc_map_pay_id = $_POST["\x64\x72\x65\141\155\x5f\x77\143\x5f\155\x61\x70\x5f\x70\x61\x79\137\151\x64"]; $dream_wc_pay_name = $_POST["\x64\x72\x65\141\155\x5f\167\143\137\x70\141\x79\x5f\x6e\141\155\x65"]; $dream_map_pay_code = $_POST["\144\162\x65\141\x6d\137\155\141\x70\x5f\x70\141\171\x5f\143\x6f\x64\145"]; $dream_map_pay_name = $_POST["\144\x72\x65\x61\x6d\137\155\x61\160\137\x70\x61\171\137\156\x61\x6d\x65"]; $dream_map_payc_id = $_POST["\x64\x72\145\x61\x6d\137\x6d\x61\x70\x5f\160\141\171\143\137\151\144"]; $arr_count = count($_POST["\144\x72\145\141\x6d\x5f\x77\x63\137\x6d\x61\x70\x5f\160\141\x79\137\151\x64"]); $arr_map_pay = array(); for ($i = 0; $i < $arr_count; $i++) { array_push($arr_map_pay, array("\151\x64" => $dream_wc_map_pay_id[$i], "\163\156\141\155\x65" => $dream_wc_pay_name[$i], "\x63\x6f\144\x65" => $dream_map_pay_code[$i], "\156\141\155\145" => $dream_map_pay_name[$i], "\143\x72" => $dream_map_payc_id[$i])); } $mapping_updated = update_option("\155\141\160\137\160\x61\171", $arr_map_pay); echo $mapping_updated; } } public function dream_historic_orders() { $dreamlove_ps_t = get_option("\x64\162\x65\141\155\160\141") && get_option("\144\x72\x65\x61\155\154\157\x76\x65\x5f\x61\x63\x63\137\163\164\141\164\165\x73") == 1; if ($dreamlove_ps_t) { $response = $this->dream_spck(false); require "\141\163\163\x65\x74\x73\x2f\166\151\x65\167\163\57\x64\x72\x65\x61\155\137\x68\151\163\x74\x6f\x72\151\x63\x5f\160\141\147\145\x2e\x70\150\x70"; } else { require "\141\x73\163\x65\x74\163\57\166\x69\145\x77\x73\x2f\144\x72\145\141\155\137\x75\x73\x65\162\137\141\x63\x74\151\166\x61\164\151\x6f\x6e\137\x70\141\147\145\x2e\x70\150\160"; } } public function dream_shipping_map() { if (isset($_POST["\144\162\145\x61\x6d\137\x77\143\x5f\x6d\x61\160\x5f\163\150\x69\160\x70\x69\x6e\x67\137\x69\144"]) && $_POST["\144\162\x65\141\x6d\137\167\x63\137\x73\150\151\x70\x70\151\x6e\147\137\156\141\x6d\x65"] && $_POST["\x64\162\x65\x61\x6d\137\155\141\160\x5f\163\x68\x69\160\x70\151\x6e\147\137\143\x6f\x64\x65"]) { $dream_wc_map_shipping_id = $_POST["\144\162\145\x61\155\x5f\167\143\137\x6d\141\160\137\163\x68\x69\160\x70\x69\x6e\147\137\151\x64"]; $dream_wc_shipping_name = $_POST["\144\162\145\x61\x6d\x5f\x77\x63\x5f\163\x68\x69\160\x70\x69\x6e\x67\137\x6e\x61\155\x65"]; $dream_map_shipping_code = $_POST["\x64\162\x65\141\x6d\x5f\155\x61\160\x5f\x73\150\x69\x70\x70\151\156\147\x5f\143\x6f\144\x65"]; $dream_map_shipping_name = $_POST["\144\x72\145\x61\155\x5f\155\141\x70\137\163\x68\151\x70\160\x69\156\x67\137\156\141\x6d\x65"]; $arr_count = count($_POST["\x64\x72\145\141\155\x5f\167\143\137\155\141\160\137\163\150\x69\160\160\151\156\x67\137\151\x64"]); $arr_map_shipping = array(); for ($i = 0; $i < $arr_count; $i++) { array_push($arr_map_shipping, array("\x69\x64" => $dream_wc_map_shipping_id[$i], "\163\156\x61\x6d\145" => $dream_wc_shipping_name[$i], "\143\x6f\144\145" => $dream_map_shipping_code[$i], "\x6e\141\155\x65" => $dream_map_shipping_name[$i])); } $mapping_updated = update_option("\x6d\141\160\x5f\163\150\151\160\160\151\x6e\x67", $arr_map_shipping); echo $mapping_updated; } } public function dream_spck($force = false) { $lastck = get_option("\x64\x72\145\141\x6d\154\x6f\x76\145\137\x61\x63\143\137\154\141\x73\164\143", 0); $response = 0; if ($force || $lastck + 3600 < time()) { $dream_wo_url = dreamlove_ps::DREAM_URL; $dreamlove_ps_wo_user = get_option("\x64\162\145\x61\155\x6c\157\x76\145\x5f\160\x73\137\167\157\x5f\165\163\145\162"); $dreamlove_ps_wo_pass = get_option("\x64\x72\x65\141\x6d\x6c\157\x76\145\x5f\160\x73\x5f\167\x6f\x5f\160\141\163\x73"); $dream_wo_email = get_option("\x64\162\145\141\x6d\154\157\x76\145\x5f\x70\x73\x5f\x77\157\x5f\x65\155\141\151\x6c"); $clientArgs = array("\164\x72\x61\x63\x65" => 1, "\143\x6f\x6e\156\145\143\164\151\x6f\156\x5f\x74\x69\155\145\157\165\x74" => 30, "\163\x6f\x61\160\x5f\x76\145\x72\x73\151\157\x6e" => "\123\x4f\x41\x50\x5f\x31\137\x31", "\x65\156\x63\x6f\x64\x69\x6e\147" => "\x75\164\x66\x2d\x38", "\143\141\x63\150\145\x5f\167\x73\144\x6c" => WSDL_CACHE_NONE); $client = new SoapClient($dream_wo_url, $clientArgs); $sKeys = array("\x55\163\145\x72\x6e\x61\x6d\145" => $dreamlove_ps_wo_user, "\x50\x61\x73\163\x77\x6f\162\144" => $dreamlove_ps_wo_pass); $headers = new SoapHeader($dream_wo_url, "\125\163\145\162\103\162\145\x64\x65\x6e\164\151\x61\x6c\x73", $sKeys); $client->__setSoapHeaders(array($headers)); if (file_exists(plugin_dir_path(__FILE__) . "\166\x61\x74")) { $getBasicCustomerInfo_response = $client->getBasicCustomerInfo("\142\x61\x73\x69\x63", $dreamlove_ps_wo_user, $dreamlove_ps_wo_pass, $dream_wo_email, "\166\x61\x74\x4e\165\x6d\x62\145\162"); } else { if (file_exists(plugin_dir_path(__FILE__) . "\x67\x65\163\x69\x6f")) { $getBasicCustomerInfo_response = $client->getBasicCustomerInfo("\x62\x61\163\151\143", $dreamlove_ps_wo_user, $dreamlove_ps_wo_pass, $dream_wo_email, "\147\x65\x73\x69\x6f\x49\x64"); } else { $getBasicCustomerInfo_response = $client->getBasicCustomerInfo("\x62\x61\163\x69\x63", $dreamlove_ps_wo_user, $dreamlove_ps_wo_pass, $dream_wo_email, "\x65\155\141\x69\154\101\x64\144\162\x65\x73\163"); } } if (file_exists(plugin_dir_path(__FILE__) . "\143\x61\x69\156")) { print_r($getBasicCustomerInfo_response); } if (empty($getBasicCustomerInfo_response["\x65\162\x72\x6f\162\x43\157\144\145"])) { update_option("\144\x72\x65\x61\x6d\154\x6f\166\x65\x5f\141\x63\143\137\163\164\141\x74\x75\x73", $getBasicCustomerInfo_response["\x73\164\x61\x74\165\163"]); update_option("\144\x72\145\x61\155\154\157\x76\x65\x5f\141\143\x63\x5f\x6e\x61\x6d\145", $getBasicCustomerInfo_response["\156\x61\x6d\145"]); update_option("\144\162\145\x61\x6d\154\157\166\x65\137\x61\x63\143\x5f\x62\154", $getBasicCustomerInfo_response["\x62\x61\154\x61\156\x63\x65\120\x75\162\x73\x65"]); update_option("\x64\x72\x65\141\x6d\x6c\157\x76\x65\137\x61\143\x63\137\154\x61\163\164\143", time()); } else { if ($getBasicCustomerInfo_response["\x65\162\162\157\x72\x43\157\144\145"] == 101) { update_option("\144\x72\x65\x61\155\154\x6f\x76\145\137\141\x63\143\137\x73\164\x61\x74\x75\163", $getBasicCustomerInfo_response["\x73\x74\x61\164\165\163"]); update_option("\144\x72\x65\141\155\154\x6f\166\145\x5f\141\143\143\x5f\x6e\x61\x6d\145", ''); update_option("\x64\x72\145\141\x6d\154\157\166\145\x5f\x61\x63\143\x5f\142\154", 0); update_option("\x64\x72\x65\x61\155\154\157\166\x65\x5f\x61\x63\x63\x5f\154\141\163\x74\x63", time()); $response = $getBasicCustomerInfo_response["\145\162\162\157\x72\x43\x6f\x64\x65"]; } else { update_option("\x64\162\x65\141\x6d\x6c\x6f\x76\x65\x5f\141\143\143\x5f\163\164\141\x74\165\163", 0); update_option("\144\162\x65\x61\155\154\157\166\145\137\141\143\143\x5f\156\x61\155\145", ''); update_option("\144\162\145\141\x6d\154\x6f\166\x65\x5f\x61\x63\143\x5f\142\x6c", 0); update_option("\x64\162\145\141\x6d\x6c\157\x76\145\137\x61\143\143\137\154\x61\163\x74\x63", time()); $response = $getBasicCustomerInfo_response["\145\162\162\x6f\162\103\x6f\144\145"]; } } } return $response; } public function dream_activation() { require "\x61\x73\163\x65\x74\163\57\166\151\145\x77\x73\x2f\144\x72\x65\x61\155\x5f\165\163\145\x72\x5f\141\x63\x74\151\166\141\164\x69\157\156\x5f\160\141\147\x65\56\x70\150\160"; } public function dream_settings() { $dreamlove_ps_t = get_option("\x64\x72\x65\x61\155\x70\141") && get_option("\144\x72\145\x61\155\x6c\157\166\x65\137\x61\x63\143\x5f\163\164\141\164\165\x73") == 1; if ($dreamlove_ps_t) { $response = $this->dream_spck(false); require "\141\x73\x73\x65\164\x73\x2f\x76\151\145\x77\x73\57\x64\x72\x65\141\155\x5f\x73\x65\164\x74\x69\156\x67\x73\137\x70\141\x67\x65\x2e\160\x68\160"; } else { require "\141\x73\163\145\164\163\x2f\x76\x69\145\167\x73\x2f\x64\162\x65\x61\155\137\x75\x73\145\162\137\x61\143\164\x69\166\141\164\151\x6f\x6e\137\160\141\147\x65\x2e\160\x68\160"; } } public function dream_token() { $bytes = random_bytes(20); $token = bin2hex($bytes); update_option("\144\162\145\x61\x6d\137\x75\x70\x64\141\164\x65\x5f\170\155\154\x5f\x74\157\153\145\x6e", $token); } public function dream_refresh_ws() { $response = $this->dream_spck(true); } public function dream_requirements() { require "\x61\x73\163\145\x74\163\57\166\x69\x65\167\x73\57\144\162\145\x61\x6d\x5f\x72\x65\x71\x75\x69\162\x65\x6d\145\156\x74\x73\137\160\141\147\x65\x2e\x70\x68\x70"; } public function dream_save_general_option_settings() { $updated = false; $dream_xml_zip_lang = $_POST["\144\x72\145\x61\x6d\x5f\x78\x6d\154\137\172\151\x70\137\154\x61\156\x67"]; $dream_cron = $_POST["\165\x70\x64\141\164\145\137\143\162\157\156"]; $dream_btax = $_POST["\x64\162\145\141\155\137\x62\164\141\x78"]; $dream_img_options = $_POST["\151\x6d\147\137\157\x70\x74\x69\x6f\156\x73"]; $dream_update_prod_price = $_POST["\x70\162\x6f\x64\137\x70\x72\151\143\145"]; $dream_update_price_val = $_POST["\x75\160\x64\141\164\x65\x5f\x70\162\151\143\x65\137\x76\141\x6c"]; $dream_update_import = $_POST["\x75\160\144\141\164\x65\137\151\155\x70\157\x72\164"]; $dream_update_newp = $_POST["\x75\x70\x64\x61\164\x65\x5f\156\145\x77\160"]; $dream_update_title = $_POST["\x75\160\x64\141\x74\x65\x5f\x74\x69\x74\154\145"]; $dream_update_desc = $_POST["\x75\x70\x64\x61\164\x65\x5f\144\x65\163\143"]; $dream_update_excerpt = $_POST["\x75\160\144\x61\x74\145\x5f\x65\170\x63\145\162\160\x74"]; $dream_update_stock = $_POST["\x75\x70\144\x61\x74\145\137\163\x74\x6f\x63\153"]; $dream_update_cost_price = $_POST["\x75\160\144\x61\164\145\137\143\157\x73\164\137\x70\162\x69\x63\x65"]; $dream_update_taxes = $_POST["\144\x72\145\141\x6d\x5f\x75\160\x64\141\164\x65\137\x74\x61\x78\145\163"]; $dream_update_categories = $_POST["\x75\x70\144\141\x74\145\137\x63\x61\x74\145\147\157\162\x69\x65\163"]; $dream_update_categories_new = $_POST["\x75\x70\144\x61\164\x65\x5f\x63\x61\164\x65\x67\x6f\162\151\145\x73\137\x6e\x65\167"]; $dream_update_categories_sale = $_POST["\x75\x70\144\141\x74\145\x5f\143\141\x74\145\x67\157\162\151\x65\163\x5f\x73\x61\154\x65"]; $dream_update_brands = $_POST["\165\160\144\141\x74\145\x5f\142\162\141\156\x64\163"]; $dream_update_images = $_POST["\165\x70\x64\141\164\x65\x5f\151\155\x61\147\x65\x73"]; $dream_update_discontinued_pv = $_POST["\x75\160\144\141\164\x65\x5f\x64\151\163\143\157\x6e\164\x69\156\165\145\144\x5f\x70\x72\157\144\137\166\x61\x72\151\x61\156\164\163"]; $dream_price_iva_incl = $_POST["\144\162\x65\141\x6d\137\x70\162\151\x63\145\137\151\x76\141\137\x69\156\x63\154"]; $dream_update_cart_stock = $_POST["\x64\162\x65\x61\x6d\137\x75\x70\x64\x61\164\x65\x5f\x63\x61\162\164\137\x73\x74\157\143\153"]; $dream_flag_send_xml = $_POST["\x64\x72\x65\141\155\137\146\154\x61\147\x5f\x73\x65\156\x64\137\x78\x6d\154"]; $order = wc_get_order_statuses(); foreach ($order as $key => $value) { update_option("\x64\x72\x65\141\x6d\x5f\146\x6c\141\147\x5f\x73\x74\x61\164\165\x73\x5f{$key}", $_POST["\144\x72\145\x61\x6d\137\146\x6c\141\x67\137\163\164\x61\164\165\x73\137{$key}"]); } if ($dream_xml_zip_lang == "\163\x70\x61\x6e\x69\x73\x68") { $dream_update_xml_url = "\x68\164\164\x70\163\72\57\x2f\163\x74\157\162\145\56\x64\162\x65\x61\155\x6c\157\166\x65\56\x65\163\57\144\x79\x6e\x64\141\164\x61\57\x65\x78\160\157\162\x74\x61\143\151\x6f\x6e\145\x73\x2f\x63\x73\166\172\151\x70\x2f\x63\x61\x74\141\x6c\x6f\147\x5f\61\137\x35\60\137\61\x32\x35\x5f\62\137\x65\142\x31\60\x61\67\x39\62\x63\60\x33\63\66\142\x63\66\71\65\145\x32\x62\x30\145\x63\x32\71\x64\x38\70\64\60\62\137\170\x6d\154\56\172\x69\160"; } else { if ($dream_xml_zip_lang == "\145\156\147\154\151\163\150") { $dream_update_xml_url = "\x68\x74\164\160\x73\72\57\x2f\x73\164\x6f\x72\x65\x2e\x64\162\x65\141\155\x6c\x6f\x76\x65\56\145\x73\x2f\x64\171\156\x64\141\164\x61\57\x65\x78\x70\x6f\162\x74\x61\x63\x69\x6f\x6e\145\163\x2f\143\163\166\x7a\x69\x70\x2f\143\x61\x74\141\154\157\147\137\x31\137\x35\61\x5f\61\x32\65\137\x32\137\x38\71\66\64\141\x64\67\70\x33\x38\x63\x65\67\x37\70\67\x39\x37\x35\141\142\x37\141\x32\61\x61\x33\67\x38\67\146\x66\x5f\170\x6d\154\x2e\172\x69\x70"; } else { if ($dream_xml_zip_lang == "\146\162\x65\156\143\x68") { $dream_update_xml_url = "\150\164\x74\160\163\72\x2f\x2f\x73\x74\x6f\162\x65\56\x64\162\x65\141\155\x6c\x6f\x76\x65\56\145\163\57\144\x79\x6e\144\141\164\x61\57\145\170\160\157\x72\164\x61\x63\151\x6f\156\x65\163\x2f\143\163\x76\172\151\x70\x2f\x63\x61\x74\x61\154\x6f\147\x5f\x31\x5f\65\62\x5f\61\62\65\x5f\62\137\144\x64\66\65\144\x34\x36\x63\x39\x65\146\x63\x33\x64\x39\x33\66\64\x32\67\x32\143\x35\65\x33\71\x39\x64\65\x62\65\66\137\x78\x6d\x6c\56\x7a\151\160"; } else { if ($dream_xml_zip_lang == "\151\x74\x61\x6c\x69\x61\x6e") { $dream_update_xml_url = "\150\x74\x74\160\x73\72\57\57\x73\164\157\x72\x65\x2e\144\162\145\x61\155\154\157\166\x65\x2e\x65\163\x2f\144\x79\x6e\x64\x61\x74\x61\57\145\170\160\x6f\162\x74\x61\x63\151\157\156\x65\163\57\143\x73\x76\172\x69\x70\x2f\143\x61\164\x61\154\x6f\147\137\61\x5f\65\64\x5f\x31\62\x35\137\x32\x5f\x38\61\65\x64\64\x37\x31\x31\x66\x30\62\62\x39\x65\x37\70\146\x65\x32\144\x66\70\x36\63\x64\x35\144\64\141\70\60\x66\x5f\170\x6d\154\x2e\x7a\151\160"; } else { if ($dream_xml_zip_lang == "\147\145\x72\155\141\x6e") { $dream_update_xml_url = "\x68\164\164\160\163\x3a\57\57\163\x74\157\x72\x65\x2e\144\162\145\x61\155\154\157\x76\x65\56\x65\163\x2f\x64\x79\156\144\141\x74\x61\x2f\x65\x78\x70\x6f\x72\164\141\x63\151\x6f\x6e\x65\x73\x2f\x63\x73\x76\x7a\x69\160\x2f\x63\x61\164\x61\x6c\x6f\147\x5f\61\137\x35\63\137\x31\62\x35\137\62\137\145\145\64\x35\x37\x66\x30\66\70\66\64\x62\x64\143\145\x39\x34\145\61\x31\66\x61\x37\x36\x66\67\142\x65\60\x34\x31\x62\x5f\x78\x6d\x6c\56\172\151\x70"; } else { if ($dream_xml_zip_lang == "\x70\x6f\162\164\165\x67\165\145\163\145") { $dream_update_xml_url = "\x68\x74\x74\160\x73\72\57\x2f\x73\164\157\x72\x65\x2e\x64\162\x65\x61\155\x6c\157\x76\145\x2e\145\x73\x2f\x64\x79\156\144\x61\x74\141\x2f\145\x78\x70\157\x72\x74\141\143\x69\157\156\145\x73\x2f\143\x73\166\172\x69\160\x2f\x63\x61\x74\141\154\x6f\147\137\x31\137\x35\65\137\61\62\65\x5f\x32\137\62\60\x36\142\x36\x38\x63\x36\x35\71\x39\145\x31\71\x30\144\x30\x30\x34\x32\64\x39\63\61\x32\x32\144\x33\146\142\66\63\137\170\155\x6c\x2e\x7a\x69\160"; } else { $dream_update_xml_url = "\x68\x74\x74\160\163\x3a\x2f\x2f\163\164\157\x72\x65\56\144\162\x65\141\155\154\x6f\x76\x65\x2e\x65\163\x2f\x64\x79\x6e\x64\x61\x74\141\57\145\170\160\x6f\x72\164\141\143\x69\157\156\x65\163\57\x63\x73\166\x7a\151\x70\x2f\143\x61\164\x61\x6c\157\x67\x5f\61\x5f\x35\x30\x5f\x31\x32\x35\137\62\x5f\x65\x62\x31\60\x61\x37\x39\62\x63\x30\63\63\x36\x62\x63\x36\x39\65\145\62\x62\x30\x65\143\62\x39\144\x38\70\64\60\62\137\x78\155\x6c\x2e\x7a\x69\160"; } } } } } } update_option("\144\x72\145\x61\x6d\x5f\x75\160\x64\141\x74\145\x5f\x78\x6d\x6c\x5f\165\162\x6c", $dream_update_xml_url); update_option("\144\162\145\141\155\x5f\x78\155\154\x5f\x7a\151\x70\x5f\x6c\x61\x6e\147", $dream_xml_zip_lang); update_option("\144\x72\145\141\x6d\137\143\x72\157\156", $dream_cron); update_option("\144\162\x65\x61\155\137\x62\164\x61\x78", $dream_btax); update_option("\144\x72\145\141\x6d\137\151\155\x67\137\157\x70\x74\x69\x6f\x6e\163", $dream_img_options); update_option("\144\162\x65\141\155\x5f\165\160\x64\141\x74\145\x5f\160\162\x6f\144\137\x70\162\x69\143\x65", $dream_update_prod_price); update_option("\x64\162\145\141\155\x5f\x75\160\x64\x61\164\145\x5f\x70\x72\151\143\x65\137\166\141\x6c", $dream_update_price_val); update_option("\144\162\x65\x61\x6d\137\x75\x70\x64\x61\x74\145\137\x69\x6d\160\x6f\x72\164", $dream_update_import); update_option("\144\x72\x65\141\x6d\137\165\x70\144\141\164\145\x5f\156\x65\167\x70", $dream_update_newp); update_option("\x64\x72\145\141\x6d\137\165\x70\x64\x61\x74\145\137\164\x69\x74\x6c\145", $dream_update_title); update_option("\144\162\145\141\155\x5f\x75\x70\144\141\164\145\x5f\x64\x65\x73\143", $dream_update_desc); update_option("\x64\162\145\141\155\137\x75\160\x64\x61\x74\x65\137\145\170\143\145\x72\x70\164", $dream_update_excerpt); update_option("\144\x72\145\141\155\137\165\160\x64\x61\164\x65\137\163\x74\157\x63\x6b", $dream_update_stock); update_option("\144\x72\145\x61\x6d\x5f\x75\160\144\141\164\x65\137\x63\157\x73\164\x5f\x70\162\151\143\x65", $dream_update_cost_price); update_option("\144\162\145\141\155\x5f\165\x70\x64\141\x74\145\137\x74\x61\x78\145\x73", $dream_update_taxes); update_option("\x64\162\145\141\155\x5f\165\x70\144\141\164\145\x5f\143\141\x74\145\147\x6f\x72\151\x65\163", $dream_update_categories); update_option("\144\162\145\141\155\137\165\160\144\141\x74\145\x5f\x63\x61\x74\145\x67\x6f\162\x69\x65\x73\137\163\x61\154\145", $dream_update_categories_sale); update_option("\x64\162\145\x61\155\137\165\x70\144\x61\x74\145\x5f\x63\141\x74\145\147\157\x72\x69\145\163\137\156\x65\x77", $dream_update_categories_new); update_option("\144\162\x65\x61\x6d\137\x75\x70\144\x61\x74\x65\137\142\x72\141\156\x64\163", $dream_update_brands); update_option("\x64\162\145\141\x6d\x5f\165\160\144\141\x74\145\x5f\151\x6d\x61\147\145\163", $dream_update_images); update_option("\x64\x72\145\x61\x6d\137\x75\x70\x64\141\x74\x65\137\x64\x69\x73\143\157\156\x74\x69\x6e\165\145\144\137\x70\166", $dream_update_discontinued_pv); update_option("\144\162\x65\141\x6d\x5f\160\162\x69\143\145\x5f\151\x76\141\137\151\156\x63\x6c", $dream_price_iva_incl); update_option("\144\162\145\x61\155\137\165\x70\144\x61\164\x65\137\143\x61\x72\164\137\163\x74\x6f\143\x6b", $dream_update_cart_stock); update_option("\x64\x72\145\141\155\x5f\x66\154\141\147\137\x73\x65\156\x64\137\x78\x6d\154", $dream_flag_send_xml); update_option("\x64\162\x65\x61\155\x5f\154\x61\163\x74\x5f\163\141\x76\145", time()); echo true; die; } public function dream_mapping() { $dreamlove_ps_t = get_option("\144\x72\145\141\x6d\160\x61") && get_option("\x64\162\x65\x61\155\154\157\x76\145\137\x61\143\143\137\163\164\141\x74\165\x73") == 1; $def_selected = ''; $def_checked = ''; if ($dreamlove_ps_t) { $response = $this->dream_spck(false); if (trim(get_option("\x64\x72\145\141\155\137\x75\160\x64\141\164\x65\x5f\170\x6d\154\x5f\x75\162\154")) != '') { $obj_xml_categories = $this->dream_list_cats_xml(); $wc_shop_categories = $this->dream_wc_shop_categories(); } require "\x61\163\163\145\x74\163\x2f\x76\151\145\x77\x73\57\x64\162\145\x61\x6d\x5f\x6d\x61\x70\160\x69\x6e\147\137\160\x61\147\145\56\x70\150\x70"; } else { require "\141\163\163\x65\x74\163\x2f\166\x69\x65\167\x73\x2f\x64\162\x65\141\x6d\137\x75\x73\x65\162\x5f\141\143\x74\151\166\141\x74\151\x6f\x6e\x5f\160\141\147\145\x2e\x70\x68\160"; } } public function dream_filters() { $dreamlove_ps_t = get_option("\144\162\145\x61\x6d\x70\141") && get_option("\144\x72\145\x61\155\154\157\x76\145\137\x61\143\143\137\x73\x74\x61\164\165\163") == 1; $def_selected = ''; $def_checked = ''; if ($dreamlove_ps_t) { $response = $this->dream_spck(false); if (trim(get_option("\144\x72\x65\141\155\137\165\x70\x64\x61\x74\145\137\x78\x6d\154\137\165\x72\x6c")) != '') { $result = $this->dream_load_filters(); $obj_xml_categories = $result["\x6f\142\x6a\x5f\x78\155\154\137\x63\x61\164\145\x67\x6f\x72\x69\x65\x73"]; $arr_xml_products = $result["\141\162\x72\137\x78\155\154\137\160\162\157\144\165\143\164\x73"]; $arr_xml_brand = $result["\x61\162\162\x5f\170\x6d\x6c\137\142\162\x61\156\x64"]; } require "\141\x73\x73\x65\164\x73\57\166\151\x65\x77\x73\57\x64\162\x65\141\155\x5f\x66\x69\x6c\x74\x65\x72\x5f\160\141\147\x65\x2e\160\x68\x70"; } else { require "\x61\163\163\145\164\163\x2f\166\x69\145\167\x73\57\x64\x72\145\141\x6d\x5f\x75\163\145\162\137\141\143\164\x69\x76\x61\x74\151\x6f\156\x5f\160\141\x67\145\56\160\150\160"; } } public function dream_wc_shop_categories() { $arr_prod_cat = array(); $orderby = "\156\x61\x6d\145"; $order = "\141\163\x63"; $hide_empty = false; $cat_args = array("\157\162\144\145\162\142\x79" => $orderby, "\157\x72\144\145\162" => $order, "\150\x69\144\145\137\145\x6d\x70\164\x79" => $hide_empty); $product_categories = get_terms("\160\162\157\x64\x75\143\x74\x5f\x63\141\x74", $cat_args); foreach ($product_categories as $prod_cat) { array_push($arr_prod_cat, array("\147\x69\144" => "\x30", "\163\x6c\x75\x67" => $prod_cat->slug, "\x6e\141\155\x65" => $prod_cat->name)); } return $arr_prod_cat; } public function dream_get_all_xml_categories() { $obj_xml_categories = $this->dream_list_cats_xml(); return $obj_xml_categories; } public function dream_list_cats_xml() { if (trim(get_option("\144\162\x65\141\155\x5f\165\160\x64\141\x74\x65\137\170\x6d\154\137\165\x72\x6c")) != '') { $xml = $this->ss_load_xml_file(); $list = array(); foreach ($xml->product as $key => $product) { $prod_categories = $product->categories; foreach ($prod_categories->category as $cat_vals) { $name = (string) $cat_vals; $slug = $this->clean_text(sanitize_title(strtolower($cat_vals))); $gid = (int) $cat_vals["\x67\145\x73\x69\x6f\151\144"]; $acat = array("\x67\151\144" => $gid, "\156\x61\155\145" => $name, "\x73\154\165\x67" => $slug); array_push($list, $acat); } } $lista = $this->unique_multidim_array($list, "\x67\x69\x64"); array_multisort($lista); return $lista; } else { return array(); } } public function dream_load_filters() { if (trim(get_option("\144\162\x65\x61\x6d\137\x75\160\144\x61\x74\145\x5f\170\x6d\154\x5f\x75\162\154")) != '') { $xml = $this->ss_load_xml_file(); $marcas = array(); $cates = array(); foreach ($xml->product as $key => $product) { $prod_categories = $product->categories; $prod_sku = strval($product->public_id); $prod_title = strval($product->title); $arr_xml_products[] = array($prod_sku, $prod_title); $hierarchy = (string) $product->brand_hierarchy; $hierarchy = str_replace("\47", "\40", $hierarchy); $prod_brand = array("\x6e\141\155\145" => $hierarchy); array_push($marcas, $prod_brand); foreach ($prod_categories->category as $cat_vals) { $name = (string) $cat_vals; $slug = $this->clean_text(sanitize_title(strtolower($cat_vals))); $gid = (int) $cat_vals["\147\145\x73\151\x6f\151\x64"]; $acat = array("\x67\x69\x64" => $gid, "\x6e\141\155\x65" => $name, "\x73\x6c\x75\x67" => $slug); array_push($cates, $acat); } } $arr_xml_brand = $this->unique_multidim_array($marcas, "\x6e\x61\155\145"); array_multisort($arr_xml_brand); $obj_xml_categories = $this->unique_multidim_array($cates, "\147\151\x64"); array_multisort($obj_xml_categories); return array("\157\x62\x6a\137\x78\155\154\x5f\143\x61\x74\145\147\157\x72\151\145\163" => $obj_xml_categories, "\x61\x72\162\x5f\x78\x6d\x6c\x5f\x70\x72\x6f\x64\x75\143\164\163" => $arr_xml_products, "\x61\162\x72\137\170\155\154\x5f\142\162\141\x6e\144" => $arr_xml_brand); } else { return array("\157\x62\x6a\x5f\170\x6d\154\137\143\x61\x74\145\x67\157\x72\x69\x65\x73" => array(), "\141\x72\162\x5f\x78\155\x6c\x5f\160\x72\x6f\144\165\143\x74\x73" => array(), "\141\x72\162\137\x78\155\x6c\137\x62\x72\x61\x6e\x64" => array()); } } public function unique_multidim_array($array, $key) { $temp_array = array(); $i = 0; $key_array = array(); foreach ($array as $val) { if (!in_array($val[$key], $key_array)) { $key_array[$i] = $val[$key]; $temp_array[$i] = $val; } $i++; } return $temp_array; } public function ss_load_xml_file() { $xml_url = get_option("\x64\x72\x65\x61\155\x5f\x75\x70\x64\141\164\x65\137\x78\155\154\137\x75\162\x6c", true); $dlp_simplexml = ''; $last_save = get_option("\x64\162\x65\x61\x6d\137\x6c\141\163\164\x5f\x73\141\166\145"); $last_dw = get_option("\x64\x72\x65\x61\x6d\137\154\x61\x73\x74\x5f\x78\155\x6c\x5f\144\167", 0); if ($last_save > $last_dw || time() > $last_dw + 3600) { if (!filter_var($xml_url, FILTER_VALIDATE_URL)) { echo "\111\156\x76\x61\154\x69\144\40\x55\x52\114\15\xa"; } else { $uploads = wp_upload_dir(); $extract_path = $uploads["\x62\x61\163\145\x64\151\x72"] . "\x2f\144\162\x65\141\155"; if (!file_exists($extract_path)) { mkdir($extract_path, 493, true); } $extracted_xmls = $extract_path . "\x2f\x78\155\154\57"; if (!file_exists($extracted_xmls)) { mkdir($extracted_xmls, 484, true); } $extract_dir = $extract_path . "\x2f\x7a\x69\160\x2f"; if (!file_exists($extract_dir)) { mkdir($extract_dir, 484, true); } $dlp_new_xml_zip = $extract_dir . "\x2f\170\155\x6c\137\x70\162\157\x64\165\143\x74\x73\x2e\x7a\x69\x70"; $file = file_put_contents($dlp_new_xml_zip, fopen($xml_url, "\x72")); if ($file) { $zip = new ZipArchive(); if ($zip->open($dlp_new_xml_zip) != "\x74\162\x75\x65") { echo "\x55\156\x61\x62\x6c\x65\x20\x74\157\x20\x6f\160\x65\156\x20\x74\x68\x65\x20\x5a\x69\x70\40\106\x69\x6c\x65\x2e\15\12"; } else { $zip->extractTo($extracted_xmls); $zip->close(); $dlp_simplexml = simplexml_load_file($extracted_xmls . "\170\155\x6c\137\60\60\61\56\170\x6d\x6c"); update_option("\x64\162\x65\141\x6d\x5f\154\x61\x73\164\x5f\170\155\154\x5f\x64\167", time()); return $dlp_simplexml; } } return $dlp_simplexml; } } else { $uploads = wp_upload_dir(); $extract_path = $uploads["\142\141\x73\x65\x64\151\x72"] . "\x2f\144\162\x65\141\155"; $extracted_xmls = $extract_path . "\57\170\x6d\x6c\57"; $dlp_simplexml = simplexml_load_file($extracted_xmls . "\170\x6d\154\137\60\x30\61\56\x78\x6d\154"); return $dlp_simplexml; } } public function dream_wc_xml_map_categories() { if (isset($_POST["\144\162\145\x61\x6d\137\167\143\x5f\x73\150\157\x70\137\143\141\x74\145\x67\157\x72\x69\145\163"]) && $_POST["\x64\x72\145\141\x6d\137\x78\155\154\x5f\160\x72\x6f\144\137\143\x61\164\145\x67\157\x72\x69\x65\x73"] && $_POST["\144\x72\x65\141\155\x5f\x77\143\x5f\163\x68\x6f\x70\x5f\x63\141\x74\145\147\x6f\162\151\145\163\x5f\x6e\x61\155\145"]) { $dream_wc_shop_categories = $_POST["\144\162\x65\141\x6d\x5f\x77\x63\x5f\x73\x68\x6f\160\137\143\x61\164\x65\x67\157\x72\x69\x65\x73"]; $dream_xml_prod_categories = $_POST["\144\x72\x65\141\x6d\137\170\x6d\154\x5f\160\162\157\144\137\x63\x61\164\145\147\x6f\162\151\145\x73"]; $dream_xml_prod_categories_slug = $_POST["\144\x72\x65\141\155\x5f\x78\155\x6c\x5f\160\162\x6f\x64\137\x63\x61\164\x65\x67\157\162\151\145\x73\137\163\x6c\x75\x67"]; $dream_wc_shop_categories_name = $_POST["\144\x72\x65\141\x6d\x5f\167\x63\x5f\x73\150\x6f\x70\x5f\143\141\x74\145\147\157\162\x69\x65\x73\x5f\x6e\141\x6d\145"]; $arr_count = count($_POST["\x64\162\145\141\x6d\137\x77\x63\x5f\x73\x68\x6f\x70\137\x63\141\x74\x65\x67\x6f\x72\151\x65\163"]); $arr_map_categories = array(); for ($i = 0; $i < $arr_count; $i++) { array_push($arr_map_categories, array("\147\x69\144" => $dream_xml_prod_categories[$i], "\x78\163\154\x75\x67" => $dream_xml_prod_categories_slug[$i], "\163\154\x75\147" => $dream_wc_shop_categories[$i], "\156\x61\155\x65" => $dream_wc_shop_categories_name[$i])); } $mapping_updated = update_option("\x6d\141\160\137\160\162\157\x64\165\143\164\137\x63\x61\x74\145\147\x6f\162\x69\x65\x73", $arr_map_categories); if (isset($_POST["\144\x72\145\141\x6d\x5f\x6d\x61\160\137\x63\141\164"])) { $dream_map_cat = (int) $_POST["\144\x72\145\141\155\x5f\155\x61\160\137\x63\x61\164"]; update_option("\x64\162\x65\141\x6d\137\x6d\141\x70\137\143\x61\x74", $dream_map_cat); } if (isset($_POST["\144\162\145\x61\x6d\137\x66\x69\x6c\164\145\162\137\x63\x61\164"])) { $dream_filter_cat = (int) $_POST["\144\162\x65\x61\155\x5f\146\151\x6c\164\x65\162\137\x63\141\164"]; update_option("\x64\162\145\141\x6d\137\x66\151\154\164\x65\162\x5f\143\141\164", $dream_filter_cat); } if (isset($_POST["\x64\x72\x65\141\155\137\146\x69\x6c\x74\x65\162\x5f\x70\x72\x6f\x64"])) { $dream_filter_prod = (int) $_POST["\x64\162\x65\x61\155\x5f\x66\151\x6c\x74\145\162\x5f\160\x72\x6f\144"]; update_option("\x64\x72\x65\x61\x6d\137\x66\x69\154\164\145\x72\x5f\x70\x72\157\x64", $dream_filter_prod); } if (isset($_POST["\x64\162\x65\x61\x6d\137\146\151\x6c\x74\x65\x72\x5f\x62\x72\x61\156\144"])) { $dream_filter_brand = (int) $_POST["\x64\x72\x65\141\155\x5f\146\151\154\x74\x65\162\137\x62\x72\x61\x6e\x64"]; update_option("\x64\x72\x65\141\155\x5f\x66\151\154\x74\x65\x72\x5f\142\162\141\x6e\x64", $dream_filter_brand); } if (isset($_POST["\144\162\145\141\155\137\151\x6e\144\154\x75\x64\145\x64\137\143\x61\164\137\x6b\x65\x79"])) { $dream_indluded_cat_key = $_POST["\x64\x72\145\141\x6d\x5f\151\156\144\x6c\165\x64\145\x64\x5f\x63\x61\164\137\153\145\171"]; update_option("\144\x72\x65\x61\155\137\x69\x6e\x64\x6c\x75\144\145\144\137\x63\x61\x74\x5f\x6b\145\171", $dream_indluded_cat_key); } if (isset($_POST["\144\x72\x65\141\x6d\137\x65\x78\143\x6c\x75\x64\x65\144\x5f\143\x61\x74\137\x6b\x65\x79"])) { $dream_excluded_cat_key = $_POST["\x64\x72\x65\141\x6d\x5f\145\170\143\x6c\x75\x64\x65\x64\137\x63\x61\x74\137\x6b\145\x79"]; update_option("\x64\x72\145\x61\x6d\x5f\145\170\x63\x6c\x75\144\145\x64\137\143\141\164\137\153\x65\171", $dream_excluded_cat_key); } if (isset($_POST["\144\x72\145\x61\155\x5f\151\156\x64\154\x75\144\x65\144\137\160\x72\157\144\137\153\145\171"])) { $dream_indluded_prod_key = $_POST["\144\162\x65\x61\155\137\x69\x6e\x64\154\x75\x64\145\144\137\160\x72\157\144\137\x6b\145\171"]; update_option("\144\x72\145\x61\155\x5f\x69\156\144\x6c\165\x64\x65\x64\137\x70\x72\x6f\x64\137\x6b\145\x79", $dream_indluded_prod_key); } if (isset($_POST["\144\162\x65\141\155\137\x65\170\x63\x6c\165\144\x65\144\x5f\160\x72\157\144\137\x6b\145\171"])) { $dream_excluded_prod_key = $_POST["\144\162\x65\x61\x6d\137\145\170\x63\x6c\165\x64\x65\x64\137\x70\x72\x6f\x64\x5f\153\145\x79"]; update_option("\x64\x72\145\x61\155\x5f\x65\170\x63\x6c\x75\x64\x65\x64\x5f\x70\162\157\x64\x5f\153\145\171", $dream_excluded_prod_key); } if (isset($_POST["\144\x72\x65\141\155\137\x69\x6e\x64\154\x75\x64\145\x64\x5f\142\x72\x61\x6e\x64\x5f\153\x65\171"])) { $dream_indluded_brand_key = $_POST["\x64\162\145\x61\155\137\151\x6e\x64\154\165\x64\145\x64\x5f\x62\x72\x61\156\144\137\153\x65\x79"]; update_option("\x64\162\145\141\155\137\151\156\144\154\165\x64\145\x64\x5f\142\162\x61\x6e\144\137\x6b\145\x79", $dream_indluded_brand_key); } if (isset($_POST["\144\162\145\x61\x6d\137\145\x78\143\x6c\x75\144\x65\x64\x5f\142\162\141\x6e\x64\137\x6b\x65\x79"])) { $dream_excluded_brand_key = $_POST["\x64\x72\145\x61\155\x5f\x65\170\x63\x6c\165\x64\145\x64\137\x62\162\x61\156\144\137\153\x65\x79"]; update_option("\x64\x72\145\x61\x6d\x5f\x65\170\x63\154\x75\x64\145\x64\x5f\x62\162\x61\156\144\137\x6b\x65\x79", $dream_excluded_brand_key); } echo $mapping_updated; } } public function dream_wc_xml_map_filters() { if (isset($_POST["\x64\x72\145\141\x6d\137\146\x69\x6c\164\x65\x72\137\143\141\164"])) { $dream_filter_cat = (int) $_POST["\x64\162\x65\141\155\137\x66\151\154\164\x65\162\137\x63\x61\x74"]; update_option("\x64\162\145\141\x6d\137\x66\151\154\x74\x65\162\x5f\x63\x61\x74", $dream_filter_cat); } if (isset($_POST["\x64\162\x65\141\x6d\x5f\146\151\x6c\164\x65\x72\x5f\160\x72\x6f\x64"])) { $dream_filter_prod = (int) $_POST["\x64\162\x65\141\x6d\x5f\x66\x69\154\x74\x65\x72\137\160\162\157\x64"]; update_option("\x64\162\x65\141\x6d\x5f\146\x69\x6c\164\145\x72\137\160\162\157\144", $dream_filter_prod); } if (isset($_POST["\144\162\145\141\x6d\137\x66\151\x6c\164\145\x72\137\142\162\x61\x6e\144"])) { $dream_filter_brand = (int) $_POST["\x64\162\145\x61\x6d\x5f\146\151\154\164\145\x72\x5f\142\162\x61\x6e\x64"]; update_option("\144\x72\x65\x61\x6d\137\146\x69\x6c\x74\145\162\x5f\142\162\141\156\144", $dream_filter_brand); } if (isset($_POST["\x64\x72\145\x61\155\137\x69\156\x64\x6c\165\144\145\144\137\x63\141\x74\137\x6b\x65\171"])) { $dream_indluded_cat_key = $_POST["\144\162\145\141\x6d\137\151\156\144\x6c\x75\144\x65\x64\137\143\141\x74\x5f\x6b\145\171"]; update_option("\144\x72\145\141\x6d\137\151\x6e\144\154\x75\144\x65\x64\137\143\x61\x74\137\x6b\x65\171", $dream_indluded_cat_key); } if (isset($_POST["\x64\x72\145\141\155\137\145\x78\143\154\165\x64\145\144\137\143\141\x74\x5f\x6b\x65\x79"])) { $dream_excluded_cat_key = $_POST["\x64\x72\x65\141\155\137\x65\170\143\154\165\x64\145\144\137\x63\x61\x74\x5f\153\x65\171"]; update_option("\144\162\145\141\x6d\137\x65\x78\x63\154\x75\144\145\144\137\143\x61\x74\137\153\x65\171", $dream_excluded_cat_key); } if (isset($_POST["\x64\162\145\x61\x6d\x5f\151\156\144\x6c\x75\x64\x65\x64\137\x70\x72\157\144\x5f\153\145\x79"])) { $dream_indluded_prod_key = $_POST["\x64\162\145\x61\155\x5f\x69\156\144\154\x75\144\x65\x64\x5f\x70\x72\x6f\x64\137\153\x65\x79"]; update_option("\144\162\145\141\x6d\x5f\x69\x6e\144\x6c\x75\x64\x65\144\137\160\162\157\x64\137\153\145\171", $dream_indluded_prod_key); } if (isset($_POST["\x64\162\x65\x61\155\137\x65\x78\143\x6c\165\x64\x65\144\137\160\162\x6f\144\137\153\145\x79"])) { $dream_excluded_prod_key = $_POST["\144\162\145\x61\155\x5f\x65\x78\x63\154\x75\x64\x65\144\137\160\162\x6f\x64\137\x6b\145\171"]; update_option("\x64\x72\x65\141\x6d\137\145\x78\x63\154\165\x64\145\x64\x5f\x70\x72\157\144\x5f\x6b\145\171", $dream_excluded_prod_key); } if (isset($_POST["\x64\x72\145\x61\x6d\137\x69\x6e\144\x6c\165\x64\145\x64\x5f\142\162\x61\x6e\144\x5f\153\145\x79"])) { $dream_indluded_brand_key = $_POST["\144\x72\x65\141\x6d\137\151\x6e\x64\x6c\165\144\x65\x64\x5f\x62\162\141\x6e\x64\x5f\x6b\x65\171"]; update_option("\144\162\145\141\155\137\151\x6e\144\x6c\x75\x64\x65\x64\x5f\142\162\141\x6e\144\137\153\x65\171", $dream_indluded_brand_key); } if (isset($_POST["\144\x72\145\141\x6d\x5f\x65\170\x63\x6c\x75\x64\x65\x64\x5f\x62\x72\x61\156\x64\137\x6b\145\171"])) { $dream_excluded_brand_key = $_POST["\144\162\145\x61\155\x5f\x65\x78\x63\154\165\x64\x65\x64\x5f\142\x72\x61\x6e\144\137\x6b\145\171"]; update_option("\144\x72\x65\x61\x6d\x5f\145\x78\x63\154\165\x64\145\x64\x5f\x62\162\141\x6e\144\137\x6b\145\x79", $dream_excluded_brand_key); } echo true; } public function dream_get_mapped_categories() { $map_product_categories = get_option("\x6d\x61\160\137\x70\x72\157\x64\165\x63\x74\x5f\143\141\x74\145\147\x6f\162\x69\x65\163"); if ($_POST["\x69\x73\x5f\141\152\x61\170"]) { echo json_encode($map_product_categories); die; } else { return $map_product_categories; } } public function dream_get_all_xml_products() { $uploads = wp_upload_dir(); $extract_path = $uploads["\142\x61\163\x65\x64\151\x72"] . "\x2f\x64\x72\145\141\x6d"; if (!file_exists($extract_path)) { mkdir($extract_path, 493, true); } $extracted_xmls = $extract_path . "\x2f\170\x6d\154\x2f"; if (!file_exists($extracted_xmls)) { mkdir($extracted_xmls, 484, true); } $extract_dir = $extract_path . "\x2f\172\151\x70\x2f"; if (!file_exists($extract_dir)) { mkdir($extract_dir, 484, true); } $dlp_new_xml_filepath = $extracted_xmls . "\170\x6d\x6c\137\60\60\61\x2e\x78\x6d\154"; if (file_exists($dlp_new_xml_filepath)) { $dlp_simplexml = simplexml_load_file($extracted_xmls . "\x78\155\x6c\137\60\60\x31\56\170\155\154"); if ($dlp_simplexml) { $prod_category = array(); $prod_count = 0; $total_prod_count = 0; foreach ($dlp_simplexml->product as $key => $xml_product) { $prod_sku = strval($xml_product->public_id); $prod_title = strval($xml_product->title); $arr_products[] = array($prod_sku, $prod_title); } $arr_products_chunks = $arr_products; } else { $arr_products_chunks = array(); } } else { $arr_products_chunks = array(); } return $arr_products_chunks; } public function dream_get_product_list() { $arr_products = $this->dream_get_all_xml_products(); return $arr_products; } public function dream_get_brand_list() { if (trim(get_option("\x64\162\x65\x61\155\x5f\165\160\x64\141\164\x65\137\170\x6d\x6c\137\x75\x72\154")) != '') { $xml = $this->ss_load_xml_file(); $list = array(); foreach ($xml->product as $key => $product) { $hierarchy = (string) $product->brand_hierarchy; $hierarchy = str_replace("\x27", "\40", $hierarchy); $prod_brand = array("\x6e\141\155\145" => $hierarchy); array_push($list, $prod_brand); } $lista = $this->unique_multidim_array($list, "\x6e\x61\155\145"); array_multisort($lista); return $lista; } else { return array(); } } public function dream_products_import() { $dreamlove_ps_t = get_option("\x64\162\145\141\x6d\160\x61") && get_option("\x64\162\x65\141\155\154\157\x76\145\x5f\141\143\143\x5f\163\x74\x61\x74\x75\x73") == 1; if ($dreamlove_ps_t) { $response = $this->dream_spck(false); require "\141\x73\163\145\x74\163\x2f\x76\x69\145\167\x73\57\144\x72\x65\141\155\137\x70\162\157\x64\x75\x63\164\163\x5f\151\x6d\x70\157\x72\164\x5f\160\x61\x67\x65\56\x70\150\160"; } else { require "\141\163\163\x65\x74\x73\x2f\x76\x69\x65\167\x73\x2f\144\162\x65\141\155\x5f\165\163\145\x72\x5f\141\x63\164\x69\166\141\x74\151\157\156\x5f\x70\141\x67\x65\x2e\160\150\160"; } } public function dream_create_cats() { $xml_url = get_option("\x64\x72\x65\141\155\x5f\x75\x70\144\141\x74\x65\x5f\170\155\x6c\137\x75\162\154", true); if (!filter_var($xml_url, FILTER_VALIDATE_URL)) { echo "\111\156\166\141\x6c\151\144\40\125\122\114\xd\12"; } else { $uploads = wp_upload_dir(); $extract_path = $uploads["\x62\x61\163\145\x64\x69\x72"] . "\57\144\154"; if (!file_exists($extract_path)) { mkdir($extract_path, 493, true); } $extracted_xmls = $extract_path . "\57\x78\155\x6c\x2f"; if (!file_exists($extracted_xmls)) { mkdir($extracted_xmls, 484, true); } $extract_dir = $extract_path . "\x2f\x7a\151\160\57"; if (!file_exists($extract_dir)) { mkdir($extract_dir, 484, true); } $dlp_new_xml_zip = $extract_dir . "\57\x78\155\154\137\160\162\x6f\144\x75\143\164\163\56\172\151\x70"; $file = file_put_contents($dlp_new_xml_zip, fopen($xml_url, "\162")); if ($file) { $zip = new ZipArchive(); if ($zip->open($dlp_new_xml_zip) != "\164\162\165\145") { echo "\125\156\141\x62\x6c\x65\x20\164\157\40\x6f\x70\x65\156\40\164\150\145\40\132\x69\160\x20\x46\151\x6c\x65\56\xd\12"; } else { $zip->extractTo($extracted_xmls); $zip->close(); $dlp_simplexml = simplexml_load_file($extracted_xmls . "\x78\155\154\137\60\60\61\x2e\170\155\154"); if (!$dlp_simplexml) { echo "\x55\156\x61\x62\154\x65\40\x74\x6f\40\x66\145\x74\x63\150\40\146\151\154\x65\x20\144\x65\x74\x61\x69\154\x73\x2e\xd\xa"; } else { $total_count = count($dlp_simplexml->product); foreach ($dlp_simplexml->product as $key => $dlpi_xml_product) { $prod_categories = $dlpi_xml_product->categories; foreach ($prod_categories->category as $cat_vals) { $cat_valsa = str_replace(array("\74\x21\133\103\x44\101\124\101\x5b", "\135\135\x3e"), array('', ''), $cat_vals); $cat_valse = explode("\174", $cat_vals); $total = count($cat_valse); if (!term_exists($this->clean_text(sanitize_title($cat_vals)), "\x70\162\x6f\x64\x75\x63\x74\137\143\x61\164")) { if (count($cat_valse) > 1) { $TSlug = $cat_valse[0]; for ($i = 1; $i < count($cat_valse); $i++) { $padre = $this->clean_text($cat_valse[$i - 1]); $term_s = get_term_by("\163\154\x75\x67", $this->clean_text(sanitize_title($TSlug)), "\x70\x72\x6f\x64\x75\143\x74\137\x63\141\164"); if (!$term_s) { $term_s = wp_insert_term($this->clean_text(strval($padre)), "\160\162\x6f\144\165\143\164\x5f\x63\141\x74", array("\163\x6c\165\147" => $this->clean_text(sanitize_title(strtolower($TSlug))))); $term_id = $term_s["\164\145\x72\x6d\137\x69\144"]; } else { $term_id = $term_s->term_id; } $TSlug .= "\174" . $cat_valse[$i]; $hijo = $this->clean_text($cat_valse[$i]); if (!term_exists(sanitize_title($TSlug), "\x70\162\x6f\144\x75\x63\x74\137\x63\x61\164")) { $term = $this->Create_Cats_Parent($term_id, $hijo, $TSlug); } else { $term = get_term_by("\x73\x6c\165\x67", $this->clean_text(sanitize_title($TSlug)), "\x70\x72\x6f\x64\x75\x63\x74\137\x63\x61\164"); } } } else { $term = wp_insert_term($this->clean_text(strval($cat_valse[$total - 1])), "\160\x72\x6f\144\x75\x63\x74\x5f\143\x61\x74", array("\x73\154\x75\x67" => $this->clean_text(sanitize_title(strtolower($cat_vals))))); } } else { if (count($cat_valse) > 1) { $TSlug = $cat_valse[0]; for ($i = 1; $i < count($cat_valse); $i++) { $padre = $this->clean_text($cat_valse[$i - 1]); $term_s = get_term_by("\163\x6c\x75\x67", $this->clean_text(sanitize_title($TSlug)), "\160\162\x6f\x64\165\x63\x74\x5f\x63\141\164"); if (!$term_s) { $term_s = wp_insert_term($this->clean_text(strval($padre)), "\x70\162\x6f\144\x75\x63\164\137\143\141\164", array("\x73\154\x75\147" => $this->clean_text(sanitize_title(strtolower($TSlug))))); $term_id = $term_s["\164\x65\x72\155\x5f\151\144"]; } else { $term_id = $term_s->term_id; } $TSlug .= "\x7c" . $cat_valse[$i]; $hijo = $this->clean_text($cat_valse[$i]); if (!term_exists(sanitize_title($TSlug), "\160\x72\x6f\144\x75\x63\x74\137\x63\141\164")) { $term = $this->Create_Cats_Parent($term_id, $hijo, $TSlug); } else { $term = get_term_by("\x73\154\165\x67", $this->clean_text(sanitize_title($TSlug)), "\160\162\x6f\x64\165\143\x74\137\143\141\x74"); } } } else { $term = get_term_by("\163\x6c\x75\147", $this->clean_text(sanitize_title($cat_valse[$total - 1])), "\x70\x72\x6f\x64\x75\x63\x74\137\x63\141\x74"); if (!$term) { $term = wp_insert_term($this->clean_text(strval($cat_valse[$total - 1])), "\160\162\x6f\x64\165\143\x74\137\x63\141\x74", array("\163\154\x75\147" => $this->clean_text(sanitize_title(strtolower($cat_vals))))); } } } } } $xmlzip_files = glob($extract_path . "\57\52"); foreach ($xmlzip_files as $file) { if (is_file($file)) { unlink($file); } } } } } } } public function dream_init_import() { require_once "\144\x72\145\x61\155\x74\x61\163\x6b\x2e\x70\150\x70"; $this->dream_info(); } public function dream_translate() { $string = $_POST["\164\162\x61\x6e\x73\154\x61\164\145"]; echo _e($string, "\x64\x72\x65\x61\155\154\x6f\x76\145\137\x70\x73"); } public function dream_option() { $option = $_POST["\157\160\164\x69\157\156"]; $value = $_POST["\166\141\x6c\165\145"]; update_option($option, $value); } public function dream_cleantemp() { $directorio = plugin_dir_path(__FILE__) . "\57\x63\150\145\143\x6b"; if (is_dir($directorio)) { $archivos = scandir($directorio); foreach ($archivos as $archivo) { if ($archivo != "\56" && $archivo != "\x2e\x2e") { $rutaCompleta = $directorio . "\57" . $archivo; if (is_file($rutaCompleta)) { unlink($rutaCompleta); } } } } } public function dream_info() { $cprocess = get_option("\x63\x6f\165\156\164\137\x70\162\157\x63\x65\x73\163", 0); $response = "\173"; $counter = get_option("\164\157\x74\x61\154\x5f\x70\x72\157\x64\x75\x63\164\137\x69\160", 0); $total = get_option("\164\x6f\164\x61\x6c\x5f\x70\162\x6f\144\165\143\164\137\x78\155\154", 0); $status = get_option("\163\x74\x61\x74\165\x73\x5f\151\155\x70\x6f\x72\164"); $init = get_option("\163\x74\x61\x72\x74\137\151\x6d\x70\x6f\x72\x74\137\x64\x61\164\x65", ''); $inittime = get_option("\x73\164\141\162\x74\137\x69\x6d\x70\x6f\x72\x74\x5f\x74\x69\x6d\145", ''); $last = get_option("\x6c\141\163\164\137\165\160\x64\x61\164\145\137\151\x6d\160\x6f\162\x74\x5f\x64\x61\164\145", ''); $end = get_option("\x65\x6e\144\x5f\x69\155\160\157\x72\x74\x5f\144\x61\164\x65", ''); $next = get_option("\156\145\170\164\x5f\x69\x6d\160\157\162\164"); $lastsku = get_option("\x6c\141\163\x74\x5f\x73\x6b\165", ''); if ($next != '') { $next = date("\x64\x2f\x6d\57\x59\x20\55\x20\x48\x3a\x69\x3a\163", $next); } $response .= "\42\x70\x72\x6f\147\x72\x65\163\x73\x22\x3a\42" . $counter . "\x22\54"; $response .= "\x22\164\157\x74\141\x6c\42\x3a\x22" . $total . "\42\54"; $response .= "\42\163\x74\x61\164\x75\x73\42\x3a\x22" . $status . "\x22\x2c"; $response .= "\42\154\141\163\x74\163\153\165\x22\72\x22" . $lastsku . "\42\54"; $response .= "\x22\x6c\141\163\164\42\x3a\x22" . $last . "\42\54"; $response .= "\42\x73\x74\x61\162\x74\42\x3a\42" . $init . "\x22\54"; $response .= "\42\145\x6e\144\x22\72\x22" . $end . "\x22\x2c"; $response .= "\42\x63\x70\162\157\143\145\x73\x73\x22\72\x22" . $cprocess . "\x22\x2c"; $response .= "\x22\x6e\x65\170\x74\42\72\x22" . $next . "\x22\x2c"; $response .= "\x22\163\x74\x61\x72\x74\x74\151\x6d\145\x22\72\42" . $inittime . "\42"; $response .= "\x7d"; echo $response; } public function Create_Cats_Parent($pTerm, $Name, $SName) { $slug = $this->clean_text(sanitize_title(strtolower($SName))); $term = wp_insert_term($Name, "\160\162\x6f\x64\165\143\164\137\x63\x61\x74", array("\x73\x6c\165\147" => $slug, "\x70\141\162\145\156\x74" => intval($pTerm))); return $term; } public function clean_text($texto, $limpiezaHtml = true, $limiteCaracteres = null) { $texto = trim($texto); $texto = html_entity_decode($texto); $texto = trim(preg_replace("\57\134\x74\x2b\57", '', $texto)); $texto = addslashes($texto); if ($limpiezaHtml) { $texto = strip_tags($texto); } $texto = preg_replace("\57\133\x5c\x78\173\x32\60\x30\102\175\x2d\134\x78\x7b\62\x30\x30\x44\x7d\135\57\165", '', $texto); $texto = preg_replace("\x2f\133\x5c\x78\173\62\60\60\102\175\55\134\x78\173\x32\x30\x30\x44\x7d\x5c\x78\173\106\105\106\106\175\x5d\57\165", '', $texto); $texto = str_replace("\342\x80\x8c", '', $texto); $texto = str_replace("\x26\43\70\62\x30\x33\x3b", '', $texto); $texto = str_replace(array("\15\xa", "\xa", "\xd"), "\x3c\142\162\x3e", $texto); $texto = str_replace("\134\x5c\x72", "\x3c\x62\162\x3e", $texto); $texto = str_replace("\134\162", "\74\x62\x72\x3e", $texto); $texto = str_replace("\xd", "\74\x62\162\x3e", $texto); $texto = str_replace("\157\156\143\x6c\x69\143\153", "\x69\x64", $texto); $texto = str_replace(array("\134", "\302\250", "\302\xba", "\342\x80\x93", "\x7e", "\x7c", "\xc2\267", "\46", "\302\xbf", "\136", "\302\xa8", "\xc2\xb4", "\43"), '', $texto); $texto = str_replace(array("\x5c", "\xe2\x80\x99"), '', $texto); if ($limiteCaracteres > 0) { $texto = substr($texto, 0, $limiteCaracteres); } return $texto; } public function dream_force_stop_import() { $rutaArchivo = plugin_dir_path(__FILE__) . "\57\163\164\x6f\160\x2e\x74\x78\164"; if (file_exists($rutaArchivo)) { echo "\x45\x6c\40\x61\162\143\x68\151\166\157\x20\171\x61\x20\x65\x78\x69\163\x74\x65\56\12"; } try { $archivo = fopen($rutaArchivo, "\x77"); if ($archivo === false) { throw new Exception("\x4e\x6f\40\x73\x65\x20\x70\165\x64\x6f\x20\143\x72\145\x61\162\40\x6f\40\x61\142\162\151\162\x20\145\x6c\x20\141\162\x63\x68\151\166\x6f\x2e"); } fclose($archivo); echo "\105\154\40\x61\x72\x63\x68\x69\x76\157\x20\x68\141\x20\163\x69\144\157\40\143\x72\145\x61\144\x6f\x20\145\x78\x69\x74\157\163\141\x6d\x65\156\164\145\x2e\12"; } catch (Exception $e) { echo "\x45\x72\x72\157\162\x20\x61\154\40\143\162\x65\141\162\40\145\x6c\40\141\x72\143\x68\x69\166\157\x3a\40" . $e->getMessage() . "\xa"; } } public function sort_terms_hierarchically(array &$cats, array &$into, $parentId = 0) { foreach ($cats as $i => $cat) { if ($cat->parent == $parentId) { $into[$cat->term_id] = $cat; unset($cats[$i]); } } foreach ($into as $topCat) { $topCat->children = array(); $this->sort_terms_hierarchically($cats, $topCat->children, $topCat->term_id); } } public function dream_create_menu() { $categories = get_terms("\160\x72\x6f\x64\165\x63\x74\137\x63\x61\164", array("\150\x69\144\x65\x5f\145\x6d\x70\164\171" => false)); $categoryHierarchy = array(); $this->sort_terms_hierarchically($categories, $categoryHierarchy); $menuname = "\x44\162\x65\141\155\137\x4d\x65\156\165"; $menu_exists = wp_get_nav_menu_object($menuname); if (!$menu_exists) { $menu_id = wp_create_nav_menu($menuname); $this->addMenu($categoryHierarchy, $menu_id); } else { wp_delete_nav_menu($menuname); $menu_id = wp_create_nav_menu($menuname); $this->addMenu($categoryHierarchy, $menu_id); } echo 1; } public function dream_clean_mapping() { update_option("\x6d\x61\160\x5f\x70\162\x6f\x64\x75\x63\164\x5f\143\x61\x74\145\147\157\162\151\x65\163", ''); echo 1; } public function addMenu($list, $menu_id) { foreach ($list as $cat) { $parent = 0; if ($cat->parent > 0) { $parent = $this->FindMenuItemID($menu_id, $cat->parent); } wp_update_nav_menu_item($menu_id, 0, array("\x6d\x65\156\165\x2d\151\x74\x65\x6d\55\164\151\164\154\x65" => $cat->name, "\x6d\x65\156\165\x2d\151\x74\x65\155\55\157\x62\152\x65\x63\x74" => "\x70\x72\157\x64\165\x63\164\x5f\143\x61\164", "\x6d\145\x6e\165\x2d\151\x74\145\x6d\55\157\x62\152\145\x63\x74\55\151\x64" => $cat->term_id, "\155\x65\x6e\x75\55\151\x74\145\x6d\55\160\x61\162\145\x6e\x74\x2d\151\144" => $parent, "\155\x65\156\x75\55\151\164\x65\x6d\55\x74\x79\x70\x65" => "\x74\141\x78\x6f\x6e\x6f\155\171", "\155\145\x6e\x75\x2d\x69\x74\x65\155\55\x73\x74\141\x74\x75\x73" => "\x70\x75\x62\154\151\163\x68")); if (count($cat->children) > 0) { $this->addMenu($cat->children, $menu_id); } } } public function FindMenuItemID($menu, $seek) { $menu_items = wp_get_nav_menu_items($menu); foreach ((array) $menu_items as $key => $menu_item) { if ($menu_item->object_id == $seek) { return $menu_item->ID; } } return 0; } public function variation_query($posts, $query = false) { if (is_search() && !is_admin()) { $ignoreIds = array(0); foreach ($posts as $post) { $ignoreIds[] = $post->ID; } $matchedSku = $this->get_parent_post_by_sku(get_search_query(), $ignoreIds); if ($matchedSku) { foreach ($matchedSku as $product_id) { $posts[] = get_post($product_id->post_id); } } return $posts; } return $posts; } public function get_parent_post_by_sku($sku, $ignoreIds) { global $wpdb, $wp_query; if ($sku == '') { return array(0); } $wmplEnabled = false; if (defined("\x57\x50\115\x4c\x5f\124\x4d\137\126\x45\x52\123\x49\x4f\116") && defined("\x57\120\x4d\x4c\x5f\x53\124\137\126\105\122\x53\x49\117\116") && class_exists("\x77\x6f\x6f\143\x6f\155\155\x65\162\143\145\137\167\x70\x6d\154")) { $wmplEnabled = true; $languageCode = "\x45\x53\x5f\x65\163"; } $results = array(); $ignoreIdsForMySql = implode("\x2c", $ignoreIds); $variationsSql = "\12\x20\x20\40\x20\40\x20\40\40\40\40\x20\x20\x20\x20\123\x45\114\105\103\x54\40\x70\56\160\157\x73\x74\x5f\x70\141\162\145\156\164\x20\x61\163\x20\160\x6f\x73\x74\x5f\x69\x64\40\x46\122\x4f\x4d\40{$wpdb->posts}\40\x61\x73\x20\x70\12\x20\40\40\40\x20\x20\x20\x20\x20\40\x20\40\x20\40\x6a\157\x69\x6e\x20{$wpdb->postmeta}\x20\160\155\xa\x20\x20\40\40\x20\x20\x20\x20\40\40\40\40\40\40\x6f\156\40\160\x2e\111\104\40\x3d\40\160\155\56\160\x6f\163\x74\137\151\x64\xa\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\40\x20\x20\40\141\x6e\144\40\x28\160\155\56\155\x65\164\x61\137\153\x65\x79\x3d\x27\137\163\x6b\x75\47\40\x6f\x72\40\x70\155\56\x6d\x65\164\x61\x5f\x6b\145\171\75\47\x5f\x62\141\162\x63\x6f\x64\x65\47\51\xa\40\x20\x20\40\x20\40\x20\40\40\40\40\40\x20\40\x61\x6e\144\40\x70\x6d\56\x6d\145\164\141\137\166\141\x6c\x75\x65\40\x4c\111\x4b\x45\40\47\x25{$sku}\45\x27\xa\x20\40\40\x20\x20\40\x20\40\x20\40\x20\40\x20\x20\152\x6f\151\x6e\40{$wpdb->postmeta}\x20\x76\151\163\151\x62\151\x6c\x69\164\171\12\x20\x20\40\x20\x20\40\40\40\40\x20\40\40\40\x20\157\x6e\x20\160\56\x70\x6f\163\164\x5f\160\x61\x72\x65\156\164\x20\75\40\x76\151\163\x69\x62\x69\x6c\151\164\x79\x2e\x70\x6f\x73\164\x5f\151\144\40\40\x20\40\xa\40\40\x20\40\x20\40\x20\x20\x20\x20\40\x20\x20\40\x61\x6e\144\x20\x76\x69\x73\151\142\x69\154\x69\164\x79\x2e\155\x65\164\141\137\153\x65\171\x20\x3d\x20\47\x5f\x76\151\163\151\x62\x69\x6c\151\164\171\x27\12\x20\40\x20\40\x20\40\40\x20\x20\40\40\x20\40\x20\141\x6e\144\x20\x76\x69\x73\151\x62\151\154\151\x74\x79\56\155\145\x74\x61\x5f\166\x61\x6c\x75\x65\40\x3c\x3e\x20\x27\x68\x69\144\144\x65\x6e\47\xa\40\40\40\x20\x20\x20\x20\x20\x20\40\40\x20\40\x20\40\40"; if ($wmplEnabled) { $variationsSql .= "\x6a\157\x69\156\x20" . $wpdb->prefix . "\x69\143\x6c\x5f\x74\162\x61\156\x73\154\141\164\x69\157\156\163\x20\164\40\157\x6e\xa\40\x20\x20\40\x20\x20\40\x20\40\40\x20\x20\40\164\56\x65\154\145\155\x65\156\x74\x5f\151\144\x20\x3d\40\160\x2e\x70\157\x73\164\137\160\141\162\x65\x6e\x74\12\40\x20\40\40\40\x20\x20\40\40\x20\x20\40\40\141\156\x64\40\x74\x2e\145\x6c\x65\155\145\x6e\164\x5f\164\x79\x70\x65\x20\x3d\40\47\160\157\163\164\137\160\162\157\x64\165\143\x74\x27\xa\x20\40\40\x20\x20\40\40\x20\x20\x20\x20\40\x20\141\156\x64\x20\164\x2e\154\141\156\147\x75\x61\147\145\x5f\x63\x6f\x64\x65\40\x3d\40\47{$languageCode}\47"; } $variationsSql .= "\12\40\x20\x20\40\40\x20\40\x20\x20\40\x20\x20\x20\40\x77\x68\x65\x72\145\x20\61\12\x20\40\x20\40\40\x20\40\x20\40\40\40\40\40\40\101\x4e\x44\x20\x70\56\160\x6f\163\x74\137\160\x61\x72\145\x6e\164\40\x3c\76\40\x30\xa\x20\x20\x20\x20\x20\x20\40\40\40\40\x20\x20\x20\x20\141\x6e\144\40\160\x2e\111\x44\x20\156\157\164\x20\151\x6e\x20\50{$ignoreIdsForMySql}\51\xa\40\40\x20\x20\40\40\40\40\x20\40\x20\x20\x20\x20\141\x6e\x64\40\x70\56\160\x6f\163\164\137\x73\164\141\164\x75\x73\x20\75\40\x27\x70\165\x62\154\151\163\150\47\xa\40\40\40\x20\40\40\x20\x20\x20\40\x20\x20\40\40\x67\162\x6f\x75\160\40\x62\171\40\160\56\x70\157\x73\164\137\x70\141\x72\145\x6e\x74\xa\40\40\x20\40\x20\40\x20\x20\40\x20\40\x20\x20\x20"; $variations = $wpdb->get_results($variationsSql); foreach ($variations as $post) { $ignoreIds[] = $post->post_id; } $ignoreIdsForMySql = implode("\54", $ignoreIds); $regularProductsSql = "\x53\105\x4c\x45\x43\124\x20\160\56\111\104\40\x61\163\40\x70\157\x73\x74\137\x69\144\x20\x46\122\x4f\x4d\40{$wpdb->posts}\40\141\x73\x20\x70\xa\x20\x20\40\x20\x20\40\x20\x20\40\40\40\40\152\157\x69\156\x20{$wpdb->postmeta}\x20\x70\155\12\x20\40\x20\x20\x20\x20\x20\40\x20\x20\40\x20\157\156\40\160\x2e\x49\104\x20\x3d\x20\x70\x6d\x2e\x70\x6f\x73\164\x5f\x69\x64\xa\x20\40\40\x20\x20\x20\x20\x20\40\x20\x20\40\x61\x6e\144\x20\50\x70\x6d\x2e\155\x65\164\141\x5f\153\x65\x79\x3d\x27\137\x73\x6b\165\47\x20\157\x72\x20\160\x6d\x2e\x6d\x65\x74\141\137\153\145\171\x3d\x27\x5f\x62\141\162\143\157\x64\x65\47\x29\xa\x20\x20\40\x20\x20\x20\x20\x20\40\40\x20\x20\x41\116\x44\40\x70\x6d\x2e\x6d\145\164\141\137\x76\141\154\165\x65\40\x4c\x49\x4b\105\x20\47\45{$sku}\45\47\40\12\40\x20\40\x20\x20\x20\x20\40\40\40\x20\40\x6a\x6f\151\156\40{$wpdb->postmeta}\40\166\151\x73\151\142\151\154\151\164\x79\12\40\x20\40\x20\x20\40\40\x20\40\40\x20\x20\x6f\156\40\160\56\111\104\40\x3d\x20\x76\x69\x73\x69\142\151\x6c\151\164\171\56\160\x6f\x73\x74\x5f\151\x64\40\x20\x20\40\12\x20\40\x20\40\x20\x20\x20\x20\40\40\x20\40\x61\x6e\144\40\166\151\x73\151\142\x69\154\151\164\x79\56\155\x65\x74\141\x5f\153\145\171\40\x3d\40\x27\x5f\x76\x69\163\151\142\x69\154\x69\x74\x79\47\12\x20\x20\x20\x20\x20\40\x20\40\x20\x20\x20\40\141\156\144\x20\x76\151\163\x69\142\x69\154\151\x74\171\x2e\x6d\x65\x74\x61\137\x76\141\x6c\165\145\40\74\76\40\x27\150\x69\x64\144\x65\156\47"; if ($wmplEnabled) { $regularProductsSql .= "\x6a\157\151\x6e\40" . $wpdb->prefix . "\151\143\x6c\137\x74\x72\x61\x6e\163\x6c\141\x74\x69\157\x6e\163\x20\164\x20\x6f\156\12\40\40\x20\x20\40\40\x20\40\x20\40\x20\40\40\x74\x2e\x65\x6c\145\x6d\x65\x6e\164\x5f\x69\144\x20\x3d\x20\x70\x2e\x49\x44\12\x20\x20\x20\40\40\x20\x20\40\x20\40\x20\40\x20\141\x6e\144\40\x74\56\145\154\x65\155\x65\x6e\164\x5f\x74\x79\160\x65\x20\x3d\40\47\x70\x6f\x73\164\x5f\x70\162\x6f\144\165\x63\x74\47\12\40\x20\x20\x20\x20\x20\40\x20\40\40\40\x20\x20\141\x6e\144\40\x74\x2e\154\x61\x6e\147\165\141\x67\x65\137\143\x6f\x64\x65\40\75\40\x27{$languageCode}\47"; } $regularProductsSql .= "\167\150\x65\162\145\x20\x31\12\40\x20\40\40\x20\x20\x20\x20\x20\x20\x20\40\141\156\x64\x20\50\x70\x2e\160\157\163\164\137\x70\141\162\x65\156\164\40\x3d\40\x30\40\x6f\x72\x20\x70\x2e\x70\157\x73\x74\137\x70\x61\162\145\x6e\164\40\x69\x73\40\156\x75\154\154\51\xa\x20\x20\x20\40\40\x20\40\x20\40\x20\40\40\x61\156\144\40\x70\x2e\x49\104\x20\x6e\x6f\164\40\151\156\x20\x28{$ignoreIdsForMySql}\51\xa\x20\x20\x20\x20\40\x20\40\40\40\x20\x20\x20\141\x6e\144\40\160\x2e\160\157\x73\x74\x5f\163\x74\141\x74\165\x73\40\75\40\47\x70\x75\142\x6c\151\163\x68\47\12\x20\40\40\40\x20\x20\40\40\x20\40\40\x20\x67\x72\157\165\x70\x20\x62\x79\x20\x70\x2e\x49\104"; $regular_products = $wpdb->get_results($regularProductsSql); $results = array_merge($variations, $regular_products); $wp_query->found_posts += sizeof($results); return $results; } public function add_barcode() { woocommerce_wp_text_input(array("\151\144" => "\x5f\142\141\162\x63\x6f\144\x65", "\154\x61\142\x65\x6c" => __("\102\x61\x72\143\x6f\144\x65", "\x64\162\x65\141\x6d\x6c\x6f\166\x65\137\160\163"), "\x70\x6c\141\143\145\x68\x6f\x6c\x64\x65\x72" => "\x53\143\x61\x6e\40\x42\x61\x72\143\x6f\x64\145", "\144\145\x73\143\137\x74\x69\160" => "\x74\x72\x75\145", "\144\145\163\x63\x72\x69\x70\164\151\x6f\156" => __("\x53\x63\141\156\40\164\150\x65\40\160\x72\x6f\x64\165\143\x74\x27\163\40\x62\141\162\x63\157\x64\x65\x2e", "\x64\x72\145\141\x6d\x6c\x6f\166\x65\x5f\160\163"))); } public function add_barcode_variation($loop, $variation_data, $variation) { echo "\x3c\144\x69\166\40\x63\x6c\141\x73\x73\75\42\x6f\x70\164\x69\x6f\156\163\x5f\147\162\157\165\x70\40\x66\x6f\162\x6d\x2d\162\157\167\40\x66\x6f\162\x6d\55\162\157\x77\55\146\165\154\154\x22\76"; woocommerce_wp_text_input(array("\151\x64" => "\x5f\x62\141\162\143\x6f\x64\145\x5b" . $variation->ID . "\135", "\x6c\141\x62\x65\x6c" => __("\102\141\x72\x63\157\x64\x65", "\x64\x72\x65\x61\155\154\157\x76\145\x5f\x70\x73"), "\x70\154\x61\143\x65\x68\157\x6c\x64\145\162" => "\x53\x63\x61\x6e\40\102\x61\162\143\157\144\145", "\144\145\x73\143\x5f\164\151\160" => true, "\144\x65\163\x63\162\x69\x70\x74\151\x6f\x6e" => __("\123\143\x61\156\40\x74\150\x65\x20\x70\x72\x6f\x64\165\143\164\47\163\40\x62\141\x72\x63\x6f\144\145\x2e", "\x77\x6f\157\x63\157\x6d\x6d\x65\x72\143\x65"), "\166\141\154\165\145" => get_post_meta($variation->ID, "\137\x62\141\x72\x63\157\144\145", true))); echo "\74\57\x64\151\x76\x3e"; } public function add_barcode_variation_save($post_id) { $woocommerce_text_field = $_POST["\137\x62\x61\162\143\x6f\144\x65"][$post_id]; update_post_meta($post_id, "\137\142\141\162\x63\x6f\144\x65", esc_attr($woocommerce_text_field)); } public function add_barcode_save($product) { if (isset($_POST["\137\142\141\162\x63\x6f\144\145"])) { $product->update_meta_data("\137\x62\x61\162\x63\157\x64\x65", sanitize_text_field($_POST["\137\x62\x61\x72\143\x6f\144\145"])); } else { $product->delete_meta_data("\x5f\142\x61\x72\x63\x6f\144\145"); } } public function add_costprice() { woocommerce_wp_text_input(array("\151\x64" => "\137\x63\x6f\163\164\x70\x72\151\x63\145", "\x6c\141\142\145\154" => __("\103\x6f\163\x74\40\x50\x72\151\143\x65", "\144\x72\145\x61\155\154\157\166\145\137\160\x73"), "\x70\154\x61\143\x65\x68\157\154\144\145\162" => "\x43\x6f\x73\164\x20\x50\162\151\x63\145", "\x64\x65\x73\143\x5f\x74\151\160" => "\x74\162\x75\145", "\x64\x65\163\143\162\151\160\x74\x69\x6f\156" => __("\x50\162\157\144\x75\143\x74\40\143\157\x73\164\x20\x70\x72\x69\143\145", "\x64\162\x65\141\155\154\157\x76\145\x5f\x70\x73"))); } public function add_costprice_save($product) { if (isset($_POST["\x5f\143\x6f\x73\x74\160\162\151\x63\x65"])) { $product->update_meta_data("\137\143\157\x73\x74\160\x72\x69\x63\x65", sanitize_text_field($_POST["\137\143\157\x73\x74\x70\x72\151\x63\145"])); } else { $product->delete_meta_data("\x5f\143\157\163\x74\160\162\151\x63\145"); } } public function add_costprice_variation($loop, $variation_data, $variation) { echo "\74\144\151\166\40\143\x6c\141\x73\x73\x3d\42\x6f\x70\164\x69\157\x6e\x73\x5f\147\x72\157\165\x70\x20\146\x6f\x72\155\55\162\157\x77\40\146\157\x72\x6d\55\x72\x6f\x77\55\x66\x75\154\x6c\42\x3e"; woocommerce_wp_text_input(array("\151\144" => "\x5f\x63\157\x73\x74\160\x72\151\x63\145\x5b" . $variation->ID . "\x5d", "\154\141\x62\145\x6c" => __("\x43\x6f\163\164\x20\x50\x72\151\143\145", "\x64\x72\x65\141\x6d\x6c\x6f\166\x65\x5f\x70\163"), "\160\154\141\x63\145\x68\157\154\144\x65\162" => "\x43\x6f\163\x74\40\120\x72\x69\143\x65", "\144\145\163\143\x5f\x74\x69\160" => true, "\x64\x65\163\x63\162\x69\x70\164\x69\157\x6e" => __("\x70\162\157\x64\x75\143\164\40\x63\x6f\x73\164\40\160\162\151\x63\x65", "\167\157\x6f\143\157\155\155\145\162\143\145"), "\166\x61\x6c\x75\145" => get_post_meta($variation->ID, "\137\x63\157\x73\x74\160\x72\151\x63\145", true))); echo "\74\x2f\x64\151\x76\76"; } public function add_costprice_variation_save($post_id) { $woocommerce_text_field = $_POST["\x5f\x63\x6f\163\x74\160\162\151\143\x65"][$post_id]; update_post_meta($post_id, "\x5f\143\x6f\x73\164\160\x72\x69\x63\145", esc_attr($woocommerce_text_field)); } public function add_dreamid() { woocommerce_wp_text_input(array("\151\144" => "\x5f\x64\162\145\141\155\151\144", "\x6c\141\142\x65\154" => __("\104\162\x65\141\x6d\x4c\157\166\x65\x20\x49\104", "\x64\x72\145\x61\155\154\x6f\166\145\137\x70\x73"), "\160\154\141\x63\x65\150\x6f\x6c\x64\x65\x72" => "\x44\x72\x65\x61\155\114\157\166\145\40\111\104", "\144\x65\x73\143\x5f\x74\151\x70" => "\x66\x61\154\163\x65", "\144\x65\163\x63\x72\x69\x70\164\151\x6f\x6e" => __("\104\x72\x65\x61\x6d\x4c\157\166\x65\40\x49\104", "\x64\x72\145\x61\155\154\x6f\166\x65\137\x70\x73"))); } public function add_dreamid_save($product) { if (isset($_POST["\x5f\x64\x72\145\141\x6d\151\144"])) { $product->update_meta_data("\x5f\144\162\x65\141\x6d\151\x64", sanitize_text_field($_POST["\137\144\x72\x65\141\155\x69\x64"])); } else { $product->delete_meta_data("\137\144\x72\x65\x61\155\151\144"); } } public function add_int_id() { woocommerce_wp_text_input(array("\x69\144" => "\137\x69\x6e\164\137\151\144", "\x6c\141\x62\x65\154" => __("\111\156\164\40\111\104", "\x64\x72\x65\141\x6d\x6c\x6f\x76\145\137\160\163"), "\160\x6c\141\x63\x65\x68\157\x6c\144\145\x72" => "\111\156\x74\x20\111\104", "\144\x65\x73\143\x5f\164\151\x70" => "\146\141\154\x73\145", "\x64\145\163\x63\162\x69\160\164\151\157\156" => __("\x49\x6e\164\x20\x49\104", "\x64\x72\145\141\155\x6c\157\166\x65\x5f\x70\163"))); } public function add_int_id_save($product) { if (isset($_POST["\x5f\151\x6e\x74\x5f\x69\144"])) { $product->update_meta_data("\x5f\x69\156\x74\x5f\151\x64", sanitize_text_field($_POST["\x5f\151\156\x74\x5f\151\144"])); } else { $product->delete_meta_data("\x5f\151\156\164\137\x69\x64"); } } public function add_dreamid_variation($loop, $variation_data, $variation) { echo "\74\x64\151\166\x20\143\x6c\x61\163\163\75\x22\x6f\x70\x74\151\157\x6e\163\137\x67\162\x6f\165\160\x20\x66\x6f\162\155\55\162\x6f\x77\x20\146\x6f\x72\x6d\55\x72\x6f\x77\55\x66\165\x6c\154\x22\76"; woocommerce_wp_text_input(array("\x69\x64" => "\137\144\162\145\x61\x6d\x69\x64\x5b" . $variation->ID . "\135", "\x6c\x61\142\145\x6c" => __("\104\162\145\x61\155\114\157\166\145\40\111\104", "\144\162\x65\141\x6d\x6c\x6f\166\145\x5f\160\163"), "\160\x6c\x61\x63\145\150\157\154\144\145\x72" => "\104\162\x65\141\155\114\x6f\x76\x65\x20\111\x44", "\144\145\163\143\137\x74\151\x70" => true, "\x64\145\163\143\162\x69\x70\164\x69\x6f\x6e" => __("\x44\x72\145\x61\x6d\x4c\x6f\x76\145\40\111\104", "\167\x6f\x6f\143\x6f\155\155\x65\x72\143\145"), "\166\141\154\165\x65" => get_post_meta($variation->ID, "\x5f\x64\162\x65\x61\x6d\151\x64", true))); echo "\x3c\57\144\151\166\x3e"; } public function add_dreamid_variation_save($post_id) { $woocommerce_text_field = $_POST["\137\x64\x72\145\x61\155\x69\x64"][$post_id]; update_post_meta($post_id, "\137\x64\162\x65\x61\x6d\151\144", esc_attr($woocommerce_text_field)); } public function dream_delete_draft() { $this->clean_product_to_delete(); $lastpagedd = 500; $oldlastpagedd = get_option("\144\145\x6c\137\154\x61\x73\x74\160\141\147\x65\144\x64"); if (!empty($oldlastpagedd)) { $lastpagedd = $oldlastpagedd; } for ($apr = $lastpagedd; $apr >= 1; $apr--) { $args = array("\160\157\163\x74\x5f\164\171\x70\x65" => "\x70\x72\x6f\144\165\143\164", "\160\x6f\x73\x74\137\163\x74\x61\164\x75\x73" => "\144\162\x61\x66\x74", "\160\157\x73\164\x73\137\x70\145\162\137\x70\x61\x67\x65" => 100, "\160\141\147\x65\144" => $apr); $products = get_posts($args); foreach ($products as $key => $product) { $prod_post_id = $product->ID; $fproduct = wc_get_product($prod_post_id); if ($fproduct->get_type() == "\166\141\162\x69\x61\x62\154\x65") { $vchild = $fproduct->get_children(); $kvid = true; for ($vpi = 0; $vpi < count($vchild); $vpi++) { wp_trash_post($vchild[$vpi]); } if (empty($vchild) || $kvid) { wp_update_post(array("\111\104" => $prod_post_id, "\160\157\x73\x74\137\163\x74\141\164\165\x73" => "\144\145\154\x65\x74\x69\156\147")); } } else { wp_update_post(array("\111\x44" => $prod_post_id, "\x70\x6f\x73\x74\137\x73\x74\141\164\x75\163" => "\x64\145\x6c\145\x74\151\x6e\147")); } } update_option("\x64\145\x6c\x5f\154\141\163\164\160\141\147\x65\144\x64", $apr); } update_option("\144\x65\x6c\137\154\x61\x73\x74\x70\x61\x67\x65\x64\144", 500); $this->clean_product_to_delete(); } public function dream_delete_all() { $this->clean_product_to_delete(); $lastpageda = 500; $oldlastpageda = get_option("\144\145\154\137\x6c\141\163\x74\160\x61\x67\145\144\x61"); if (!empty($oldlastpageda)) { $lastpageda = $oldlastpageda; } for ($apr = $lastpageda; $apr >= 1; $apr--) { $args = array("\160\157\163\164\x5f\x74\x79\x70\145" => "\x70\162\x6f\x64\x75\x63\164", "\160\157\x73\x74\x5f\x73\x74\141\x74\x75\163" => "\x70\165\142\x6c\x69\163\150\54\x70\162\151\x76\141\164\x65\54\x64\x72\x61\146\x74", "\160\157\x73\164\163\137\160\x65\x72\137\160\141\147\x65" => 100, "\x70\x61\147\145\x64" => $apr); $products = get_posts($args); foreach ($products as $key => $product) { $prod_post_id = $product->ID; $fproduct = wc_get_product($prod_post_id); if ($fproduct->get_type() == "\166\141\162\151\x61\x62\154\145") { $vchild = $fproduct->get_children(); $kvid = true; for ($vpi = 0; $vpi < count($vchild); $vpi++) { wp_trash_post($vchild[$vpi]); } if (empty($vchild) || $kvid) { wp_update_post(array("\111\104" => $prod_post_id, "\160\157\x73\164\137\x73\164\x61\164\165\163" => "\144\x65\x6c\x65\x74\x69\x6e\147")); } } else { wp_update_post(array("\x49\x44" => $prod_post_id, "\160\157\x73\x74\137\163\x74\x61\164\x75\x73" => "\144\145\x6c\x65\164\x69\156\147")); } } update_option("\x64\145\154\137\x6c\141\163\164\x70\x61\x67\145\x64\141", $apr); } update_option("\x64\145\154\137\154\141\x73\x74\160\141\x67\x65\x64\141", 500); $this->clean_product_to_delete(); } public function dream_delete_duplicate() { $this->clean_product_to_delete(); $lastpagedu = 500; $oldlastpagedu = get_option("\x64\x65\x6c\137\154\141\x73\x74\x70\x61\x67\145\x64\x75"); if (!empty($oldlastpagedu)) { $lastpagedu = $oldlastpagedu; } $Uplist = array(''); $del_listdu = get_option("\144\x65\x6c\137\154\151\163\x74\144\x75"); if (!empty($del_listdu)) { $Uplist = $del_listdu; } for ($apr = $lastpagedu; $apr >= 1; $apr--) { $args = array("\x70\x6f\163\x74\x5f\164\171\160\145" => "\x70\162\157\x64\165\143\164", "\160\x6f\163\164\137\x73\x74\141\x74\x75\x73" => "\160\x75\x62\x6c\151\163\150\x2c\160\162\x69\166\x61\x74\x65\x2c\144\x72\141\x66\164", "\160\157\x73\164\x73\x5f\160\x65\162\x5f\x70\x61\x67\145" => 100, "\x70\141\147\x65\x64" => $apr); $products = get_posts($args); foreach ($products as $key => $product) { $prod_post_id = $product->ID; $fproduct = wc_get_product($prod_post_id); $mypid = $fproduct->get_sku(); if (in_array($mypid, $Uplist, true)) { if ($fproduct->get_type() == "\166\x61\162\151\x61\142\154\x65") { $vchild = $fproduct->get_children(); $kvid = true; for ($vpi = 0; $vpi < count($vchild); $vpi++) { wp_trash_post($vchild[$vpi]); } if (empty($vchild) || $kvid) { wp_update_post(array("\x49\x44" => $prod_post_id, "\160\157\x73\164\x5f\163\164\141\x74\165\x73" => "\144\145\x6c\145\x74\x69\156\147")); } } else { wp_update_post(array("\x49\104" => $prod_post_id, "\x70\157\163\164\x5f\x73\164\141\164\165\163" => "\144\145\154\145\164\x69\156\147")); } } else { array_push($Uplist, $mypid); update_option("\144\145\x6c\137\x6c\x69\x73\164\x64\x75", $Uplist); } } update_option("\x64\x65\154\137\154\141\x73\x74\160\141\x67\x65\144\x75", $apr); } update_option("\x64\x65\x6c\137\x6c\141\163\164\160\x61\147\145\x64\165", 500); update_option("\144\145\x6c\137\154\x69\163\x74\144\165", array('')); $this->clean_product_to_delete(); } function clean_product_to_delete() { global $wpdb; $ids = $wpdb->delete($wpdb->posts, array("\x70\x6f\163\164\x5f\164\x79\x70\x65" => "\160\x72\x6f\x64\x75\143\x74", "\x70\x6f\x73\x74\x5f\x73\164\141\x74\x75\163" => "\x64\145\154\x65\164\151\156\x67")); } } goto eRKAo; eRKAo: $dreamlove_ps = new dreamlove_ps(); goto IT_1X; IT_1X: if (is_admin() && !file_exists(plugin_dir_path(__FILE__) . "\x2f\151\x67\156\x6f\162\x65")) { include_once plugin_dir_path(__FILE__) . "\57\x61\x70\x70\57\165\160\x64\141\x74\145\x72\x2e\x70\x68\160"; new DreamLove_PS\Updater_Dreamlove_ps(); }

Function Calls

None

Variables

None

Stats

MD5 28300c1b96cbc0245bda8dc7807dff0e
Eval Count 0
Decode Time 187 ms