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 lIlcf; Bx9I8: function itl_sanitize_debug_mode($input) { $debug_mode_enabled ..
Decoded Output download
<?php
goto lIlcf; Bx9I8: 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 ql39d; M3ABj: 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("\xa", $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"), "
", $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 jqGEE; lbfBa: global $rss_responses; goto cKqzo; XhET4: 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 n49p4; OyVxM: add_action("admin_init", "itl_register_settings"); goto TCjj4; AUOP_: add_action("init", "itl_evaluate_conditions_and_execute_actions"); goto M3ABj; oMaXQ: require_once plugin_dir_path(__FILE__) . "custom_actions.php"; goto tfcMt; O5Zcj: $bing_results = array(); goto duLC8; ql39d: add_action("wp_ajax_delete_itl_debug_log", "itl_delete_debug_log_callback"); goto OzNHG; lIlcf: 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", "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 f_x8w; tfcMt: global $gpt_responses; goto xrMWp; cKqzo: $rss_responses = array(); goto znP3M; hVL2g: function itl_admin_menu() { add_menu_page("If Then Logic", "If Then Logic", "manage_options", "if-then-logic", "itl_settings_page"); } goto yOOSD; xrMWp: $gpt_responses = array(); goto lbfBa; bmysA: $parsed_urls = array(); goto kokWC; duLC8: add_action("admin_menu", "itl_admin_menu"); goto hVL2g; yOOSD: add_action("wp_ajax_itl_save_table", "itl_save_table"); goto XhET4; znP3M: global $parsed_urls; goto bmysA; kokWC: global $bing_results; goto O5Zcj; TCjj4: 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 Bx9I8; lsR8K: 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 AUOP_; n49p4: 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 OyVxM; f_x8w: require_once plugin_dir_path(__FILE__) . "custom_conditions.php"; goto oMaXQ; OzNHG: 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 lsR8K; jqGEE: 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 lIlcf; Bx9I8: 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\x2d\144\x65\142\x75\x67\x2e\x6c\x6f\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\55\155\x2d\144\40\x48\72\151\72\x73") . "\40\x2d\40\x44\145\x62\165\x67\40\115\157\x64\x65\x20\105\x6e\141\142\x6c\x65\x64\xa", FILE_APPEND); } else { $debug_mode_enabled = false; add_settings_error("\x69\x74\154\x5f\144\x65\142\165\x67\137\x6d\x6f\x64\x65", "\151\164\154\x5f\x64\145\142\x75\x67\x5f\155\x6f\x64\x65\137\145\162\x72\x6f\x72", "\x44\x65\142\x75\x67\40\115\x6f\x64\x65\x20\143\157\x75\154\x64\x20\x6e\x6f\164\40\142\145\40\x65\156\141\x62\154\x65\x64\x20\142\145\x63\x61\165\163\x65\40\x74\150\145\x20\x64\x65\142\x75\147\40\x6c\x6f\x67\x20\146\151\154\x65\40\151\x73\40\156\x6f\164\x20\167\162\x69\164\141\142\x6c\x65\x2e\40\120\x6c\145\141\163\x65\x20\143\x68\x65\x63\153\40\164\x68\145\40\x66\151\x6c\145\40\160\x65\162\155\x69\163\163\151\x6f\x6e\163\56", "\145\x72\162\x6f\162"); } } return $debug_mode_enabled ? 1 : 0; } goto ql39d; M3ABj: function itl_evaluate_conditions_and_execute_actions() { if (is_admin() || defined("\104\117\111\x4e\x47\x5f\103\x52\x4f\116") && DOING_CRON || strpos($_SERVER["\x52\105\121\125\105\123\x54\x5f\125\122\111"], "\57\x77\160\x2d\152\163\x6f\156\x2f") !== false) { return; } $dataJson = get_option("\151\x74\x6c\137\164\141\142\154\145\137\x64\x61\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["\x63\157\x6e\x64\x69\x74\x69\157\156\163"] as $condition) { if (array_key_exists($condition["\156\x61\155\x65"], $custom_conditions)) { $normalizedContent = str_replace(array("\xd\12", "\15"), "\12", $condition["\x63\157\156\x74\x65\156\164"]); $parameters = explode("\xa", $normalizedContent); $parameters = array_map("\164\162\151\155", $parameters); $parameters = array_filter($parameters, function ($line) { return !empty($line); }); $result = call_user_func($custom_conditions[$condition["\x6e\x61\155\x65"]], $parameters); itl_debug_log("\x43\x6f\156\144\151\x74\x69\157\x6e\x20\x63\150\x65\143\153\x65\144\x3a\x20" . $condition["\156\141\x6d\145"] . "\40\x52\145\x73\165\154\x74\72\x20" . ($result ? "\x6d\141\164\x63\150\x65\144" : "\156\x6f\x74\x20\155\x61\x74\x63\150\145\x64")); } else { $preparedCondition = "\x72\145\x74\x75\x72\x6e\x20\50" . $condition["\x63\157\156\x74\x65\156\164"] . "\x29\x3b"; try { $result = eval($preparedCondition); itl_debug_log("\x43\157\156\x64\151\x74\151\x6f\x6e\x20\143\150\145\x63\x6b\x65\144\72\x20" . $condition["\156\x61\155\145"] . "\40\x52\x65\x73\165\154\x74\72\x20" . ($result ? "\155\x61\x74\x63\x68\145\144" : "\x6e\x6f\x74\x20\155\x61\164\143\150\x65\144")); if (!$result) { $conditionsMet = false; break; } } catch (Throwable $e) { error_log("\x45\x72\x72\157\x72\x20\x65\166\x61\x6c\x75\141\164\151\156\x67\40\143\157\x6e\x64\x69\164\x69\x6f\156\72\x20" . $e->getMessage()); itl_debug_log("\x45\x72\162\157\162\x20\145\x76\141\x6c\x75\x61\164\151\156\147\x20\x63\x6f\x6e\144\x69\164\x69\x6f\156\72\40" . $condition["\156\x61\155\x65"] . "\40\105\162\162\157\x72\72\40" . $e->getMessage()); $conditionsMet = false; break; } } if (isset($condition["\x6e\x65\x67\x61\164\151\x76\x65\x4d\141\x74\x63\150"]) && $condition["\x6e\x65\147\141\164\151\166\145\115\x61\x74\143\x68"] === true) { $result = !$result; } if (!$result) { $conditionsMet = false; break; } } if ($conditionsMet) { $skipNextAction = 0; foreach ($row["\x61\x63\164\151\157\156\x73"] as $action) { $content = $action["\x63\x6f\156\x74\145\156\164"]; replace_tokens_with_data($content); if ($skipNextAction > 0) { $skipNextAction--; itl_debug_log("\163\x6b\x69\160\x70\151\x6e\x67\40\156\x65\x78\x74\40\x61\x63\x74\x69\157\x6e"); continue; } if (array_key_exists($action["\x6e\141\x6d\145"], $custom_actions)) { $normalizedContent = str_replace(array("\15\12", "\xd"), "\12", $content); $parameters = explode("\12", $normalizedContent); $parameters = array_map("\x74\x72\x69\155", $parameters); $parameters = array_filter($parameters, function ($line) { return !empty($line); }); call_user_func($custom_actions[$action["\156\141\155\145"]], $parameters); itl_debug_log("\x41\143\x74\151\x6f\x6e\40\x65\170\145\143\165\164\x65\x64\x3a\x20" . $action["\156\x61\x6d\145"]); } else { try { eval($content); itl_debug_log("\x41\x63\x74\x69\157\156\40\145\x78\x65\143\165\164\145\x64\x3a\x20" . $action["\156\141\x6d\x65"]); } catch (Throwable $e) { error_log("\x45\162\x72\157\x72\40\145\170\145\x63\165\x74\x69\x6e\x67\40\141\x63\164\x69\x6f\156\72\x20" . $e->getMessage()); itl_debug_log("\x45\x72\x72\x6f\x72\x20\145\170\x65\143\x75\x74\151\156\x67\x20\x61\143\164\x69\157\x6e\72\40" . $action["\x6e\x61\155\145"] . "\40\105\x72\x72\157\162\x3a\x20" . $e->getMessage()); } } } itl_debug_log("\101\154\154\x20\x41\143\164\151\157\x6e\163\x20\x44\x6f\156\145"); return; } } } goto jqGEE; lbfBa: global $rss_responses; goto cKqzo; XhET4: function itl_save_table() { if (isset($_POST["\144\141\164\141"]) && !empty($_POST["\x64\141\x74\x61"])) { $data = wp_unslash($_POST["\144\x61\164\141"]); $encodedData = base64_encode($data); update_option("\x69\164\x6c\137\x74\x61\x62\154\145\x5f\144\141\164\141", $encodedData); echo "\124\x61\142\154\x65\x20\x64\141\164\x61\x20\163\x61\166\145\x64\x20\163\165\x63\x63\145\163\x73\146\x75\x6c\x6c\171\x2e"; } else { echo "\105\162\x72\x6f\x72\40\x73\x61\166\151\x6e\x67\40\x64\141\x74\x61\x2e"; } wp_die(); } goto n49p4; OyVxM: add_action("\141\x64\155\x69\156\137\151\x6e\151\x74", "\151\x74\154\x5f\x72\x65\147\151\x73\x74\145\x72\137\x73\145\x74\164\151\x6e\x67\163"); goto TCjj4; AUOP_: add_action("\151\156\x69\164", "\151\x74\154\137\x65\x76\141\x6c\165\141\164\x65\137\x63\x6f\x6e\x64\x69\x74\x69\x6f\156\163\x5f\x61\156\144\137\x65\x78\145\x63\165\x74\x65\x5f\141\x63\x74\x69\157\156\163"); goto M3ABj; oMaXQ: require_once plugin_dir_path(__FILE__) . "\143\165\x73\164\157\155\137\x61\x63\x74\151\x6f\156\x73\56\x70\x68\x70"; goto tfcMt; O5Zcj: $bing_results = array(); goto duLC8; ql39d: add_action("\167\x70\137\141\152\x61\x78\x5f\x64\x65\x6c\145\x74\x65\137\x69\x74\x6c\137\144\145\142\x75\x67\x5f\x6c\x6f\x67", "\x69\x74\x6c\137\144\145\154\145\x74\x65\137\x64\x65\x62\x75\x67\137\154\x6f\x67\x5f\x63\141\x6c\x6c\x62\141\x63\x6b"); goto OzNHG; lIlcf: if (!function_exists("\151\x74\x6c\137\x66\163")) { function itl_fs() { global $itl_fs; if (!isset($itl_fs)) { require_once dirname(__FILE__) . "\57\x66\162\x65\145\x6d\x69\165\x73\57\x73\x74\141\162\164\x2e\160\x68\x70"; $itl_fs = fs_dynamic_init(array("\x69\x64" => "\61\65\62\x31\61", "\x73\x6c\x75\x67" => "\151\x66\x2d\x74\150\x65\x6e\x2d\x6c\x6f\147\x69\143", "\x74\x79\x70\145" => "\x70\x6c\165\x67\x69\x6e", "\160\165\142\154\x69\x63\x5f\153\x65\171" => "\160\x6b\x5f\x37\x37\x31\x61\x34\x66\67\70\143\x63\62\66\x33\145\67\60\x64\x38\x33\71\x37\64\x32\60\x39\145\x36\70\x37", "\151\163\x5f\x70\x72\x65\155\x69\165\x6d" => true, "\x69\163\137\x70\162\x65\155\x69\x75\155\x5f\x6f\156\154\171" => true, "\150\141\163\137\141\144\x64\x6f\x6e\163" => false, "\150\141\x73\137\160\x61\151\144\x5f\160\154\141\x6e\x73" => true, "\x69\163\x5f\157\162\147\x5f\143\157\x6d\x70\x6c\151\141\x6e\x74" => false, "\x6d\x65\x6e\x75" => array("\163\154\x75\x67" => "\x69\x66\55\x74\x68\x65\x6e\55\154\x6f\147\151\143", "\163\165\x70\x70\157\162\x74" => false))); } return $itl_fs; } itl_fs(); do_action("\x69\x74\154\x5f\x66\x73\137\x6c\157\x61\x64\x65\144"); } goto f_x8w; tfcMt: global $gpt_responses; goto xrMWp; cKqzo: $rss_responses = array(); goto znP3M; hVL2g: function itl_admin_menu() { add_menu_page("\111\x66\40\124\150\145\x6e\40\x4c\x6f\x67\x69\143", "\x49\146\40\x54\x68\145\156\40\x4c\x6f\x67\151\x63", "\155\141\x6e\x61\x67\145\137\157\160\x74\x69\x6f\156\x73", "\x69\146\55\164\x68\145\156\55\154\157\147\x69\x63", "\x69\x74\154\x5f\163\145\164\x74\x69\156\147\x73\137\160\141\x67\145"); } goto yOOSD; xrMWp: $gpt_responses = array(); goto lbfBa; bmysA: $parsed_urls = array(); goto kokWC; duLC8: add_action("\141\x64\155\x69\x6e\x5f\155\x65\156\165", "\151\164\x6c\137\141\x64\155\151\x6e\137\155\x65\x6e\x75"); goto hVL2g; yOOSD: add_action("\167\160\x5f\141\152\x61\x78\x5f\151\x74\154\x5f\163\x61\166\145\137\164\x61\142\154\x65", "\x69\x74\154\x5f\x73\141\166\145\x5f\164\x61\142\154\x65"); goto XhET4; znP3M: global $parsed_urls; goto bmysA; kokWC: global $bing_results; goto O5Zcj; TCjj4: function itl_debug_log($message) { if (get_option("\x69\x74\154\x5f\x64\x65\x62\165\147\137\x6d\157\x64\145") == 1) { $visitorIP = getClientIP(); $log_entry = date("\131\x2d\155\55\144\40\x48\72\x69\x3a\x73") . "\40\55\40" . $visitorIP . "\x20\55\x20" . $_SERVER["\x52\105\x51\x55\x45\123\x54\x5f\x55\x52\111"] . "\40\x2d\x20" . $message . "\xa"; $log_file = plugin_dir_path(__FILE__) . "\151\x74\x6c\x2d\x64\x65\x62\x75\147\56\x6c\x6f\x67"; file_put_contents($log_file, $log_entry, FILE_APPEND); } } goto Bx9I8; lsR8K: 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("\131\55\x6d\x2d\x64\40\110\72\151\x3a\163"); ?>
</div>
<script>
console.log(<?php echo json_encode(get_option("\151\x74\154\137\x74\x61\142\x6c\x65\x5f\144\x61\x74\x61")) ?: "\156\x75\154\x6c"; ?>
);
</script>
<script type="text/javascript">
window.onload = function() {
var savedData = <?php echo json_encode(get_option("\x69\164\154\137\x74\x61\x62\x6c\x65\137\144\x61\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("\x69\x74\154\137\x6f\160\145\156\x61\x69\137\x61\x70\x69\x5f\x6b\145\171"); $openai_model = get_option("\151\x74\154\x5f\x64\x65\146\141\165\154\x74\137\155\x6f\x64\x65\x6c"); ?>
<h2>Settings</h2>
<form method="post" action="options.php">
<?php settings_fields("\151\164\154\x5f\x6f\x70\x65\156\141\151\x5f\x73\x65\x74\164\151\x6e\147\163"); do_settings_sections("\x69\x74\154\x5f\x6f\160\145\156\141\151\137\x73\145\164\x74\x69\156\x67\163"); ?>
<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("\x69\x74\154\137\157\160\145\156\141\151\137\x61\160\x69\137\x6b\x65\171", '')); ?>
" /></td>
</tr>
<tr valign="top">
<th scope="row">Default OpenAI Model</th>
<td>
<select name="itl_default_model">
<!-- Dynamically populate options -->
<?php $models = array("\x67\x70\x74\x2d\64\55\x74\165\x72\142\157\x2d\x70\x72\145\166\151\145\167", "\x67\x70\x74\x2d\64\x2d\60\61\62\65\x2d\160\162\x65\x76\151\145\x77", "\x67\160\164\55\x34\x2d\x31\61\x30\66\x2d\160\162\x65\166\x69\145\x77", "\x67\160\164\55\x34", "\147\160\164\55\x33\x2e\x35\x2d\x74\x75\x72\x62\157", "\147\160\x74\55\63\56\65\55\164\165\162\142\157\x2d\x30\61\x32\x35", "\147\x70\x74\55\x33\x2e\x35\x2d\164\165\x72\x62\157\x2d\x31\x31\60\66", "\x67\x70\164\55\x33\56\65\55\x74\x75\x72\x62\x6f\x2d\61\x36\153"); foreach ($models as $model) { echo "\x3c\157\160\x74\x69\x6f\x6e\x20\x76\141\x6c\x75\x65\x3d\x22" . $model . "\x22" . selected($openai_model, $model) . "\76" . $model . "\74\x2f\x6f\160\x74\151\x6f\156\76"; } ?>
</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("\151\164\x6c\137\144\145\x62\165\x67\137\x6d\157\x64\x65", 0)); ?>
/> <a href="<?php echo esc_url(plugins_url("\x69\x74\x6c\55\x64\x65\142\165\x67\x2e\154\x6f\147", __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("\x69\x74\x6c\55\x73\164\171\154\145", plugin_dir_url(__FILE__) . "\151\164\154\x2d\x73\164\x79\154\145\56\143\163\163", array(), "\x31\x2e\x30"); if (itl_fs()->is__premium_only()) { wp_enqueue_script("\x69\164\x6c\55\163\x61\166\x65\55\x6c\157\141\144\x2d\x73\x63\162\x69\x70\x74", plugin_dir_url(__FILE__) . "\163\141\x76\145\55\154\157\x61\x64\56\152\x73", array("\x6a\161\165\145\162\x79"), "\x31\x2e\60", true); } wp_enqueue_script("\151\164\154\55\141\152\141\x78\x2d\x73\143\x72\151\x70\164", plugin_dir_url(__FILE__) . "\151\164\x6c\x2d\x61\152\141\170\56\152\x73", array("\152\161\x75\x65\162\171")); wp_localize_script("\151\x74\x6c\55\141\152\x61\170\x2d\x73\x63\x72\151\x70\x74", "\151\164\x6c\101\x6a\141\170", array("\x61\x6a\141\x78\165\x72\154" => admin_url("\141\144\155\x69\156\x2d\x61\x6a\141\x78\56\x70\x68\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\x2d\x64"); $pk_hash = hash("\x73\x68\x61\65\x31\x32", $site_private_key . "\x7c" . $nonce); $authentication_string = base64_encode($pk_hash . "\174" . $nonce); $url = "\150\164\x74\x70\x73\x3a\x2f\57\x69\x66\164\x68\145\156\154\x6f\x67\x69\143\56\x63\157\155\x2f\x63\150\145\143\153\56\160\150\160\77\154\151\143\145\x6e\163\145\x3d" . $license_id . "\46\151\156\x73\x74\x61\x6c\154\x73\x3d" . $install_id . ''; $response = wp_remote_get($url, array("\150\x65\x61\144\145\x72\x73" => array("\101\165\164\150\x6f\x72\151\172\x61\164\151\x6f\156" => $authentication_string), "\x74\151\x6d\145\x6f\165\164" => 45)); if (is_wp_error($response)) { $error_message = $response->get_error_message(); echo "\x3c\163\x63\x72\x69\160\x74\x3e\x61\154\145\162\x74\x28\47\x46\x61\151\x6c\145\144\x20\x74\157\x20\x72\145\141\143\150\x20\x6c\151\143\x65\x6e\163\x65\40\x73\145\162\166\x65\x72\72\x20{$error_message}\47\51\73\74\x2f\163\x63\x72\x69\x70\x74\x3e\x3c\142\x72\x3e"; echo "\x52\145\x66\x72\145\x73\x68\40\x74\x68\x65\40\160\x61\x67\x65\40\x74\157\40\162\x65\x74\x72\171"; return; } $response_code = wp_remote_retrieve_response_code($response); if ($response_code !== 200) { echo "\74\x73\x63\162\151\160\164\x3e\141\154\145\x72\164\50\47\x46\x61\151\x6c\x65\144\40\164\x6f\40\162\x65\x61\143\150\40\154\x69\x63\145\x6e\x73\x65\40\163\145\x72\166\x65\162\x2e\x20\110\124\x54\120\40\x72\x65\163\160\157\x6e\x73\x65\40\143\x6f\144\145\72\40{$response_code}\47\51\x3b\x3c\57\163\x63\x72\151\160\x74\x3e\x3c\x62\x72\76"; echo "\122\x65\x66\162\x65\163\x68\x20\164\x68\145\40\160\141\x67\x65\x20\164\x6f\40\x72\145\164\162\x79"; return; } $response_data = wp_remote_retrieve_body($response); echo $response_data; } goto AUOP_; n49p4: function itl_register_settings() { register_setting("\x69\x74\x6c\137\157\160\x65\156\141\x69\137\x73\145\x74\164\x69\x6e\147\x73", "\x69\164\154\x5f\157\160\x65\x6e\141\151\137\x61\x70\x69\x5f\x6b\145\171"); register_setting("\151\164\154\137\157\x70\x65\x6e\141\x69\x5f\163\145\164\x74\151\156\147\163", "\151\164\x6c\137\x64\x65\146\141\165\x6c\164\x5f\x6d\157\144\x65\x6c"); register_setting("\x69\x74\154\137\157\x70\145\156\141\x69\137\163\145\164\164\151\156\147\163", "\151\x74\x6c\137\144\x65\142\165\x67\137\x6d\157\144\145", "\151\164\154\137\163\x61\x6e\x69\x74\151\172\x65\137\x64\145\142\165\x67\x5f\x6d\x6f\x64\145"); } goto OyVxM; f_x8w: require_once plugin_dir_path(__FILE__) . "\143\x75\163\x74\x6f\155\137\143\157\x6e\x64\x69\x74\x69\157\x6e\x73\x2e\160\x68\x70"; goto oMaXQ; OzNHG: function itl_delete_debug_log_callback() { if (!current_user_can("\x6d\141\x6e\141\x67\x65\137\157\160\164\151\157\156\x73")) { wp_send_json_error("\111\156\163\165\146\x66\151\x63\151\145\156\x74\40\160\145\162\x6d\151\x73\x73\151\x6f\156\163", 403); } $log_file = plugin_dir_path(__FILE__) . "\151\x74\154\55\x64\145\x62\x75\x67\x2e\x6c\157\147"; if (file_exists($log_file) && unlink($log_file)) { wp_send_json_success("\x44\x65\142\x75\147\40\x6c\x6f\147\40\144\145\154\145\164\145\x64\40\163\x75\143\143\x65\163\163\146\x75\154\154\171"); } else { wp_send_json_error("\106\x61\151\154\145\144\x20\x74\x6f\x20\144\145\154\145\x74\x65\x20\x64\x65\x62\165\147\x20\154\157\x67"); } wp_die(); } goto lsR8K; jqGEE: function replace_tokens_with_data(&$item) { global $gpt_responses, $rss_responses, $parsed_urls, $bing_results; if (preg_match_all("\x2f\45\x25\147\x70\x74\134\x2e\x28\56\52\77\x29\x25\45\x2f", $item, $gpt_matches)) { foreach ($gpt_matches[1] as $key) { if (isset($gpt_responses[$key])) { $messages = $gpt_responses[$key]["\155\x65\x73\163\141\147\145\163"]; $item = str_replace("\45\x25\147\x70\164\x2e{$key}\x25\45", $messages, $item); itl_debug_log("\122\x65\x70\x6c\141\143\x65\144\40\107\x50\124\40\164\157\x6b\145\156\72\40\45\45\147\x70\164\56{$key}\x25\45\40\167\x69\x74\x68\x20\x6d\x65\163\x73\x61\x67\145\x73\72\40" . json_encode($messages)); } } } if (preg_match_all("\57\45\45\x72\163\x73\134\56\50\56\x2a\77\x29\x5c\x2e\x28\133\141\55\x7a\101\55\x5a\x30\x2d\71\x5d\53\x29\x25\x25\57", $item, $rss_matches)) { foreach ($rss_matches[0] as $index => $placeholder) { $property = $rss_matches[1][$index]; $key = $rss_matches[2][$index]; if ($key === "\x72\x61\x6e\x64\157\155" || $key === "\x72\141\x6e\144\x6f\x6d\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\x65\160\154\141\x63\x65\x64\40\x52\x53\x53\x20\164\157\153\x65\156\72\x20{$placeholder}\40\x77\151\x74\x68\40\x72\x61\156\144\x6f\155\40\166\x61\154\x75\145\40\146\162\x6f\155\40\160\x72\x6f\160\x65\162\164\171\x3a\40{$property}"); if ($key === "\162\141\156\144\157\x6d\55\x64\145\x6c\x65\x74\x65") { itl_debug_log("\x44\x65\154\145\x74\145\144\40\165\163\x65\144\40\x72\141\156\144\x6f\155\x20\x65\156\164\162\x79\40\x66\x72\x6f\x6d\40\122\123\123\x20\162\145\x73\160\157\x6e\x73\145\x73\x2e"); 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\x65\160\154\141\143\145\144\40\x52\123\x53\x20\164\x6f\x6b\x65\156\x3a\x20{$placeholder}\40\167\151\x74\x68\40\x76\x61\x6c\x75\x65\40\x66\162\157\155\x20\x70\x72\x6f\x70\x65\x72\164\x79\72\x20{$property}\40\141\x74\x20\x69\x6e\x64\145\170\72\x20{$key}"); } } } } if (preg_match_all("\x2f\x25\x25\142\x69\156\x67\x5c\x2e\x28\56\52\77\x29\x5c\x2e\50\x5b\141\55\x7a\x41\55\132\60\x2d\71\134\x2d\135\x2b\51\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 === "\x72\141\x6e\144\157\155" || $key === "\162\x61\x6e\144\157\x6d\x2d\x64\145\x6c\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("\122\x65\160\x6c\x61\143\145\144\40\102\151\x6e\x67\x20\x74\157\153\145\156\72\x20{$placeholder}\40\167\151\x74\150\40\x72\x61\156\144\157\155\40\x76\x61\154\165\x65\40\146\162\157\155\40\x70\162\x6f\x70\x65\x72\164\x79\72\x20{$property}"); if ($key === "\162\x61\x6e\144\x6f\155\55\x64\x65\x6c\x65\x74\145") { itl_debug_log("\x44\x65\x6c\145\164\145\144\40\x75\163\145\x64\x20\x72\141\x6e\144\157\x6d\40\x65\x6e\164\162\171\40\146\162\157\155\x20\x42\x69\x6e\x67\x20\162\145\163\x70\157\156\x73\145\x73\56"); 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\160\154\141\x63\x65\x64\40\x42\151\x6e\147\40\x74\x6f\153\x65\156\72\x20{$placeholder}\40\167\x69\x74\150\40\x76\141\x6c\165\145\40\x66\x72\157\x6d\x20\x70\x72\157\160\145\162\164\171\72\x20{$property}\x20\x61\164\x20\151\x6e\144\145\x78\72\x20{$key}"); } } } } if (preg_match_all("\57\45\x25\160\141\x72\163\145\x64\134\56\x28\x2e\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("\45\x25\160\x61\162\163\x65\144\56{$encodedUrl}\45\x25", $url_content, $item); itl_debug_log("\122\145\160\154\141\143\x65\x64\40\160\x61\x72\x73\x65\144\x20\x55\x52\x4c\40\x74\157\x6b\145\x6e\x3a\40\x25\45\x70\x61\162\163\145\x64\56{$encodedUrl}\x25\45\40\x77\x69\164\x68\40\x63\157\x6e\x74\x65\x6e\x74\72\x20" . json_encode($url_content)); } } } $pattern = "\x2f\x25\x25\50\56\52\77\x29\134\x2e\x28\56\52\x3f\51\x5c\56\x28\x2e\x2a\77\51\x25\45\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("\x47\x6c\157\142\x61\x6c\x20\166\141\162\x69\141\142\154\145\x20{$arrayName}\40\x64\157\x65\x73\x20\156\x6f\x74\40\x65\170\151\x73\x74\56"); itl_debug_log("\122\145\x6d\x6f\166\x65\144\x20\x74\x6f\x6b\x65\x6e\x3a\40{$placeholder}"); $item = str_replace($placeholder, '', $item); continue; } if (is_array($arrayVar)) { if ($key === "\162\x61\156\144\x6f\x6d" || $key === "\x72\x61\x6e\x64\157\x6d\x2d\x64\145\154\145\164\x65") { $randomKey = array_rand($arrayVar); if (isset($arrayVar[$randomKey][$property])) { $value = $arrayVar[$randomKey][$property]; $item = str_replace($placeholder, $value, $item); itl_debug_log("\x52\x65\x70\154\141\x63\x65\144\40\x74\x6f\153\145\156\72\x20{$placeholder}\x20\167\151\x74\150\x20\x72\x61\156\144\x6f\x6d\x20\166\x61\x6c\165\x65\40\146\x72\x6f\x6d\40\160\x72\x6f\x70\145\x72\164\171\72\x20{$property}"); if ($key === "\x72\x61\x6e\144\157\x6d\x2d\144\145\154\145\164\x65") { itl_debug_log("\x44\145\154\x65\x74\x65\144\x20\165\163\145\x64\x20\x72\x61\x6e\144\x6f\x6d\x20\x65\x6e\x74\162\171\x20\x66\x72\157\x6d\x20{$arrayName}\56"); 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("\x52\x65\x70\x6c\141\143\145\144\40\164\157\153\145\156\72\40{$placeholder}\40\x77\x69\x74\150\x20\166\141\x6c\x75\145\40\x66\162\x6f\x6d\x20\x70\162\x6f\160\145\162\164\x79\72\x20{$property}\40\x61\x74\40\151\x6e\144\145\x78\x3a\x20{$key}"); } } } } } if (preg_match_all("\57\45\x25\45\x70\x61\x72\163\x65\144\157\167\x6e\134\x2e\x28\x2e\52\77\x29\x25\x25\45\57\x73", $item, $parsedown_matches)) { require_once plugin_dir_path(__FILE__) . "\x50\141\x72\x73\x65\144\x6f\x77\x6e\x2e\x70\x68\160"; $parsedown = new Parsedown(); foreach ($parsedown_matches[1] as $input) { $parsed_content = $parsedown->text($input); $item = str_replace("\45\45\x25\160\x61\x72\x73\x65\144\157\167\156\56{$input}\45\x25\x25", $parsed_content, $item); itl_debug_log("\x52\x65\x70\154\141\x63\x65\144\40\120\141\x72\163\x65\144\x6f\x77\x6e\x20\x74\x6f\x6b\x65\x6e\72\40\45\45\x25\160\x61\162\163\145\144\157\x77\x6e\x2e{$input}\x25\x25\45\x20\167\151\164\x68\x20\x70\141\x72\163\x65\x64\40\143\157\x6e\164\x65\156\164\x3a\x20" . $parsed_content); } } }
Function Calls
None |
Stats
MD5 | f46c6a799097475a8735f64f5b045edf |
Eval Count | 0 |
Decode Time | 89 ms |