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 UNkNl; STQem: global $gpt_responses; goto QwKFg; GrZRW: require_once plugin_d..

Decoded Output download

<?php 
 goto UNkNl; STQem: global $gpt_responses; goto QwKFg; GrZRW: require_once plugin_dir_path(__FILE__) . "custom_conditions.php"; goto Q6AS8; Nc2vR: add_action("admin_menu", "itl_admin_menu"); goto nZxX3; Mmkqo: global $bing_results; goto HF_Nq; FX39N: $rss_responses = array(); goto AgZQN; kPZln: function itl_debug_log($message) { if (get_option("itl_debug_mode") == 1) { $visitorIP = getClientIP(); $log_entry = date("Y-m-d H:i:s") . " - " . $visitorIP . " - " . $_SERVER["REQUEST_URI"] . " - " . $message . "\xa"; $log_file = plugin_dir_path(__FILE__) . "itl-debug.log"; file_put_contents($log_file, $log_entry, FILE_APPEND); } } goto siKGM; BgU2v: add_action("wp_ajax_itl_save_table", "itl_save_table"); goto m55qk; AgZQN: global $parsed_urls; goto CBl29; siKGM: function itl_sanitize_debug_mode($input) { $debug_mode_enabled = isset($input) && intval($input) === 1 ? true : false; $log_file = plugin_dir_path(__FILE__) . "itl-debug.log"; if ($debug_mode_enabled) { if (is_writable($log_file) || !file_exists($log_file) && is_writable(dirname($log_file))) { file_put_contents($log_file, date("Y-m-d H:i:s") . " - Debug Mode Enabled\xa", FILE_APPEND); } else { $debug_mode_enabled = false; add_settings_error("itl_debug_mode", "itl_debug_mode_error", "Debug Mode could not be enabled because the debug log file is not writable. Please check the file permissions.", "error"); } } return $debug_mode_enabled ? 1 : 0; } goto g9c99; I7SS4: function itl_register_settings() { register_setting("itl_openai_settings", "itl_openai_api_key"); register_setting("itl_openai_settings", "itl_default_model"); register_setting("itl_openai_settings", "itl_debug_mode", "itl_sanitize_debug_mode"); } goto R5SyU; m55qk: function itl_save_table() { if (isset($_POST["data"]) && !empty($_POST["data"])) { $data = wp_unslash($_POST["data"]); $encodedData = base64_encode($data); update_option("itl_table_data", $encodedData); echo "Table data saved successfully."; } else { echo "Error saving data."; } wp_die(); } goto I7SS4; CBl29: $parsed_urls = array(); goto Mmkqo; g9c99: add_action("wp_ajax_delete_itl_debug_log", "itl_delete_debug_log_callback"); goto Uk1vo; HF_Nq: $bing_results = array(); goto Nc2vR; UNkNl: if (!function_exists("itl_fs")) { function itl_fs() { global $itl_fs; if (!isset($itl_fs)) { require_once dirname(__FILE__) . "/freemius/start.php"; $itl_fs = fs_dynamic_init(array("id" => "15211", "slug" => "if-then-logic", "premium_slug" => "if-then-logic", "type" => "plugin", "public_key" => "pk_771a4f78cc263e70d83974209e687", "is_premium" => true, "is_premium_only" => true, "has_addons" => false, "has_paid_plans" => true, "is_org_compliant" => false, "menu" => array("slug" => "if-then-logic", "support" => false))); } return $itl_fs; } itl_fs(); do_action("itl_fs_loaded"); } goto GrZRW; mlr67: add_action("init", "itl_evaluate_conditions_and_execute_actions"); goto zLj5I; R5SyU: add_action("admin_init", "itl_register_settings"); goto kPZln; Uk1vo: function itl_delete_debug_log_callback() { if (!current_user_can("manage_options")) { wp_send_json_error("Insufficient permissions", 403); } $log_file = plugin_dir_path(__FILE__) . "itl-debug.log"; if (file_exists($log_file) && unlink($log_file)) { wp_send_json_success("Debug log deleted successfully"); } else { wp_send_json_error("Failed to delete debug log"); } wp_die(); } goto YuSb2; Q6AS8: require_once plugin_dir_path(__FILE__) . "custom_actions.php"; goto STQem; zLj5I: function itl_evaluate_conditions_and_execute_actions() { if (is_admin() || defined("DOING_CRON") && DOING_CRON || strpos($_SERVER["REQUEST_URI"], "/wp-json/") !== false) { return; } $dataJson = get_option("itl_table_data"); if (empty($dataJson)) { return; } $data = json_decode(base64_decode($dataJson), true); if (!$data) { return; } global $custom_conditions; global $custom_actions; foreach ($data as $row) { $conditionsMet = true; foreach ($row["conditions"] as $condition) { if (array_key_exists($condition["name"], $custom_conditions)) { $normalizedContent = str_replace(array("\xd
", "
"), "
", $condition["content"]); $parameters = explode("
", $normalizedContent); $parameters = array_map("trim", $parameters); $parameters = array_filter($parameters, function ($line) { return !empty($line); }); $result = call_user_func($custom_conditions[$condition["name"]], $parameters); itl_debug_log("Condition checked: " . $condition["name"] . " Result: " . ($result ? "matched" : "not matched")); } else { $preparedCondition = "return (" . $condition["content"] . ");"; try { $result = eval($preparedCondition); itl_debug_log("Condition checked: " . $condition["name"] . " Result: " . ($result ? "matched" : "not matched")); if (!$result) { $conditionsMet = false; break; } } catch (Throwable $e) { error_log("Error evaluating condition: " . $e->getMessage()); itl_debug_log("Error evaluating condition: " . $condition["name"] . " Error: " . $e->getMessage()); $conditionsMet = false; break; } } if (isset($condition["negativeMatch"]) && $condition["negativeMatch"] === true) { $result = !$result; } if (!$result) { $conditionsMet = false; break; } } if ($conditionsMet) { $skipNextAction = 0; foreach ($row["actions"] as $action) { $content = $action["content"]; replace_tokens_with_data($content); if ($skipNextAction > 0) { $skipNextAction--; itl_debug_log("skipping next action"); continue; } if (array_key_exists($action["name"], $custom_actions)) { $normalizedContent = str_replace(array("\xd\xa", "
"), "\xa", $content); $parameters = explode("
", $normalizedContent); $parameters = array_map("trim", $parameters); $parameters = array_filter($parameters, function ($line) { return !empty($line); }); call_user_func($custom_actions[$action["name"]], $parameters); itl_debug_log("Action executed: " . $action["name"]); } else { try { eval($content); itl_debug_log("Action executed: " . $action["name"]); } catch (Throwable $e) { error_log("Error executing action: " . $e->getMessage()); itl_debug_log("Error executing action: " . $action["name"] . " Error: " . $e->getMessage()); } } } itl_debug_log("All Actions Done"); return; } } } goto WbMxL; BmG21: global $rss_responses; goto FX39N; nZxX3: function itl_admin_menu() { add_menu_page("If Then Logic", "If Then Logic", "manage_options", "if-then-logic", "itl_settings_page"); } goto BgU2v; YuSb2: function itl_settings_page() { settings_errors(); ?> 
<div class="wrap"> 
    <h2>If Then Logic</h2> 
    <h3 id="saveMessage" style="display:none;"></h3> <!-- Placeholder for the savemessage --> 
	<button class="button button-primary" id="saveTable">Save Conditions and Actions</button><br> 
    <div id="tableContainer"> 
        <table id="editableTable"> 
            <thead> 
                <tr> 
                    <th>Order</th> 
                    <th>Condition(s)</th> 
                    <th>Action(s)</th> 
                    <th>Modify</th> 
                </tr> 
            </thead> 
            <tbody></tbody> 
        </table> 
        <button onclick="addRow()">Add Row</button> 
    </div> 
     
    <br><button class="button button-primary" id="saveTable2">Save Conditions and Actions</button> 
	 
	<div><br>* this name field can't be changed as it would break the code</div> 
	<div><br>The current (server) date and time is: <?php  echo date("Y-m-d H:i:s"); ?> 
</div> 
 
   <script> 
   console.log(<?php  echo json_encode(get_option("itl_table_data")) ?: "null"; ?> 
); 
   </script> 
 
    <script type="text/javascript"> 
window.onload = function() { 
    var savedData = <?php  echo json_encode(get_option("itl_table_data"), JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT); ?> 
; 
    if(savedData) { 
        try { 
            // Base64 decode before parsing 
            var decodedData = atob(savedData); 
            var parsedData = JSON.parse(decodedData); 
            console.log("Parsed Table Data:", parsedData); 
            loadTableData(parsedData); 
        } catch(e) { 
            console.error("Error parsing saved data:", e); 
        } 
		updateNameTextareasEditableState(); // make textareas with a * uneditable 
    } else { 
        console.log("No saved data found."); 
    } 
} 
 
function loadTableData(data) { 
    if (data.length === 0) { 
        // If there is no data, just add one empty row for new entries 
        addRow(); 
        return; 
    } 
 
    data.forEach((row, index) => { 
		console.log("Processing row: ", index); 
        if (index === 0) { 
            // For the first iteration, ensure there's a table body available, but don't add a new row. Assume table structure exists. 
            const tbody = document.querySelector('#editableTable tbody'); 
            if (tbody.children.length === 0) { 
                addRow(); // Adds a first row if table is completely empty (should not happen with saved data) 
            } 
        } else { 
            // For subsequent rows, add a new row normally 
            addRow(); 
        } 
         
        // Use the current (possibly newly added) row or the first row if we're on the initial iteration 
        const currentRow = index === 0 ? document.querySelector('#editableTable tbody').firstElementChild : document.querySelector('#editableTable tbody').lastElementChild; 
 
        // Populate condition(s) 
        row.conditions.forEach((condition) => { 
            addPopulatedDetail(currentRow.children[1], condition.name, condition.content, condition.negativeMatch); // Pass negative match state 
			// Set the negativeMatch checkbox based on the loaded data 
			const negMatchCheckbox = currentRow.querySelectorAll('.detail-neg-match'); 
			if(negMatchCheckbox && negMatchCheckbox[index]) { // Check if the checkbox element exists 
				negMatchCheckbox[index].checked = condition.negativeMatch === true; 
			} 
        }); 
 
        // Populate action(s) 
        row.actions.forEach((action) => { 
            addPopulatedDetail(currentRow.children[2], action.name, action.content); // Assuming third child (2) is the action cell 
        }); 
         
    }); 
} 
</script> 
</div> 
<?php  $openai_key = get_option("itl_openai_api_key"); $openai_model = get_option("itl_default_model"); ?> 
 
    <h2>Settings</h2> 
    <form method="post" action="options.php"> 
        <?php  settings_fields("itl_openai_settings"); do_settings_sections("itl_openai_settings"); ?> 
        <table class="form-table"> 
            <tr valign="top"> 
                <th scope="row">OpenAI API Key</th> 
                <td><input type="text" name="itl_openai_api_key" value="<?php  echo esc_attr(get_option("itl_openai_api_key", '')); ?> 
" /></td> 
            </tr> 
            <tr valign="top"> 
                <th scope="row">Default OpenAI Model</th> 
                <td> 
                    <select name="itl_default_model"> 
                        <!-- Dynamically populate options --> 
                        <?php  $models = array("gpt-4-turbo-preview", "gpt-4-0125-preview", "gpt-4-1106-preview", "gpt-4", "gpt-3.5-turbo", "gpt-3.5-turbo-0125", "gpt-3.5-turbo-1106", "gpt-3.5-turbo-16k"); foreach ($models as $model) { echo "<option value="" . $model . """ . selected($openai_model, $model) . ">" . $model . "</option>"; } ?> 
                    </select> 
                </td> 
            </tr> 
			<tr valign="top"> 
                <th scope="row">Enable Debug Mode</th> 
                <td><input type="checkbox" name="itl_debug_mode" value="1" <?php  checked(1, get_option("itl_debug_mode", 0)); ?> 
 /> <a href="<?php  echo esc_url(plugins_url("itl-debug.log", __FILE__)); ?> 
" target="_blank">View Debug Log</a> - <a href="#" id="deleteDebugLog">Delete Debug Log</a></td> 
            </tr> 
            <tr valign="top"> 
        </table> 
        <?php  submit_button(); ?> 
    </form> 
 
    <!-- Display Table for OpenAI model details --> 
    <table border="1"> 
	  <tr> 
		<th>Model</th> 
		<th>Input</th> 
		<th>Output</th> 
		<th>Context Window</th> 
	  </tr> 
	  <tr> 
		<td>gpt-4-turbo-preview</td> 
		<td>$0.01 / 1k tokens</td> 
		<td>$0.03 / 1k tokens</td> 
		<td>128,000 tokens</td> 
	  </tr> 
	  <tr> 
		<td>gpt-4-0125-preview</td> 
		<td>$0.01 / 1k tokens</td> 
		<td>$0.03 / 1k tokens</td> 
		<td>128,000 tokens</td> 
	  </tr> 
	  <tr> 
		<td>gpt-4-1106-preview</td> 
		<td>$0.01 / 1k tokens</td> 
		<td>$0.03 / 1k tokens</td> 
		<td>128,000 tokens</td> 
	  </tr> 
	  <tr> 
		<td>gpt-4</td> 
		<td>$0.03 / 1k tokens</td> 
		<td>$0.06 / 1k tokens</td> 
		<td>8,192 tokens</td> 
	  </tr> 
	  <tr> 
		<td>gpt-3.5-turbo</td> 
		<td>$0.0015 / 1k tokens</td> 
		<td>$0.002 / 1k tokens</td> 
		<td>4,096 tokens</td> 
	  </tr> 
	  <tr> 
		<td>gpt-3.5-turbo-0125</td> 
		<td>$0.0005 / 1k tokens</td> 
		<td>$0.0015 / 1k tokens</td> 
		<td>16,385 tokens</td> 
	  </tr> 
	  <tr> 
		<td>gpt-3.5-turbo-1106</td> 
		<td>$0.001 / 1k tokens</td> 
		<td>$0.002 / 1k tokens</td> 
		<td>16,385 tokens</td> 
	  </tr> 
	  <tr> 
		<td>gpt-3.5-turbo-16k</td> 
		<td>$0.003 / 1k tokens</td> 
		<td>$0.006 / 1k tokens</td> 
		<td>16,385 tokens</td> 
	  </tr> 
	</table> 
	<div><p>Updated March 1st, 2024</p></div> 
 
 
<?php  wp_enqueue_style("itl-style", plugin_dir_url(__FILE__) . "itl-style.css", array(), "1.0"); if (itl_fs()->is__premium_only()) { wp_enqueue_script("itl-save-load-script", plugin_dir_url(__FILE__) . "save-load.js", array("jquery"), "1.0", true); } wp_enqueue_script("itl-ajax-script", plugin_dir_url(__FILE__) . "itl-ajax.js", array("jquery")); wp_localize_script("itl-ajax-script", "itlAjax", array("ajaxurl" => admin_url("admin-ajax.php"))); $license_id = itl_fs()->_get_license()->id; $install_id = itl_fs()->get_site()->id; $site_private_key = itl_fs()->get_site()->secret_key; $nonce = date("Y-m-d"); $pk_hash = hash("sha512", $site_private_key . "|" . $nonce); $authentication_string = base64_encode($pk_hash . "|" . $nonce); $url = "https://ifthenlogic.com/check.php?license=" . $license_id . "&installs=" . $install_id . ''; $response = wp_remote_get($url, array("headers" => array("Authorization" => $authentication_string), "timeout" => 45)); if (is_wp_error($response)) { $error_message = $response->get_error_message(); echo "<script>alert('Failed to reach license server: {$error_message}');</script><br>"; echo "Refresh the page to retry"; return; } $response_code = wp_remote_retrieve_response_code($response); if ($response_code !== 200) { echo "<script>alert('Failed to reach license server. HTTP response code: {$response_code}');</script><br>"; echo "Refresh the page to retry"; return; } $response_data = wp_remote_retrieve_body($response); echo $response_data; } goto mlr67; QwKFg: $gpt_responses = array(); goto BmG21; WbMxL: function replace_tokens_with_data(&$item) { global $gpt_responses, $rss_responses, $parsed_urls, $bing_results; if (preg_match_all("/%%gpt\.(.*?)%%/", $item, $gpt_matches)) { foreach ($gpt_matches[1] as $key) { if (isset($gpt_responses[$key])) { $messages = $gpt_responses[$key]["messages"]; $item = str_replace("%%gpt.{$key}%%", $messages, $item); itl_debug_log("Replaced GPT token: %%gpt.{$key}%% with messages: " . json_encode($messages)); } } } if (preg_match_all("/%%rss\.(.*?)\.([a-zA-Z0-9]+)%%/", $item, $rss_matches)) { foreach ($rss_matches[0] as $index => $placeholder) { $property = $rss_matches[1][$index]; $key = $rss_matches[2][$index]; if ($key === "random" || $key === "random-delete") { $randomKey = array_rand($rss_responses); if (isset($rss_responses[$randomKey][$property])) { $rss_value = $rss_responses[$randomKey][$property]; $item = str_replace($placeholder, $rss_value, $item); itl_debug_log("Replaced RSS token: {$placeholder} with random value from property: {$property}"); if ($key === "random-delete") { itl_debug_log("Deleted used random entry from RSS responses."); unset($rss_responses[$randomKey]); } } } else { if (isset($rss_responses[$key]) && isset($rss_responses[$key][$property])) { $rss_value = $rss_responses[$key][$property]; $item = str_replace($placeholder, $rss_value, $item); itl_debug_log("Replaced RSS token: {$placeholder} with value from property: {$property} at index: {$key}"); } } } } if (preg_match_all("/%%bing\.(.*?)\.([a-zA-Z0-9\-]+)%%/", $item, $bing_matches)) { foreach ($bing_matches[0] as $index => $placeholder) { $property = $bing_matches[1][$index]; $key = $bing_matches[2][$index]; if ($key === "random" || $key === "random-delete") { $randomKey = array_rand($bing_results); if (isset($bing_results[$randomKey][$property])) { $bing_value = $bing_results[$randomKey][$property]; $item = str_replace($placeholder, $bing_value, $item); itl_debug_log("Replaced Bing token: {$placeholder} with random value from property: {$property}"); if ($key === "random-delete") { itl_debug_log("Deleted used random entry from Bing responses."); unset($bing_results[$randomKey]); } } } else { if (isset($bing_results[$key]) && isset($bing_results[$key][$property])) { $bing_value = $bing_results[$key][$property]; $item = str_replace($placeholder, $bing_value, $item); itl_debug_log("Replaced Bing token: {$placeholder} with value from property: {$property} at index: {$key}"); } } } } if (preg_match_all("/%%parsed\.(.*?)%%/", $item, $url_matches)) { foreach ($url_matches[1] as $encodedUrl) { $url = urldecode($encodedUrl); if (isset($parsed_urls[$url])) { $url_content = $parsed_urls[$url]; $item = str_replace("%%parsed.{$encodedUrl}%%", $url_content, $item); itl_debug_log("Replaced parsed URL token: %%parsed.{$encodedUrl}%% with content: " . json_encode($url_content)); } } } $pattern = "/%%(.*?)\.(.*?)\.(.*?)%%/"; if (preg_match_all($pattern, $item, $matches)) { foreach ($matches[0] as $index => $placeholder) { $arrayName = $matches[1][$index]; $property = $matches[2][$index]; $key = $matches[3][$index]; if (isset($GLOBALS[$arrayName])) { $arrayVar = $GLOBALS[$arrayName]; } else { itl_debug_log("Global variable {$arrayName} does not exist."); itl_debug_log("Removed token: {$placeholder}"); $item = str_replace($placeholder, '', $item); continue; } if (is_array($arrayVar)) { if ($key === "random" || $key === "random-delete") { $randomKey = array_rand($arrayVar); if (isset($arrayVar[$randomKey][$property])) { $value = $arrayVar[$randomKey][$property]; $item = str_replace($placeholder, $value, $item); itl_debug_log("Replaced token: {$placeholder} with random value from property: {$property}"); if ($key === "random-delete") { itl_debug_log("Deleted used random entry from {$arrayName}."); unset($arrayVar[$randomKey]); } } } else { if (isset($arrayVar[$key]) && isset($arrayVar[$key][$property])) { $value = $arrayVar[$key][$property]; $item = str_replace($placeholder, $value, $item); itl_debug_log("Replaced token: {$placeholder} with value from property: {$property} at index: {$key}"); } } } } } if (preg_match_all("/%%%parsedown\.(.*?)%%%/s", $item, $parsedown_matches)) { require_once plugin_dir_path(__FILE__) . "Parsedown.php"; $parsedown = new Parsedown(); foreach ($parsedown_matches[1] as $input) { $parsed_content = $parsedown->text($input); $item = str_replace("%%%parsedown.{$input}%%%", $parsed_content, $item); itl_debug_log("Replaced Parsedown token: %%%parsedown.{$input}%%% with parsed content: " . $parsed_content); } } } ?>

Did this file decode correctly?

Original Code

<?php
 goto UNkNl; STQem: global $gpt_responses; goto QwKFg; GrZRW: require_once plugin_dir_path(__FILE__) . "\143\165\x73\164\157\155\137\x63\x6f\156\x64\x69\164\x69\x6f\156\x73\x2e\160\150\160"; goto Q6AS8; Nc2vR: add_action("\x61\x64\x6d\151\156\x5f\x6d\145\x6e\165", "\151\164\x6c\x5f\x61\144\x6d\151\x6e\137\155\145\x6e\165"); goto nZxX3; Mmkqo: global $bing_results; goto HF_Nq; FX39N: $rss_responses = array(); goto AgZQN; kPZln: function itl_debug_log($message) { if (get_option("\x69\x74\154\137\144\145\142\x75\147\137\155\x6f\x64\145") == 1) { $visitorIP = getClientIP(); $log_entry = date("\x59\x2d\x6d\55\144\x20\110\72\x69\72\163") . "\40\x2d\x20" . $visitorIP . "\x20\55\x20" . $_SERVER["\x52\x45\x51\125\x45\123\x54\x5f\x55\122\111"] . "\x20\55\40" . $message . "\xa"; $log_file = plugin_dir_path(__FILE__) . "\151\164\154\x2d\x64\145\x62\165\x67\56\154\157\x67"; file_put_contents($log_file, $log_entry, FILE_APPEND); } } goto siKGM; BgU2v: add_action("\167\160\137\x61\152\x61\170\137\151\164\154\137\163\x61\x76\x65\x5f\164\x61\x62\x6c\x65", "\151\164\x6c\x5f\163\141\166\145\137\x74\x61\x62\154\145"); goto m55qk; AgZQN: global $parsed_urls; goto CBl29; siKGM: function itl_sanitize_debug_mode($input) { $debug_mode_enabled = isset($input) && intval($input) === 1 ? true : false; $log_file = plugin_dir_path(__FILE__) . "\151\164\x6c\55\x64\x65\142\x75\x67\x2e\x6c\157\147"; if ($debug_mode_enabled) { if (is_writable($log_file) || !file_exists($log_file) && is_writable(dirname($log_file))) { file_put_contents($log_file, date("\131\x2d\x6d\x2d\x64\x20\110\x3a\151\x3a\163") . "\40\x2d\x20\x44\145\x62\x75\147\x20\x4d\157\144\x65\x20\105\156\x61\x62\154\145\144\xa", FILE_APPEND); } else { $debug_mode_enabled = false; add_settings_error("\x69\x74\x6c\137\144\145\142\x75\147\137\x6d\x6f\144\x65", "\x69\x74\154\x5f\x64\x65\142\165\x67\137\x6d\157\x64\145\x5f\145\x72\162\157\162", "\104\145\142\165\x67\40\x4d\157\x64\145\x20\x63\x6f\165\154\144\x20\x6e\x6f\x74\x20\142\145\x20\x65\x6e\x61\x62\154\145\144\40\142\x65\143\x61\165\163\145\x20\164\150\x65\40\x64\x65\x62\x75\147\x20\x6c\x6f\x67\40\146\151\154\145\40\151\163\x20\156\157\164\x20\167\x72\151\x74\x61\142\154\145\x2e\40\x50\x6c\145\141\163\x65\40\143\150\145\x63\x6b\x20\164\150\145\x20\146\151\x6c\x65\x20\160\145\x72\155\x69\163\163\x69\x6f\x6e\x73\56", "\145\x72\162\157\162"); } } return $debug_mode_enabled ? 1 : 0; } goto g9c99; I7SS4: function itl_register_settings() { register_setting("\151\x74\x6c\137\x6f\160\x65\x6e\x61\151\137\x73\145\164\164\x69\x6e\x67\x73", "\x69\x74\154\x5f\157\160\x65\x6e\x61\x69\x5f\141\160\151\x5f\x6b\x65\x79"); register_setting("\x69\164\x6c\137\157\160\x65\156\x61\151\x5f\163\x65\x74\164\x69\156\x67\x73", "\x69\x74\154\x5f\144\x65\146\141\x75\154\x74\x5f\155\157\144\145\154"); register_setting("\x69\164\154\137\157\160\x65\x6e\141\x69\137\163\x65\x74\164\x69\x6e\x67\163", "\151\164\x6c\137\144\x65\x62\165\x67\137\x6d\157\x64\x65", "\x69\x74\154\137\163\x61\156\x69\164\151\172\x65\x5f\144\145\142\165\x67\137\155\157\x64\145"); } goto R5SyU; m55qk: function itl_save_table() { if (isset($_POST["\x64\x61\164\x61"]) && !empty($_POST["\144\141\x74\141"])) { $data = wp_unslash($_POST["\x64\x61\x74\x61"]); $encodedData = base64_encode($data); update_option("\151\164\x6c\x5f\x74\141\x62\x6c\x65\x5f\x64\141\x74\141", $encodedData); echo "\124\141\x62\154\x65\40\144\x61\164\141\40\x73\x61\166\145\144\x20\163\x75\143\x63\x65\163\x73\x66\165\154\x6c\x79\56"; } else { echo "\105\x72\162\157\162\40\x73\141\x76\151\156\147\40\x64\141\x74\141\56"; } wp_die(); } goto I7SS4; CBl29: $parsed_urls = array(); goto Mmkqo; g9c99: add_action("\167\x70\x5f\x61\x6a\x61\x78\137\x64\x65\x6c\x65\164\x65\137\151\164\x6c\137\x64\x65\x62\165\147\x5f\154\157\147", "\151\x74\154\137\x64\145\x6c\145\x74\145\x5f\x64\145\142\165\x67\137\x6c\x6f\147\137\x63\141\154\154\142\x61\x63\x6b"); goto Uk1vo; HF_Nq: $bing_results = array(); goto Nc2vR; UNkNl: if (!function_exists("\151\164\x6c\137\x66\x73")) { function itl_fs() { global $itl_fs; if (!isset($itl_fs)) { require_once dirname(__FILE__) . "\57\x66\x72\145\145\x6d\151\x75\163\57\163\x74\x61\162\x74\56\x70\x68\x70"; $itl_fs = fs_dynamic_init(array("\151\144" => "\x31\65\x32\x31\x31", "\x73\x6c\x75\147" => "\151\x66\55\164\x68\x65\156\x2d\154\157\x67\x69\x63", "\x70\x72\145\x6d\151\165\155\137\x73\154\x75\x67" => "\x69\146\55\164\150\x65\156\55\x6c\157\x67\x69\x63", "\164\171\160\145" => "\160\x6c\x75\x67\x69\156", "\160\165\142\x6c\151\143\137\153\145\171" => "\x70\x6b\x5f\x37\x37\61\x61\64\146\x37\x38\x63\143\62\x36\63\x65\67\60\x64\70\63\71\67\64\x32\x30\71\145\66\70\67", "\151\x73\137\x70\x72\145\x6d\151\x75\155" => true, "\151\x73\137\x70\x72\x65\155\151\165\155\x5f\157\x6e\154\171" => true, "\x68\x61\x73\137\x61\x64\x64\157\156\x73" => false, "\150\x61\x73\x5f\x70\141\x69\144\x5f\x70\x6c\141\156\x73" => true, "\151\163\x5f\157\162\x67\137\x63\x6f\155\160\x6c\x69\x61\x6e\x74" => false, "\x6d\145\156\x75" => array("\163\154\165\147" => "\x69\146\55\164\150\x65\156\x2d\154\x6f\147\x69\143", "\163\x75\x70\x70\x6f\x72\x74" => false))); } return $itl_fs; } itl_fs(); do_action("\x69\x74\154\x5f\x66\163\137\154\157\141\x64\145\144"); } goto GrZRW; mlr67: add_action("\x69\x6e\x69\164", "\x69\x74\x6c\x5f\145\x76\141\x6c\x75\x61\x74\145\137\143\157\156\144\x69\164\151\x6f\x6e\x73\137\x61\x6e\144\x5f\145\170\x65\143\165\164\145\x5f\141\x63\x74\151\x6f\156\x73"); goto zLj5I; R5SyU: add_action("\x61\x64\155\x69\156\137\151\156\x69\164", "\151\x74\x6c\137\162\x65\x67\x69\163\164\x65\162\x5f\163\145\x74\x74\151\156\147\163"); goto kPZln; Uk1vo: function itl_delete_debug_log_callback() { if (!current_user_can("\x6d\141\x6e\141\147\145\137\x6f\x70\x74\151\x6f\x6e\x73")) { wp_send_json_error("\x49\x6e\x73\x75\146\x66\x69\x63\x69\x65\156\164\40\160\x65\162\155\151\163\x73\151\x6f\x6e\x73", 403); } $log_file = plugin_dir_path(__FILE__) . "\x69\164\x6c\55\x64\x65\142\x75\x67\x2e\154\x6f\147"; if (file_exists($log_file) && unlink($log_file)) { wp_send_json_success("\x44\x65\x62\165\x67\x20\x6c\157\147\40\x64\145\x6c\x65\164\x65\144\x20\x73\165\x63\143\145\x73\x73\146\x75\154\x6c\x79"); } else { wp_send_json_error("\x46\141\151\154\145\144\x20\x74\157\x20\x64\x65\x6c\145\x74\145\x20\144\x65\142\165\x67\40\x6c\157\147"); } wp_die(); } goto YuSb2; Q6AS8: require_once plugin_dir_path(__FILE__) . "\x63\165\x73\164\x6f\x6d\137\x61\143\x74\x69\157\x6e\163\56\160\150\x70"; goto STQem; zLj5I: function itl_evaluate_conditions_and_execute_actions() { if (is_admin() || defined("\x44\117\x49\116\x47\137\x43\122\x4f\x4e") && DOING_CRON || strpos($_SERVER["\x52\105\121\125\x45\x53\124\137\x55\x52\x49"], "\x2f\167\160\55\x6a\x73\x6f\x6e\x2f") !== false) { return; } $dataJson = get_option("\151\164\154\137\164\x61\142\154\145\x5f\x64\141\164\x61"); if (empty($dataJson)) { return; } $data = json_decode(base64_decode($dataJson), true); if (!$data) { return; } global $custom_conditions; global $custom_actions; foreach ($data as $row) { $conditionsMet = true; foreach ($row["\143\x6f\156\x64\x69\164\151\157\156\163"] as $condition) { if (array_key_exists($condition["\x6e\141\155\x65"], $custom_conditions)) { $normalizedContent = str_replace(array("\xd\12", "\15"), "\12", $condition["\x63\157\156\x74\x65\x6e\x74"]); $parameters = explode("\12", $normalizedContent); $parameters = array_map("\164\x72\151\155", $parameters); $parameters = array_filter($parameters, function ($line) { return !empty($line); }); $result = call_user_func($custom_conditions[$condition["\x6e\x61\x6d\x65"]], $parameters); itl_debug_log("\x43\x6f\x6e\x64\151\164\151\x6f\156\x20\143\150\145\x63\x6b\x65\x64\72\40" . $condition["\x6e\x61\x6d\x65"] . "\40\122\145\163\x75\154\x74\72\x20" . ($result ? "\155\141\164\x63\x68\x65\x64" : "\x6e\x6f\x74\40\155\141\x74\x63\x68\x65\x64")); } else { $preparedCondition = "\x72\x65\164\x75\x72\156\40\50" . $condition["\143\157\156\x74\145\x6e\164"] . "\x29\73"; try { $result = eval($preparedCondition); itl_debug_log("\103\x6f\x6e\x64\151\164\151\x6f\x6e\x20\x63\150\145\143\153\145\144\x3a\x20" . $condition["\156\x61\x6d\145"] . "\x20\x52\x65\x73\165\x6c\164\72\x20" . ($result ? "\155\x61\164\x63\x68\x65\x64" : "\156\157\164\40\x6d\x61\164\143\x68\x65\x64")); if (!$result) { $conditionsMet = false; break; } } catch (Throwable $e) { error_log("\x45\162\x72\157\162\40\x65\x76\x61\154\165\x61\x74\151\156\x67\40\x63\157\x6e\144\x69\x74\151\x6f\x6e\72\x20" . $e->getMessage()); itl_debug_log("\105\x72\x72\x6f\x72\x20\x65\x76\141\x6c\x75\x61\164\151\156\147\40\143\x6f\156\144\151\164\x69\x6f\x6e\72\40" . $condition["\x6e\x61\155\145"] . "\x20\x45\x72\162\157\162\x3a\x20" . $e->getMessage()); $conditionsMet = false; break; } } if (isset($condition["\x6e\x65\147\141\x74\x69\166\145\x4d\x61\x74\143\x68"]) && $condition["\156\x65\147\x61\164\x69\x76\145\115\x61\x74\x63\150"] === true) { $result = !$result; } if (!$result) { $conditionsMet = false; break; } } if ($conditionsMet) { $skipNextAction = 0; foreach ($row["\141\143\x74\151\x6f\156\x73"] as $action) { $content = $action["\143\157\x6e\x74\x65\x6e\x74"]; replace_tokens_with_data($content); if ($skipNextAction > 0) { $skipNextAction--; itl_debug_log("\x73\x6b\x69\160\x70\x69\156\147\40\x6e\x65\x78\164\x20\141\143\x74\151\x6f\156"); continue; } if (array_key_exists($action["\156\141\155\x65"], $custom_actions)) { $normalizedContent = str_replace(array("\xd\xa", "\15"), "\xa", $content); $parameters = explode("\12", $normalizedContent); $parameters = array_map("\x74\162\151\x6d", $parameters); $parameters = array_filter($parameters, function ($line) { return !empty($line); }); call_user_func($custom_actions[$action["\156\x61\x6d\x65"]], $parameters); itl_debug_log("\101\x63\x74\x69\x6f\156\40\x65\x78\145\143\x75\x74\145\144\72\x20" . $action["\x6e\141\155\x65"]); } else { try { eval($content); itl_debug_log("\x41\143\x74\151\157\x6e\x20\x65\170\x65\143\165\x74\x65\x64\72\40" . $action["\156\141\x6d\145"]); } catch (Throwable $e) { error_log("\105\x72\x72\157\162\x20\145\x78\x65\143\165\x74\x69\156\x67\40\x61\x63\x74\x69\x6f\x6e\72\x20" . $e->getMessage()); itl_debug_log("\105\162\x72\x6f\x72\x20\x65\x78\145\143\165\164\151\x6e\147\x20\141\143\x74\151\x6f\156\72\40" . $action["\156\141\x6d\x65"] . "\x20\x45\162\x72\x6f\162\x3a\x20" . $e->getMessage()); } } } itl_debug_log("\101\154\x6c\x20\x41\x63\164\151\157\x6e\x73\x20\x44\157\x6e\x65"); return; } } } goto WbMxL; BmG21: global $rss_responses; goto FX39N; nZxX3: function itl_admin_menu() { add_menu_page("\x49\146\40\x54\150\145\156\x20\114\157\147\151\x63", "\111\146\40\x54\x68\x65\x6e\40\x4c\x6f\x67\151\143", "\x6d\x61\156\x61\x67\x65\x5f\x6f\160\x74\151\x6f\156\x73", "\x69\146\x2d\164\x68\145\156\x2d\154\x6f\x67\x69\x63", "\x69\x74\154\137\x73\145\164\x74\151\x6e\147\x73\137\160\141\x67\x65"); } goto BgU2v; YuSb2: function itl_settings_page() { settings_errors(); ?>
<div class="wrap">
    <h2>If Then Logic</h2>
    <h3 id="saveMessage" style="display:none;"></h3> <!-- Placeholder for the savemessage -->
	<button class="button button-primary" id="saveTable">Save Conditions and Actions</button><br>
    <div id="tableContainer">
        <table id="editableTable">
            <thead>
                <tr>
                    <th>Order</th>
                    <th>Condition(s)</th>
                    <th>Action(s)</th>
                    <th>Modify</th>
                </tr>
            </thead>
            <tbody></tbody>
        </table>
        <button onclick="addRow()">Add Row</button>
    </div>
    
    <br><button class="button button-primary" id="saveTable2">Save Conditions and Actions</button>
	
	<div><br>* this name field can't be changed as it would break the code</div>
	<div><br>The current (server) date and time is: <?php  echo date("\x59\x2d\155\55\144\40\x48\72\x69\x3a\x73"); ?>
</div>

   <script>
   console.log(<?php  echo json_encode(get_option("\151\164\x6c\137\164\x61\x62\x6c\145\137\x64\x61\164\141")) ?: "\x6e\165\154\x6c"; ?>
);
   </script>

    <script type="text/javascript">
window.onload = function() {
    var savedData = <?php  echo json_encode(get_option("\151\x74\154\x5f\164\141\x62\x6c\145\x5f\144\141\x74\x61"), JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT); ?>
;
    if(savedData) {
        try {
            // Base64 decode before parsing
            var decodedData = atob(savedData);
            var parsedData = JSON.parse(decodedData);
            console.log("Parsed Table Data:", parsedData);
            loadTableData(parsedData);
        } catch(e) {
            console.error("Error parsing saved data:", e);
        }
		updateNameTextareasEditableState(); // make textareas with a * uneditable
    } else {
        console.log("No saved data found.");
    }
}

function loadTableData(data) {
    if (data.length === 0) {
        // If there is no data, just add one empty row for new entries
        addRow();
        return;
    }

    data.forEach((row, index) => {
		console.log("Processing row: ", index);
        if (index === 0) {
            // For the first iteration, ensure there's a table body available, but don't add a new row. Assume table structure exists.
            const tbody = document.querySelector('#editableTable tbody');
            if (tbody.children.length === 0) {
                addRow(); // Adds a first row if table is completely empty (should not happen with saved data)
            }
        } else {
            // For subsequent rows, add a new row normally
            addRow();
        }
        
        // Use the current (possibly newly added) row or the first row if we're on the initial iteration
        const currentRow = index === 0 ? document.querySelector('#editableTable tbody').firstElementChild : document.querySelector('#editableTable tbody').lastElementChild;

        // Populate condition(s)
        row.conditions.forEach((condition) => {
            addPopulatedDetail(currentRow.children[1], condition.name, condition.content, condition.negativeMatch); // Pass negative match state
			// Set the negativeMatch checkbox based on the loaded data
			const negMatchCheckbox = currentRow.querySelectorAll('.detail-neg-match');
			if(negMatchCheckbox && negMatchCheckbox[index]) { // Check if the checkbox element exists
				negMatchCheckbox[index].checked = condition.negativeMatch === true;
			}
        });

        // Populate action(s)
        row.actions.forEach((action) => {
            addPopulatedDetail(currentRow.children[2], action.name, action.content); // Assuming third child (2) is the action cell
        });
        
    });
}
</script>
</div>
<?php  $openai_key = get_option("\151\x74\x6c\x5f\157\x70\x65\156\141\x69\x5f\141\x70\151\137\x6b\145\171"); $openai_model = get_option("\x69\164\154\x5f\x64\x65\x66\141\x75\154\x74\137\155\157\x64\145\x6c"); ?>

    <h2>Settings</h2>
    <form method="post" action="options.php">
        <?php  settings_fields("\x69\x74\x6c\x5f\x6f\160\145\156\x61\151\x5f\x73\145\x74\164\151\x6e\147\163"); do_settings_sections("\151\x74\154\x5f\x6f\160\145\x6e\x61\151\137\163\x65\164\x74\x69\x6e\x67\x73"); ?>
        <table class="form-table">
            <tr valign="top">
                <th scope="row">OpenAI API Key</th>
                <td><input type="text" name="itl_openai_api_key" value="<?php  echo esc_attr(get_option("\151\x74\x6c\x5f\157\x70\145\x6e\141\x69\137\x61\160\151\x5f\153\x65\x79", '')); ?>
" /></td>
            </tr>
            <tr valign="top">
                <th scope="row">Default OpenAI Model</th>
                <td>
                    <select name="itl_default_model">
                        <!-- Dynamically populate options -->
                        <?php  $models = array("\147\160\164\x2d\64\x2d\x74\165\162\x62\x6f\x2d\160\x72\x65\x76\x69\145\167", "\147\160\164\x2d\64\55\x30\x31\x32\65\55\x70\x72\x65\x76\151\145\167", "\x67\x70\x74\55\x34\55\x31\x31\60\x36\55\x70\162\145\166\151\145\x77", "\147\160\164\55\x34", "\x67\160\164\x2d\63\x2e\65\55\164\x75\162\x62\x6f", "\x67\160\x74\x2d\x33\x2e\65\x2d\164\x75\162\142\157\55\x30\61\62\65", "\147\160\164\55\x33\56\65\55\164\165\x72\x62\x6f\x2d\61\x31\x30\66", "\x67\x70\164\x2d\x33\56\x35\x2d\x74\165\x72\x62\157\x2d\x31\x36\x6b"); foreach ($models as $model) { echo "\x3c\157\x70\x74\x69\x6f\x6e\40\166\x61\x6c\x75\x65\75\42" . $model . "\x22" . selected($openai_model, $model) . "\76" . $model . "\x3c\x2f\x6f\x70\164\x69\x6f\156\x3e"; } ?>
                    </select>
                </td>
            </tr>
			<tr valign="top">
                <th scope="row">Enable Debug Mode</th>
                <td><input type="checkbox" name="itl_debug_mode" value="1" <?php  checked(1, get_option("\x69\164\x6c\x5f\144\145\x62\165\x67\x5f\x6d\157\x64\x65", 0)); ?>
 /> <a href="<?php  echo esc_url(plugins_url("\x69\x74\154\55\x64\x65\142\165\147\56\x6c\x6f\x67", __FILE__)); ?>
" target="_blank">View Debug Log</a> - <a href="#" id="deleteDebugLog">Delete Debug Log</a></td>
            </tr>
            <tr valign="top">
        </table>
        <?php  submit_button(); ?>
    </form>

    <!-- Display Table for OpenAI model details -->
    <table border="1">
	  <tr>
		<th>Model</th>
		<th>Input</th>
		<th>Output</th>
		<th>Context Window</th>
	  </tr>
	  <tr>
		<td>gpt-4-turbo-preview</td>
		<td>$0.01 / 1k tokens</td>
		<td>$0.03 / 1k tokens</td>
		<td>128,000 tokens</td>
	  </tr>
	  <tr>
		<td>gpt-4-0125-preview</td>
		<td>$0.01 / 1k tokens</td>
		<td>$0.03 / 1k tokens</td>
		<td>128,000 tokens</td>
	  </tr>
	  <tr>
		<td>gpt-4-1106-preview</td>
		<td>$0.01 / 1k tokens</td>
		<td>$0.03 / 1k tokens</td>
		<td>128,000 tokens</td>
	  </tr>
	  <tr>
		<td>gpt-4</td>
		<td>$0.03 / 1k tokens</td>
		<td>$0.06 / 1k tokens</td>
		<td>8,192 tokens</td>
	  </tr>
	  <tr>
		<td>gpt-3.5-turbo</td>
		<td>$0.0015 / 1k tokens</td>
		<td>$0.002 / 1k tokens</td>
		<td>4,096 tokens</td>
	  </tr>
	  <tr>
		<td>gpt-3.5-turbo-0125</td>
		<td>$0.0005 / 1k tokens</td>
		<td>$0.0015 / 1k tokens</td>
		<td>16,385 tokens</td>
	  </tr>
	  <tr>
		<td>gpt-3.5-turbo-1106</td>
		<td>$0.001 / 1k tokens</td>
		<td>$0.002 / 1k tokens</td>
		<td>16,385 tokens</td>
	  </tr>
	  <tr>
		<td>gpt-3.5-turbo-16k</td>
		<td>$0.003 / 1k tokens</td>
		<td>$0.006 / 1k tokens</td>
		<td>16,385 tokens</td>
	  </tr>
	</table>
	<div><p>Updated March 1st, 2024</p></div>


<?php  wp_enqueue_style("\151\164\x6c\x2d\x73\x74\x79\x6c\x65", plugin_dir_url(__FILE__) . "\x69\164\154\x2d\163\x74\x79\x6c\145\x2e\143\163\163", array(), "\61\x2e\x30"); if (itl_fs()->is__premium_only()) { wp_enqueue_script("\x69\x74\154\55\x73\x61\x76\145\55\154\157\x61\x64\55\x73\x63\162\151\x70\x74", plugin_dir_url(__FILE__) . "\163\x61\166\x65\x2d\x6c\157\141\144\x2e\152\163", array("\x6a\x71\165\x65\x72\x79"), "\x31\56\60", true); } wp_enqueue_script("\x69\x74\x6c\x2d\x61\x6a\141\x78\x2d\x73\x63\162\x69\x70\164", plugin_dir_url(__FILE__) . "\151\x74\x6c\x2d\141\x6a\141\170\56\152\163", array("\152\161\165\145\162\x79")); wp_localize_script("\x69\x74\154\x2d\141\x6a\x61\x78\55\x73\x63\162\x69\160\x74", "\151\164\154\101\x6a\x61\170", array("\141\152\141\x78\165\x72\154" => admin_url("\x61\144\155\x69\x6e\55\x61\x6a\141\170\56\x70\150\160"))); $license_id = itl_fs()->_get_license()->id; $install_id = itl_fs()->get_site()->id; $site_private_key = itl_fs()->get_site()->secret_key; $nonce = date("\x59\55\155\55\x64"); $pk_hash = hash("\x73\x68\x61\x35\x31\x32", $site_private_key . "\x7c" . $nonce); $authentication_string = base64_encode($pk_hash . "\x7c" . $nonce); $url = "\x68\164\164\160\x73\x3a\57\x2f\151\x66\164\150\145\x6e\x6c\157\x67\x69\143\56\143\157\155\x2f\143\x68\145\x63\153\x2e\x70\150\160\x3f\x6c\x69\x63\x65\156\163\x65\75" . $license_id . "\x26\x69\156\163\x74\x61\x6c\x6c\163\75" . $install_id . ''; $response = wp_remote_get($url, array("\150\145\x61\x64\x65\162\x73" => array("\101\165\x74\x68\x6f\x72\x69\x7a\141\x74\x69\157\156" => $authentication_string), "\x74\x69\155\x65\x6f\x75\x74" => 45)); if (is_wp_error($response)) { $error_message = $response->get_error_message(); echo "\74\x73\143\162\151\160\x74\x3e\141\154\x65\162\164\50\x27\106\x61\x69\154\145\144\x20\164\x6f\x20\162\145\x61\x63\150\40\x6c\x69\x63\x65\156\163\x65\x20\x73\145\162\x76\145\162\72\40{$error_message}\x27\x29\x3b\74\57\163\143\162\151\x70\164\x3e\x3c\142\162\76"; echo "\122\x65\x66\162\x65\163\x68\40\164\x68\145\x20\x70\x61\x67\x65\40\x74\157\40\162\x65\x74\162\171"; return; } $response_code = wp_remote_retrieve_response_code($response); if ($response_code !== 200) { echo "\74\x73\x63\x72\x69\160\x74\x3e\141\154\145\162\164\x28\x27\106\141\x69\x6c\x65\144\40\164\157\x20\162\145\x61\x63\x68\40\x6c\151\143\145\x6e\163\145\x20\x73\145\162\x76\x65\x72\56\x20\110\124\124\120\40\x72\145\163\160\157\x6e\x73\145\x20\143\x6f\x64\145\72\x20{$response_code}\x27\x29\73\x3c\x2f\163\143\162\x69\160\164\x3e\74\142\x72\76"; echo "\122\x65\x66\x72\x65\x73\150\x20\164\150\145\40\x70\x61\x67\x65\x20\164\x6f\40\x72\x65\164\x72\171"; return; } $response_data = wp_remote_retrieve_body($response); echo $response_data; } goto mlr67; QwKFg: $gpt_responses = array(); goto BmG21; WbMxL: function replace_tokens_with_data(&$item) { global $gpt_responses, $rss_responses, $parsed_urls, $bing_results; if (preg_match_all("\57\x25\x25\147\x70\x74\x5c\56\x28\x2e\52\x3f\x29\45\x25\57", $item, $gpt_matches)) { foreach ($gpt_matches[1] as $key) { if (isset($gpt_responses[$key])) { $messages = $gpt_responses[$key]["\155\x65\x73\163\141\147\x65\163"]; $item = str_replace("\45\45\147\160\164\56{$key}\x25\45", $messages, $item); itl_debug_log("\x52\145\160\154\x61\143\x65\144\x20\x47\120\x54\x20\164\157\x6b\145\156\72\40\x25\x25\x67\x70\164\56{$key}\x25\45\40\167\x69\164\150\x20\x6d\145\163\x73\x61\147\145\163\x3a\x20" . json_encode($messages)); } } } if (preg_match_all("\57\45\45\162\163\163\x5c\56\50\56\52\77\51\x5c\x2e\x28\133\141\x2d\172\101\55\132\60\x2d\71\x5d\x2b\x29\45\x25\x2f", $item, $rss_matches)) { foreach ($rss_matches[0] as $index => $placeholder) { $property = $rss_matches[1][$index]; $key = $rss_matches[2][$index]; if ($key === "\x72\x61\156\144\157\x6d" || $key === "\x72\x61\156\144\x6f\155\55\x64\145\154\145\x74\x65") { $randomKey = array_rand($rss_responses); if (isset($rss_responses[$randomKey][$property])) { $rss_value = $rss_responses[$randomKey][$property]; $item = str_replace($placeholder, $rss_value, $item); itl_debug_log("\x52\145\160\154\141\143\x65\x64\x20\122\x53\123\40\x74\x6f\x6b\145\156\x3a\x20{$placeholder}\40\167\151\x74\150\40\x72\x61\156\x64\157\155\x20\x76\x61\154\x75\145\40\146\x72\x6f\155\x20\x70\x72\x6f\160\x65\x72\x74\x79\x3a\x20{$property}"); if ($key === "\162\141\156\144\x6f\155\55\x64\x65\154\145\x74\x65") { itl_debug_log("\x44\x65\154\145\164\x65\144\40\165\x73\x65\144\40\x72\x61\x6e\x64\x6f\155\40\x65\156\164\162\171\40\146\x72\x6f\x6d\40\x52\x53\123\40\x72\145\163\160\x6f\156\163\145\163\56"); unset($rss_responses[$randomKey]); } } } else { if (isset($rss_responses[$key]) && isset($rss_responses[$key][$property])) { $rss_value = $rss_responses[$key][$property]; $item = str_replace($placeholder, $rss_value, $item); itl_debug_log("\122\145\x70\x6c\141\x63\145\x64\x20\x52\x53\123\x20\164\x6f\153\145\x6e\x3a\40{$placeholder}\40\167\x69\x74\x68\x20\x76\141\x6c\165\x65\40\146\162\157\155\x20\x70\162\157\160\145\162\164\171\72\40{$property}\40\x61\x74\40\151\x6e\x64\145\170\x3a\40{$key}"); } } } } if (preg_match_all("\x2f\x25\x25\x62\151\x6e\x67\134\x2e\50\x2e\x2a\x3f\x29\134\56\50\x5b\x61\55\172\101\55\132\60\x2d\x39\134\x2d\135\53\x29\45\x25\x2f", $item, $bing_matches)) { foreach ($bing_matches[0] as $index => $placeholder) { $property = $bing_matches[1][$index]; $key = $bing_matches[2][$index]; if ($key === "\162\141\156\x64\x6f\x6d" || $key === "\162\x61\x6e\144\x6f\155\55\x64\145\154\145\164\x65") { $randomKey = array_rand($bing_results); if (isset($bing_results[$randomKey][$property])) { $bing_value = $bing_results[$randomKey][$property]; $item = str_replace($placeholder, $bing_value, $item); itl_debug_log("\x52\145\160\x6c\x61\x63\x65\144\40\102\151\156\x67\40\164\157\153\x65\x6e\72\x20{$placeholder}\40\x77\151\x74\x68\40\162\141\x6e\144\157\155\x20\x76\141\x6c\x75\x65\x20\146\x72\x6f\155\x20\160\x72\x6f\160\145\x72\164\171\x3a\x20{$property}"); if ($key === "\x72\141\156\144\x6f\x6d\55\x64\x65\x6c\x65\164\145") { itl_debug_log("\x44\x65\154\x65\x74\145\144\40\x75\163\145\x64\40\162\x61\x6e\144\157\155\x20\x65\x6e\164\x72\x79\40\146\162\x6f\x6d\x20\102\151\156\147\40\162\x65\x73\160\x6f\156\x73\145\x73\x2e"); unset($bing_results[$randomKey]); } } } else { if (isset($bing_results[$key]) && isset($bing_results[$key][$property])) { $bing_value = $bing_results[$key][$property]; $item = str_replace($placeholder, $bing_value, $item); itl_debug_log("\x52\x65\x70\154\x61\x63\x65\x64\40\x42\x69\x6e\147\x20\x74\x6f\x6b\x65\156\72\40{$placeholder}\x20\x77\x69\x74\x68\40\x76\141\154\x75\x65\x20\146\x72\157\155\x20\x70\162\157\x70\145\x72\164\x79\x3a\40{$property}\40\x61\164\40\x69\156\144\x65\x78\72\40{$key}"); } } } } if (preg_match_all("\x2f\45\x25\x70\141\162\x73\145\x64\x5c\56\x28\56\52\77\51\45\45\57", $item, $url_matches)) { foreach ($url_matches[1] as $encodedUrl) { $url = urldecode($encodedUrl); if (isset($parsed_urls[$url])) { $url_content = $parsed_urls[$url]; $item = str_replace("\x25\x25\160\141\162\163\145\x64\56{$encodedUrl}\45\x25", $url_content, $item); itl_debug_log("\122\x65\160\154\141\x63\x65\x64\40\x70\x61\162\x73\x65\144\x20\x55\122\x4c\40\x74\157\x6b\145\156\x3a\x20\x25\45\160\141\162\x73\x65\144\56{$encodedUrl}\x25\x25\x20\167\151\164\150\40\x63\157\x6e\x74\145\156\x74\x3a\40" . json_encode($url_content)); } } } $pattern = "\x2f\x25\45\x28\x2e\x2a\77\x29\134\x2e\x28\56\52\x3f\51\x5c\56\x28\x2e\x2a\x3f\x29\45\x25\57"; if (preg_match_all($pattern, $item, $matches)) { foreach ($matches[0] as $index => $placeholder) { $arrayName = $matches[1][$index]; $property = $matches[2][$index]; $key = $matches[3][$index]; if (isset($GLOBALS[$arrayName])) { $arrayVar = $GLOBALS[$arrayName]; } else { itl_debug_log("\107\154\157\x62\x61\x6c\x20\x76\141\x72\151\141\x62\154\145\x20{$arrayName}\x20\144\x6f\145\163\40\156\157\164\40\x65\x78\151\163\164\x2e"); itl_debug_log("\x52\x65\x6d\157\166\x65\144\40\164\x6f\153\x65\156\72\x20{$placeholder}"); $item = str_replace($placeholder, '', $item); continue; } if (is_array($arrayVar)) { if ($key === "\162\x61\x6e\144\157\x6d" || $key === "\162\x61\x6e\x64\157\155\x2d\x64\145\154\145\x74\145") { $randomKey = array_rand($arrayVar); if (isset($arrayVar[$randomKey][$property])) { $value = $arrayVar[$randomKey][$property]; $item = str_replace($placeholder, $value, $item); itl_debug_log("\x52\145\160\x6c\x61\x63\x65\144\x20\x74\x6f\153\145\156\x3a\40{$placeholder}\x20\x77\151\x74\150\x20\162\141\156\144\x6f\x6d\40\x76\x61\x6c\x75\x65\40\x66\162\x6f\155\40\160\x72\157\160\x65\162\x74\x79\x3a\40{$property}"); if ($key === "\162\141\x6e\144\x6f\155\55\x64\145\154\145\x74\145") { itl_debug_log("\104\145\154\145\x74\x65\x64\40\x75\x73\145\144\x20\x72\x61\x6e\144\157\x6d\x20\x65\x6e\x74\162\171\x20\146\162\157\155\40{$arrayName}\x2e"); unset($arrayVar[$randomKey]); } } } else { if (isset($arrayVar[$key]) && isset($arrayVar[$key][$property])) { $value = $arrayVar[$key][$property]; $item = str_replace($placeholder, $value, $item); itl_debug_log("\122\145\x70\x6c\141\x63\145\x64\x20\164\157\x6b\x65\x6e\72\x20{$placeholder}\x20\x77\x69\x74\x68\x20\x76\141\154\x75\x65\x20\x66\162\x6f\x6d\x20\160\x72\x6f\160\145\162\x74\171\72\40{$property}\x20\141\164\40\151\x6e\144\x65\170\x3a\x20{$key}"); } } } } } if (preg_match_all("\57\x25\45\45\160\141\162\163\145\144\x6f\x77\x6e\x5c\x2e\x28\x2e\x2a\x3f\x29\45\45\45\57\163", $item, $parsedown_matches)) { require_once plugin_dir_path(__FILE__) . "\120\x61\162\x73\145\x64\157\167\x6e\x2e\160\x68\x70"; $parsedown = new Parsedown(); foreach ($parsedown_matches[1] as $input) { $parsed_content = $parsedown->text($input); $item = str_replace("\45\45\x25\x70\141\162\x73\x65\144\x6f\167\156\x2e{$input}\x25\45\x25", $parsed_content, $item); itl_debug_log("\122\x65\x70\154\141\143\145\x64\x20\x50\141\162\x73\x65\x64\x6f\x77\x6e\x20\164\157\153\x65\156\x3a\40\45\45\45\160\141\162\x73\145\x64\157\167\x6e\x2e{$input}\45\45\45\x20\167\151\x74\x68\x20\x70\141\162\x73\145\x64\x20\143\157\156\x74\145\x6e\164\72\x20" . $parsed_content); } } }

Function Calls

None

Variables

None

Stats

MD5 b0c793b2b5c1d2c2b5ea5355f6cda06d
Eval Count 0
Decode Time 76 ms