OrderPK!m009admin/bsf-analytics/assets/css/minified/style-rtl.min.cssnu[[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}PK![005admin/bsf-analytics/assets/css/minified/style.min.cssnu[[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}PK!qq7admin/bsf-analytics/assets/css/unminified/style-rtl.cssnu[[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; }PK!qq3admin/bsf-analytics/assets/css/unminified/style.cssnu[[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; }PK! 2admin/bsf-analytics/class-bsf-analytics-loader.phpnu[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 ); } } } } PK!SQYcc1admin/bsf-analytics/class-bsf-analytics-stats.phpnu[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; } } PK! "7"7+admin/bsf-analytics/class-bsf-analytics.phpnu[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 %1s 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( '
%1$s
%3$s %6$s
', /* translators: %s usage doc link */ sprintf( $notice_string . '%4s', 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 ) { ?>
%2s', esc_url( $args['usage_doc_link'] ), __( 'Learn More.', 'customizer-search' ) ) ); ?>
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 ); } } } } } PK!t)) admin/bsf-analytics/version.jsonnu[{ "bsf-analytics-ver": "1.1.0" } PK!@t t &assets/css/customizer-search-admin.cssnu[.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; }PK!г-assets/js/customizer-search-admin.compiled.jsnu[(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("
"),a(document).on("keyup","#customizer-search-input",function(b){b.preventDefault(),$this=a("#customizer-search-input"),string=$this.val(),0".concat(a,"
"));return c=c.replace(d,"".concat(a,"")),"\n
  • \n

    \n ").concat(e,"\n Press return or enter to open this section\n

    \n ").concat(c,"\n
  • \n ")}}).join(""),b.classList.add("search-not-found"),document.getElementById("search-results").innerHTML="");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); PK!]x7OO$assets/js/customizer-search-admin.jsnu[/** * 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('
    '); $(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, `${stringToMatch}`); settingTrail = settingTrail.replace(regex, `${stringToMatch}`); return `
  • ${label} Press return or enter to open this section

    ${settingTrail}
  • `; }).join(''); customizerPanels.classList.add('search-not-found'); document.getElementById('search-results').innerHTML = ``; 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); PK!O & & languages/customizer-search.potnu[# 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 \n" "Language-Team: LANGUAGE \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 %1s 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 ""PK!+''#lib/notices/class-astra-notices.phpnu[ Create custom close notice link in the notice markup. E.g. * `` * 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']}" ); ?>
    PK!Mclass-customizer-search.phpnu[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(); PK!lset_entity( array( 'bsf' => array( 'product_name' => 'Customizer Search', 'path' => BSFCS_DIR . 'admin/bsf-analytics', 'author' => 'Brainstorm Force', 'time_to_display' => '+24 hours', ), ) ); PK! ^ readme.txtnu[=== 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 PK!m009admin/bsf-analytics/assets/css/minified/style-rtl.min.cssnu[PK![005admin/bsf-analytics/assets/css/minified/style.min.cssnu[PK!qq7.admin/bsf-analytics/assets/css/unminified/style-rtl.cssnu[PK!qq3admin/bsf-analytics/assets/css/unminified/style.cssnu[PK! 2admin/bsf-analytics/class-bsf-analytics-loader.phpnu[PK!SQYcc1admin/bsf-analytics/class-bsf-analytics-stats.phpnu[PK! "7"7++admin/bsf-analytics/class-bsf-analytics.phpnu[PK!t)) badmin/bsf-analytics/version.jsonnu[PK!@t t &wcassets/css/customizer-search-admin.cssnu[PK!г-Amassets/js/customizer-search-admin.compiled.jsnu[PK!]x7OO$}assets/js/customizer-search-admin.jsnu[PK!O & & Hlanguages/customizer-search.potnu[PK!+''#lib/notices/class-astra-notices.phpnu[PK!d,lib/notices/notices.jsnu[PK!L*templates/admin-customize-js-templates.phpnu[PK!Mclass-customizer-search.phpnu[PK!l