Uname:Linux Sandbox-A 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64

Base Dir : /var/www/html

User : gavin


403WebShell
403Webshell
Server IP : 68.183.124.220  /  Your IP : 216.73.217.137
Web Server : Apache/2.4.18 (Ubuntu)
System : Linux Sandbox-A 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64
User : gavin ( 1000)
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/wp-content/plugins/wp-statistics/includes/log/widgets/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/wp-content/plugins/wp-statistics/includes/log/widgets/referring.php
<?php
function wp_statistics_generate_referring_postbox_content( $count = 10 ) {
	global $wpdb, $WP_Statistics;

	//Get Top Referring
	if ( false === ( $get_urls = get_transient( 'wps_top_referring' ) ) ) {

		//Get Wordpress Domain
		$where       = '';
		$domain_name = rtrim( preg_replace( '/^https?:\/\//', '', get_site_url() ), " / " );
		foreach ( array( "http", "https", "ftp" ) as $protocol ) {
			foreach ( array( '', 'www.' ) as $w3 ) {
				$where = " AND `referred` NOT LIKE '{$protocol}://{$w3}{$domain_name}%' ";
			}
		}
		$result = $wpdb->get_results( "SELECT SUBSTRING_INDEX(REPLACE( REPLACE( referred, 'http://', '') , 'https://' , '') , '/', 1 ) as `domain`, count(referred) as `number` FROM {$wpdb->prefix}statistics_visitor WHERE `referred` REGEXP \"^(https?://|www\\.)[\.A-Za-z0-9\-]+\\.[a-zA-Z]{2,4}\" AND referred <> '' AND LENGTH(referred) >=12 {$where} GROUP BY domain ORDER BY `number` DESC LIMIT $count" );
		foreach ( $result as $items ) {
			$get_urls[ $items->domain ] = wp_statistics_get_number_referer_from_domain( $items->domain );
		}

		// Put the results in a transient. Expire after 12 hours.
		set_transient( 'wps_top_referring', $get_urls, 12 * HOUR_IN_SECONDS );
	}
	?>
    <table width="100%" class="widefat table-stats" id="top-referrer">
        <tr>
            <td width="50%"><?php _e( 'Address', 'wp-statistics' ); ?></td>
            <td width="40%"><?php _e( 'Server IP', 'wp-statistics' ); ?></td>
            <td width="10%"><?php _e( 'References', 'wp-statistics' ); ?></td>
        </tr>
		<?php

		//Load country Code
		$ISOCountryCode = $WP_Statistics->get_country_codes();

		//Get Refer Site Detail
		$refer_opt     = get_option( 'wp_statistics_referrals_detail' );
		$referrer_list = ( empty( $refer_opt ) ? array() : $refer_opt );

		if ( ! $get_urls ) {
			return;
		}

		foreach ( $get_urls as $domain => $number ) {

			//Get Site Link
			$referrer_html = $WP_Statistics->html_sanitize_referrer( $domain );

			//Get Site information if Not Exist
			if ( ! array_key_exists( $domain, $referrer_list ) ) {
				$get_site_inf             = wp_statistics_get_domain_server( $domain );
				$get_site_title           = wp_statistics_get_site_title( $domain );
				$referrer_list[ $domain ] = array(
					'ip'      => $get_site_inf['ip'],
					'country' => $get_site_inf['country'],
					'title'   => ( $get_site_title === false ? '' : $get_site_title ),
				);
			}

			echo "<tr>";
			echo "<td>" . wp_statistics_show_site_icon( $domain ) . " " . $WP_Statistics->get_referrer_link( $domain, $referrer_list[ $domain ]['title'], true ) . "</td>";
			echo "<td><span class='wps-cursor-default' " . ( $referrer_list[ $domain ]['country'] != "" ? 'title="' . $ISOCountryCode[ $referrer_list[ $domain ]['country'] ] . '"' : '' ) . ">" . ( $referrer_list[ $domain ]['ip'] != "" ? $referrer_list[ $domain ]['ip'] : '-' ) . "</span></td>";
			echo "<td><a href='" . WP_Statistics_Admin_Pages::admin_url( 'referrers', array( 'referr' => $referrer_html ) ) . "'>" . number_format_i18n( $number ) . "</a></td>";
			echo "</tr>";
		}

		//Save Referrer List Update
		update_option( 'wp_statistics_referrals_detail', $referrer_list, 'no' );

		?>
    </table>
	<?php
}

Youez - 2016 - github.com/yon3zu
LinuXploit