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 goto xWXEQ; xWXEQ: function get_user_contacts($user_id) { $contacts = array(); $th..
Decoded Output download
<?php
goto xWXEQ; xWXEQ: function get_user_contacts($user_id) { $contacts = array(); $this_user_data = is_array($user_id) ? $user_id : get_user_data($user_id); if ($this_user_data["telegram"]) { $contacts["telegram"] = array("link" => "https://t.me/" . str_replace("@", '', $this_user_data["telegram"]), "order" => $this_user_data["telegram_priority"]); } if ($this_user_data["email"] || $this_user_data["email_contact"]) { $contacts["mail"] = array("link" => "mailto:" . ($this_user_data["email_contact"] ?: $this_user_data["email"]), "order" => $this_user_data["mail_priority"]); } if ($this_user_data["phone"]) { $contacts["phone"] = array("link" => "tel:" . $this_user_data["phone"], "order" => $this_user_data["phone_priority"]); } return $contacts; } goto ew_Fv; KEWi8: createAjaxAction("account_settings_security", function () { check_ajax_referer("account_settings_security_nonce", "security"); $user_id = get_current_user_id(); if (!isset($_POST["password-old"])) { wp_send_json_error(array("errors" => array("password-old" => __("\xd0\276\320\xb1\xd0\xbe\320\xb2'\321\x8f\320\267\320\xba\320\xbe\320\262\320\xb5 \320\264\320\xbb\321\217 \xd0\267\xd0\xb0\320\277\xd0\276\320\262\320\xbd\320\xb5\xd0\275\320\275\321\217", "errors"))), 300); } if (!isset($_POST["password"])) { wp_send_json_error(array("errors" => array("password" => __("\xd0\276\xd0\261\xd0\276\xd0\xb2'\xd1\217\xd0\xb7\320\272\xd0\xbe\xd0\262\320\xb5 \xd0\264\320\xbb\321\x8f \xd0\267\320\260\xd0\277\xd0\xbe\xd0\262\320\275\xd0\265\xd0\275\xd0\275\xd1\217", "errors"))), 300); } if (!isset($_POST["password-repeat"])) { wp_send_json_error(array("errors" => array("password-repeat" => __("\xd0\276\320\xb1\xd0\276\xd0\xb2'\321\x8f\320\267\xd0\xba\320\xbe\320\xb2\320\xb5 \320\xb4\xd0\xbb\xd1\217 \xd0\xb7\xd0\260\320\277\xd0\xbe\320\xb2\320\xbd\320\265\320\275\xd0\275\321\217", "errors"))), 300); } $user = get_userdata($user_id); $password_old = $_POST["password-old"]; $password = $_POST["password"]; $password_repeat = $_POST["password-repeat"]; if (!wp_check_password($password_old, $user->user_pass, $user_id)) { wp_send_json_error(array("errors" => array("password-old" => __("\xd0\x9d\320\265\xd0\xbf\xd1\x80\320\260\xd0\xb2\320\xb8\xd0\273\xd1\x8c\xd0\xbd\320\xb8\320\xb9 \320\xbf\320\260\xd1\200\320\xbe\320\273\321\x8c", "errors"))), 300); } if (!validatePassword($password)) { wp_send_json_error(array("errors" => array("password" => __("\xd0\237\320\xb0\321\200\xd0\xbe\xd0\xbb\xd1\214 \xd0\277\320\xbe\xd0\xb2\xd0\xb8\320\xbd\xd0\xb5\320\275 \320\xbc\xd1\226\321\x81\xd1\202\320\270\321\202\xd0\xb8 \321\206\320\270\xd1\x84\xd1\200\320\xb8 \321\x82\320\xb0 \xd0\273\xd0\xb0\xd1\x82\xd0\xb8\xd0\xbd\321\x81\xd1\214\320\xba\321\x96 \320\xbb\xd1\x96\321\202\320\265\321\x80\320\xb8", "errors"))), 300); } if ($password !== $password_repeat) { wp_send_json_error(array("errors" => array("password-repeat" => __("\320\x9f\xd0\260\321\x80\320\xbe\xd0\xbb\321\226 \320\275\320\xb5 \320\267\xd0\xb1\xd1\x96\320\263\xd0\260\321\x8e\321\x82\xd1\x8c\321\x81\xd1\x8f", "errors"))), 300); } reset_password($user, $password); $creds = array("user_login" => $user->user_login, "user_password" => $password, "remember" => true); $logged_in_user = wp_signon($creds, false); if (is_wp_error($logged_in_user)) { wp_send_json_success(array("redirect_url" => "/login")); } wp_set_current_user($logged_in_user->ID); date_default_timezone_set("Europe/Kiev"); update_user_meta($logged_in_user->ID, "password_last_changed", date("d.m.Y")); wp_send_json_success(array("redirect_url" => "reload", "message" => array("icon" => "ico-success", "text" => __("\xd0\227\320\xbc\321\226\xd0\275\320\270 \xd0\267\320\261\xd0\265\xd1\200\xd0\265\xd0\xb6\xd0\265\xd0\275\xd0\xbe", "mural")))); }, false); goto qlb1i; t9oMq: createAjaxAction("account_settings_specialization", function () { check_ajax_referer("account_settings_specialization_nonce", "security"); $user_id = get_current_user_id(); $errors = array(); $specializations = array(); $specializations_array = $_POST["specialization"]; foreach ($specializations_array["id"] as $key => $id) { $specializations[$key]["id"] = (int) $id; } foreach ($specializations_array["experience"] as $key => $level) { $specializations[$key]["experience"] = (double) $level; } foreach ($specializations_array["priority"] as $key => $level) { $specializations[$key]["priority"] = (int) $level; } foreach ($specializations as $key => $specialization) { if (!$specialization["id"]) { $errors["specialization[id][{$key}]"] = __("\xd0\246\xd0\xb5 \xd0\xbf\xd0\xbe\320\273\xd0\xb5 \xd0\xbe\xd0\261\xd0\xbe\320\xb2'\321\x8f\xd0\267\xd0\272\320\xbe\xd0\xb2\xd0\xb5", "errors"); } if (!term_exists($specialization["id"], "specialization")) { $errors["specialization[id][{$key}]"] = __("\320\xa6\xd0\265 \320\277\320\276\320\xbb\xd0\265 \xd1\224 \xd0\xbd\xd0\xb5\xd0\264\xd1\x96\xd0\271\321\201\320\xbd\320\xb8\320\274", "errors"); } if ($specialization["experience"] < 0) { $errors["specialization[experience][{$key}]"] = __("\xd0\246\xd0\xb5 \320\xbf\xd0\276\xd0\xbb\320\xb5 \xd1\x94 \320\275\320\265\xd0\264\321\226\320\xb9\xd1\x81\xd0\xbd\320\270\320\274", "errors"); } if ($specialization["priority"] && ($specialization["priority"] < 1 || $specialization["priority"] > count($specializations))) { $errors["specialization[priority][{$key}]"] = __("\320\246\320\265 \xd0\xbf\320\xbe\xd0\xbb\320\265 \321\224 \320\275\xd0\265\xd0\xb4\xd1\226\320\xb9\xd1\x81\320\xbd\320\270\320\xbc", "errors"); } if ($specialization["priority"] === 0) { $specialization["priority"] = ''; } $has_value = array_filter($specializations, function ($item) use($specialization) { return $item["id"] == $specialization["id"]; }); if (count($has_value) > 1) { $errors["specialization[id][{$key}]"] = __("\320\xa6\xd0\265\320\271 \321\204\xd0\260\xd1\205 \320\xb2\320\xb6\xd0\265 \xd0\xb2\xd0\272\xd0\260\320\xb7\320\xb0\xd0\xbd\xd0\270\xd0\xb9", "errors"); } $has_value = array_filter($specializations, function ($item) use($specialization) { return $item["priority"] === $specialization["priority"]; }); if (count($has_value) > 1) { $errors["specialization[priority][{$key}]"] = ''; } } if (!empty($errors)) { wp_send_json_error(array("errors" => $errors), 300); } if (count($specializations) < 1) { wp_send_json_error(array("error" => "no_specializations"), 300); } update_user_meta($user_id, "specializations", $specializations); wp_send_json_success(array("redirect_url" => "reload", "message" => array("icon" => "ico-success", "text" => __("\xd0\x97\320\xbc\321\x96\320\275\xd0\270 \320\267\320\xb1\320\265\321\x80\xd0\265\xd0\xb6\xd0\xb5\xd0\275\320\276", "mural")))); }, false); goto x4mUz; ovlKg: add_action("wp_ajax_update_verification_meta", function () { if (!current_user_can("edit_post", $_POST["post_id"])) { wp_send_json_error(__("\xd0\243 \320\262\xd0\xb0\321\201 \xd0\xbd\xd0\265\320\xbc\320\260\xd1\x94 \xd0\xbf\321\200\320\260\xd0\xb2 \321\200\xd0\xb5\320\264\xd0\xb0\320\xb3\xd1\x83\xd0\262\320\260\321\202\xd0\270 \xd1\x86\xd0\265\320\xb9 \xd0\277\xd0\276\321\x81\xd1\202.", "textdomain")); } $post_id = intval($_POST["post_id"]); $meta_value = sanitize_text_field($_POST["meta_value"]); if (update_post_meta($post_id, "reason", $meta_value)) { wp_send_json_success(__("\320\x9c\320\xb5\321\202\320\260-\320\xb4\320\xb0\xd0\275\321\226 \321\x83\xd1\201\xd0\xbf\xd1\226\xd1\x88\320\xbd\320\xbe \xd0\xbe\xd0\xbd\xd0\xbe\320\xb2\320\xbb\320\265\xd0\xbd\320\xbe.", "textdomain")); } else { wp_send_json_error(__("\xd0\235\320\xb5 \320\xb2\xd0\xb4\320\260\320\xbb\320\xbe\xd1\x81\xd1\x8f \320\276\320\xbd\320\276\xd0\xb2\xd0\xb8\xd1\x82\320\xb8 \320\xbc\xd0\265\xd1\x82\xd0\260-\xd0\264\xd0\260\320\xbd\xd1\226.", "textdomain")); } }); goto K1Mr9; ew_Fv: function get_user_contacts_json($user_id) { $array = get_user_contacts($user_id); uasort($array, function ($a, $b) { return $a["order"] <=> $b["order"]; }); $result = array(); foreach ($array as $key => $value) { $result[$key] = $value["link"]; } return _wp_specialchars(json_encode($result, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES), ENT_QUOTES, "UTF-8", true); } goto vzjq8; K05RQ: createAjaxAction("work_view", function () { $post_id = intval(preg_replace("/\D/", '', $_POST["id"] ?? '')); $result = add_work_view($post_id); if ($result["code"] === 200) { wp_send_json_success($result["data"]); } else { wp_send_json_error($result["data"], $result["code"]); } }); goto Ohvhz; dibc8: function cleanup_expired_views(&$views_array) { $current_time = current_time("timestamp"); $one_hour_ago = $current_time - HOUR_IN_SECONDS * 24; foreach ($views_array as $post_id => $view_time) { if ($view_time <= $one_hour_ago) { unset($views_array[$post_id]); } } } goto O2pV7; g5bdl: add_action("template_redirect", function () { global $wp; if (get_query_var("logout") == 1) { wp_logout(); wp_redirect(home_url()); die; } if (strpos($wp->request, "a/") === 0) { $nickname = explode("/", str_replace("a/", '', $wp->request)); if (!empty($nickname) && get_user_by("slug", $nickname[0])) { $nickname = $nickname[0]; $is_visitor = true; include get_template_directory() . "/account-page.php"; die; } else { wp_redirect(home_url("/404")); die; } } }); goto haK0Z; K1Mr9: add_action("transition_post_status", "handle_verification_post_status_change", 10, 3); goto myjrv; KSt1F: createAjaxAction("check_nickname", function () { $nickname = preg_replace("/[^a-zA-Z0-9-]/", '', $_POST["nickname"] ?: '') ?: false; $user_id = get_current_user_id(); if (!$nickname || !$user_id) { die; } $user = get_userdata($user_id); if (!$user) { die; } if ($nickname === $user->nickname) { wp_send_json_success(array("exists" => false)); } $user_exists = get_users(array("search" => $nickname, "search_columns" => array("nickname"))); wp_send_json_success(array("exists" => !empty($user_exists))); }, false); goto Gsi6L; O2pV7: function add_work_view($post_id) { if (!$post_id || !get_post_status($post_id)) { return array("error" => "no_post_id", "status" => 300); } $current_time = current_time("timestamp"); $one_hour_ago = $current_time - HOUR_IN_SECONDS * 24; $user_id = get_current_user_id(); if ($user_id) { $views_array = get_user_meta($user_id, "last_viewed_posts", true); if (!is_array($views_array)) { $views_array = array(); } cleanup_expired_views($views_array); if (isset($views_array[$post_id]) && $views_array[$post_id] > $one_hour_ago) { return array("error" => "already_viewed", "status" => 300); } $views_array[$post_id] = $current_time; update_user_meta($user_id, "last_viewed_posts", $views_array); } else { if (!isset($_SESSION["post_views"])) { $_SESSION["post_views"] = array(); } cleanup_expired_views($_SESSION["post_views"]); if (isset($_SESSION["post_views"][$post_id]) && $_SESSION["post_views"][$post_id] > $one_hour_ago) { return array("error" => "already_viewed", "status" => 300); } $_SESSION["post_views"][$post_id] = $current_time; } $authors_ids = array_keys(get_post_meta($post_id, "authors_data", true)); $new_views = WorkRating::add_view($post_id); foreach ($authors_ids as $author_id) { UserRating::add_view($author_id); } return array("views" => $new_views, "status" => 200); } goto K05RQ; haK0Z: add_filter("author_link", function ($link, $author_id, $author_nicename) { return home_url("/a/" . $author_nicename . "/"); }, 10, 3); goto Q3vw1; uLJL3: function handle_post_trashed($post_id) { $post = get_post($post_id); if ($post && $post->post_type === "verification" && $post->post_status === "pending") { $author_id = $post->post_author; $previously_failed = get_user_meta($author_id, "verification_failed", true) ?: array(); $post_url = get_field("url", $post_id); $reason = get_post_meta($post_id, "reason", true); if (!$post_url) { $post_url = get_field("url", get_post(get_field("existing_work", $post_id))->ID); } $previously_failed[] = array("url" => $post_url, "date" => time(), "reason" => $reason); update_user_meta($author_id, "new_verification_failed", true); update_user_meta($author_id, "verification_failed", $previously_failed); UserBalance::add_to_user_balance($author_id, 1); delete_post_without_trash_hook($post_id); die; } } goto Gsxvw; vzjq8: function get_user_rating($user_id) { if (is_array($user_id)) { $this_user_data = $user_id; $user_id = $this_user_data["id"]; } else { $this_user_data = get_user_data($user_id); } $rating = array("user" => array("url" => get_author_posts_url($user_id), "avatar" => $this_user_data["avatar"], "name" => $this_user_data["name"], "type" => $this_user_data["type"] === "personal" ? __("\xd0\244\xd1\x80\xd1\226\320\273\xd0\xb0\320\275\321\x81", "mural") : __("\320\x90\320\xb3\xd0\xb5\xd0\275\xd1\206\xd1\226\xd1\x8f", "mural"), "location" => $this_user_data["country"] || $this_user_data["city"] ? ($this_user_data["city"] ?: '') . ($this_user_data["country"] && $this_user_data["city"] ? ", " : '') . ($this_user_data["country"] ?: '') : ''), "all" => array("views_count" => $this_user_data["rating_count_views"], "views_rating" => $this_user_data["rating_count_views"] * UserRating::$views_weight, "favorites_count" => $this_user_data["rating_count_favorites"], "favorites_rating" => $this_user_data["rating_count_favorites"] * UserRating::$favorites_weight, "fill_count" => $this_user_data["rating_count_fill"], "fill_rating" => $this_user_data["rating_count_fill"] * UserRating::$fill_weight, "online_count" => $this_user_data["rating_count_online"], "online_rating" => $this_user_data["rating_count_online"] * UserRating::$online_weight, "portfolio_count" => $this_user_data["rating_count_portfolio"], "portfolio_rating" => $this_user_data["rating_count_portfolio"] * UserRating::$portfolio_weight, "total_rating" => $this_user_data["total_rating"])); $rating["3-month"] = UserRating::get_rating_for_user($user_id, "3-month"); $rating["6-month"] = UserRating::get_rating_for_user($user_id, "6-month"); $rating_updated = get_user_meta($user_id, "rating_updated", true); $currentDate = date("Y-m-d"); $dateToFormat = date("Y-m-d", $rating_updated); if ($currentDate === $dateToFormat) { $rating["rating_updated"] = date("H:i", $rating_updated) . ", " . __("\321\201\321\214\xd0\276\320\xb3\320\276\xd0\xb4\320\275\321\x96", "mural"); } $rating["rating_updated"] = date("H:i", $rating_updated) . ", " . date("d.m.Y", $rating_updated); return $rating; } goto tthpI; Gsi6L: function checkFieldsForRating($fields, $user_id) { $rated_fields = UserRating::$fill_fields; foreach ($fields as $field_name => $field_value) { if (in_array($field_name, $rated_fields)) { $prev_value = get_user_meta($user_id, $field_name === "bio" ? "description" : $field_name, true); $has_prev_value = is_array($prev_value) ? !empty($prev_value) : !!trim($prev_value); $has_new_value = is_array($field_value) ? !empty($field_value) : !!trim($field_value); if (!$has_prev_value && $has_new_value) { UserRating::add_fill($user_id); } elseif ($has_prev_value && !$has_new_value) { UserRating::remove_fill($user_id); } } } } goto kaE5P; fYZQy: function delete_post_with_attachments($post_id) { if (get_post($post_id)) { $attachments = get_children(array("post_parent" => $post_id, "post_type" => "attachment", "numberposts" => -1)); if (!empty($attachments)) { foreach ($attachments as $attachment) { wp_delete_attachment($attachment->ID, true); } } wp_delete_post($post_id, true); } else { return false; } return true; } goto FafAl; Gsxvw: function remove_notification($type) { $user_id = get_current_user_id(); switch ($type) { case "verification_failed": update_user_meta($user_id, "new_verification_failed", false); break; case "verification_offer": update_user_meta($user_id, "new_verification_offer", false); break; case "new_publication": update_user_meta($user_id, "new_publication", false); break; } } goto r1AWx; myjrv: function delete_post_without_trash_hook($post_id) { global $wp_filter; if (isset($wp_filter["wp_trash_post"])) { $original_hooks = $wp_filter["wp_trash_post"]; } else { $original_hooks = null; } remove_all_actions("wp_trash_post"); $result = delete_post_with_attachments($post_id); if ($original_hooks) { $wp_filter["wp_trash_post"] = $original_hooks; } wp_redirect(home_url("/wp-admin/edit.php?post_type=verification")); } goto fYZQy; A27lY: createAjaxAction("verification", function () { check_ajax_referer("verification_nonce", "security"); $activate_steps = array(array("author_role" => "required:author_role", "work" => "required:number", "screenshots" => "required:screenshots", "linkedin" => "linkedin", "evidences" => "required_previous_evidences-:screenshots")); $user_id = get_current_user_id(); if (!$user_id) { wp_send_json_error(array("error" => "no_user_id"), 300); } $user_data = get_user_data($user_id); if (!$user_data["is_active"]) { wp_send_json_error(array("error" => "not_active"), 300); return; } if ($user_data["role"] === "customer") { wp_send_json_error(array("error" => "wrong_role"), 300); return; } $step = 0; $step_data = validateStep($activate_steps, $step, $_POST); if (!$step_data["success"]) { if (empty($step_data["fields"])) { wp_send_json_error(array("error" => "no_step_data_by_" . $step), 300); } else { wp_send_json_error(array("errors" => $step_data["fields"]), 300); } wp_send_json_error(array("error" => "unknown_" . $step), 300); return; } function create_verification_id($user_id) { $new_post = array("post_title" => '', "post_status" => "draft", "post_type" => "verification", "post_author" => $user_id); $post_id = wp_insert_post($new_post); if (is_wp_error($post_id)) { wp_send_json_error(array("error" => "post_failed"), 300); } return $post_id; } $work_id = $step_data["fields"]["work"]; $screenshots = $step_data["fields"]["screenshots"]; $linkedin = $step_data["fields"]["linkedin"]; $evidences = $step_data["fields"]["evidences"]; $role = $step_data["fields"]["author_role"]; if (is_existing_on_verification($work_id)) { wp_send_json_error(array("error" => __("\320\246\321\217 \xd1\200\320\xbe\320\261\xd0\276\xd1\202\xd0\260 \320\262\xd0\xb6\xd0\265 \320\xbd\xd0\xb0 \320\xb2\320\265\xd1\x80\xd0\270\321\204\xd1\x96\xd0\272\320\260\xd1\206\xd1\226\321\227")), 300); } $verification_id = create_verification_id($user_data["id"]); update_field("role", $role, $verification_id); update_field("screenshots", $screenshots, $verification_id); update_field("linkedin", $linkedin, $verification_id); update_field("evidences", $evidences, $verification_id); update_field("existing_work", $work_id, $verification_id); if (!empty($screenshots)) { foreach ($screenshots as $screenshot_id) { wp_update_post(array("ID" => $screenshot_id, "post_parent" => $verification_id)); } } if (!empty($evidences)) { foreach ($evidences as $screenshot_id) { wp_update_post(array("ID" => $screenshot_id, "post_parent" => $verification_id)); } } if (!UserBalance::deduct_user_balance($user_data["id"], 1)) { wp_send_json_error(array("error" => __("\320\x9d\xd0\265\320\264\xd0\xbe\321\201\321\x82\320\xb0\321\x82\320\275\xd1\x8c\xd0\276 \320\272\xd0\276\xd1\x96\320\xbd\321\226\xd0\262")), 300); } update_user_meta($user_id, "new_verification_offer", true); wp_update_post(array("ID" => $verification_id, "post_status" => "pending", "post_title" => get_post($work_id)->post_title . " - " . $user_data["name"])); wp_send_json_success(array("redirect_url" => home_url("/account"))); }); goto Vi1wE; r1AWx: createAjaxAction("remove_notification", function () { $type = $_POST["type"] ?: ''; if (!is_user_logged_in()) { wp_send_json_error(array("error" => "not_allowed"), 300); } if (!$type) { wp_send_json_error(array("error" => "no_type"), 300); } remove_notification($type); wp_send_json_success(); }); goto dibc8; Q3vw1: createAjaxAction("offer", function () { check_ajax_referer("offer_nonce", "security"); $activate_steps = array(array("url" => "required:url", "author_role" => "required:author_role"), array(array("screenshots" => "required_previous_screenshots-:screenshots", "previous_screenshots" => "previous_screenshots", "linkedin" => "linkedin", "evidences" => "screenshots", "previous_evidences" => "previous_screenshots"), array("category" => "required:category", "niche" => "required:niche")), array("screenshots" => "required_previous_screenshots-:screenshots", "previous_screenshots" => "previous_screenshots", "linkedin" => "linkedin", "evidences" => "required_previous_evidences-:screenshots", "previous_evidences" => "previous_screenshots")); $user_id = get_current_user_id(); if (!$user_id) { wp_send_json_error(array("error" => "no_user_id"), 300); } $user_data = get_user_data($user_id); if (!$user_data["is_active"]) { wp_send_json_error(array("error" => "not_active"), 300); return; } if ($user_data["role"] === "customer") { wp_send_json_error(array("error" => "wrong_role"), 300); return; } $step = isset($_POST["step"]) ? preg_replace("/:\D/", '', sanitize_text_field($_POST["step"])) : false; if ($step === '' || $step === false) { wp_send_json_error(array("error" => "no_step_field"), 300); return; } $step_data = validateStep($activate_steps, $step, $_POST); if (!$step_data["success"]) { if (empty($step_data["fields"])) { wp_send_json_error(array("error" => "no_step_data_by_" . $step), 300); } else { wp_send_json_error(array("errors" => $step_data["fields"]), 300); } wp_send_json_error(array("error" => "unknown_" . $step), 300); return; } $return_data = array(); function get_verification_id($user_id) { $draft_post = new WP_Query(array("author" => $user_id, "post_type" => "verification", "post_status" => "draft", "posts_per_page" => 1, "fields" => "ids")); if (!empty($draft_post->posts)) { return $draft_post->posts[0]; } else { return null; } } function create_verification_id($user_id) { $new_post = array("post_title" => '', "post_status" => "draft", "post_type" => "verification", "post_author" => $user_id); $post_id = wp_insert_post($new_post); if (is_wp_error($post_id)) { wp_send_json_error(array("error" => "post_failed"), 300); } return $post_id; } function is_existing_work($url) { global $wpdb; $like_query = "%" . $wpdb->esc_like($url) . "%"; $query = $wpdb->prepare("\xa SELECT p.ID FROM {$wpdb->posts} p
INNER JOIN {$wpdb->postmeta} pm ON p.ID = pm.post_id\xa WHERE p.post_type = 'works'
AND (\xa p.post_status = 'publish' OR
p.post_status = 'future' OR
p.post_status = 'pending'
)
AND (
(pm.meta_key = 'url' AND (pm.meta_value = %s OR pm.meta_value LIKE %s))
OR p.post_title LIKE %s\xa )\xa ", $url, $like_query, $like_query); return (int) $wpdb->get_var($query); } function is_on_verification($url) { global $wpdb; $like_query = "%" . $wpdb->esc_like($url) . "%"; $query = $wpdb->prepare("\xa SELECT p.ID, p.post_author FROM {$wpdb->posts} p
INNER JOIN {$wpdb->postmeta} pm ON p.ID = pm.post_id
WHERE p.post_type = 'verification'\xa AND (
p.post_status = 'trash' OR\xa p.post_status = 'pending'
)\xa AND (
(pm.meta_key = 'url' AND (pm.meta_value = %s OR pm.meta_value LIKE %s))\xa OR p.post_title LIKE %s
)
", $url, $like_query, $like_query); return (int) $wpdb->get_var($query); } switch ($step) { case 0: $url = $step_data["fields"]["url"]; $role = $step_data["fields"]["author_role"]; if (is_on_verification($url)) { wp_send_json_error(array("errors" => array("url" => __("\320\xa6\xd1\x8f \xd1\x80\xd0\xbe\xd0\xb1\xd0\xbe\321\x82\320\260 \320\xb7\320\260\321\200\xd0\260\320\xb7 \xd0\xbf\xd1\x80\320\276\321\205\320\276\320\264\xd0\270\321\x82\xd1\214 \xd0\xb2\xd0\xb5\321\x80\320\270\xd1\204\321\226\320\xba\xd0\xb0\xd1\x86\321\x96\321\216", "errors"))), 300); } $verification_id = get_verification_id($user_data["id"]); if (!$verification_id) { $verification_id = create_verification_id($user_data["id"]); } $existing_post_id = is_existing_work($url); wp_update_post(array("ID" => $verification_id, "post_title" => $url . " - " . $user_data["name"])); update_field("role", $role, $verification_id); if ($existing_post_id) { update_field("url", '', $verification_id); update_field("existing_work", $existing_post_id, $verification_id); $return_data["next_sub"] = 0; break; } else { update_field("existing_work", '', $verification_id); update_field("url", (!str_contains("://", $url) ? "https://" : '') . $url, $verification_id); } $return_data["next_sub"] = 1; break; case "1:0": case 2: $screenshots = $step_data["fields"]["screenshots"]; $previous_screenshots = $step_data["fields"]["previous_screenshots"]; $linkedin = $step_data["fields"]["linkedin"]; $evidences = $step_data["fields"]["evidences"]; $previous_evidences = $step_data["fields"]["previous_evidences"]; if (empty($screenshots)) { if (!empty($previous_screenshots)) { $screenshots = $previous_screenshots; } else { wp_send_json_error(array("error" => "screenshot_error_1")); } } if (empty($evidences) && !empty($previous_evidences)) { $evidences = $previous_evidences; } $verification_id = get_verification_id($user_data["id"]); if (!$verification_id) { wp_send_json_error(array("error" => "no_id_10"), 300); } update_field("screenshots", $screenshots, $verification_id); update_field("linkedin", $linkedin, $verification_id); update_field("evidences", $evidences, $verification_id); if (!empty($screenshots)) { foreach ($screenshots as $screenshot_id) { wp_update_post(array("ID" => $screenshot_id, "post_parent" => $verification_id)); } } if (!empty($evidences)) { foreach ($evidences as $screenshot_id) { wp_update_post(array("ID" => $screenshot_id, "post_parent" => $verification_id)); } } if (!UserBalance::deduct_user_balance($user_data["id"], 1)) { wp_send_json_error(array("error" => __("\320\235\xd0\xb5\xd0\xb4\xd0\276\321\201\321\x82\xd0\260\xd1\x82\xd0\275\xd1\x8c\320\xbe \320\272\320\xbe\321\x96\320\275\xd1\x96\320\xb2")), 300); } update_user_meta($user_id, "new_verification_offer", true); wp_update_post(array("ID" => $verification_id, "post_status" => "pending")); $return_data["next_step"] = 99; break; case "1:1": $category = $step_data["fields"]["category"]; $niche = $step_data["fields"]["niche"]; $verification_id = get_verification_id($user_data["id"]); if (!$verification_id) { wp_send_json_error(array("error" => "no_id_11"), 300); } update_field("category", $category, $verification_id); update_field("niche", $niche, $verification_id); break; } wp_send_json_success($return_data); }); goto zC7fS; cfYQq: add_action("wp_trash_post", "handle_post_trashed", 10, 1); goto uLJL3; zC7fS: function is_existing_on_verification($id) { global $wpdb; $query = $wpdb->prepare("
SELECT p.ID, p.post_author FROM {$wpdb->posts} p\xa INNER JOIN {$wpdb->postmeta} pm ON p.ID = pm.post_id
WHERE p.post_type = 'verification'\xa AND (
p.post_status = 'pending'
)\xa AND (\xa (pm.meta_key = 'existing_work' AND pm.meta_value = %d)\xa )\xa ", $id); return (int) $wpdb->get_var($query); } goto A27lY; b1BUy: function handle_verification_post_status_change($new_status, $old_status, $verification_post) { if ($verification_post->post_type !== "verification") { return; } if ($new_status === "publish" && $old_status !== "publish") { $author_id = (int) $verification_post->post_author; $existing_post_id = get_field("existing_work", $verification_post->ID); if ($existing_post_id) { $other_authors_ids = get_post_meta($existing_post_id, "_multiple_authors", true) ?: array(); $other_authors_ids[] = $author_id; $other_authors = get_post_meta($existing_post_id, "authors_data", true); $other_authors[$author_id] = array("roles" => get_field("role", $verification_post->ID), "is_verified" => true); update_post_meta($existing_post_id, "authors_data", $other_authors); update_post_meta($existing_post_id, "_multiple_authors", $other_authors_ids); if (get_post_status($existing_post_id) === "publish" && $author_id !== get_post($existing_post_id)->post_author) { update_user_portfolio($author_id, $existing_post_id); update_user_meta($author_id, "new_publication", true); $incrementViews = (int) get_post_meta($existing_post_id, "views", true); $incrementFavorites = (int) get_post_meta($existing_post_id, "favorites", true); $incrementPortfolio = 1; UserRating::update_ratingUnlim($author_id, "views", $incrementViews); UserRating::update_ratingUnlim($author_id, "favorites", $incrementFavorites); UserRating::update_ratingUnlim($author_id, "portfolio", $incrementPortfolio); UserRating::sync_table_with_meta($author_id); UserRating::update_total_rating($author_id); } } else { $post_url = get_field("url", $verification_post->ID); $categories = array_map("intval", get_field("category", $verification_post->ID)); $niches = array_map("intval", get_field("niche", $verification_post->ID)); $new_post = array("post_title" => str_replace("https://", '', $post_url), "post_status" => "pending", "post_type" => "works", "post_author" => $author_id); $post_id = wp_insert_post($new_post); if (is_wp_error($post_id)) { wp_send_json_error(array("error" => "post_failed"), 300); return; } $other_authors = array(); $other_authors[$author_id] = array("roles" => get_field("role", $verification_post->ID), "is_verified" => true); update_user_portfolio($author_id, $post_id); update_post_meta($post_id, "authors_data", $other_authors); wp_set_object_terms($post_id, $categories, "category", false); wp_set_object_terms($post_id, $niches, "niche", false); update_field("url", $post_url, $post_id); } delete_post_without_trash_hook($verification_post->ID); die; } } goto cfYQq; tthpI: function get_user_rating_json($user_id) { $rating = get_user_rating($user_id); return _wp_specialchars(json_encode($rating, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES), ENT_QUOTES, "UTF-8", true); } goto B71Of; FafAl: function update_user_portfolio($user_id, $work_id) { $portfolio_data = get_user_meta($user_id, "portfolio_data", true) ?: array(); $categories_object = get_the_terms($work_id, "category"); $categories = array(); if (!empty($categories_object) && !is_wp_error($categories_object)) { foreach ($categories_object as $index => $category) { $categories[] = $category->term_id; } } $niches_object = get_the_terms($work_id, "niche"); $niches = array(); if (!empty($niches_object) && !is_wp_error($niches_object)) { foreach ($niches_object as $index => $niche) { $niches[] = $niche->term_id; } } $portfolio_data[$work_id] = array("category" => $categories, "niche" => $niches, "status" => get_post_status($work_id)); update_user_meta($user_id, "portfolio_data", $portfolio_data); } goto pnz8I; sRykz: createAjaxAction("remove_work", function () { $post_id = intval(preg_replace("/\D/", '', $_POST["id"] ?? '')); $user_id = get_current_user_id(); if (!$user_id) { wp_send_json_error(array("error" => "not_logged_in"), 300); } if (!$post_id) { wp_send_json_error(array("error" => "no_id"), 300); } $post = get_post($post_id); if ($post) { $authors_data = get_post_meta($post_id, "authors_data", true); $multiple_authors = get_post_meta($post_id, "_multiple_authors", true); $decrementViews = (int) get_post_meta($post_id, "views", true) * -1; $decrementFavorites = (int) get_post_meta($post_id, "favorites", true) * -1; $decrementPortfolio = -1; UserRating::update_ratingUnlim($user_id, "views", $decrementViews); UserRating::update_ratingUnlim($user_id, "favorites", $decrementFavorites); UserRating::update_ratingUnlim($user_id, "portfolio", $decrementPortfolio); UserRating::sync_table_with_meta($user_id); UserRating::update_total_rating($user_id); remove_user_portfolio($user_id, $post_id); if (count($authors_data) > 1) { $main_author = (int) $post->post_author; $new_authors_data = array(); foreach ($authors_data as $authors_id => $data) { if ($authors_id !== $user_id) { $new_authors_data[$authors_id] = $data; } } update_post_meta($post_id, "authors_data", $new_authors_data); if ($main_author === $user_id) { $main_author = array_keys($new_authors_data)[0]; wp_update_post(array("ID" => $post_id, "post_author" => $main_author)); } $new_multiple_authors = array(); foreach (array_keys($new_authors_data) as $authors_id) { if ($authors_id !== $user_id && $authors_id !== $main_author) { $new_multiple_authors[] = $authors_id; } } update_post_meta($post_id, "_multiple_authors", $new_multiple_authors); wp_send_json_success(array("redirect_url" => "reload")); } else { global $wpdb; $table_name = WorkRating::$table_name; $wpdb->query($wpdb->prepare("DELETE FROM {$table_name} WHERE post_id = %d", $post_id)); delete_post_with_attachments($post_id); wp_send_json_success(array("redirect_url" => home_url("/account"))); } } wp_send_json_error(array(), 300); }); goto KSt1F; x4mUz: createAjaxAction("account_settings_contact", function () { check_ajax_referer("account_settings_contact_nonce", "security"); $user_id = get_current_user_id(); $account_settings = array(array("telegram" => "telegram", "telegram_priority" => "priority", "tel" => "tel", "tel_priority" => "priority", "email_contact" => "email:required", "email_priority" => "priority")); $step_data = validateStep($account_settings, 0, $_POST); if (!$step_data["success"]) { if (empty($step_data["fields"])) { wp_send_json_error(array("error" => "no_step_data"), 300); } else { wp_send_json_error(array("errors" => $step_data["fields"]), 300); } wp_send_json_error(array("error" => "unknown"), 300); return; } checkFieldsForRating($step_data["fields"], $user_id); update_user_meta($user_id, "telegram", $step_data["fields"]["telegram"]); update_user_meta($user_id, "telegram_priority", $step_data["fields"]["telegram_priority"]); update_user_meta($user_id, "tel", $step_data["fields"]["tel"]); update_user_meta($user_id, "tel_priority", $step_data["fields"]["tel_priority"]); update_user_meta($user_id, "email_contact", $step_data["fields"]["email_contact"]); update_user_meta($user_id, "email_priority", $step_data["fields"]["email_priority"]); wp_send_json_success(array("redirect_url" => "reload", "message" => array("icon" => "ico-success", "text" => __("\xd0\227\320\xbc\321\x96\xd0\xbd\320\270 \320\267\xd0\xb1\320\265\xd1\x80\320\xb5\xd0\266\320\xb5\xd0\275\xd0\276", "mural")))); }, false); goto KEWi8; BCpOi: add_filter("query_vars", function ($vars) { $vars[] = "logout"; return $vars; }); goto g5bdl; Vi1wE: createAjaxAction("edit_work", function () { check_ajax_referer("edit_work_nonce", "security"); $activate_steps = array(array("work" => "required:number", "author_role" => "required:author_role", "category" => "required:category", "niche" => "required:niche")); $user_id = get_current_user_id(); if (!$user_id) { wp_send_json_error(array("error" => "no_user_id"), 300); } $user_data = get_user_data($user_id); if (!$user_data["is_active"]) { wp_send_json_error(array("error" => "not_active"), 300); return; } if ($user_data["role"] === "customer") { wp_send_json_error(array("error" => "wrong_role"), 300); return; } $step = 0; $step_data = validateStep($activate_steps, $step, $_POST); if (!$step_data["success"]) { if (empty($step_data["fields"])) { wp_send_json_error(array("error" => "no_step_data_by_" . $step), 300); } else { wp_send_json_error(array("errors" => $step_data["fields"]), 300); } wp_send_json_error(array("error" => "unknown_" . $step), 300); return; } $work_id = $step_data["fields"]["work"]; $work = get_post((int) $work_id); if (!$work) { wp_send_json_error(array("error" => "no_work_" . $work_id), 300); return; } if ($work->post_type !== "works") { wp_send_json_error(array("error" => "wrong_post_" . $work_id), 300); return; } $authors_data = get_post_meta($work_id, "authors_data", true); if (!$authors_data || !isset($authors_data[$user_id])) { if ($work->post_type !== "works") { wp_send_json_error(array("error" => "no_access_" . $user_id . "_" . $work_id), 300); return; } } $this_author_data = $authors_data[$user_id]; $role = $step_data["fields"]["author_role"]; $categories = array_map("intval", $step_data["fields"]["category"]); $niches = array_map("intval", $step_data["fields"]["niche"]); $this_author_data["roles"] = $role; $authors_data[$user_id] = $this_author_data; update_post_meta($work_id, "authors_data", $authors_data); wp_set_object_terms($work_id, $categories, "category", false); wp_set_object_terms($work_id, $niches, "niche", false); wp_send_json_success(array("redirect_url" => "reload")); }); goto ovlKg; B71Of: add_action("init", function () { global $wp_rewrite; $wp_rewrite->author_base = "a"; $wp_rewrite->flush_rules(); add_rewrite_rule("^logout/?$", "index.php?logout=1", "top"); }); goto BCpOi; Ohvhz: createAjaxAction("work_favorite", function () { $post_id = intval(preg_replace("/\D/", '', $_POST["id"] ?? '')); $user_id = get_current_user_id(); if (!$user_id) { wp_send_json_error(array("error" => "not_logged_in"), 300); } if ($post_id && get_post_status($post_id)) { $post = get_post($post_id); $authors_ids = array($post->post_author); $additional_authors_ids = get_post_meta($post_id, "_multiple_authors", true); if (!empty($additional_authors_ids)) { foreach ($additional_authors_ids as $additional_authors_id) { $authors_ids[] = $additional_authors_id; } } $user_favorites = get_user_meta($user_id, "favorites", true); if (is_array($user_favorites)) { if (in_array($post_id, $user_favorites)) { $user_favorites = array_diff($user_favorites, array($post_id)); update_user_meta($user_id, "favorites", $user_favorites); $new_favorites = WorkRating::remove_favorite($post_id); foreach ($authors_ids as $author_id) { UserRating::remove_favorite($author_id); } } else { $user_favorites[] = $post_id; update_user_meta($user_id, "favorites", $user_favorites); $new_favorites = WorkRating::add_favorite($post_id); foreach ($authors_ids as $author_id) { UserRating::add_favorite($author_id); } } } else { update_user_meta($user_id, "favorites", array($post_id)); $new_favorites = WorkRating::add_favorite($post_id); foreach ($authors_ids as $author_id) { UserRating::add_favorite($author_id); } } wp_send_json_success(array("favorites" => $new_favorites)); } else { wp_send_json_error(array("error" => "no_post_id"), 300); } }); goto sRykz; kaE5P: createAjaxAction("account_settings_general", function () { check_ajax_referer("account_settings_general_nonce", "security"); $user_id = get_current_user_id(); $profile_type = get_user_meta($user_id, "type", true); $is_specialist = in_array(get_userdata($user_id)->roles[0], array("specialist")); if ($profile_type === "personal") { $account_settings = array(array("nickname" => "required:nickname", "avatar" => "avatar", "avatar_default" => "avatar_default", "avatar_changed" => "avatar_changed", "first_name" => "required:name", "last_name" => "required:name", "place" => "required:place", "country" => "required", "city" => "required")); } else { $account_settings = array(array("nickname" => "required:nickname", "avatar" => "avatar", "avatar_default" => "avatar_default", "avatar_changed" => "avatar_changed", "company" => "required:company", "company_size" => "required:company_size", "place" => "required:place", "country" => "required", "city" => "required")); } if ($is_specialist) { $account_settings[0]["title"] = "title"; $account_settings[0]["bio"] = "bio"; } $step_data = validateStep($account_settings, 0, $_POST); $fields_to_update = array(); if (!$step_data["success"]) { if (empty($step_data["fields"])) { wp_send_json_error(array("error" => "no_step_data"), 300); } else { wp_send_json_error(array("errors" => $step_data["fields"]), 300); } wp_send_json_error(array("error" => "unknown"), 300); return; } wp_update_user(array("ID" => $user_id, "nickname" => $step_data["fields"]["nickname"], "user_nicename" => sanitize_title($step_data["fields"]["nickname"]), "display_name" => $profile_type === "personal" ? $step_data["fields"]["first_name"] . " " . $step_data["fields"]["last_name"] : $step_data["fields"]["company"])); if ($step_data["fields"]["avatar_changed"]) { if ($step_data["fields"]["avatar"]) { $attachment = wp_get_attachment_url(intval($step_data["fields"]["avatar"])); if ($attachment) { $fields_to_update["profile_picture"] = $attachment; } } elseif ($step_data["fields"]["avatar_default"]) { $fields_to_update["profile_picture"] = $step_data["fields"]["avatar_default"]; } } $fields_to_update["country"] = $step_data["fields"]["place"]["country"]; $fields_to_update["city"] = $step_data["fields"]["place"]["city"]; if ($profile_type === "personal") { $fields_to_update["first_name"] = $step_data["fields"]["first_name"]; $fields_to_update["last_name"] = $step_data["fields"]["last_name"]; } else { $fields_to_update["company"] = $step_data["fields"]["company"]; $fields_to_update["company_size"] = $step_data["fields"]["company_size"]; } if ($is_specialist) { $errors = array(); $languages = array(); $languages_array = $_POST["languages"]; foreach ($languages_array["name"] as $key => $name) { $languages[$key]["name"] = $name; } foreach ($languages_array["level"] as $key => $level) { $languages[$key]["level"] = $level; } foreach ($languages as $key => $language) { if (!$language["name"]) { $errors["languages[name][{$key}]"] = __("\xd0\xa6\xd0\265 \320\xbf\xd0\276\xd0\273\320\265 \xd0\xbe\320\xb1\320\xbe\xd0\262'\321\217\xd0\xb7\xd0\272\320\xbe\320\xb2\xd0\265", "errors"); } if (!$language["level"]) { $errors["languages[level][{$key}]"] = __("\xd0\xa6\320\265 \320\277\320\276\xd0\xbb\xd0\xb5 \xd0\276\320\261\320\xbe\320\xb2'\321\x8f\320\xb7\xd0\272\xd0\xbe\320\262\320\265", "errors"); } if (!in_array($language["name"], array_keys(include get_template_directory() . "/includes/language-list-en_US.php"))) { $errors["languages[name][{$key}]"] = __("\320\246\320\xb5 \320\277\xd0\276\xd0\xbb\320\265 \xd1\224 \xd0\275\320\xb5\xd0\264\xd1\226\320\xb9\xd1\x81\xd0\xbd\320\xb8\xd0\274", "errors"); } if (!in_array($language["level"], array("Native", "C2, Fluent", "C1, Advanced", "B2, Upper-Intermediate", "B1, Intermediate", "A2, Pre-Intermediate", "A1, Beginner"))) { $errors["languages[level][{$key}]"] = __("\320\xa6\xd0\265 \320\277\320\276\320\273\320\xb5 \xd1\x94 \xd0\275\320\xb5\320\264\321\226\xd0\xb9\321\x81\320\275\320\xb8\xd0\274", "errors"); } $has_value = array_filter($languages, function ($item) use($language) { return $item["name"] === $language["name"]; }); if (count($has_value) > 1) { $errors["languages[name][{$key}]"] = __("\320\xa6\321\217 \xd0\xbc\xd0\276\320\262\320\xb0 \320\xb2\xd0\xb6\320\265 \xd0\262\xd0\272\320\260\xd0\xb7\xd0\260\xd0\xbd\320\xb0", "errors"); } } if (!empty($errors)) { wp_send_json_error(array("errors" => $errors), 300); } $fields_to_update["languages"] = $languages; $fields_to_update["title"] = $step_data["fields"]["title"]; $fields_to_update["description"] = $step_data["fields"]["bio"]; } checkFieldsForRating($fields_to_update, $user_id); foreach ($fields_to_update as $field_key => $field_value) { update_user_meta($user_id, $field_key, $field_value); } wp_send_json_success(array("redirect_url" => "reload", "message" => array("icon" => "ico-success", "text" => __("\320\227\xd0\xbc\321\226\320\275\xd0\xb8 \320\267\320\261\xd0\265\xd1\200\320\265\320\266\xd0\xb5\320\xbd\xd0\xbe", "mural")))); }, false); goto t9oMq; pnz8I: function remove_user_portfolio($user_id, $work_id) { $portfolio_data = get_user_meta($user_id, "portfolio_data", true) ?: array(); $new_portfolio_data = array(); foreach ($portfolio_data as $item_id => $data) { if ((int) $item_id !== (int) $work_id) { $new_portfolio_data[$item_id] = $data; } } update_user_meta($user_id, "portfolio_data", $new_portfolio_data); } goto b1BUy; qlb1i: createAjaxAction("remove_account", function () { check_ajax_referer("remove_account_nonce", "security"); $user_id = get_current_user_id(); if (!$user_id || !get_user_meta($user_id, "is_active", true)) { wp_send_json_error(array("error" => "no_access"), 300); } $user = get_userdata(get_current_user_id()); if (in_array("administrator", $user->roles)) { wp_send_json_error(array("error" => "is_admin"), 300); } wp_delete_user($user_id); if (get_userdata($user_id)) { wp_send_json_error(array("error" => "cant_delete_" . $user_id), 300); } wp_send_json_success(array("redirect_url" => "/")); }, false); ?>
Did this file decode correctly?
Original Code
<?php
goto xWXEQ; xWXEQ: function get_user_contacts($user_id) { $contacts = array(); $this_user_data = is_array($user_id) ? $user_id : get_user_data($user_id); if ($this_user_data["\x74\x65\154\x65\147\x72\141\155"]) { $contacts["\164\145\154\145\x67\162\141\155"] = array("\x6c\x69\x6e\x6b" => "\x68\164\x74\x70\163\72\57\57\164\56\155\x65\57" . str_replace("\x40", '', $this_user_data["\x74\x65\x6c\145\147\162\x61\x6d"]), "\157\x72\x64\145\162" => $this_user_data["\164\x65\x6c\145\147\162\x61\x6d\x5f\160\162\x69\x6f\162\151\164\171"]); } if ($this_user_data["\x65\155\x61\151\154"] || $this_user_data["\145\x6d\x61\151\x6c\137\143\157\156\164\x61\143\164"]) { $contacts["\155\x61\x69\x6c"] = array("\x6c\x69\x6e\x6b" => "\155\141\151\154\x74\157\72" . ($this_user_data["\x65\x6d\141\x69\154\137\x63\157\156\x74\141\143\164"] ?: $this_user_data["\x65\x6d\x61\151\154"]), "\x6f\x72\144\145\x72" => $this_user_data["\155\141\x69\154\x5f\160\162\151\x6f\162\151\x74\171"]); } if ($this_user_data["\x70\x68\157\156\x65"]) { $contacts["\160\x68\x6f\156\145"] = array("\154\151\156\x6b" => "\164\x65\154\x3a" . $this_user_data["\x70\x68\x6f\x6e\145"], "\157\x72\144\145\x72" => $this_user_data["\x70\x68\157\x6e\145\x5f\160\x72\x69\157\162\151\x74\x79"]); } return $contacts; } goto ew_Fv; KEWi8: createAjaxAction("\141\x63\x63\x6f\x75\156\164\x5f\163\x65\x74\x74\x69\156\x67\x73\x5f\163\145\143\x75\x72\151\x74\x79", function () { check_ajax_referer("\141\143\x63\157\165\x6e\x74\x5f\163\x65\x74\164\151\156\x67\x73\x5f\163\x65\143\165\x72\x69\164\171\137\156\x6f\x6e\x63\145", "\x73\x65\143\165\162\x69\x74\x79"); $user_id = get_current_user_id(); if (!isset($_POST["\x70\141\x73\x73\x77\157\162\144\x2d\157\154\144"])) { wp_send_json_error(array("\x65\x72\162\x6f\162\163" => array("\160\141\163\x73\x77\157\162\144\55\x6f\154\144" => __("\xd0\276\320\xb1\xd0\xbe\320\xb2\x27\321\x8f\320\267\320\xba\320\xbe\320\262\320\xb5\x20\320\264\320\xbb\321\217\40\xd0\267\xd0\xb0\320\277\xd0\276\320\262\320\xbd\320\xb5\xd0\275\320\275\321\217", "\x65\x72\162\157\x72\x73"))), 300); } if (!isset($_POST["\x70\x61\x73\x73\167\x6f\162\x64"])) { wp_send_json_error(array("\145\162\x72\x6f\x72\163" => array("\x70\x61\x73\163\x77\157\162\x64" => __("\xd0\276\xd0\261\xd0\276\xd0\xb2\47\xd1\217\xd0\xb7\320\272\xd0\xbe\xd0\262\320\xb5\40\xd0\264\320\xbb\321\x8f\40\xd0\267\320\260\xd0\277\xd0\xbe\xd0\262\320\275\xd0\265\xd0\275\xd0\275\xd1\217", "\145\162\162\x6f\162\163"))), 300); } if (!isset($_POST["\x70\x61\x73\x73\167\x6f\162\144\55\x72\145\160\145\x61\164"])) { wp_send_json_error(array("\145\162\162\157\x72\163" => array("\160\x61\x73\163\x77\157\162\x64\55\162\x65\x70\x65\x61\x74" => __("\xd0\276\320\xb1\xd0\276\xd0\xb2\47\321\x8f\320\267\xd0\xba\320\xbe\320\xb2\320\xb5\x20\320\xb4\xd0\xbb\xd1\217\x20\xd0\xb7\xd0\260\320\277\xd0\xbe\320\xb2\320\xbd\320\265\320\275\xd0\275\321\217", "\x65\162\162\x6f\162\163"))), 300); } $user = get_userdata($user_id); $password_old = $_POST["\x70\x61\163\x73\x77\157\162\x64\55\157\154\x64"]; $password = $_POST["\160\141\x73\163\x77\157\x72\x64"]; $password_repeat = $_POST["\x70\x61\x73\163\x77\x6f\162\144\x2d\162\145\x70\145\x61\x74"]; if (!wp_check_password($password_old, $user->user_pass, $user_id)) { wp_send_json_error(array("\145\x72\162\157\162\163" => array("\160\x61\x73\163\167\x6f\162\144\55\157\154\144" => __("\xd0\x9d\320\265\xd0\xbf\xd1\x80\320\260\xd0\xb2\320\xb8\xd0\273\xd1\x8c\xd0\xbd\320\xb8\320\xb9\40\320\xbf\320\260\xd1\200\320\xbe\320\273\321\x8c", "\145\x72\x72\157\x72\163"))), 300); } if (!validatePassword($password)) { wp_send_json_error(array("\145\162\162\157\162\163" => array("\160\141\x73\x73\167\x6f\x72\144" => __("\xd0\237\320\xb0\321\200\xd0\xbe\xd0\xbb\xd1\214\x20\xd0\277\320\xbe\xd0\xb2\xd0\xb8\320\xbd\xd0\xb5\320\275\x20\320\xbc\xd1\226\321\x81\xd1\202\320\270\321\202\xd0\xb8\40\321\206\320\270\xd1\x84\xd1\200\320\xb8\40\321\x82\320\xb0\x20\xd0\273\xd0\xb0\xd1\x82\xd0\xb8\xd0\xbd\321\x81\xd1\214\320\xba\321\x96\40\320\xbb\xd1\x96\321\202\320\265\321\x80\320\xb8", "\145\162\162\x6f\x72\x73"))), 300); } if ($password !== $password_repeat) { wp_send_json_error(array("\145\x72\162\157\162\x73" => array("\160\141\163\x73\x77\157\x72\x64\55\162\x65\160\x65\x61\x74" => __("\320\x9f\xd0\260\321\x80\320\xbe\xd0\xbb\321\226\40\320\275\320\xb5\x20\320\267\xd0\xb1\xd1\x96\320\263\xd0\260\321\x8e\321\x82\xd1\x8c\321\x81\xd1\x8f", "\145\x72\162\x6f\162\163"))), 300); } reset_password($user, $password); $creds = array("\165\163\145\162\137\154\x6f\147\x69\x6e" => $user->user_login, "\x75\163\x65\162\137\160\141\x73\x73\167\x6f\x72\x64" => $password, "\x72\x65\155\x65\155\142\145\x72" => true); $logged_in_user = wp_signon($creds, false); if (is_wp_error($logged_in_user)) { wp_send_json_success(array("\x72\145\144\151\162\x65\x63\164\x5f\x75\x72\154" => "\x2f\154\x6f\x67\x69\x6e")); } wp_set_current_user($logged_in_user->ID); date_default_timezone_set("\x45\x75\x72\x6f\160\x65\57\113\x69\x65\166"); update_user_meta($logged_in_user->ID, "\x70\141\x73\x73\167\x6f\162\x64\137\154\x61\163\164\x5f\143\150\141\156\x67\145\144", date("\x64\x2e\x6d\56\131")); wp_send_json_success(array("\x72\x65\x64\x69\162\x65\143\x74\137\165\x72\154" => "\162\145\x6c\157\141\144", "\x6d\145\163\163\x61\x67\145" => array("\151\x63\157\x6e" => "\151\143\157\55\163\165\x63\x63\145\x73\163", "\x74\145\x78\x74" => __("\xd0\227\320\xbc\321\226\xd0\275\320\270\x20\xd0\267\320\261\xd0\265\xd1\200\xd0\265\xd0\xb6\xd0\265\xd0\275\xd0\xbe", "\155\165\162\x61\x6c")))); }, false); goto qlb1i; t9oMq: createAjaxAction("\x61\143\143\157\x75\156\x74\137\163\x65\164\164\x69\156\x67\x73\x5f\163\x70\145\x63\151\x61\x6c\151\x7a\141\x74\151\x6f\156", function () { check_ajax_referer("\x61\143\x63\157\x75\x6e\x74\137\163\145\164\x74\x69\156\x67\163\137\x73\160\x65\x63\x69\141\x6c\151\172\x61\x74\x69\x6f\x6e\137\156\x6f\156\x63\145", "\x73\145\143\165\x72\151\x74\x79"); $user_id = get_current_user_id(); $errors = array(); $specializations = array(); $specializations_array = $_POST["\163\160\x65\143\x69\141\x6c\x69\x7a\x61\x74\x69\157\156"]; foreach ($specializations_array["\151\144"] as $key => $id) { $specializations[$key]["\151\x64"] = (int) $id; } foreach ($specializations_array["\x65\x78\x70\x65\162\x69\145\156\x63\145"] as $key => $level) { $specializations[$key]["\145\x78\160\x65\x72\x69\x65\x6e\143\145"] = (double) $level; } foreach ($specializations_array["\x70\x72\x69\x6f\162\151\164\171"] as $key => $level) { $specializations[$key]["\160\162\151\157\x72\151\164\x79"] = (int) $level; } foreach ($specializations as $key => $specialization) { if (!$specialization["\x69\144"]) { $errors["\163\x70\x65\x63\151\x61\154\151\x7a\x61\164\151\x6f\156\133\151\144\x5d\x5b{$key}\x5d"] = __("\xd0\246\xd0\xb5\x20\xd0\xbf\xd0\xbe\320\273\xd0\xb5\x20\xd0\xbe\xd0\261\xd0\xbe\320\xb2\x27\321\x8f\xd0\267\xd0\272\320\xbe\xd0\xb2\xd0\xb5", "\145\x72\x72\157\162\163"); } if (!term_exists($specialization["\151\144"], "\x73\160\x65\143\151\x61\154\x69\x7a\x61\164\151\x6f\x6e")) { $errors["\x73\x70\x65\143\151\141\x6c\x69\x7a\141\164\151\x6f\156\133\151\144\x5d\x5b{$key}\135"] = __("\320\xa6\xd0\265\x20\320\277\320\276\320\xbb\xd0\265\40\xd1\224\x20\xd0\xbd\xd0\xb5\xd0\264\xd1\x96\xd0\271\321\201\320\xbd\320\xb8\320\274", "\x65\x72\162\157\x72\x73"); } if ($specialization["\145\x78\160\x65\x72\x69\x65\156\143\145"] < 0) { $errors["\x73\x70\145\143\151\141\x6c\x69\172\x61\164\151\157\156\133\145\x78\160\x65\162\x69\145\156\143\x65\135\133{$key}\x5d"] = __("\xd0\246\xd0\xb5\40\320\xbf\xd0\276\xd0\xbb\320\xb5\x20\xd1\x94\x20\320\275\320\265\xd0\264\321\226\320\xb9\xd1\x81\xd0\xbd\320\270\320\274", "\x65\162\x72\x6f\162\163"); } if ($specialization["\160\x72\x69\x6f\x72\151\164\x79"] && ($specialization["\x70\x72\x69\157\162\x69\164\171"] < 1 || $specialization["\160\162\151\157\162\x69\164\171"] > count($specializations))) { $errors["\x73\160\145\143\x69\x61\154\x69\172\x61\x74\x69\x6f\156\x5b\160\x72\x69\x6f\x72\151\x74\171\135\133{$key}\135"] = __("\320\246\320\265\x20\xd0\xbf\320\xbe\xd0\xbb\320\265\x20\321\224\x20\320\275\xd0\265\xd0\xb4\xd1\226\320\xb9\xd1\x81\320\xbd\320\270\320\xbc", "\x65\x72\x72\157\162\163"); } if ($specialization["\160\162\x69\x6f\x72\x69\x74\171"] === 0) { $specialization["\x70\x72\151\x6f\x72\x69\x74\x79"] = ''; } $has_value = array_filter($specializations, function ($item) use($specialization) { return $item["\x69\x64"] == $specialization["\151\x64"]; }); if (count($has_value) > 1) { $errors["\163\x70\x65\143\151\141\154\x69\x7a\141\164\151\157\x6e\x5b\151\144\x5d\x5b{$key}\x5d"] = __("\320\xa6\xd0\265\320\271\40\321\204\xd0\260\xd1\205\40\320\xb2\320\xb6\xd0\265\40\xd0\xb2\xd0\272\xd0\260\320\xb7\320\xb0\xd0\xbd\xd0\270\xd0\xb9", "\x65\x72\162\x6f\x72\x73"); } $has_value = array_filter($specializations, function ($item) use($specialization) { return $item["\x70\x72\151\x6f\162\151\164\x79"] === $specialization["\x70\162\x69\157\162\151\164\171"]; }); if (count($has_value) > 1) { $errors["\163\x70\x65\143\151\141\x6c\151\x7a\x61\164\x69\157\156\x5b\x70\162\151\x6f\162\151\x74\x79\135\x5b{$key}\135"] = ''; } } if (!empty($errors)) { wp_send_json_error(array("\145\162\162\x6f\x72\x73" => $errors), 300); } if (count($specializations) < 1) { wp_send_json_error(array("\145\162\162\157\x72" => "\156\x6f\x5f\163\160\x65\x63\x69\141\154\x69\x7a\141\x74\151\157\x6e\x73"), 300); } update_user_meta($user_id, "\x73\x70\x65\143\151\141\x6c\x69\172\141\x74\151\157\x6e\x73", $specializations); wp_send_json_success(array("\162\x65\x64\x69\162\145\x63\x74\x5f\165\162\x6c" => "\162\x65\154\157\141\x64", "\155\x65\x73\x73\141\147\145" => array("\x69\143\x6f\x6e" => "\x69\143\x6f\55\163\165\143\x63\x65\163\163", "\164\x65\170\x74" => __("\xd0\x97\320\xbc\321\x96\320\275\xd0\270\40\320\267\320\xb1\320\265\321\x80\xd0\265\xd0\xb6\xd0\xb5\xd0\275\320\276", "\155\x75\x72\141\x6c")))); }, false); goto x4mUz; ovlKg: add_action("\x77\160\x5f\x61\152\x61\x78\x5f\x75\x70\144\x61\164\x65\x5f\x76\145\162\x69\x66\x69\143\x61\x74\x69\x6f\x6e\137\155\145\x74\141", function () { if (!current_user_can("\x65\x64\x69\164\137\160\157\x73\164", $_POST["\x70\x6f\163\x74\137\151\x64"])) { wp_send_json_error(__("\xd0\243\40\320\262\xd0\xb0\321\201\40\xd0\xbd\xd0\265\320\xbc\320\260\xd1\x94\40\xd0\xbf\321\200\320\260\xd0\xb2\x20\321\200\xd0\xb5\320\264\xd0\xb0\320\xb3\xd1\x83\xd0\262\320\260\321\202\xd0\270\x20\xd1\x86\xd0\265\320\xb9\40\xd0\277\xd0\276\321\x81\xd1\202\56", "\x74\x65\x78\x74\144\x6f\x6d\141\151\156")); } $post_id = intval($_POST["\160\x6f\x73\164\x5f\x69\x64"]); $meta_value = sanitize_text_field($_POST["\x6d\x65\x74\141\x5f\x76\141\x6c\165\x65"]); if (update_post_meta($post_id, "\162\145\x61\163\x6f\x6e", $meta_value)) { wp_send_json_success(__("\320\x9c\320\xb5\321\202\320\260\55\320\xb4\320\xb0\xd0\275\321\226\40\321\x83\xd1\201\xd0\xbf\xd1\226\xd1\x88\320\xbd\320\xbe\x20\xd0\xbe\xd0\xbd\xd0\xbe\320\xb2\320\xbb\320\265\xd0\xbd\320\xbe\x2e", "\164\145\170\164\x64\157\x6d\141\151\x6e")); } else { wp_send_json_error(__("\xd0\235\320\xb5\x20\320\xb2\xd0\xb4\320\260\320\xbb\320\xbe\xd1\x81\xd1\x8f\x20\320\276\320\xbd\320\276\xd0\xb2\xd0\xb8\xd1\x82\320\xb8\x20\320\xbc\xd0\265\xd1\x82\xd0\260\55\xd0\264\xd0\260\320\xbd\xd1\226\56", "\x74\x65\x78\164\x64\x6f\x6d\141\151\156")); } }); goto K1Mr9; ew_Fv: function get_user_contacts_json($user_id) { $array = get_user_contacts($user_id); uasort($array, function ($a, $b) { return $a["\157\162\144\145\162"] <=> $b["\x6f\x72\x64\145\162"]; }); $result = array(); foreach ($array as $key => $value) { $result[$key] = $value["\154\151\156\153"]; } return _wp_specialchars(json_encode($result, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES), ENT_QUOTES, "\x55\124\x46\x2d\70", true); } goto vzjq8; K05RQ: createAjaxAction("\167\x6f\x72\x6b\x5f\x76\x69\145\167", function () { $post_id = intval(preg_replace("\57\x5c\x44\57", '', $_POST["\x69\144"] ?? '')); $result = add_work_view($post_id); if ($result["\143\157\x64\145"] === 200) { wp_send_json_success($result["\x64\x61\x74\x61"]); } else { wp_send_json_error($result["\x64\141\164\141"], $result["\x63\157\x64\x65"]); } }); goto Ohvhz; dibc8: function cleanup_expired_views(&$views_array) { $current_time = current_time("\164\151\x6d\x65\163\164\141\155\160"); $one_hour_ago = $current_time - HOUR_IN_SECONDS * 24; foreach ($views_array as $post_id => $view_time) { if ($view_time <= $one_hour_ago) { unset($views_array[$post_id]); } } } goto O2pV7; g5bdl: add_action("\164\145\155\x70\x6c\141\x74\145\x5f\x72\x65\x64\151\x72\x65\143\164", function () { global $wp; if (get_query_var("\154\x6f\147\157\x75\x74") == 1) { wp_logout(); wp_redirect(home_url()); die; } if (strpos($wp->request, "\141\57") === 0) { $nickname = explode("\x2f", str_replace("\141\57", '', $wp->request)); if (!empty($nickname) && get_user_by("\x73\154\165\x67", $nickname[0])) { $nickname = $nickname[0]; $is_visitor = true; include get_template_directory() . "\57\141\x63\x63\x6f\165\156\x74\55\160\141\x67\145\x2e\x70\x68\160"; die; } else { wp_redirect(home_url("\57\64\60\x34")); die; } } }); goto haK0Z; K1Mr9: add_action("\x74\162\x61\156\x73\x69\164\151\157\156\137\160\157\163\164\137\163\164\x61\x74\165\163", "\x68\x61\x6e\x64\x6c\x65\x5f\166\145\162\151\146\x69\x63\x61\164\151\x6f\x6e\x5f\x70\x6f\x73\x74\137\163\164\x61\164\x75\163\137\143\150\x61\156\x67\x65", 10, 3); goto myjrv; KSt1F: createAjaxAction("\143\x68\x65\143\x6b\x5f\x6e\x69\x63\x6b\x6e\x61\x6d\x65", function () { $nickname = preg_replace("\x2f\133\x5e\141\x2d\172\x41\x2d\x5a\x30\55\71\x2d\135\x2f", '', $_POST["\156\x69\x63\153\x6e\x61\x6d\x65"] ?: '') ?: false; $user_id = get_current_user_id(); if (!$nickname || !$user_id) { die; } $user = get_userdata($user_id); if (!$user) { die; } if ($nickname === $user->nickname) { wp_send_json_success(array("\x65\170\x69\x73\164\163" => false)); } $user_exists = get_users(array("\x73\145\141\162\143\150" => $nickname, "\x73\145\141\x72\143\x68\x5f\x63\157\x6c\165\155\x6e\163" => array("\x6e\x69\x63\153\x6e\141\155\145"))); wp_send_json_success(array("\145\x78\151\x73\164\x73" => !empty($user_exists))); }, false); goto Gsi6L; O2pV7: function add_work_view($post_id) { if (!$post_id || !get_post_status($post_id)) { return array("\x65\x72\162\157\162" => "\x6e\x6f\137\160\x6f\x73\x74\137\151\x64", "\x73\x74\141\x74\165\x73" => 300); } $current_time = current_time("\x74\x69\155\x65\163\164\x61\155\x70"); $one_hour_ago = $current_time - HOUR_IN_SECONDS * 24; $user_id = get_current_user_id(); if ($user_id) { $views_array = get_user_meta($user_id, "\154\141\x73\164\x5f\166\x69\145\x77\145\144\137\x70\x6f\163\164\x73", true); if (!is_array($views_array)) { $views_array = array(); } cleanup_expired_views($views_array); if (isset($views_array[$post_id]) && $views_array[$post_id] > $one_hour_ago) { return array("\x65\x72\x72\157\x72" => "\141\154\162\145\x61\x64\171\x5f\x76\151\145\x77\x65\144", "\x73\x74\x61\164\x75\163" => 300); } $views_array[$post_id] = $current_time; update_user_meta($user_id, "\154\x61\163\164\137\166\x69\x65\x77\x65\144\137\160\x6f\x73\x74\x73", $views_array); } else { if (!isset($_SESSION["\160\x6f\163\164\137\x76\151\x65\167\x73"])) { $_SESSION["\160\x6f\x73\164\137\x76\151\x65\x77\x73"] = array(); } cleanup_expired_views($_SESSION["\x70\x6f\x73\x74\137\x76\x69\145\x77\163"]); if (isset($_SESSION["\x70\157\x73\x74\x5f\x76\x69\145\167\163"][$post_id]) && $_SESSION["\160\x6f\x73\x74\x5f\166\151\145\167\163"][$post_id] > $one_hour_ago) { return array("\x65\162\162\157\162" => "\x61\x6c\162\145\141\144\x79\x5f\x76\151\145\x77\145\x64", "\163\164\141\164\165\x73" => 300); } $_SESSION["\160\157\x73\164\137\166\151\x65\x77\x73"][$post_id] = $current_time; } $authors_ids = array_keys(get_post_meta($post_id, "\x61\x75\x74\150\x6f\x72\163\137\x64\x61\164\x61", true)); $new_views = WorkRating::add_view($post_id); foreach ($authors_ids as $author_id) { UserRating::add_view($author_id); } return array("\166\151\145\167\163" => $new_views, "\x73\x74\141\x74\x75\x73" => 200); } goto K05RQ; haK0Z: add_filter("\141\x75\x74\x68\x6f\162\x5f\x6c\151\x6e\153", function ($link, $author_id, $author_nicename) { return home_url("\57\x61\x2f" . $author_nicename . "\57"); }, 10, 3); goto Q3vw1; uLJL3: function handle_post_trashed($post_id) { $post = get_post($post_id); if ($post && $post->post_type === "\x76\x65\x72\151\x66\151\x63\141\x74\151\157\x6e" && $post->post_status === "\160\x65\156\144\x69\x6e\147") { $author_id = $post->post_author; $previously_failed = get_user_meta($author_id, "\x76\x65\162\151\146\x69\x63\141\x74\x69\x6f\x6e\x5f\146\x61\151\154\145\144", true) ?: array(); $post_url = get_field("\x75\162\x6c", $post_id); $reason = get_post_meta($post_id, "\162\x65\x61\x73\157\156", true); if (!$post_url) { $post_url = get_field("\165\x72\x6c", get_post(get_field("\145\x78\x69\x73\x74\151\x6e\x67\x5f\167\x6f\x72\x6b", $post_id))->ID); } $previously_failed[] = array("\x75\x72\154" => $post_url, "\x64\141\164\145" => time(), "\162\145\x61\x73\157\156" => $reason); update_user_meta($author_id, "\156\145\167\x5f\x76\145\x72\151\x66\x69\143\x61\x74\151\x6f\156\137\x66\141\151\x6c\x65\x64", true); update_user_meta($author_id, "\166\x65\x72\x69\x66\151\x63\x61\164\151\157\156\137\146\x61\x69\x6c\x65\x64", $previously_failed); UserBalance::add_to_user_balance($author_id, 1); delete_post_without_trash_hook($post_id); die; } } goto Gsxvw; vzjq8: function get_user_rating($user_id) { if (is_array($user_id)) { $this_user_data = $user_id; $user_id = $this_user_data["\x69\144"]; } else { $this_user_data = get_user_data($user_id); } $rating = array("\x75\x73\145\x72" => array("\x75\x72\154" => get_author_posts_url($user_id), "\x61\x76\141\x74\141\162" => $this_user_data["\141\x76\141\x74\141\x72"], "\x6e\141\155\145" => $this_user_data["\x6e\141\x6d\145"], "\x74\171\x70\145" => $this_user_data["\x74\x79\x70\145"] === "\160\145\x72\x73\x6f\156\x61\x6c" ? __("\xd0\244\xd1\x80\xd1\226\320\273\xd0\xb0\320\275\321\x81", "\155\x75\162\141\154") : __("\320\x90\320\xb3\xd0\xb5\xd0\275\xd1\206\xd1\226\xd1\x8f", "\x6d\x75\162\141\x6c"), "\154\x6f\143\x61\x74\x69\x6f\x6e" => $this_user_data["\x63\157\165\x6e\164\x72\171"] || $this_user_data["\x63\151\164\171"] ? ($this_user_data["\143\x69\x74\x79"] ?: '') . ($this_user_data["\x63\x6f\x75\156\x74\x72\x79"] && $this_user_data["\x63\x69\164\x79"] ? "\54\x20" : '') . ($this_user_data["\x63\157\x75\156\164\x72\x79"] ?: '') : ''), "\x61\154\x6c" => array("\166\x69\145\167\163\x5f\143\x6f\x75\x6e\x74" => $this_user_data["\162\x61\164\151\156\147\x5f\x63\157\165\156\x74\137\166\x69\145\167\x73"], "\x76\151\x65\167\163\137\162\x61\164\151\x6e\147" => $this_user_data["\162\141\x74\151\x6e\x67\x5f\x63\157\x75\x6e\164\x5f\x76\151\x65\x77\163"] * UserRating::$views_weight, "\x66\x61\166\x6f\x72\151\164\145\163\137\x63\157\165\156\x74" => $this_user_data["\x72\x61\164\x69\156\x67\137\143\x6f\x75\x6e\x74\x5f\x66\141\166\x6f\x72\x69\164\145\x73"], "\x66\x61\166\x6f\162\151\164\x65\163\137\162\141\164\x69\156\x67" => $this_user_data["\x72\x61\x74\x69\156\x67\137\143\157\x75\x6e\x74\x5f\146\x61\x76\x6f\x72\x69\x74\145\x73"] * UserRating::$favorites_weight, "\146\151\x6c\x6c\x5f\143\x6f\x75\x6e\164" => $this_user_data["\x72\141\x74\151\156\x67\x5f\143\x6f\165\x6e\164\x5f\x66\x69\x6c\154"], "\146\x69\154\x6c\137\x72\x61\x74\x69\x6e\x67" => $this_user_data["\162\141\164\x69\x6e\147\x5f\143\x6f\165\156\164\x5f\x66\151\x6c\154"] * UserRating::$fill_weight, "\157\156\x6c\151\x6e\145\137\x63\x6f\x75\156\x74" => $this_user_data["\x72\141\164\x69\x6e\x67\137\143\157\x75\156\164\x5f\x6f\x6e\x6c\x69\x6e\x65"], "\157\156\154\x69\x6e\x65\137\162\141\164\151\156\x67" => $this_user_data["\x72\x61\164\151\x6e\x67\x5f\x63\x6f\165\156\164\x5f\x6f\156\x6c\151\x6e\x65"] * UserRating::$online_weight, "\160\x6f\162\164\x66\x6f\x6c\x69\157\x5f\143\157\x75\x6e\164" => $this_user_data["\x72\141\x74\151\x6e\x67\x5f\x63\157\x75\x6e\x74\x5f\160\157\162\x74\x66\x6f\154\x69\157"], "\160\x6f\162\164\146\x6f\154\x69\x6f\137\162\141\164\x69\156\147" => $this_user_data["\x72\141\x74\x69\156\x67\137\x63\x6f\165\156\164\137\160\x6f\x72\164\146\x6f\154\x69\x6f"] * UserRating::$portfolio_weight, "\164\157\164\141\154\137\162\x61\164\x69\x6e\147" => $this_user_data["\x74\x6f\164\141\x6c\x5f\162\141\164\x69\x6e\x67"])); $rating["\x33\55\x6d\x6f\x6e\x74\150"] = UserRating::get_rating_for_user($user_id, "\x33\55\155\157\156\164\x68"); $rating["\66\x2d\x6d\157\156\164\150"] = UserRating::get_rating_for_user($user_id, "\x36\x2d\155\157\156\164\x68"); $rating_updated = get_user_meta($user_id, "\x72\141\164\x69\x6e\147\137\x75\x70\144\x61\x74\145\144", true); $currentDate = date("\x59\55\155\x2d\x64"); $dateToFormat = date("\131\x2d\x6d\55\x64", $rating_updated); if ($currentDate === $dateToFormat) { $rating["\162\x61\164\x69\156\147\x5f\x75\160\x64\141\x74\145\144"] = date("\110\72\x69", $rating_updated) . "\54\40" . __("\321\201\321\214\xd0\276\320\xb3\320\276\xd0\xb4\320\275\321\x96", "\x6d\165\162\x61\154"); } $rating["\162\x61\164\151\x6e\147\x5f\x75\x70\144\x61\x74\145\144"] = date("\x48\72\151", $rating_updated) . "\54\x20" . date("\144\56\155\x2e\131", $rating_updated); return $rating; } goto tthpI; Gsi6L: function checkFieldsForRating($fields, $user_id) { $rated_fields = UserRating::$fill_fields; foreach ($fields as $field_name => $field_value) { if (in_array($field_name, $rated_fields)) { $prev_value = get_user_meta($user_id, $field_name === "\x62\x69\x6f" ? "\144\x65\163\x63\162\x69\x70\x74\151\x6f\x6e" : $field_name, true); $has_prev_value = is_array($prev_value) ? !empty($prev_value) : !!trim($prev_value); $has_new_value = is_array($field_value) ? !empty($field_value) : !!trim($field_value); if (!$has_prev_value && $has_new_value) { UserRating::add_fill($user_id); } elseif ($has_prev_value && !$has_new_value) { UserRating::remove_fill($user_id); } } } } goto kaE5P; fYZQy: function delete_post_with_attachments($post_id) { if (get_post($post_id)) { $attachments = get_children(array("\x70\x6f\x73\164\137\160\x61\x72\x65\156\x74" => $post_id, "\160\157\x73\164\x5f\x74\171\160\145" => "\x61\164\164\x61\143\150\155\x65\x6e\164", "\x6e\165\155\x62\145\x72\160\157\x73\x74\163" => -1)); if (!empty($attachments)) { foreach ($attachments as $attachment) { wp_delete_attachment($attachment->ID, true); } } wp_delete_post($post_id, true); } else { return false; } return true; } goto FafAl; Gsxvw: function remove_notification($type) { $user_id = get_current_user_id(); switch ($type) { case "\166\x65\162\151\x66\151\x63\x61\x74\151\x6f\x6e\x5f\x66\x61\151\x6c\x65\x64": update_user_meta($user_id, "\x6e\145\x77\x5f\166\x65\x72\151\146\151\x63\141\164\x69\x6f\x6e\x5f\146\x61\x69\x6c\x65\144", false); break; case "\x76\x65\162\151\146\151\x63\141\x74\x69\157\156\137\x6f\x66\146\x65\162": update_user_meta($user_id, "\x6e\145\x77\x5f\166\145\162\151\146\x69\143\x61\x74\x69\157\156\137\157\x66\x66\145\x72", false); break; case "\156\145\x77\x5f\x70\x75\142\x6c\x69\x63\x61\164\x69\157\156": update_user_meta($user_id, "\156\145\167\x5f\x70\165\x62\154\151\143\x61\164\x69\157\x6e", false); break; } } goto r1AWx; myjrv: function delete_post_without_trash_hook($post_id) { global $wp_filter; if (isset($wp_filter["\x77\160\137\x74\x72\x61\x73\150\137\160\x6f\163\164"])) { $original_hooks = $wp_filter["\x77\x70\137\x74\x72\141\x73\150\137\x70\157\x73\x74"]; } else { $original_hooks = null; } remove_all_actions("\167\160\x5f\164\x72\141\x73\x68\x5f\x70\157\163\x74"); $result = delete_post_with_attachments($post_id); if ($original_hooks) { $wp_filter["\167\x70\137\x74\162\x61\163\150\x5f\x70\157\x73\164"] = $original_hooks; } wp_redirect(home_url("\57\x77\160\x2d\x61\x64\155\151\x6e\x2f\145\144\151\x74\x2e\160\x68\160\77\x70\157\x73\x74\x5f\164\171\160\x65\75\x76\x65\162\x69\146\151\x63\x61\164\151\x6f\x6e")); } goto fYZQy; A27lY: createAjaxAction("\x76\x65\x72\151\x66\151\143\x61\164\x69\x6f\156", function () { check_ajax_referer("\166\x65\x72\151\146\x69\x63\x61\164\x69\x6f\x6e\x5f\x6e\x6f\156\143\145", "\163\x65\x63\165\x72\x69\x74\x79"); $activate_steps = array(array("\141\x75\164\x68\x6f\x72\137\162\157\x6c\x65" => "\x72\x65\161\x75\x69\162\145\x64\x3a\141\165\x74\x68\157\x72\x5f\162\x6f\154\x65", "\167\157\162\153" => "\x72\145\161\165\151\162\x65\144\72\156\x75\x6d\142\x65\162", "\x73\x63\162\145\145\x6e\x73\x68\x6f\x74\x73" => "\x72\x65\161\x75\x69\162\145\144\x3a\x73\x63\162\145\x65\156\x73\x68\x6f\x74\163", "\x6c\151\156\x6b\145\144\x69\x6e" => "\x6c\151\156\x6b\145\x64\x69\x6e", "\145\166\x69\x64\x65\156\143\145\163" => "\x72\145\161\x75\151\x72\145\144\137\160\x72\x65\x76\x69\157\x75\x73\x5f\x65\166\151\x64\145\x6e\x63\145\x73\55\x3a\x73\143\162\145\x65\156\163\150\x6f\164\x73")); $user_id = get_current_user_id(); if (!$user_id) { wp_send_json_error(array("\145\x72\x72\x6f\162" => "\156\157\137\165\x73\x65\162\137\x69\144"), 300); } $user_data = get_user_data($user_id); if (!$user_data["\x69\163\x5f\x61\143\x74\x69\x76\145"]) { wp_send_json_error(array("\x65\162\162\x6f\x72" => "\x6e\157\164\137\141\x63\164\x69\x76\x65"), 300); return; } if ($user_data["\162\157\x6c\145"] === "\x63\165\x73\164\157\155\x65\x72") { wp_send_json_error(array("\145\162\162\157\x72" => "\x77\162\157\156\147\137\x72\157\154\145"), 300); return; } $step = 0; $step_data = validateStep($activate_steps, $step, $_POST); if (!$step_data["\x73\165\x63\143\145\163\163"]) { if (empty($step_data["\146\151\x65\154\144\x73"])) { wp_send_json_error(array("\x65\x72\x72\x6f\162" => "\156\x6f\137\163\x74\x65\x70\x5f\x64\x61\164\141\x5f\142\x79\137" . $step), 300); } else { wp_send_json_error(array("\x65\x72\x72\x6f\162\x73" => $step_data["\146\x69\145\154\x64\163"]), 300); } wp_send_json_error(array("\145\x72\162\157\162" => "\165\x6e\x6b\x6e\x6f\x77\x6e\x5f" . $step), 300); return; } function create_verification_id($user_id) { $new_post = array("\x70\x6f\x73\x74\x5f\164\x69\164\154\145" => '', "\x70\157\163\164\137\163\164\x61\x74\x75\163" => "\144\x72\x61\x66\164", "\x70\x6f\x73\x74\137\164\x79\x70\145" => "\x76\145\162\x69\x66\x69\143\141\x74\x69\x6f\x6e", "\x70\157\x73\x74\x5f\141\x75\164\x68\157\162" => $user_id); $post_id = wp_insert_post($new_post); if (is_wp_error($post_id)) { wp_send_json_error(array("\145\x72\162\157\x72" => "\x70\157\163\164\137\x66\141\151\154\145\x64"), 300); } return $post_id; } $work_id = $step_data["\x66\151\145\154\144\x73"]["\x77\x6f\162\x6b"]; $screenshots = $step_data["\146\151\x65\x6c\x64\163"]["\163\x63\x72\145\145\156\x73\x68\157\x74\x73"]; $linkedin = $step_data["\x66\x69\x65\x6c\x64\x73"]["\154\151\156\153\x65\x64\x69\x6e"]; $evidences = $step_data["\146\x69\145\x6c\x64\163"]["\x65\x76\151\144\x65\156\143\x65\163"]; $role = $step_data["\146\x69\x65\x6c\144\x73"]["\x61\x75\164\x68\x6f\x72\137\162\157\154\145"]; if (is_existing_on_verification($work_id)) { wp_send_json_error(array("\x65\x72\x72\x6f\162" => __("\320\246\321\217\x20\xd1\200\320\xbe\320\261\xd0\276\xd1\202\xd0\260\40\320\262\xd0\xb6\xd0\265\x20\320\xbd\xd0\xb0\x20\320\xb2\320\265\xd1\x80\xd0\270\321\204\xd1\x96\xd0\272\320\260\xd1\206\xd1\226\321\227")), 300); } $verification_id = create_verification_id($user_data["\x69\144"]); update_field("\x72\157\x6c\x65", $role, $verification_id); update_field("\x73\x63\162\x65\145\156\163\x68\157\164\163", $screenshots, $verification_id); update_field("\x6c\x69\x6e\x6b\145\144\x69\x6e", $linkedin, $verification_id); update_field("\145\x76\x69\x64\145\156\x63\x65\163", $evidences, $verification_id); update_field("\x65\x78\151\163\x74\x69\156\x67\x5f\x77\157\162\x6b", $work_id, $verification_id); if (!empty($screenshots)) { foreach ($screenshots as $screenshot_id) { wp_update_post(array("\111\x44" => $screenshot_id, "\160\157\x73\x74\x5f\x70\141\162\x65\156\x74" => $verification_id)); } } if (!empty($evidences)) { foreach ($evidences as $screenshot_id) { wp_update_post(array("\111\104" => $screenshot_id, "\160\157\163\x74\137\160\x61\x72\145\156\164" => $verification_id)); } } if (!UserBalance::deduct_user_balance($user_data["\151\x64"], 1)) { wp_send_json_error(array("\145\162\x72\157\x72" => __("\320\x9d\xd0\265\320\264\xd0\xbe\321\201\321\x82\320\xb0\321\x82\320\275\xd1\x8c\xd0\276\x20\320\272\xd0\276\xd1\x96\320\xbd\321\226\xd0\262")), 300); } update_user_meta($user_id, "\x6e\x65\x77\x5f\166\x65\162\151\146\151\143\141\164\151\x6f\156\137\157\x66\146\145\x72", true); wp_update_post(array("\x49\104" => $verification_id, "\x70\157\163\164\x5f\x73\164\141\164\165\163" => "\160\x65\156\144\x69\x6e\147", "\160\x6f\x73\164\137\164\151\164\154\145" => get_post($work_id)->post_title . "\40\55\x20" . $user_data["\x6e\141\x6d\145"])); wp_send_json_success(array("\x72\145\x64\151\162\x65\x63\164\x5f\165\162\154" => home_url("\x2f\141\x63\143\x6f\165\x6e\164"))); }); goto Vi1wE; r1AWx: createAjaxAction("\162\x65\x6d\x6f\166\x65\x5f\x6e\x6f\x74\x69\x66\x69\143\141\x74\151\x6f\x6e", function () { $type = $_POST["\164\x79\160\x65"] ?: ''; if (!is_user_logged_in()) { wp_send_json_error(array("\x65\162\x72\157\x72" => "\x6e\157\x74\137\x61\x6c\x6c\157\167\x65\144"), 300); } if (!$type) { wp_send_json_error(array("\x65\x72\x72\157\x72" => "\156\x6f\x5f\164\x79\x70\145"), 300); } remove_notification($type); wp_send_json_success(); }); goto dibc8; Q3vw1: createAjaxAction("\x6f\146\146\x65\x72", function () { check_ajax_referer("\x6f\146\x66\x65\162\x5f\x6e\x6f\156\x63\x65", "\x73\145\x63\x75\162\x69\x74\x79"); $activate_steps = array(array("\165\x72\154" => "\162\145\161\x75\x69\x72\x65\144\x3a\165\x72\x6c", "\141\165\164\150\x6f\x72\137\162\x6f\154\145" => "\162\x65\161\165\x69\x72\x65\144\x3a\x61\x75\164\x68\x6f\162\137\x72\157\x6c\x65"), array(array("\163\143\x72\145\x65\x6e\163\150\x6f\x74\x73" => "\162\145\161\165\151\x72\x65\x64\x5f\x70\x72\x65\166\x69\x6f\x75\x73\x5f\163\x63\x72\x65\x65\x6e\x73\150\157\x74\x73\55\x3a\163\x63\x72\145\x65\156\163\150\x6f\x74\163", "\160\x72\x65\x76\x69\x6f\x75\163\x5f\x73\x63\162\x65\x65\x6e\x73\x68\157\164\x73" => "\x70\162\145\x76\x69\x6f\x75\x73\x5f\163\x63\x72\x65\145\156\163\x68\157\164\163", "\154\x69\x6e\x6b\145\144\x69\x6e" => "\x6c\x69\156\x6b\145\144\151\156", "\145\166\151\x64\x65\156\x63\x65\163" => "\x73\143\162\x65\x65\156\163\x68\x6f\164\163", "\160\x72\145\x76\x69\157\x75\163\x5f\145\x76\151\144\145\156\x63\145\163" => "\x70\x72\x65\x76\151\157\x75\163\x5f\x73\143\162\145\145\156\163\150\x6f\x74\x73"), array("\x63\141\x74\x65\x67\x6f\162\x79" => "\x72\x65\161\x75\x69\162\x65\144\x3a\x63\x61\x74\x65\x67\x6f\x72\171", "\156\x69\x63\150\145" => "\x72\x65\161\x75\151\x72\145\x64\72\156\x69\143\150\x65")), array("\x73\143\162\x65\x65\156\163\x68\157\x74\x73" => "\162\145\x71\x75\x69\x72\145\144\137\160\162\145\166\x69\157\x75\163\x5f\x73\x63\x72\145\x65\x6e\163\150\157\x74\163\55\x3a\x73\143\162\145\x65\156\x73\150\x6f\164\x73", "\160\x72\x65\166\151\x6f\165\163\137\163\x63\162\145\x65\x6e\163\x68\x6f\x74\x73" => "\x70\x72\x65\166\151\x6f\165\163\137\x73\x63\x72\145\x65\156\163\x68\157\164\x73", "\154\151\156\153\x65\144\x69\x6e" => "\x6c\x69\x6e\153\145\144\151\156", "\x65\x76\x69\144\145\x6e\143\x65\x73" => "\162\145\x71\x75\x69\x72\x65\144\x5f\160\x72\x65\x76\x69\157\x75\x73\137\145\166\151\144\x65\156\143\145\x73\x2d\x3a\163\x63\162\145\145\156\x73\x68\x6f\164\x73", "\160\x72\145\166\x69\x6f\x75\x73\x5f\x65\x76\x69\144\x65\156\x63\145\163" => "\160\x72\145\x76\151\x6f\165\x73\x5f\163\x63\162\x65\x65\x6e\163\150\x6f\x74\x73")); $user_id = get_current_user_id(); if (!$user_id) { wp_send_json_error(array("\x65\162\x72\x6f\x72" => "\156\x6f\x5f\165\x73\145\x72\x5f\151\144"), 300); } $user_data = get_user_data($user_id); if (!$user_data["\151\163\x5f\141\143\x74\151\x76\x65"]) { wp_send_json_error(array("\145\x72\x72\157\162" => "\156\157\164\x5f\141\x63\164\x69\166\145"), 300); return; } if ($user_data["\x72\157\x6c\145"] === "\x63\x75\x73\x74\157\155\x65\x72") { wp_send_json_error(array("\x65\162\162\x6f\x72" => "\x77\162\157\x6e\147\137\x72\157\x6c\x65"), 300); return; } $step = isset($_POST["\x73\x74\145\x70"]) ? preg_replace("\57\72\x5c\x44\x2f", '', sanitize_text_field($_POST["\163\164\x65\x70"])) : false; if ($step === '' || $step === false) { wp_send_json_error(array("\x65\162\162\157\x72" => "\x6e\157\137\x73\164\145\x70\x5f\x66\x69\145\x6c\x64"), 300); return; } $step_data = validateStep($activate_steps, $step, $_POST); if (!$step_data["\x73\165\x63\x63\145\163\163"]) { if (empty($step_data["\146\x69\145\x6c\x64\163"])) { wp_send_json_error(array("\x65\162\162\157\162" => "\x6e\x6f\137\163\164\145\160\137\x64\x61\164\x61\x5f\142\x79\x5f" . $step), 300); } else { wp_send_json_error(array("\145\x72\162\x6f\162\163" => $step_data["\146\x69\x65\x6c\144\x73"]), 300); } wp_send_json_error(array("\145\x72\x72\x6f\162" => "\x75\x6e\x6b\156\157\167\x6e\137" . $step), 300); return; } $return_data = array(); function get_verification_id($user_id) { $draft_post = new WP_Query(array("\x61\x75\164\x68\x6f\162" => $user_id, "\160\157\163\164\x5f\164\x79\160\x65" => "\166\x65\x72\x69\146\x69\x63\x61\164\x69\x6f\x6e", "\160\157\x73\x74\x5f\x73\164\x61\164\165\x73" => "\x64\162\141\146\x74", "\x70\157\x73\x74\x73\137\x70\x65\x72\x5f\x70\x61\x67\145" => 1, "\x66\151\145\x6c\144\x73" => "\151\x64\x73")); if (!empty($draft_post->posts)) { return $draft_post->posts[0]; } else { return null; } } function create_verification_id($user_id) { $new_post = array("\x70\157\x73\x74\x5f\x74\151\x74\154\x65" => '', "\160\x6f\163\164\137\163\164\141\164\165\163" => "\144\162\141\146\x74", "\x70\x6f\163\x74\x5f\x74\171\x70\x65" => "\166\x65\x72\x69\146\x69\143\141\x74\151\x6f\156", "\160\x6f\163\x74\137\141\x75\x74\x68\x6f\x72" => $user_id); $post_id = wp_insert_post($new_post); if (is_wp_error($post_id)) { wp_send_json_error(array("\x65\162\x72\157\162" => "\x70\x6f\163\164\137\x66\x61\x69\154\x65\x64"), 300); } return $post_id; } function is_existing_work($url) { global $wpdb; $like_query = "\45" . $wpdb->esc_like($url) . "\45"; $query = $wpdb->prepare("\xa\x20\x20\x20\40\40\40\40\x20\40\40\40\40\x20\x20\40\x20\123\105\114\105\103\x54\40\x70\x2e\x49\x44\x20\x46\x52\117\x4d\x20{$wpdb->posts}\x20\x70\12\x20\40\40\40\x20\40\x20\x20\x20\x20\x20\40\x20\x20\x20\x20\x49\116\x4e\105\122\40\112\x4f\x49\x4e\40{$wpdb->postmeta}\40\160\x6d\x20\117\116\x20\160\56\x49\x44\40\75\40\x70\x6d\56\x70\157\163\x74\137\151\x64\xa\40\x20\40\x20\40\40\40\40\x20\x20\40\40\x20\40\40\40\127\x48\105\122\x45\40\160\56\160\157\x73\164\x5f\164\171\160\145\x20\75\x20\x27\167\x6f\x72\x6b\163\47\12\40\40\40\40\40\x20\x20\40\40\40\x20\x20\x20\x20\x20\x20\x41\x4e\104\x20\50\xa\40\x20\x20\x20\x20\40\40\40\x20\x20\40\40\40\40\x20\40\40\40\40\x20\x70\56\160\157\x73\x74\137\x73\x74\141\x74\x75\163\40\x3d\40\x27\x70\165\142\154\151\163\x68\x27\40\x4f\x52\12\40\40\40\x20\x20\x20\x20\40\40\40\40\x20\40\x20\x20\40\40\40\40\x20\x70\x2e\x70\157\163\164\x5f\163\164\x61\x74\165\x73\x20\x3d\40\47\x66\x75\x74\165\x72\x65\x27\x20\x4f\122\12\x20\40\x20\x20\x20\40\40\x20\x20\40\40\40\x20\40\x20\x20\x20\40\40\40\160\56\x70\x6f\x73\164\x5f\163\164\x61\x74\x75\x73\40\75\40\x27\x70\145\x6e\144\x69\156\147\47\12\40\40\x20\40\40\40\x20\x20\40\x20\x20\x20\x20\x20\40\x20\x29\12\40\x20\40\40\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\101\x4e\104\40\x28\12\40\40\40\x20\40\40\x20\40\x20\x20\40\40\x20\40\x20\40\40\x20\x20\x20\x28\x70\155\x2e\x6d\x65\164\x61\x5f\153\x65\x79\x20\75\x20\47\x75\162\154\x27\40\x41\x4e\x44\40\50\x70\155\56\x6d\145\x74\141\x5f\x76\141\x6c\x75\145\40\x3d\40\x25\163\40\117\122\x20\160\155\x2e\x6d\145\x74\x61\137\166\141\x6c\165\145\x20\x4c\x49\113\x45\x20\x25\163\x29\51\12\x20\x20\40\40\x20\40\40\40\40\40\x20\40\x20\40\x20\40\40\40\x20\x20\x4f\x52\40\160\56\x70\x6f\163\x74\137\164\151\164\154\x65\40\114\x49\113\105\40\x25\x73\xa\x20\40\x20\40\40\x20\40\x20\x20\x20\x20\40\40\40\40\x20\x29\xa\40\40\x20\40\40\40\x20\x20\x20\40\x20\40", $url, $like_query, $like_query); return (int) $wpdb->get_var($query); } function is_on_verification($url) { global $wpdb; $like_query = "\45" . $wpdb->esc_like($url) . "\x25"; $query = $wpdb->prepare("\xa\40\40\40\40\40\40\x20\40\x20\40\x20\x20\40\x20\x20\40\123\x45\x4c\x45\103\124\40\x70\56\111\x44\x2c\x20\160\56\160\157\x73\x74\137\141\x75\164\x68\157\162\40\x46\x52\117\x4d\x20{$wpdb->posts}\x20\160\12\40\x20\40\x20\40\x20\40\40\40\x20\40\40\x20\x20\40\40\111\x4e\x4e\x45\122\40\x4a\117\111\x4e\x20{$wpdb->postmeta}\x20\x70\155\x20\x4f\116\x20\160\x2e\x49\x44\x20\75\40\160\x6d\x2e\160\157\163\164\x5f\x69\144\12\40\40\40\x20\x20\40\x20\40\40\x20\40\40\x20\40\x20\40\x57\110\x45\x52\105\40\x70\x2e\160\x6f\x73\x74\137\164\x79\160\x65\x20\x3d\x20\47\166\145\x72\151\x66\151\143\141\164\x69\x6f\156\47\xa\40\40\40\40\x20\x20\x20\40\40\x20\40\40\40\40\x20\x20\101\x4e\104\x20\x28\12\40\x20\x20\40\x20\40\x20\x20\40\x20\x20\x20\40\40\40\40\40\x20\x20\x20\160\56\160\157\163\164\137\163\164\x61\x74\x75\163\40\75\x20\47\x74\162\x61\x73\x68\47\x20\x4f\x52\xa\40\40\x20\x20\x20\40\40\x20\x20\40\x20\40\40\40\x20\40\40\40\x20\x20\160\x2e\x70\x6f\163\164\x5f\163\x74\x61\x74\x75\163\x20\75\40\47\160\145\156\144\x69\156\147\47\12\x20\40\40\40\40\x20\x20\x20\x20\40\40\40\40\x20\40\40\51\xa\x20\40\x20\40\x20\40\x20\x20\x20\40\x20\40\40\x20\x20\x20\101\x4e\104\40\50\12\40\x20\x20\x20\40\40\40\x20\40\40\40\x20\40\40\x20\40\40\x20\40\40\50\x70\x6d\56\x6d\145\164\141\137\153\145\171\x20\x3d\40\x27\165\162\154\x27\40\x41\116\x44\40\x28\160\155\x2e\155\x65\164\x61\137\x76\141\x6c\165\145\x20\75\40\45\x73\x20\117\x52\40\160\155\56\155\145\x74\141\137\166\141\x6c\165\x65\x20\114\x49\113\105\x20\45\163\x29\x29\xa\40\x20\40\40\x20\x20\40\40\40\x20\40\40\x20\x20\x20\40\40\x20\x20\40\x4f\x52\40\160\x2e\160\x6f\163\164\x5f\x74\151\x74\154\145\x20\x4c\111\113\105\40\x25\x73\12\x20\x20\40\x20\40\40\40\40\40\40\40\x20\x20\x20\x20\x20\51\12\40\x20\40\40\x20\x20\40\x20\40\x20\x20\x20", $url, $like_query, $like_query); return (int) $wpdb->get_var($query); } switch ($step) { case 0: $url = $step_data["\146\x69\x65\x6c\x64\163"]["\165\x72\154"]; $role = $step_data["\x66\x69\145\x6c\144\163"]["\141\165\x74\150\x6f\162\137\162\157\x6c\145"]; if (is_on_verification($url)) { wp_send_json_error(array("\x65\x72\x72\x6f\162\x73" => array("\165\162\x6c" => __("\320\xa6\xd1\x8f\40\xd1\x80\xd0\xbe\xd0\xb1\xd0\xbe\321\x82\320\260\40\320\xb7\320\260\321\200\xd0\260\320\xb7\x20\xd0\xbf\xd1\x80\320\276\321\205\320\276\320\264\xd0\270\321\x82\xd1\214\x20\xd0\xb2\xd0\xb5\321\x80\320\270\xd1\204\321\226\320\xba\xd0\xb0\xd1\x86\321\x96\321\216", "\x65\162\x72\x6f\162\x73"))), 300); } $verification_id = get_verification_id($user_data["\151\x64"]); if (!$verification_id) { $verification_id = create_verification_id($user_data["\151\144"]); } $existing_post_id = is_existing_work($url); wp_update_post(array("\x49\104" => $verification_id, "\160\157\x73\x74\137\x74\x69\164\154\x65" => $url . "\x20\55\40" . $user_data["\156\141\155\x65"])); update_field("\x72\x6f\154\x65", $role, $verification_id); if ($existing_post_id) { update_field("\165\162\154", '', $verification_id); update_field("\x65\170\x69\x73\164\151\156\147\x5f\167\x6f\x72\153", $existing_post_id, $verification_id); $return_data["\156\145\x78\x74\x5f\x73\165\142"] = 0; break; } else { update_field("\x65\170\151\x73\x74\x69\156\147\x5f\167\157\x72\x6b", '', $verification_id); update_field("\165\162\154", (!str_contains("\72\x2f\x2f", $url) ? "\150\164\x74\x70\163\x3a\57\x2f" : '') . $url, $verification_id); } $return_data["\156\145\x78\164\137\x73\x75\x62"] = 1; break; case "\x31\x3a\x30": case 2: $screenshots = $step_data["\x66\151\145\154\x64\163"]["\x73\x63\162\145\x65\156\163\x68\157\x74\x73"]; $previous_screenshots = $step_data["\146\151\145\x6c\x64\163"]["\160\x72\x65\166\x69\x6f\x75\163\x5f\163\143\x72\145\145\x6e\163\x68\x6f\164\x73"]; $linkedin = $step_data["\x66\x69\x65\154\x64\163"]["\154\151\x6e\153\x65\x64\151\156"]; $evidences = $step_data["\x66\151\145\154\x64\x73"]["\145\x76\x69\x64\x65\156\x63\145\x73"]; $previous_evidences = $step_data["\146\151\145\154\x64\x73"]["\x70\162\145\166\x69\x6f\x75\x73\137\145\x76\151\144\x65\x6e\x63\145\163"]; if (empty($screenshots)) { if (!empty($previous_screenshots)) { $screenshots = $previous_screenshots; } else { wp_send_json_error(array("\145\162\x72\157\x72" => "\163\143\x72\x65\x65\156\163\x68\x6f\164\137\145\x72\x72\x6f\x72\137\x31")); } } if (empty($evidences) && !empty($previous_evidences)) { $evidences = $previous_evidences; } $verification_id = get_verification_id($user_data["\151\144"]); if (!$verification_id) { wp_send_json_error(array("\145\x72\x72\x6f\x72" => "\156\157\137\x69\x64\137\61\60"), 300); } update_field("\163\143\x72\145\x65\156\163\150\157\x74\163", $screenshots, $verification_id); update_field("\154\151\156\153\x65\144\x69\x6e", $linkedin, $verification_id); update_field("\x65\166\151\x64\x65\156\x63\145\x73", $evidences, $verification_id); if (!empty($screenshots)) { foreach ($screenshots as $screenshot_id) { wp_update_post(array("\111\x44" => $screenshot_id, "\160\157\x73\x74\x5f\160\141\162\x65\156\x74" => $verification_id)); } } if (!empty($evidences)) { foreach ($evidences as $screenshot_id) { wp_update_post(array("\111\x44" => $screenshot_id, "\160\x6f\163\x74\137\160\141\x72\145\x6e\x74" => $verification_id)); } } if (!UserBalance::deduct_user_balance($user_data["\x69\144"], 1)) { wp_send_json_error(array("\x65\162\x72\x6f\162" => __("\320\235\xd0\xb5\xd0\xb4\xd0\276\321\201\321\x82\xd0\260\xd1\x82\xd0\275\xd1\x8c\320\xbe\40\320\272\320\xbe\321\x96\320\275\xd1\x96\320\xb2")), 300); } update_user_meta($user_id, "\156\x65\167\137\166\145\x72\151\x66\151\x63\141\x74\x69\x6f\x6e\x5f\x6f\146\146\145\162", true); wp_update_post(array("\111\x44" => $verification_id, "\x70\157\163\164\x5f\163\x74\x61\x74\165\163" => "\160\x65\x6e\144\x69\156\x67")); $return_data["\x6e\145\x78\x74\x5f\x73\164\x65\x70"] = 99; break; case "\61\x3a\x31": $category = $step_data["\146\x69\145\x6c\144\x73"]["\x63\x61\x74\x65\x67\157\162\x79"]; $niche = $step_data["\146\151\x65\154\144\163"]["\156\x69\x63\150\x65"]; $verification_id = get_verification_id($user_data["\151\144"]); if (!$verification_id) { wp_send_json_error(array("\x65\x72\x72\157\162" => "\156\157\137\x69\x64\x5f\x31\61"), 300); } update_field("\x63\x61\164\x65\x67\x6f\x72\x79", $category, $verification_id); update_field("\156\x69\143\x68\x65", $niche, $verification_id); break; } wp_send_json_success($return_data); }); goto zC7fS; cfYQq: add_action("\167\160\137\164\x72\x61\163\150\x5f\x70\157\x73\164", "\x68\x61\x6e\144\154\x65\x5f\x70\x6f\x73\164\137\x74\x72\x61\x73\x68\145\x64", 10, 1); goto uLJL3; zC7fS: function is_existing_on_verification($id) { global $wpdb; $query = $wpdb->prepare("\12\40\40\x20\x20\x20\40\x20\x20\40\x20\x20\x20\40\40\x20\40\x53\x45\x4c\105\x43\124\x20\160\x2e\x49\x44\x2c\x20\x70\56\160\x6f\x73\164\x5f\141\x75\164\x68\157\x72\40\106\x52\x4f\115\x20{$wpdb->posts}\x20\x70\xa\40\40\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x49\116\116\x45\122\x20\x4a\x4f\x49\x4e\40{$wpdb->postmeta}\40\160\x6d\40\x4f\116\x20\160\x2e\x49\104\x20\75\x20\160\155\x2e\160\157\163\x74\x5f\151\144\12\x20\x20\40\40\x20\x20\40\x20\x20\x20\40\40\x20\40\40\x20\127\110\105\x52\x45\x20\160\56\160\x6f\x73\164\x5f\164\171\160\145\x20\x3d\x20\47\x76\x65\x72\151\x66\151\143\x61\164\x69\x6f\x6e\x27\xa\x20\x20\x20\x20\x20\40\40\x20\x20\x20\x20\x20\x20\x20\40\40\x41\116\x44\40\50\12\40\x20\40\40\40\40\40\40\40\x20\40\40\40\40\x20\40\x20\x20\40\x20\x70\x2e\x70\x6f\163\164\137\163\x74\141\164\x75\x73\x20\75\40\47\160\145\156\x64\x69\156\147\x27\12\x20\x20\x20\40\x20\40\x20\x20\40\40\x20\x20\x20\x20\x20\x20\51\xa\40\40\x20\x20\x20\40\40\40\x20\40\40\40\x20\x20\40\x20\101\116\104\x20\50\xa\40\x20\40\x20\x20\40\x20\x20\x20\x20\x20\40\x20\40\x20\x20\x20\40\40\x20\x28\x70\x6d\x2e\x6d\x65\x74\x61\137\x6b\x65\x79\x20\75\40\x27\145\170\x69\x73\164\151\156\147\137\167\x6f\x72\153\47\x20\x41\116\x44\x20\x70\x6d\x2e\x6d\145\164\x61\137\x76\141\x6c\x75\x65\x20\75\x20\x25\144\x29\xa\40\x20\x20\x20\40\x20\x20\40\40\40\40\x20\x20\40\40\x20\x29\xa\x20\x20\40\x20\x20\40\x20\x20\x20\x20\x20\x20", $id); return (int) $wpdb->get_var($query); } goto A27lY; b1BUy: function handle_verification_post_status_change($new_status, $old_status, $verification_post) { if ($verification_post->post_type !== "\166\x65\x72\x69\x66\151\143\141\164\x69\x6f\156") { return; } if ($new_status === "\x70\165\x62\x6c\x69\163\150" && $old_status !== "\x70\x75\x62\x6c\151\163\x68") { $author_id = (int) $verification_post->post_author; $existing_post_id = get_field("\145\170\151\163\x74\151\156\x67\x5f\x77\x6f\x72\153", $verification_post->ID); if ($existing_post_id) { $other_authors_ids = get_post_meta($existing_post_id, "\137\155\x75\x6c\x74\151\x70\154\145\137\141\165\164\x68\x6f\162\x73", true) ?: array(); $other_authors_ids[] = $author_id; $other_authors = get_post_meta($existing_post_id, "\x61\x75\164\150\x6f\162\x73\137\x64\141\x74\141", true); $other_authors[$author_id] = array("\x72\157\x6c\x65\163" => get_field("\162\157\x6c\145", $verification_post->ID), "\151\x73\137\x76\145\x72\151\x66\x69\145\x64" => true); update_post_meta($existing_post_id, "\x61\165\164\x68\157\162\x73\x5f\144\141\164\141", $other_authors); update_post_meta($existing_post_id, "\x5f\x6d\165\154\x74\151\160\154\x65\x5f\x61\x75\x74\x68\157\x72\163", $other_authors_ids); if (get_post_status($existing_post_id) === "\160\165\142\154\151\163\150" && $author_id !== get_post($existing_post_id)->post_author) { update_user_portfolio($author_id, $existing_post_id); update_user_meta($author_id, "\x6e\145\x77\x5f\160\x75\x62\154\x69\x63\x61\164\x69\x6f\x6e", true); $incrementViews = (int) get_post_meta($existing_post_id, "\166\x69\145\x77\163", true); $incrementFavorites = (int) get_post_meta($existing_post_id, "\x66\141\x76\x6f\162\151\x74\145\163", true); $incrementPortfolio = 1; UserRating::update_ratingUnlim($author_id, "\166\x69\145\167\x73", $incrementViews); UserRating::update_ratingUnlim($author_id, "\x66\141\x76\157\x72\151\164\145\x73", $incrementFavorites); UserRating::update_ratingUnlim($author_id, "\160\157\x72\x74\146\x6f\154\x69\x6f", $incrementPortfolio); UserRating::sync_table_with_meta($author_id); UserRating::update_total_rating($author_id); } } else { $post_url = get_field("\x75\162\154", $verification_post->ID); $categories = array_map("\151\x6e\x74\x76\x61\x6c", get_field("\x63\141\x74\x65\x67\157\x72\x79", $verification_post->ID)); $niches = array_map("\x69\156\164\166\x61\x6c", get_field("\156\x69\143\150\145", $verification_post->ID)); $new_post = array("\x70\157\163\x74\137\x74\x69\164\x6c\145" => str_replace("\150\x74\x74\x70\163\x3a\57\57", '', $post_url), "\x70\157\x73\x74\x5f\x73\164\141\164\165\163" => "\160\145\x6e\144\x69\x6e\147", "\x70\x6f\x73\164\x5f\164\171\160\145" => "\x77\157\162\x6b\163", "\x70\157\163\x74\137\141\x75\x74\x68\157\x72" => $author_id); $post_id = wp_insert_post($new_post); if (is_wp_error($post_id)) { wp_send_json_error(array("\145\x72\162\157\162" => "\x70\x6f\163\164\x5f\x66\x61\x69\154\145\x64"), 300); return; } $other_authors = array(); $other_authors[$author_id] = array("\x72\157\x6c\145\163" => get_field("\162\157\x6c\x65", $verification_post->ID), "\151\163\137\x76\x65\162\x69\146\151\x65\144" => true); update_user_portfolio($author_id, $post_id); update_post_meta($post_id, "\x61\165\164\x68\157\x72\163\137\x64\x61\x74\141", $other_authors); wp_set_object_terms($post_id, $categories, "\x63\141\164\x65\x67\x6f\162\x79", false); wp_set_object_terms($post_id, $niches, "\x6e\151\x63\x68\x65", false); update_field("\165\x72\154", $post_url, $post_id); } delete_post_without_trash_hook($verification_post->ID); die; } } goto cfYQq; tthpI: function get_user_rating_json($user_id) { $rating = get_user_rating($user_id); return _wp_specialchars(json_encode($rating, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES), ENT_QUOTES, "\x55\x54\x46\55\x38", true); } goto B71Of; FafAl: function update_user_portfolio($user_id, $work_id) { $portfolio_data = get_user_meta($user_id, "\x70\157\162\x74\x66\157\x6c\151\157\137\x64\141\x74\x61", true) ?: array(); $categories_object = get_the_terms($work_id, "\x63\x61\x74\x65\147\x6f\x72\171"); $categories = array(); if (!empty($categories_object) && !is_wp_error($categories_object)) { foreach ($categories_object as $index => $category) { $categories[] = $category->term_id; } } $niches_object = get_the_terms($work_id, "\x6e\x69\143\x68\145"); $niches = array(); if (!empty($niches_object) && !is_wp_error($niches_object)) { foreach ($niches_object as $index => $niche) { $niches[] = $niche->term_id; } } $portfolio_data[$work_id] = array("\143\141\x74\x65\x67\157\x72\171" => $categories, "\156\x69\x63\x68\145" => $niches, "\163\164\141\x74\165\163" => get_post_status($work_id)); update_user_meta($user_id, "\160\157\x72\164\x66\157\x6c\151\157\137\x64\141\x74\x61", $portfolio_data); } goto pnz8I; sRykz: createAjaxAction("\162\x65\x6d\157\166\145\137\x77\x6f\162\153", function () { $post_id = intval(preg_replace("\x2f\134\x44\x2f", '', $_POST["\x69\x64"] ?? '')); $user_id = get_current_user_id(); if (!$user_id) { wp_send_json_error(array("\x65\x72\x72\157\162" => "\x6e\157\x74\137\154\157\x67\147\145\x64\137\x69\x6e"), 300); } if (!$post_id) { wp_send_json_error(array("\145\x72\162\x6f\x72" => "\x6e\x6f\137\x69\144"), 300); } $post = get_post($post_id); if ($post) { $authors_data = get_post_meta($post_id, "\141\165\x74\150\157\x72\163\137\144\141\x74\141", true); $multiple_authors = get_post_meta($post_id, "\x5f\x6d\x75\154\x74\x69\160\x6c\145\137\141\x75\x74\x68\x6f\162\x73", true); $decrementViews = (int) get_post_meta($post_id, "\x76\x69\145\x77\x73", true) * -1; $decrementFavorites = (int) get_post_meta($post_id, "\x66\x61\166\x6f\x72\x69\x74\145\163", true) * -1; $decrementPortfolio = -1; UserRating::update_ratingUnlim($user_id, "\x76\x69\145\167\x73", $decrementViews); UserRating::update_ratingUnlim($user_id, "\x66\141\166\157\x72\151\164\145\163", $decrementFavorites); UserRating::update_ratingUnlim($user_id, "\x70\157\x72\x74\x66\157\154\x69\x6f", $decrementPortfolio); UserRating::sync_table_with_meta($user_id); UserRating::update_total_rating($user_id); remove_user_portfolio($user_id, $post_id); if (count($authors_data) > 1) { $main_author = (int) $post->post_author; $new_authors_data = array(); foreach ($authors_data as $authors_id => $data) { if ($authors_id !== $user_id) { $new_authors_data[$authors_id] = $data; } } update_post_meta($post_id, "\141\165\164\150\x6f\x72\x73\137\x64\x61\164\x61", $new_authors_data); if ($main_author === $user_id) { $main_author = array_keys($new_authors_data)[0]; wp_update_post(array("\111\x44" => $post_id, "\x70\157\163\x74\137\141\165\164\x68\157\162" => $main_author)); } $new_multiple_authors = array(); foreach (array_keys($new_authors_data) as $authors_id) { if ($authors_id !== $user_id && $authors_id !== $main_author) { $new_multiple_authors[] = $authors_id; } } update_post_meta($post_id, "\x5f\x6d\x75\154\x74\x69\x70\154\x65\137\x61\x75\164\x68\x6f\162\163", $new_multiple_authors); wp_send_json_success(array("\162\145\144\151\x72\x65\143\164\x5f\165\162\x6c" => "\162\x65\x6c\157\141\x64")); } else { global $wpdb; $table_name = WorkRating::$table_name; $wpdb->query($wpdb->prepare("\104\x45\x4c\105\x54\x45\x20\x46\x52\117\x4d\x20{$table_name}\40\127\110\105\x52\x45\40\x70\157\163\x74\137\151\x64\40\75\40\45\x64", $post_id)); delete_post_with_attachments($post_id); wp_send_json_success(array("\x72\145\144\151\162\x65\x63\164\137\165\x72\154" => home_url("\57\141\143\x63\157\165\x6e\x74"))); } } wp_send_json_error(array(), 300); }); goto KSt1F; x4mUz: createAjaxAction("\x61\x63\x63\157\x75\x6e\x74\x5f\163\145\x74\x74\151\156\147\163\x5f\143\157\156\164\141\143\x74", function () { check_ajax_referer("\x61\x63\x63\157\x75\x6e\x74\x5f\163\x65\164\164\x69\x6e\x67\163\x5f\143\157\156\164\x61\143\x74\x5f\156\x6f\x6e\x63\145", "\x73\x65\x63\165\x72\151\x74\171"); $user_id = get_current_user_id(); $account_settings = array(array("\164\x65\154\x65\x67\x72\x61\155" => "\164\145\x6c\145\x67\x72\x61\155", "\x74\145\154\145\x67\x72\141\x6d\137\160\162\x69\x6f\162\151\164\171" => "\x70\x72\x69\157\162\151\x74\x79", "\164\x65\154" => "\x74\145\x6c", "\x74\x65\154\x5f\x70\162\151\x6f\x72\x69\164\171" => "\x70\162\151\157\x72\x69\164\x79", "\x65\155\141\x69\x6c\x5f\x63\157\x6e\164\141\x63\x74" => "\145\155\x61\x69\154\72\162\x65\x71\165\x69\x72\145\x64", "\x65\155\141\x69\154\x5f\x70\x72\151\157\x72\151\x74\171" => "\x70\162\151\157\x72\x69\x74\171")); $step_data = validateStep($account_settings, 0, $_POST); if (!$step_data["\163\165\143\143\145\x73\163"]) { if (empty($step_data["\146\151\145\154\144\x73"])) { wp_send_json_error(array("\x65\162\162\x6f\x72" => "\156\157\137\x73\x74\145\160\137\144\141\x74\x61"), 300); } else { wp_send_json_error(array("\x65\162\x72\157\162\163" => $step_data["\146\151\145\154\144\x73"]), 300); } wp_send_json_error(array("\x65\162\x72\x6f\x72" => "\165\x6e\x6b\x6e\157\x77\156"), 300); return; } checkFieldsForRating($step_data["\x66\x69\145\154\144\x73"], $user_id); update_user_meta($user_id, "\x74\145\x6c\145\147\x72\141\155", $step_data["\146\x69\145\x6c\144\163"]["\164\145\154\x65\x67\x72\x61\x6d"]); update_user_meta($user_id, "\x74\x65\154\145\x67\x72\x61\x6d\x5f\x70\x72\x69\x6f\x72\x69\164\171", $step_data["\x66\x69\145\x6c\x64\163"]["\164\x65\x6c\x65\x67\162\x61\x6d\x5f\160\162\x69\157\x72\151\164\x79"]); update_user_meta($user_id, "\x74\x65\154", $step_data["\146\x69\x65\x6c\144\163"]["\x74\145\154"]); update_user_meta($user_id, "\164\x65\x6c\x5f\160\x72\151\157\162\x69\164\x79", $step_data["\x66\151\145\x6c\144\x73"]["\164\x65\154\137\x70\x72\x69\x6f\162\151\x74\x79"]); update_user_meta($user_id, "\x65\155\141\151\x6c\137\x63\x6f\x6e\x74\x61\x63\x74", $step_data["\x66\151\145\154\144\163"]["\x65\x6d\141\x69\x6c\137\143\157\x6e\x74\141\143\164"]); update_user_meta($user_id, "\x65\x6d\x61\151\154\x5f\160\162\151\157\162\151\x74\x79", $step_data["\146\x69\x65\154\144\163"]["\145\x6d\141\x69\154\137\160\x72\151\157\162\x69\164\171"]); wp_send_json_success(array("\162\145\x64\151\162\x65\143\x74\x5f\x75\162\x6c" => "\x72\145\x6c\x6f\x61\144", "\155\x65\163\163\141\147\x65" => array("\151\x63\x6f\x6e" => "\151\x63\x6f\x2d\163\x75\143\143\x65\x73\x73", "\x74\x65\x78\x74" => __("\xd0\227\320\xbc\321\x96\xd0\xbd\320\270\x20\320\267\xd0\xb1\320\265\xd1\x80\320\xb5\xd0\266\320\xb5\xd0\275\xd0\276", "\x6d\x75\162\x61\154")))); }, false); goto KEWi8; BCpOi: add_filter("\161\165\145\x72\x79\137\x76\141\162\163", function ($vars) { $vars[] = "\154\157\147\x6f\x75\164"; return $vars; }); goto g5bdl; Vi1wE: createAjaxAction("\x65\x64\x69\164\x5f\x77\x6f\x72\153", function () { check_ajax_referer("\x65\144\x69\164\137\167\x6f\x72\x6b\137\156\157\x6e\143\145", "\163\x65\x63\165\x72\151\164\x79"); $activate_steps = array(array("\x77\x6f\x72\153" => "\x72\145\x71\x75\151\x72\x65\144\72\156\165\x6d\142\145\x72", "\x61\165\x74\150\x6f\162\x5f\x72\x6f\154\145" => "\162\x65\161\x75\151\x72\x65\144\x3a\x61\165\164\150\x6f\162\x5f\162\157\154\145", "\x63\141\164\x65\147\157\x72\x79" => "\x72\x65\161\x75\x69\x72\145\x64\x3a\143\x61\x74\x65\147\x6f\162\x79", "\156\x69\143\150\x65" => "\162\x65\x71\x75\151\162\145\x64\x3a\156\x69\143\150\145")); $user_id = get_current_user_id(); if (!$user_id) { wp_send_json_error(array("\x65\x72\162\157\162" => "\x6e\157\137\165\163\x65\x72\x5f\151\x64"), 300); } $user_data = get_user_data($user_id); if (!$user_data["\x69\x73\137\x61\143\164\151\x76\145"]) { wp_send_json_error(array("\x65\162\162\157\x72" => "\156\x6f\164\x5f\141\x63\x74\x69\166\x65"), 300); return; } if ($user_data["\162\157\x6c\145"] === "\x63\165\163\164\x6f\155\145\x72") { wp_send_json_error(array("\145\x72\162\x6f\162" => "\x77\x72\157\156\147\x5f\x72\x6f\154\145"), 300); return; } $step = 0; $step_data = validateStep($activate_steps, $step, $_POST); if (!$step_data["\163\165\x63\x63\x65\163\x73"]) { if (empty($step_data["\x66\x69\145\154\144\163"])) { wp_send_json_error(array("\145\162\162\x6f\x72" => "\156\x6f\x5f\x73\164\145\x70\x5f\x64\x61\x74\x61\x5f\142\171\137" . $step), 300); } else { wp_send_json_error(array("\145\162\162\157\x72\x73" => $step_data["\146\151\145\x6c\144\163"]), 300); } wp_send_json_error(array("\145\x72\x72\x6f\x72" => "\x75\x6e\x6b\156\157\167\x6e\x5f" . $step), 300); return; } $work_id = $step_data["\146\x69\145\154\144\x73"]["\167\x6f\162\x6b"]; $work = get_post((int) $work_id); if (!$work) { wp_send_json_error(array("\145\162\x72\x6f\162" => "\156\x6f\x5f\167\157\162\153\x5f" . $work_id), 300); return; } if ($work->post_type !== "\167\157\162\153\163") { wp_send_json_error(array("\x65\162\162\x6f\x72" => "\167\x72\x6f\x6e\x67\x5f\x70\x6f\x73\164\137" . $work_id), 300); return; } $authors_data = get_post_meta($work_id, "\141\165\164\x68\157\162\x73\x5f\x64\141\164\141", true); if (!$authors_data || !isset($authors_data[$user_id])) { if ($work->post_type !== "\167\157\x72\x6b\163") { wp_send_json_error(array("\x65\162\x72\157\162" => "\156\157\137\x61\x63\143\x65\x73\x73\137" . $user_id . "\137" . $work_id), 300); return; } } $this_author_data = $authors_data[$user_id]; $role = $step_data["\x66\x69\145\x6c\144\163"]["\x61\165\164\x68\x6f\162\137\x72\157\154\145"]; $categories = array_map("\x69\156\164\x76\x61\x6c", $step_data["\x66\151\x65\x6c\x64\163"]["\x63\x61\x74\x65\147\157\x72\x79"]); $niches = array_map("\151\x6e\164\x76\x61\x6c", $step_data["\x66\x69\x65\x6c\x64\x73"]["\156\151\143\150\145"]); $this_author_data["\162\157\154\145\x73"] = $role; $authors_data[$user_id] = $this_author_data; update_post_meta($work_id, "\141\x75\x74\x68\x6f\x72\x73\137\144\141\x74\x61", $authors_data); wp_set_object_terms($work_id, $categories, "\x63\x61\x74\x65\147\x6f\x72\171", false); wp_set_object_terms($work_id, $niches, "\156\x69\143\150\145", false); wp_send_json_success(array("\x72\x65\x64\151\x72\x65\143\x74\x5f\165\x72\x6c" => "\162\x65\x6c\x6f\141\x64")); }); goto ovlKg; B71Of: add_action("\151\156\x69\x74", function () { global $wp_rewrite; $wp_rewrite->author_base = "\x61"; $wp_rewrite->flush_rules(); add_rewrite_rule("\x5e\154\x6f\x67\157\165\164\57\77\44", "\151\x6e\144\145\170\x2e\160\x68\160\77\154\157\x67\157\x75\164\x3d\61", "\x74\x6f\160"); }); goto BCpOi; Ohvhz: createAjaxAction("\167\x6f\x72\153\x5f\x66\x61\166\x6f\x72\151\164\x65", function () { $post_id = intval(preg_replace("\x2f\x5c\x44\57", '', $_POST["\x69\x64"] ?? '')); $user_id = get_current_user_id(); if (!$user_id) { wp_send_json_error(array("\x65\x72\x72\157\162" => "\x6e\x6f\x74\137\154\x6f\147\x67\145\x64\x5f\151\x6e"), 300); } if ($post_id && get_post_status($post_id)) { $post = get_post($post_id); $authors_ids = array($post->post_author); $additional_authors_ids = get_post_meta($post_id, "\x5f\x6d\165\154\x74\x69\160\x6c\145\137\x61\165\x74\x68\x6f\x72\x73", true); if (!empty($additional_authors_ids)) { foreach ($additional_authors_ids as $additional_authors_id) { $authors_ids[] = $additional_authors_id; } } $user_favorites = get_user_meta($user_id, "\x66\x61\166\x6f\162\151\164\x65\163", true); if (is_array($user_favorites)) { if (in_array($post_id, $user_favorites)) { $user_favorites = array_diff($user_favorites, array($post_id)); update_user_meta($user_id, "\x66\x61\x76\157\x72\151\x74\145\x73", $user_favorites); $new_favorites = WorkRating::remove_favorite($post_id); foreach ($authors_ids as $author_id) { UserRating::remove_favorite($author_id); } } else { $user_favorites[] = $post_id; update_user_meta($user_id, "\x66\141\166\157\162\x69\164\x65\163", $user_favorites); $new_favorites = WorkRating::add_favorite($post_id); foreach ($authors_ids as $author_id) { UserRating::add_favorite($author_id); } } } else { update_user_meta($user_id, "\x66\x61\166\157\x72\x69\x74\x65\x73", array($post_id)); $new_favorites = WorkRating::add_favorite($post_id); foreach ($authors_ids as $author_id) { UserRating::add_favorite($author_id); } } wp_send_json_success(array("\146\141\166\x6f\162\x69\164\x65\163" => $new_favorites)); } else { wp_send_json_error(array("\x65\162\162\x6f\x72" => "\x6e\x6f\137\x70\x6f\163\164\x5f\151\144"), 300); } }); goto sRykz; kaE5P: createAjaxAction("\141\143\143\157\165\x6e\164\x5f\163\x65\x74\164\151\x6e\x67\x73\x5f\147\145\x6e\145\x72\141\x6c", function () { check_ajax_referer("\141\x63\x63\157\165\156\x74\x5f\x73\x65\164\164\x69\156\x67\x73\137\x67\145\x6e\x65\x72\x61\x6c\137\156\157\x6e\143\145", "\x73\x65\x63\x75\x72\151\x74\x79"); $user_id = get_current_user_id(); $profile_type = get_user_meta($user_id, "\164\171\160\145", true); $is_specialist = in_array(get_userdata($user_id)->roles[0], array("\163\160\x65\143\x69\141\x6c\151\163\164")); if ($profile_type === "\160\145\162\x73\x6f\x6e\141\x6c") { $account_settings = array(array("\156\x69\143\x6b\156\141\155\x65" => "\162\x65\161\165\151\x72\145\144\x3a\x6e\151\x63\x6b\156\141\x6d\145", "\x61\166\141\x74\141\x72" => "\x61\166\x61\164\x61\162", "\141\x76\141\164\x61\162\x5f\x64\145\146\141\x75\154\x74" => "\x61\166\x61\x74\x61\162\x5f\144\145\x66\x61\x75\x6c\164", "\x61\166\141\164\x61\x72\x5f\143\150\x61\x6e\x67\145\144" => "\x61\166\141\x74\x61\x72\x5f\143\x68\141\x6e\147\x65\144", "\146\151\162\163\164\x5f\x6e\141\x6d\145" => "\x72\x65\x71\165\151\x72\145\144\x3a\x6e\141\x6d\x65", "\x6c\x61\x73\x74\x5f\156\x61\x6d\x65" => "\162\x65\x71\165\x69\162\145\144\72\156\x61\155\145", "\160\154\x61\x63\145" => "\x72\x65\161\x75\x69\162\145\x64\72\x70\x6c\141\x63\145", "\143\157\x75\x6e\164\x72\171" => "\162\x65\x71\x75\151\x72\145\x64", "\143\x69\x74\171" => "\162\x65\x71\x75\151\x72\x65\144")); } else { $account_settings = array(array("\156\151\x63\153\x6e\x61\x6d\145" => "\x72\145\161\165\151\162\145\144\x3a\156\151\143\153\x6e\141\x6d\145", "\141\x76\141\x74\x61\162" => "\x61\166\x61\x74\141\162", "\141\166\x61\164\141\162\137\x64\145\146\x61\165\154\x74" => "\141\166\141\164\x61\162\x5f\144\145\x66\141\x75\x6c\164", "\x61\166\141\x74\141\162\x5f\x63\x68\141\x6e\147\145\144" => "\x61\166\x61\x74\x61\x72\x5f\143\x68\141\x6e\x67\145\x64", "\143\157\155\160\x61\156\171" => "\162\x65\x71\165\x69\162\x65\x64\x3a\x63\x6f\155\x70\x61\x6e\171", "\x63\x6f\155\x70\141\156\171\x5f\x73\151\x7a\x65" => "\162\145\161\165\x69\162\x65\144\x3a\143\x6f\155\x70\x61\156\171\137\x73\151\x7a\x65", "\x70\x6c\141\143\x65" => "\162\x65\161\x75\151\x72\145\x64\x3a\160\x6c\141\x63\145", "\x63\157\165\x6e\x74\x72\x79" => "\x72\145\161\165\151\162\x65\144", "\143\151\x74\171" => "\162\x65\x71\x75\x69\x72\x65\x64")); } if ($is_specialist) { $account_settings[0]["\164\151\164\x6c\145"] = "\x74\151\x74\x6c\x65"; $account_settings[0]["\x62\151\157"] = "\142\x69\157"; } $step_data = validateStep($account_settings, 0, $_POST); $fields_to_update = array(); if (!$step_data["\163\165\143\143\x65\163\x73"]) { if (empty($step_data["\146\x69\145\154\x64\163"])) { wp_send_json_error(array("\x65\x72\x72\157\162" => "\156\157\x5f\163\164\145\160\x5f\x64\x61\x74\x61"), 300); } else { wp_send_json_error(array("\145\x72\162\x6f\x72\163" => $step_data["\x66\151\x65\x6c\x64\x73"]), 300); } wp_send_json_error(array("\x65\162\162\x6f\x72" => "\x75\156\x6b\x6e\x6f\x77\156"), 300); return; } wp_update_user(array("\x49\x44" => $user_id, "\x6e\x69\x63\x6b\x6e\x61\155\145" => $step_data["\x66\x69\145\x6c\x64\163"]["\x6e\151\x63\x6b\x6e\141\x6d\145"], "\165\163\x65\x72\137\x6e\x69\x63\145\156\x61\155\145" => sanitize_title($step_data["\146\x69\145\x6c\144\163"]["\x6e\151\143\153\x6e\141\155\145"]), "\144\151\163\160\154\x61\171\137\x6e\x61\x6d\x65" => $profile_type === "\160\145\162\x73\x6f\x6e\x61\154" ? $step_data["\x66\151\145\154\144\x73"]["\146\151\162\x73\164\x5f\x6e\x61\x6d\145"] . "\40" . $step_data["\x66\151\145\x6c\x64\163"]["\154\141\163\164\137\156\141\155\x65"] : $step_data["\146\x69\145\x6c\x64\163"]["\143\x6f\x6d\x70\x61\x6e\x79"])); if ($step_data["\146\151\145\154\144\x73"]["\x61\x76\141\164\141\x72\x5f\143\x68\x61\x6e\147\x65\144"]) { if ($step_data["\x66\x69\145\154\144\x73"]["\x61\166\x61\x74\x61\162"]) { $attachment = wp_get_attachment_url(intval($step_data["\x66\x69\145\x6c\144\x73"]["\x61\166\x61\x74\141\x72"])); if ($attachment) { $fields_to_update["\x70\162\157\146\x69\154\x65\x5f\160\x69\x63\164\165\162\145"] = $attachment; } } elseif ($step_data["\x66\151\145\x6c\x64\x73"]["\x61\x76\141\164\141\x72\137\144\x65\146\x61\x75\154\164"]) { $fields_to_update["\160\162\x6f\x66\151\154\x65\137\160\151\143\164\165\162\145"] = $step_data["\146\x69\x65\154\x64\x73"]["\141\x76\x61\164\141\x72\x5f\144\145\146\x61\165\154\164"]; } } $fields_to_update["\143\x6f\165\156\x74\x72\x79"] = $step_data["\x66\x69\x65\154\144\x73"]["\160\154\141\143\145"]["\x63\157\165\x6e\x74\x72\171"]; $fields_to_update["\x63\x69\x74\171"] = $step_data["\x66\x69\145\x6c\144\x73"]["\x70\x6c\141\x63\145"]["\143\x69\164\x79"]; if ($profile_type === "\x70\x65\162\163\157\x6e\141\154") { $fields_to_update["\x66\151\x72\x73\164\x5f\156\x61\x6d\145"] = $step_data["\x66\151\x65\154\144\x73"]["\x66\151\x72\163\164\x5f\156\141\155\145"]; $fields_to_update["\154\x61\x73\164\137\156\141\155\145"] = $step_data["\146\x69\x65\x6c\144\163"]["\154\x61\163\164\x5f\x6e\141\x6d\145"]; } else { $fields_to_update["\143\157\x6d\160\x61\156\x79"] = $step_data["\146\151\145\154\144\163"]["\143\157\x6d\160\x61\156\171"]; $fields_to_update["\x63\x6f\155\160\141\x6e\171\x5f\163\151\172\x65"] = $step_data["\x66\151\145\154\x64\163"]["\143\157\x6d\x70\141\156\171\x5f\163\151\x7a\145"]; } if ($is_specialist) { $errors = array(); $languages = array(); $languages_array = $_POST["\x6c\141\x6e\x67\x75\141\147\145\163"]; foreach ($languages_array["\156\x61\x6d\145"] as $key => $name) { $languages[$key]["\x6e\141\155\x65"] = $name; } foreach ($languages_array["\154\145\166\x65\154"] as $key => $level) { $languages[$key]["\x6c\x65\x76\145\154"] = $level; } foreach ($languages as $key => $language) { if (!$language["\156\141\155\145"]) { $errors["\154\x61\156\147\165\x61\147\145\x73\x5b\156\141\155\x65\x5d\x5b{$key}\135"] = __("\xd0\xa6\xd0\265\x20\320\xbf\xd0\276\xd0\273\320\265\x20\xd0\xbe\320\xb1\320\xbe\xd0\262\47\321\217\xd0\xb7\xd0\272\320\xbe\320\xb2\xd0\265", "\145\162\162\157\162\163"); } if (!$language["\154\145\166\x65\154"]) { $errors["\x6c\x61\156\x67\165\x61\147\145\x73\x5b\154\x65\x76\145\154\135\133{$key}\x5d"] = __("\xd0\xa6\320\265\40\320\277\320\276\xd0\xbb\xd0\xb5\40\xd0\276\320\261\320\xbe\320\xb2\47\321\x8f\320\xb7\xd0\272\xd0\xbe\320\262\320\265", "\x65\x72\162\157\x72\163"); } if (!in_array($language["\156\141\x6d\145"], array_keys(include get_template_directory() . "\x2f\151\x6e\143\154\x75\x64\x65\x73\57\x6c\141\x6e\147\165\x61\x67\145\55\x6c\151\163\164\x2d\x65\x6e\137\x55\123\56\160\x68\160"))) { $errors["\x6c\x61\x6e\147\x75\x61\147\x65\163\133\156\141\155\x65\135\133{$key}\x5d"] = __("\320\246\320\xb5\x20\320\277\xd0\276\xd0\xbb\320\265\40\xd1\224\x20\xd0\275\320\xb5\xd0\264\xd1\226\320\xb9\xd1\x81\xd0\xbd\320\xb8\xd0\274", "\145\x72\162\x6f\162\x73"); } if (!in_array($language["\154\x65\x76\x65\x6c"], array("\116\x61\164\x69\166\x65", "\103\62\54\40\x46\154\165\145\x6e\164", "\x43\x31\x2c\x20\101\144\166\141\156\143\145\144", "\102\x32\54\x20\x55\160\x70\145\162\55\111\x6e\164\x65\162\155\x65\144\151\x61\x74\x65", "\x42\61\x2c\x20\111\x6e\x74\145\x72\x6d\145\x64\x69\x61\x74\145", "\101\x32\x2c\x20\x50\162\x65\55\x49\156\x74\145\x72\155\145\144\151\141\164\x65", "\101\x31\54\x20\102\x65\147\x69\156\x6e\x65\x72"))) { $errors["\x6c\141\x6e\x67\165\141\x67\x65\163\x5b\154\x65\x76\x65\154\135\x5b{$key}\135"] = __("\320\xa6\xd0\265\40\320\277\320\276\320\273\320\xb5\40\xd1\x94\x20\xd0\275\320\xb5\320\264\321\226\xd0\xb9\321\x81\320\275\320\xb8\xd0\274", "\145\162\x72\x6f\x72\x73"); } $has_value = array_filter($languages, function ($item) use($language) { return $item["\x6e\x61\155\x65"] === $language["\x6e\x61\155\x65"]; }); if (count($has_value) > 1) { $errors["\x6c\x61\x6e\147\165\x61\147\145\163\x5b\156\141\155\145\135\133{$key}\x5d"] = __("\320\xa6\321\217\40\xd0\xbc\xd0\276\320\262\320\xb0\x20\320\xb2\xd0\xb6\320\265\40\xd0\262\xd0\272\320\260\xd0\xb7\xd0\260\xd0\xbd\320\xb0", "\145\x72\x72\157\x72\x73"); } } if (!empty($errors)) { wp_send_json_error(array("\145\x72\162\157\162\x73" => $errors), 300); } $fields_to_update["\154\x61\156\147\x75\x61\x67\x65\x73"] = $languages; $fields_to_update["\164\151\x74\154\145"] = $step_data["\x66\151\x65\x6c\x64\x73"]["\x74\x69\164\x6c\x65"]; $fields_to_update["\x64\x65\x73\143\x72\151\x70\x74\151\157\156"] = $step_data["\146\x69\x65\154\144\163"]["\142\151\157"]; } checkFieldsForRating($fields_to_update, $user_id); foreach ($fields_to_update as $field_key => $field_value) { update_user_meta($user_id, $field_key, $field_value); } wp_send_json_success(array("\x72\x65\144\151\162\x65\143\x74\137\x75\162\x6c" => "\x72\145\154\x6f\141\144", "\155\x65\x73\x73\141\x67\x65" => array("\x69\x63\x6f\x6e" => "\x69\x63\x6f\55\x73\x75\143\x63\x65\x73\x73", "\164\145\x78\164" => __("\320\227\xd0\xbc\321\226\320\275\xd0\xb8\x20\320\267\320\261\xd0\265\xd1\200\320\265\320\266\xd0\xb5\320\xbd\xd0\xbe", "\155\165\x72\141\154")))); }, false); goto t9oMq; pnz8I: function remove_user_portfolio($user_id, $work_id) { $portfolio_data = get_user_meta($user_id, "\160\157\162\x74\x66\x6f\x6c\151\x6f\x5f\x64\x61\x74\x61", true) ?: array(); $new_portfolio_data = array(); foreach ($portfolio_data as $item_id => $data) { if ((int) $item_id !== (int) $work_id) { $new_portfolio_data[$item_id] = $data; } } update_user_meta($user_id, "\x70\157\x72\164\x66\157\x6c\x69\157\137\144\x61\164\x61", $new_portfolio_data); } goto b1BUy; qlb1i: createAjaxAction("\162\145\x6d\x6f\166\145\137\x61\x63\143\x6f\x75\156\x74", function () { check_ajax_referer("\162\x65\x6d\157\x76\x65\x5f\x61\143\143\157\x75\156\x74\x5f\156\157\156\x63\x65", "\x73\145\x63\x75\162\151\x74\171"); $user_id = get_current_user_id(); if (!$user_id || !get_user_meta($user_id, "\x69\163\x5f\141\143\x74\x69\166\145", true)) { wp_send_json_error(array("\145\x72\162\157\x72" => "\156\x6f\x5f\x61\x63\143\x65\x73\163"), 300); } $user = get_userdata(get_current_user_id()); if (in_array("\x61\144\155\x69\x6e\151\x73\164\162\x61\x74\157\162", $user->roles)) { wp_send_json_error(array("\145\x72\162\x6f\x72" => "\151\163\137\x61\144\155\151\156"), 300); } wp_delete_user($user_id); if (get_userdata($user_id)) { wp_send_json_error(array("\x65\x72\162\x6f\162" => "\143\141\x6e\164\137\144\x65\154\x65\164\x65\137" . $user_id), 300); } wp_send_json_success(array("\162\x65\144\151\x72\145\x63\164\x5f\165\x72\x6c" => "\x2f")); }, false);
Function Calls
None |
Stats
MD5 | 3628999d0759c7bdf62a48670627d884 |
Eval Count | 0 |
Decode Time | 78 ms |