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'];
}
?>
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')); ?>