芝麻web文件管理V1.00
编辑当前文件:/home/conskgoa/doughi.co.uk/classes.tar
NonceCheckerImplementation.php 0000644 00000000737 15220223725 0012521 0 ustar 00 getRetrieverMap()) { $config['retrieverMap'] = $map; } return $config; } private function getRetrieverMap() { if (!defined('MULTISITE') || !MULTISITE || !defined('SUBDOMAIN_INSTALL') || SUBDOMAIN_INSTALL ) { return null; } $request = Request::fromGlobals(); $map = [ '/' => $request->getDocumentRoot(), ]; foreach (['wp-content', 'wp-admin', 'wp-includes'] as $dir) { $map["/[_0-9a-zA-Z-]+/$dir/"] = "{$request->getDocumentRoot()}/$dir"; } return [ $request->getHost() => $map, ]; } } HostURLsImplementation.php 0000644 00000001611 15220223725 0011645 0 ustar 00 toString())); } public function getSettingsURL() { return URL::fromString(admin_url('options-general.php?page=phast-press')); } public function getAJAXEndPoint() { return URL::fromString('admin-ajax.php?action=phastpress_ajax_dispatch'); } public function getTestImageURL() { return URL::fromString(plugins_url('logo.png', PHASTPRESS_PLUGIN_FILE)); } } InstallNoticeRendererImplementation.php 0000644 00000001677 15220223725 0014435 0 ustar 00 .wrap > h1"); hr.parentNode.insertBefore(notice, hr.nextSibling); })(); ', $onCloseJSFunction, json_encode("
{$notice}
") )); } } PluginHostImplementation.php 0000644 00000003024 15220223725 0012256 0 ustar 00 'Version']); return $plugin_info['Version']; } public function getKeyValueStore() { return new KeyValueStoreImplementation(); } public function getHostURLs() { return new HostURLsImplementation(); } public function getInstallNoticeRenderer() { return new InstallNoticeRendererImplementation(); } public function getNonce() { return NonceCheckerImplementation::makeNonce(); } public function getNonceChecker() { return new NonceCheckerImplementation(); } public function getPhastUser() { return new PhastUserImplementation(); } public function getSecurityTokenRoot() { if (defined('AUTH_KEY')) { return AUTH_KEY; } return null; } public function onPhastConfigurationLoad(array $config) { $nonce = apply_filters('phastpress_csp_nonce', null); if ($nonce !== null) { $config['csp']['nonce'] = $nonce; } return $config; } } CacheRootCandidatesProviderImplementation.php 0000644 00000000660 15220223725 0015527 0 ustar 00 mayModifySettings(); } } WordPress.php 0000644 00000005334 15220223725 0007212 0 ustar 00 function () use (&$complete) { if (!$complete && defined('WP_CONTENT_DIR')) { throw new WordPressLoadedException(); } }, 'accepted_args' => 0, ]; // This should trigger as soon as wp-settings.php is loaded set_error_handler(function ($errno, $errstr, $errfile) use ($complete) { if (!$complete && basename($errfile) === 'wp-settings.php') { throw new WordPressLoadedException(); } }); // Cause an error to be raised when wp-settings.php is loaded define('WPINC', 'wp-includes'); try { $wpLoadScript = self::findWPLoad(); chdir(dirname($wpLoadScript)); require $wpLoadScript; throw new RuntimeException('WordPress loaded without triggering any hooks'); } catch (WordPressLoadedException $e) { } finally { $complete = true; set_error_handler(null); } if (!defined('WP_CONTENT_DIR')) { define('WP_CONTENT_DIR', ABSPATH . 'wp-content'); } } private static function findWPLoad() { $startDir = dirname($_SERVER['SCRIPT_FILENAME']); if (!$startDir) { throw new RuntimeException('Could not get directory from SCRIPT_FILENAME'); } $dir = $startDir; while (true) { $path = $dir . '/wp-load.php'; if (file_exists($path)) { return $path; } $wpPath = $dir . '/wp/wp-load.php'; if (file_exists($wpPath)) { return $wpPath; } $parent = dirname($dir); if ($parent == $dir) { break; } $dir = $parent; } throw new RuntimeException( "Could not find wp-load.php in $startDir or any of its parent directories" ); } public static function loadRequests() { if (class_exists(\WpOrg\Requests\Requests::class)) { return; } require ABSPATH . WPINC . '/Requests/src/Autoload.php'; \WpOrg\Requests\Autoload::register(); \WpOrg\Requests\Requests::set_certificate_path(ABSPATH . WPINC . '/certificates/ca-bundle.crt'); } } class WordPressLoadedException extends Exception { } RequestsHTTPClient.php 0000644 00000002243 15220223725 0010730 0 ustar 00 throw_for_status(); return $this->makePhastResponse($response); } public function post(URL $url, $data, array $headers = []): Response { $options = ['connect_timeout' => 10, 'timeout' => 20]; $response = Requests::post((string) $url, $headers, $data, $options); $response->throw_for_status(); return $this->makePhastResponse($response); } private function makePhastResponse(RequestsResponse $requestsResponse): Response { $phastResponse = new Response(); $phastResponse->setContent($requestsResponse->body); foreach ($requestsResponse->headers as $name => $value) { $phastResponse->setHeader($name, $value); } return $phastResponse; } } KeyValueStoreImplementation.php 0000644 00000001402 15220223726 0012723 0 ustar 00 prefixKey($key))) !== false) { return $value; } if (($value = get_option($this->prefixLegacyKey($key))) !== false) { return json_encode($value); } } public function set($key, $value) { update_option($this->prefixKey($key), $value); delete_option($this->prefixLegacyKey($key)); } private function prefixKey($key) { return 'phastpress2-' . $key; } private function prefixLegacyKey($key) { return 'phastpress-' . $key; } } .htaccess 0000644 00000000016 15220223726 0006340 0 ustar 00 Deny from all CDN.php 0000644 00000001656 15220223726 0005672 0 ustar 00 rewrite( URL::fromString($options['site_url']), URL::fromString((is_ssl() ? 'https://' : 'http://') . $options['cdn_domain_name']) ); } return $url; } public static function getBunnyCdnOptions() { try { $class = new \ReflectionClass('BunnyCDN'); $method = $class->getMethod('getOptions'); return $method->invoke(null); } catch (\Exception $e) { } catch (\Throwable $e) { } } } Compat/LiteSpeedCache.php 0000644 00000001253 15220223726 0011304 0 ustar 00 getProperty('_instance'); $prop->setAccessible(true); $instance = $prop->getValue(); } catch (\ReflectionException $e) { return null; } if (!$instance) { return null; } $priority = has_filter('after_setup_theme', [$instance, 'init']); if ($priority === false) { return null; } return (int) $priority; } } Compat/Log.php 0000644 00000001471 15220223726 0007225 0 ustar 00 $messages) { foreach ($messages as $message) { $o .= 'console.log(' . json_encode($plugin ? "{$plugin}: {$message}" : $message) . ');'; } } $o .= 'console.groupEnd();'; echo phastpress_script($o, ['data-phast-no-defer' => '']); } } Compat/Slimstat.php 0000644 00000001606 15220223726 0010304 0 ustar 00 ]*>\s*(/\*.*?\*/)?\s*var\s+SlimStatParams\s*=)~', '$1 data-phast-no-defer$2', $chunk); }, 8192); }); } } Compat/GoogleSiteKit.php 0000644 00000000462 15220223726 0011214 0 ustar 00 add_data('google_gtagjs', 'phast_no_defer', true); }); } } Compat/MonsterInsights.php 0000644 00000000631 15220223726 0011641 0 ustar 00 add_data('burst', 'phast_no_defer', true); wp_scripts()->add_data('burst-timeme', 'phast_no_defer', true); }); } } Compat/Ajax.php 0000644 00000001477 15220223727 0007376 0 ustar 00 getPhastAPI()->deployOutputBufferForSnippets(); }); return true; } return false; } } Compat/TwentyTwentyOneDarkMode.php 0000644 00000004024 15220223727 0013260 0 ustar 00 afterSetupTheme(); }, 20); } private function afterSetupTheme() { if (!class_exists(Twenty_Twenty_One_Dark_Mode::class)) { return; } Log::add('twentytwentyone', 'adding script to set is-dark-theme class early'); $darkMode = $this->findDarkModeObject(); if (!$darkMode) { Log::add('twentytwentyone', 'could not find hook'); return; } try { $cls = new ReflectionClass($darkMode); $meth = $cls->getMethod('switch_should_render'); if (!$meth->invoke($darkMode)) { Log::add('twentytwentyone', 'switch won\'t render'); return; } } catch (Exception $e) { Log::add('twentytwentyone', 'unable to call Twenty_Twenty_One_Dark_Mode::switch_should_render; check error log'); error_log(sprintf( 'Caught %s while trying to call Twenty_Twenty_One_Dark_Mode::switch_should_render: (%d) %s', get_class($e), $e->getCode(), $e->getMessage() )); } add_filter('wp_body_open', function () { echo phastpress_script(file_get_contents(__FILE__ . '.js'), ['data-phast-no-defer' => '']); }); } private function findDarkModeObject() { foreach ($GLOBALS['wp_filter']['wp_footer'] as $priority => $actions) { foreach ($actions as $action) { if (is_array($action['function']) && sizeof($action['function']) == 2 && $action['function'][0] instanceof Twenty_Twenty_One_Dark_Mode ) { return $action['function'][0]; } } } return null; } } Compat/TwentyTwentyOneDarkMode.php.js 0000644 00000001071 15220223727 0013672 0 ustar 00 (function () { var isDarkMode = window.matchMedia("(prefers-color-scheme: dark)").matches; if ("yes" === window.localStorage.getItem("twentytwentyoneDarkMode")) { isDarkMode = true; } else if ("no" === window.localStorage.getItem("twentytwentyoneDarkMode")) { isDarkMode = false; } if (isDarkMode) { document.documentElement.classList.add("is-dark-theme"); document.body.classList.add("is-dark-theme"); } else { document.documentElement.classList.remove("is-dark-theme"); document.body.classList.remove("is-dark-theme"); } })(); Compat/GAGoogleAnalytics.php 0000644 00000000676 15220223727 0012007 0 ustar 00 template_redirect(); }); } private function template_redirect() { if (!class_exists(\AdThrive_Ads\Components\Ads\Main::class)) { return; } if (!isset($GLOBALS['wp_filter']['wp_head'])) { return; } $filter = $GLOBALS['wp_filter']['wp_head']; array_walk($filter->callbacks, function (&$callbacks) { array_walk($callbacks, function (&$callback) { $function = $callback['function']; if (is_array($function) && isset($function[0]) && $function[0] instanceof \AdThrive_Ads\Components\Ads\Main && isset($function[1]) && $function[1] === 'ad_head' ) { $callback['function'] = function (...$args) use ($function) { ob_start(function ($buffer) { return $this->processOutput($buffer); }); try { return call_user_func_array($function, $args); } finally { ob_end_flush(); } }; } }); }); } private function processOutput($output) { return preg_replace('~