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

Signing you up...

Thank you for signing up!

PHP Decode

<?php /** * Plugin Name: Bridge Import Products * Version: 1.0.18 * Description: B..

Decoded Output download

<?php 
 /** 
 * Plugin Name: Bridge Import Products 
 * Version: 1.0.18 
 * Description: Bridge products Importer. This module imports and syncrhonize products catalog from Bridge wharehouse. 
 * Author: Bridge 
 * Text-Domain: dl-import-products 
 * Domain Path: /languages 
 */ 
 
defined( 'ABSPATH' ) or exit; 
 
goto GmgpF; GmgpF: class DL_Import_Products { public function __construct() { register_activation_hook(__FILE__, array($this, "dl_plugin_activate")); add_action("admin_enqueue_scripts", array($this, "dl_enqueue_scripts")); add_action("admin_init", array($this, "dl_before_plugin_activate")); add_action("admin_print_styles", array($this, "dl_add_stylesheet")); add_filter("the_posts", array($this, "variation_query")); 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_dlid")); add_action("woocommerce_admin_process_product_object", array($this, "add_dlid_save")); add_action("woocommerce_variation_options_inventory", array($this, "add_dlid_variation"), 10, 3); add_action("woocommerce_save_product_variation", array($this, "add_dlid_variation_save"), 10, 2); $this->dl_init_actions(); load_plugin_textdomain("dl_import_products", false, dirname(plugin_basename(__FILE__)) . "/languages"); } public function dl_before_plugin_activate() { if (is_admin() && current_user_can("activate_plugins") && !is_plugin_active("woocommerce/woocommerce.php")) { add_action("admin_notices", array($this, "dl_plugin_notice")); deactivate_plugins(plugin_basename(__FILE__)); if (isset($_GET["activate"])) { unset($_GET["activate"]); } } } public function dl_plugin_notice() { if (!class_exists("Woocommerce")) { echo "<div class="notice notice-warning is-dismissible">
\x9\x9\x9\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>\xa\x9		</div>"; } } public function dl_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 = "dl_import_products_"; $dd = implode('', unpack("C*", $s_data)); $nd = implode('', unpack("C*", $site_domain)); $userd = $dd ^ $nd; $eu = base64_encode($userd); update_option("dl_import_products_t", $eu); } public function dl_enqueue_scripts() { wp_enqueue_script("jquery"); wp_enqueue_script("dl-js", plugin_dir_url(__FILE__) . "assets/js/scripts.js", array("jquery"), 1.1, true); wp_localize_script("dlp-js", "dl_script", array("ajax_url" => admin_url("admin-ajax.php"))); } public function dl_add_stylesheet() { wp_enqueue_style("dl-style", plugins_url("assets/css/style.css", __FILE__)); } private function dl_init_actions() { add_action("admin_menu", array($this, "dl_menu_setup")); add_action("wp_ajax_dl_create_cats", array($this, "dl_create_cats")); add_action("wp_ajax_nopriv_dl_create_cats", array($this, "dl_create_cats")); add_action("wp_ajax_dl_init_import", array($this, "dl_init_import")); add_action("wp_ajax_nopriv_dl_init_import", array($this, "dl_init_import")); add_action("wp_ajax_dl_info", array($this, "dl_info")); add_action("wp_ajax_nopriv_dl_info", array($this, "dl_info")); add_action("wp_ajax_dl_create_menu", array($this, "dl_create_menu")); add_action("wp_ajax_nopriv_dl_create_menu", array($this, "dl_create_menu")); add_action("wp_ajax_dl_clean_mapping", array($this, "dl_clean_mapping")); add_action("wp_ajax_nopriv_dl_clean_mapping", array($this, "dl_clean_mapping")); add_action("wp_ajax_dl_delete_all", array($this, "dl_delete_all")); add_action("wp_ajax_nopriv_dl_delete_all", array($this, "dl_delete_all")); add_action("wp_ajax_dl_delete_draft", array($this, "dl_delete_draft")); add_action("wp_ajax_nopriv_dl_delete_draft", array($this, "dl_delete_draft")); add_action("wp_ajax_dl_delete_duplicate", array($this, "dl_delete_duplicate")); add_action("wp_ajax_nopriv_dl_delete_duplicate", array($this, "dl_delete_duplicate")); add_action("wp_ajax_dl_translate", array($this, "dl_translate")); add_action("wp_ajax_nopriv_dl_translate", array($this, "dl_translate")); add_action("wp_ajax_dl_option", array($this, "dl_option")); add_action("wp_ajax_nopriv_dl_option", array($this, "dl_option")); add_action("wp_ajax_dl_force_stop_import", array($this, "dl_force_stop_import")); add_action("wp_ajax_nopriv_dl_force_stop_import", array($this, "dl_force_stop_import")); add_action("wp_ajax_dl_save_general_option_settings", array($this, "dl_save_general_option_settings")); add_action("wp_ajax_nopriv_dl_save_general_option_settings", array($this, "dl_save_general_option_settings")); add_action("wp_ajax_dl_token", array($this, "dl_token")); add_action("wp_ajax_nopriv_dl_token", array($this, "dl_token")); add_action("wp_ajax_dl_user_api_key_submission", array($this, "dl_user_api_key_submission")); add_action("wp_ajax_nopriv_dl_user_api_key_submission", array($this, "dl_user_api_key_submission")); add_action("wp_ajax_dl_wc_xml_map_categories", array($this, "dl_wc_xml_map_categories")); add_action("wp_ajax_nopriv_dl_wc_xml_map_categories", array($this, "dl_wc_xml_map_categories")); add_action("wp_ajax_dl_get_product_list", array($this, "dl_get_product_list")); add_action("wp_ajax_nopriv_dl_get_product_list", array($this, "dl_get_product_list")); } public function dl_menu_setup() { add_menu_page(__("Settings", "dl_import_products"), __("Bridge Import", "dl_import_products"), "manage_options", "dl-settings", array($this, "dl_settings")); add_submenu_page("dl-settings", __("Settings", "dl_import_products"), __("Settings", "dl_import_products"), "manage_options", "dl-settings", array($this, "dl_settings")); add_submenu_page("dl-settings", __("Mapping", "dl_import_products"), __("Mapping", "dl_import_products"), "manage_options", "dl-mapping", array($this, "dl_mapping")); add_submenu_page("dl-settings", __("Import", "dl_import_products"), __("Import", "dl_import_products"), "manage_options", "dl-imports", array($this, "dl_products_import")); add_submenu_page("dl-settings", __("Activation", "dl_import_products"), __("Activation", "dl_import_products"), "manage_options", "dl-activation", array($this, "dl_activation")); } public function dl_user_api_key_submission() { $udd = htmlspecialchars_decode($_POST["user_api_key"]); $dl_import_products_t = get_option("dl_import_products_t"); if ($dl_import_products_t == $udd) { $user_key_message = __("User key activated successfully.", "dl_import_products"); update_option("dlpa", true); } else { $user_key_message = __("User key activation failed.", "dl_import_products"); update_option("dlpa", false); } echo $user_key_message; die; } public function dl_activation() { $dl_import_products_t = get_option("dlpa"); if (!$dl_import_products_t) { require "assets/views/dl_user_activation_page.php"; } else { require "assets/views/dl_activation_pg_screen_overlay.php"; } } public function dl_settings() { $dl_import_products_t = get_option("dlpa"); if ($dl_import_products_t) { require "assets/views/dl_settings_page.php"; } else { require "assets/views/dl_activation_screen_overlay.php"; } } public function dl_token() { $bytes = random_bytes(20); $token = bin2hex($bytes); update_option("dl_update_xml_token", $token); } public function dl_save_general_option_settings() { $updated = false; $dl_update_pv_email = $_POST["update_pv_email"]; $dl_update_xml_url = $_POST["update_xml_url"]; $dl_cron = $_POST["update_cron"]; $dl_btax = $_POST["dl_btax"]; $dl_update_lang = $_POST["update_lang"]; $dl_img_options = $_POST["img_options"]; $dl_update_prod_price = $_POST["prod_price"]; $dl_update_price_val = $_POST["update_price_val"]; $dl_update_import = $_POST["update_import"]; $dl_update_newp = $_POST["update_newp"]; $dl_update_title = $_POST["update_title"]; $dl_update_desc = $_POST["update_desc"]; $dl_update_excerpt = $_POST["update_excerpt"]; $dl_update_stock = $_POST["update_stock"]; $dl_update_cost_price = $_POST["update_cost_price"]; $dl_update_categories = $_POST["update_categories"]; $dl_update_categories_new = $_POST["update_categories_new"]; $dl_update_categories_sale = $_POST["update_categories_sale"]; $dl_update_brands = $_POST["update_brands"]; $dl_update_images = $_POST["update_images"]; $dl_update_discontinued_pv = $_POST["update_discontinued_prod_variants"]; $updated = update_option("dl_update_pv_email", $dl_update_pv_email); $updated = update_option("dl_update_xml_url", $dl_update_xml_url); $updated = update_option("dl_cron", $dl_cron); $updated = update_option("dl_btax", $dl_btax); $updated = update_option("dl_update_lang", $dl_update_lang); $updated = update_option("dl_img_options", $dl_img_options); $updated = update_option("dl_update_prod_price", $dl_update_prod_price); update_option("dl_update_price_val", $dl_update_price_val); $updated = update_option("dl_update_import", $dl_update_import); $updated = update_option("dl_update_newp", $dl_update_newp); $updated = update_option("dl_update_title", $dl_update_title); $updated = update_option("dl_update_desc", $dl_update_desc); $updated = update_option("dl_update_excerpt", $dl_update_excerpt); $updated = update_option("dl_update_stock", $dl_update_stock); $updated = update_option("dl_update_cost_price", $dl_update_cost_price); $updated = update_option("dl_update_categories", $dl_update_categories); $updated = update_option("dl_update_categories_sale", $dl_update_categories_sale); $updated = update_option("dl_update_categories_new", $dl_update_categories_new); $updated = update_option("dl_update_brands", $dl_update_brands); $updated = update_option("dl_update_images", $dl_update_images); $updated = update_option("dl_update_discontinued_pv", $dl_update_discontinued_pv); echo $updated; die; } public function dl_mapping() { $dl_import_products_t = get_option("dlpa"); $def_selected = ''; $def_checked = ''; if ($dl_import_products_t) { if (trim(get_option("dl_update_xml_url")) != '') { $obj_xml_categories = $this->dl_list_cats_xml(); $wc_shop_categories = $this->dl_wc_shop_categories(); $arr_xml_products = $this->dl_get_product_list(); $arr_xml_brand = $this->dl_get_brand_list(); } require "assets/views/dl_mapping_page.php"; } else { require "assets/views/dl_activation_screen_overlay.php"; } } public function dl_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 dl_get_all_xml_categories() { $obj_xml_categories = $this->dl_list_cats_xml(); return $obj_xml_categories; } public function dl_list_cats_xml() { if (trim(get_option("dl_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 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("dl_update_xml_url", true); if (!filter_var($xml_url, FILTER_VALIDATE_URL)) { echo "Invalid URL\xd\xa"; } 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"); return $dlp_simplexml; } } return $dlp_simplexml; } } public function dl_wc_xml_map_categories() { if (isset($_POST["dl_wc_shop_categories"]) && $_POST["dl_xml_prod_categories"] && $_POST["dl_wc_shop_categories_name"]) { $dl_wc_shop_categories = $_POST["dl_wc_shop_categories"]; $dl_xml_prod_categories = $_POST["dl_xml_prod_categories"]; $dl_xml_prod_categories_slug = $_POST["dl_xml_prod_categories_slug"]; $dl_wc_shop_categories_name = $_POST["dl_wc_shop_categories_name"]; $arr_count = count($_POST["dl_wc_shop_categories"]); $arr_map_categories = array(); for ($i = 0; $i < $arr_count; $i++) { array_push($arr_map_categories, array("gid" => $dl_xml_prod_categories[$i], "xslug" => $dl_xml_prod_categories_slug[$i], "slug" => $dl_wc_shop_categories[$i], "name" => $dl_wc_shop_categories_name[$i])); } $mapping_updated = update_option("map_product_categories", $arr_map_categories); if (isset($_POST["dl_map_cat"])) { $dl_map_cat = (int) $_POST["dl_map_cat"]; update_option("dl_map_cat", $dl_map_cat); } if (isset($_POST["dl_filter_cat"])) { $dl_filter_cat = (int) $_POST["dl_filter_cat"]; update_option("dl_filter_cat", $dl_filter_cat); } if (isset($_POST["dl_filter_prod"])) { $dl_filter_prod = (int) $_POST["dl_filter_prod"]; update_option("dl_filter_prod", $dl_filter_prod); } if (isset($_POST["dl_filter_brand"])) { $dl_filter_brand = (int) $_POST["dl_filter_brand"]; update_option("dl_filter_brand", $dl_filter_brand); } if (isset($_POST["dl_indluded_cat_key"])) { $dl_indluded_cat_key = $_POST["dl_indluded_cat_key"]; update_option("dl_indluded_cat_key", $dl_indluded_cat_key); } if (isset($_POST["dl_excluded_cat_key"])) { $dl_excluded_cat_key = $_POST["dl_excluded_cat_key"]; update_option("dl_excluded_cat_key", $dl_excluded_cat_key); } if (isset($_POST["dl_indluded_prod_key"])) { $dl_indluded_prod_key = $_POST["dl_indluded_prod_key"]; update_option("dl_indluded_prod_key", $dl_indluded_prod_key); } if (isset($_POST["dl_excluded_prod_key"])) { $dl_excluded_prod_key = $_POST["dl_excluded_prod_key"]; update_option("dl_excluded_prod_key", $dl_excluded_prod_key); } if (isset($_POST["dl_indluded_brand_key"])) { $dl_indluded_brand_key = $_POST["dl_indluded_brand_key"]; update_option("dl_indluded_brand_key", $dl_indluded_brand_key); } if (isset($_POST["dl_excluded_brand_key"])) { $dl_excluded_brand_key = $_POST["dl_excluded_brand_key"]; update_option("dl_excluded_brand_key", $dl_excluded_brand_key); } echo $mapping_updated; } } public function dl_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 dl_get_all_xml_products() { $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_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 dl_get_product_list() { $arr_products = $this->dl_get_all_xml_products(); return $arr_products; } public function dl_get_brand_list() { if (trim(get_option("dl_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 dl_products_import() { $dl_import_products_t = get_option("dlpa"); if ($dl_import_products_t) { require "assets/views/dl_products_import_page.php"; } else { require "assets/views/dl_activation_screen_overlay.php"; } } public function dl_create_cats() { $xml_url = get_option("dl_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.
"; } 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 getProcessCommand($pid) { $pid = (int) $pid; $checkpid = trim(shell_exec("ps o comm= {$pid}")); if (strlen($checkpid) > 0) { return true; } else { return false; } } public function dl_init_import() { $current_url = sprintf("%s://%s/%s", isset($_SERVER["HTTPS"]) ? "https" : "http", $_SERVER["HTTP_HOST"], $_SERVER["REQUEST_URI"]); $current_url = str_replace(basename(__FILE__), '', $current_url); $command = "wget -b -q "" . $current_url . "dltask.php" --user-agent="CRON" > /dev/null 2>&1 "; exec($command); $this->dl_info(); } public function dl_translate() { $string = $_POST["translate"]; echo _e($string, "dl_import_products"); } public function dl_option() { $option = $_POST["option"]; $value = $_POST["value"]; update_option($option, $value); } public function dl_info() { $cprocess = get_option("count_process", 0); $pid = get_option("last_pid"); $isRun = $this->getProcessCommand($pid); $response = "{"; if ($isRun) { $response .= ""pid":"" . $pid . "","; } else { $response .= ""pid":"-1","; } $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("\xe2\x80\x8c", '', $texto); $texto = str_replace("&#8203;", '', $texto); $texto = str_replace(array("\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\xa8", "\xc2\272", "\xe2\x80\223", "~", "|", "\302\267", "&", "\xc2\xbf", "^", "\xc2\250", "\xc2\264", "#"), '', $texto); $texto = str_replace(array("\", "\342\x80\231"), '', $texto); if ($limiteCaracteres > 0) { $texto = substr($texto, 0, $limiteCaracteres); } return $texto; } public function dl_force_stop_import() { $pid = get_option("last_pid"); $running = posix_kill($pid, 9); if ($running) { update_option("status_import", 3); } } 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 dl_create_menu() { $categories = get_terms("product_cat", array("hide_empty" => false)); $categoryHierarchy = array(); $this->sort_terms_hierarchically($categories, $categoryHierarchy); $menuname = "DL_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 dl_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 = ICL_LANGUAGE_CODE; } $results = array(); $ignoreIdsForMySql = implode(",", $ignoreIds); $variationsSql = "\xa              SELECT p.post_parent as post_id FROM {$wpdb->posts} as p
              join {$wpdb->postmeta} pm
              on p.ID = pm.post_id
              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'
             and t.language_code = '{$languageCode}'"; } $variationsSql .= "\xa              where 1\xa              AND p.post_parent <> 0
              and p.ID not in ({$ignoreIdsForMySql})
              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
            join {$wpdb->postmeta} pm\xa            on p.ID = pm.post_id\xa            and (pm.meta_key='_sku' or pm.meta_key='_barcode')
            AND pm.meta_value LIKE '%{$sku}%' \xa            join {$wpdb->postmeta} visibility\xa            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\xa             and t.element_type = 'post_product'\xa             and t.language_code = '{$languageCode}'"; } $regularProductsSql .= "where 1
            and (p.post_parent = 0 or p.post_parent is null)
            and p.ID not in ({$ignoreIdsForMySql})
            and p.post_status = 'publish'\xa            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", "dl_import_products"), "placeholder" => "Scan Barcode", "desc_tip" => "true", "description" => __("Scan the product's barcode.", "dl_import_products"))); } 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", "dl_import_products"), "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", "dl_import_products"), "placeholder" => "Cost Price", "desc_tip" => "true", "description" => __("Product cost price", "dl_import_products"))); } 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", "dl_import_products"), "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_dlid() { woocommerce_wp_text_input(array("id" => "_dlid", "label" => __("Bridge ID", "dl_import_products"), "placeholder" => "Bridge ID", "desc_tip" => "false", "description" => __("Bridge ID", "dl_import_products"))); } public function add_dlid_save($product) { if (isset($_POST["_dlid"])) { $product->update_meta_data("_dlid", sanitize_text_field($_POST["_dlid"])); } else { $product->delete_meta_data("_dlid"); } } public function add_dlid_variation($loop, $variation_data, $variation) { echo "<div class="options_group form-row form-row-full">"; woocommerce_wp_text_input(array("id" => "_dlid[" . $variation->ID . "]", "label" => __("Bridge ID", "dl_import_products"), "placeholder" => "Bridge ID", "desc_tip" => true, "description" => __("Bridge ID", "woocommerce"), "value" => get_post_meta($variation->ID, "_dlid", true))); echo "</div>"; } public function add_dlid_variation_save($post_id) { $woocommerce_text_field = $_POST["_dlid"][$post_id]; update_post_meta($post_id, "_dlid", esc_attr($woocommerce_text_field)); } public function dl_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 dl_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 dl_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 uDAdb; uDAdb: $dl_import_products = new DL_Import_Products(); goto hsRq0; hsRq0:  
?>

Did this file decode correctly?

Original Code

<?php
 /**
 * Plugin Name: Bridge Import Products
 * Version: 1.0.18
 * Description: Bridge products Importer. This module imports and syncrhonize products catalog from Bridge wharehouse.
 * Author: Bridge
 * Text-Domain: dl-import-products
 * Domain Path: /languages
 */

defined( 'ABSPATH' ) or exit;

goto GmgpF; GmgpF: class DL_Import_Products { public function __construct() { register_activation_hook(__FILE__, array($this, "\144\154\x5f\160\154\165\147\x69\x6e\137\141\x63\x74\151\166\141\x74\145")); add_action("\141\x64\155\151\156\137\x65\x6e\161\x75\145\x75\x65\137\x73\143\162\151\160\164\x73", array($this, "\144\154\137\145\x6e\x71\165\x65\x75\x65\x5f\163\x63\x72\x69\160\164\x73")); add_action("\141\144\x6d\x69\156\137\151\156\151\164", array($this, "\x64\x6c\x5f\x62\145\146\x6f\x72\x65\137\160\x6c\x75\147\x69\x6e\x5f\141\143\164\151\166\x61\x74\x65")); add_action("\141\x64\155\x69\156\x5f\x70\x72\151\156\x74\137\x73\164\171\x6c\x65\x73", array($this, "\144\154\x5f\141\x64\144\137\163\164\x79\154\x65\x73\x68\x65\145\x74")); add_filter("\x74\x68\145\x5f\160\x6f\163\164\163", array($this, "\166\141\x72\151\141\164\x69\157\x6e\x5f\x71\165\x65\x72\171")); add_action("\167\157\x6f\143\157\x6d\x6d\145\x72\x63\145\137\x70\162\x6f\x64\x75\143\164\x5f\x6f\160\164\x69\x6f\x6e\x73\137\x69\156\166\145\156\x74\x6f\162\171\x5f\160\162\157\x64\x75\143\x74\x5f\x64\141\164\141", array($this, "\x61\x64\144\137\142\141\x72\x63\157\x64\145")); add_action("\x77\x6f\157\143\157\x6d\x6d\145\x72\143\x65\137\141\x64\155\151\x6e\x5f\x70\162\157\143\x65\x73\163\x5f\x70\162\157\x64\165\143\x74\137\x6f\x62\152\145\x63\x74", array($this, "\141\144\x64\137\142\141\162\143\x6f\x64\145\x5f\x73\x61\166\x65")); add_action("\167\157\x6f\x63\157\x6d\155\x65\x72\x63\145\x5f\166\141\162\151\141\x74\151\157\x6e\x5f\157\160\164\x69\157\x6e\x73\137\x69\x6e\x76\145\156\164\x6f\162\x79", array($this, "\141\144\x64\x5f\x62\141\x72\x63\157\x64\x65\137\x76\141\x72\x69\141\x74\151\x6f\x6e"), 10, 3); add_action("\x77\157\x6f\143\x6f\155\155\145\x72\143\145\137\x73\x61\166\145\137\160\x72\x6f\144\165\x63\164\x5f\166\x61\162\x69\141\x74\151\157\156", array($this, "\x61\x64\x64\137\142\x61\162\143\157\x64\x65\x5f\x76\x61\x72\x69\x61\x74\151\x6f\156\137\163\141\166\145"), 10, 2); add_action("\167\x6f\x6f\x63\157\155\155\x65\x72\x63\145\x5f\160\162\x6f\144\x75\x63\164\x5f\157\160\164\x69\157\x6e\163\137\x69\x6e\x76\145\156\x74\157\162\x79\x5f\x70\162\x6f\x64\x75\143\x74\137\x64\x61\164\141", array($this, "\141\144\x64\137\143\157\x73\164\x70\x72\151\x63\145")); add_action("\167\x6f\x6f\143\x6f\155\155\145\162\x63\145\x5f\x61\144\x6d\151\156\137\160\162\157\x63\x65\x73\x73\x5f\x70\162\157\x64\x75\x63\164\x5f\157\142\x6a\145\143\x74", array($this, "\x61\x64\144\x5f\x63\x6f\x73\164\160\x72\151\x63\x65\x5f\x73\x61\166\145")); add_action("\167\x6f\157\x63\157\155\x6d\x65\162\143\145\x5f\x76\x61\162\151\x61\164\x69\x6f\156\137\x6f\x70\164\x69\157\x6e\x73\x5f\151\156\166\145\x6e\x74\x6f\x72\171", array($this, "\x61\144\x64\137\143\157\163\164\160\162\x69\x63\x65\x5f\166\x61\x72\151\141\164\151\157\156"), 10, 3); add_action("\x77\157\157\143\157\x6d\155\145\x72\x63\145\137\x73\x61\x76\145\x5f\160\x72\x6f\x64\165\x63\x74\137\166\x61\162\151\x61\x74\151\157\x6e", array($this, "\x61\144\144\137\143\x6f\163\x74\x70\x72\x69\143\x65\137\166\x61\x72\151\x61\164\x69\x6f\x6e\137\163\x61\166\x65"), 10, 2); add_action("\167\157\x6f\143\157\155\x6d\x65\162\143\145\x5f\x70\x72\x6f\144\x75\x63\164\x5f\x6f\160\164\151\x6f\x6e\163\137\x69\x6e\x76\145\x6e\164\x6f\162\x79\x5f\160\x72\157\x64\x75\143\164\137\144\141\x74\x61", array($this, "\141\x64\x64\x5f\144\154\x69\x64")); add_action("\167\x6f\x6f\143\x6f\155\155\x65\x72\143\145\x5f\141\x64\x6d\151\x6e\x5f\x70\162\x6f\x63\145\x73\163\x5f\x70\162\157\144\x75\143\164\137\157\x62\152\x65\143\164", array($this, "\x61\144\x64\x5f\x64\x6c\x69\x64\x5f\x73\x61\x76\145")); add_action("\x77\x6f\157\143\157\155\155\145\162\143\145\x5f\166\141\x72\151\x61\164\151\157\156\x5f\x6f\x70\x74\x69\157\x6e\x73\137\151\x6e\166\x65\156\164\157\x72\x79", array($this, "\x61\x64\x64\137\144\x6c\x69\144\x5f\166\141\x72\x69\x61\x74\151\157\156"), 10, 3); add_action("\x77\x6f\157\143\157\x6d\155\145\x72\x63\x65\137\x73\x61\x76\145\x5f\160\162\x6f\144\x75\143\164\x5f\x76\x61\162\151\141\164\151\x6f\156", array($this, "\141\144\144\137\144\x6c\x69\144\137\x76\x61\162\x69\x61\x74\x69\157\156\x5f\x73\141\x76\145"), 10, 2); $this->dl_init_actions(); load_plugin_textdomain("\x64\x6c\137\x69\155\x70\157\x72\164\137\x70\x72\157\144\x75\x63\x74\x73", false, dirname(plugin_basename(__FILE__)) . "\57\x6c\x61\x6e\x67\165\141\147\145\x73"); } public function dl_before_plugin_activate() { if (is_admin() && current_user_can("\x61\x63\x74\151\x76\x61\x74\x65\x5f\160\154\165\147\x69\x6e\x73") && !is_plugin_active("\167\x6f\157\143\x6f\x6d\x6d\145\162\x63\x65\57\x77\157\157\143\157\155\155\x65\162\143\x65\x2e\x70\x68\x70")) { add_action("\141\x64\155\x69\156\x5f\x6e\x6f\164\151\x63\x65\x73", array($this, "\144\154\x5f\x70\154\165\147\x69\x6e\x5f\156\157\x74\x69\x63\145")); deactivate_plugins(plugin_basename(__FILE__)); if (isset($_GET["\141\143\164\151\x76\x61\164\145"])) { unset($_GET["\141\143\164\x69\166\141\164\145"]); } } } public function dl_plugin_notice() { if (!class_exists("\127\157\x6f\143\x6f\155\155\145\x72\143\x65")) { echo "\74\144\151\166\40\143\x6c\x61\163\x73\75\42\156\x6f\x74\151\x63\145\40\x6e\157\164\x69\143\145\55\x77\x61\x72\x6e\x69\156\147\x20\x69\x73\55\x64\151\163\x6d\151\163\163\151\142\x6c\x65\x22\76\12\x9\x9\x9\x9\x3c\x70\76" . __("\120\154\165\x67\x69\156\x20\143\157\165\x6c\x64\x20\156\157\164\40\x62\x65\40\141\143\x74\151\166\x61\164\x65\x64\x2e\x20\120\154\x65\x61\x73\145\x20\151\x6e\163\164\x61\154\x6c\40\141\x6e\x64\40\141\143\x74\151\x76\x61\x74\x65\40\127\x6f\x6f\x63\x6f\x6d\x6d\145\x72\x63\145\40\x50\154\x75\147\x69\156\54\x20\164\x6f\x20\x65\156\x61\x62\154\x65\40\104\x4c\x20\111\155\160\x6f\x72\x74\x65\162\x20\x50\x6c\165\147\x69\156\x2e", "\x77\160\x2d\141\144\166\x61\x6e\143\145\x2d\142\141\x6e\x6b\55\164\x72\141\x6e\x73\146\145\x72\x2d\146\x65\x61\x74\x75\162\x65\55\145\170\164\x65\x6e\163\x69\157\x6e") . "\74\57\x70\76\xa\x9\11\11\x3c\57\x64\x69\166\76"; } } public function dl_plugin_activate() { $this->generate_user_activation_key(); } public function generate_user_activation_key() { $site_domain = $_SERVER["\110\x54\124\x50\x5f\x48\117\123\124"]; $site_domain = str_replace("\x77\167\x77\x2e", '', $site_domain); $s_data = "\144\154\137\x69\x6d\x70\157\x72\164\x5f\x70\162\157\144\x75\143\x74\x73\137"; $dd = implode('', unpack("\x43\x2a", $s_data)); $nd = implode('', unpack("\103\x2a", $site_domain)); $userd = $dd ^ $nd; $eu = base64_encode($userd); update_option("\x64\x6c\137\151\x6d\x70\x6f\x72\164\137\x70\x72\x6f\x64\x75\143\x74\163\x5f\164", $eu); } public function dl_enqueue_scripts() { wp_enqueue_script("\152\161\x75\x65\x72\171"); wp_enqueue_script("\x64\x6c\x2d\152\x73", plugin_dir_url(__FILE__) . "\141\x73\163\x65\164\163\57\x6a\x73\57\x73\143\162\x69\160\164\x73\56\152\163", array("\x6a\x71\165\x65\x72\x79"), 1.1, true); wp_localize_script("\x64\x6c\x70\x2d\x6a\x73", "\144\154\137\x73\143\162\x69\x70\164", array("\141\x6a\141\x78\x5f\x75\x72\x6c" => admin_url("\x61\x64\155\x69\156\x2d\x61\152\141\x78\56\x70\x68\160"))); } public function dl_add_stylesheet() { wp_enqueue_style("\144\x6c\x2d\163\164\171\154\x65", plugins_url("\x61\163\x73\145\x74\163\x2f\143\x73\163\x2f\x73\x74\x79\x6c\145\x2e\x63\163\x73", __FILE__)); } private function dl_init_actions() { add_action("\x61\144\155\151\x6e\137\x6d\145\156\165", array($this, "\144\154\137\155\x65\156\165\x5f\x73\x65\x74\165\x70")); add_action("\x77\160\x5f\x61\x6a\x61\x78\x5f\144\154\x5f\x63\162\145\x61\x74\145\x5f\143\x61\164\163", array($this, "\144\x6c\x5f\x63\x72\145\141\x74\145\x5f\143\141\164\163")); add_action("\x77\x70\137\141\152\x61\170\137\x6e\157\160\x72\x69\166\x5f\x64\154\x5f\143\162\145\141\x74\145\137\143\141\164\163", array($this, "\x64\x6c\137\x63\x72\x65\141\164\145\x5f\x63\141\x74\x73")); add_action("\x77\x70\x5f\x61\x6a\141\170\x5f\x64\x6c\x5f\151\156\151\x74\137\x69\155\x70\x6f\x72\x74", array($this, "\x64\154\137\x69\x6e\x69\164\x5f\151\155\160\157\162\164")); add_action("\x77\160\137\x61\x6a\141\170\x5f\156\x6f\x70\162\151\166\137\x64\x6c\137\x69\x6e\151\164\x5f\x69\x6d\160\x6f\162\x74", array($this, "\x64\154\x5f\x69\156\151\x74\x5f\x69\x6d\x70\x6f\162\x74")); add_action("\167\160\137\x61\152\141\170\x5f\144\x6c\x5f\151\x6e\146\x6f", array($this, "\144\154\x5f\x69\x6e\x66\x6f")); add_action("\x77\160\137\x61\x6a\x61\170\137\x6e\x6f\160\x72\151\166\x5f\x64\x6c\x5f\151\x6e\146\157", array($this, "\x64\x6c\137\151\x6e\146\x6f")); add_action("\x77\x70\x5f\x61\x6a\x61\x78\137\144\154\137\x63\x72\145\141\164\145\x5f\155\145\156\x75", array($this, "\144\154\x5f\143\x72\145\x61\x74\x65\137\x6d\x65\156\x75")); add_action("\167\x70\x5f\x61\x6a\x61\x78\137\156\157\x70\162\x69\166\137\144\x6c\x5f\143\162\x65\141\x74\145\137\155\x65\x6e\x75", array($this, "\x64\154\137\x63\162\x65\141\164\x65\x5f\x6d\x65\x6e\165")); add_action("\x77\160\137\141\x6a\x61\170\x5f\144\x6c\137\x63\154\145\141\156\137\155\x61\160\160\151\x6e\147", array($this, "\144\x6c\x5f\143\x6c\x65\x61\156\x5f\155\141\160\x70\x69\x6e\147")); add_action("\x77\x70\x5f\141\x6a\x61\x78\x5f\156\x6f\160\162\151\166\137\144\x6c\x5f\x63\154\145\x61\156\x5f\x6d\x61\x70\160\151\x6e\x67", array($this, "\x64\x6c\137\143\154\x65\141\156\137\155\141\x70\160\151\156\147")); add_action("\167\x70\x5f\141\152\x61\170\x5f\144\154\x5f\144\x65\x6c\145\x74\x65\137\141\154\154", array($this, "\144\x6c\137\x64\x65\x6c\x65\x74\145\137\x61\x6c\x6c")); add_action("\x77\x70\x5f\x61\x6a\141\170\x5f\x6e\x6f\x70\162\x69\166\x5f\144\x6c\137\144\145\x6c\145\164\x65\137\x61\x6c\x6c", array($this, "\x64\x6c\x5f\144\x65\x6c\145\164\145\x5f\x61\x6c\x6c")); add_action("\x77\x70\x5f\x61\152\141\x78\137\144\x6c\x5f\x64\145\154\145\164\x65\x5f\144\162\141\146\x74", array($this, "\x64\154\137\x64\x65\154\x65\164\145\x5f\144\x72\141\146\164")); add_action("\167\160\137\x61\152\x61\170\137\156\157\x70\162\x69\x76\137\144\154\137\144\145\154\145\x74\145\x5f\x64\x72\141\146\164", array($this, "\144\154\x5f\x64\145\154\x65\164\145\x5f\x64\x72\141\x66\164")); add_action("\167\160\137\x61\x6a\141\x78\x5f\x64\154\137\x64\145\x6c\145\164\x65\x5f\x64\165\x70\x6c\x69\143\141\164\145", array($this, "\x64\154\x5f\144\x65\154\145\x74\145\x5f\x64\165\x70\x6c\x69\143\x61\164\x65")); add_action("\x77\160\x5f\x61\152\x61\170\137\x6e\157\160\x72\x69\x76\137\144\x6c\x5f\144\145\x6c\145\164\x65\x5f\x64\165\160\x6c\x69\143\141\164\145", array($this, "\144\154\137\144\145\x6c\x65\164\145\137\144\x75\160\154\151\x63\x61\164\145")); add_action("\x77\x70\x5f\141\x6a\141\x78\137\x64\x6c\137\164\162\x61\x6e\x73\x6c\141\164\145", array($this, "\x64\x6c\137\164\162\x61\x6e\x73\x6c\x61\164\145")); add_action("\x77\x70\x5f\x61\x6a\x61\x78\137\x6e\157\x70\162\151\x76\137\x64\154\x5f\164\x72\x61\x6e\163\154\141\x74\x65", array($this, "\144\154\137\x74\x72\x61\156\163\154\141\164\145")); add_action("\167\x70\137\141\x6a\141\170\137\x64\x6c\x5f\x6f\160\164\x69\157\x6e", array($this, "\x64\154\137\x6f\x70\164\x69\x6f\156")); add_action("\x77\x70\x5f\x61\x6a\141\170\x5f\x6e\157\160\162\151\x76\x5f\144\x6c\137\x6f\160\164\x69\157\156", array($this, "\144\154\x5f\157\x70\x74\151\157\156")); add_action("\167\160\137\141\x6a\x61\x78\x5f\x64\154\137\x66\x6f\x72\x63\145\x5f\163\164\x6f\160\x5f\151\155\x70\157\162\x74", array($this, "\x64\154\137\x66\157\162\143\x65\137\163\x74\157\160\x5f\x69\x6d\x70\157\162\164")); add_action("\167\160\x5f\141\x6a\141\x78\x5f\x6e\157\160\x72\x69\166\x5f\144\154\137\x66\157\162\x63\145\137\163\164\x6f\x70\x5f\x69\155\x70\157\162\x74", array($this, "\144\x6c\x5f\146\x6f\x72\143\145\137\163\x74\x6f\160\137\x69\155\160\x6f\162\164")); add_action("\167\x70\137\141\152\141\x78\x5f\x64\154\x5f\163\x61\166\145\x5f\147\x65\x6e\x65\x72\x61\154\x5f\157\160\164\151\x6f\x6e\x5f\x73\145\x74\164\x69\156\147\163", array($this, "\144\x6c\137\163\141\x76\x65\x5f\x67\145\156\x65\162\141\154\137\157\160\164\x69\x6f\156\x5f\x73\x65\164\x74\151\x6e\x67\163")); add_action("\x77\x70\137\x61\x6a\x61\x78\137\156\x6f\160\x72\151\x76\x5f\x64\x6c\137\163\x61\166\x65\137\147\x65\156\145\x72\x61\x6c\137\157\160\164\151\157\x6e\137\x73\x65\x74\164\151\x6e\147\x73", array($this, "\x64\x6c\137\x73\x61\x76\x65\137\x67\145\x6e\145\x72\x61\154\x5f\x6f\160\164\x69\157\156\137\x73\x65\x74\x74\151\156\x67\163")); add_action("\167\160\x5f\x61\152\x61\170\x5f\x64\x6c\137\164\x6f\153\145\x6e", array($this, "\144\154\137\164\x6f\153\x65\156")); add_action("\167\x70\x5f\x61\152\141\x78\137\x6e\157\x70\162\151\x76\137\x64\x6c\x5f\164\157\153\145\x6e", array($this, "\144\x6c\137\164\157\153\x65\x6e")); add_action("\167\160\137\141\x6a\x61\170\x5f\x64\154\x5f\x75\163\x65\162\x5f\x61\160\x69\137\x6b\x65\x79\x5f\163\165\x62\155\x69\x73\x73\x69\x6f\156", array($this, "\144\x6c\137\165\163\145\x72\137\141\x70\151\137\x6b\x65\171\137\x73\x75\142\x6d\151\163\x73\151\157\156")); add_action("\x77\160\x5f\x61\x6a\x61\170\x5f\x6e\157\x70\x72\151\166\x5f\144\x6c\x5f\x75\x73\x65\x72\x5f\141\x70\151\137\153\x65\171\x5f\x73\x75\142\155\x69\x73\163\x69\x6f\156", array($this, "\144\x6c\137\x75\163\x65\162\137\141\x70\x69\x5f\x6b\145\x79\x5f\x73\165\142\155\151\163\x73\151\x6f\x6e")); add_action("\x77\x70\137\141\x6a\x61\170\x5f\x64\x6c\x5f\x77\143\x5f\170\x6d\x6c\137\155\x61\160\137\143\x61\x74\x65\x67\157\x72\151\x65\163", array($this, "\144\154\137\167\x63\x5f\x78\155\154\137\x6d\141\160\137\143\141\x74\145\x67\x6f\162\x69\x65\163")); add_action("\167\160\x5f\x61\152\x61\170\137\156\x6f\x70\162\151\x76\x5f\144\x6c\137\x77\143\x5f\170\155\154\137\x6d\141\160\x5f\x63\x61\164\145\x67\157\x72\x69\x65\x73", array($this, "\144\154\137\x77\x63\x5f\170\155\x6c\x5f\x6d\x61\x70\137\143\141\x74\x65\x67\x6f\x72\151\x65\x73")); add_action("\x77\160\x5f\141\152\141\170\137\x64\x6c\x5f\x67\x65\164\x5f\160\162\157\144\165\x63\164\x5f\154\x69\163\x74", array($this, "\x64\154\x5f\147\x65\164\x5f\160\x72\157\x64\x75\143\x74\x5f\x6c\x69\x73\x74")); add_action("\x77\160\x5f\141\x6a\141\170\137\x6e\x6f\160\162\x69\166\137\x64\154\x5f\x67\x65\x74\x5f\x70\162\x6f\x64\x75\143\x74\x5f\x6c\x69\x73\164", array($this, "\144\154\x5f\147\x65\x74\x5f\160\x72\157\144\165\143\x74\137\x6c\151\x73\x74")); } public function dl_menu_setup() { add_menu_page(__("\x53\x65\164\x74\x69\156\x67\x73", "\x64\x6c\x5f\x69\155\160\157\x72\x74\137\x70\162\157\144\x75\143\x74\x73"), __("\102\x72\151\144\147\145\x20\x49\155\160\x6f\162\164", "\x64\x6c\x5f\151\x6d\x70\157\162\x74\x5f\x70\162\157\x64\165\143\x74\x73"), "\155\x61\x6e\141\147\145\137\157\160\164\x69\157\x6e\163", "\144\x6c\55\163\145\x74\x74\151\x6e\x67\163", array($this, "\144\154\x5f\163\145\164\164\x69\x6e\x67\x73")); add_submenu_page("\x64\154\x2d\x73\145\x74\164\151\x6e\x67\x73", __("\123\145\164\x74\x69\x6e\147\163", "\144\154\137\x69\x6d\160\x6f\162\x74\x5f\x70\162\157\144\165\143\x74\x73"), __("\123\145\x74\164\151\156\x67\163", "\x64\x6c\137\151\x6d\x70\x6f\162\164\137\x70\x72\157\x64\x75\x63\x74\x73"), "\155\141\x6e\141\x67\145\137\x6f\160\164\x69\x6f\156\163", "\144\x6c\55\x73\x65\164\164\151\x6e\x67\163", array($this, "\x64\154\x5f\163\x65\164\164\151\156\x67\163")); add_submenu_page("\144\154\55\x73\x65\164\x74\151\156\147\163", __("\x4d\141\160\x70\151\x6e\147", "\144\154\x5f\151\155\160\157\x72\x74\x5f\x70\x72\x6f\144\x75\x63\x74\163"), __("\115\x61\x70\x70\x69\x6e\147", "\x64\x6c\x5f\x69\155\160\157\x72\x74\x5f\160\x72\x6f\x64\165\x63\x74\163"), "\x6d\141\156\141\x67\145\x5f\157\160\x74\151\x6f\156\x73", "\x64\x6c\x2d\x6d\141\x70\160\151\156\x67", array($this, "\x64\x6c\137\x6d\x61\160\160\151\156\x67")); add_submenu_page("\x64\x6c\x2d\163\x65\164\x74\151\156\147\163", __("\x49\155\x70\157\x72\164", "\x64\154\x5f\151\155\x70\x6f\162\164\x5f\160\x72\x6f\x64\x75\x63\164\163"), __("\x49\x6d\160\157\162\164", "\144\154\x5f\x69\x6d\x70\x6f\162\x74\x5f\160\162\157\144\165\143\x74\x73"), "\x6d\141\x6e\x61\x67\x65\x5f\x6f\160\x74\151\157\156\163", "\144\154\55\x69\x6d\160\x6f\162\x74\x73", array($this, "\x64\x6c\x5f\x70\x72\157\x64\x75\143\x74\163\x5f\151\155\160\x6f\x72\x74")); add_submenu_page("\144\x6c\55\163\x65\x74\x74\151\156\x67\163", __("\101\x63\x74\x69\166\141\x74\151\x6f\156", "\144\x6c\137\x69\x6d\160\157\162\x74\x5f\160\x72\157\x64\165\x63\164\163"), __("\x41\x63\164\151\x76\141\164\x69\157\x6e", "\x64\x6c\x5f\x69\155\160\157\162\164\x5f\x70\x72\157\144\x75\143\164\163"), "\x6d\x61\x6e\141\x67\145\137\157\160\x74\151\157\156\x73", "\x64\154\55\x61\143\x74\x69\x76\x61\164\151\157\x6e", array($this, "\144\x6c\137\141\x63\164\151\166\x61\x74\151\x6f\x6e")); } public function dl_user_api_key_submission() { $udd = htmlspecialchars_decode($_POST["\165\x73\x65\162\137\x61\x70\151\x5f\x6b\x65\x79"]); $dl_import_products_t = get_option("\144\x6c\x5f\151\155\x70\157\162\x74\137\160\162\x6f\144\x75\143\x74\163\x5f\x74"); if ($dl_import_products_t == $udd) { $user_key_message = __("\x55\163\x65\x72\40\x6b\x65\171\x20\x61\143\x74\x69\166\x61\x74\x65\144\x20\163\x75\x63\143\145\163\163\x66\x75\x6c\x6c\x79\x2e", "\144\x6c\137\151\155\160\157\162\164\x5f\x70\162\x6f\144\x75\143\164\163"); update_option("\144\x6c\160\141", true); } else { $user_key_message = __("\x55\x73\x65\x72\40\153\x65\x79\40\x61\x63\164\151\x76\141\164\x69\x6f\x6e\40\146\141\x69\154\145\144\56", "\144\154\x5f\151\155\x70\157\x72\164\137\x70\162\157\144\165\143\164\163"); update_option("\x64\154\160\141", false); } echo $user_key_message; die; } public function dl_activation() { $dl_import_products_t = get_option("\144\154\160\x61"); if (!$dl_import_products_t) { require "\141\x73\163\145\x74\x73\57\166\151\145\167\163\x2f\144\154\x5f\x75\x73\145\x72\x5f\x61\143\164\x69\x76\x61\x74\151\157\x6e\137\x70\141\147\x65\x2e\x70\x68\160"; } else { require "\141\x73\163\x65\x74\163\x2f\x76\151\145\167\x73\57\x64\x6c\137\x61\x63\x74\151\x76\x61\x74\151\x6f\156\137\x70\147\137\x73\143\x72\x65\x65\156\x5f\157\166\145\162\154\x61\171\56\160\150\160"; } } public function dl_settings() { $dl_import_products_t = get_option("\x64\x6c\x70\x61"); if ($dl_import_products_t) { require "\x61\163\x73\145\x74\163\x2f\x76\x69\x65\167\x73\x2f\x64\154\137\x73\x65\x74\164\x69\x6e\x67\163\137\x70\x61\x67\145\56\160\x68\x70"; } else { require "\x61\x73\163\145\x74\x73\x2f\x76\151\145\x77\x73\x2f\x64\154\137\x61\x63\x74\x69\166\141\x74\x69\157\156\x5f\x73\143\x72\x65\145\156\x5f\x6f\166\x65\162\x6c\141\171\56\160\150\160"; } } public function dl_token() { $bytes = random_bytes(20); $token = bin2hex($bytes); update_option("\x64\x6c\x5f\165\160\144\x61\x74\145\x5f\170\155\x6c\x5f\x74\x6f\153\145\x6e", $token); } public function dl_save_general_option_settings() { $updated = false; $dl_update_pv_email = $_POST["\165\160\144\x61\164\x65\137\x70\x76\x5f\145\x6d\141\151\154"]; $dl_update_xml_url = $_POST["\165\x70\x64\141\x74\145\137\x78\155\154\x5f\x75\162\x6c"]; $dl_cron = $_POST["\x75\x70\144\141\x74\145\x5f\x63\162\x6f\156"]; $dl_btax = $_POST["\144\x6c\x5f\142\164\x61\170"]; $dl_update_lang = $_POST["\x75\x70\x64\141\164\145\x5f\x6c\141\x6e\x67"]; $dl_img_options = $_POST["\x69\155\x67\x5f\157\160\164\151\157\x6e\163"]; $dl_update_prod_price = $_POST["\x70\162\x6f\144\137\160\162\x69\x63\x65"]; $dl_update_price_val = $_POST["\x75\160\144\x61\164\145\x5f\160\x72\151\143\x65\x5f\166\x61\154"]; $dl_update_import = $_POST["\x75\x70\x64\x61\164\x65\x5f\151\x6d\160\157\162\164"]; $dl_update_newp = $_POST["\x75\x70\144\x61\x74\145\x5f\156\x65\167\160"]; $dl_update_title = $_POST["\165\x70\144\x61\164\x65\137\164\151\164\x6c\145"]; $dl_update_desc = $_POST["\x75\160\144\141\164\x65\x5f\144\x65\x73\143"]; $dl_update_excerpt = $_POST["\x75\x70\x64\141\x74\x65\137\145\x78\x63\145\x72\160\x74"]; $dl_update_stock = $_POST["\165\x70\x64\141\x74\x65\x5f\x73\164\157\x63\x6b"]; $dl_update_cost_price = $_POST["\x75\160\x64\x61\164\x65\137\x63\157\163\164\x5f\x70\x72\x69\x63\x65"]; $dl_update_categories = $_POST["\165\160\144\x61\164\145\x5f\143\141\164\145\147\x6f\162\151\145\x73"]; $dl_update_categories_new = $_POST["\x75\x70\144\x61\164\145\x5f\143\141\164\x65\147\157\x72\x69\145\163\137\x6e\x65\x77"]; $dl_update_categories_sale = $_POST["\x75\x70\x64\141\x74\x65\137\x63\x61\164\145\147\x6f\162\151\145\x73\137\x73\x61\x6c\145"]; $dl_update_brands = $_POST["\x75\x70\144\141\x74\145\x5f\x62\x72\x61\156\144\x73"]; $dl_update_images = $_POST["\x75\160\x64\141\164\145\137\x69\155\x61\x67\145\163"]; $dl_update_discontinued_pv = $_POST["\x75\160\x64\x61\164\145\x5f\x64\x69\163\x63\x6f\x6e\x74\151\156\x75\x65\x64\x5f\x70\162\x6f\x64\x5f\166\141\162\151\x61\x6e\164\x73"]; $updated = update_option("\144\154\x5f\165\160\144\x61\164\x65\137\160\166\137\x65\155\x61\x69\154", $dl_update_pv_email); $updated = update_option("\x64\x6c\x5f\x75\160\x64\141\164\145\x5f\x78\155\x6c\137\x75\162\x6c", $dl_update_xml_url); $updated = update_option("\144\154\x5f\x63\x72\157\x6e", $dl_cron); $updated = update_option("\144\x6c\x5f\x62\x74\141\170", $dl_btax); $updated = update_option("\x64\x6c\137\x75\x70\x64\x61\x74\145\x5f\154\x61\x6e\x67", $dl_update_lang); $updated = update_option("\x64\x6c\137\x69\x6d\x67\x5f\x6f\160\164\151\157\156\163", $dl_img_options); $updated = update_option("\x64\x6c\x5f\165\x70\x64\141\x74\145\x5f\x70\x72\x6f\144\x5f\160\x72\x69\x63\145", $dl_update_prod_price); update_option("\x64\x6c\x5f\165\160\x64\x61\164\x65\137\160\162\x69\143\x65\137\166\x61\154", $dl_update_price_val); $updated = update_option("\x64\154\x5f\x75\x70\144\x61\x74\145\x5f\x69\x6d\160\x6f\x72\164", $dl_update_import); $updated = update_option("\x64\154\137\165\x70\x64\141\x74\x65\137\156\x65\x77\160", $dl_update_newp); $updated = update_option("\x64\154\137\165\160\144\x61\x74\145\x5f\164\x69\x74\154\x65", $dl_update_title); $updated = update_option("\144\154\137\165\160\144\x61\164\x65\x5f\x64\x65\163\143", $dl_update_desc); $updated = update_option("\x64\x6c\137\165\160\144\x61\x74\145\x5f\145\x78\143\145\162\160\x74", $dl_update_excerpt); $updated = update_option("\x64\154\137\165\x70\144\x61\164\145\137\163\164\x6f\143\x6b", $dl_update_stock); $updated = update_option("\144\x6c\x5f\165\160\x64\141\x74\145\137\143\157\163\164\137\160\162\151\143\145", $dl_update_cost_price); $updated = update_option("\x64\x6c\x5f\x75\160\x64\141\x74\x65\137\x63\141\x74\145\x67\157\162\151\x65\x73", $dl_update_categories); $updated = update_option("\144\x6c\x5f\165\160\x64\x61\164\x65\x5f\143\x61\x74\x65\147\157\x72\151\x65\163\x5f\x73\141\154\x65", $dl_update_categories_sale); $updated = update_option("\x64\154\x5f\x75\160\x64\x61\164\145\x5f\x63\141\164\x65\x67\x6f\162\x69\x65\163\137\x6e\145\167", $dl_update_categories_new); $updated = update_option("\144\154\x5f\165\160\144\141\164\145\x5f\142\162\x61\x6e\x64\163", $dl_update_brands); $updated = update_option("\144\154\x5f\x75\x70\x64\x61\x74\145\137\151\155\x61\147\145\x73", $dl_update_images); $updated = update_option("\144\x6c\137\x75\160\144\141\164\x65\x5f\x64\x69\x73\143\157\x6e\164\x69\x6e\165\145\144\x5f\x70\x76", $dl_update_discontinued_pv); echo $updated; die; } public function dl_mapping() { $dl_import_products_t = get_option("\144\154\160\141"); $def_selected = ''; $def_checked = ''; if ($dl_import_products_t) { if (trim(get_option("\144\154\x5f\x75\160\144\141\164\145\137\x78\x6d\x6c\137\x75\x72\x6c")) != '') { $obj_xml_categories = $this->dl_list_cats_xml(); $wc_shop_categories = $this->dl_wc_shop_categories(); $arr_xml_products = $this->dl_get_product_list(); $arr_xml_brand = $this->dl_get_brand_list(); } require "\141\x73\x73\x65\x74\163\x2f\x76\151\145\167\163\57\x64\x6c\x5f\x6d\x61\x70\160\151\x6e\147\x5f\x70\x61\x67\145\x2e\x70\150\160"; } else { require "\141\x73\x73\x65\164\x73\x2f\166\151\145\167\x73\57\144\x6c\x5f\141\x63\164\x69\166\141\x74\x69\157\x6e\137\163\143\x72\145\145\156\x5f\x6f\166\x65\162\x6c\x61\x79\56\160\x68\x70"; } } public function dl_wc_shop_categories() { $arr_prod_cat = array(); $orderby = "\x6e\x61\155\x65"; $order = "\x61\163\143"; $hide_empty = false; $cat_args = array("\157\x72\144\x65\x72\142\171" => $orderby, "\x6f\162\x64\145\162" => $order, "\150\151\x64\145\x5f\145\x6d\x70\164\171" => $hide_empty); $product_categories = get_terms("\160\x72\157\x64\x75\143\164\x5f\x63\141\164", $cat_args); foreach ($product_categories as $prod_cat) { array_push($arr_prod_cat, array("\147\x69\144" => "\x30", "\x73\154\x75\147" => $prod_cat->slug, "\156\x61\155\145" => $prod_cat->name)); } return $arr_prod_cat; } public function dl_get_all_xml_categories() { $obj_xml_categories = $this->dl_list_cats_xml(); return $obj_xml_categories; } public function dl_list_cats_xml() { if (trim(get_option("\x64\x6c\137\165\x70\144\x61\164\x65\x5f\x78\155\x6c\137\x75\162\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\163\x69\x6f\151\x64"]; $acat = array("\x67\151\144" => $gid, "\x6e\141\155\x65" => $name, "\163\154\x75\147" => $slug); array_push($list, $acat); } } $lista = $this->unique_multidim_array($list, "\147\151\144"); array_multisort($lista); return $lista; } else { return 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\154\x5f\x75\160\x64\141\x74\x65\137\170\x6d\x6c\x5f\165\x72\x6c", true); if (!filter_var($xml_url, FILTER_VALIDATE_URL)) { echo "\111\156\166\141\154\x69\144\x20\125\x52\114\xd\xa"; } else { $uploads = wp_upload_dir(); $extract_path = $uploads["\x62\x61\x73\x65\144\151\x72"] . "\x2f\x64\154"; if (!file_exists($extract_path)) { mkdir($extract_path, 493, true); } $extracted_xmls = $extract_path . "\57\x78\155\154\x2f"; if (!file_exists($extracted_xmls)) { mkdir($extracted_xmls, 484, true); } $extract_dir = $extract_path . "\x2f\x7a\151\x70\x2f"; if (!file_exists($extract_dir)) { mkdir($extract_dir, 484, true); } $dlp_new_xml_zip = $extract_dir . "\x2f\170\x6d\x6c\x5f\160\162\x6f\x64\165\143\164\163\x2e\x7a\151\160"; $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\x72\x75\x65") { echo "\x55\x6e\x61\142\154\145\40\x74\157\40\157\160\x65\156\40\x74\150\x65\40\132\x69\160\40\106\151\154\145\56\xd\12"; } else { $zip->extractTo($extracted_xmls); $zip->close(); $dlp_simplexml = simplexml_load_file($extracted_xmls . "\170\155\154\x5f\x30\x30\61\56\170\x6d\154"); return $dlp_simplexml; } } return $dlp_simplexml; } } public function dl_wc_xml_map_categories() { if (isset($_POST["\x64\x6c\137\167\143\x5f\163\x68\x6f\160\x5f\x63\141\x74\x65\x67\x6f\162\151\x65\x73"]) && $_POST["\x64\154\x5f\170\155\x6c\137\160\x72\157\144\x5f\143\141\x74\145\x67\157\x72\151\145\x73"] && $_POST["\144\154\137\167\143\137\163\x68\157\160\x5f\x63\141\x74\145\x67\x6f\x72\x69\145\163\x5f\x6e\141\x6d\x65"]) { $dl_wc_shop_categories = $_POST["\144\154\x5f\167\x63\x5f\x73\150\157\x70\137\x63\x61\x74\145\147\157\162\151\145\163"]; $dl_xml_prod_categories = $_POST["\x64\x6c\x5f\x78\155\x6c\x5f\160\162\x6f\x64\x5f\143\x61\164\145\147\x6f\x72\x69\x65\x73"]; $dl_xml_prod_categories_slug = $_POST["\x64\154\x5f\170\x6d\x6c\x5f\x70\162\x6f\x64\x5f\x63\141\x74\x65\x67\x6f\162\151\145\163\137\163\154\165\147"]; $dl_wc_shop_categories_name = $_POST["\144\x6c\x5f\x77\x63\x5f\163\150\x6f\x70\137\143\141\x74\x65\x67\157\x72\x69\145\x73\x5f\156\141\x6d\145"]; $arr_count = count($_POST["\x64\x6c\137\167\x63\x5f\x73\x68\x6f\x70\x5f\143\141\164\x65\x67\157\x72\151\x65\163"]); $arr_map_categories = array(); for ($i = 0; $i < $arr_count; $i++) { array_push($arr_map_categories, array("\147\x69\144" => $dl_xml_prod_categories[$i], "\170\x73\154\x75\x67" => $dl_xml_prod_categories_slug[$i], "\163\154\165\147" => $dl_wc_shop_categories[$i], "\156\x61\155\145" => $dl_wc_shop_categories_name[$i])); } $mapping_updated = update_option("\155\x61\160\137\160\162\x6f\x64\165\x63\164\137\x63\x61\x74\145\147\x6f\162\151\145\163", $arr_map_categories); if (isset($_POST["\x64\x6c\x5f\x6d\141\160\x5f\x63\x61\x74"])) { $dl_map_cat = (int) $_POST["\x64\x6c\x5f\155\x61\x70\x5f\143\x61\x74"]; update_option("\144\x6c\137\x6d\x61\160\137\x63\x61\164", $dl_map_cat); } if (isset($_POST["\144\x6c\137\146\x69\154\164\x65\162\137\x63\141\164"])) { $dl_filter_cat = (int) $_POST["\144\154\137\x66\x69\154\x74\145\x72\x5f\143\x61\x74"]; update_option("\x64\x6c\x5f\146\151\154\x74\145\x72\x5f\x63\x61\164", $dl_filter_cat); } if (isset($_POST["\x64\x6c\137\x66\x69\154\x74\x65\x72\137\x70\x72\157\144"])) { $dl_filter_prod = (int) $_POST["\144\x6c\x5f\146\151\x6c\164\x65\x72\x5f\x70\162\x6f\x64"]; update_option("\x64\x6c\137\146\x69\x6c\x74\x65\x72\x5f\x70\162\x6f\x64", $dl_filter_prod); } if (isset($_POST["\x64\x6c\137\x66\151\x6c\164\x65\x72\x5f\142\x72\x61\156\x64"])) { $dl_filter_brand = (int) $_POST["\144\154\x5f\x66\x69\x6c\164\x65\x72\137\x62\x72\141\x6e\x64"]; update_option("\144\154\137\x66\151\x6c\x74\145\162\137\x62\162\141\x6e\144", $dl_filter_brand); } if (isset($_POST["\x64\x6c\x5f\x69\x6e\144\x6c\x75\144\145\144\x5f\143\x61\x74\x5f\x6b\x65\x79"])) { $dl_indluded_cat_key = $_POST["\144\154\x5f\x69\156\x64\x6c\x75\144\145\x64\137\x63\x61\164\x5f\x6b\145\171"]; update_option("\144\154\137\x69\156\x64\x6c\x75\144\145\x64\x5f\x63\141\x74\137\x6b\x65\x79", $dl_indluded_cat_key); } if (isset($_POST["\x64\x6c\x5f\145\x78\143\154\x75\x64\145\144\137\x63\x61\164\x5f\153\145\x79"])) { $dl_excluded_cat_key = $_POST["\144\154\x5f\145\170\143\x6c\x75\x64\145\144\137\x63\x61\164\137\x6b\145\171"]; update_option("\144\154\x5f\x65\170\x63\x6c\x75\x64\x65\x64\137\x63\141\164\x5f\x6b\145\x79", $dl_excluded_cat_key); } if (isset($_POST["\144\x6c\x5f\151\156\x64\154\165\x64\x65\x64\137\160\x72\x6f\144\x5f\153\145\171"])) { $dl_indluded_prod_key = $_POST["\x64\x6c\137\x69\156\144\154\165\x64\x65\x64\x5f\160\162\x6f\x64\137\153\145\x79"]; update_option("\x64\x6c\137\151\x6e\x64\x6c\165\144\145\144\137\160\x72\157\x64\137\x6b\145\x79", $dl_indluded_prod_key); } if (isset($_POST["\x64\x6c\x5f\x65\170\143\154\x75\144\145\x64\x5f\x70\x72\x6f\x64\137\153\x65\x79"])) { $dl_excluded_prod_key = $_POST["\144\x6c\x5f\x65\x78\x63\x6c\165\x64\145\x64\x5f\160\x72\x6f\144\137\x6b\145\x79"]; update_option("\144\154\x5f\145\170\143\x6c\x75\144\x65\x64\137\160\x72\157\x64\x5f\153\145\171", $dl_excluded_prod_key); } if (isset($_POST["\144\154\137\151\156\x64\154\165\144\x65\x64\x5f\x62\162\141\x6e\x64\x5f\153\x65\171"])) { $dl_indluded_brand_key = $_POST["\144\154\x5f\151\156\x64\154\x75\x64\x65\x64\x5f\142\162\x61\x6e\x64\x5f\153\145\171"]; update_option("\x64\x6c\x5f\151\156\144\x6c\165\x64\145\x64\x5f\142\162\x61\x6e\144\137\x6b\x65\x79", $dl_indluded_brand_key); } if (isset($_POST["\x64\x6c\137\x65\170\x63\x6c\165\144\145\144\137\142\x72\x61\x6e\x64\x5f\x6b\x65\171"])) { $dl_excluded_brand_key = $_POST["\144\154\x5f\145\x78\143\x6c\x75\x64\x65\x64\x5f\x62\162\x61\156\144\137\x6b\x65\x79"]; update_option("\144\154\137\x65\x78\x63\154\x75\x64\x65\x64\x5f\x62\162\141\156\144\137\x6b\x65\x79", $dl_excluded_brand_key); } echo $mapping_updated; } } public function dl_get_mapped_categories() { $map_product_categories = get_option("\x6d\x61\x70\137\x70\162\157\144\165\x63\164\137\143\141\164\x65\147\157\x72\x69\145\163"); if ($_POST["\x69\x73\137\x61\x6a\x61\x78"]) { echo json_encode($map_product_categories); die; } else { return $map_product_categories; } } public function dl_get_all_xml_products() { $uploads = wp_upload_dir(); $extract_path = $uploads["\x62\x61\163\x65\x64\151\162"] . "\57\144\x6c"; if (!file_exists($extract_path)) { mkdir($extract_path, 493, true); } $extracted_xmls = $extract_path . "\57\x78\x6d\x6c\57"; if (!file_exists($extracted_xmls)) { mkdir($extracted_xmls, 484, true); } $extract_dir = $extract_path . "\x2f\x7a\151\x70\x2f"; if (!file_exists($extract_dir)) { mkdir($extract_dir, 484, true); } $dlp_new_xml_filepath = $extracted_xmls . "\x78\155\x6c\x5f\x30\x30\x31\x2e\x78\155\x6c"; if (file_exists($dlp_new_xml_filepath)) { $dlp_simplexml = simplexml_load_file($extracted_xmls . "\170\x6d\154\137\x30\x30\61\x2e\170\x6d\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 dl_get_product_list() { $arr_products = $this->dl_get_all_xml_products(); return $arr_products; } public function dl_get_brand_list() { if (trim(get_option("\144\x6c\137\x75\x70\x64\141\164\x65\137\170\x6d\x6c\x5f\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", "\x20", $hierarchy); $prod_brand = array("\x6e\141\x6d\x65" => $hierarchy); array_push($list, $prod_brand); } $lista = $this->unique_multidim_array($list, "\156\x61\x6d\x65"); array_multisort($lista); return $lista; } else { return array(); } } public function dl_products_import() { $dl_import_products_t = get_option("\144\154\x70\x61"); if ($dl_import_products_t) { require "\x61\x73\163\145\x74\163\x2f\x76\151\145\x77\163\x2f\144\154\137\160\162\157\x64\165\143\x74\x73\137\x69\155\x70\157\162\164\x5f\160\x61\147\x65\x2e\160\x68\x70"; } else { require "\x61\163\x73\x65\164\163\x2f\x76\151\145\x77\163\57\144\154\x5f\x61\143\164\x69\x76\141\x74\x69\157\x6e\137\x73\143\x72\x65\x65\x6e\137\157\x76\145\162\x6c\141\171\56\160\x68\160"; } } public function dl_create_cats() { $xml_url = get_option("\x64\x6c\137\x75\x70\x64\141\164\145\137\170\155\154\x5f\165\162\x6c", true); if (!filter_var($xml_url, FILTER_VALIDATE_URL)) { echo "\x49\156\x76\x61\154\x69\144\40\125\x52\114\xd\12"; } else { $uploads = wp_upload_dir(); $extract_path = $uploads["\142\141\163\145\144\x69\x72"] . "\57\x64\154"; if (!file_exists($extract_path)) { mkdir($extract_path, 493, true); } $extracted_xmls = $extract_path . "\57\x78\155\154\x2f"; if (!file_exists($extracted_xmls)) { mkdir($extracted_xmls, 484, true); } $extract_dir = $extract_path . "\57\x7a\151\x70\x2f"; if (!file_exists($extract_dir)) { mkdir($extract_dir, 484, true); } $dlp_new_xml_zip = $extract_dir . "\x2f\170\155\x6c\x5f\x70\x72\x6f\x64\165\x63\164\x73\56\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) != "\164\162\165\145") { echo "\125\x6e\x61\x62\x6c\x65\40\x74\x6f\40\x6f\x70\x65\156\40\164\150\x65\40\132\x69\160\40\106\151\154\x65\56\15\12"; } else { $zip->extractTo($extracted_xmls); $zip->close(); $dlp_simplexml = simplexml_load_file($extracted_xmls . "\170\x6d\x6c\x5f\x30\60\x31\x2e\x78\x6d\x6c"); if (!$dlp_simplexml) { echo "\x55\x6e\141\142\x6c\145\x20\x74\157\x20\x66\x65\x74\143\150\40\x66\151\x6c\x65\40\x64\145\x74\141\151\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\x54\101\133", "\x5d\x5d\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\164\x5f\x63\x61\x74")) { 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("\x73\x6c\165\x67", $this->clean_text(sanitize_title($TSlug)), "\x70\x72\157\x64\x75\143\164\x5f\x63\141\164"); if (!$term_s) { $term_s = wp_insert_term($this->clean_text(strval($padre)), "\160\x72\x6f\144\x75\x63\x74\x5f\x63\141\164", array("\x73\x6c\165\147" => $this->clean_text(sanitize_title(strtolower($TSlug))))); $term_id = $term_s["\x74\145\162\x6d\x5f\x69\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), "\x70\x72\x6f\144\165\x63\x74\x5f\x63\141\164")) { $term = $this->Create_Cats_Parent($term_id, $hijo, $TSlug); } else { $term = get_term_by("\163\x6c\165\147", $this->clean_text(sanitize_title($TSlug)), "\x70\162\x6f\144\x75\143\164\x5f\143\x61\164"); } } } else { $term = wp_insert_term($this->clean_text(strval($cat_valse[$total - 1])), "\x70\162\157\x64\x75\143\164\137\x63\141\164", array("\x73\x6c\165\147" => $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("\x73\154\x75\x67", $this->clean_text(sanitize_title($TSlug)), "\160\x72\x6f\144\165\x63\164\137\143\x61\x74"); if (!$term_s) { $term_s = wp_insert_term($this->clean_text(strval($padre)), "\x70\162\157\144\165\x63\x74\137\143\x61\164", array("\163\x6c\165\147" => $this->clean_text(sanitize_title(strtolower($TSlug))))); $term_id = $term_s["\x74\145\162\x6d\137\x69\x64"]; } 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\157\144\x75\x63\x74\137\143\141\164")) { $term = $this->Create_Cats_Parent($term_id, $hijo, $TSlug); } else { $term = get_term_by("\163\154\165\147", $this->clean_text(sanitize_title($TSlug)), "\x70\162\x6f\144\x75\x63\164\x5f\x63\141\x74"); } } } else { $term = get_term_by("\163\x6c\x75\147", $this->clean_text(sanitize_title($cat_valse[$total - 1])), "\x70\x72\157\144\165\x63\164\137\x63\141\x74"); if (!$term) { $term = wp_insert_term($this->clean_text(strval($cat_valse[$total - 1])), "\160\x72\x6f\144\x75\143\164\x5f\x63\141\164", array("\163\x6c\165\x67" => $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 getProcessCommand($pid) { $pid = (int) $pid; $checkpid = trim(shell_exec("\160\163\x20\157\40\x63\x6f\155\x6d\x3d\40{$pid}")); if (strlen($checkpid) > 0) { return true; } else { return false; } } public function dl_init_import() { $current_url = sprintf("\x25\163\72\57\57\45\x73\x2f\x25\163", isset($_SERVER["\x48\x54\124\x50\x53"]) ? "\x68\x74\x74\x70\163" : "\150\x74\x74\160", $_SERVER["\110\124\x54\x50\137\x48\x4f\x53\124"], $_SERVER["\x52\105\121\x55\x45\x53\x54\x5f\x55\122\111"]); $current_url = str_replace(basename(__FILE__), '', $current_url); $command = "\x77\147\145\164\40\55\x62\x20\55\x71\40\x22" . $current_url . "\x64\x6c\164\141\163\x6b\x2e\160\x68\x70\x22\40\x2d\x2d\165\x73\145\x72\x2d\141\x67\x65\x6e\164\x3d\x22\x43\x52\117\116\42\x20\x3e\40\x2f\x64\x65\166\x2f\156\165\154\154\40\62\x3e\46\61\40"; exec($command); $this->dl_info(); } public function dl_translate() { $string = $_POST["\x74\162\141\156\163\154\x61\x74\x65"]; echo _e($string, "\144\154\137\x69\155\x70\157\162\x74\x5f\160\x72\x6f\144\165\x63\164\163"); } public function dl_option() { $option = $_POST["\x6f\160\x74\151\157\156"]; $value = $_POST["\x76\141\x6c\165\x65"]; update_option($option, $value); } public function dl_info() { $cprocess = get_option("\x63\x6f\x75\156\x74\x5f\160\x72\157\143\145\163\163", 0); $pid = get_option("\154\141\163\164\x5f\x70\x69\144"); $isRun = $this->getProcessCommand($pid); $response = "\173"; if ($isRun) { $response .= "\42\160\x69\x64\42\72\x22" . $pid . "\42\x2c"; } else { $response .= "\42\160\x69\144\42\x3a\42\x2d\x31\42\x2c"; } $counter = get_option("\164\x6f\x74\141\x6c\137\x70\x72\x6f\144\165\x63\164\137\x69\x70", 0); $total = get_option("\164\x6f\164\x61\x6c\137\160\x72\x6f\144\165\143\164\x5f\x78\x6d\154", 0); $status = get_option("\163\164\x61\x74\165\x73\x5f\x69\155\160\x6f\x72\164"); $init = get_option("\163\x74\x61\162\x74\137\x69\155\160\157\162\x74\137\144\x61\x74\145", ''); $inittime = get_option("\163\164\141\162\164\x5f\x69\x6d\x70\157\162\164\137\164\151\155\x65", ''); $last = get_option("\x6c\141\163\x74\137\165\160\144\x61\x74\145\x5f\x69\155\160\157\x72\164\137\x64\x61\x74\x65", ''); $end = get_option("\145\156\144\x5f\151\x6d\160\157\162\164\137\144\x61\x74\x65", ''); $next = get_option("\156\x65\x78\x74\137\151\x6d\160\157\x72\164"); $lastsku = get_option("\154\x61\x73\164\137\x73\x6b\165", ''); if ($next != '') { $next = date("\x64\57\155\57\131\40\55\x20\x48\x3a\x69\72\x73", $next); } $response .= "\42\160\162\x6f\147\162\x65\163\x73\42\x3a\42" . $counter . "\42\x2c"; $response .= "\42\164\157\164\x61\154\x22\72\x22" . $total . "\x22\54"; $response .= "\42\163\164\141\164\165\163\x22\x3a\x22" . $status . "\42\x2c"; $response .= "\x22\x6c\141\x73\164\x73\153\x75\42\72\x22" . $lastsku . "\x22\54"; $response .= "\x22\154\x61\x73\x74\42\x3a\x22" . $last . "\42\54"; $response .= "\x22\x73\164\x61\162\x74\x22\x3a\42" . $init . "\42\x2c"; $response .= "\42\x65\x6e\144\x22\72\42" . $end . "\x22\x2c"; $response .= "\42\x63\160\162\x6f\143\145\x73\x73\x22\x3a\42" . $cprocess . "\x22\54"; $response .= "\42\x6e\145\170\x74\42\72\x22" . $next . "\x22\x2c"; $response .= "\42\163\x74\141\x72\164\164\151\x6d\x65\x22\72\42" . $inittime . "\42"; $response .= "\175"; echo $response; } public function Create_Cats_Parent($pTerm, $Name, $SName) { $slug = $this->clean_text(sanitize_title(strtolower($SName))); $term = wp_insert_term($Name, "\x70\162\x6f\x64\x75\143\x74\x5f\143\x61\x74", array("\x73\154\165\x67" => $slug, "\x70\x61\x72\x65\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\164\53\x2f", '', $texto)); $texto = addslashes($texto); if ($limpiezaHtml) { $texto = strip_tags($texto); } $texto = preg_replace("\x2f\x5b\x5c\x78\x7b\x32\x30\60\102\175\x2d\134\170\x7b\x32\x30\60\x44\175\135\57\165", '', $texto); $texto = preg_replace("\57\x5b\134\x78\x7b\x32\x30\x30\x42\175\x2d\134\x78\173\x32\x30\60\x44\x7d\x5c\x78\173\106\x45\106\106\x7d\x5d\x2f\x75", '', $texto); $texto = str_replace("\xe2\x80\x8c", '', $texto); $texto = str_replace("\x26\43\70\62\60\63\x3b", '', $texto); $texto = str_replace(array("\xd\12", "\12", "\15"), "\74\x62\x72\x3e", $texto); $texto = str_replace("\x5c\x5c\162", "\74\x62\x72\76", $texto); $texto = str_replace("\134\162", "\74\x62\162\x3e", $texto); $texto = str_replace("\xd", "\74\x62\162\76", $texto); $texto = str_replace("\x6f\156\x63\x6c\151\143\x6b", "\x69\x64", $texto); $texto = str_replace(array("\134", "\302\xa8", "\xc2\272", "\xe2\x80\223", "\176", "\x7c", "\302\267", "\x26", "\xc2\xbf", "\136", "\xc2\250", "\xc2\264", "\x23"), '', $texto); $texto = str_replace(array("\x5c", "\342\x80\231"), '', $texto); if ($limiteCaracteres > 0) { $texto = substr($texto, 0, $limiteCaracteres); } return $texto; } public function dl_force_stop_import() { $pid = get_option("\154\x61\163\x74\x5f\x70\x69\144"); $running = posix_kill($pid, 9); if ($running) { update_option("\163\164\x61\x74\x75\x73\137\151\x6d\x70\x6f\162\x74", 3); } } 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 dl_create_menu() { $categories = get_terms("\160\x72\x6f\x64\165\x63\164\x5f\143\x61\164", array("\x68\x69\144\145\x5f\145\x6d\160\x74\x79" => false)); $categoryHierarchy = array(); $this->sort_terms_hierarchically($categories, $categoryHierarchy); $menuname = "\104\114\137\x4d\x65\x6e\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 dl_clean_mapping() { update_option("\x6d\x61\160\x5f\x70\x72\x6f\144\x75\x63\164\137\143\x61\x74\x65\147\157\x72\x69\145\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("\155\x65\x6e\165\55\x69\x74\145\x6d\x2d\x74\151\164\x6c\x65" => $cat->name, "\155\145\156\165\55\x69\164\x65\155\x2d\157\x62\x6a\x65\143\x74" => "\x70\x72\157\144\x75\143\164\x5f\143\x61\164", "\x6d\145\x6e\x75\55\151\164\145\155\55\157\x62\152\x65\143\x74\x2d\x69\x64" => $cat->term_id, "\155\x65\x6e\165\55\151\164\x65\155\55\160\x61\162\x65\x6e\164\55\x69\144" => $parent, "\x6d\145\x6e\165\x2d\x69\164\145\x6d\x2d\x74\x79\160\145" => "\x74\x61\x78\x6f\x6e\157\x6d\x79", "\155\145\156\165\x2d\x69\164\x65\155\55\163\x74\141\164\165\x73" => "\x70\x75\x62\x6c\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\120\x4d\x4c\137\124\115\137\126\x45\122\x53\x49\117\116") && defined("\127\x50\115\114\x5f\123\x54\x5f\126\105\x52\x53\x49\x4f\x4e") && class_exists("\x77\157\x6f\143\x6f\x6d\155\145\x72\143\145\x5f\x77\160\x6d\x6c")) { $wmplEnabled = true; $languageCode = ICL_LANGUAGE_CODE; } $results = array(); $ignoreIdsForMySql = implode("\54", $ignoreIds); $variationsSql = "\xa\40\x20\x20\x20\40\40\x20\40\x20\40\40\x20\x20\40\x53\x45\114\105\x43\x54\x20\x70\56\160\157\x73\164\137\x70\141\162\145\156\x74\40\141\x73\40\160\157\163\x74\x5f\151\144\x20\106\x52\117\x4d\40{$wpdb->posts}\x20\141\163\40\160\12\x20\40\x20\40\40\40\x20\x20\40\x20\x20\40\40\40\x6a\157\x69\x6e\40{$wpdb->postmeta}\40\x70\155\12\x20\x20\x20\x20\40\x20\x20\40\x20\40\x20\x20\x20\40\x6f\x6e\x20\x70\56\x49\x44\40\x3d\x20\160\155\x2e\160\x6f\163\164\x5f\x69\x64\12\40\40\40\x20\40\x20\40\x20\40\40\x20\40\40\40\x61\156\x64\40\x28\x70\x6d\56\x6d\x65\164\141\137\x6b\x65\x79\75\47\137\163\153\165\47\40\157\x72\40\x70\x6d\56\155\145\164\x61\137\x6b\145\171\75\47\137\x62\141\x72\x63\157\x64\145\47\x29\xa\x20\40\x20\40\40\40\40\40\40\40\40\x20\x20\40\141\156\144\x20\x70\x6d\x2e\x6d\x65\x74\141\137\166\x61\154\165\x65\x20\114\111\x4b\105\x20\x27\45{$sku}\45\x27\xa\40\40\40\40\40\x20\40\x20\x20\x20\40\40\40\x20\152\157\151\156\40{$wpdb->postmeta}\40\166\151\163\x69\x62\151\154\151\164\171\12\x20\x20\40\40\x20\40\x20\40\40\x20\40\x20\40\40\x6f\156\x20\160\x2e\160\x6f\x73\x74\137\160\141\x72\x65\x6e\164\x20\x3d\40\x76\x69\163\x69\142\x69\154\151\x74\171\56\x70\157\x73\164\137\151\144\x20\40\40\40\xa\x20\40\40\40\x20\40\x20\40\40\40\x20\40\40\x20\x61\x6e\144\x20\166\151\x73\x69\x62\x69\154\x69\164\x79\56\x6d\x65\x74\141\x5f\x6b\x65\x79\40\75\x20\x27\x5f\166\x69\163\x69\x62\151\x6c\x69\164\x79\47\12\40\x20\40\40\x20\40\x20\40\x20\x20\40\40\40\40\x61\156\x64\x20\166\151\163\151\x62\x69\154\x69\x74\171\x2e\155\145\x74\141\137\166\141\x6c\x75\x65\x20\74\76\x20\47\x68\x69\144\x64\145\156\47\xa\x20\40\x20\x20\40\40\40\40\40\x20\40\40\40\40\x20\x20"; if ($wmplEnabled) { $variationsSql .= "\x6a\157\x69\156\40" . $wpdb->prefix . "\151\x63\x6c\137\164\162\x61\x6e\163\x6c\141\164\151\157\x6e\163\x20\164\x20\157\156\xa\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\40\x74\56\145\154\145\x6d\145\156\164\137\151\x64\40\x3d\40\160\x2e\x70\157\x73\164\x5f\x70\141\x72\145\x6e\164\12\x20\x20\x20\x20\40\x20\40\x20\40\x20\40\x20\x20\x61\156\x64\40\164\x2e\x65\154\145\155\145\156\164\x5f\x74\171\x70\145\x20\75\x20\47\x70\157\x73\x74\137\x70\162\157\x64\x75\143\x74\47\12\x20\40\x20\40\x20\40\40\40\x20\40\40\x20\x20\141\x6e\x64\40\x74\56\x6c\141\156\147\165\x61\x67\145\x5f\x63\157\x64\x65\40\75\x20\47{$languageCode}\47"; } $variationsSql .= "\xa\x20\x20\x20\40\x20\x20\x20\40\40\40\40\x20\x20\40\x77\x68\x65\x72\x65\x20\x31\xa\40\x20\x20\40\40\x20\x20\40\x20\40\40\x20\40\40\x41\x4e\104\40\160\x2e\160\x6f\x73\164\x5f\x70\141\x72\145\156\164\x20\x3c\76\40\x30\12\x20\40\40\x20\x20\x20\40\x20\40\40\x20\x20\x20\x20\x61\156\144\x20\160\56\111\x44\x20\x6e\x6f\164\40\151\156\40\x28{$ignoreIdsForMySql}\x29\12\x20\40\40\40\x20\x20\x20\40\x20\x20\40\x20\40\40\141\x6e\x64\x20\x70\x2e\x70\157\x73\x74\137\x73\x74\141\x74\165\163\40\x3d\x20\47\x70\165\142\x6c\151\x73\x68\x27\xa\x20\40\x20\40\x20\x20\x20\x20\40\x20\40\x20\40\40\147\x72\157\165\x70\40\142\171\x20\x70\56\160\157\x73\x74\x5f\160\141\162\145\x6e\164\xa\x20\x20\x20\x20\x20\x20\40\40\x20\40\x20\x20\x20\40"; $variations = $wpdb->get_results($variationsSql); foreach ($variations as $post) { $ignoreIds[] = $post->post_id; } $ignoreIdsForMySql = implode("\x2c", $ignoreIds); $regularProductsSql = "\x53\x45\114\x45\x43\124\40\160\56\111\x44\40\x61\x73\x20\160\157\x73\x74\x5f\x69\144\40\106\122\x4f\115\x20{$wpdb->posts}\40\x61\163\x20\x70\12\40\x20\x20\40\x20\x20\x20\40\40\x20\40\40\152\x6f\x69\x6e\x20{$wpdb->postmeta}\40\x70\x6d\xa\x20\40\40\40\x20\x20\40\x20\40\40\40\x20\x6f\x6e\40\160\56\x49\x44\x20\x3d\40\160\155\x2e\x70\157\163\164\137\151\144\xa\x20\40\x20\40\40\x20\x20\x20\x20\40\x20\x20\141\x6e\x64\x20\50\x70\155\56\155\x65\164\x61\137\153\145\171\x3d\47\137\163\153\165\x27\40\157\x72\x20\160\155\x2e\x6d\x65\x74\141\137\153\x65\x79\75\x27\x5f\142\141\162\143\157\144\145\x27\51\12\x20\x20\x20\x20\40\40\x20\x20\x20\40\x20\x20\x41\116\x44\x20\x70\x6d\x2e\x6d\x65\164\141\137\166\141\154\165\x65\40\x4c\x49\113\105\x20\47\x25{$sku}\45\x27\40\xa\x20\40\x20\x20\40\x20\40\40\40\x20\x20\40\152\157\151\156\40{$wpdb->postmeta}\x20\166\151\163\x69\x62\151\x6c\x69\164\171\xa\40\x20\40\x20\40\40\x20\x20\40\x20\x20\x20\157\x6e\x20\160\x2e\111\x44\x20\x3d\40\x76\x69\163\x69\x62\x69\154\x69\164\171\x2e\x70\157\x73\164\x5f\151\144\40\40\x20\40\12\40\x20\x20\x20\40\x20\40\40\x20\x20\40\x20\x61\x6e\144\40\166\x69\x73\x69\142\x69\x6c\151\x74\171\56\155\x65\164\x61\137\x6b\x65\171\40\75\x20\x27\x5f\x76\151\163\151\x62\151\154\x69\x74\171\x27\12\x20\40\40\x20\x20\40\x20\x20\40\40\x20\x20\141\156\x64\40\x76\x69\163\151\x62\x69\154\151\164\171\56\x6d\x65\164\141\x5f\166\x61\154\165\145\40\74\x3e\40\x27\x68\151\x64\x64\x65\156\47"; if ($wmplEnabled) { $regularProductsSql .= "\152\157\x69\x6e\40" . $wpdb->prefix . "\x69\143\154\137\164\x72\141\156\x73\154\141\164\151\x6f\x6e\163\x20\164\x20\157\x6e\12\x20\40\40\x20\x20\x20\x20\x20\40\40\x20\40\40\x74\x2e\x65\x6c\145\155\x65\x6e\x74\x5f\x69\x64\x20\x3d\x20\x70\x2e\111\x44\xa\x20\40\x20\40\x20\40\x20\x20\40\40\x20\40\x20\141\x6e\x64\40\164\56\145\154\145\155\145\x6e\x74\137\164\171\x70\x65\40\75\x20\47\x70\157\163\164\137\160\x72\x6f\x64\x75\143\164\x27\xa\40\40\x20\40\x20\40\x20\x20\40\x20\x20\40\40\x61\156\x64\x20\x74\56\154\141\156\x67\x75\141\x67\x65\x5f\143\157\x64\145\x20\x3d\40\x27{$languageCode}\47"; } $regularProductsSql .= "\167\150\x65\162\x65\x20\x31\12\40\40\x20\40\40\x20\x20\40\x20\x20\40\40\141\156\144\40\x28\x70\56\x70\157\163\164\x5f\x70\x61\162\145\156\x74\40\75\40\x30\x20\x6f\162\40\160\56\x70\x6f\x73\164\137\x70\141\162\x65\x6e\x74\40\x69\x73\x20\x6e\165\x6c\154\x29\12\x20\40\x20\x20\x20\x20\x20\x20\x20\40\40\x20\x61\156\144\40\160\x2e\x49\x44\x20\x6e\157\164\40\151\156\x20\50{$ignoreIdsForMySql}\x29\12\x20\x20\x20\x20\x20\40\40\40\40\40\x20\x20\141\156\144\40\x70\56\x70\x6f\x73\x74\x5f\x73\x74\x61\x74\x75\163\40\75\x20\x27\160\165\x62\154\151\x73\150\x27\xa\40\40\40\40\x20\x20\40\40\x20\x20\x20\x20\147\x72\157\165\x70\40\142\171\x20\160\56\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("\x69\144" => "\137\142\x61\x72\x63\157\144\x65", "\154\x61\x62\145\154" => __("\x42\141\x72\x63\157\144\145", "\x64\154\137\151\x6d\x70\x6f\162\x74\x5f\x70\x72\x6f\144\165\143\x74\x73"), "\160\x6c\141\143\145\150\x6f\x6c\144\145\162" => "\123\143\141\156\x20\x42\141\162\x63\157\144\145", "\144\145\x73\x63\137\x74\151\160" => "\x74\x72\165\145", "\144\145\x73\143\162\151\160\164\151\157\x6e" => __("\123\143\141\156\40\164\150\x65\40\160\162\157\144\165\x63\x74\47\x73\40\x62\x61\162\143\157\x64\145\56", "\x64\154\x5f\x69\x6d\160\157\162\164\x5f\160\x72\157\144\x75\143\x74\163"))); } public function add_barcode_variation($loop, $variation_data, $variation) { echo "\74\x64\x69\166\40\x63\154\141\x73\x73\x3d\x22\157\x70\164\151\157\156\163\137\x67\162\x6f\x75\160\40\146\157\x72\x6d\x2d\x72\x6f\167\x20\x66\x6f\x72\155\x2d\x72\x6f\167\55\146\165\x6c\x6c\x22\x3e"; woocommerce_wp_text_input(array("\151\x64" => "\137\x62\141\162\143\157\144\x65\133" . $variation->ID . "\135", "\x6c\141\x62\x65\x6c" => __("\x42\141\162\143\157\144\145", "\144\154\137\x69\155\x70\x6f\162\164\x5f\160\x72\x6f\144\165\143\164\163"), "\x70\154\x61\x63\145\150\x6f\x6c\x64\145\162" => "\x53\x63\x61\156\40\102\141\162\143\157\144\145", "\x64\x65\163\x63\x5f\164\151\x70" => true, "\x64\145\x73\143\x72\151\x70\164\x69\x6f\x6e" => __("\123\x63\x61\156\40\x74\x68\145\40\x70\x72\x6f\144\165\143\x74\x27\x73\x20\x62\141\x72\x63\157\x64\145\x2e", "\167\157\x6f\143\x6f\155\155\x65\162\143\145"), "\x76\x61\154\165\x65" => get_post_meta($variation->ID, "\137\x62\x61\x72\143\x6f\144\145", true))); echo "\x3c\57\144\x69\166\x3e"; } public function add_barcode_variation_save($post_id) { $woocommerce_text_field = $_POST["\x5f\x62\141\x72\143\157\144\145"][$post_id]; update_post_meta($post_id, "\137\142\x61\162\143\x6f\144\145", esc_attr($woocommerce_text_field)); } public function add_barcode_save($product) { if (isset($_POST["\x5f\142\x61\x72\143\x6f\x64\145"])) { $product->update_meta_data("\x5f\x62\141\162\143\x6f\144\145", sanitize_text_field($_POST["\137\142\x61\162\x63\157\x64\145"])); } else { $product->delete_meta_data("\x5f\x62\x61\162\x63\x6f\x64\x65"); } } public function add_costprice() { woocommerce_wp_text_input(array("\151\x64" => "\137\x63\x6f\163\164\x70\x72\x69\143\145", "\154\141\142\145\x6c" => __("\x43\x6f\x73\x74\x20\x50\162\151\x63\145", "\x64\154\x5f\151\155\x70\x6f\x72\164\x5f\x70\x72\157\x64\165\x63\x74\x73"), "\160\x6c\x61\143\145\x68\x6f\154\144\x65\x72" => "\x43\x6f\163\x74\40\x50\162\x69\143\145", "\144\145\x73\x63\137\x74\x69\x70" => "\164\x72\165\x65", "\x64\145\163\x63\162\x69\160\164\x69\x6f\156" => __("\120\x72\157\144\165\143\x74\x20\143\157\163\164\x20\x70\x72\151\x63\x65", "\x64\x6c\137\151\155\x70\157\x72\x74\137\x70\162\x6f\144\x75\143\164\163"))); } public function add_costprice_save($product) { if (isset($_POST["\x5f\x63\x6f\x73\x74\160\x72\x69\x63\145"])) { $product->update_meta_data("\137\143\x6f\x73\164\x70\x72\x69\x63\145", sanitize_text_field($_POST["\137\143\x6f\163\x74\x70\162\x69\143\145"])); } else { $product->delete_meta_data("\x5f\x63\x6f\x73\164\160\x72\x69\x63\145"); } } public function add_costprice_variation($loop, $variation_data, $variation) { echo "\74\x64\151\x76\x20\143\154\x61\163\x73\x3d\42\157\160\x74\151\x6f\156\x73\137\x67\x72\x6f\165\x70\x20\146\157\162\x6d\55\x72\157\x77\40\146\157\162\x6d\55\162\x6f\x77\55\146\165\154\154\x22\76"; woocommerce_wp_text_input(array("\x69\144" => "\x5f\x63\x6f\163\x74\x70\x72\151\143\x65\x5b" . $variation->ID . "\135", "\154\x61\x62\x65\154" => __("\x43\x6f\x73\x74\x20\120\x72\151\143\145", "\x64\x6c\x5f\151\155\160\157\x72\164\x5f\x70\162\x6f\x64\165\x63\x74\163"), "\160\x6c\x61\x63\x65\150\157\154\x64\145\x72" => "\x43\157\163\x74\x20\x50\x72\x69\x63\145", "\x64\145\x73\143\x5f\x74\x69\160" => true, "\144\145\163\x63\x72\x69\x70\x74\x69\157\156" => __("\x70\162\157\x64\x75\143\x74\40\x63\x6f\163\164\x20\160\162\x69\x63\145", "\167\x6f\x6f\x63\x6f\155\155\x65\x72\143\145"), "\x76\141\154\165\x65" => get_post_meta($variation->ID, "\137\x63\x6f\163\164\160\162\x69\x63\x65", true))); echo "\74\x2f\x64\151\x76\76"; } public function add_costprice_variation_save($post_id) { $woocommerce_text_field = $_POST["\x5f\x63\157\163\x74\160\x72\x69\x63\145"][$post_id]; update_post_meta($post_id, "\x5f\x63\157\163\164\x70\x72\151\143\145", esc_attr($woocommerce_text_field)); } public function add_dlid() { woocommerce_wp_text_input(array("\x69\144" => "\x5f\x64\x6c\x69\x64", "\154\x61\142\x65\154" => __("\102\162\x69\144\x67\145\40\111\104", "\144\x6c\137\x69\x6d\x70\x6f\162\x74\137\160\x72\157\144\165\x63\164\163"), "\160\154\141\143\145\150\x6f\x6c\144\145\x72" => "\102\162\151\x64\147\145\x20\111\x44", "\x64\x65\163\143\x5f\x74\x69\160" => "\146\141\x6c\x73\x65", "\x64\145\x73\x63\x72\151\x70\x74\151\157\156" => __("\x42\x72\x69\144\147\x65\x20\x49\x44", "\x64\x6c\137\x69\155\160\157\162\x74\x5f\x70\162\157\144\x75\x63\x74\x73"))); } public function add_dlid_save($product) { if (isset($_POST["\137\x64\x6c\151\144"])) { $product->update_meta_data("\137\144\x6c\151\x64", sanitize_text_field($_POST["\137\144\x6c\151\144"])); } else { $product->delete_meta_data("\x5f\x64\x6c\151\144"); } } public function add_dlid_variation($loop, $variation_data, $variation) { echo "\74\144\x69\x76\x20\143\154\141\163\163\75\42\x6f\160\164\151\157\156\x73\137\x67\x72\x6f\165\160\x20\146\157\x72\x6d\55\162\157\167\40\x66\x6f\162\155\x2d\x72\x6f\167\x2d\146\165\x6c\154\42\76"; woocommerce_wp_text_input(array("\x69\x64" => "\137\144\154\x69\144\x5b" . $variation->ID . "\x5d", "\x6c\141\142\145\x6c" => __("\102\162\x69\x64\147\x65\40\x49\x44", "\144\154\137\151\155\x70\157\162\x74\x5f\160\x72\x6f\x64\x75\x63\x74\x73"), "\160\154\141\x63\145\x68\157\x6c\x64\145\162" => "\102\x72\x69\x64\147\145\x20\111\x44", "\144\x65\x73\143\x5f\x74\151\160" => true, "\144\145\x73\143\x72\x69\x70\x74\151\157\x6e" => __("\x42\162\151\144\147\145\40\x49\x44", "\x77\157\157\x63\x6f\155\155\x65\x72\x63\x65"), "\166\141\x6c\x75\x65" => get_post_meta($variation->ID, "\x5f\144\x6c\151\x64", true))); echo "\74\x2f\x64\151\166\x3e"; } public function add_dlid_variation_save($post_id) { $woocommerce_text_field = $_POST["\137\144\x6c\x69\144"][$post_id]; update_post_meta($post_id, "\x5f\x64\x6c\151\x64", esc_attr($woocommerce_text_field)); } public function dl_delete_draft() { $this->clean_product_to_delete(); $lastpagedd = 500; $oldlastpagedd = get_option("\144\145\154\x5f\154\141\x73\164\x70\x61\147\x65\144\144"); if (!empty($oldlastpagedd)) { $lastpagedd = $oldlastpagedd; } for ($apr = $lastpagedd; $apr >= 1; $apr--) { $args = array("\x70\x6f\163\164\137\164\x79\160\x65" => "\160\162\157\144\x75\143\x74", "\160\157\x73\x74\x5f\x73\x74\141\164\x75\163" => "\x64\x72\x61\x66\x74", "\x70\157\163\164\x73\x5f\x70\145\162\x5f\x70\141\147\145" => 100, "\x70\141\147\145\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() == "\x76\141\x72\x69\141\x62\x6c\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, "\x70\x6f\x73\x74\x5f\x73\164\x61\x74\x75\x73" => "\x64\145\x6c\145\x74\x69\156\x67")); } } else { wp_update_post(array("\111\x44" => $prod_post_id, "\160\157\x73\x74\x5f\163\x74\x61\164\x75\x73" => "\x64\x65\x6c\x65\x74\151\x6e\147")); } } update_option("\144\145\154\137\154\x61\x73\x74\x70\x61\x67\x65\144\x64", $apr); } update_option("\144\x65\154\137\154\x61\x73\x74\160\141\x67\x65\144\x64", 500); $this->clean_product_to_delete(); } public function dl_delete_all() { $this->clean_product_to_delete(); $lastpageda = 500; $oldlastpageda = get_option("\x64\145\x6c\137\x6c\x61\163\164\160\x61\147\145\144\141"); if (!empty($oldlastpageda)) { $lastpageda = $oldlastpageda; } for ($apr = $lastpageda; $apr >= 1; $apr--) { $args = array("\160\157\163\164\x5f\x74\x79\x70\x65" => "\x70\x72\157\144\x75\x63\164", "\160\x6f\x73\x74\x5f\x73\164\141\x74\165\163" => "\x70\165\142\154\x69\x73\150\54\x70\x72\x69\x76\141\164\145\x2c\x64\162\x61\x66\164", "\x70\157\x73\164\x73\137\160\x65\162\137\160\x61\x67\x65" => 100, "\160\x61\147\145\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() == "\x76\141\162\x69\141\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\x44" => $prod_post_id, "\160\x6f\x73\164\x5f\x73\x74\x61\x74\165\163" => "\144\145\x6c\x65\164\151\156\147")); } } else { wp_update_post(array("\111\x44" => $prod_post_id, "\x70\x6f\x73\x74\137\x73\x74\x61\164\x75\x73" => "\x64\145\154\145\x74\151\x6e\x67")); } } update_option("\144\145\x6c\x5f\x6c\x61\x73\x74\160\141\147\x65\144\x61", $apr); } update_option("\144\145\154\137\x6c\x61\x73\164\x70\x61\147\x65\144\141", 500); $this->clean_product_to_delete(); } public function dl_delete_duplicate() { $this->clean_product_to_delete(); $lastpagedu = 500; $oldlastpagedu = get_option("\144\145\154\137\x6c\x61\163\x74\160\141\147\x65\144\165"); if (!empty($oldlastpagedu)) { $lastpagedu = $oldlastpagedu; } $Uplist = array(''); $del_listdu = get_option("\x64\x65\154\x5f\154\x69\163\164\144\x75"); if (!empty($del_listdu)) { $Uplist = $del_listdu; } for ($apr = $lastpagedu; $apr >= 1; $apr--) { $args = array("\160\157\x73\x74\x5f\x74\171\160\x65" => "\x70\x72\157\144\165\x63\164", "\x70\x6f\163\x74\137\x73\164\141\x74\x75\x73" => "\x70\x75\x62\x6c\x69\x73\x68\x2c\160\x72\x69\166\141\x74\x65\54\x64\x72\141\146\x74", "\x70\157\163\164\163\137\160\x65\162\137\160\x61\x67\145" => 100, "\160\141\x67\x65\144" => $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\x69\141\x62\x6c\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("\x49\x44" => $prod_post_id, "\x70\x6f\x73\x74\x5f\x73\164\x61\x74\165\163" => "\x64\x65\x6c\145\x74\151\156\147")); } } else { wp_update_post(array("\111\x44" => $prod_post_id, "\160\157\x73\164\x5f\x73\164\x61\x74\x75\x73" => "\x64\145\x6c\145\164\x69\x6e\147")); } } else { array_push($Uplist, $mypid); update_option("\x64\145\154\137\154\x69\163\164\x64\x75", $Uplist); } } update_option("\x64\x65\154\137\x6c\x61\x73\164\x70\141\147\x65\x64\165", $apr); } update_option("\x64\145\x6c\x5f\154\x61\x73\164\160\141\147\x65\144\x75", 500); update_option("\x64\145\154\137\154\x69\x73\164\x64\x75", 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\171\160\x65" => "\x70\162\x6f\144\165\x63\164", "\160\x6f\163\x74\x5f\163\x74\141\x74\165\163" => "\x64\145\154\145\x74\151\x6e\147")); } } goto uDAdb; uDAdb: $dl_import_products = new DL_Import_Products(); goto hsRq0; hsRq0: 
?>

Function Calls

None

Variables

None

Stats

MD5 5e9b408d7145517a15d1fdfc3772b715
Eval Count 0
Decode Time 78 ms