get_option_name('proxy-check')); $params = []; if (isset($_GET['page'])) { $params['page'] = sanitize_text_field(wp_unslash($_GET['page'])); } if (isset($_GET['tab'])) { $params['tab'] = sanitize_text_field(wp_unslash($_GET['tab'])); } header('Location: admin.php?' . build_query($params)); exit; } if (isset($_GET['notification'])) { if (isset($_GET['action'])) { check_admin_referer('ti-notification'); $type = sanitize_text_field(wp_unslash($_GET['notification'])); $action = sanitize_text_field(wp_unslash($_GET['action'])); $options = $pluginManagerInstance->getNotificationOptions($type); switch ($action) { case 'later': $remindDays = isset($_GET['remind-days']) ? (int)$_GET['remind-days'] : 14; $pluginManagerInstance->setNotificationParam($type, 'timestamp', time() + ($remindDays * 86400)); break; case 'close': if ($options['hide-on-close']) { $pluginManagerInstance->setNotificationParam($type, 'active', false); } break; case 'open': if ($options['hide-on-open']) { $pluginManagerInstance->setNotificationParam($type, 'active', false); } if ($options['redirect']) { header('Location: '. $options['redirect']); exit; } break; case 'hide': $pluginManagerInstance->setNotificationParam($type, 'hidden', true); header('Location: admin.php?page=' . sanitize_text_field(wp_unslash($_GET['page'])) .'&tab=advanced'); break; case 'unhide': $pluginManagerInstance->setNotificationParam($type, 'hidden', false); header('Location: admin.php?page=' . sanitize_text_field(wp_unslash($_GET['page'])) .'&tab=advanced'); break; } } exit; } if (isset($_REQUEST['command']) && $_REQUEST['command'] === 'rate-us-feedback') { check_admin_referer('ti-rate-us'); $text = isset($_POST['text']) ? trim(wp_kses_post(sanitize_text_field(wp_unslash($_POST['text'])))) : ""; $email = isset($_POST['email']) ? trim(sanitize_text_field(wp_unslash($_POST['email']))) : ""; $star = isset($_REQUEST['star']) ? (int)$_REQUEST['star'] : 1; update_option($pluginManagerInstance->get_option_name('rate-us-feedback'), $star, false); if ($star > 3) { header('Location: https://wordpress.org/support/plugin/'. $pluginManagerInstance->get_plugin_slug() . '/reviews/?rate='. $star .'#new-post'); } else { wp_mail('support@trustindex.io', 'Feedback from '. $pluginNameForEmails .' plugin', "We received a $star star feedback about the $pluginNameForEmails plugin from $email:

$text", [ 'From: '. $email, 'Content-Type: text/html; charset=UTF-8' ]); } exit; } $httpBlocked = false; if (defined('WP_HTTP_BLOCK_EXTERNAL') && WP_HTTP_BLOCK_EXTERNAL) { if (!defined('WP_ACCESSIBLE_HOSTS') || strpos(WP_ACCESSIBLE_HOSTS, '*.trustindex.io') === FALSE) { $httpBlocked = true; } } $proxy = new WP_HTTP_Proxy(); $proxyCheck = true; if ($proxy->is_enabled()) { $optName = $pluginManagerInstance->get_option_name('proxy-check'); $dbData = get_option($optName, ""); if (!$dbData) { $response = wp_remote_post("https://admin.trustindex.io/" . 'api/userCheckLoggedIn', [ 'timeout' => '30', 'redirection' => '5', 'blocking' => true ]); if (is_wp_error($response)) { $proxyCheck = $response->get_error_message(); update_option($optName, $response->get_error_message(), false); } else { update_option($optName, 1, false); } } else { if ($dbData !== '1') { $proxyCheck = $dbData; } } } $tabs = $pluginManagerInstance->getPluginTabs(); $selectedTab = isset($_GET['tab']) ? sanitize_text_field(wp_unslash($_GET['tab'])) : null; if (!$selectedTab || !in_array($selectedTab, array_column($tabs, 'slug'))) { $selectedTab = $tabs[0]['slug']; } ?> $file) { $jsFiles []= [ 'id' => $id, 'url' => $pluginManagerInstance->get_plugin_file_url($file), ]; } $jsContent = " window.onload = function() { let notLoaded = []; let loadedCount = 0; let jsFiles = ". wp_json_encode($jsFiles) ."; let addElement = function(type, url, callback) { let element = document.createElement(type); if (type === 'script') { element.type = 'text/javascript'; element.src = url; } else { element.type = 'text/css'; element.rel = 'stylesheet'; element.href = url; element.id = '". esc_html($assetCheckCssId) ."-css'; } document.head.appendChild(element); element.addEventListener('load', function() { callback(true); }); element.addEventListener('error', function() { callback(false); }); }; let isCSSExists = function() { let link = document.getElementById('". esc_html($assetCheckCssId) ."-css'); return link && Boolean(link.sheet); }; let isJSExists = function(id) { return typeof TrustindexJsLoaded !== 'undefined' && typeof TrustindexJsLoaded[ id ] !== 'undefined'; }; let process = function() { if (loadedCount < jsFiles.length + 1) { return false; } if (notLoaded.length) { document.getElementById('trustindex-plugin-settings-page').remove(); let warningBox = document.getElementById('ti-assets-error'); if (warningBox) { warningBox.style.display = 'block'; warningBox.querySelector('p strong').innerHTML = notLoaded.join(', '); } } } if (!isCSSExists()) { addElement('link', '". esc_attr($pluginManagerInstance->get_plugin_file_url($assetCheckCssFile)) ."', function(success) { loadedCount++; if (!success) { notLoaded.push('CSS'); } process(); }); } else { loadedCount++; } jsFiles.forEach(function(js) { if (!isJSExists(js.id)) { addElement('script', js.url, function(success) { loadedCount++; if (!success) { if (notLoaded.indexOf('JS') === -1) { notLoaded.push('JS'); } } process(); }); } else { loadedCount++; } }); }; "; wp_register_script($jsKey, false, [], true, [ 'in_footer' => true ]); wp_enqueue_script($jsKey); wp_add_inline_script($jsKey, $jsContent); ?>


https://wordpress.org/support/article/editing-wp-config-php/#block-external-url-requests


WP_HTTP_BLOCK_EXTERNAL as false', 'wp-reviews-plugin-for-google')); ?>
WP_ACCESSIBLE_HOSTS: \"*.trustindex.io\"", 'wp-reviews-plugin-for-google')); ?>