File manager - Edit - /home/aresglob/public_html/wp/wp-includes/images/smilies/classes.tar
Back
class-bsf-analytics-helper.php 0000644 00000005462 15104450003 0012373 0 ustar 00 <?php /** * BSF analytics Helper Class File. * * @package bsf-analytics */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } if ( ! class_exists( 'BSF_Analytics_Helper' ) ) { /** * BSF analytics stat class. */ class BSF_Analytics_Helper { /** * Check is error in the received response. * * @param object $response Received API Response. * @return array $result Error result. */ public static function is_api_error( $response ) { $result = array( 'error' => false, 'error_message' => __( 'Oops! Something went wrong. Please refresh the page and try again.', 'astra-sites' ), 'error_code' => 0, ); if ( is_wp_error( $response ) ) { $result['error'] = true; $result['error_message'] = $response->get_error_message(); $result['error_code'] = $response->get_error_code(); } elseif ( ! empty( wp_remote_retrieve_response_code( $response ) ) && ! in_array( wp_remote_retrieve_response_code( $response ), array( 200, 201, 204 ), true ) ) { $result['error'] = true; $result['error_message'] = wp_remote_retrieve_response_message( $response ); $result['error_code'] = wp_remote_retrieve_response_code( $response ); } return $result; } /** * Get API headers * * @since 1.1.6 * @return array<string, string> */ public static function get_api_headers() { return array( 'Content-Type' => 'application/json', 'Accept' => 'application/json', ); } /** * Get API URL for sending analytics. * * @return string API URL. * @since 1.0.0 */ public static function get_api_url() { return defined( 'BSF_ANALYTICS_API_BASE_URL' ) ? BSF_ANALYTICS_API_BASE_URL : 'https://analytics.brainstormforce.com/'; } /** * Check if the current screen is allowed for the survey. * * This function checks if the current screen is one of the allowed screens for displaying the survey. * It uses the `get_current_screen` function to get the current screen information and compares it with the list of allowed screens. * * @since 1.1.6 * @return bool True if the current screen is allowed, false otherwise. */ public static function is_allowed_screen() { // This filter allows to dynamically modify the list of allowed screens for the survey. $allowed_screens = apply_filters( 'uds_survey_allowed_screens', array( 'plugins' ) ); $current_screen = get_current_screen(); // Check if $current_screen is a valid object before accessing its properties. if ( ! is_object( $current_screen ) ) { return false; // Return false if current screen is not valid. } $screen_id = $current_screen->id; if ( ! empty( $screen_id ) && in_array( $screen_id, $allowed_screens, true ) ) { return true; } return false; } } } zipwp-images-script.php 0000644 00000011066 15106251204 0011173 0 ustar 00 <?php /** * Zipwp Images Script * * @since 1.0.0 * @package Zipwp Images Script */ namespace ZipWP_Images\Classes; /** * Ai_Builder */ class Zipwp_Images_Script { /** * Instance * * @access private * @var object Class Instance. * @since 1.0.0 */ private static $instance = null; /** * Constructor. * * @since 1.0.0 */ public function __construct() { add_action( 'admin_enqueue_scripts', array( $this, 'editor_load_scripts' ) ); add_action( 'wp_enqueue_scripts', array( $this, 'bb_editor_load_scripts' ) ); add_action( 'elementor/editor/before_enqueue_scripts', array( $this, 'editor_load_scripts' ) ); } /** * Initiator * * @since 1.0.0 * @return object initialized object of class. */ public static function get_instance() { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } /** * Load script for block editor and elementor editor. * * @since 1.0.0 * @return void */ public function editor_load_scripts(): void { if ( ! is_admin() ) { return; } $this->load_script(); } /** * Load script for block BB editor. * * @since 1.0.0 * @return void */ public function bb_editor_load_scripts(): void { if ( class_exists( 'FLBuilderModel' ) && \FLBuilderModel::is_builder_active() || is_customize_preview() ) { $this->load_script(); } } /** * Load all the required files in the importer. * * @since 1.0.0 * @return void */ public function load_script(): void { // Introduces a filter to exclude certain post types from the plugin. $exclude_post_types = apply_filters( 'zipwp_images_excluded_post_types', array( 'sureforms_form' ) ); if ( ! function_exists( 'get_current_screen' ) ) { require_once ABSPATH . '/wp-admin/includes/screen.php'; } $current_screen = get_current_screen(); if ( ! is_object( $current_screen ) ) { return; } if ( in_array( $current_screen->post_type, $exclude_post_types, true ) ) { return; } // Enqueue JS. wp_enqueue_script( 'zipwp-images-script', ZIPWP_IMAGES_URL . 'dist/main.js', array( 'jquery', 'media-views', 'react', 'wp-element', 'wp-api-fetch' ), ZIPWP_IMAGES_VER, true ); $data = apply_filters( 'zipwp_images_vars', array( 'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ), 'asyncurl' => esc_url( admin_url( 'async-upload.php' ) ), 'is_customize_preview' => is_customize_preview(), 'is_bb_active' => class_exists( 'FLBuilderModel' ), 'is_brizy_active' => class_exists( 'Brizy_Editor_Post' ), 'is_elementor_active' => did_action( 'elementor/loaded' ), 'is_elementor_editor' => did_action( 'elementor/loaded' ) && class_exists( '\Elementor\Plugin' ) ? \Elementor\Plugin::instance()->editor->is_edit_mode() : false, 'is_bb_editor' => class_exists( '\FLBuilderModel' ) ? \FLBuilderModel::is_builder_active() : false, 'is_brizy_editor' => class_exists( 'Brizy_Editor_Post' ) ? ( isset( $_GET['brizy-edit'] ) || isset( $_GET['brizy-edit-iframe'] ) ) : false, // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Fetching GET parameter, no nonce associated with this action. 'saved_images' => get_option( 'zipwp-images-saved-images', array() ), 'title' => apply_filters( 'zipwp_images_tab_title', __( 'Search Images', 'astra-sites' ) ), 'search_placeholder' => __( 'Search - Ex: flowers', 'astra-sites' ), 'downloading' => __( 'Downloading...', 'astra-sites' ), 'validating' => __( 'Validating...', 'astra-sites' ), '_ajax_nonce' => wp_create_nonce( 'zipwp-images' ), 'rest_api_nonce' => current_user_can( 'edit_posts' ) ? wp_create_nonce( 'wp_rest' ) : '', ) ); // Add localize JS. wp_localize_script( 'zipwp-images-script', 'zipwpImages', $data ); // Enqueue CSS. wp_enqueue_style( 'zipwp-images-style', ZIPWP_IMAGES_URL . 'dist/style-main.css', array(), ZIPWP_IMAGES_VER ); wp_enqueue_style( 'zipwp-images-google-fonts', $this->google_fonts_
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings