SILENT KILLERPanel

Current Path: > home > transcarter > public_html > wp-content > plugins > LayerSlider > assets > classes


Operation   : Linux host59.registrar-servers.com 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64
Software     : Apache
Server IP    : 198.54.126.42 | Your IP: 216.73.216.135
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: /home/transcarter/public_html/wp-content/plugins/LayerSlider/assets/classes

NameTypeSizeLast ModifiedActions
class.km.autoupdate.plugins.v3.php File 1726 bytes March 10 2023 20:45:24.
class.km.autoupdate.v3.php File 16249 bytes March 10 2023 20:45:24.
class.ls.config.php File 2480 bytes March 10 2023 20:45:24.
class.ls.dom.php File 4008 bytes March 10 2023 20:45:24.
class.ls.elementor.php File 2533 bytes March 10 2023 20:45:24.
class.ls.elementor.widget.php File 4505 bytes March 10 2023 20:45:24.
class.ls.exportutil.php File 6149 bytes March 10 2023 20:45:24.
class.ls.filesystem.php File 1953 bytes March 10 2023 20:45:24.
class.ls.importutil.php File 9880 bytes March 10 2023 20:45:24.
class.ls.modulemanager.php File 4185 bytes March 10 2023 20:45:24.
class.ls.modules.php File 3000 bytes March 10 2023 20:45:24.
class.ls.notifications.php File 13031 bytes March 10 2023 20:45:24.
class.ls.popups.php File 4787 bytes March 10 2023 20:45:24.
class.ls.posts.php File 10320 bytes March 10 2023 20:45:24.
class.ls.remotedata.php File 2462 bytes March 10 2023 20:45:24.
class.ls.revisions.php File 6622 bytes March 10 2023 20:45:24.
class.ls.sliders.php File 21612 bytes March 10 2023 20:45:24.
class.ls.sources.php File 7556 bytes March 10 2023 20:45:24.
class.ls.templateutils.php File 6958 bytes March 10 2023 20:45:24.
class.ls.transitionpresets.php File 785 bytes March 10 2023 20:45:24.
class.ls.uninstaller.php File 4185 bytes March 10 2023 20:45:24.
index.php File 27 bytes March 10 2023 20:45:24.

Reading File: /home/transcarter/public_html/wp-content/plugins/LayerSlider/assets/classes/class.ls.remotedata.php

<?php

class LS_RemoteData {

	private static $data;
	private static $sources;


	private function __construct() {

	}


	public static function init() {


		self::$sources = [

			'general' 	=> [
				'url' 		=> LS_REPO_BASE_URL.'data/ls-wp/v2/',
				'dataKey' 	=> 'ls-remote-data-v2',
				'updateKey' => 'ls-remote-data-v2-updated',
				'interval' 	=> HOUR_IN_SECONDS * 6
			],

			'fonts' 	=> [
				'url' 		=> 'https://repository.kreaturamedia.com/googlefonts/fonts.json',
				'dataKey' 	=> 'ls-google-fonts-data',
				'updateKey' => 'ls-google-fonts-data-updated',
				'interval' 	=> WEEK_IN_SECONDS
			]
		];

		self::checkData();
	}


	public static function get( $handle = '', $default = '', $source = 'general' ) {

		// Get data if not present
		if( empty( self::$data[ $source ] ) ) {
			self::$data[ $source ] = get_option( self::$sources[ $source ]['dataKey'], [] );
		}

		// Send back data by handle
		if( ! empty( $handle ) && isset( self::$data[ $source ][ $handle ] ) ) {
			return self::$data[ $source ][ $handle ];
		}

		return $default;
	}


	public static function update( $source = 'general' ) {

		self::updateSource( self::$sources[ $source ] );
	}


	public static function lastUpdated( $source = 'general' ) {
		return get_option( self::$sources[ $source ]['updateKey'], 0 );
	}



	public static function getAvailableVersion() {

		$updateVersion = get_option( 'ls-latest-version', LS_PLUGIN_VERSION );
		$remoteVersion = self::get( 'latest-version', LS_PLUGIN_VERSION );

		if( version_compare( $remoteVersion, $updateVersion, '>=' ) ) {
			return $remoteVersion;
		}

		return $updateVersion;
	}


	// ------------------------------------

	private static function checkData() {

		if( ! empty( self::$sources ) ) {
			foreach( self::$sources as $source ) {

				$lastUpdated = get_option( $source['updateKey'], 0 );

				if( $lastUpdated < time() - $source['interval'] ) {
					self::updateSource( $source );
				}
			}
		}
	}

	private static function updateSource( $source ) {

		$data 	= wp_remote_retrieve_body( wp_remote_get( $source['url'] ) );
		$data 	= ! empty( $data ) ? $data : '{}';
		$json 	= json_decode( $data, true );

		// Success
		if( ! empty( $json ) ) {

			update_option( $source['dataKey'], $json, false );
			update_option( $source['updateKey'], time(), false );

		// Failed
		} else {

			$time = time() - $source['interval'] + ( 60 * 30 );
			update_option( $source['updateKey'], $time, false );
		}
	}

}

SILENT KILLER Tool