GRAYBYTE WORDPRESS FILE MANAGER3271

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/giriqfky/nioscentre.in/wp-content/plugins/woolentor-addons/includes/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/nioscentre.in/wp-content/plugins/woolentor-addons/includes//api.php
<?php
if( ! defined( 'ABSPATH' ) ) exit(); // Exit if accessed directly

class Woolentor_Api{

    /**
     * Define nessesary variables
     */
    const NEWS_FEED_OPTION_KEY = 'woolentor_info_news_feed_data';
	const TRANSIENT_KEY_PREFIX = 'woolentor_info_api_data';

    /**
     * Info API URL
     */
    public static $api_url = 'https://library.shoplentor.com/wp-json/woolentor/v1/info';

    /**
     * Get API data
     */
    private static function get_info_data( $force_update = false ) {
		$cache_key = self::TRANSIENT_KEY_PREFIX;

		$info_data = get_transient( $cache_key );

		if ( $force_update || false === $info_data ) {
			$timeout = ( $force_update ) ? 25 : 8;

			$response = wp_remote_get( self::$api_url, [
				'timeout' => $timeout,
				'body' => [
					'api_version' => WOOLENTOR_VERSION,
					'site_lang' => get_bloginfo( 'language' ),
				],
			] );

			if ( is_wp_error( $response ) || 200 !== (int) wp_remote_retrieve_response_code( $response ) ) {
				set_transient( $cache_key, [], 2 * HOUR_IN_SECONDS );
				return false;
			}

			$info_data = json_decode( wp_remote_retrieve_body( $response ), true );

			if ( empty( $info_data ) || ! is_array( $info_data ) ) {
				set_transient( $cache_key, [], 2 * HOUR_IN_SECONDS );
				return false;
			}

			if ( isset( $info_data['info'] ) ) {
				update_option( self::NEWS_FEED_OPTION_KEY, $info_data['info'], 'no' );
				unset( $info_data['info'] );
			}

			set_transient( $cache_key, $info_data, 2 * (24 * HOUR_IN_SECONDS) );
		}

		return $info_data;
	}

    /**
	 * Get news feed data.
	 * Retrieve the feed info data from remote woolentor server.
	 *
	 * @param bool $force_update Optional. Whether to force the data update.
	 * @return array News Feed data.
	 */
	public static function get_remote_data( $force_update = false ) {
		self::get_info_data( $force_update );
		$feed = get_option( self::NEWS_FEED_OPTION_KEY );
        return empty( $feed ) ? [] : $feed;
	}

}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
May 04 2025 08:32:06
giriqfky / giriqfky
0755
addons
--
May 04 2025 08:32:06
giriqfky / giriqfky
0755
admin
--
May 04 2025 08:32:06
giriqfky / giriqfky
0755
admin-panel
--
May 04 2025 08:32:06
giriqfky / giriqfky
0755
modules
--
May 04 2025 08:32:06
giriqfky / giriqfky
0755
traits
--
May 04 2025 08:32:06
giriqfky / giriqfky
0755
api.php
1.906 KB
October 30 2023 09:01:42
giriqfky / giriqfky
0644
archive_product_render.php
9.897 KB
August 27 2023 06:50:10
giriqfky / giriqfky
0644
base.php
17.815 KB
February 18 2025 09:27:26
giriqfky / giriqfky
0644
class.product_video_gallery.php
1.604 KB
November 14 2020 10:00:12
giriqfky / giriqfky
0644
custom-metabox.php
3.277 KB
October 07 2024 13:14:24
giriqfky / giriqfky
0644
helper-function.php
59.755 KB
May 04 2025 09:26:14
giriqfky / giriqfky
0644
manage_wc_template.php
16.691 KB
April 16 2025 09:07:38
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF