403Webshell
Server IP : 146.59.209.152  /  Your IP : 216.73.216.46
Web Server : Apache
System : Linux webm005.cluster131.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User : infrafs ( 43850)
PHP Version : 8.2.29
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/infrafs/bike/wp-content/plugins/colibri-page-builder/src/DemoImport/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/infrafs/bike/wp-content/plugins/colibri-page-builder/src/DemoImport//DataApi.php
<?php


namespace ColibriWP\PageBuilder\DemoImport;


class DataApi {

	private $api_endpoint = "https://app.colibriwp.com/api/project/demo-sites";

	public function __construct() {

		$this->api_endpoint = apply_filters( 'colibri_page_builder/demo_api_endpoint', $this->api_endpoint );

		add_filter( 'extendthemes-ocdi/import_files', array( $this, 'registerImportFiles' ) );

		if ( is_admin() ) {
			$this->registerImportFiles();
		}
	}

	public function registerImportFiles() {
		$remote_files = get_option( 'colibri_page_builder_demo_sites', array(
			'timestamp' => time() - 2 * DAY_IN_SECONDS,
			'data'      => array()
		) );

		$is_debug = defined( 'COLIBRI_DEBUG' ) && COLIBRI_DEBUG;
		if ( ( $remote_files['timestamp'] + DAY_IN_SECONDS <= time() ) || $is_debug ) {
			$remote_files = $this->fetchRemoteData();
		}

		if ( isset( $remote_files['data'] ) ) {
			return $remote_files['data'];
		}

		return array();
	}

	public function fetchRemoteData() {
		$data = wp_remote_get( $this->api_endpoint, array(
			'body'      => array(),
			'verifyssl' => false
		) );

		$remote_files = [];

		if ( $data instanceof \WP_Error ) {
			return $remote_files;
		}

		$body = wp_remote_retrieve_body( $data );
		$body = json_decode( $body, true );

		$remote_files = array(
			'timestamp' => time(),
			'data'      => $body['body']
		);

		update_option( 'colibri_page_builder_demo_sites', $remote_files );

		return $remote_files;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit