Order
Файловый менеджер
Файловый менеджер - Редактировать - /home/bestoj5/nestedpack.com/customizer-search.tar
Назад
admin/bsf-analytics/assets/css/minified/style-rtl.min.css�������������������������������������������0000644�����������������00000000460�14760040512�0017503 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[ID*="-optin-notice"]{padding:1px 12px;border-right-color:#007cba}[ID*="-optin-notice"] .notice-container{padding-top:10px;padding-bottom:12px}[ID*="-optin-notice"] .notice-content{margin:0}[ID*="-optin-notice"] .notice-heading{padding:0 0 12px 20px}[ID*="-optin-notice"] .button-primary{margin-left:5px}����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������admin/bsf-analytics/assets/css/minified/style.min.css�����������������������������������������������0000644�����������������00000000460�14760040512�0016704 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[ID*="-optin-notice"]{padding:1px 12px;border-left-color:#007cba}[ID*="-optin-notice"] .notice-container{padding-top:10px;padding-bottom:12px}[ID*="-optin-notice"] .notice-content{margin:0}[ID*="-optin-notice"] .notice-heading{padding:0 20px 12px 0}[ID*="-optin-notice"] .button-primary{margin-right:5px}����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������admin/bsf-analytics/assets/css/unminified/style-rtl.css���������������������������������������������0000644�����������������00000000561�14760040512�0017266 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[ID*="-optin-notice"] { padding: 1px 12px; border-right-color: #007cba; } [ID*="-optin-notice"] .notice-container { padding-top: 10px; padding-bottom: 12px; } [ID*="-optin-notice"] .notice-content { margin: 0; } [ID*="-optin-notice"] .notice-heading { padding: 0 0 12px 20px; } [ID*="-optin-notice"] .button-primary { margin-left: 5px; }�����������������������������������������������������������������������������������������������������������������������������������������������admin/bsf-analytics/assets/css/unminified/style.css�������������������������������������������������0000644�����������������00000000561�14760040512�0016467 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[ID*="-optin-notice"] { padding: 1px 12px; border-left-color: #007cba; } [ID*="-optin-notice"] .notice-container { padding-top: 10px; padding-bottom: 12px; } [ID*="-optin-notice"] .notice-content { margin: 0; } [ID*="-optin-notice"] .notice-heading { padding: 0 20px 12px 0; } [ID*="-optin-notice"] .button-primary { margin-right: 5px; }�����������������������������������������������������������������������������������������������������������������������������������������������admin/bsf-analytics/class-bsf-analytics-loader.php��������������������������������������������������0000644�����������������00000004601�14760040512�0016212 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * BSF analytics loader file. * * @version 1.0.0 * * @package bsf-analytics */ if ( ! defined( 'ABSPATH' ) ) { exit(); } /** * Class BSF_Analytics_Loader. */ class BSF_Analytics_Loader { /** * Analytics Entities. * * @access private * @var array Entities array. */ private $entities = array(); /** * Analytics Version. * * @access private * @var float analytics version. */ private $analytics_version = ''; /** * Analytics path. * * @access private * @var string path array. */ private $analytics_path = ''; /** * Instance * * @access private * @var object Class object. */ private static $instance = null; /** * Get instace of class. * * @return object */ public static function get_instance() { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } /** * Constructor */ public function __construct() { add_action( 'init', array( $this, 'load_analytics' ) ); } /** * Set entity for analytics. * * @param string $data Entity attributes data. * @return void */ public function set_entity( $data ) { array_push( $this->entities, $data ); } /** * Load Analytics library. * * @return void */ public function load_analytics() { $unique_entities = array(); if ( ! empty( $this->entities ) ) { foreach ( $this->entities as $entity ) { foreach ( $entity as $key => $data ) { if ( isset( $data['path'] ) ) { if ( file_exists( $data['path'] . '/version.json' ) ) { $file_contents = file_get_contents( $data['path'] . '/version.json' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents $analytics_version = json_decode( $file_contents, 1 ); $analytics_version = $analytics_version['bsf-analytics-ver']; if ( version_compare( $analytics_version, $this->analytics_version, '>' ) ) { $this->analytics_version = $analytics_version; $this->analytics_path = $data['path']; } } } if ( ! isset( $unique_entities[ $key ] ) ) { $unique_entities[ $key ] = $data; } } } if ( file_exists( $this->analytics_path ) && ! class_exists( 'BSF_Analytics' ) ) { require_once $this->analytics_path . '/class-bsf-analytics.php'; new BSF_Analytics( $unique_entities, $this->analytics_path, $this->analytics_version ); } } } } �������������������������������������������������������������������������������������������������������������������������������admin/bsf-analytics/class-bsf-analytics-stats.php���������������������������������������������������0000644�����������������00000015143�14760040512�0016105 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * BSF analytics stat class file. * * @package bsf-analytics */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } if ( ! class_exists( 'BSF_Analytics_Stats' ) ) { /** * BSF analytics stat class. */ class BSF_Analytics_Stats { /** * Active plugins. * * Holds the sites active plugins list. * * @var array */ private $plugins; /** * Instance of BSF_Analytics_Stats. * * Holds only the first object of class. * * @var object */ private static $instance = null; /** * Create only once instance of a class. * * @return object * @since 1.0.0 */ public static function instance() { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } /** * Get stats. * * @return array stats data. * @since 1.0.0 */ public function get_stats() { return apply_filters( 'bsf_core_stats', $this->get_default_stats() ); } /** * Retrieve stats for site. * * @return array stats data. * @since 1.0.0 */ private function get_default_stats() { return array( 'graupi_version' => defined( 'BSF_UPDATER_VERSION' ) ? BSF_UPDATER_VERSION : false, 'domain_name' => get_site_url(), 'php_os' => PHP_OS, 'server_software' => isset( $_SERVER['SERVER_SOFTWARE'] ) ? filter_var( wp_unslash( $_SERVER['SERVER_SOFTWARE'] ), FILTER_SANITIZE_STRING ) : '', 'mysql_version' => $this->get_mysql_version(), 'php_version' => $this->get_php_version(), 'php_max_input_vars' => ini_get( 'max_input_vars' ), // phpcs:ignore:PHPCompatibility.IniDirectives.NewIniDirectives.max_input_varsFound 'php_post_max_size' => ini_get( 'post_max_size' ), 'php_max_execution_time' => ini_get( 'max_execution_time' ), 'php_memory_limit' => ini_get( 'memory_limit' ), 'zip_installed' => extension_loaded( 'zip' ), 'imagick_availabile' => extension_loaded( 'imagick' ), 'xmlreader_exists' => class_exists( 'XMLReader' ), 'gd_available' => extension_loaded( 'gd' ), 'curl_version' => $this->get_curl_version(), 'curl_ssl_version' => $this->get_curl_ssl_version(), 'is_writable' => $this->is_content_writable(), 'wp_version' => get_bloginfo( 'version' ), 'user_count' => $this->get_user_count(), 'site_language' => get_locale(), 'timezone' => wp_timezone_string(), 'is_ssl' => is_ssl(), 'is_multisite' => is_multisite(), 'network_url' => network_site_url(), 'external_object_cache' => (bool) wp_using_ext_object_cache(), 'wp_debug' => WP_DEBUG, 'wp_debug_display' => WP_DEBUG_DISPLAY, 'script_debug' => SCRIPT_DEBUG, 'active_plugins' => $this->get_active_plugins(), 'active_theme' => get_template(), 'active_stylesheet' => get_stylesheet(), ); } /** * Get installed PHP version. * * @return float PHP version. * @since 1.0.0 */ private function get_php_version() { if ( defined( 'PHP_MAJOR_VERSION' ) && defined( 'PHP_MINOR_VERSION' ) && defined( 'PHP_RELEASE_VERSION' ) ) { // phpcs:ignore return PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION . '.' . PHP_RELEASE_VERSION; } return phpversion(); } /** * User count on site. * * @return int User count. * @since 1.0.0 */ private function get_user_count() { if ( is_multisite() ) { $user_count = get_user_count(); } else { $count = count_users(); $user_count = $count['total_users']; } return $user_count; } /** * Get active plugin's data. * * @return array active plugin's list. * @since 1.0.0 */ private function get_active_plugins() { if ( ! $this->plugins ) { // Ensure get_plugin_data function is loaded. if ( ! function_exists( 'get_plugin_data' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $plugins = wp_get_active_and_valid_plugins(); $plugins = array_map( 'get_plugin_data', $plugins ); $this->plugins = array_map( array( $this, 'format_plugin' ), $plugins ); } return $this->plugins; } /** * Format plugin data. * * @param string $plugin plugin. * @return array formatted plugin data. * @since 1.0.0 */ public function format_plugin( $plugin ) { return array( 'name' => html_entity_decode( $plugin['Name'], ENT_COMPAT, 'UTF-8' ), 'url' => $plugin['PluginURI'], 'version' => $plugin['Version'], 'slug' => $plugin['TextDomain'], 'author_name' => html_entity_decode( wp_strip_all_tags( $plugin['Author'] ), ENT_COMPAT, 'UTF-8' ), 'author_url' => $plugin['AuthorURI'], ); } /** * Curl SSL version. * * @return float SSL version. * @since 1.0.0 */ private function get_curl_ssl_version() { $curl = array(); if ( function_exists( 'curl_version' ) ) { $curl = curl_version(); // phpcs:ignore WordPress.WP.AlternativeFunctions.curl_curl_version } return isset( $curl['ssl_version'] ) ? $curl['ssl_version'] : false; } /** * Get cURL version. * * @return float cURL version. * @since 1.0.0 */ private function get_curl_version() { if ( function_exists( 'curl_version' ) ) { $curl = curl_version(); // phpcs:ignore WordPress.WP.AlternativeFunctions.curl_curl_version } return isset( $curl['version'] ) ? $curl['version'] : false; } /** * Get MySQL version. * * @return float MySQL version. * @since 1.0.0 */ private function get_mysql_version() { global $wpdb; return $wpdb->db_version(); } /** * Check if content directory is writable. * * @return bool * @since 1.0.0 */ private function is_content_writable() { $upload_dir = wp_upload_dir(); return wp_is_writable( $upload_dir['basedir'] ); } } } /** * Polyfill for sites using WP version less than 5.3 */ if ( ! function_exists( 'wp_timezone_string' ) ) { /** * Get timezone string. * * @return string timezone string. * @since 1.0.0 */ function wp_timezone_string() { $timezone_string = get_option( 'timezone_string' ); if ( $timezone_string ) { return $timezone_string; } $offset = (float) get_option( 'gmt_offset' ); $hours = (int) $offset; $minutes = ( $offset - $hours ); $sign = ( $offset < 0 ) ? '-' : '+'; $abs_hour = abs( $hours ); $abs_mins = abs( $minutes * 60 ); $tz_offset = sprintf( '%s%02d:%02d', $sign, $abs_hour, $abs_mins ); return $tz_offset; } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������admin/bsf-analytics/class-bsf-analytics.php���������������������������������������������������������0000644�����������������00000033442�14760040512�0014753 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * BSF analytics class file. * * @version 1.0.0 * * @package bsf-analytics */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } if ( ! class_exists( 'BSF_Analytics' ) ) { /** * BSF analytics */ class BSF_Analytics { /** * Member Variable * * @var array Entities data. */ private $entities; /** * Member Variable * * @var string Usage tracking document URL */ public $usage_doc_link = 'https://store.brainstormforce.com/usage-tracking/?utm_source=wp_dashboard&utm_medium=general_settings&utm_campaign=usage_tracking'; /** * Setup actions, load files. * * @param array $args entity data for analytics. * @param string $analytics_path directory path to analytics library. * @param float $analytics_version analytics library version. * @since 1.0.0 */ public function __construct( $args, $analytics_path, $analytics_version ) { // Bail when no analytics entities are registered. if ( empty( $args ) ) { return; } $this->entities = $args; define( 'BSF_ANALYTICS_VERSION', $analytics_version ); define( 'BSF_ANALYTICS_URI', $this->get_analytics_url( $analytics_path ) ); add_action( 'admin_init', array( $this, 'handle_optin_optout' ) ); add_action( 'admin_notices', array( $this, 'option_notice' ) ); add_action( 'init', array( $this, 'maybe_track_analytics' ), 99 ); $this->set_actions(); add_action( 'admin_init', array( $this, 'register_usage_tracking_setting' ) ); $this->includes(); } /** * Setup actions for admin notice style and analytics cron event. * * @since 1.0.4 */ public function set_actions() { foreach ( $this->entities as $key => $data ) { add_action( 'astra_notice_before_markup_' . $key . '-optin-notice', array( $this, 'enqueue_assets' ) ); add_action( 'update_option_' . $key . '_analytics_optin', array( $this, 'update_analytics_option_callback' ), 10, 3 ); add_action( 'add_option_' . $key . '_analytics_optin', array( $this, 'add_analytics_option_callback' ), 10, 2 ); } } /** * BSF Analytics URL * * @param string $analytics_path directory path to analytics library. * @return String URL of bsf-analytics directory. * @since 1.0.0 */ public function get_analytics_url( $analytics_path ) { $content_dir_path = wp_normalize_path( WP_CONTENT_DIR ); $analytics_path = wp_normalize_path( $analytics_path ); return str_replace( $content_dir_path, content_url(), $analytics_path ); } /** * Get API URL for sending analytics. * * @return string API URL. * @since 1.0.0 */ private function get_api_url() { return defined( 'BSF_API_URL' ) ? BSF_API_URL : 'https://support.brainstormforce.com/'; } /** * Enqueue Scripts. * * @since 1.0.0 * @return void */ public function enqueue_assets() { /** * Load unminified if SCRIPT_DEBUG is true. * * Directory and Extensions. */ $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified'; $file_rtl = ( is_rtl() ) ? '-rtl' : ''; $css_ext = ( SCRIPT_DEBUG ) ? '.css' : '.min.css'; $css_uri = BSF_ANALYTICS_URI . '/assets/css/' . $dir_name . '/style' . $file_rtl . $css_ext; wp_enqueue_style( 'bsf-analytics-admin-style', $css_uri, false, BSF_ANALYTICS_VERSION, 'all' ); } /** * Send analytics API call. * * @since 1.0.0 */ public function send() { wp_remote_post( $this->get_api_url() . 'wp-json/bsf-core/v1/analytics/', array( 'body' => BSF_Analytics_Stats::instance()->get_stats(), 'timeout' => 5, 'blocking' => false, ) ); } /** * Check if usage tracking is enabled. * * @return bool * @since 1.0.0 */ public function is_tracking_enabled() { foreach ( $this->entities as $key => $data ) { $is_enabled = get_site_option( $key . '_analytics_optin' ) === 'yes' ? true : false; $is_enabled = $this->is_white_label_enabled( $key ) ? false : $is_enabled; if ( apply_filters( $key . '_tracking_enabled', $is_enabled ) ) { return true; } } return false; } /** * Check if WHITE label is enabled for BSF products. * * @param string $source source of analytics. * @return bool * @since 1.0.0 */ public function is_white_label_enabled( $source ) { $options = apply_filters( $source . '_white_label_options', array() ); $is_enabled = false; if ( is_array( $options ) ) { foreach ( $options as $option ) { if ( true === $option ) { $is_enabled = true; break; } } } return $is_enabled; } /** * Display admin notice for usage tracking. * * @since 1.0.0 */ public function option_notice() { if ( ! current_user_can( 'manage_options' ) ) { return; } foreach ( $this->entities as $key => $data ) { $time_to_display = isset( $data['time_to_display'] ) ? $data['time_to_display'] : '+24 hours'; $usage_doc_link = isset( $data['usage_doc_link'] ) ? $data['usage_doc_link'] : $this->usage_doc_link; // Don't display the notice if tracking is disabled or White Label is enabled for any of our plugins. if ( false !== get_site_option( $key . '_analytics_optin', false ) || $this->is_white_label_enabled( $key ) ) { continue; } // Show tracker consent notice after 24 hours from installed time. if ( strtotime( $time_to_display, $this->get_analytics_install_time( $key ) ) > time() ) { continue; } /* translators: %s product name */ $notice_string = __( 'Want to help make <strong>%1s</strong> even more awesome? Allow us to collect non-sensitive diagnostic data and usage information. ', 'customizer-search' ); if ( is_multisite() ) { $notice_string .= __( 'This will be applicable for all sites from the network.', 'customizer-search' ); } $language_dir = is_rtl() ? 'rtl' : 'ltr'; Astra_Notices::add_notice( array( 'id' => $key . '-optin-notice', 'type' => '', 'message' => sprintf( '<div class="notice-content"> <div class="notice-heading"> %1$s </div> <div class="astra-notices-container"> <a href="%2$s" class="astra-notices button-primary"> %3$s </a> <a href="%4$s" data-repeat-notice-after="%5$s" class="astra-notices button-secondary"> %6$s </a> </div> </div>', /* translators: %s usage doc link */ sprintf( $notice_string . '<span dir="%2s"><a href="%3s" target="_blank" rel="noreferrer noopener">%4s</a><span>', esc_html( $data['product_name'] ), $language_dir, esc_url( $usage_doc_link ), __( ' Know More.', 'customizer-search' ) ), add_query_arg( array( $key . '_analytics_optin' => 'yes', $key . '_analytics_nonce' => wp_create_nonce( $key . '_analytics_optin' ), 'bsf_analytics_source' => $key, ) ), __( 'Yes! Allow it', 'customizer-search' ), add_query_arg( array( $key . '_analytics_optin' => 'no', $key . '_analytics_nonce' => wp_create_nonce( $key . '_analytics_optin' ), 'bsf_analytics_source' => $key, ) ), MONTH_IN_SECONDS, __( 'No Thanks', 'customizer-search' ) ), 'show_if' => true, 'repeat-notice-after' => false, 'priority' => 18, 'display-with-other-notices' => true, ) ); } } /** * Process usage tracking opt out. * * @since 1.0.0 */ public function handle_optin_optout() { if ( ! current_user_can( 'manage_options' ) ) { return; } $source = isset( $_GET['bsf_analytics_source'] ) ? sanitize_text_field( wp_unslash( $_GET['bsf_analytics_source'] ) ) : ''; if ( ! isset( $_GET[ $source . '_analytics_nonce' ] ) ) { return; } if ( ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET[ $source . '_analytics_nonce' ] ) ), $source . '_analytics_optin' ) ) { return; } $optin_status = isset( $_GET[ $source . '_analytics_optin' ] ) ? sanitize_text_field( wp_unslash( $_GET[ $source . '_analytics_optin' ] ) ) : ''; if ( 'yes' === $optin_status ) { $this->optin( $source ); } elseif ( 'no' === $optin_status ) { $this->optout( $source ); } wp_safe_redirect( remove_query_arg( array( $source . '_analytics_optin', $source . '_analytics_nonce', 'bsf_analytics_source', ) ) ); } /** * Opt in to usage tracking. * * @param string $source source of analytics. * @since 1.0.0 */ private function optin( $source ) { update_site_option( $source . '_analytics_optin', 'yes' ); } /** * Opt out to usage tracking. * * @param string $source source of analytics. * @since 1.0.0 */ private function optout( $source ) { update_site_option( $source . '_analytics_optin', 'no' ); } /** * Load analytics stat class. * * @since 1.0.0 */ private function includes() { require_once __DIR__ . '/class-bsf-analytics-stats.php'; } /** * Register usage tracking option in General settings page. * * @since 1.0.0 */ public function register_usage_tracking_setting() { foreach ( $this->entities as $key => $data ) { if ( ! apply_filters( $key . '_tracking_enabled', true ) || $this->is_white_label_enabled( $key ) ) { return; } $usage_doc_link = isset( $data['usage_doc_link'] ) ? $data['usage_doc_link'] : $this->usage_doc_link; $author = isset( $data['author'] ) ? $data['author'] : 'Brainstorm Force'; register_setting( 'general', // Options group. $key . '_analytics_optin', // Option name/database. array( 'sanitize_callback' => array( $this, 'sanitize_option' ) ) // sanitize callback function. ); add_settings_field( $key . '-analytics-optin', // Field ID. __( 'Usage Tracking', 'customizer-search' ), // Field title. array( $this, 'render_settings_field_html' ), // Field callback function. 'general', 'default', // Settings page slug. array( 'type' => 'checkbox', 'title' => $author, 'name' => $key . '_analytics_optin', 'label_for' => $key . '-analytics-optin', 'id' => $key . '-analytics-optin', 'usage_doc_link' => $usage_doc_link, ) ); } } /** * Sanitize Callback Function * * @param bool $input Option value. * @since 1.0.0 */ public function sanitize_option( $input ) { if ( ! $input || 'no' === $input ) { return 'no'; } return 'yes'; } /** * Print settings field HTML. * * @param array $args arguments to field. * @since 1.0.0 */ public function render_settings_field_html( $args ) { ?> <fieldset> <label for="<?php echo esc_attr( $args['label_for'] ); ?>"> <input id="<?php echo esc_attr( $args['id'] ); ?>" type="checkbox" value="1" name="<?php echo esc_attr( $args['name'] ); ?>" <?php checked( get_site_option( $args['name'], 'no' ), 'yes' ); ?>> <?php /* translators: %s Product title */ echo esc_html( sprintf( __( 'Allow %s products to track non-sensitive usage tracking data.', 'customizer-search' ), $args['title'] ) );// phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText if ( is_multisite() ) { esc_html_e( ' This will be applicable for all sites from the network.', 'customizer-search' ); } ?> </label> <?php echo wp_kses_post( sprintf( '<a href="%1s" target="_blank" rel="noreferrer noopener">%2s</a>', esc_url( $args['usage_doc_link'] ), __( 'Learn More.', 'customizer-search' ) ) ); ?> </fieldset> <?php } /** * Set analytics installed time in option. * * @param string $source source of analytics. * @return string $time analytics installed time. * @since 1.0.0 */ private function get_analytics_install_time( $source ) { $time = get_site_option( $source . '_analytics_installed_time' ); if ( ! $time ) { $time = time(); update_site_option( $source . '_analytics_installed_time', time() ); } return $time; } /** * Schedule/unschedule cron event on updation of option. * * @param string $old_value old value of option. * @param string $value value of option. * @param string $option Option name. * @since 1.0.0 */ public function update_analytics_option_callback( $old_value, $value, $option ) { if ( is_multisite() ) { $this->add_option_to_network( $option, $value ); } } /** * Analytics option add callback. * * @param string $option Option name. * @param string $value value of option. * @since 1.0.0 */ public function add_analytics_option_callback( $option, $value ) { if ( is_multisite() ) { $this->add_option_to_network( $option, $value ); } } /** * Send analaytics track event if tracking is enabled. * * @since 1.0.0 */ public function maybe_track_analytics() { if ( ! $this->is_tracking_enabled() ) { return; } $analytics_track = get_site_transient( 'bsf_analytics_track' ); // If the last data sent is 2 days old i.e. transient is expired. if ( ! $analytics_track ) { $this->send(); set_site_transient( 'bsf_analytics_track', true, 2 * DAY_IN_SECONDS ); } } /** * Save analytics option to network. * * @param string $option name of option. * @param string $value value of option. * @since 1.0.0 */ public function add_option_to_network( $option, $value ) { // If action coming from general settings page. if ( isset( $_POST['option_page'] ) && 'general' === $_POST['option_page'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing if ( get_site_option( $option ) ) { update_site_option( $option, $value ); } else { add_site_option( $option, $value ); } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������admin/bsf-analytics/version.json��������������������������������������������������������������������0000644�����������������00000000051�14760040512�0012746 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "bsf-analytics-ver": "1.1.0" } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������assets/css/customizer-search-admin.css��������������������������������������������������������������0000644�����������������00000004564�14760040512�0014115 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.search-input { display: block; margin-bottom: 8px; } .customizer-search-section { padding: 10px; } .customizer-search-input { width: 77% } .customizer-search-section { padding: 10px; } .customize-pane-parent { overflow: inherit; } #customize-controls .customize-info .customize-search-toggle { padding: 20px; } #customize-controls .customize-info .customize-search-toggle { position: absolute; bottom: 4px; right: 1px; width: 20px; height: 20px; cursor: pointer; box-shadow: none; -webkit-appearance: none; background: transparent; color: #555d66; border: none; } #customize-controls .customize-info .customize-search-toggle:before { padding: 4px; } #customize-controls .customize-info .customize-search-toggle:before { position: absolute; top: 5px; left: 6px; } #accordion-section-customizer-search { margin-bottom: 0; color: #555d66; background: #fff; padding: 12px 15px; border-top: 1px solid #ddd; } #accordion-section-customizer-search .accordion-section-title:after { content: none; } .customizer-search-section { padding: 0; } .search-not-found { height: 0; transition: height 0.3s ease-in-out; visibility: hidden; opacity: 0; display: none; } .search-found { height: 100%; transition: height 0.3s ease-in-out; visibility: visible; opacity: 1; } #search-results .accordion-section { border-left: none; border-right: none; padding: 10px 10px 11px 14px; line-height: 21px; background: #fff; position: relative; } #search-results .accordion-section h3 { padding: 0; margin: 0 } #search-results .accordion-section:hover { background: #f3f3f5; } .search-setting-path { display: flex; cursor: pointer; } #search-results .accordion-section:after { font: normal 20px/1 dashicons; speak: none; display: block; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-decoration: none !important; } #search-results .accordion-section:after { content: "\f345"; position: absolute; top: 12px; right: 10px; z-index: 1; top: calc(50% - 10px); } #search-results .accordion-section h3:after { content: none; } #search-results .accordion-section h3:hover { background: inherit; } #customize-controls .hl { background: #ffcd1724; }��������������������������������������������������������������������������������������������������������������������������������������������assets/js/customizer-search-admin.compiled.js�������������������������������������������������������0000644�����������������00000010007�14760040512�0015345 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(function(a){var b="";CustomizerSearchAdmin={_init:function _init(){this._bind();var c=a.map(_wpCustomizeSettings.controls,function(b){return a.map(_wpCustomizeSettings.sections,function(c){b.section==c.id&&a.map(_wpCustomizeSettings.panels,function(a){""==c.panel&&(b.panelName=c.title),c.panel==a.id&&(b.sectionName=c.title,b.panel=c.panel,b.panelName=a.title)})}),[b]});b=document.getElementById("customize-theme-controls"),customizePanelsParent=a("#customize-theme-controls"),customizePanelsParent.after("<div id=\"search-results\"></div>"),a(document).on("keyup","#customizer-search-input",function(b){b.preventDefault(),$this=a("#customizer-search-input"),string=$this.val(),0<string.length?CustomizerSearchAdmin.displayMatches(string,c):CustomizerSearchAdmin._clearSearch()}),a(document).on("click",".clear-search",function(){CustomizerSearchAdmin._clearSearch()}),a(document).on("click",".customize-search-toggle",function(){CustomizerSearchAdmin._display_search_form()})},expandSection:function expandSection(){var a=this.getAttribute("data-section"),b=wp.customize.section(a);CustomizerSearchAdmin._clearSearch(),b.expand()},displayMatches:function displayMatches(a,c){var d=CustomizerSearchAdmin.findMatches(a,c);if(0!==d.length){html=d.map(function(b){if(""!==b.label){var c=b.panelName;""!=b.sectionName&&(c="".concat(c," \u25B8 ").concat(b.sectionName));var d=new RegExp(a,"gi"),e=b.label.replace(d,"<span class=\"hl\">".concat(a,"</span>"));return c=c.replace(d,"<span class=\"hl\">".concat(a,"</span>")),"\n <li id=\"accordion-section-".concat(b.section,"\" class=\"accordion-section control-section control-section-default customizer-search-results\" aria-owns=\"sub-accordion-section-").concat(b.section,"\" data-section=\"").concat(b.section,"\">\n <h3 class=\"accordion-section-title\" tabindex=\"0\">\n ").concat(e,"\n <span class=\"screen-reader-text\">Press return or enter to open this section</span>\n </h3>\n <span class=\"search-setting-path\">").concat(c,"</i></span>\n </li>\n ")}}).join(""),b.classList.add("search-not-found"),document.getElementById("search-results").innerHTML="<ul id=\"customizer-search-results\">".concat(html,"</ul>");var e=document.querySelectorAll("#search-results .accordion-section");e.forEach(function(a){return a.addEventListener("click",CustomizerSearchAdmin.expandSection)})}},findMatches:function findMatches(a,b){return b.filter(function(b){null==b.panelName&&(b.panelName=""),null==b.sectionName&&(b.sectionName="");var c=new RegExp(a,"gi");return b.label.match(c)||b.panelName.match(c)||b.sectionName.match(c)})},_bind:function _bind(){wp.customize.previewer.targetWindow.bind(a.proxy(this._showSearchButtonToggle,this))},_showSearchButtonToggle:function _showSearchButtonToggle(){var b=wp.template("search-button");0==a("#customize-info .accordion-section-title .customize-search-toggle").length&&a("#customize-info .accordion-section-title").append(b());var b=wp.template("search-form");0==a("#customize-info #accordion-section-customizer-search").length&&a("#customize-info .customize-panel-description").after(b())},_display_search_form:function _display_search_form(){a("#accordion-section-customizer-search").hasClass("open")?(a("#accordion-section-customizer-search").removeClass("open"),a("#accordion-section-customizer-search").slideUp("fast")):(a(".customize-panel-description").removeClass("open"),a(".customize-panel-description").slideUp("fast"),a("#accordion-section-customizer-search").addClass("open"),a("#accordion-section-customizer-search").slideDown("fast")),a("#customizer-search-input").focus()},_clearSearch:function _clearSearch(){var b=document.getElementById("customize-theme-controls");b.classList.remove("search-not-found"),document.getElementById("search-results").innerHTML="",document.getElementById("customizer-search-input").value="",a("#customizer-search-input").focus()}},a(function(){CustomizerSearchAdmin._init()})})(jQuery); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������assets/js/customizer-search-admin.js����������������������������������������������������������������0000644�����������������00000017117�14760040512�0013563 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * Customizer Admin JS * * @since 1.0.0 * @package Customizer_Search */ (function ($) { /** * Selector for the search field * @type {String} */ const searchInputSelector = '#customizer-search-input'; /** * innerHTML of all the customizer panels. * @type {String} */ let customizerPanels = ''; /** * Handles logic for the admin customize interface. * * @class CustomizerSearchAdmin * @since 1.0.0 */ CustomizerSearchAdmin = { /** * Initializes the admin customize interface. * * @since 1.0.0 * @access private * @method _init */ _init: function () { this._bind(); const controls = $.map(_wpCustomizeSettings.controls, function(control, index) { $.map(_wpCustomizeSettings.sections, function(section, index) { if (control.section == section.id) { $.map(_wpCustomizeSettings.panels, function(panel, index) { if ('' == section.panel) { control.panelName = section.title; } if (section.panel == panel.id) { control.sectionName = section.title; control.panel = section.panel; control.panelName = panel.title; } }); } }); return [control]; }); customizerPanels = document.getElementById('customize-theme-controls'); customizePanelsParent = $('#customize-theme-controls'); customizePanelsParent.after('<div id="search-results"></div>'); $(document).on('keyup', searchInputSelector, function (event) { event.preventDefault(); $this = $(searchInputSelector); string = $this.val(); if (string.length > 0) { CustomizerSearchAdmin.displayMatches(string, controls); } else { CustomizerSearchAdmin._clearSearch(); } }); $(document).on('click', '.clear-search', function (event) { CustomizerSearchAdmin._clearSearch(); }); $(document).on('click', '.customize-search-toggle', function (event) { CustomizerSearchAdmin._display_search_form(); }); }, expandSection: function(setting) { const sectionName = this.getAttribute('data-section'); const section = wp.customize.section( sectionName ); CustomizerSearchAdmin._clearSearch(); section.expand(); }, displayMatches: function (stringToMatch, controls) { const matchArray = CustomizerSearchAdmin.findMatches(stringToMatch, controls); if ( 0 === matchArray.length ) return; // Return if empty results. html = matchArray.map(function(index, elem) { if ( '' === index.label ) return; // Return if empty results. let settingTrail = index.panelName; if ("" != index.sectionName) { settingTrail = `${settingTrail} ▸ ${index.sectionName}`; } const regex = new RegExp(stringToMatch, 'gi'); const label = index.label.replace(regex, `<span class="hl">${stringToMatch}</span>`); settingTrail = settingTrail.replace(regex, `<span class="hl">${stringToMatch}</span>`); return ` <li id="accordion-section-${index.section}" class="accordion-section control-section control-section-default customizer-search-results" aria-owns="sub-accordion-section-${index.section}" data-section="${index.section}"> <h3 class="accordion-section-title" tabindex="0"> ${label} <span class="screen-reader-text">Press return or enter to open this section</span> </h3> <span class="search-setting-path">${settingTrail}</i></span> </li> `; }).join(''); customizerPanels.classList.add('search-not-found'); document.getElementById('search-results').innerHTML = `<ul id="customizer-search-results">${html}</ul>`; const searchSettings = document.querySelectorAll('#search-results .accordion-section'); searchSettings.forEach( setting => setting.addEventListener('click', CustomizerSearchAdmin.expandSection) ); }, findMatches: function (stringToMatch, controls) { return controls.filter(control => { if (control.panelName == null) control.panelName = ''; if (control.sectionName == null) control.sectionName = ''; // Search for the stringToMatch from control label, Panel Name, Section Name. const regex = new RegExp(stringToMatch, 'gi'); return control.label.match(regex) || control.panelName.match(regex) || control.sectionName.match(regex) }); }, /** * Binds admin customize events. * * @since 1.0.0 * @access private * @method _bind */ _bind: function () { wp.customize.previewer.targetWindow.bind($.proxy(this._showSearchButtonToggle, this)); }, /** * Shows the message that is shown for when a header * or footer is already set for this page. * * @since 1.0.0 * @access private * @method _showSearchButtonToggle */ _showSearchButtonToggle: function () { var template = wp.template('search-button'); if ($('#customize-info .accordion-section-title .customize-search-toggle').length == 0) { $('#customize-info .accordion-section-title').append(template()); } var template = wp.template('search-form'); if ($('#customize-info #accordion-section-customizer-search').length == 0) { $('#customize-info .customize-panel-description').after(template()); } }, _display_search_form: function () { if ($('#accordion-section-customizer-search').hasClass('open')) { $('#accordion-section-customizer-search').removeClass('open') $('#accordion-section-customizer-search').slideUp('fast'); } else { $('.customize-panel-description').removeClass('open'); $('.customize-panel-description').slideUp('fast'); $('#accordion-section-customizer-search').addClass('open'); $('#accordion-section-customizer-search').slideDown('fast'); } $(searchInputSelector).focus(); }, /** * Clear Search input and display all the options * * @since 1.0.0 * @access private */ _clearSearch: function () { const panels = document.getElementById('customize-theme-controls'); panels.classList.remove('search-not-found'); document.getElementById('search-results').innerHTML = ''; document.getElementById('customizer-search-input').value = ''; $(searchInputSelector).focus(); } }; // Initialize $(function () { CustomizerSearchAdmin._init(); }); })(jQuery); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������languages/customizer-search.pot���������������������������������������������������������������������0000644�����������������00000005446�14760040512�0012715 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2020 Brainstorm Force # This file is distributed under the same license as the Customizer Search package. msgid "" msgstr "" "Project-Id-Version: Customizer Search 1.1.6\n" "Report-Msgid-Bugs-To: " "https://wordpress.org/support/plugin/customizer-search\n" "POT-Creation-Date: 2020-08-19 10:41:52+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" "Language: en\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Poedit-Country: United States\n" "X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-KeywordsList: " "__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_" "attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n" "X-Poedit-Basepath: ../\n" "X-Poedit-SearchPath-0: .\n" "X-Poedit-Bookmarks: \n" "X-Textdomain-Support: yes\n" "X-Generator: grunt-wp-i18n 1.0.3\n" #: admin/bsf-analytics/class-bsf-analytics.php:216 #. translators: %s product name msgid "" "Want to help make <strong>%1s</strong> even more awesome? Allow us to " "collect non-sensitive diagnostic data and usage information. " msgstr "" #: admin/bsf-analytics/class-bsf-analytics.php:219 msgid "This will be applicable for all sites from the network." msgstr "" #: admin/bsf-analytics/class-bsf-analytics.php:243 #. translators: %s usage doc link msgid " Know More." msgstr "" #: admin/bsf-analytics/class-bsf-analytics.php:251 msgid "Yes! Allow it" msgstr "" #: admin/bsf-analytics/class-bsf-analytics.php:260 msgid "No Thanks" msgstr "" #: admin/bsf-analytics/class-bsf-analytics.php:364 msgid "Usage Tracking" msgstr "" #: admin/bsf-analytics/class-bsf-analytics.php:408 #. translators: %s Product title msgid "Allow %s products to track non-sensitive usage tracking data." msgstr "" #: admin/bsf-analytics/class-bsf-analytics.php:411 msgid " This will be applicable for all sites from the network." msgstr "" #: admin/bsf-analytics/class-bsf-analytics.php:416 msgid "Learn More." msgstr "" #: lib/notices/class-astra-notices.php:125 msgid "WordPress Nonce not validated." msgstr "" #: templates/admin-customize-js-templates.php:20 msgid "Search" msgstr "" #: templates/admin-customize-js-templates.php:22 msgid "Search..." msgstr "" #: templates/admin-customize-js-templates.php:23 msgid "Clear" msgstr "" #. Plugin Name of the plugin/theme msgid "Customizer Search" msgstr "" #. Plugin URI of the plugin/theme msgid "https://github.com/Nikschavan/customizer-search" msgstr "" #. Description of the plugin/theme msgid "Search for settings in customizer." msgstr "" #. Author of the plugin/theme msgid "Brainstorm Force" msgstr "" #. Author URI of the plugin/theme msgid "https://www.brainstormforce.com/" msgstr ""��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������lib/notices/class-astra-notices.php�����������������������������������������������������������������0000644�����������������00000023434�14760040512�0013353 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Astra Sites Notices * * Closing notice on click on `astra-notice-close` class. * * If notice has the data attribute `data-repeat-notice-after="%2$s"` then notice close for that SPECIFIC TIME. * If notice has NO data attribute `data-repeat-notice-after="%2$s"` then notice close for the CURRENT USER FOREVER. * * > Create custom close notice link in the notice markup. E.g. * `<a href="#" data-repeat-notice-after="<?php echo MONTH_IN_SECONDS; ?>" class="astra-notice-close">` * It close the notice for 30 days. * * @package Astra Sites * @since 1.4.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } if ( ! class_exists( 'Astra_Notices' ) ) : /** * Astra_Notices * * @since 1.4.0 */ class Astra_Notices { /** * Notices * * @access private * @var array Notices. * @since 1.4.0 */ private static $version = '1.1.5'; /** * Notices * * @access private * @var array Notices. * @since 1.4.0 */ private static $notices = array(); /** * Instance * * @access private * @var object Class object. * @since 1.4.0 */ private static $instance; /** * Initiator * * @since 1.4.0 * @return object initialized object of class. */ public static function get_instance() { if ( ! isset( self::$instance ) ) { self::$instance = new self(); } return self::$instance; } /** * Constructor * * @since 1.4.0 */ public function __construct() { add_action( 'admin_notices', array( $this, 'show_notices' ), 30 ); add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); add_action( 'wp_ajax_astra-notice-dismiss', array( $this, 'dismiss_notice' ) ); add_filter( 'wp_kses_allowed_html', array( $this, 'add_data_attributes' ), 10, 2 ); } /** * Filters and Returns a list of allowed tags and attributes for a given context. * * @param Array $allowedposttags Array of allowed tags. * @param String $context Context type (explicit). * @since 1.4.0 * @return Array */ public function add_data_attributes( $allowedposttags, $context ) { $allowedposttags['a']['data-repeat-notice-after'] = true; return $allowedposttags; } /** * Add Notice. * * @since 1.4.0 * @param array $args Notice arguments. * @return void */ public static function add_notice( $args = array() ) { self::$notices[] = $args; } /** * Dismiss Notice. * * @since 1.4.0 * @return void */ public function dismiss_notice() { if ( ! apply_filters( 'astra_notices_user_cap_check', current_user_can( 'manage_options' ) ) ) { return; } $notice_id = ( isset( $_POST['notice_id'] ) ) ? sanitize_key( $_POST['notice_id'] ) : ''; $repeat_notice_after = ( isset( $_POST['repeat_notice_after'] ) ) ? absint( $_POST['repeat_notice_after'] ) : ''; $nonce = ( isset( $_POST['nonce'] ) ) ? sanitize_key( $_POST['nonce'] ) : ''; if ( false === wp_verify_nonce( $nonce, 'astra-notices' ) ) { wp_send_json_error( esc_html_e( 'WordPress Nonce not validated.', 'customizer-search' ) ); } // Valid inputs? if ( ! empty( $notice_id ) ) { if ( ! empty( $repeat_notice_after ) ) { set_transient( $notice_id, true, $repeat_notice_after ); } else { update_user_meta( get_current_user_id(), $notice_id, 'notice-dismissed' ); } wp_send_json_success(); } wp_send_json_error(); } /** * Enqueue Scripts. * * @since 1.4.0 * @return void */ public function enqueue_scripts() { wp_register_script( 'astra-notices', self::_get_uri() . 'notices.js', array( 'jquery' ), self::$version, true ); wp_localize_script( 'astra-notices', 'astraNotices', array( '_notice_nonce' => wp_create_nonce( 'astra-notices' ), ) ); } /** * Rating priority sort * * @since 1.5.2 * @param array $array1 array one. * @param array $array2 array two. * @return array */ public function sort_notices( $array1, $array2 ) { if ( ! isset( $array1['priority'] ) ) { $array1['priority'] = 10; } if ( ! isset( $array2['priority'] ) ) { $array2['priority'] = 10; } return $array1['priority'] - $array2['priority']; } /** * Notice Types * * @since 1.4.0 * @return void */ public function show_notices() { $defaults = array( 'id' => '', // Optional, Notice ID. If empty it set `astra-notices-id-<$array-index>`. 'type' => 'info', // Optional, Notice type. Default `info`. Expected [info, warning, notice, error]. 'message' => '', // Optional, Message. 'show_if' => true, // Optional, Show notice on custom condition. E.g. 'show_if' => if( is_admin() ) ? true, false, . 'repeat-notice-after' => '', // Optional, Dismiss-able notice time. It'll auto show after given time. 'display-notice-after' => false, // Optional, Dismiss-able notice time. It'll auto show after given time. 'class' => '', // Optional, Additional notice wrapper class. 'priority' => 10, // Priority of the notice. 'display-with-other-notices' => true, // Should the notice be displayed if other notices are being displayed from Astra_Notices. 'is_dismissible' => true, ); // Count for the notices that are rendered. $notices_displayed = 0; // sort the array with priority. usort( self::$notices, array( $this, 'sort_notices' ) ); foreach ( self::$notices as $key => $notice ) { $notice = wp_parse_args( $notice, $defaults ); $notice['id'] = self::get_notice_id( $notice, $key ); $notice['classes'] = self::get_wrap_classes( $notice ); // Notices visible after transient expire. if ( isset( $notice['show_if'] ) && true === $notice['show_if'] ) { // don't display the notice if it is not supposed to be displayed with other notices. if ( 0 !== $notices_displayed && false === $notice['display-with-other-notices'] ) { continue; } if ( self::is_expired( $notice ) ) { self::markup( $notice ); ++$notices_displayed; } } } } /** * Markup Notice. * * @since 1.4.0 * @param array $notice Notice markup. * @return void */ public static function markup( $notice = array() ) { wp_enqueue_script( 'astra-notices' ); do_action( 'astra_notice_before_markup' ); do_action( "astra_notice_before_markup_{$notice['id']}" ); ?> <div id="<?php echo esc_attr( $notice['id'] ); ?>" class="<?php echo esc_attr( $notice['classes'] ); ?>" data-repeat-notice-after="<?php echo esc_attr( $notice['repeat-notice-after'] ); ?>"> <div class="notice-container"> <?php do_action( "astra_notice_inside_markup_{$notice['id']}" ); ?> <?php echo wp_kses_post( $notice['message'] ); ?> </div> </div> <?php do_action( "astra_notice_after_markup_{$notice['id']}" ); do_action( 'astra_notice_after_markup' ); } /** * Notice classes. * * @since 1.4.0 * * @param array $notice Notice arguments. * @return array Notice wrapper classes. */ private static function get_wrap_classes( $notice ) { $classes = array( 'astra-notice', 'notice' ); if ( $notice['is_dismissible'] ) { $classes[] = 'is-dismissible'; } $classes[] = $notice['class']; if ( isset( $notice['type'] ) && '' !== $notice['type'] ) { $classes[] = 'notice-' . $notice['type']; } return esc_attr( implode( ' ', $classes ) ); } /** * Get Notice ID. * * @since 1.4.0 * * @param array $notice Notice arguments. * @param int $key Notice array index. * @return string Notice id. */ private static function get_notice_id( $notice, $key ) { if ( isset( $notice['id'] ) && ! empty( $notice['id'] ) ) { return $notice['id']; } return 'astra-notices-id-' . $key; } /** * Is notice expired? * * @since 1.4.0 * * @param array $notice Notice arguments. * @return boolean */ private static function is_expired( $notice ) { $transient_status = get_transient( $notice['id'] ); if ( false === $transient_status ) { if ( isset( $notice['display-notice-after'] ) && false !== $notice['display-notice-after'] ) { if ( 'delayed-notice' !== get_user_meta( get_current_user_id(), $notice['id'], true ) && 'notice-dismissed' !== get_user_meta( get_current_user_id(), $notice['id'], true ) ) { set_transient( $notice['id'], 'delayed-notice', $notice['display-notice-after'] ); update_user_meta( get_current_user_id(), $notice['id'], 'delayed-notice' ); return false; } } // Check the user meta status if current notice is dismissed or delay completed. $meta_status = get_user_meta( get_current_user_id(), $notice['id'], true ); if ( empty( $meta_status ) || 'delayed-notice' === $meta_status ) { return true; } } return false; } /** * Get URI * * @return mixed URL. */ public static function _get_uri() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore $path = wp_normalize_path( dirname( __FILE__ ) ); $theme_dir = wp_normalize_path( get_template_directory() ); $plugin_dir = wp_normalize_path( WP_PLUGIN_DIR ); if ( strpos( $path, $theme_dir ) !== false ) { return trailingslashit( get_template_directory_uri() . str_replace( $theme_dir, '', $path ) ); } elseif ( strpos( $path, $plugin_dir ) !== false ) { return plugin_dir_url( __FILE__ ); } elseif ( strpos( $path, dirname( plugin_basename( __FILE__ ) ) ) !== false ) { return plugin_dir_url( __FILE__ ); } return; // phpcs:ignore Squiz.PHP.NonExecutableCode.ReturnNotRequired } } /** * Kicking this off by calling 'get_instance()' method */ Astra_Notices::get_instance(); endif; ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������lib/notices/notices.js������������������������������������������������������������������������������0000644�����������������00000004021�14760040512�0010754 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * Customizer controls toggles * * @package Astra */ ( function( $ ) { /** * Helper class for the main Customizer interface. * * @since 1.0.0 * @class ASTCustomizer */ AstraNotices = { /** * Initializes our custom logic for the Customizer. * * @since 1.0.0 * @method init */ init: function() { this._bind(); }, /** * Binds events for the Astra Portfolio. * * @since 1.0.0 * @access private * @method _bind */ _bind: function() { $( document ).on('click', '.astra-notice-close', AstraNotices._dismissNoticeNew ); $( document ).on('click', '.astra-notice .notice-dismiss', AstraNotices._dismissNotice ); }, _dismissNotice: function( event ) { event.preventDefault(); var repeat_notice_after = $( this ).parents('.astra-notice').data( 'repeat-notice-after' ) || ''; var notice_id = $( this ).parents('.astra-notice').attr( 'id' ) || ''; AstraNotices._ajax( notice_id, repeat_notice_after ); }, _dismissNoticeNew: function( event ) { event.preventDefault(); var repeat_notice_after = $( this ).attr( 'data-repeat-notice-after' ) || ''; var notice_id = $( this ).parents('.astra-notice').attr( 'id' ) || ''; var $el = $( this ).parents('.astra-notice'); $el.fadeTo( 100, 0, function() { $el.slideUp( 100, function() { $el.remove(); }); }); AstraNotices._ajax( notice_id, repeat_notice_after ); var link = $( this ).attr( 'href' ) || ''; var target = $( this ).attr( 'target' ) || ''; if( '' !== link && '_blank' === target ) { window.open(link , '_blank'); } }, _ajax: function( notice_id, repeat_notice_after ) { if( '' === notice_id ) { return; } $.ajax({ url: ajaxurl, type: 'POST', data: { action : 'astra-notice-dismiss', nonce : astraNotices._notice_nonce, notice_id : notice_id, repeat_notice_after : parseInt( repeat_notice_after ), }, }); } }; $( function() { AstraNotices.init(); } ); } )( jQuery );���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������templates/admin-customize-js-templates.php����������������������������������������������������������0000644�����������������00000002016�14760040512�0014767 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Underscore js Template for adding customizer setting for customizer search. * * @since 1.0.0 * @package Customizer_Search */ ?> <script type="text/html" id="tmpl-search-button"> <button type="button" class="customize-search-toggle dashicons dashicons-search" aria-expanded="false"><span class="screen-reader-text">Search</span></button> </script> <script type="text/html" id="tmpl-search-form"> <div id="accordion-section-customizer-search" style="display: none;"> <h4 class="customizer-search-section accordion-section-title"> <span class="search-input"><?php _e( 'Search', 'customizer-search' ); ?></span> <span class="search-field-wrapper"> <input type="text" placeholder="<?php _e( 'Search...', 'customizer-search' ); ?>" name="customizer-search-input" autofocus="autofocus" id="customizer-search-input" class="customizer-search-input"> <button type="button" class="button clear-search" tabindex="0"><?php _e( 'Clear', 'customizer-search' ); ?></button> </span> </h4> </div> </script> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class-customizer-search.php�������������������������������������������������������������������������0000644�����������������00000003344�14760040512�0012032 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Initial Class for Customizer Search * * @since 1.0.0 * @package Customizer_Search */ /** * Handles Customizer logic for the theme builder. * * @since 1.0 */ class Customizer_Search { /** * Instance of Customizer_Search * * @var Customizer_Search */ private static $instance; /** * Initiator */ public static function instance() { if ( ! isset( self::$instance ) ) { self::$instance = new Customizer_Search(); self::$instance->hooks(); } return self::$instance; } /** * Initialize hooks. * * @since 1.0 * @return void */ private function hooks() { add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); add_action( 'customize_controls_print_footer_scripts', array( $this, 'footer_scripts' ) ); add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) ); } /** * Load the plugin textdomain. * * @return void */ public function load_textdomain() { load_plugin_textdomain( 'customizer-search', false, basename( dirname( __FILE__ ) ) . '/languages/' ); } /** * Enqueues scripts for the Customizer. * * @since 1.0 * @return void */ public function enqueue_scripts() { wp_enqueue_style( 'customizer-search-admin', BSFCS_URL . 'assets/css/customizer-search-admin.css', array(), BSFCS_VER ); wp_enqueue_script( 'customizer-search-admin', BSFCS_URL . 'assets/js/customizer-search-admin.compiled.js', array(), filemtime( BSFCS_DIR . 'assets/js/customizer-search-admin.compiled.js' ), true ); } /** * Renders the Customizer footer scripts. * * @since 1.0 * @return void */ public function footer_scripts() { include BSFCS_DIR . 'templates/admin-customize-js-templates.php'; } } Customizer_Search::instance(); ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������customizer-search.php�������������������������������������������������������������������������������0000644�����������������00000002333�14760040512�0010724 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Plugin Name: Customizer Search * Plugin URI: https://github.com/Nikschavan/customizer-search * Description: Search for settings in customizer. * Author: Brainstorm Force * Author URI: https://www.brainstormforce.com/ * Text Domain: customizer-search * Domain Path: /languages * Version: 1.1.6 * * @package Customizer_Search */ define( 'BSFCS_VER', '1.1.6' ); define( 'BSFCS_DIR', plugin_dir_path( __FILE__ ) ); define( 'BSFCS_URL', plugins_url( '/', __FILE__ ) ); define( 'BSFCS_PATH', plugin_basename( __FILE__ ) ); /** * Load the plugin. */ require_once 'class-customizer-search.php'; if ( is_admin() ) { // Admin Notice Library Settings. require_once 'lib/notices/class-astra-notices.php'; } // BSF Analytics library. if ( ! class_exists( 'BSF_Analytics_Loader' ) ) { require_once BSFCS_DIR . 'admin/bsf-analytics/class-bsf-analytics-loader.php'; } $bsf_analytics = BSF_Analytics_Loader::get_instance(); $bsf_analytics->set_entity( array( 'bsf' => array( 'product_name' => 'Customizer Search', 'path' => BSFCS_DIR . 'admin/bsf-analytics', 'author' => 'Brainstorm Force', 'time_to_display' => '+24 hours', ), ) ); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������readme.txt������������������������������������������������������������������������������������������0000644�����������������00000003613�14760040512�0006544 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=== Customizer Search === Contributors: brainstormforce, Nikschavan Donate link: https://www.paypal.me/BrainstormForce Tags: customizer, search Requires at least: 4.6 Tested up to: 6.7 Stable tag: 1.1.6 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Search for settings in customizer. == Description == Using a theme powered by the WordPress Customizer? Then you will love this plugin. Save the time and frustration finding options. Simply search for the setting you're looking for and get there instantly. Works with all WordPress themes. https://www.youtube.com/watch?v=IBFfap_vGzg == Installation == 1. Upload the plugin files to the `/wp-content/plugins/customizer-search` directory, or install the plugin through the WordPress plugins screen directly. 1. Activate the plugin through the 'Plugins' screen in WordPress 1. Search field will appear when in the customizer. == Changelog == = 1.1.6 = - Fix: Admin notice CSS console error in admin area. = 1.1.5 = - Fix: Fixed compatibility with other plugins with respect to the admin notice. = 1.1.4 = - New: Users can now share non-personal usage data to help us test and develop better products. ( https://store.brainstormforce.com/usage-tracking/?utm_source=wp_dashboard&utm_medium=general_settings&utm_campaign=usage_tracking ) = 1.1.3 = - Setup plugin translations through https://translate.wordpress.org/projects/wp-plugins/customizer-search/. = 1.1.2 = - Change the background color highlight in the searched results. = 1.1.1 = - Highlight the characters that are matched in the results. - Auto focus the search input when the search icon is clicked. = 1.1.0 = - Rewrite the search logic to improve the search results. - The search results are direct links to the customizer panel where the searched setting resides, This improves the required clicks to get to the search setting from old version. = 1.0.0 = - Initial Release �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
Переключить редактор
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка