diff --git a/admin/bsf-analytics/class-bsf-analytics.php b/admin/bsf-analytics/class-bsf-analytics.php index ebf78b1ad..e69de29bb 100644 --- a/admin/bsf-analytics/class-bsf-analytics.php +++ b/admin/bsf-analytics/class-bsf-analytics.php @@ -1,523 +0,0 @@ -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 - * @return void - */ - 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 - * @return void - */ - 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 - * @return void - */ - 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. ', 'header-footer-elementor' ); - - if ( is_multisite() ) { - $notice_string .= __( 'This will be applicable for all sites from the network.', 'header-footer-elementor' ); - } - - $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.', 'header-footer-elementor' ) ), - add_query_arg( - array( - $key . '_analytics_optin' => 'yes', - $key . '_analytics_nonce' => wp_create_nonce( $key . '_analytics_optin' ), - 'bsf_analytics_source' => $key, - ) - ), - __( 'Yes! Allow it', 'header-footer-elementor' ), - 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', 'header-footer-elementor' ) - ), - 'show_if' => true, - 'repeat-notice-after' => false, - 'priority' => 18, - 'display-with-other-notices' => true, - ) - ); - } - } - - /** - * Process usage tracking opt out. - * - * @since 1.0.0 - * @return void - */ - 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 - * @return void - */ - 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 - * @return void - */ - private function optout( $source ) { - update_site_option( $source . '_analytics_optin', 'no' ); - } - - /** - * Load analytics stat class. - * - * @since 1.0.0 - * @return void - */ - private function includes() { - require_once __DIR__ . '/class-bsf-analytics-stats.php'; - } - - /** - * Register usage tracking option in General settings page. - * - * @since 1.0.0 - * @return void - */ - 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', 'header-footer-elementor' ), // 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 - * @return string - */ - 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 - * @return void - */ - public function render_settings_field_html( $args ) { - ?> -
- - %2s', esc_url( $args['usage_doc_link'] ), __( 'Learn More.', 'header-footer-elementor' ) ) ); - ?> -
- 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 - * @return void - */ - 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 - * @return void - */ - 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. - * @return void - * @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 ); - } - } - } - } -} diff --git a/admin/class-hfe-addons-actions.php b/admin/class-hfe-addons-actions.php index 70b5bb9b4..ce17d4509 100644 --- a/admin/class-hfe-addons-actions.php +++ b/admin/class-hfe-addons-actions.php @@ -1,180 +1,171 @@ get_api_domain() ); - // PHPCS:Ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized - $arguments = isset( $_POST['data'] ) ? array_map( 'sanitize_text_field', json_decode( stripslashes( wp_unslash( $_POST['data'] ) ), true ) ) : []; - - $url = add_query_arg( $arguments, $api_domain . 'wp-json/starter-templates/v1/subscribe/' ); // add URL of your site or mail API. - - $response = wp_remote_post( $url, [ 'timeout' => 60 ] ); - - if ( ! is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) === 200 ) { - $response = json_decode( wp_remote_retrieve_body( $response ), true ); - - // Successfully subscribed. - if ( isset( $response['success'] ) && $response['success'] ) { - update_user_meta( get_current_user_ID(), 'hfe-subscribed', 'yes' ); - wp_send_json_success( $response ); - } - } else { - wp_send_json_error( $response ); - } - } - - /** - * Get the API URL. - * - * @since 1.6.0 - * @return string - */ - public function get_api_domain() { - return apply_filters( 'hfe_api_domain', 'https://websitedemos.net/' ); - } - - /** - * Activate addon. - * - * @since 1.6.0 - * @return void - */ - public function hfe_activate_addon() { - - // Run a security check. - check_ajax_referer( 'hfe-admin-nonce', 'nonce' ); - - if ( isset( $_POST['plugin'] ) ) { - - $type = ''; - if ( ! empty( $_POST['type'] ) ) { - $type = sanitize_key( wp_unslash( $_POST['type'] ) ); - } - - $plugin = sanitize_text_field( wp_unslash( $_POST['plugin'] ) ); - - if ( 'plugin' === $type ) { - - // Check for permissions. - if ( ! current_user_can( 'activate_plugins' ) ) { - wp_send_json_error( esc_html__( 'Plugin activation is disabled for you on this site.', 'header-footer-elementor' ) ); - } - - $activate = activate_plugins( $plugin ); - - if ( ! is_wp_error( $activate ) ) { - - do_action( 'hfe_plugin_activated', $plugin ); - - wp_send_json_success( esc_html__( 'Plugin Activated.', 'header-footer-elementor' ) ); - } - } - - if ( 'theme' === $type ) { - - if ( isset( $_POST['slug'] ) ) { - $slug = sanitize_key( wp_unslash( $_POST['slug'] ) ); - - // Check for permissions. - if ( ! ( current_user_can( 'switch_themes' ) ) ) { - wp_send_json_error( esc_html__( 'Theme activation is disabled for you on this site.', 'header-footer-elementor' ) ); - } - - $activate = switch_theme( $slug ); - - if ( ! is_wp_error( $activate ) ) { - - do_action( 'hfe_theme_activated', $plugin ); - - wp_send_json_success( esc_html__( 'Theme Activated.', 'header-footer-elementor' ) ); - } - } - } - } - - if ( 'plugin' === $type ) { - wp_send_json_error( esc_html__( 'Could not activate plugin. Please activate from the Plugins page.', 'header-footer-elementor' ) ); - } elseif ( 'theme' === $type ) { - wp_send_json_error( esc_html__( 'Could not activate theme. Please activate from the Themes page.', 'header-footer-elementor' ) ); - } - } - } - - /** - * Kicking this off by calling 'get_instance()' method - */ - HFE_Addons_Actions::get_instance(); - +if (! class_exists('HFE_Addons_Actions')) { + /** + * Initialization + * + * @since 1.6.0 + */ + class HFE_Addons_Actions + { + /** + * Member Variable + */ + private static HFE_Addons_Actions $instance; + + /** + * Constructor + */ + public function __construct() + { + add_action('wp_ajax_hfe_admin_modal', [ $this, 'hfe_admin_modal' ]); + add_action('wp_ajax_hfe-update-subscription', [ $this, 'update_subscription' ]); + add_action('wp_ajax_hfe_activate_addon', [ $this, 'hfe_activate_addon' ]); + } + + /** + * Initiator + */ + public static function get_instance(): HFE_Addons_Actions + { + if (! isset(self::$instance)) { + self::$instance = new self(); + } + return self::$instance; + } + + /** + * Open modal popup. + * + * @since 1.6.0 + */ + public function hfe_admin_modal(): void + { + // Run a security check. + check_ajax_referer('hfe-admin-nonce', 'nonce'); + + update_user_meta(get_current_user_id(), 'hfe-popup', 'dismissed'); + } + + /** + * Update Subscription + * + * @since 1.6.0 + */ + public function update_subscription(): void + { + check_ajax_referer('hfe-admin-nonce', 'nonce'); + + if (! current_user_can('manage_options')) { + wp_send_json_error('You can\'t perform this action.'); + } + + $api_domain = trailingslashit($this->get_api_domain()); + // PHPCS:Ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + $arguments = isset($_POST['data']) ? array_map('sanitize_text_field', json_decode(stripslashes(wp_unslash($_POST['data'])), true)) : []; + + $url = add_query_arg($arguments, $api_domain . 'wp-json/starter-templates/v1/subscribe/'); // add URL of your site or mail API. + + $response = wp_remote_post($url, [ 'timeout' => 60 ]); + + if (! is_wp_error($response) || wp_remote_retrieve_response_code($response) === 200) { + $response = json_decode(wp_remote_retrieve_body($response), true); + + // Successfully subscribed. + if (isset($response['success']) && $response['success']) { + update_user_meta(get_current_user_ID(), 'hfe-subscribed', 'yes'); + wp_send_json_success($response); + } + } else { + wp_send_json_error($response); + } + } + + /** + * Get the API URL. + * + * @since 1.6.0 + */ + public function get_api_domain(): string + { + return apply_filters('hfe_api_domain', 'https://websitedemos.net/'); + } + + /** + * Activate addon. + * + * @since 1.6.0 + */ + public function hfe_activate_addon(): void + { + // Run a security check. + check_ajax_referer('hfe-admin-nonce', 'nonce'); + + if (isset($_POST['plugin'])) { + $type = ''; + if (! empty($_POST['type'])) { + $type = sanitize_key(wp_unslash($_POST['type'])); + } + + $plugin = sanitize_text_field(wp_unslash($_POST['plugin'])); + + if ($type === 'plugin') { + // Check for permissions. + if (! current_user_can('activate_plugins')) { + wp_send_json_error(esc_html__('Plugin activation is disabled for you on this site.', 'header-footer-elementor')); + } + + $activate = activate_plugins($plugin); + + if (! is_wp_error($activate)) { + do_action('hfe_plugin_activated', $plugin); + + wp_send_json_success(esc_html__('Plugin Activated.', 'header-footer-elementor')); + } + } + + if ($type === 'theme') { + if (isset($_POST['slug'])) { + $slug = sanitize_key(wp_unslash($_POST['slug'])); + + // Check for permissions. + if (! current_user_can('switch_themes')) { + wp_send_json_error(esc_html__('Theme activation is disabled for you on this site.', 'header-footer-elementor')); + } + + $activate = switch_theme($slug); + + if (! is_wp_error($activate)) { + do_action('hfe_theme_activated', $plugin); + + wp_send_json_success(esc_html__('Theme Activated.', 'header-footer-elementor')); + } + } + } + } + + if ($type === 'plugin') { + wp_send_json_error(esc_html__('Could not activate plugin. Please activate from the Plugins page.', 'header-footer-elementor')); + } elseif ($type === 'theme') { + wp_send_json_error(esc_html__('Could not activate theme. Please activate from the Themes page.', 'header-footer-elementor')); + } + } + } + + /** + * Kicking this off by calling 'get_instance()' method + */ + HFE_Addons_Actions::get_instance(); } diff --git a/admin/class-hfe-admin.php b/admin/class-hfe-admin.php index 7b508b1d5..b6a4cc3c2 100644 --- a/admin/class-hfe-admin.php +++ b/admin/class-hfe-admin.php @@ -1,4 +1,7 @@ 2.8 ) { - add_action( 'elementor/editor/footer', [ $this, 'register_hfe_epro_script' ], 99 ); - } - - if ( is_admin() ) { - add_action( 'manage_elementor-hf_posts_custom_column', [ $this, 'column_content' ], 10, 2 ); - add_filter( 'manage_elementor-hf_posts_columns', [ $this, 'column_headings' ] ); - require_once HFE_DIR . 'admin/class-hfe-addons-actions.php'; - } - } - /** - * Script for Elementor Pro full site editing support. - * - * @since 1.4.0 - * - * @return void - */ - public function register_hfe_epro_script() { - $ids_array = [ - [ - 'id' => get_hfe_header_id(), - 'value' => 'Header', - ], - [ - 'id' => get_hfe_footer_id(), - 'value' => 'Footer', - ], - [ - 'id' => hfe_get_before_footer_id(), - 'value' => 'Before Footer', - ], - ]; - - wp_enqueue_script( 'hfe-elementor-pro-compatibility', HFE_URL . 'inc/js/hfe-elementor-pro-compatibility.js', [ 'jquery' ], HFE_VER, true ); - - wp_localize_script( - 'hfe-elementor-pro-compatibility', - 'hfe_admin', - [ - 'ids_array' => wp_json_encode( $ids_array ), - ] - ); - } - - /** - * Adds or removes list table column headings. - * - * @param array $columns Array of columns. - * @return array - */ - public function column_headings( $columns ) { - unset( $columns['date'] ); - - $columns['elementor_hf_display_rules'] = __( 'Display Rules', 'header-footer-elementor' ); - $columns['date'] = __( 'Date', 'header-footer-elementor' ); - - return $columns; - } - - /** - * Adds the custom list table column content. - * - * @since 1.2.0 - * @param array $column Name of column. - * @param int $post_id Post id. - * @return void - */ - public function column_content( $column, $post_id ) { - - if ( 'elementor_hf_display_rules' === $column ) { - - $locations = get_post_meta( $post_id, 'ehf_target_include_locations', true ); - if ( ! empty( $locations ) ) { - echo '
'; - echo 'Display: '; - $this->column_display_location_rules( $locations ); - echo '
'; - } - - $locations = get_post_meta( $post_id, 'ehf_target_exclude_locations', true ); - if ( ! empty( $locations ) ) { - echo '
'; - echo 'Exclusion: '; - $this->column_display_location_rules( $locations ); - echo '
'; - } - - $users = get_post_meta( $post_id, 'ehf_target_user_roles', true ); - if ( isset( $users ) && is_array( $users ) ) { - if ( isset( $users[0] ) && ! empty( $users[0] ) ) { - $user_label = []; - foreach ( $users as $user ) { - $user_label[] = Astra_Target_Rules_Fields::get_user_by_key( $user ); - } - echo '
'; - echo 'Users: '; - echo esc_html( join( ', ', $user_label ) ); - echo '
'; - } - } - } - } - - /** - * Get Markup of Location rules for Display rule column. - * - * @param array $locations Array of locations. - * @return void - */ - public function column_display_location_rules( $locations ) { - - $location_label = []; - if ( is_array( $locations ) && is_array( $locations['rule'] ) && isset( $locations['rule'] ) ) { - $index = array_search( 'specifics', $locations['rule'] ); - if ( false !== $index && ! empty( $index ) ) { - unset( $locations['rule'][ $index ] ); - } - } - - if ( isset( $locations['rule'] ) && is_array( $locations['rule'] ) ) { - foreach ( $locations['rule'] as $location ) { - $location_label[] = Astra_Target_Rules_Fields::get_location_by_key( $location ); - } - } - if ( isset( $locations['specific'] ) && is_array( $locations['specific'] ) ) { - foreach ( $locations['specific'] as $location ) { - $location_label[] = Astra_Target_Rules_Fields::get_location_by_key( $location ); - } - } - - echo esc_html( join( ', ', $location_label ) ); - } - - - /** - * Register Post type for Elementor Header & Footer Builder templates - * - * @return void - */ - public function header_footer_posttype() { - if ( ! current_user_can( 'manage_options' ) ) { - return; - } - $labels = [ - 'name' => esc_html__( 'Elementor Header & Footer Builder', 'header-footer-elementor' ), - 'singular_name' => esc_html__( 'Elementor Header & Footer Builder', 'header-footer-elementor' ), - 'menu_name' => esc_html__( 'Elementor Header & Footer Builder', 'header-footer-elementor' ), - 'name_admin_bar' => esc_html__( 'Elementor Header & Footer Builder', 'header-footer-elementor' ), - 'add_new' => esc_html__( 'Add New', 'header-footer-elementor' ), - 'add_new_item' => esc_html__( 'Add New Header or Footer', 'header-footer-elementor' ), - 'new_item' => esc_html__( 'New Template', 'header-footer-elementor' ), - 'edit_item' => esc_html__( 'Edit Template', 'header-footer-elementor' ), - 'view_item' => esc_html__( 'View Template', 'header-footer-elementor' ), - 'all_items' => esc_html__( 'All Templates', 'header-footer-elementor' ), - 'search_items' => esc_html__( 'Search Templates', 'header-footer-elementor' ), - 'parent_item_colon' => esc_html__( 'Parent Templates:', 'header-footer-elementor' ), - 'not_found' => esc_html__( 'No Templates found.', 'header-footer-elementor' ), - 'not_found_in_trash' => esc_html__( 'No Templates found in Trash.', 'header-footer-elementor' ), - ]; - - $args = [ - 'labels' => $labels, - 'public' => true, - 'show_ui' => true, - 'show_in_menu' => false, - 'show_in_nav_menus' => false, - 'exclude_from_search' => true, - 'capability_type' => 'post', - 'hierarchical' => false, - 'menu_icon' => 'dashicons-editor-kitchensink', - 'supports' => [ 'title', 'thumbnail', 'elementor' ], - ]; - - register_post_type( 'elementor-hf', $args ); - } - - /** - * Register the admin menu for Elementor Header & Footer Builder. - * - * @since 1.0.0 - * @since 1.0.1 - * Moved the menu under Appearance -> Elementor Header & Footer Builder - * @return void - */ - public function register_admin_menu() { - add_submenu_page( - 'themes.php', - __( 'Elementor Header & Footer Builder', 'header-footer-elementor' ), - __( 'Elementor Header & Footer Builder', 'header-footer-elementor' ), - 'edit_pages', - 'edit.php?post_type=elementor-hf' - ); - } - - /** - * Register meta box(es). - * - * @return void - */ - public function ehf_register_metabox() { - add_meta_box( - 'ehf-meta-box', - __( 'Elementor Header & Footer Builder Options', 'header-footer-elementor' ), - [ - $this, - 'efh_metabox_render', - ], - 'elementor-hf', - 'normal', - 'high' - ); - } - - /** - * Render Meta field. - * - * @param array $post Currennt post object which is being displayed. - * @return void - */ - public function efh_metabox_render( $post ) { - $values = get_post_custom( $post->ID ); - $template_type = isset( $values['ehf_template_type'] ) ? esc_attr( sanitize_text_field( $values['ehf_template_type'][0] ) ) : ''; - $display_on_canvas = isset( $values['display-on-canvas-template'] ) ? true : false; - - // We'll use this nonce field later on when saving. - wp_nonce_field( 'ehf_meta_nounce', 'ehf_meta_nounce' ); - ?> - - - - - - - - display_rules_tab(); ?> - - - - - - - - - -
- - - -
- - - - - - - -
- - - - /> -
- admin_styles(); - - $include_locations = get_post_meta( get_the_id(), 'ehf_target_include_locations', true ); - $exclude_locations = get_post_meta( get_the_id(), 'ehf_target_exclude_locations', true ); - $users = get_post_meta( get_the_id(), 'ehf_target_user_roles', true ); - ?> - - - - - - - __( 'Display Rules', 'header-footer-elementor' ), - 'value' => '[{"type":"basic-global","specific":null}]', - 'tags' => 'site,enable,target,pages', - 'rule_type' => 'display', - 'add_rule_label' => __( 'Add Display Rule', 'header-footer-elementor' ), - ], - $include_locations - ); - ?> - - - - - - - - - __( 'Exclude On', 'header-footer-elementor' ), - 'value' => '[]', - 'tags' => 'site,enable,target,pages', - 'add_rule_label' => __( 'Add Exclusion Rule', 'header-footer-elementor' ), - 'rule_type' => 'exclude', - ], - $exclude_locations - ); - ?> - - - - - - - - - __( 'Users', 'header-footer-elementor' ), - 'value' => '[]', - 'tags' => 'site,enable,target,pages', - 'add_rule_label' => __( 'Add User Rule', 'header-footer-elementor' ), - ], - $users - ); - ?> - - - post_type ) { - return; - } - - $template_type = get_post_meta( $post->ID, 'ehf_template_type', true ); - - if ( '' !== $template_type ) { - $templates = Header_Footer_Elementor::get_template_id( $template_type ); - - // Check if more than one template is selected for current template type. - if ( is_array( $templates ) && isset( $templates[1] ) && $post->ID != $templates[0] ) { - $post_title = '' . esc_html( get_the_title( $templates[0] ) ) . ''; - $template_location = '' . esc_html( $this->template_location( $template_type ) ) . ''; - /* Translators: Post title, Template Location */ - $message = sprintf( __( 'Template %1$s is already assigned to the location %2$s', 'header-footer-elementor' ), $post_title, $template_location ); - - echo '

'; - echo esc_html( $message ); - echo '

'; - } - } - } - - /** - * Convert the Template name to be added in the notice. - * - * @since 1.0.0 - * - * @param string $template_type Template type name. - * - * @return string $template_type Template type name. - */ - public function template_location( $template_type ) { - $template_type = ucfirst( str_replace( 'type_', '', $template_type ) ); - - return $template_type; - } - - /** - * Don't display the elementor Elementor Header & Footer Builder templates on the frontend for non edit_posts capable users. - * - * @since 1.0.0 - * @return void - */ - public function block_template_frontend() { - if ( is_singular( 'elementor-hf' ) && ! current_user_can( 'edit_posts' ) ) { - wp_redirect( site_url(), 301 ); - die; - } - } - - /** - * Single template function which will choose our template - * - * @since 1.0.1 - * - * @param string $single_template Single template. - * @return string - */ - public function load_canvas_template( $single_template ) { - global $post; - - if ( 'elementor-hf' == $post->post_type ) { - $elementor_2_0_canvas = ELEMENTOR_PATH . '/modules/page-templates/templates/canvas.php'; - - if ( file_exists( $elementor_2_0_canvas ) ) { - return $elementor_2_0_canvas; - } else { - return ELEMENTOR_PATH . '/includes/page-templates/canvas.php'; - } - } - - return $single_template; - } - - /** - * Set shortcode column for template list. - * - * @param array $columns template list columns. - * @return array - */ - public function set_shortcode_columns( $columns ) { - $date_column = $columns['date']; - - unset( $columns['date'] ); - - $columns['shortcode'] = __( 'Shortcode', 'header-footer-elementor' ); - $columns['date'] = $date_column; - - return $columns; - } - - /** - * Display shortcode in template list column. - * - * @param array $column template list column. - * @param int $post_id post id. - * @return void - */ - public function render_shortcode_column( $column, $post_id ) { - switch ( $column ) { - case 'shortcode': - ob_start(); - ?> - - - - - 2.8) { + add_action('elementor/editor/footer', [ $this, 'register_hfe_epro_script' ], 99); + } + + if (is_admin()) { + add_action('manage_elementor-hf_posts_custom_column', [ $this, 'column_content' ], 10, 2); + add_filter('manage_elementor-hf_posts_columns', [ $this, 'column_headings' ]); + require_once HFE_DIR . 'admin/class-hfe-addons-actions.php'; + } + } + + /** + * Instance of HFE_Admin + * + * @return HFE_Admin Instance of HFE_Admin + */ + public static function instance(): HFE_Admin + { + if (! isset(self::$_instance)) { + self::$_instance = new self(); + } + + add_action('elementor/init', self::class . '::load_admin', 0); + + return self::$_instance; + } + + /** + * Load the icons style in editor. + * + * @since 1.3.0 + * + * @access public + */ + public static function load_admin(): void + { + add_action('elementor/editor/after_enqueue_styles', self::class . '::hfe_admin_enqueue_scripts'); + } + + /** + * Enqueue admin scripts + * + * @since 1.3.0 + * + * @param string $hook Current page hook. + * + * @access public + */ + public static function hfe_admin_enqueue_scripts(string $hook): void + { + // Register the icons styles. + wp_register_style( + 'hfe-style', + HFE_URL . 'assets/css/style.css', + [], + HFE_VER + ); + + wp_enqueue_style('hfe-style'); + } + /** + * Script for Elementor Pro full site editing support. + * + * @since 1.4.0 + */ + public function register_hfe_epro_script(): void + { + $ids_array = [ + [ + 'id' => get_hfe_header_id(), + 'value' => 'Header', + ], + [ + 'id' => get_hfe_footer_id(), + 'value' => 'Footer', + ], + [ + 'id' => hfe_get_before_footer_id(), + 'value' => 'Before Footer', + ], + ]; + + wp_enqueue_script('hfe-elementor-pro-compatibility', HFE_URL . 'inc/js/hfe-elementor-pro-compatibility.js', [ 'jquery' ], HFE_VER, true); + + wp_localize_script( + 'hfe-elementor-pro-compatibility', + 'hfe_admin', + [ + 'ids_array' => wp_json_encode($ids_array), + ] + ); + } + + /** + * Adds or removes list table column headings. + * + * @param array $columns Array of columns. + */ + public function column_headings(array $columns): array + { + unset($columns['date']); + + $columns['elementor_hf_display_rules'] = __('Display Rules', 'header-footer-elementor'); + $columns['date'] = __('Date', 'header-footer-elementor'); + + return $columns; + } + + /** + * Adds the custom list table column content. + * + * @since 1.2.0 + * + * @param array $column Name of column. + * @param int $post_id Post id. + */ + public function column_content(array $column, int $post_id): void + { + if ($column === 'elementor_hf_display_rules') { + $locations = get_post_meta($post_id, 'ehf_target_include_locations', true); + if (! empty($locations)) { + echo '
'; + echo 'Display: '; + $this->column_display_location_rules($locations); + echo '
'; + } + + $locations = get_post_meta($post_id, 'ehf_target_exclude_locations', true); + if (! empty($locations)) { + echo '
'; + echo 'Exclusion: '; + $this->column_display_location_rules($locations); + echo '
'; + } + + $users = get_post_meta($post_id, 'ehf_target_user_roles', true); + if (isset($users) && is_array($users)) { + if (isset($users[0]) && ! empty($users[0])) { + $user_label = []; + foreach ($users as $user) { + $user_label[] = Astra_Target_Rules_Fields::get_user_by_key($user); + } + echo '
'; + echo 'Users: '; + echo esc_html(join(', ', $user_label)); + echo '
'; + } + } + } + } + + /** + * Get Markup of Location rules for Display rule column. + * + * @param array $locations Array of locations. + */ + public function column_display_location_rules(array $locations): void + { + $location_label = []; + if (is_array($locations) && is_array($locations['rule']) && isset($locations['rule'])) { + $index = array_search('specifics', $locations['rule']); + if ($index !== false && ! empty($index)) { + unset($locations['rule'][$index]); + } + } + + if (isset($locations['rule']) && is_array($locations['rule'])) { + foreach ($locations['rule'] as $location) { + $location_label[] = Astra_Target_Rules_Fields::get_location_by_key($location); + } + } + if (isset($locations['specific']) && is_array($locations['specific'])) { + foreach ($locations['specific'] as $location) { + $location_label[] = Astra_Target_Rules_Fields::get_location_by_key($location); + } + } + + echo esc_html(join(', ', $location_label)); + } + + /** + * Register Post type for Elementor Header & Footer Builder templates + */ + public function header_footer_posttype(): void + { + if (! current_user_can('manage_options')) { + return; + } + $labels = [ + 'name' => esc_html__('Elementor Header & Footer Builder', 'header-footer-elementor'), + 'singular_name' => esc_html__('Elementor Header & Footer Builder', 'header-footer-elementor'), + 'menu_name' => esc_html__('Elementor Header & Footer Builder', 'header-footer-elementor'), + 'name_admin_bar' => esc_html__('Elementor Header & Footer Builder', 'header-footer-elementor'), + 'add_new' => esc_html__('Add New', 'header-footer-elementor'), + 'add_new_item' => esc_html__('Add New Header or Footer', 'header-footer-elementor'), + 'new_item' => esc_html__('New Template', 'header-footer-elementor'), + 'edit_item' => esc_html__('Edit Template', 'header-footer-elementor'), + 'view_item' => esc_html__('View Template', 'header-footer-elementor'), + 'all_items' => esc_html__('All Templates', 'header-footer-elementor'), + 'search_items' => esc_html__('Search Templates', 'header-footer-elementor'), + 'parent_item_colon' => esc_html__('Parent Templates:', 'header-footer-elementor'), + 'not_found' => esc_html__('No Templates found.', 'header-footer-elementor'), + 'not_found_in_trash' => esc_html__('No Templates found in Trash.', 'header-footer-elementor'), + ]; + + $args = [ + 'labels' => $labels, + 'public' => true, + 'show_ui' => true, + 'show_in_menu' => false, + 'show_in_nav_menus' => false, + 'exclude_from_search' => true, + 'capability_type' => 'post', + 'hierarchical' => false, + 'menu_icon' => 'dashicons-editor-kitchensink', + 'supports' => [ 'title', 'thumbnail', 'elementor' ], + ]; + + register_post_type('elementor-hf', $args); + } + + /** + * Register the admin menu for Elementor Header & Footer Builder. + * + * @since 1.0.0 + * @since 1.0.1 + * Moved the menu under Appearance -> Elementor Header & Footer Builder + */ + public function register_admin_menu(): void + { + add_submenu_page( + 'themes.php', + __('Elementor Header & Footer Builder', 'header-footer-elementor'), + __('Elementor Header & Footer Builder', 'header-footer-elementor'), + 'edit_pages', + 'edit.php?post_type=elementor-hf' + ); + } + + /** + * Register meta box(es). + */ + public function ehf_register_metabox(): void + { + add_meta_box( + 'ehf-meta-box', + __('Elementor Header & Footer Builder Options', 'header-footer-elementor'), + [ + $this, + 'efh_metabox_render', + ], + 'elementor-hf', + 'normal', + 'high' + ); + } + + /** + * Render Meta field. + * + * @param array $post Currennt post object which is being displayed. + */ + public function efh_metabox_render(array $post): void + { + $values = get_post_custom($post->ID); + $template_type = isset($values['ehf_template_type']) ? esc_attr(sanitize_text_field($values['ehf_template_type'][0])) : ''; + $display_on_canvas = isset($values['display-on-canvas-template']) ? true : false; + + // We'll use this nonce field later on when saving. + wp_nonce_field('ehf_meta_nounce', 'ehf_meta_nounce'); + ?> + + + + + + + + display_rules_tab(); ?> + + + + + + + + + +
+ + + +
+ + + + + + + +
+ + + + /> +
+ admin_styles(); + + $include_locations = get_post_meta(get_the_id(), 'ehf_target_include_locations', true); + $exclude_locations = get_post_meta(get_the_id(), 'ehf_target_exclude_locations', true); + $users = get_post_meta(get_the_id(), 'ehf_target_user_roles', true); + ?> + + + + + + + __('Display Rules', 'header-footer-elementor'), + 'value' => '[{"type":"basic-global","specific":null}]', + 'tags' => 'site,enable,target,pages', + 'rule_type' => 'display', + 'add_rule_label' => __('Add Display Rule', 'header-footer-elementor'), + ], + $include_locations + ); + ?> + + + + + + + + + __('Exclude On', 'header-footer-elementor'), + 'value' => '[]', + 'tags' => 'site,enable,target,pages', + 'add_rule_label' => __('Add Exclusion Rule', 'header-footer-elementor'), + 'rule_type' => 'exclude', + ], + $exclude_locations + ); + ?> + + + + + + + + + __('Users', 'header-footer-elementor'), + 'value' => '[]', + 'tags' => 'site,enable,target,pages', + 'add_rule_label' => __('Add User Rule', 'header-footer-elementor'), + ], + $users + ); + ?> + + + post_type !== 'elementor-hf') { + return; + } + + $template_type = get_post_meta($post->ID, 'ehf_template_type', true); + + if ($template_type !== '') { + $templates = Header_Footer_Elementor::get_template_id($template_type); + + // Check if more than one template is selected for current template type. + if (is_array($templates) && isset($templates[1]) && $post->ID !== $templates[0]) { + $post_title = '' . esc_html(get_the_title($templates[0])) . ''; + $template_location = '' . esc_html($this->template_location($template_type)) . ''; + /* Translators: Post title, Template Location */ + $message = sprintf(__('Template %1$s is already assigned to the location %2$s', 'header-footer-elementor'), $post_title, $template_location); + + echo '

'; + echo esc_html($message); + echo '

'; + } + } + } + + /** + * Convert the Template name to be added in the notice. + * + * @since 1.0.0 + * + * @param string $template_type Template type name. + * + * @return string $template_type Template type name. + */ + public function template_location(string $template_type): string + { + return ucfirst(str_replace('type_', '', $template_type)); + } + + /** + * Don't display the elementor Elementor Header & Footer Builder templates on the frontend for non edit_posts capable users. + * + * @since 1.0.0 + */ + public function block_template_frontend(): void + { + if (is_singular('elementor-hf') && ! current_user_can('edit_posts')) { + wp_redirect(site_url(), 301); + die; + } + } + + /** + * Single template function which will choose our template + * + * @since 1.0.1 + * + * @param string $single_template Single template. + */ + public function load_canvas_template(string $single_template): string + { + global $post; + + if ($post->post_type === 'elementor-hf') { + $elementor_2_0_canvas = ELEMENTOR_PATH . '/modules/page-templates/templates/canvas.php'; + + if (file_exists($elementor_2_0_canvas)) { + return $elementor_2_0_canvas; + } + return ELEMENTOR_PATH . '/includes/page-templates/canvas.php'; + } + + return $single_template; + } + + /** + * Set shortcode column for template list. + * + * @param array $columns template list columns. + */ + public function set_shortcode_columns(array $columns): array + { + $date_column = $columns['date']; + + unset($columns['date']); + + $columns['shortcode'] = __('Shortcode', 'header-footer-elementor'); + $columns['date'] = $date_column; + + return $columns; + } + + /** + * Display shortcode in template list column. + * + * @param array $column template list column. + * @param int $post_id post id. + */ + public function render_shortcode_column(array $column, int $post_id): void + { + switch ($column) { + case 'shortcode': + ob_start(); + ?> + + + + + =5.3", - "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" + "react/stream": "^1.2" }, "require-dev": { - "composer/composer": "*", - "php-parallel-lint/php-parallel-lint": "^1.3.1", - "phpcompatibility/php-compatibility": "^9.0" - }, - "type": "composer-plugin", - "extra": { - "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35", + "react/event-loop": "^1.2" }, + "type": "library", "autoload": { "psr-4": { - "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + "Clue\\React\\NDJson\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -291,77 +286,75 @@ ], "authors": [ { - "name": "Franck Nijhof", - "email": "franck.nijhof@dealerdirect.com", - "homepage": "http://www.frenck.nl", - "role": "Developer / IT Manager" - }, - { - "name": "Contributors", - "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" + "name": "Christian Lück", + "email": "christian@clue.engineering" } ], - "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://www.dealerdirect.com", + "description": "Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.", + "homepage": "https://github.com/clue/reactphp-ndjson", "keywords": [ - "PHPCodeSniffer", - "PHP_CodeSniffer", - "code quality", - "codesniffer", - "composer", - "installer", - "phpcbf", - "phpcs", - "plugin", - "qa", - "quality", - "standard", - "standards", - "style guide", - "stylecheck", - "tests" + "NDJSON", + "json", + "jsonlines", + "newline", + "reactphp", + "streaming" ], "support": { - "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", - "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" + "issues": "https://github.com/clue/reactphp-ndjson/issues", + "source": "https://github.com/clue/reactphp-ndjson/tree/v1.3.0" }, - "time": "2022-02-04T12:51:07+00:00" + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-12-23T10:58:28+00:00" }, { - "name": "nikic/php-parser", - "version": "v4.19.1", + "name": "cmgmyr/phploc", + "version": "8.0.3", "source": { "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b" + "url": "https://github.com/cmgmyr/phploc.git", + "reference": "e61d4729df46c5920ab61973bfa3f70f81a70b5f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4e1b88d21c69391150ace211e9eaf05810858d0b", - "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b", + "url": "https://api.github.com/repos/cmgmyr/phploc/zipball/e61d4729df46c5920ab61973bfa3f70f81a70b5f", + "reference": "e61d4729df46c5920ab61973bfa3f70f81a70b5f", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": ">=7.1" + "ext-dom": "*", + "ext-json": "*", + "php": "^7.4 || ^8.0", + "phpunit/php-file-iterator": "^3.0|^4.0", + "sebastian/cli-parser": "^1.0|^2.0" }, "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + "friendsofphp/php-cs-fixer": "^3.2", + "phpunit/phpunit": "^9.0|^10.0", + "vimeo/psalm": "^5.7" }, "bin": [ - "bin/php-parse" + "phploc" ], "type": "library", "extra": { "branch-alias": { - "dev-master": "4.9-dev" + "dev-main": "8.0-dev" } }, "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -369,53 +362,56 @@ ], "authors": [ { - "name": "Nikita Popov" + "name": "Chris Gmyr", + "email": "cmgmyr@gmail.com", + "role": "lead" } ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], + "description": "A tool for quickly measuring the size of a PHP project.", + "homepage": "https://github.com/cmgmyr/phploc", "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.1" + "issues": "https://github.com/cmgmyr/phploc/issues", + "source": "https://github.com/cmgmyr/phploc/tree/8.0.3" }, - "time": "2024-03-17T08:10:35+00:00" + "funding": [ + { + "url": "https://github.com/cmgmyr", + "type": "github" + } + ], + "time": "2023-08-05T16:49:39+00:00" }, { - "name": "php-stubs/generator", - "version": "v0.8.4", + "name": "composer/pcre", + "version": "3.1.4", "source": { "type": "git", - "url": "https://github.com/php-stubs/generator.git", - "reference": "bf758105124218225d59e698913ac852ee7d79c7" + "url": "https://github.com/composer/pcre.git", + "reference": "04229f163664973f68f38f6f73d917799168ef24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/generator/zipball/bf758105124218225d59e698913ac852ee7d79c7", - "reference": "bf758105124218225d59e698913ac852ee7d79c7", + "url": "https://api.github.com/repos/composer/pcre/zipball/04229f163664973f68f38f6f73d917799168ef24", + "reference": "04229f163664973f68f38f6f73d917799168ef24", "shasum": "" }, "require": { - "nikic/php-parser": "^4.10", - "php": "^7.3 || ^8.0", - "symfony/console": "^5.1 || ^6.0", - "symfony/filesystem": "^5.0 || ^6.0", - "symfony/finder": "^5.0 || ^6.0" + "php": "^7.4 || ^8.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.16 || ^3.12", - "phpunit/phpunit": "^9.4", - "vimeo/psalm": "^4.1" + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^5" }, - "bin": [ - "bin/generate-stubs" - ], "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, "autoload": { "psr-4": { - "StubsGenerator\\": "src/" + "Composer\\Pcre\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -424,352 +420,582 @@ ], "authors": [ { - "name": "Giaco Corsiglia", - "email": "GiacoCorsiglia@gmail.com" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" } ], - "description": "Generate stubs from any PHP code for IDE completion and static analysis.", - "homepage": "https://github.com/php-stubs/generator", + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", "keywords": [ - "ide", - "static analysis" + "PCRE", + "preg", + "regex", + "regular expression" ], "support": { - "issues": "https://github.com/php-stubs/generator/issues", - "source": "https://github.com/php-stubs/generator/tree/v0.8.4" + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.1.4" }, - "time": "2023-07-24T16:33:51+00:00" + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-05-27T13:40:54+00:00" }, { - "name": "php-stubs/wordpress-stubs", - "version": "v6.5.3", + "name": "composer/semver", + "version": "3.4.3", "source": { "type": "git", - "url": "https://github.com/php-stubs/wordpress-stubs.git", - "reference": "e611a83292d02055a25f83291a98fadd0c21e092" + "url": "https://github.com/composer/semver.git", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/e611a83292d02055a25f83291a98fadd0c21e092", - "reference": "e611a83292d02055a25f83291a98fadd0c21e092", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", "shasum": "" }, - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0", - "nikic/php-parser": "^4.13", - "php": "^7.4 || ~8.0.0", - "php-stubs/generator": "^0.8.3", - "phpdocumentor/reflection-docblock": "5.3", - "phpstan/phpstan": "^1.10.49", - "phpunit/phpunit": "^9.5", - "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.11" + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" }, - "suggest": { - "paragonie/sodium_compat": "Pure PHP implementation of libsodium", - "symfony/polyfill-php80": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan" + "require-dev": { + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "WordPress function and class declaration stubs for static analysis.", - "homepage": "https://github.com/php-stubs/wordpress-stubs", + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", "keywords": [ - "PHPStan", - "static analysis", - "wordpress" + "semantic", + "semver", + "validation", + "versioning" ], "support": { - "issues": "https://github.com/php-stubs/wordpress-stubs/issues", - "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.5.3" + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.3" }, - "time": "2024-05-08T02:12:31+00:00" + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-09-19T14:15:21+00:00" }, { - "name": "phpcompatibility/php-compatibility", - "version": "9.3.5", + "name": "composer/xdebug-handler", + "version": "3.0.5", "source": { "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", "shasum": "" }, "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" - }, - "conflict": { - "squizlabs/php_codesniffer": "2.6.2" + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" }, "require-dev": { - "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } }, - "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0-or-later" + "MIT" ], "authors": [ { - "name": "Wim Godden", - "homepage": "https://github.com/wimg", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", - "role": "lead" - }, - { - "name": "Contributors", - "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" } ], - "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", - "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "description": "Restarts a process without Xdebug.", "keywords": [ - "compatibility", - "phpcs", - "standards" + "Xdebug", + "performance" ], "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibility" + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" }, - "time": "2019-12-27T09:44:58+00:00" + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-05-06T16:37:16+00:00" }, { - "name": "phpcompatibility/phpcompatibility-paragonie", - "version": "1.3.3", + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v0.7.2", "source": { "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", - "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac" + "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/293975b465e0e709b571cbf0c957c6c0a7b9a2ac", - "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", "shasum": "" }, "require": { - "phpcompatibility/php-compatibility": "^9.0" + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0", - "paragonie/random_compat": "dev-master", - "paragonie/sodium_compat": "dev-master" + "composer/composer": "*", + "php-parallel-lint/php-parallel-lint": "^1.3.1", + "phpcompatibility/php-compatibility": "^9.0" }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + "type": "composer-plugin", + "extra": { + "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "autoload": { + "psr-4": { + "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + } }, - "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0-or-later" + "MIT" ], "authors": [ { - "name": "Wim Godden", - "role": "lead" + "name": "Franck Nijhof", + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" }, { - "name": "Juliette Reinders Folmer", - "role": "lead" + "name": "Contributors", + "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" } ], - "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", - "homepage": "http://phpcompatibility.com/", + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "homepage": "http://www.dealerdirect.com", "keywords": [ - "compatibility", - "paragonie", + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcbf", "phpcs", - "polyfill", + "plugin", + "qa", + "quality", + "standard", "standards", - "static analysis" + "style guide", + "stylecheck", + "tests" ], "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", - "security": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/security/policy", - "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" + "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", + "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" }, - "funding": [ - { - "url": "https://github.com/PHPCompatibility", - "type": "github" - }, - { - "url": "https://github.com/jrfnl", - "type": "github" - }, + "time": "2022-02-04T12:51:07+00:00" + }, + { + "name": "evenement/evenement", + "version": "v3.0.2", + "source": { + "type": "git", + "url": "https://github.com/igorw/evenement.git", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^9 || ^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Evenement\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ { - "url": "https://opencollective.com/php_codesniffer", - "type": "open_collective" + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" } ], - "time": "2024-04-24T21:30:46+00:00" + "description": "Événement is a very simple event dispatching library for PHP", + "keywords": [ + "event-dispatcher", + "event-emitter" + ], + "support": { + "issues": "https://github.com/igorw/evenement/issues", + "source": "https://github.com/igorw/evenement/tree/v3.0.2" + }, + "time": "2023-08-08T05:53:35+00:00" }, { - "name": "phpcompatibility/phpcompatibility-wp", - "version": "2.1.5", + "name": "fidry/cpu-core-counter", + "version": "1.2.0", "source": { "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", - "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082" + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "8520451a140d3f46ac33042715115e290cf5785f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/01c1ff2704a58e46f0cb1ca9d06aee07b3589082", - "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/8520451a140d3f46ac33042715115e290cf5785f", + "reference": "8520451a140d3f46ac33042715115e290cf5785f", "shasum": "" }, "require": { - "phpcompatibility/php-compatibility": "^9.0", - "phpcompatibility/phpcompatibility-paragonie": "^1.0" + "php": "^7.2 || ^8.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0" + "fidry/makefile": "^0.2.0", + "fidry/php-cs-fixer-config": "^1.1.2", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^1.9.2", + "phpstan/phpstan-deprecation-rules": "^1.0.0", + "phpstan/phpstan-phpunit": "^1.2.2", + "phpstan/phpstan-strict-rules": "^1.4.4", + "phpunit/phpunit": "^8.5.31 || ^9.5.26", + "webmozarts/strict-phpunit": "^7.5" }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + "type": "library", + "autoload": { + "psr-4": { + "Fidry\\CpuCoreCounter\\": "src/" + } }, - "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0-or-later" + "MIT" ], "authors": [ { - "name": "Wim Godden", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "role": "lead" + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" } ], - "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", - "homepage": "http://phpcompatibility.com/", + "description": "Tiny utility to get the number of CPU cores.", "keywords": [ - "compatibility", - "phpcs", - "standards", - "static analysis", - "wordpress" + "CPU", + "core" ], "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", - "security": "https://github.com/PHPCompatibility/PHPCompatibilityWP/security/policy", - "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.2.0" }, "funding": [ { - "url": "https://github.com/PHPCompatibility", - "type": "github" - }, - { - "url": "https://github.com/jrfnl", + "url": "https://github.com/theofidry", "type": "github" - }, - { - "url": "https://opencollective.com/php_codesniffer", - "type": "open_collective" } ], - "time": "2024-04-24T21:37:59+00:00" + "time": "2024-08-06T10:04:20+00:00" }, { - "name": "phpstan/phpstan", - "version": "1.11.7", + "name": "friendsofphp/php-cs-fixer", + "version": "v3.64.0", "source": { "type": "git", - "url": "https://github.com/phpstan/phpstan.git", - "reference": "52d2bbfdcae7f895915629e4694e9497d0f8e28d" + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "58dd9c931c785a79739310aef5178928305ffa67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/52d2bbfdcae7f895915629e4694e9497d0f8e28d", - "reference": "52d2bbfdcae7f895915629e4694e9497d0f8e28d", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/58dd9c931c785a79739310aef5178928305ffa67", + "reference": "58dd9c931c785a79739310aef5178928305ffa67", "shasum": "" }, "require": { - "php": "^7.2|^8.0" + "clue/ndjson-react": "^1.0", + "composer/semver": "^3.4", + "composer/xdebug-handler": "^3.0.3", + "ext-filter": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "fidry/cpu-core-counter": "^1.0", + "php": "^7.4 || ^8.0", + "react/child-process": "^0.6.5", + "react/event-loop": "^1.0", + "react/promise": "^2.0 || ^3.0", + "react/socket": "^1.0", + "react/stream": "^1.0", + "sebastian/diff": "^4.0 || ^5.0 || ^6.0", + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", + "symfony/finder": "^5.4 || ^6.0 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0", + "symfony/polyfill-mbstring": "^1.28", + "symfony/polyfill-php80": "^1.28", + "symfony/polyfill-php81": "^1.28", + "symfony/process": "^5.4 || ^6.0 || ^7.0", + "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" }, - "conflict": { - "phpstan/phpstan-shim": "*" + "require-dev": { + "facile-it/paraunit": "^1.3 || ^2.3", + "infection/infection": "^0.29.5", + "justinrainbow/json-schema": "^5.2", + "keradus/cli-executor": "^2.1", + "mikey179/vfsstream": "^1.6.11", + "php-coveralls/php-coveralls": "^2.7", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5", + "phpunit/phpunit": "^9.6.19 || ^10.5.21 || ^11.2", + "symfony/var-dumper": "^5.4 || ^6.0 || ^7.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." }, "bin": [ - "phpstan", - "phpstan.phar" + "php-cs-fixer" ], - "type": "library", + "type": "application", "autoload": { - "files": [ - "bootstrap.php" + "psr-4": { + "PhpCsFixer\\": "src/" + }, + "exclude-from-classmap": [ + "src/Fixer/Internal/*" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "PHPStan - PHP Static Analysis Tool", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", "keywords": [ - "dev", + "Static code analysis", + "fixer", + "standards", "static analysis" ], "support": { - "docs": "https://phpstan.org/user-guide/getting-started", - "forum": "https://github.com/phpstan/phpstan/discussions", - "issues": "https://github.com/phpstan/phpstan/issues", - "security": "https://github.com/phpstan/phpstan/security/policy", - "source": "https://github.com/phpstan/phpstan-src" + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.64.0" }, "funding": [ { - "url": "https://github.com/ondrejmirtes", + "url": "https://github.com/keradus", "type": "github" + } + ], + "time": "2024-08-30T23:09:38+00:00" + }, + { + "name": "justinrainbow/json-schema", + "version": "5.3.0", + "source": { + "type": "git", + "url": "https://github.com/jsonrainbow/json-schema.git", + "reference": "feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8", + "reference": "feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", + "json-schema/json-schema-test-suite": "1.2.0", + "phpunit/phpunit": "^4.8.35" + }, + "bin": [ + "bin/validate-json" + ], + "type": "library", + "autoload": { + "psr-4": { + "JsonSchema\\": "src/JsonSchema/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" }, { - "url": "https://github.com/phpstan", - "type": "github" + "name": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, + { + "name": "Robert Schönthal", + "email": "seroscho@googlemail.com" } ], - "time": "2024-07-06T11:17:41+00:00" + "description": "A library to validate a json schema.", + "homepage": "https://github.com/justinrainbow/json-schema", + "keywords": [ + "json", + "schema" + ], + "support": { + "issues": "https://github.com/jsonrainbow/json-schema/issues", + "source": "https://github.com/jsonrainbow/json-schema/tree/5.3.0" + }, + "time": "2024-07-06T21:00:26+00:00" }, { - "name": "psr/container", - "version": "1.1.2", + "name": "league/container", + "version": "4.2.2", "source": { "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + "url": "https://github.com/thephpleague/container.git", + "reference": "ff346319ca1ff0e78277dc2311a42107cc1aab88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "url": "https://api.github.com/repos/thephpleague/container/zipball/ff346319ca1ff0e78277dc2311a42107cc1aab88", + "reference": "ff346319ca1ff0e78277dc2311a42107cc1aab88", "shasum": "" }, "require": { - "php": ">=7.4.0" + "php": "^7.2 || ^8.0", + "psr/container": "^1.1 || ^2.0" + }, + "provide": { + "psr/container-implementation": "^1.0" + }, + "replace": { + "orno/di": "~2.0" + }, + "require-dev": { + "nette/php-generator": "^3.4", + "nikic/php-parser": "^4.10", + "phpstan/phpstan": "^0.12.47", + "phpunit/phpunit": "^8.5.17", + "roave/security-advisories": "dev-latest", + "scrutinizer/ocular": "^1.8", + "squizlabs/php_codesniffer": "^3.6" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev", + "dev-4.x": "4.x-dev", + "dev-3.x": "3.x-dev", + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, "autoload": { "psr-4": { - "Psr\\Container\\": "src/" + "League\\Container\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -778,216 +1004,2423 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Phil Bennett", + "email": "mail@philbennett.co.uk", + "role": "Developer" } ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", + "description": "A fast and intuitive dependency injection container.", + "homepage": "https://github.com/thephpleague/container", "keywords": [ - "PSR-11", "container", - "container-interface", - "container-interop", - "psr" + "dependency", + "di", + "injection", + "league", + "provider", + "service" ], "support": { - "issues": "https://github.com/php-fig/container/issues", + "issues": "https://github.com/thephpleague/container/issues", + "source": "https://github.com/thephpleague/container/tree/4.2.2" + }, + "funding": [ + { + "url": "https://github.com/philipobenito", + "type": "github" + } + ], + "time": "2024-03-13T13:12:53+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.19.1", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4e1b88d21c69391150ace211e9eaf05810858d0b", + "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.1" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.1" + }, + "time": "2024-03-17T08:10:35+00:00" + }, + { + "name": "nunomaduro/phpinsights", + "version": "v2.11.0", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/phpinsights.git", + "reference": "f476219759a61aad988641476259465c77203383" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/phpinsights/zipball/f476219759a61aad988641476259465c77203383", + "reference": "f476219759a61aad988641476259465c77203383", + "shasum": "" + }, + "require": { + "cmgmyr/phploc": "^8.0.3", + "composer/semver": "^3.4", + "ext-iconv": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-tokenizer": "*", + "friendsofphp/php-cs-fixer": "^3.40.0", + "justinrainbow/json-schema": "^5.2.13", + "league/container": "^3.2|^4.2", + "php": "^7.4|^8.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "psr/container": "^1.0|^2.0.2", + "psr/simple-cache": "^1.0|^2.0|^3.0", + "sebastian/diff": "^4.0|^5.0.3", + "slevomat/coding-standard": "^8.14.1", + "squizlabs/php_codesniffer": "^3.7.2", + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/console": "^5.4|^6.4|^7.0", + "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.4|^7.0" + }, + "require-dev": { + "ergebnis/phpstan-rules": "^0.15.3", + "illuminate/console": "^5.8|^6.0|^7.0|^8.0|^9.20|^10.0", + "illuminate/support": "^5.8|^6.0|^7.0|^8.0|^9.52.16|^10.0", + "mockery/mockery": "^1.6.6", + "phpstan/phpstan-strict-rules": "^0.12.11", + "phpunit/phpunit": "^8.0|^9.0|^10.4.2", + "rector/rector": "0.11.56", + "symfony/var-dumper": "^5.4|^6.0|^7.0", + "thecodingmachine/phpstan-strict-rules": "^0.12.2" + }, + "suggest": { + "ext-simplexml": "It is needed for the checkstyle formatter" + }, + "bin": [ + "bin/phpinsights" + ], + "type": "library", + "extra": { + "laravel": { + "providers": [ + "NunoMaduro\\PhpInsights\\Application\\Adapters\\Laravel\\InsightsServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "NunoMaduro\\PhpInsights\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Instant PHP quality checks from your console.", + "keywords": [ + "Insights", + "code", + "console", + "php", + "quality", + "source" + ], + "support": { + "issues": "https://github.com/nunomaduro/phpinsights/issues", + "source": "https://github.com/nunomaduro/phpinsights/tree/v2.11.0" + }, + "funding": [ + { + "url": "https://github.com/JustSteveKing", + "type": "github" + }, + { + "url": "https://github.com/cmgmyr", + "type": "github" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + } + ], + "time": "2023-11-30T10:54:50+00:00" + }, + { + "name": "php-parallel-lint/php-parallel-lint", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", + "reference": "6db563514f27e19595a19f45a4bf757b6401194e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/6db563514f27e19595a19f45a4bf757b6401194e", + "reference": "6db563514f27e19595a19f45a4bf757b6401194e", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.3.0" + }, + "replace": { + "grogy/php-parallel-lint": "*", + "jakub-onderka/php-parallel-lint": "*" + }, + "require-dev": { + "nette/tester": "^1.3 || ^2.0", + "php-parallel-lint/php-console-highlighter": "0.* || ^1.0", + "squizlabs/php_codesniffer": "^3.6" + }, + "suggest": { + "php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet" + }, + "bin": [ + "parallel-lint" + ], + "type": "library", + "autoload": { + "classmap": [ + "./src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "ahoj@jakubonderka.cz" + } + ], + "description": "This tool checks the syntax of PHP files about 20x faster than serial check.", + "homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint", + "keywords": [ + "lint", + "static analysis" + ], + "support": { + "issues": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/issues", + "source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v1.4.0" + }, + "time": "2024-03-27T12:14:49+00:00" + }, + { + "name": "php-stubs/generator", + "version": "v0.8.4", + "source": { + "type": "git", + "url": "https://github.com/php-stubs/generator.git", + "reference": "bf758105124218225d59e698913ac852ee7d79c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-stubs/generator/zipball/bf758105124218225d59e698913ac852ee7d79c7", + "reference": "bf758105124218225d59e698913ac852ee7d79c7", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.10", + "php": "^7.3 || ^8.0", + "symfony/console": "^5.1 || ^6.0", + "symfony/filesystem": "^5.0 || ^6.0", + "symfony/finder": "^5.0 || ^6.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.16 || ^3.12", + "phpunit/phpunit": "^9.4", + "vimeo/psalm": "^4.1" + }, + "bin": [ + "bin/generate-stubs" + ], + "type": "library", + "autoload": { + "psr-4": { + "StubsGenerator\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Giaco Corsiglia", + "email": "GiacoCorsiglia@gmail.com" + } + ], + "description": "Generate stubs from any PHP code for IDE completion and static analysis.", + "homepage": "https://github.com/php-stubs/generator", + "keywords": [ + "ide", + "static analysis" + ], + "support": { + "issues": "https://github.com/php-stubs/generator/issues", + "source": "https://github.com/php-stubs/generator/tree/v0.8.4" + }, + "time": "2023-07-24T16:33:51+00:00" + }, + { + "name": "php-stubs/wordpress-stubs", + "version": "v6.5.3", + "source": { + "type": "git", + "url": "https://github.com/php-stubs/wordpress-stubs.git", + "reference": "e611a83292d02055a25f83291a98fadd0c21e092" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/e611a83292d02055a25f83291a98fadd0c21e092", + "reference": "e611a83292d02055a25f83291a98fadd0c21e092", + "shasum": "" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "nikic/php-parser": "^4.13", + "php": "^7.4 || ~8.0.0", + "php-stubs/generator": "^0.8.3", + "phpdocumentor/reflection-docblock": "5.3", + "phpstan/phpstan": "^1.10.49", + "phpunit/phpunit": "^9.5", + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.11" + }, + "suggest": { + "paragonie/sodium_compat": "Pure PHP implementation of libsodium", + "symfony/polyfill-php80": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WordPress function and class declaration stubs for static analysis.", + "homepage": "https://github.com/php-stubs/wordpress-stubs", + "keywords": [ + "PHPStan", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/php-stubs/wordpress-stubs/issues", + "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.5.3" + }, + "time": "2024-05-08T02:12:31+00:00" + }, + { + "name": "phpcompatibility/php-compatibility", + "version": "9.3.5", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" + }, + "conflict": { + "squizlabs/php_codesniffer": "2.6.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "homepage": "https://github.com/wimg", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" + } + ], + "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", + "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "keywords": [ + "compatibility", + "phpcs", + "standards" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibility" + }, + "time": "2019-12-27T09:44:58+00:00" + }, + { + "name": "phpcompatibility/phpcompatibility-paragonie", + "version": "1.3.3", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", + "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/293975b465e0e709b571cbf0c957c6c0a7b9a2ac", + "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^9.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "paragonie/random_compat": "dev-master", + "paragonie/sodium_compat": "dev-master" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "lead" + } + ], + "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", + "homepage": "http://phpcompatibility.com/", + "keywords": [ + "compatibility", + "paragonie", + "phpcs", + "polyfill", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/security/policy", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" + }, + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-04-24T21:30:46+00:00" + }, + { + "name": "phpcompatibility/phpcompatibility-wp", + "version": "2.1.5", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", + "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/01c1ff2704a58e46f0cb1ca9d06aee07b3589082", + "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^9.0", + "phpcompatibility/phpcompatibility-paragonie": "^1.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "lead" + } + ], + "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", + "homepage": "http://phpcompatibility.com/", + "keywords": [ + "compatibility", + "phpcs", + "standards", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityWP/security/policy", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" + }, + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-04-24T21:37:59+00:00" + }, + { + "name": "phpstan/phpdoc-parser", + "version": "1.32.0", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "6ca22b154efdd9e3c68c56f5d94670920a1c19a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/6ca22b154efdd9e3c68c56f5d94670920a1c19a4", + "reference": "6ca22b154efdd9e3c68c56f5d94670920a1c19a4", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/annotations": "^2.0", + "nikic/php-parser": "^4.15", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "symfony/process": "^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.32.0" + }, + "time": "2024-09-26T07:23:32+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "1.11.7", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "52d2bbfdcae7f895915629e4694e9497d0f8e28d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/52d2bbfdcae7f895915629e4694e9497d0f8e28d", + "reference": "52d2bbfdcae7f895915629e4694e9497d0f8e28d", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + } + ], + "time": "2024-07-06T11:17:41+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-02T12:48:52+00:00" + }, + { + "name": "psr/cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/3.0.0" + }, + "time": "2021-02-03T23:26:27+00:00" + }, + { + "name": "psr/container", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", "source": "https://github.com/php-fig/container/tree/1.1.2" }, - "time": "2021-11-05T16:50:12+00:00" + "time": "2021-11-05T16:50:12+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/log", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/ef29f6d262798707a9edd554e2b82517ef3a9376", + "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/2.0.0" + }, + "time": "2021-07-14T16:41:46+00:00" + }, + { + "name": "psr/simple-cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" + }, + "time": "2021-10-29T13:26:27+00:00" + }, + { + "name": "react/cache", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/cache.git", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/promise": "^3.0 || ^2.0 || ^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, Promise-based cache interface for ReactPHP", + "keywords": [ + "cache", + "caching", + "promise", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/cache/issues", + "source": "https://github.com/reactphp/cache/tree/v1.2.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2022-11-30T15:59:55+00:00" + }, + { + "name": "react/child-process", + "version": "v0.6.5", + "source": { + "type": "git", + "url": "https://github.com/reactphp/child-process.git", + "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/child-process/zipball/e71eb1aa55f057c7a4a0d08d06b0b0a484bead43", + "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/event-loop": "^1.2", + "react/stream": "^1.2" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", + "react/socket": "^1.8", + "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\ChildProcess\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven library for executing child processes with ReactPHP.", + "keywords": [ + "event-driven", + "process", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/child-process/issues", + "source": "https://github.com/reactphp/child-process/tree/v0.6.5" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-09-16T13:41:56+00:00" + }, + { + "name": "react/dns", + "version": "v1.13.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/dns.git", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/dns/zipball/eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/cache": "^1.0 || ^0.6 || ^0.5", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.7 || ^1.2.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3 || ^2", + "react/promise-timer": "^1.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Dns\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async DNS resolver for ReactPHP", + "keywords": [ + "async", + "dns", + "dns-resolver", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/dns/issues", + "source": "https://github.com/reactphp/dns/tree/v1.13.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-06-13T14:18:03+00:00" + }, + { + "name": "react/event-loop", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/event-loop.git", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "suggest": { + "ext-pcntl": "For signal handling support when using the StreamSelectLoop" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\EventLoop\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "keywords": [ + "asynchronous", + "event-loop" + ], + "support": { + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.5.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2023-11-13T13:48:05+00:00" + }, + { + "name": "react/promise", + "version": "v3.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63", + "shasum": "" + }, + "require": { + "php": ">=7.1.0" + }, + "require-dev": { + "phpstan/phpstan": "1.10.39 || 1.4.10", + "phpunit/phpunit": "^9.6 || ^7.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v3.2.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-05-24T10:39:05+00:00" + }, + { + "name": "react/socket", + "version": "v1.16.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/socket.git", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/dns": "^1.13", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3.3 || ^2", + "react/promise-stream": "^1.4", + "react/promise-timer": "^1.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Socket\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", + "keywords": [ + "Connection", + "Socket", + "async", + "reactphp", + "stream" + ], + "support": { + "issues": "https://github.com/reactphp/socket/issues", + "source": "https://github.com/reactphp/socket/tree/v1.16.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-07-26T10:38:09+00:00" + }, + { + "name": "react/stream", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/stream.git", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.2" + }, + "require-dev": { + "clue/stream-filter": "~1.2", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Stream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", + "keywords": [ + "event-driven", + "io", + "non-blocking", + "pipe", + "reactphp", + "readable", + "stream", + "writable" + ], + "support": { + "issues": "https://github.com/reactphp/stream/issues", + "source": "https://github.com/reactphp/stream/tree/v1.4.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-06-11T12:45:25+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:27:43+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:30:58+00:00" + }, + { + "name": "sirbrillig/phpcs-variable-analysis", + "version": "v2.11.19", + "source": { + "type": "git", + "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", + "reference": "bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1", + "reference": "bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "squizlabs/php_codesniffer": "^3.5.6" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.0", + "phpcsstandards/phpcsdevcs": "^1.1", + "phpstan/phpstan": "^1.7", + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0", + "sirbrillig/phpcs-import-detection": "^1.1", + "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0@beta" + }, + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "VariableAnalysis\\": "VariableAnalysis/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Sam Graham", + "email": "php-codesniffer-variableanalysis@illusori.co.uk" + }, + { + "name": "Payton Swick", + "email": "payton@foolord.com" + } + ], + "description": "A PHPCS sniff to detect problems with variables.", + "keywords": [ + "phpcs", + "static analysis" + ], + "support": { + "issues": "https://github.com/sirbrillig/phpcs-variable-analysis/issues", + "source": "https://github.com/sirbrillig/phpcs-variable-analysis", + "wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki" + }, + "time": "2024-06-26T20:08:34+00:00" + }, + { + "name": "slevomat/coding-standard", + "version": "8.15.0", + "source": { + "type": "git", + "url": "https://github.com/slevomat/coding-standard.git", + "reference": "7d1d957421618a3803b593ec31ace470177d7817" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/7d1d957421618a3803b593ec31ace470177d7817", + "reference": "7d1d957421618a3803b593ec31ace470177d7817", + "shasum": "" + }, + "require": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", + "php": "^7.2 || ^8.0", + "phpstan/phpdoc-parser": "^1.23.1", + "squizlabs/php_codesniffer": "^3.9.0" + }, + "require-dev": { + "phing/phing": "2.17.4", + "php-parallel-lint/php-parallel-lint": "1.3.2", + "phpstan/phpstan": "1.10.60", + "phpstan/phpstan-deprecation-rules": "1.1.4", + "phpstan/phpstan-phpunit": "1.3.16", + "phpstan/phpstan-strict-rules": "1.5.2", + "phpunit/phpunit": "8.5.21|9.6.8|10.5.11" + }, + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "SlevomatCodingStandard\\": "SlevomatCodingStandard/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", + "keywords": [ + "dev", + "phpcs" + ], + "support": { + "issues": "https://github.com/slevomat/coding-standard/issues", + "source": "https://github.com/slevomat/coding-standard/tree/8.15.0" + }, + "funding": [ + { + "url": "https://github.com/kukulich", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard", + "type": "tidelift" + } + ], + "time": "2024-03-09T15:20:58+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.10.1", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/8f90f7a53ce271935282967f53d0894f8f1ff877", + "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" + }, + "bin": [ + "bin/phpcbf", + "bin/phpcs" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" + }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-05-22T21:24:41+00:00" + }, + { + "name": "symfony/cache", + "version": "v6.0.19", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache.git", + "reference": "81ca309f056e836480928b20280ec52ce8369bb3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache/zipball/81ca309f056e836480928b20280ec52ce8369bb3", + "reference": "81ca309f056e836480928b20280ec52ce8369bb3", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "psr/cache": "^2.0|^3.0", + "psr/log": "^1.1|^2|^3", + "symfony/cache-contracts": "^1.1.7|^2|^3", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/var-exporter": "^5.4|^6.0" + }, + "conflict": { + "doctrine/dbal": "<2.13.1", + "symfony/dependency-injection": "<5.4", + "symfony/http-kernel": "<5.4", + "symfony/var-dumper": "<5.4" + }, + "provide": { + "psr/cache-implementation": "2.0|3.0", + "psr/simple-cache-implementation": "1.0|2.0|3.0", + "symfony/cache-implementation": "1.1|2.0|3.0" + }, + "require-dev": { + "cache/integration-tests": "dev-master", + "doctrine/dbal": "^2.13.1|^3.0", + "predis/predis": "^1.1", + "psr/simple-cache": "^1.0|^2.0|^3.0", + "symfony/config": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/filesystem": "^5.4|^6.0", + "symfony/http-kernel": "^5.4|^6.0", + "symfony/messenger": "^5.4|^6.0", + "symfony/var-dumper": "^5.4|^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Cache\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides extended PSR-6, PSR-16 (and tags) implementations", + "homepage": "https://symfony.com", + "keywords": [ + "caching", + "psr6" + ], + "support": { + "source": "https://github.com/symfony/cache/tree/v6.0.19" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-20T17:44:14+00:00" + }, + { + "name": "symfony/cache-contracts", + "version": "v3.0.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache-contracts.git", + "reference": "1c0a181c9ee221afe4fa55b2d13fc63c5ae14348" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/1c0a181c9ee221afe4fa55b2d13fc63c5ae14348", + "reference": "1c0a181c9ee221afe4fa55b2d13fc63c5ae14348", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "psr/cache": "^3.0" + }, + "suggest": { + "symfony/cache-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Cache\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to caching", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/cache-contracts/tree/v3.0.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:55:41+00:00" + }, + { + "name": "symfony/console", + "version": "v5.4.41", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "6473d441a913cb997123b59ff2dbe3d1cf9e11ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/6473d441a913cb997123b59ff2dbe3d1cf9e11ba", + "reference": "6473d441a913cb997123b59ff2dbe3d1cf9e11ba", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.1|^6.0" + }, + "conflict": { + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" + }, + "require-dev": { + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v5.4.41" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-06-28T07:48:55+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.5.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "80d075412b557d41002320b96a096ca65aa2c98d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/80d075412b557d41002320b96a096ca65aa2c98d", + "reference": "80d075412b557d41002320b96a096ca65aa2c98d", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-24T14:02:46+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v6.0.19", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "2eaf8e63bc5b8cefabd4a800157f0d0c094f677a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2eaf8e63bc5b8cefabd4a800157f0d0c094f677a", + "reference": "2eaf8e63bc5b8cefabd4a800157f0d0c094f677a", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "symfony/event-dispatcher-contracts": "^2|^3" + }, + "conflict": { + "symfony/dependency-injection": "<5.4" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/error-handler": "^5.4|^6.0", + "symfony/expression-language": "^5.4|^6.0", + "symfony/http-foundation": "^5.4|^6.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/stopwatch": "^5.4|^6.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v6.0.19" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-01T08:36:10+00:00" }, { - "name": "sirbrillig/phpcs-variable-analysis", - "version": "v2.11.19", + "name": "symfony/event-dispatcher-contracts", + "version": "v3.0.2", "source": { "type": "git", - "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", - "reference": "bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1" + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "7bc61cc2db649b4637d331240c5346dcc7708051" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1", - "reference": "bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7bc61cc2db649b4637d331240c5346dcc7708051", + "reference": "7bc61cc2db649b4637d331240c5346dcc7708051", "shasum": "" }, "require": { - "php": ">=5.4.0", - "squizlabs/php_codesniffer": "^3.5.6" + "php": ">=8.0.2", + "psr/event-dispatcher": "^1" }, - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.0", - "phpcsstandards/phpcsdevcs": "^1.1", - "phpstan/phpstan": "^1.7", - "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0", - "sirbrillig/phpcs-import-detection": "^1.1", - "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0@beta" + "suggest": { + "symfony/event-dispatcher-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } }, - "type": "phpcodesniffer-standard", "autoload": { "psr-4": { - "VariableAnalysis\\": "VariableAnalysis/" + "Symfony\\Contracts\\EventDispatcher\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-2-Clause" + "MIT" ], "authors": [ { - "name": "Sam Graham", - "email": "php-codesniffer-variableanalysis@illusori.co.uk" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Payton Swick", - "email": "payton@foolord.com" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "A PHPCS sniff to detect problems with variables.", + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", "keywords": [ - "phpcs", - "static analysis" + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" ], "support": { - "issues": "https://github.com/sirbrillig/phpcs-variable-analysis/issues", - "source": "https://github.com/sirbrillig/phpcs-variable-analysis", - "wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.0.2" }, - "time": "2024-06-26T20:08:34+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:55:41+00:00" }, { - "name": "squizlabs/php_codesniffer", - "version": "3.10.1", + "name": "symfony/filesystem", + "version": "v5.4.41", "source": { "type": "git", - "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877" + "url": "https://github.com/symfony/filesystem.git", + "reference": "6d29dd9340b372fa603f04e6df4dd76bb808591e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/8f90f7a53ce271935282967f53d0894f8f1ff877", - "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/6d29dd9340b372fa603f04e6df4dd76bb808591e", + "reference": "6d29dd9340b372fa603f04e6df4dd76bb808591e", "shasum": "" }, "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8", + "symfony/polyfill-php80": "^1.16" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" + "symfony/process": "^5.4|^6.4" }, - "bin": [ - "bin/phpcbf", - "bin/phpcs" - ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Greg Sherwood", - "role": "Former lead" - }, - { - "name": "Juliette Reinders Folmer", - "role": "Current lead" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { - "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", - "keywords": [ - "phpcs", - "standards", - "static analysis" - ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", - "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", - "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", - "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" + "source": "https://github.com/symfony/filesystem/tree/v5.4.41" }, "funding": [ { - "url": "https://github.com/PHPCSStandards", - "type": "github" + "url": "https://symfony.com/sponsor", + "type": "custom" }, { - "url": "https://github.com/jrfnl", + "url": "https://github.com/fabpot", "type": "github" }, { - "url": "https://opencollective.com/php_codesniffer", - "type": "open_collective" + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2024-05-22T21:24:41+00:00" + "time": "2024-06-28T09:36:24+00:00" }, { - "name": "symfony/console", - "version": "v5.4.41", + "name": "symfony/finder", + "version": "v5.4.40", "source": { "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "6473d441a913cb997123b59ff2dbe3d1cf9e11ba" + "url": "https://github.com/symfony/finder.git", + "reference": "f51cff4687547641c7d8180d74932ab40b2205ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/6473d441a913cb997123b59ff2dbe3d1cf9e11ba", - "reference": "6473d441a913cb997123b59ff2dbe3d1cf9e11ba", + "url": "https://api.github.com/repos/symfony/finder/zipball/f51cff4687547641c7d8180d74932ab40b2205ce", + "reference": "f51cff4687547641c7d8180d74932ab40b2205ce", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.1|^6.0" - }, - "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" - }, - "provide": { - "psr/log-implementation": "1.0|2.0" - }, - "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/lock": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\Console\\": "" + "Symfony\\Component\\Finder\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -1007,16 +3440,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Eases the creation of beautiful and testable command line interfaces", + "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", - "keywords": [ - "cli", - "command-line", - "console", - "terminal" - ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.41" + "source": "https://github.com/symfony/finder/tree/v5.4.40" }, "funding": [ { @@ -1032,38 +3459,55 @@ "type": "tidelift" } ], - "time": "2024-06-28T07:48:55+00:00" + "time": "2024-05-31T14:33:22+00:00" }, { - "name": "symfony/deprecation-contracts", - "version": "v2.5.3", + "name": "symfony/http-client", + "version": "v6.0.20", "source": { "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "80d075412b557d41002320b96a096ca65aa2c98d" + "url": "https://github.com/symfony/http-client.git", + "reference": "541c04560da1875f62c963c3aab6ea12a7314e11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/80d075412b557d41002320b96a096ca65aa2c98d", - "reference": "80d075412b557d41002320b96a096ca65aa2c98d", + "url": "https://api.github.com/repos/symfony/http-client/zipball/541c04560da1875f62c963c3aab6ea12a7314e11", + "reference": "541c04560da1875f62c963c3aab6ea12a7314e11", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.0.2", + "psr/log": "^1|^2|^3", + "symfony/http-client-contracts": "^3", + "symfony/service-contracts": "^1.0|^2|^3" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } + "provide": { + "php-http/async-client-implementation": "*", + "php-http/client-implementation": "*", + "psr/http-client-implementation": "1.0", + "symfony/http-client-implementation": "3.0" + }, + "require-dev": { + "amphp/amp": "^2.5", + "amphp/http-client": "^4.2.1", + "amphp/http-tunnel": "^1.0", + "amphp/socket": "^1.1", + "guzzlehttp/promises": "^1.4", + "nyholm/psr7": "^1.0", + "php-http/httplug": "^1.0|^2.0", + "psr/http-client": "^1.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/http-kernel": "^5.4|^6.0", + "symfony/process": "^5.4|^6.0", + "symfony/stopwatch": "^5.4|^6.0" }, + "type": "library", "autoload": { - "files": [ - "function.php" + "psr-4": { + "Symfony\\Component\\HttpClient\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1080,10 +3524,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "A generic function and convention to trigger deprecation notices", + "description": "Provides powerful methods to fetch HTTP resources synchronously or asynchronously", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.3" + "source": "https://github.com/symfony/http-client/tree/v6.0.20" }, "funding": [ { @@ -1099,39 +3543,42 @@ "type": "tidelift" } ], - "time": "2023-01-24T14:02:46+00:00" + "time": "2023-01-30T15:41:07+00:00" }, { - "name": "symfony/filesystem", - "version": "v5.4.41", + "name": "symfony/http-client-contracts", + "version": "v3.0.2", "source": { "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "6d29dd9340b372fa603f04e6df4dd76bb808591e" + "url": "https://github.com/symfony/http-client-contracts.git", + "reference": "4184b9b63af1edaf35b6a7974c6f1f9f33294129" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/6d29dd9340b372fa603f04e6df4dd76bb808591e", - "reference": "6d29dd9340b372fa603f04e6df4dd76bb808591e", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/4184b9b63af1edaf35b6a7974c6f1f9f33294129", + "reference": "4184b9b63af1edaf35b6a7974c6f1f9f33294129", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.0.2" }, - "require-dev": { - "symfony/process": "^5.4|^6.4" + "suggest": { + "symfony/http-client-implementation": "" }, "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" }, - "exclude-from-classmap": [ - "/Tests/" - ] + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\HttpClient\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1139,18 +3586,26 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Provides basic utilities for the filesystem", + "description": "Generic abstractions related to HTTP clients", "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.41" + "source": "https://github.com/symfony/http-client-contracts/tree/v3.0.2" }, "funding": [ { @@ -1166,31 +3621,30 @@ "type": "tidelift" } ], - "time": "2024-06-28T09:36:24+00:00" + "time": "2022-04-12T16:11:42+00:00" }, { - "name": "symfony/finder", - "version": "v5.4.40", + "name": "symfony/options-resolver", + "version": "v6.0.19", "source": { "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "f51cff4687547641c7d8180d74932ab40b2205ce" + "url": "https://github.com/symfony/options-resolver.git", + "reference": "6a180d1c45e0d9797470ca9eb46215692de00fa3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/f51cff4687547641c7d8180d74932ab40b2205ce", - "reference": "f51cff4687547641c7d8180d74932ab40b2205ce", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/6a180d1c45e0d9797470ca9eb46215692de00fa3", + "reference": "6a180d1c45e0d9797470ca9eb46215692de00fa3", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.0.2", + "symfony/deprecation-contracts": "^2.1|^3" }, "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\Finder\\": "" + "Symfony\\Component\\OptionsResolver\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -1210,10 +3664,15 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Finds files and directories via an intuitive fluent interface", + "description": "Provides an improved replacement for the array_replace PHP function", "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.40" + "source": "https://github.com/symfony/options-resolver/tree/v6.0.19" }, "funding": [ { @@ -1229,7 +3688,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2023-01-01T08:36:10+00:00" }, { "name": "symfony/polyfill-ctype", @@ -1705,6 +4164,144 @@ ], "time": "2024-05-31T15:07:36+00:00" }, + { + "name": "symfony/polyfill-php81", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/process", + "version": "v5.4.44", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "1b9fa82b5c62cd49da8c9e3952dd8531ada65096" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/1b9fa82b5c62cd49da8c9e3952dd8531ada65096", + "reference": "1b9fa82b5c62cd49da8c9e3952dd8531ada65096", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v5.4.44" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-17T12:46:43+00:00" + }, { "name": "symfony/service-contracts", "version": "v2.5.3", @@ -1788,6 +4385,68 @@ ], "time": "2023-04-21T15:04:16+00:00" }, + { + "name": "symfony/stopwatch", + "version": "v6.0.19", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "011e781839dd1d2eb8119f65ac516a530f60226d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/011e781839dd1d2eb8119f65ac516a530f60226d", + "reference": "011e781839dd1d2eb8119f65ac516a530f60226d", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "symfony/service-contracts": "^1|^2|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v6.0.19" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-01T08:36:10+00:00" + }, { "name": "symfony/string", "version": "v5.4.41", @@ -1874,6 +4533,78 @@ ], "time": "2024-06-28T09:20:55+00:00" }, + { + "name": "symfony/var-exporter", + "version": "v6.0.19", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-exporter.git", + "reference": "df56f53818c2d5d9f683f4ad2e365ba73a3b69d2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/df56f53818c2d5d9f683f4ad2e365ba73a3b69d2", + "reference": "df56f53818c2d5d9f683f4ad2e365ba73a3b69d2", + "shasum": "" + }, + "require": { + "php": ">=8.0.2" + }, + "require-dev": { + "symfony/var-dumper": "^5.4|^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\VarExporter\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Allows exporting any serializable PHP data structure to plain PHP code", + "homepage": "https://symfony.com", + "keywords": [ + "clone", + "construct", + "export", + "hydrate", + "instantiate", + "serialize" + ], + "support": { + "source": "https://github.com/symfony/var-exporter/tree/v6.0.19" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-13T08:34:10+00:00" + }, { "name": "szepeviktor/phpstan-wordpress", "version": "v1.3.4", @@ -1995,5 +4726,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/header-footer-elementor.php b/header-footer-elementor.php index b3ce9087a..68b560aa9 100644 --- a/header-footer-elementor.php +++ b/header-footer-elementor.php @@ -1,4 +1,7 @@ template = get_template(); - - $is_elementor_callable = ( defined( 'ELEMENTOR_VERSION' ) && is_callable( 'Elementor\Plugin::instance' ) ) ? true : false; - - $required_elementor_version = '3.5.0'; - - $is_elementor_outdated = ( $is_elementor_callable && ( ! version_compare( ELEMENTOR_VERSION, $required_elementor_version, '>=' ) ) ) ? true : false; - - if ( ( ! $is_elementor_callable ) || $is_elementor_outdated ) { - $this->elementor_not_available( $is_elementor_callable, $is_elementor_outdated ); - } - - if ( $is_elementor_callable ) { - self::$elementor_instance = Elementor\Plugin::instance(); - - $this->includes(); - $this->load_textdomain(); - - add_action( 'init', [ $this, 'setup_settings_page' ] ); - - if ( 'genesis' == $this->template ) { - require HFE_DIR . 'themes/genesis/class-hfe-genesis-compat.php'; - } elseif ( 'astra' == $this->template ) { - require HFE_DIR . 'themes/astra/class-hfe-astra-compat.php'; - } elseif ( 'bb-theme' == $this->template || 'beaver-builder-theme' == $this->template ) { - $this->template = 'beaver-builder-theme'; - require HFE_DIR . 'themes/bb-theme/class-hfe-bb-theme-compat.php'; - } elseif ( 'generatepress' == $this->template ) { - require HFE_DIR . 'themes/generatepress/class-hfe-generatepress-compat.php'; - } elseif ( 'oceanwp' == $this->template ) { - require HFE_DIR . 'themes/oceanwp/class-hfe-oceanwp-compat.php'; - } elseif ( 'storefront' == $this->template ) { - require HFE_DIR . 'themes/storefront/class-hfe-storefront-compat.php'; - } elseif ( 'hello-elementor' == $this->template ) { - require HFE_DIR . 'themes/hello-elementor/class-hfe-hello-elementor-compat.php'; - } else { - add_filter( 'hfe_settings_tabs', [ $this, 'setup_unsupported_theme' ] ); - add_action( 'init', [ $this, 'setup_fallback_support' ] ); - } - - if ( 'yes' === get_option( 'hfe_plugin_is_activated' ) ) { - add_action( 'admin_init', [ $this, 'show_setup_wizard' ] ); - } - - // Scripts and styles. - add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_scripts' ] ); - - add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_admin_scripts' ] ); - - add_filter( 'body_class', [ $this, 'body_class' ] ); - add_action( 'switch_theme', [ $this, 'reset_unsupported_theme_notice' ] ); - - add_shortcode( 'hfe_template', [ $this, 'render_template' ] ); - - add_action( 'astra_notice_before_markup_header-footer-elementor-rating', [ $this, 'rating_notice_css' ] ); - add_action( 'admin_init', [ $this, 'register_notices' ] ); - - // BSF Analytics Tracker. - if ( ! class_exists( 'BSF_Analytics_Loader' ) ) { - require_once HFE_DIR . 'admin/bsf-analytics/class-bsf-analytics-loader.php'; - } - - $bsf_analytics = BSF_Analytics_Loader::get_instance(); - - $bsf_analytics->set_entity( - [ - 'bsf' => [ - 'product_name' => 'Elementor Header & Footer builder', - 'path' => HFE_DIR . 'admin/bsf-analytics', - 'author' => 'Brainstorm Force', - 'time_to_display' => '+24 hours', - ], - ] - ); - - } - } - - /** - * Reset the Unsupported theme nnotice after a theme is switched. - * - * @since 1.0.16 - * - * @return void - */ - public function reset_unsupported_theme_notice() { - delete_user_meta( get_current_user_id(), 'unsupported-theme' ); - } - - /** - * Register Astra Notices. - * - * @since 1.2.0 - * - * @return void - */ - public function register_notices() { - $image_path = HFE_URL . 'assets/images/header-footer-elementor-icon.svg'; - - Astra_Notices::add_notice( - [ - 'id' => 'header-footer-elementor-rating', - 'type' => '', - 'message' => sprintf( - '
+class Header_Footer_Elementor +{ + /** + * Current theme template + */ + public string $template; + + /** + * Instance of Elemenntor Frontend class. + * + * @var object \Elementor\Frontend() + */ + private static object $elementor_instance; + + /** + * Instance of HFE_Admin + */ + private static Header_Footer_Elementor $_instance = null; + /** + * Constructor + */ + public function __construct() + { + $this->template = get_template(); + + $is_elementor_callable = defined('ELEMENTOR_VERSION') && is_callable('Elementor\Plugin::instance') ? true : false; + + $required_elementor_version = '3.5.0'; + + $is_elementor_outdated = $is_elementor_callable && (! version_compare(ELEMENTOR_VERSION, $required_elementor_version, '>=')) ? true : false; + + if (! $is_elementor_callable || $is_elementor_outdated) { + $this->elementor_not_available($is_elementor_callable, $is_elementor_outdated); + } + + if ($is_elementor_callable) { + self::$elementor_instance = Elementor\Plugin::instance(); + + $this->includes(); + $this->load_textdomain(); + + add_action('init', [ $this, 'setup_settings_page' ]); + + if ($this->template === 'genesis') { + require HFE_DIR . 'themes/genesis/class-hfe-genesis-compat.php'; + } elseif ($this->template === 'astra') { + require HFE_DIR . 'themes/astra/class-hfe-astra-compat.php'; + } elseif ($this->template === 'bb-theme' || $this->template === 'beaver-builder-theme') { + $this->template = 'beaver-builder-theme'; + require HFE_DIR . 'themes/bb-theme/class-hfe-bb-theme-compat.php'; + } elseif ($this->template === 'generatepress') { + require HFE_DIR . 'themes/generatepress/class-hfe-generatepress-compat.php'; + } elseif ($this->template === 'oceanwp') { + require HFE_DIR . 'themes/oceanwp/class-hfe-oceanwp-compat.php'; + } elseif ($this->template === 'storefront') { + require HFE_DIR . 'themes/storefront/class-hfe-storefront-compat.php'; + } elseif ($this->template === 'hello-elementor') { + require HFE_DIR . 'themes/hello-elementor/class-hfe-hello-elementor-compat.php'; + } else { + add_filter('hfe_settings_tabs', [ $this, 'setup_unsupported_theme' ]); + add_action('init', [ $this, 'setup_fallback_support' ]); + } + + if (get_option('hfe_plugin_is_activated') === 'yes') { + add_action('admin_init', [ $this, 'show_setup_wizard' ]); + } + + // Scripts and styles. + add_action('wp_enqueue_scripts', [ $this, 'enqueue_scripts' ]); + + add_action('admin_enqueue_scripts', [ $this, 'enqueue_admin_scripts' ]); + + add_filter('body_class', [ $this, 'body_class' ]); + add_action('switch_theme', [ $this, 'reset_unsupported_theme_notice' ]); + + add_shortcode('hfe_template', [ $this, 'render_template' ]); + + add_action('astra_notice_before_markup_header-footer-elementor-rating', [ $this, 'rating_notice_css' ]); + add_action('admin_init', [ $this, 'register_notices' ]); + + // BSF Analytics Tracker. + if (! class_exists('BSF_Analytics_Loader')) { + require_once HFE_DIR . 'admin/bsf-analytics/class-bsf-analytics-loader.php'; + } + + $bsf_analytics = BSF_Analytics_Loader::get_instance(); + + $bsf_analytics->set_entity( + [ + 'bsf' => [ + 'product_name' => 'Elementor Header & Footer builder', + 'path' => HFE_DIR . 'admin/bsf-analytics', + 'author' => 'Brainstorm Force', + 'time_to_display' => '+24 hours', + ], + ] + ); + } + } + + /** + * Instance of Header_Footer_Elementor + * + * @return Header_Footer_Elementor Instance of Header_Footer_Elementor + */ + public static function instance(): Header_Footer_Elementor + { + if (! isset(self::$_instance)) { + self::$_instance = new self(); + } + + return self::$_instance; + } + + /** + * Reset the Unsupported theme nnotice after a theme is switched. + * + * @since 1.0.16 + */ + public function reset_unsupported_theme_notice(): void + { + delete_user_meta(get_current_user_id(), 'unsupported-theme'); + } + + /** + * Register Astra Notices. + * + * @since 1.2.0 + */ + public function register_notices(): void + { + $image_path = HFE_URL . 'assets/images/header-footer-elementor-icon.svg'; + + Astra_Notices::add_notice( + [ + 'id' => 'header-footer-elementor-rating', + 'type' => '', + 'message' => sprintf( + '
@@ -174,480 +172,456 @@ public function register_notices() {
', - $image_path, - __( 'Hello! Seems like you have used Elementor Header & Footer Builder to build this website — Thanks a ton!', 'header-footer-elementor' ), - __( 'Could you please do us a BIG favor and give it a 5-star rating on WordPress? This would boost our motivation and help other users make a comfortable decision while choosing the Elementor Header & Footer Builder.', 'header-footer-elementor' ), - 'https://wordpress.org/support/plugin/header-footer-elementor/reviews/?filter=5#new-post', - __( 'Ok, you deserve it', 'header-footer-elementor' ), - MONTH_IN_SECONDS, - __( 'Nope, maybe later', 'header-footer-elementor' ), - __( 'I already did', 'header-footer-elementor' ) - ), - 'show_if' => ( hfe_header_enabled() || hfe_footer_enabled() || hfe_is_before_footer_enabled() ) ? true : false, - 'repeat-notice-after' => MONTH_IN_SECONDS, - 'display-notice-after' => 1296000, // Display notice after 15 days. - 'priority' => 18, - 'display-with-other-notices' => false, - ] - ); - } - - /** - * Enqueue CSS for the Rating Notice. - * - * @since 1.2.0 - * @return void - */ - public function rating_notice_css() { - wp_enqueue_style( 'hfe-admin-style', HFE_URL . 'assets/css/admin-header-footer-elementor.css', [], HFE_VER ); - } - - /** - * Prints the admin notics when Elementor is not installed or activated or version outdated. - * - * @since 1.5.9 - * @param boolean $is_elementor_callable specifies if elementor is available. - * @param boolean $is_elementor_outdated specifies if elementor version is old. - * @return void - */ - public function elementor_not_available( $is_elementor_callable, $is_elementor_outdated ) { - - if ( ( ! did_action( 'elementor/loaded' ) ) || ( ! $is_elementor_callable ) ) { - add_action( 'admin_notices', [ $this, 'elementor_not_installed_activated' ] ); - add_action( 'network_admin_notices', [ $this, 'elementor_not_installed_activated' ] ); - return; - } - - if ( $is_elementor_outdated ) { - add_action( 'admin_notices', [ $this, 'elementor_outdated' ] ); - add_action( 'network_admin_notices', [ $this, 'elementor_outdated' ] ); - return; - } - } - - /** - * Prints the admin notics when Elementor is not installed or activated. - * - * @return void - */ - public function elementor_not_installed_activated() { - - $screen = get_current_screen(); - if ( isset( $screen->parent_file ) && 'plugins.php' === $screen->parent_file && 'update' === $screen->id ) { - return; - } - - if ( ! did_action( 'elementor/loaded' ) ) { - // Check user capability. - if ( ! ( current_user_can( 'activate_plugins' ) && current_user_can( 'install_plugins' ) ) ) { - return; - } - - /* TO DO */ - $class = 'notice notice-error'; - /* translators: %s: html tags */ - $message = sprintf( __( 'The %1$sElementor Header & Footer Builder%2$s plugin requires %1$sElementor%2$s plugin installed & activated.', 'header-footer-elementor' ), '', '' ); - - $plugin = 'elementor/elementor.php'; - - if ( _is_elementor_installed() ) { - - $action_url = wp_nonce_url( 'plugins.php?action=activate&plugin=' . $plugin . '&plugin_status=all&paged=1&s', 'activate-plugin_' . $plugin ); - $button_label = __( 'Activate Elementor', 'header-footer-elementor' ); - - } else { - - $action_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=elementor' ), 'install-plugin_elementor' ); - $button_label = __( 'Install Elementor', 'header-footer-elementor' ); - } - - $button = '

' . esc_html( $button_label ) . '

'; - - printf( '

%2$s

%3$s
', esc_attr( $class ), wp_kses_post( $message ), wp_kses_post( $button ) ); - } - } - - /** - * Prints the admin notics when Elementor version is outdated. - * - * @return void - */ - public function elementor_outdated() { - - // Check user capability. - if ( ! ( current_user_can( 'activate_plugins' ) && current_user_can( 'install_plugins' ) ) ) { - return; - } - - /* TO DO */ - $class = 'notice notice-error'; - /* translators: %s: html tags */ - $message = sprintf( __( 'The %1$sElementor Header & Footer Builder%2$s plugin has stopped working because you are using an older version of %1$sElementor%2$s plugin.', 'header-footer-elementor' ), '', '' ); - - $plugin = 'elementor/elementor.php'; - - if ( file_exists( WP_PLUGIN_DIR . '/elementor/elementor.php' ) ) { - - $action_url = wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $plugin . '&', 'upgrade-plugin_' . $plugin ); - $button_label = __( 'Update Elementor', 'header-footer-elementor' ); - - } else { - - $action_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=elementor' ), 'install-plugin_elementor' ); - $button_label = __( 'Install Elementor', 'header-footer-elementor' ); - } - - $button = '

' . esc_html( $button_label ) . '

'; - - printf( '

%2$s

%3$s
', esc_attr( $class ), wp_kses_post( $message ), wp_kses_post( $button ) ); - } - - /** - * Prints the admin notics when Elementor is not installed or activated. - * - * @return void - */ - public function show_setup_wizard() { - - $screen = get_current_screen(); - $screen_id = $screen ? $screen->id : ''; - - if ( 'plugins' !== $screen_id ) { - return; - } - - /* TO DO */ - $class = 'notice notice-info is-dismissible'; - $setting_url = admin_url( 'edit.php?post_type=elementor-hf' ); - $image_path = HFE_URL . 'assets/images/header-footer-elementor-icon.svg'; - - /* translators: %s: html tags */ - $notice_message = sprintf( __( 'Thank you for installing %1$s Elementor Header & Footer Builder %2$s Plugin! Click here to %3$sget started. %4$s', 'header-footer-elementor' ), '', '', '', '' ); - - Astra_Notices::add_notice( - [ - 'id' => 'header-footer-install-notice', - 'type' => 'info', - /* translators: %s: html tags */ - 'message' => sprintf( - ' + $image_path, + __('Hello! Seems like you have used Elementor Header & Footer Builder to build this website — Thanks a ton!', 'header-footer-elementor'), + __('Could you please do us a BIG favor and give it a 5-star rating on WordPress? This would boost our motivation and help other users make a comfortable decision while choosing the Elementor Header & Footer Builder.', 'header-footer-elementor'), + 'https://wordpress.org/support/plugin/header-footer-elementor/reviews/?filter=5#new-post', + __('Ok, you deserve it', 'header-footer-elementor'), + MONTH_IN_SECONDS, + __('Nope, maybe later', 'header-footer-elementor'), + __('I already did', 'header-footer-elementor') + ), + 'show_if' => hfe_header_enabled() || hfe_footer_enabled() || hfe_is_before_footer_enabled() ? true : false, + 'repeat-notice-after' => MONTH_IN_SECONDS, + 'display-notice-after' => 1296000, // Display notice after 15 days. + 'priority' => 18, + 'display-with-other-notices' => false, + ] + ); + } + + /** + * Enqueue CSS for the Rating Notice. + * + * @since 1.2.0 + */ + public function rating_notice_css(): void + { + wp_enqueue_style('hfe-admin-style', HFE_URL . 'assets/css/admin-header-footer-elementor.css', [], HFE_VER); + } + + /** + * Prints the admin notics when Elementor is not installed or activated or version outdated. + * + * @since 1.5.9 + * + * @param bool $is_elementor_callable specifies if elementor is available. + * @param bool $is_elementor_outdated specifies if elementor version is old. + */ + public function elementor_not_available(bool $is_elementor_callable, bool $is_elementor_outdated): void + { + if ((! did_action('elementor/loaded')) || (! $is_elementor_callable)) { + add_action('admin_notices', [ $this, 'elementor_not_installed_activated' ]); + add_action('network_admin_notices', [ $this, 'elementor_not_installed_activated' ]); + return; + } + + if ($is_elementor_outdated) { + add_action('admin_notices', [ $this, 'elementor_outdated' ]); + add_action('network_admin_notices', [ $this, 'elementor_outdated' ]); + return; + } + } + + /** + * Prints the admin notics when Elementor is not installed or activated. + */ + public function elementor_not_installed_activated(): void + { + $screen = get_current_screen(); + if (isset($screen->parent_file) && $screen->parent_file === 'plugins.php' && $screen->id === 'update') { + return; + } + + if (! did_action('elementor/loaded')) { + // Check user capability. + if (! (current_user_can('activate_plugins') && current_user_can('install_plugins'))) { + return; + } + + /* TO DO */ + $class = 'notice notice-error'; + /* translators: %s: html tags */ + $message = sprintf(__('The %1$sElementor Header & Footer Builder%2$s plugin requires %1$sElementor%2$s plugin installed & activated.', 'header-footer-elementor'), '', ''); + + $plugin = 'elementor/elementor.php'; + + if (_is_elementor_installed()) { + $action_url = wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin . '&plugin_status=all&paged=1&s', 'activate-plugin_' . $plugin); + $button_label = __('Activate Elementor', 'header-footer-elementor'); + } else { + $action_url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=elementor'), 'install-plugin_elementor'); + $button_label = __('Install Elementor', 'header-footer-elementor'); + } + + $button = '

' . esc_html($button_label) . '

'; + + printf('

%2$s

%3$s
', esc_attr($class), wp_kses_post($message), wp_kses_post($button)); + } + } + + /** + * Prints the admin notics when Elementor version is outdated. + */ + public function elementor_outdated(): void + { + // Check user capability. + if (! (current_user_can('activate_plugins') && current_user_can('install_plugins'))) { + return; + } + + /* TO DO */ + $class = 'notice notice-error'; + /* translators: %s: html tags */ + $message = sprintf(__('The %1$sElementor Header & Footer Builder%2$s plugin has stopped working because you are using an older version of %1$sElementor%2$s plugin.', 'header-footer-elementor'), '', ''); + + $plugin = 'elementor/elementor.php'; + + if (file_exists(WP_PLUGIN_DIR . '/elementor/elementor.php')) { + $action_url = wp_nonce_url(self_admin_url('update.php?action=upgrade-plugin&plugin=') . $plugin . '&', 'upgrade-plugin_' . $plugin); + $button_label = __('Update Elementor', 'header-footer-elementor'); + } else { + $action_url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=elementor'), 'install-plugin_elementor'); + $button_label = __('Install Elementor', 'header-footer-elementor'); + } + + $button = '

' . esc_html($button_label) . '

'; + + printf('

%2$s

%3$s
', esc_attr($class), wp_kses_post($message), wp_kses_post($button)); + } + + /** + * Prints the admin notics when Elementor is not installed or activated. + */ + public function show_setup_wizard(): void + { + $screen = get_current_screen(); + $screen_id = $screen ? $screen->id : ''; + + if ($screen_id !== 'plugins') { + return; + } + + /* TO DO */ + $class = 'notice notice-info is-dismissible'; + $setting_url = admin_url('edit.php?post_type=elementor-hf'); + $image_path = HFE_URL . 'assets/images/header-footer-elementor-icon.svg'; + + /* translators: %s: html tags */ + $notice_message = sprintf(__('Thank you for installing %1$s Elementor Header & Footer Builder %2$s Plugin! Click here to %3$sget started. %4$s', 'header-footer-elementor'), '', '', '', ''); + + Astra_Notices::add_notice( + [ + 'id' => 'header-footer-install-notice', + 'type' => 'info', + /* translators: %s: html tags */ + 'message' => sprintf( + '

%2$s

', - $image_path, - $notice_message - ), - 'repeat-notice-after' => false, - 'priority' => 18, - 'display-with-other-notices' => false, - ] - ); - } - - /** - * Loads the globally required files for the plugin. - * - * @return void - */ - public function includes() { - require_once HFE_DIR . 'admin/class-hfe-admin.php'; - - require_once HFE_DIR . 'inc/hfe-functions.php'; - - // Load Elementor Canvas Compatibility. - require_once HFE_DIR . 'inc/class-hfe-elementor-canvas-compat.php'; - - // Load WPML & Polylang Compatibility if WPML is installed and activated. - if ( defined( 'ICL_SITEPRESS_VERSION' ) || defined( 'POLYLANG_BASENAME' ) ) { - require_once HFE_DIR . 'inc/compatibility/class-hfe-wpml-compatibility.php'; - } - - // Load the Admin Notice Class. - require_once HFE_DIR . 'inc/lib/astra-notices/class-astra-notices.php'; - - // Load Target rules. - require_once HFE_DIR . 'inc/lib/target-rule/class-astra-target-rules-fields.php'; - // Setup upgrade routines. - require_once HFE_DIR . 'inc/class-hfe-update.php'; - - // Load the widgets. - require HFE_DIR . 'inc/widgets-manager/class-widgets-loader.php'; - } - - /** - * Loads textdomain for the plugin. - * - * @return void - */ - public function load_textdomain() { - load_plugin_textdomain( 'header-footer-elementor' ); - } - - /** - * Enqueue styles and scripts. - * - * @return void - */ - public function enqueue_scripts() { - wp_enqueue_style( 'hfe-style', HFE_URL . 'assets/css/header-footer-elementor.css', [], HFE_VER ); - - if ( class_exists( '\Elementor\Plugin' ) ) { - $elementor = \Elementor\Plugin::instance(); - $elementor->frontend->enqueue_styles(); - } - - if ( class_exists( '\ElementorPro\Plugin' ) ) { - $elementor_pro = \ElementorPro\Plugin::instance(); - $elementor_pro->enqueue_styles(); - } - - if ( hfe_header_enabled() ) { - if ( class_exists( '\Elementor\Core\Files\CSS\Post' ) ) { - $css_file = new \Elementor\Core\Files\CSS\Post( get_hfe_header_id() ); - } elseif ( class_exists( '\Elementor\Post_CSS_File' ) ) { - $css_file = new \Elementor\Post_CSS_File( get_hfe_header_id() ); - } - - $css_file->enqueue(); - } - - if ( hfe_footer_enabled() ) { - if ( class_exists( '\Elementor\Core\Files\CSS\Post' ) ) { - $css_file = new \Elementor\Core\Files\CSS\Post( get_hfe_footer_id() ); - } elseif ( class_exists( '\Elementor\Post_CSS_File' ) ) { - $css_file = new \Elementor\Post_CSS_File( get_hfe_footer_id() ); - } - - $css_file->enqueue(); - } - - if ( hfe_is_before_footer_enabled() ) { - if ( class_exists( '\Elementor\Core\Files\CSS\Post' ) ) { - $css_file = new \Elementor\Core\Files\CSS\Post( hfe_get_before_footer_id() ); - } elseif ( class_exists( '\Elementor\Post_CSS_File' ) ) { - $css_file = new \Elementor\Post_CSS_File( hfe_get_before_footer_id() ); - } - $css_file->enqueue(); - } - } - - /** - * Load admin styles on header footer elementor edit screen. - * - * @return void - */ - public function enqueue_admin_scripts() { - global $pagenow; - $screen = get_current_screen(); - - if ( ( 'elementor-hf' == $screen->id && ( 'post.php' == $pagenow || 'post-new.php' == $pagenow ) ) || ( 'edit.php' == $pagenow && 'edit-elementor-hf' == $screen->id ) ) { - - wp_enqueue_style( 'hfe-admin-style', HFE_URL . 'admin/assets/css/ehf-admin.css', [], HFE_VER ); - wp_enqueue_script( 'hfe-admin-script', HFE_URL . 'admin/assets/js/ehf-admin.js', [ 'jquery', 'updates' ], HFE_VER, true ); - - } - } - - /** - * Adds classes to the body tag conditionally. - * - * @param array $classes array with class names for the body tag. - * - * @return array array with class names for the body tag. - */ - public function body_class( $classes ) { - if ( hfe_header_enabled() ) { - $classes[] = 'ehf-header'; - } - - if ( hfe_footer_enabled() ) { - $classes[] = 'ehf-footer'; - } - - $classes[] = 'ehf-template-' . $this->template; - $classes[] = 'ehf-stylesheet-' . get_stylesheet(); - - return $classes; - } - - /** - * Display Settings Page options - * - * @since 1.6.0 - * @return void - */ - public function setup_settings_page() { - - require_once HFE_DIR . 'inc/class-hfe-settings-page.php'; - } - - /** - * Display Unsupported theme notice if the current theme does add support for 'header-footer-elementor' - * - * @param array $hfe_settings_tabs settings array tabs. - * @since 1.0.3 - * @return array - */ - public function setup_unsupported_theme( $hfe_settings_tabs = [] ) { - if ( ! current_theme_supports( 'header-footer-elementor' ) ) { - $hfe_settings_tabs['hfe_settings'] = [ - 'name' => __( 'Theme Support', 'header-footer-elementor' ), - 'url' => admin_url( 'themes.php?page=hfe-settings' ), - ]; - } - return $hfe_settings_tabs; - } - - /** - * Add support for theme if the current theme does add support for 'header-footer-elementor' - * - * @since 1.6.1 - * @return void - */ - public function setup_fallback_support() { - - if ( ! current_theme_supports( 'header-footer-elementor' ) ) { - $hfe_compatibility_option = get_option( 'hfe_compatibility_option', '1' ); - - if ( '1' === $hfe_compatibility_option ) { - if ( ! class_exists( 'HFE_Default_Compat' ) ) { - require_once HFE_DIR . 'themes/default/class-hfe-default-compat.php'; - } - } elseif ( '2' === $hfe_compatibility_option ) { - require HFE_DIR . 'themes/default/class-global-theme-compatibility.php'; - } - } - } - - /** - * Prints the Header content. - * - * @return void - */ - public static function get_header_content() { - $header_content = self::$elementor_instance->frontend->get_builder_content_for_display( get_hfe_header_id() ); - echo $header_content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } - - /** - * Prints the Footer content. - * - * @return void - */ - public static function get_footer_content() { - echo "'; - } - - /** - * Prints the Before Footer content. - * - * @return void - */ - public static function get_before_footer_content() { - echo "'; - } - - /** - * Get option for the plugin settings - * - * @param string $setting Option name. - * @param string $default Default value to be received if the option value is not stored in the option. - * - * @return mixed | string - */ - public static function get_settings( $setting = '', $default = '' ) { - if ( 'type_header' == $setting || 'type_footer' == $setting || 'type_before_footer' == $setting ) { - $templates = self::get_template_id( $setting ); - - $template = ! is_array( $templates ) ? $templates : $templates[0]; - - $template = apply_filters( "hfe_get_settings_{$setting}", $template ); - - return $template; - } - } - - /** - * Get header or footer template id based on the meta query. - * - * @param String $type Type of the template header/footer. - * - * @return Mixed Returns the header or footer template id if found, else returns string ''. - */ - public static function get_template_id( $type ) { - $option = [ - 'location' => 'ehf_target_include_locations', - 'exclusion' => 'ehf_target_exclude_locations', - 'users' => 'ehf_target_user_roles', - ]; - - $hfe_templates = Astra_Target_Rules_Fields::get_instance()->get_posts_by_conditions( 'elementor-hf', $option ); - - foreach ( $hfe_templates as $template ) { - if ( get_post_meta( absint( $template['id'] ), 'ehf_template_type', true ) === $type ) { - if ( function_exists( 'pll_current_language' ) ) { - if ( pll_current_language( 'slug' ) == pll_get_post_language( $template['id'], 'slug' ) ) { - return $template['id']; - } - } else { - return $template['id']; - } - } - } - - return ''; - } - - /** - * Callback to shortcode. - * - * @param array $atts attributes for shortcode. - * @return string - */ - public function render_template( $atts ) { - $atts = shortcode_atts( - [ - 'id' => '', - ], - $atts, - 'hfe_template' - ); - - $id = ! empty( $atts['id'] ) ? apply_filters( 'hfe_render_template_id', intval( $atts['id'] ) ) : ''; - - if ( empty( $id ) ) { - return ''; - } - - if ( class_exists( '\Elementor\Core\Files\CSS\Post' ) ) { - $css_file = new \Elementor\Core\Files\CSS\Post( $id ); - } elseif ( class_exists( '\Elementor\Post_CSS_File' ) ) { - // Load elementor styles. - $css_file = new \Elementor\Post_CSS_File( $id ); - } - $css_file->enqueue(); - - return self::$elementor_instance->frontend->get_builder_content_for_display( $id ); - } + $image_path, + $notice_message + ), + 'repeat-notice-after' => false, + 'priority' => 18, + 'display-with-other-notices' => false, + ] + ); + } + + /** + * Loads the globally required files for the plugin. + */ + public function includes(): void + { + require_once HFE_DIR . 'admin/class-hfe-admin.php'; + + require_once HFE_DIR . 'inc/hfe-functions.php'; + + // Load Elementor Canvas Compatibility. + require_once HFE_DIR . 'inc/class-hfe-elementor-canvas-compat.php'; + + // Load WPML & Polylang Compatibility if WPML is installed and activated. + if (defined('ICL_SITEPRESS_VERSION') || defined('POLYLANG_BASENAME')) { + require_once HFE_DIR . 'inc/compatibility/class-hfe-wpml-compatibility.php'; + } + + // Load the Admin Notice Class. + require_once HFE_DIR . 'inc/lib/astra-notices/class-astra-notices.php'; + + // Load Target rules. + require_once HFE_DIR . 'inc/lib/target-rule/class-astra-target-rules-fields.php'; + // Setup upgrade routines. + require_once HFE_DIR . 'inc/class-hfe-update.php'; + + // Load the widgets. + require HFE_DIR . 'inc/widgets-manager/class-widgets-loader.php'; + } + + /** + * Loads textdomain for the plugin. + */ + public function load_textdomain(): void + { + load_plugin_textdomain('header-footer-elementor'); + } + + /** + * Enqueue styles and scripts. + */ + public function enqueue_scripts(): void + { + wp_enqueue_style('hfe-style', HFE_URL . 'assets/css/header-footer-elementor.css', [], HFE_VER); + + if (class_exists('\Elementor\Plugin')) { + $elementor = \Elementor\Plugin::instance(); + $elementor->frontend->enqueue_styles(); + } + + if (class_exists('\ElementorPro\Plugin')) { + $elementor_pro = \ElementorPro\Plugin::instance(); + $elementor_pro->enqueue_styles(); + } + + if (hfe_header_enabled()) { + if (class_exists('\Elementor\Core\Files\CSS\Post')) { + $css_file = new \Elementor\Core\Files\CSS\Post(get_hfe_header_id()); + } elseif (class_exists('\Elementor\Post_CSS_File')) { + $css_file = new \Elementor\Post_CSS_File(get_hfe_header_id()); + } + + $css_file->enqueue(); + } + + if (hfe_footer_enabled()) { + if (class_exists('\Elementor\Core\Files\CSS\Post')) { + $css_file = new \Elementor\Core\Files\CSS\Post(get_hfe_footer_id()); + } elseif (class_exists('\Elementor\Post_CSS_File')) { + $css_file = new \Elementor\Post_CSS_File(get_hfe_footer_id()); + } + + $css_file->enqueue(); + } + + if (hfe_is_before_footer_enabled()) { + if (class_exists('\Elementor\Core\Files\CSS\Post')) { + $css_file = new \Elementor\Core\Files\CSS\Post(hfe_get_before_footer_id()); + } elseif (class_exists('\Elementor\Post_CSS_File')) { + $css_file = new \Elementor\Post_CSS_File(hfe_get_before_footer_id()); + } + $css_file->enqueue(); + } + } + + /** + * Load admin styles on header footer elementor edit screen. + */ + public function enqueue_admin_scripts(): void + { + global $pagenow; + $screen = get_current_screen(); + + if (($screen->id === 'elementor-hf' && ($pagenow === 'post.php' || $pagenow === 'post-new.php')) || ($pagenow === 'edit.php' && $screen->id === 'edit-elementor-hf')) { + wp_enqueue_style('hfe-admin-style', HFE_URL . 'admin/assets/css/ehf-admin.css', [], HFE_VER); + wp_enqueue_script('hfe-admin-script', HFE_URL . 'admin/assets/js/ehf-admin.js', [ 'jquery', 'updates' ], HFE_VER, true); + } + } + + /** + * Adds classes to the body tag conditionally. + * + * @param array $classes array with class names for the body tag. + * + * @return array array with class names for the body tag. + */ + public function body_class(array $classes): array + { + if (hfe_header_enabled()) { + $classes[] = 'ehf-header'; + } + + if (hfe_footer_enabled()) { + $classes[] = 'ehf-footer'; + } + + $classes[] = 'ehf-template-' . $this->template; + $classes[] = 'ehf-stylesheet-' . get_stylesheet(); + + return $classes; + } + + /** + * Display Settings Page options + * + * @since 1.6.0 + */ + public function setup_settings_page(): void + { + require_once HFE_DIR . 'inc/class-hfe-settings-page.php'; + } + + /** + * Display Unsupported theme notice if the current theme does add support for 'header-footer-elementor' + * + * @param array $hfe_settings_tabs settings array tabs. + * + * @since 1.0.3 + */ + public function setup_unsupported_theme(array $hfe_settings_tabs = []): array + { + if (! current_theme_supports('header-footer-elementor')) { + $hfe_settings_tabs['hfe_settings'] = [ + 'name' => __('Theme Support', 'header-footer-elementor'), + 'url' => admin_url('themes.php?page=hfe-settings'), + ]; + } + return $hfe_settings_tabs; + } + + /** + * Add support for theme if the current theme does add support for 'header-footer-elementor' + * + * @since 1.6.1 + */ + public function setup_fallback_support(): void + { + if (! current_theme_supports('header-footer-elementor')) { + $hfe_compatibility_option = get_option('hfe_compatibility_option', '1'); + + if ($hfe_compatibility_option === '1') { + if (! class_exists('HFE_Default_Compat')) { + require_once HFE_DIR . 'themes/default/class-hfe-default-compat.php'; + } + } elseif ($hfe_compatibility_option === '2') { + require HFE_DIR . 'themes/default/class-global-theme-compatibility.php'; + } + } + } + + /** + * Prints the Header content. + */ + public static function get_header_content(): void + { + $header_content = self::$elementor_instance->frontend->get_builder_content_for_display(get_hfe_header_id()); + echo $header_content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + } + + /** + * Prints the Footer content. + */ + public static function get_footer_content(): void + { + echo "'; + } + + /** + * Prints the Before Footer content. + */ + public static function get_before_footer_content(): void + { + echo "'; + } + + /** + * Get option for the plugin settings + * + * @param string $setting Option name. + * @param string $default Default value to be received if the option value is not stored in the option. + */ + public static function get_settings(string $setting = '', string $default = ''): mixed + { + if ($setting === 'type_header' || $setting === 'type_footer' || $setting === 'type_before_footer') { + $templates = self::get_template_id($setting); + + $template = ! is_array($templates) ? $templates : $templates[0]; + + return apply_filters("hfe_get_settings_{$setting}", $template); + } + } + + /** + * Get header or footer template id based on the meta query. + * + * @param String $type Type of the template header/footer. + * + * @return Mixed Returns the header or footer template id if found, else returns string ''. + */ + public static function get_template_id(string $type): mixed + { + $option = [ + 'location' => 'ehf_target_include_locations', + 'exclusion' => 'ehf_target_exclude_locations', + 'users' => 'ehf_target_user_roles', + ]; + + $hfe_templates = Astra_Target_Rules_Fields::get_instance()->get_posts_by_conditions('elementor-hf', $option); + + foreach ($hfe_templates as $template) { + if (get_post_meta(absint($template['id']), 'ehf_template_type', true) === $type) { + if (function_exists('pll_current_language')) { + if (pll_current_language('slug') === pll_get_post_language($template['id'], 'slug')) { + return $template['id']; + } + } else { + return $template['id']; + } + } + } + + return ''; + } + + /** + * Callback to shortcode. + * + * @param array $atts attributes for shortcode. + */ + public function render_template(array $atts): string + { + $atts = shortcode_atts( + [ + 'id' => '', + ], + $atts, + 'hfe_template' + ); + + $id = ! empty($atts['id']) ? apply_filters('hfe_render_template_id', intval($atts['id'])) : ''; + + if (empty($id)) { + return ''; + } + + if (class_exists('\Elementor\Core\Files\CSS\Post')) { + $css_file = new \Elementor\Core\Files\CSS\Post($id); + } elseif (class_exists('\Elementor\Post_CSS_File')) { + // Load elementor styles. + $css_file = new \Elementor\Post_CSS_File($id); + } + $css_file->enqueue(); + + return self::$elementor_instance->frontend->get_builder_content_for_display($id); + } } /** * Is elementor plugin installed. */ -if ( ! function_exists( '_is_elementor_installed' ) ) { - - /** - * Check if Elementor is installed - * - * @since 1.6.0 - * - * @access public - * @return bool - */ - function _is_elementor_installed() { - return ( file_exists( WP_PLUGIN_DIR . '/elementor/elementor.php' ) ) ? true : false; - } +if (! function_exists('_is_elementor_installed')) { + /** + * Check if Elementor is installed + * + * @since 1.6.0 + * + * @access public + */ + function _is_elementor_installed(): bool + { + return file_exists(WP_PLUGIN_DIR . '/elementor/elementor.php') ? true : false; + } } diff --git a/inc/class-hfe-elementor-canvas-compat.php b/inc/class-hfe-elementor-canvas-compat.php index 3a06dd59a..d8aeee812 100644 --- a/inc/class-hfe-elementor-canvas-compat.php +++ b/inc/class-hfe-elementor-canvas-compat.php @@ -1,4 +1,7 @@ =' ) ) { - add_action( 'elementor/page_templates/canvas/before_content', [ $this, 'render_header' ] ); - } else { - add_action( 'wp_head', [ $this, 'render_header' ] ); - } - } - - if ( hfe_footer_enabled() ) { - - // Action `elementor/page_templates/canvas/after_content` is introduced in Elementor Version 1.9.0. - if ( version_compare( ELEMENTOR_VERSION, '1.9.0', '>=' ) ) { - add_action( 'elementor/page_templates/canvas/after_content', [ $this, 'render_footer' ] ); - } else { - add_action( 'wp_footer', [ $this, 'render_footer' ] ); - } - } - - if ( hfe_is_before_footer_enabled() ) { - - // check if current page template is Elemenntor Canvas. - if ( 'elementor_canvas' == get_page_template_slug() ) { - $override_cannvas_template = get_post_meta( hfe_get_before_footer_id(), 'display-on-canvas-template', true ); - - if ( '1' == $override_cannvas_template ) { - add_action( 'elementor/page_templates/canvas/after_content', 'hfe_render_before_footer', 9 ); - } - } - } - } - - /** - * Render the header if display template on elementor canvas is enabled - * and current template is Elementor Canvas - * - * @return void - */ - public function render_header() { - - // bail if current page template is not Elemenntor Canvas. - if ( 'elementor_canvas' !== get_page_template_slug() ) { - return; - } - - $override_cannvas_template = get_post_meta( get_hfe_header_id(), 'display-on-canvas-template', true ); - - if ( '1' == $override_cannvas_template ) { - hfe_render_header(); - } - } - - /** - * Render the footer if display template on elementor canvas is enabled - * and current template is Elementor Canvas - * - * @return void - */ - public function render_footer() { - - // bail if current page template is not Elemenntor Canvas. - if ( 'elementor_canvas' !== get_page_template_slug() ) { - return; - } - - $override_cannvas_template = get_post_meta( get_hfe_footer_id(), 'display-on-canvas-template', true ); - - if ( '1' == $override_cannvas_template ) { - hfe_render_footer(); - } - } +class HFE_Elementor_Canvas_Compat +{ + /** + * Instance of HFE_Elementor_Canvas_Compat. + */ + private static HFE_Elementor_Canvas_Compat $instance; + + /** + * Initiator + */ + public static function instance(): HFE_Elementor_Canvas_Compat + { + if (! isset(self::$instance)) { + self::$instance = new HFE_Elementor_Canvas_Compat(); + + add_action('wp', [ self::$instance, 'hooks' ]); + } + + return self::$instance; + } + + /** + * Run all the Actions / Filters. + */ + public function hooks(): void + { + if (hfe_header_enabled()) { + // Action `elementor/page_templates/canvas/before_content` is introduced in Elementor Version 1.4.1. + if (version_compare(ELEMENTOR_VERSION, '1.4.1', '>=')) { + add_action('elementor/page_templates/canvas/before_content', [ $this, 'render_header' ]); + } else { + add_action('wp_head', [ $this, 'render_header' ]); + } + } + + if (hfe_footer_enabled()) { + // Action `elementor/page_templates/canvas/after_content` is introduced in Elementor Version 1.9.0. + if (version_compare(ELEMENTOR_VERSION, '1.9.0', '>=')) { + add_action('elementor/page_templates/canvas/after_content', [ $this, 'render_footer' ]); + } else { + add_action('wp_footer', [ $this, 'render_footer' ]); + } + } + + if (hfe_is_before_footer_enabled()) { + // check if current page template is Elemenntor Canvas. + if (get_page_template_slug() === 'elementor_canvas') { + $override_cannvas_template = get_post_meta(hfe_get_before_footer_id(), 'display-on-canvas-template', true); + + if ($override_cannvas_template === '1') { + add_action('elementor/page_templates/canvas/after_content', 'hfe_render_before_footer', 9); + } + } + } + } + + /** + * Render the header if display template on elementor canvas is enabled + * and current template is Elementor Canvas + */ + public function render_header(): void + { + // bail if current page template is not Elemenntor Canvas. + if (get_page_template_slug() !== 'elementor_canvas') { + return; + } + + $override_cannvas_template = get_post_meta(get_hfe_header_id(), 'display-on-canvas-template', true); + + if ($override_cannvas_template === '1') { + hfe_render_header(); + } + } + + /** + * Render the footer if display template on elementor canvas is enabled + * and current template is Elementor Canvas + */ + public function render_footer(): void + { + // bail if current page template is not Elemenntor Canvas. + if (get_page_template_slug() !== 'elementor_canvas') { + return; + } + + $override_cannvas_template = get_post_meta(get_hfe_footer_id(), 'display-on-canvas-template', true); + + if ($override_cannvas_template === '1') { + hfe_render_footer(); + } + } } HFE_Elementor_Canvas_Compat::instance(); diff --git a/inc/class-hfe-settings-page.php b/inc/class-hfe-settings-page.php index 589743a93..e69de29bb 100644 --- a/inc/class-hfe-settings-page.php +++ b/inc/class-hfe-settings-page.php @@ -1,855 +0,0 @@ - esc_html__( 'Activate', 'header-footer-elementor' ), - 'addon_activated' => esc_html__( 'Activated', 'header-footer-elementor' ), - 'addon_active' => esc_html__( 'Active', 'header-footer-elementor' ), - 'addon_deactivate' => esc_html__( 'Deactivate', 'header-footer-elementor' ), - 'addon_inactive' => esc_html__( 'Inactive', 'header-footer-elementor' ), - 'addon_install' => esc_html__( 'Install', 'header-footer-elementor' ), - 'theme_installed' => esc_html__( 'Theme Installed', 'header-footer-elementor' ), - 'plugin_installed' => esc_html__( 'Plugin Installed', 'header-footer-elementor' ), - 'addon_download' => esc_html__( 'Download', 'header-footer-elementor' ), - 'addon_exists' => esc_html__( 'Already Exists.', 'header-footer-elementor' ), - 'visit_site' => esc_html__( 'Visit Website', 'header-footer-elementor' ), - 'plugin_error' => esc_html__( 'Could not install. Please download from WordPress.org and install manually.', 'header-footer-elementor' ), - 'subscribe_success' => esc_html__( 'Your details are submitted successfully.', 'header-footer-elementor' ), - 'subscribe_error' => esc_html__( 'Encountered an error while performing your request.', 'header-footer-elementor' ), - 'ajax_url' => admin_url( 'admin-ajax.php' ), - 'nonce' => wp_create_nonce( 'hfe-admin-nonce' ), - 'popup_dismiss' => false, - 'data_source' => 'HFE', - ]; - - $strings = apply_filters( 'hfe_admin_strings', $strings ); - - wp_localize_script( - 'hfe-admin-script', - 'hfe_admin_data', - $strings - ); - } - - /** - * Adds a tab in plugin submenu page. - * - * @since 1.6.0 - * @param string $views to add tab to current post type view. - * - * @return mixed - */ - public function hfe_settings( $views ) { - - $this->hfe_tabs(); - $this->hfe_modal(); - return $views; - } - - /** - * Function for registering the settings api. - * - * @since 1.6.0 - * @return void - */ - public function hfe_admin_init() { - register_setting( 'hfe-plugin-options', 'hfe_compatibility_option' ); - add_settings_section( 'hfe-options', __( 'Add Theme Support', 'header-footer-elementor' ), [ $this, 'hfe_compatibility_callback' ], 'Settings' ); - add_settings_field( 'hfe-way', 'Methods to Add Theme Support', [ $this, 'hfe_compatibility_option_callback' ], 'Settings', 'hfe-options' ); - - register_setting( 'hfe-plugin-guide', 'hfe_guide_email' ); - register_setting( 'hfe-plugin-guide', 'hfe_guide_fname' ); - } - - /** - * Call back function for the ssettings api function add_settings_section - * - * This function can be used to add description of the settings sections - * - * @since 1.6.0 - * @return void - */ - public function hfe_compatibility_callback() { - $message = __( 'The Elementor Header & Footer Builder plugin need compatibility with your current theme to work smoothly.

Following are two methods that enable theme support for the plugin.

Method 1 is selected by default and that works fine almost will all themes. In case, you face any issue with the header or footer template, try choosing Method 2.', 'header-footer-elementor' ); - $allowed_html = [ 'br' => [] ]; - echo wp_kses( $message, $allowed_html ); - } - - /** - * Call back function for the ssettings api function add_settings_field - * - * This function will contain the markup for the input feilds that we can add. - * - * @since 1.6.0 - * @return void - */ - public function hfe_compatibility_option_callback() { - $hfe_radio_button = get_option( 'hfe_compatibility_option', '1' ); - wp_enqueue_style( 'hfe-admin-style', HFE_URL . 'admin/assets/css/ehf-admin.css', [], HFE_VER ); - ?> - - - -

- plugin.', 'header-footer-elementor' ), - [ - 'a' => [ - 'href' => [], - ], - ] - ), - 'https://github.com/Nikschavan/header-footer-elementor/wiki/Adding-Header-Footer-Elementor-support-for-your-theme' - ); - ?> -

- - '; - esc_attr_e( 'Elementor Header & Footer Builder ', 'header-footer-elementor' ); - echo ''; - $this->hfe_tabs(); - ?> - - get_themes_support(); - break; - - case 'hfe-about': - $this->get_about_html(); - break; - - case 'default': - break; - } - } - } - - /** - * Settings page - load modal content. - * - * Call back function for add submenu page function. - * - * @since 1.6.2 - * @return (void | bool) - */ - public function hfe_modal() { - $is_dismissed = []; - $is_dismissed = get_user_meta( get_current_user_id(), 'hfe-popup' ); - - $is_subscribed = get_user_meta( get_current_user_ID(), 'hfe-subscribed' ); - $subscribe_valid = ( is_array( $is_subscribed ) && isset( $is_subscribed[0] ) && 'yes' === $is_subscribed[0] ) ? 'yes' : false; - - if ( ( ! empty( $is_dismissed ) && 'dismissed' === $is_dismissed[0] ) || 'yes' === $subscribe_valid ) { - return false; - } else { - $this->get_guide_modal(); - } - } - - /** - * Function for adding tabs - * - * @since 1.6.0 - * @return void - */ - public function hfe_tabs() { - ?> - - post_type || 'appearance_page_hfe-guide' === $current_screen->id || 'appearance_page_hfe-about' === $current_screen->id || 'appearance_page_hfe-settings' === $current_screen->id ) ); - - if ( $is_elementor_screen ) { - $footer_text = sprintf( - /* translators: 1: Elementor, 2: Link to plugin review */ - __( 'Help us spread the word about the plugin by leaving %2$s %1$s %3$s ratings on %2$s WordPress.org %3$s. Thank you from the Brainstorm Force team!', 'header-footer-elementor' ), - '★★★★★', - '', - '' - ); - } - - return $footer_text; - } - - /** - * Function for theme support tab - * - * @since 1.6.0 - * @return void - */ - public function get_themes_support() { - ?> -
- - - -
- - -
- -
-
-

-

-
-
- -
-
-
-
-
- get_form_html(); ?> -
-
-
- -

', '', '', '' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>

-
-
- -
- - get_form_row_1(); ?> - get_form_row_2(); ?> - - - -
-
-
- - - -
-
- - - -
-
- -

- -

-
- -
-
-
- - - -
-
- - - -
-
- - -
-
-

- -

-
- -
-
-
-
- -

-
- get_guide_html(); ?> -
-
-
-
- output_about_info(); - $this->output_about_addons(); - } - - /** - * Function for Astra Pro white labels with defaults. - * - * @since 1.6.24 - * @return array - */ - protected function get_white_label() { - $white_labels = is_callable( 'Astra_Admin_Helper::get_admin_settings_option' ) ? \Astra_Admin_Helper::get_admin_settings_option( '_astra_ext_white_label', true ) : []; - - $theme_name = ! empty( $white_labels['astra']['name'] ) ? $white_labels['astra']['name'] : 'Astra'; - - return [ - 'theme_name' => $theme_name, - /* translators: %s: theme name */ - 'description' => ! empty( $white_labels['astra']['description'] ) ? $white_labels['astra']['description'] : esc_html( sprintf( __( 'Powering over 1+ Million websites, %s is loved for the fast performance and ease of use it offers. It is suitable for all kinds of websites like blogs, portfolios, business, and WooCommerce stores.', 'header-footer-elementor' ), esc_html( $theme_name ) ) ), - 'theme_icon' => ! empty( $white_labels['astra']['icon'] ) ? $white_labels['astra']['icon'] : '', - 'author_url' => ! empty( $white_labels['astra']['author_url'] ) ? $white_labels['astra']['author_url'] : 'https://wpastra.com/', - ]; - } - - /** - * Display the General Info section of About tab. - * - * @since 1.6.0 - * @return void - */ - protected function output_about_info() { - - $white_labels = $this->get_white_label(); - - ?> - -
- -
-

- -

- -

- -

- - -

- -

- -
-
- <?php esc_attr_e( 'Team photo', 'header-footer-elementor' ); ?> -
-
-
-
-
- -
- get_bsf_plugins(); - $can_install_plugins = $this->hfe_can_install( 'plugin' ); - $can_install_themes = $this->hfe_can_install( 'theme' ); - - ?> -
-
- $details ) : - - $plugin_data = $this->get_plugin_data( $plugin, $details, $all_plugins, $all_themes ); - - ?> -
-
-
- -
-
- ', - '', - esc_html( $plugin_data['details']['name'] ) - ); - ?> -
- -

-
-
-
-
- - ' . wp_kses_post( $plugin_data['status_text'] ) . '' - ); - ?> - -
-
- - - - - - - - - - - - -
-
-
-
- -
-
- name || 'Astra' === $theme->parent_theme ) ) ) { - - // Status text/status. - $plugin_data['status_class'] = 'status-active'; - $plugin_data['status_text'] = esc_html__( 'Active', 'header-footer-elementor' ); - // Button text/status. - $plugin_data['action_class'] = $plugin_data['status_class'] . ' button button-secondary disabled'; - $plugin_data['action_text'] = esc_html__( 'Activated', 'header-footer-elementor' ); - $plugin_data['plugin_src'] = esc_attr( $addon ); - } else { - // Status text/status. - $plugin_data['status_class'] = 'status-inactive'; - $plugin_data['status_text'] = esc_html__( 'Inactive', 'header-footer-elementor' ); - // Button text/status. - $plugin_data['action_class'] = $plugin_data['status_class'] . ' button button-secondary'; - $plugin_data['action_text'] = esc_html__( 'Activate', 'header-footer-elementor' ); - $plugin_data['plugin_src'] = esc_attr( $addon ); - } - } else { - // install if already doesn't exists. - // Status text/status. - $plugin_data['status_class'] = 'status-download'; - if ( isset( $details['act'] ) && 'go-to-url' === $details['act'] ) { - $plugin_data['status_class'] = 'status-go-to-url'; - } - $plugin_data['status_text'] = esc_html__( 'Not Installed', 'header-footer-elementor' ); - // Button text/status. - $plugin_data['action_class'] = $plugin_data['status_class'] . ' button button-primary'; - $plugin_data['action_text'] = esc_html__( 'Install', 'header-footer-elementor' ); - $plugin_data['plugin_src'] = esc_url( $details['url'] ); - - if ( $have_pro ) { - $plugin_data['status_class'] = ''; - $plugin_data['action_text'] = esc_html__( 'Visit Website', 'header-footer-elementor' ); - } - } - - $plugin_data['details'] = $details; - - return $plugin_data; - } - - /** - * List of plugins that we propose to install. - * - * @since 1.6.0 - * - * @return array - */ - protected function get_bsf_plugins() { - - $white_labels = $this->get_white_label(); - - $images_url = HFE_URL . 'assets/images/settings/'; - - return [ - - 'astra' => [ - 'icon' => ! empty( $white_labels['theme_icon'] ) ? $white_labels['theme_icon'] : $images_url . 'plugin-astra.png', - 'type' => 'theme', - 'name' => $white_labels['theme_name'], - 'desc' => $white_labels['description'], - 'wporg' => 'https://wordpress.org/themes/astra/', - 'url' => 'https://downloads.wordpress.org/theme/astra.zip', - 'siteurl' => $white_labels['author_url'], - 'pro' => false, - 'slug' => 'astra', - ], - - 'astra-sites/astra-sites.php' => [ - 'icon' => $images_url . 'plugin-st.png', - 'type' => 'plugin', - 'name' => esc_html__( 'Starter Templates', 'header-footer-elementor' ), - 'desc' => esc_html__( 'A popular templates plugin that provides an extensive library of professional and fully customizable 600+ ready website and templates. More than 1+ Million websites have built with this plugin.', 'header-footer-elementor' ), - 'wporg' => 'https://wordpress.org/plugins/astra-sites/', - 'url' => 'https://downloads.wordpress.org/plugin/astra-sites.zip', - 'siteurl' => 'https://startertemplates.com/', - 'pro' => false, - 'slug' => 'astra-sites', - ], - - 'ultimate-elementor/ultimate-elementor.php' => [ - 'icon' => $images_url . 'plugin-uae.png', - 'type' => 'plugin', - 'name' => esc_html__( 'Ultimate Addons for Elementor', 'header-footer-elementor' ), - 'desc' => esc_html__( 'It’s a collection of 40+ unique, creative, and optimized Elementor widgets with 100+ readymade templates. Trusted by more than 600+ K web professionals. It’s a #1 toolkit for Elementor Page Builder.', 'header-footer-elementor' ), - 'wporg' => '', - 'url' => 'https://ultimateelementor.com/', - 'siteurl' => 'https://ultimateelementor.com/', - 'pro' => true, - 'slug' => 'ultimate-elementor', - ], - ]; - } - - /** - * Determine if the plugin/addon installations are allowed. - * - * @since 1.6.0 - * @param string $type defines addon type. - * @return bool - */ - public function hfe_can_install( $type ) { - - if ( ! in_array( $type, [ 'plugin', 'theme' ], true ) ) { - return false; - } - - // Determine whether file modifications are allowed. - if ( ! wp_is_file_mod_allowed( 'hfe_can_install' ) ) { - return false; - } - - if ( 'theme' === $type ) { - if ( ! current_user_can( 'install_themes' ) ) { - return false; - } - - return true; - - } elseif ( 'plugin' === $type ) { - if ( ! current_user_can( 'install_plugins' ) ) { - return false; - } - - return true; - } - - return false; - } - - /** - * Add settings link to the Plugins page. - * - * @since 1.6.0 - * - * @param array $links Plugin row links. - * - * @return array $links - */ - public function settings_link( $links ) { - - $custom['settings'] = sprintf( - '%s', - esc_url( - add_query_arg( - [ - 'post_type' => 'elementor-hf', - ], - admin_url( 'edit.php' ) - ) - ), - esc_attr__( 'Go to HFE Settings page', 'header-footer-elementor' ), - esc_html__( 'Settings', 'header-footer-elementor' ) - ); - - return array_merge( $custom, (array) $links ); - } -} - -new HFE_Settings_Page(); diff --git a/inc/class-hfe-update.php b/inc/class-hfe-update.php index c99caf607..79c589721 100644 --- a/inc/class-hfe-update.php +++ b/inc/class-hfe-update.php @@ -1,176 +1,184 @@ + * * @copyright Copyright (c) 2019, Header Footer Elementor + * * @link https://github.com/Nikschavan/header-footer-elementor/ + * * @since HFE 1.1.4 */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. +if (! defined('ABSPATH')) { + exit; // Exit if accessed directly. } -if ( ! class_exists( 'HFE_Update' ) ) { - - /** - * HFE_Update initial setup - * - * @since 1.1.4 - */ - class HFE_Update { - - /** - * Option key for stored version number. - * - * @since 1.1.4 - * @var string - */ - // phpcs:ignore - private string $db_option_key = '_hfe_db_version'; - - /** - * Constructor - * - * @since 1.1.4 - */ - public function __construct() { - - // Theme Updates. - if ( is_admin() ) { - add_action( 'admin_init', [ $this, 'init' ], 5 ); - } else { - add_action( 'wp', [ $this, 'init' ], 5 ); - } - } - - /** - * Implement theme update logic. - * - * @since 1.1.4 - * @return void - */ - public function init() { - do_action( 'hfe_update_before' ); - - if ( ! $this->needs_db_update() ) { - return; - } - - $db_version = get_option( $this->db_option_key, false ); - - if ( version_compare( $db_version, '1.2.0-beta.2', '<' ) ) { - $this->setup_default_terget_rules(); - } - - // flush rewrite rules on plugin update. - flush_rewrite_rules(); // PHPCS:Ignore WordPressVIPMinimum.Functions.RestrictedFunctions.flush_rewrite_rules_flush_rewrite_rules - - $this->update_db_version(); - - do_action( 'hfe_update_after' ); - } - - /** - * Set default target rules for header, footer, before footers being used before target rules were added to the plugin. - * - * @since 1.2.0-beta.1 - * @return void - */ - private function setup_default_terget_rules() { - $default_include_locations = [ - 'rule' => [ 0 => 'basic-global' ], - 'specific' => [], - ]; - - $header_id = $this->get_legacy_template_id( 'type_header' ); - $footer_id = $this->get_legacy_template_id( 'type_footer' ); - $before_footer_id = $this->get_legacy_template_id( 'type_before_footer' ); - - // Header. - if ( ! empty( $header_id ) ) { - update_post_meta( $header_id, 'ehf_target_include_locations', $default_include_locations ); - } - - // Footer. - if ( ! empty( $footer_id ) ) { - update_post_meta( $footer_id, 'ehf_target_include_locations', $default_include_locations ); - } - - // Before Footer. - if ( ! empty( $before_footer_id ) ) { - update_post_meta( $before_footer_id, 'ehf_target_include_locations', $default_include_locations ); - } - } - - /** - * Get header or footer template id based on the meta query. - * - * @param string $type Type of the template header/footer. - * - * @return mixed Returns the header or footer template id if found, else returns string ''. - */ - public function get_legacy_template_id( $type ) { - $args = [ - 'post_type' => 'elementor-hf', - 'meta_key' => 'ehf_template_type', - 'meta_value' => $type, // PHPCS:Ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_value - 'meta_type' => 'post', - 'meta_compare' => '>=', - 'orderby' => 'meta_value', - 'order' => 'ASC', - 'meta_query' => [ // PHPCS:Ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query - 'relation' => 'OR', - [ - 'key' => 'ehf_template_type', - 'value' => $type, - 'compare' => '==', - 'type' => 'post', - ], - ], - ]; - - $args = apply_filters( 'hfe_get_template_id_args', $args ); - $template = new WP_Query( - $args - ); - - if ( $template->have_posts() ) { - $posts = wp_list_pluck( $template->posts, 'ID' ); - return $posts[0]; - } - - return ''; - } - - /** - * Check if db upgrade is required. - * - * @since 1.1.4 - * @return bool True if stored database version is lower than constant; false if otherwise. - */ - private function needs_db_update() { - $db_version = get_option( $this->db_option_key, false ); - - if ( false === $db_version || version_compare( $db_version, HFE_VER ) ) { - return true; - } - - return false; - } - - /** - * Update DB version. - * - * @since 1.1.4 - * @return void - */ - private function update_db_version() { - update_option( $this->db_option_key, HFE_VER ); - } - } +if (! class_exists('HFE_Update')) { + /** + * HFE_Update initial setup + * + * @since 1.1.4 + */ + class HFE_Update + { + /** + * Option key for stored version number. + * + * @since 1.1.4 + */ + // phpcs:ignore + private string $db_option_key = '_hfe_db_version'; + + /** + * Constructor + * + * @since 1.1.4 + */ + public function __construct() + { + // Theme Updates. + if (is_admin()) { + add_action('admin_init', [ $this, 'init' ], 5); + } else { + add_action('wp', [ $this, 'init' ], 5); + } + } + + /** + * Implement theme update logic. + * + * @since 1.1.4 + */ + public function init(): void + { + do_action('hfe_update_before'); + + if (! $this->needs_db_update()) { + return; + } + + $db_version = get_option($this->db_option_key, false); + + if (version_compare($db_version, '1.2.0-beta.2', '<')) { + $this->setup_default_terget_rules(); + } + + // flush rewrite rules on plugin update. + flush_rewrite_rules(); // PHPCS:Ignore WordPressVIPMinimum.Functions.RestrictedFunctions.flush_rewrite_rules_flush_rewrite_rules + + $this->update_db_version(); + + do_action('hfe_update_after'); + } + + /** + * Get header or footer template id based on the meta query. + * + * @param string $type Type of the template header/footer. + * + * @return mixed Returns the header or footer template id if found, else returns string ''. + */ + public function get_legacy_template_id(string $type): mixed + { + $args = [ + 'post_type' => 'elementor-hf', + 'meta_key' => 'ehf_template_type', + 'meta_value' => $type, // PHPCS:Ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_value + 'meta_type' => 'post', + 'meta_compare' => '>=', + 'orderby' => 'meta_value', + 'order' => 'ASC', + 'meta_query' => [ // PHPCS:Ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query + 'relation' => 'OR', + [ + 'key' => 'ehf_template_type', + 'value' => $type, + 'compare' => '==', + 'type' => 'post', + ], + ], + ]; + + $args = apply_filters('hfe_get_template_id_args', $args); + $template = new WP_Query( + $args + ); + + if ($template->have_posts()) { + $posts = wp_list_pluck($template->posts, 'ID'); + return $posts[0]; + } + + return ''; + } + + /** + * Set default target rules for header, footer, before footers being used before target rules were added to the plugin. + * + * @since 1.2.0-beta.1 + */ + private function setup_default_terget_rules(): void + { + $default_include_locations = [ + 'rule' => [ 0 => 'basic-global' ], + 'specific' => [], + ]; + + $header_id = $this->get_legacy_template_id('type_header'); + $footer_id = $this->get_legacy_template_id('type_footer'); + $before_footer_id = $this->get_legacy_template_id('type_before_footer'); + + // Header. + if (! empty($header_id)) { + update_post_meta($header_id, 'ehf_target_include_locations', $default_include_locations); + } + + // Footer. + if (! empty($footer_id)) { + update_post_meta($footer_id, 'ehf_target_include_locations', $default_include_locations); + } + + // Before Footer. + if (! empty($before_footer_id)) { + update_post_meta($before_footer_id, 'ehf_target_include_locations', $default_include_locations); + } + } + + /** + * Check if db upgrade is required. + * + * @since 1.1.4 + * + * @return bool True if stored database version is lower than constant; false if otherwise. + */ + private function needs_db_update(): bool + { + $db_version = get_option($this->db_option_key, false); + + if ($db_version === false || version_compare($db_version, HFE_VER)) { + return true; + } + + return false; + } + + /** + * Update DB version. + * + * @since 1.1.4 + */ + private function update_db_version(): void + { + update_option($this->db_option_key, HFE_VER); + } + } } new HFE_Update(); diff --git a/inc/compatibility/class-hfe-wpml-compatibility.php b/inc/compatibility/class-hfe-wpml-compatibility.php index 011c00bd2..0e1a0cdab 100644 --- a/inc/compatibility/class-hfe-wpml-compatibility.php +++ b/inc/compatibility/class-hfe-wpml-compatibility.php @@ -1,84 +1,93 @@ -
-

- -
- - +
+

+ +
+ + -
- -
- +
+ +
+ - - + + get_notice_by_id( $notice_id ); - $capability = isset( $notice['capability'] ) ? $notice['capability'] : 'manage_options'; - - if ( ! apply_filters( 'astra_notices_user_cap_check', current_user_can( $capability ) ) ) { - return; - } - - if ( false === wp_verify_nonce( $nonce, 'astra-notices' ) ) { - wp_send_json_error( esc_html_e( 'WordPress Nonce not validated.', 'header-footer-elementor' ) ); - } - - // 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.0.0 - * @return void - */ - public function enqueue_scripts() { - wp_register_style( 'astra-notices', self::get_url() . 'notices.css', array(), self::$version ); - wp_register_script( 'astra-notices', self::get_url() . 'notices.js', array( 'jquery' ), self::$version, true ); - wp_localize_script( - 'astra-notices', - 'astraNotices', - array( - '_notice_nonce' => wp_create_nonce( 'astra-notices' ), - ) - ); - } - - /** - * Sort the notices based on the given priority of the notice. - * This function is called from usort() - * - * @since 1.5.2 - * @param array $notice_1 First notice. - * @param array $notice_2 Second Notice. - * @return array - */ - public function sort_notices( $notice_1, $notice_2 ) { - if ( ! isset( $notice_1['priority'] ) ) { - $notice_1['priority'] = 10; - } - if ( ! isset( $notice_2['priority'] ) ) { - $notice_2['priority'] = 10; - } - - return $notice_1['priority'] - $notice_2['priority']; - } - - /** - * Get all registered notices. - * Since v1.1.8 it is recommended to register the notices on - * - * @return array|null - */ - private function get_notices() { - usort( self::$notices, array( $this, 'sort_notices' ) ); - - return self::$notices; - } - - /** - * Get notice by notice_id - * - * @param string $notice_id Notice id. - * - * @return array notice based on the notice id. - */ - private function get_notice_by_id( $notice_id ) { - if ( empty( $notice_id ) ) { - return array(); - } - - $notices = $this->get_notices(); - $notice = wp_list_filter( - $notices, - array( - 'id' => $notice_id, - ) - ); - - return ! empty( $notice ) ? $notice[0] : array(); - } - - /** - * Display the notices in the WordPress admin. - * - * @since 1.0.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, - 'capability' => 'manage_options', // User capability - This capability is required for the current user to see this notice. - ); - - // Count for the notices that are rendered. - $notices_displayed = 0; - $notices = $this->get_notices(); - - foreach ( $notices as $key => $notice ) { - $notice = wp_parse_args( $notice, $defaults ); - - // Show notices only for users with `manage_options` cap. - if ( ! current_user_can( $notice['capability'] ) ) { - continue; - } - - $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; - } - } - } - - } - - /** - * Render a notice. - * - * @since 1.0.0 - * @param array $notice Notice markup. - * @return void - */ - public static function markup( $notice = array() ) { - wp_enqueue_script( 'astra-notices' ); - wp_enqueue_style( 'astra-notices' ); - - do_action( 'astra_notice_before_markup' ); - - do_action( "astra_notice_before_markup_{$notice['id']}" ); - - ?> -
-
- - -
-
- register_general_content_controls(); - $this->register_cart_typo_content_controls(); - } - - /** - * Register Menu Cart General Controls. - * - * @since 1.4.0 - * @access protected - * @return void - */ - protected function register_general_content_controls() { - - $this->start_controls_section( - 'section_general_fields', - [ - 'label' => __( 'Menu Cart', 'header-footer-elementor' ), - ] - ); - - $this->add_control( - 'hfe_cart_type', - [ - 'label' => __( 'Type', 'header-footer-elementor' ), - 'type' => Controls_Manager::SELECT, - 'default' => 'default', - 'options' => [ - 'default' => __( 'Default', 'header-footer-elementor' ), - 'custom' => __( 'Custom', 'header-footer-elementor' ), - ], - ] - ); - - $this->add_control( - 'icon', - [ - 'label' => __( 'Icon', 'header-footer-elementor' ), - 'type' => Controls_Manager::SELECT, - 'options' => [ - 'bag-light' => __( 'Bag Light', 'header-footer-elementor' ), - 'bag-medium' => __( 'Bag Medium', 'header-footer-elementor' ), - 'bag-solid' => __( 'Bag Solid', 'header-footer-elementor' ), - ], - 'default' => 'bag-light', - 'prefix_class' => 'toggle-icon--', - 'condition' => [ - 'hfe_cart_type' => 'custom', - ], - ] - ); - - $this->add_control( - 'items_indicator', - [ - 'label' => __( 'Items Count', 'header-footer-elementor' ), - 'type' => Controls_Manager::SELECT, - 'options' => [ - 'none' => __( 'None', 'header-footer-elementor' ), - 'bubble' => __( 'Bubble', 'header-footer-elementor' ), - ], - 'prefix_class' => 'hfe-menu-cart--items-indicator-', - 'default' => 'bubble', - 'condition' => [ - 'hfe_cart_type' => 'custom', - ], - ] - ); - - $this->add_control( - 'show_subtotal', - [ - 'label' => __( 'Show Total Price', 'header-footer-elementor' ), - 'type' => Controls_Manager::SWITCHER, - 'label_on' => __( 'Yes', 'header-footer-elementor' ), - 'label_off' => __( 'No', 'header-footer-elementor' ), - 'return_value' => 'yes', - 'default' => 'yes', - 'prefix_class' => 'hfe-menu-cart--show-subtotal-', - 'condition' => [ - 'hfe_cart_type' => 'custom', - ], - ] - ); - - $this->add_control( - 'hide_empty_indicator', - [ - 'label' => __( 'Hide Empty', 'header-footer-elementor' ), - 'type' => Controls_Manager::SWITCHER, - 'label_on' => __( 'Yes', 'header-footer-elementor' ), - 'label_off' => __( 'No', 'header-footer-elementor' ), - 'return_value' => 'hide', - 'prefix_class' => 'hfe-menu-cart--empty-indicator-', - 'description' => __( 'This will hide the items count until the cart is empty', 'header-footer-elementor' ), - 'condition' => [ - 'items_indicator!' => 'none', - 'hfe_cart_type' => 'custom', - ], - ] - ); - - $this->add_responsive_control( - 'align', - [ - 'label' => __( 'Alignment', 'header-footer-elementor' ), - 'type' => Controls_Manager::CHOOSE, - 'options' => [ - 'left' => [ - 'title' => __( 'Left', 'header-footer-elementor' ), - 'icon' => 'eicon-text-align-left', - ], - 'center' => [ - 'title' => __( 'Center', 'header-footer-elementor' ), - 'icon' => 'eicon-text-align-center', - ], - 'right' => [ - 'title' => __( 'Right', 'header-footer-elementor' ), - 'icon' => 'eicon-text-align-right', - ], - ], - 'frontend_available' => true, - 'prefix_class' => 'elementor%s-align-', - 'default' => '', - ] - ); - - $this->end_controls_section(); - } - - - /** - * Register Menu Cart Typography Controls. - * - * @since 1.4.0 - * @access protected - * @return void - */ - protected function register_cart_typo_content_controls() { - $this->start_controls_section( - 'section_heading_typography', - [ - 'label' => __( 'Menu Cart', 'header-footer-elementor' ), - 'tab' => Controls_Manager::TAB_STYLE, - ] - ); - - $this->add_group_control( - Group_Control_Typography::get_type(), - [ - 'name' => 'toggle_button_typography', - 'global' => [ - 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, - ], - 'selector' => '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button', - 'condition' => [ - 'hfe_cart_type' => 'custom', - ], - ] - ); - $this->add_control( - 'icon_size', - [ - 'label' => __( 'Size', 'header-footer-elementor' ), - 'type' => Controls_Manager::SLIDER, - 'range' => [ - 'px' => [ - 'min' => 15, - 'max' => 30, - ], - ], - 'selectors' => [ - '{{WRAPPER}} .hfe-masthead-custom-menu-items .hfe-site-header-cart .hfe-site-header-cart-li ' => 'font-size: {{SIZE}}{{UNIT}};', - ], - 'condition' => [ - 'hfe_cart_type' => 'default', - ], - ] - ); - $this->add_control( - 'toggle_button_border_width', - [ - 'label' => __( 'Border Width', 'header-footer-elementor' ), - 'type' => Controls_Manager::DIMENSIONS, - 'size_units' => [ 'px' ], - 'default' => [ - 'top' => '1', - 'bottom' => '1', - 'left' => '1', - 'right' => '1', - 'unit' => 'px', - ], - 'selectors' => [ - '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button,{{WRAPPER}} .hfe-cart-menu-wrap-default .hfe-cart-count:after, {{WRAPPER}} .hfe-cart-menu-wrap-default .hfe-cart-count' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', - ], - ] - ); - - $this->add_control( - 'toggle_button_border_radius', - [ - 'label' => __( 'Border Radius', 'header-footer-elementor' ), - 'type' => Controls_Manager::DIMENSIONS, - 'default' => [ - 'top' => '', - 'bottom' => '', - 'left' => '', - 'right' => '', - 'unit' => 'px', - ], - 'size_units' => [ 'px', 'em', '%' ], - 'selectors' => [ - '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button,{{WRAPPER}} .hfe-cart-menu-wrap-default .hfe-cart-count:after, {{WRAPPER}} .hfe-cart-menu-wrap-default .hfe-cart-count' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', - ], - - ] - ); - - $this->add_responsive_control( - 'toggle_button_padding', - [ - 'label' => __( 'Padding', 'header-footer-elementor' ), - 'type' => Controls_Manager::DIMENSIONS, - 'size_units' => [ 'px', 'em' ], - 'selectors' => [ - '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', - ], - 'condition' => [ - 'hfe_cart_type' => 'custom', - ], - 'frontend_available' => true, - ] - ); - - $this->start_controls_tabs( 'toggle_button_colors' ); - - $this->start_controls_tab( - 'toggle_button_normal_colors', - [ - 'label' => __( 'Normal', 'header-footer-elementor' ), - ] - ); - - $this->add_control( - 'toggle_button_text_color', - [ - 'label' => __( 'Text Color', 'header-footer-elementor' ), - 'type' => Controls_Manager::COLOR, - 'selectors' => [ - '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button,{{WRAPPER}} .hfe-cart-menu-wrap-default span.hfe-cart-count' => 'color: {{VALUE}}', - ], - ] - ); - - $this->add_control( - 'toggle_button_icon_color', - [ - 'label' => __( 'Icon Color', 'header-footer-elementor' ), - 'type' => Controls_Manager::COLOR, - 'selectors' => [ - '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button-icon' => 'color: {{VALUE}}', - ], - 'condition' => [ - 'hfe_cart_type' => 'custom', - ], - ] - ); - - $this->add_control( - 'toggle_button_background_color', - [ - 'label' => __( 'Background Color', 'header-footer-elementor' ), - 'type' => Controls_Manager::COLOR, - 'selectors' => [ - '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button,{{WRAPPER}} .hfe-cart-menu-wrap-default span.hfe-cart-count' => 'background-color: {{VALUE}}', - ], - ] - ); - - $this->add_control( - 'toggle_button_border_color', - [ - 'label' => __( 'Border Color', 'header-footer-elementor' ), - 'type' => Controls_Manager::COLOR, - 'selectors' => [ - '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button,{{WRAPPER}} .hfe-cart-menu-wrap-default .hfe-cart-count:after, {{WRAPPER}} .hfe-masthead-custom-menu-items .hfe-cart-menu-wrap-default .hfe-cart-count' => 'border-color: {{VALUE}}', - ], - ] - ); - - $this->end_controls_tab(); - - $this->start_controls_tab( - 'toggle_button_hover_colors', - [ - 'label' => __( 'Hover', 'header-footer-elementor' ), - ] - ); - - $this->add_control( - 'toggle_button_hover_text_color', - [ - 'label' => __( 'Text Color', 'header-footer-elementor' ), - 'type' => Controls_Manager::COLOR, - 'selectors' => [ - '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button:hover,{{WRAPPER}} .hfe-cart-menu-wrap-default span.hfe-cart-count:hover' => 'color: {{VALUE}}', - ], - ] - ); - - $this->add_control( - 'toggle_button_hover_icon_color', - [ - 'label' => __( 'Icon Color', 'header-footer-elementor' ), - 'type' => Controls_Manager::COLOR, - 'selectors' => [ - '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button:hover .elementor-button-icon' => 'color: {{VALUE}}', - ], - 'condition' => [ - 'hfe_cart_type' => 'custom', - ], - ] - ); - - $this->add_control( - 'toggle_button_hover_background_color', - [ - 'label' => __( 'Background Color', 'header-footer-elementor' ), - 'type' => Controls_Manager::COLOR, - 'selectors' => [ - '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button:hover,{{WRAPPER}} .hfe-cart-menu-wrap-default span.hfe-cart-count:hover' => 'background-color: {{VALUE}}', - ], - ] - ); - - $this->add_control( - 'toggle_button_hover_border_color', - [ - 'label' => __( 'Border Color', 'header-footer-elementor' ), - 'type' => Controls_Manager::COLOR, - 'selectors' => [ - '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button:hover,{{WRAPPER}} .hfe-cart-menu-wrap-default:hover .hfe-cart-count:after, {{WRAPPER}} .hfe-cart-menu-wrap-default:hover .hfe-cart-count' => 'border-color: {{VALUE}}', - ], - ] - ); - - $this->end_controls_tab(); - - $this->end_controls_tabs(); - $this->add_control( - 'toggle_icon_size', - [ - 'label' => __( 'Icon Size', 'header-footer-elementor' ), - 'type' => Controls_Manager::SLIDER, - 'range' => [ - 'px' => [ - 'min' => 0, - 'max' => 50, - ], - ], - 'size_units' => [ 'px', 'em' ], - 'selectors' => [ - '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button-icon' => 'font-size: {{SIZE}}{{UNIT}}', - ], - 'condition' => [ - 'hfe_cart_type' => 'custom', - ], - 'separator' => 'before', - ] - ); - - $this->add_control( - 'toggle_icon_spacing', - [ - 'label' => __( 'Icon Spacing', 'header-footer-elementor' ), - 'type' => Controls_Manager::SLIDER, - 'range' => [ - 'px' => [ - 'min' => 0, - 'max' => 50, - ], - ], - 'size-units' => [ 'px', 'em' ], - 'selectors' => [ - 'body:not(.rtl) {{WRAPPER}} .hfe-menu-cart__toggle .elementor-button-text' => 'margin-right: {{SIZE}}{{UNIT}}', - 'body.rtl {{WRAPPER}} .hfe-menu-cart__toggle .elementor-button-text' => 'margin-left: {{SIZE}}{{UNIT}}', - ], - 'condition' => [ - 'hfe_cart_type' => 'custom', - ], - ] - ); - - $this->end_controls_section(); - - $this->start_controls_section( - 'section_icon', - [ - 'label' => __( 'Items Count', 'header-footer-elementor' ), - 'tab' => Controls_Manager::TAB_STYLE, - 'condition' => [ - 'icon[value]!' => '', - 'items_indicator!' => 'none', - 'hfe_cart_type' => 'custom', - ], - ] - ); - - $this->add_control( - 'items_indicator_distance', - [ - 'label' => __( 'Distance', 'header-footer-elementor' ), - 'type' => Controls_Manager::SLIDER, - 'default' => [ - 'unit' => 'em', - ], - 'range' => [ - 'em' => [ - 'min' => 0, - 'max' => 4, - 'step' => 0.1, - ], - ], - 'selectors' => [ - '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button-icon[data-counter]:before' => 'right: -{{SIZE}}{{UNIT}}; top: -{{SIZE}}{{UNIT}}', - ], - 'condition' => [ - 'items_indicator' => 'bubble', - ], - ] - ); - - $this->start_controls_tabs( 'count_colors' ); - - $this->start_controls_tab( - 'count_normal_colors', - [ - 'label' => __( 'Normal', 'header-footer-elementor' ), - ] - ); - - $this->add_control( - 'items_indicator_text_color', - [ - 'label' => __( 'Text Color', 'header-footer-elementor' ), - 'type' => Controls_Manager::COLOR, - 'selectors' => [ - '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button-icon[data-counter]:before' => 'color: {{VALUE}}', - ], - 'condition' => [ - 'items_indicator!' => 'none', - ], - ] - ); - - $this->add_control( - 'items_indicator_background_color', - [ - 'label' => __( 'Background Color', 'header-footer-elementor' ), - 'type' => Controls_Manager::COLOR, - 'selectors' => [ - '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button-icon[data-counter]:before' => 'background-color: {{VALUE}}', - ], - 'condition' => [ - 'items_indicator' => 'bubble', - ], - ] - ); - - $this->end_controls_tab(); - - $this->start_controls_tab( - 'count_hover_colors', - [ - 'label' => __( 'Hover', 'header-footer-elementor' ), - ] - ); - - $this->add_control( - 'items_indicator_text_hover_color', - [ - 'label' => __( 'Text Color', 'header-footer-elementor' ), - 'type' => Controls_Manager::COLOR, - 'selectors' => [ - '{{WRAPPER}} .hfe-menu-cart__toggle:hover .elementor-button-icon[data-counter]:before' => 'color: {{VALUE}}', - ], - 'condition' => [ - 'items_indicator!' => 'none', - ], - ] - ); - - $this->add_control( - 'items_indicator_background_hover_color', - [ - 'label' => __( 'Background Color', 'header-footer-elementor' ), - 'type' => Controls_Manager::COLOR, - 'selectors' => [ - '{{WRAPPER}} .hfe-menu-cart__toggle:hover .elementor-button-icon[data-counter]:before' => 'background-color: {{VALUE}}', - ], - 'condition' => [ - 'items_indicator' => 'bubble', - ], - ] - ); - - $this->end_controls_tab(); - - $this->end_controls_tabs(); - - $this->end_controls_section(); - } - - /** - * Render Menu Cart output on the frontend. - * - * Written in PHP and used to generate the final HTML. - * - * @since 1.4.0 - * @access protected - * @return void - */ - protected function render() { - - if ( null === WC()->cart ) { - return; - } - - $settings = $this->get_settings_for_display(); - $cart_type = $settings['hfe_cart_type']; - - ?> - - - register_general_content_controls(); + $this->register_cart_typo_content_controls(); + } + + /** + * Register Menu Cart General Controls. + * + * @since 1.4.0 + * + * @access protected + */ + protected function register_general_content_controls(): void + { + $this->start_controls_section( + 'section_general_fields', + [ + 'label' => __('Menu Cart', 'header-footer-elementor'), + ] + ); + + $this->add_control( + 'hfe_cart_type', + [ + 'label' => __('Type', 'header-footer-elementor'), + 'type' => Controls_Manager::SELECT, + 'default' => 'default', + 'options' => [ + 'default' => __('Default', 'header-footer-elementor'), + 'custom' => __('Custom', 'header-footer-elementor'), + ], + ] + ); + + $this->add_control( + 'icon', + [ + 'label' => __('Icon', 'header-footer-elementor'), + 'type' => Controls_Manager::SELECT, + 'options' => [ + 'bag-light' => __('Bag Light', 'header-footer-elementor'), + 'bag-medium' => __('Bag Medium', 'header-footer-elementor'), + 'bag-solid' => __('Bag Solid', 'header-footer-elementor'), + ], + 'default' => 'bag-light', + 'prefix_class' => 'toggle-icon--', + 'condition' => [ + 'hfe_cart_type' => 'custom', + ], + ] + ); + + $this->add_control( + 'items_indicator', + [ + 'label' => __('Items Count', 'header-footer-elementor'), + 'type' => Controls_Manager::SELECT, + 'options' => [ + 'none' => __('None', 'header-footer-elementor'), + 'bubble' => __('Bubble', 'header-footer-elementor'), + ], + 'prefix_class' => 'hfe-menu-cart--items-indicator-', + 'default' => 'bubble', + 'condition' => [ + 'hfe_cart_type' => 'custom', + ], + ] + ); + + $this->add_control( + 'show_subtotal', + [ + 'label' => __('Show Total Price', 'header-footer-elementor'), + 'type' => Controls_Manager::SWITCHER, + 'label_on' => __('Yes', 'header-footer-elementor'), + 'label_off' => __('No', 'header-footer-elementor'), + 'return_value' => 'yes', + 'default' => 'yes', + 'prefix_class' => 'hfe-menu-cart--show-subtotal-', + 'condition' => [ + 'hfe_cart_type' => 'custom', + ], + ] + ); + + $this->add_control( + 'hide_empty_indicator', + [ + 'label' => __('Hide Empty', 'header-footer-elementor'), + 'type' => Controls_Manager::SWITCHER, + 'label_on' => __('Yes', 'header-footer-elementor'), + 'label_off' => __('No', 'header-footer-elementor'), + 'return_value' => 'hide', + 'prefix_class' => 'hfe-menu-cart--empty-indicator-', + 'description' => __('This will hide the items count until the cart is empty', 'header-footer-elementor'), + 'condition' => [ + 'items_indicator!' => 'none', + 'hfe_cart_type' => 'custom', + ], + ] + ); + + $this->add_responsive_control( + 'align', + [ + 'label' => __('Alignment', 'header-footer-elementor'), + 'type' => Controls_Manager::CHOOSE, + 'options' => [ + 'left' => [ + 'title' => __('Left', 'header-footer-elementor'), + 'icon' => 'eicon-text-align-left', + ], + 'center' => [ + 'title' => __('Center', 'header-footer-elementor'), + 'icon' => 'eicon-text-align-center', + ], + 'right' => [ + 'title' => __('Right', 'header-footer-elementor'), + 'icon' => 'eicon-text-align-right', + ], + ], + 'frontend_available' => true, + 'prefix_class' => 'elementor%s-align-', + 'default' => '', + ] + ); + + $this->end_controls_section(); + } + + /** + * Register Menu Cart Typography Controls. + * + * @since 1.4.0 + * + * @access protected + */ + protected function register_cart_typo_content_controls(): void + { + $this->start_controls_section( + 'section_heading_typography', + [ + 'label' => __('Menu Cart', 'header-footer-elementor'), + 'tab' => Controls_Manager::TAB_STYLE, + ] + ); + + $this->add_group_control( + Group_Control_Typography::get_type(), + [ + 'name' => 'toggle_button_typography', + 'global' => [ + 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, + ], + 'selector' => '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button', + 'condition' => [ + 'hfe_cart_type' => 'custom', + ], + ] + ); + $this->add_control( + 'icon_size', + [ + 'label' => __('Size', 'header-footer-elementor'), + 'type' => Controls_Manager::SLIDER, + 'range' => [ + 'px' => [ + 'min' => 15, + 'max' => 30, + ], + ], + 'selectors' => [ + '{{WRAPPER}} .hfe-masthead-custom-menu-items .hfe-site-header-cart .hfe-site-header-cart-li ' => 'font-size: {{SIZE}}{{UNIT}};', + ], + 'condition' => [ + 'hfe_cart_type' => 'default', + ], + ] + ); + $this->add_control( + 'toggle_button_border_width', + [ + 'label' => __('Border Width', 'header-footer-elementor'), + 'type' => Controls_Manager::DIMENSIONS, + 'size_units' => [ 'px' ], + 'default' => [ + 'top' => '1', + 'bottom' => '1', + 'left' => '1', + 'right' => '1', + 'unit' => 'px', + ], + 'selectors' => [ + '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button,{{WRAPPER}} .hfe-cart-menu-wrap-default .hfe-cart-count:after, {{WRAPPER}} .hfe-cart-menu-wrap-default .hfe-cart-count' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', + ], + ] + ); + + $this->add_control( + 'toggle_button_border_radius', + [ + 'label' => __('Border Radius', 'header-footer-elementor'), + 'type' => Controls_Manager::DIMENSIONS, + 'default' => [ + 'top' => '', + 'bottom' => '', + 'left' => '', + 'right' => '', + 'unit' => 'px', + ], + 'size_units' => [ 'px', 'em', '%' ], + 'selectors' => [ + '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button,{{WRAPPER}} .hfe-cart-menu-wrap-default .hfe-cart-count:after, {{WRAPPER}} .hfe-cart-menu-wrap-default .hfe-cart-count' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', + ], + + ] + ); + + $this->add_responsive_control( + 'toggle_button_padding', + [ + 'label' => __('Padding', 'header-footer-elementor'), + 'type' => Controls_Manager::DIMENSIONS, + 'size_units' => [ 'px', 'em' ], + 'selectors' => [ + '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', + ], + 'condition' => [ + 'hfe_cart_type' => 'custom', + ], + 'frontend_available' => true, + ] + ); + + $this->start_controls_tabs('toggle_button_colors'); + + $this->start_controls_tab( + 'toggle_button_normal_colors', + [ + 'label' => __('Normal', 'header-footer-elementor'), + ] + ); + + $this->add_control( + 'toggle_button_text_color', + [ + 'label' => __('Text Color', 'header-footer-elementor'), + 'type' => Controls_Manager::COLOR, + 'selectors' => [ + '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button,{{WRAPPER}} .hfe-cart-menu-wrap-default span.hfe-cart-count' => 'color: {{VALUE}}', + ], + ] + ); + + $this->add_control( + 'toggle_button_icon_color', + [ + 'label' => __('Icon Color', 'header-footer-elementor'), + 'type' => Controls_Manager::COLOR, + 'selectors' => [ + '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button-icon' => 'color: {{VALUE}}', + ], + 'condition' => [ + 'hfe_cart_type' => 'custom', + ], + ] + ); + + $this->add_control( + 'toggle_button_background_color', + [ + 'label' => __('Background Color', 'header-footer-elementor'), + 'type' => Controls_Manager::COLOR, + 'selectors' => [ + '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button,{{WRAPPER}} .hfe-cart-menu-wrap-default span.hfe-cart-count' => 'background-color: {{VALUE}}', + ], + ] + ); + + $this->add_control( + 'toggle_button_border_color', + [ + 'label' => __('Border Color', 'header-footer-elementor'), + 'type' => Controls_Manager::COLOR, + 'selectors' => [ + '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button,{{WRAPPER}} .hfe-cart-menu-wrap-default .hfe-cart-count:after, {{WRAPPER}} .hfe-masthead-custom-menu-items .hfe-cart-menu-wrap-default .hfe-cart-count' => 'border-color: {{VALUE}}', + ], + ] + ); + + $this->end_controls_tab(); + + $this->start_controls_tab( + 'toggle_button_hover_colors', + [ + 'label' => __('Hover', 'header-footer-elementor'), + ] + ); + + $this->add_control( + 'toggle_button_hover_text_color', + [ + 'label' => __('Text Color', 'header-footer-elementor'), + 'type' => Controls_Manager::COLOR, + 'selectors' => [ + '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button:hover,{{WRAPPER}} .hfe-cart-menu-wrap-default span.hfe-cart-count:hover' => 'color: {{VALUE}}', + ], + ] + ); + + $this->add_control( + 'toggle_button_hover_icon_color', + [ + 'label' => __('Icon Color', 'header-footer-elementor'), + 'type' => Controls_Manager::COLOR, + 'selectors' => [ + '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button:hover .elementor-button-icon' => 'color: {{VALUE}}', + ], + 'condition' => [ + 'hfe_cart_type' => 'custom', + ], + ] + ); + + $this->add_control( + 'toggle_button_hover_background_color', + [ + 'label' => __('Background Color', 'header-footer-elementor'), + 'type' => Controls_Manager::COLOR, + 'selectors' => [ + '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button:hover,{{WRAPPER}} .hfe-cart-menu-wrap-default span.hfe-cart-count:hover' => 'background-color: {{VALUE}}', + ], + ] + ); + + $this->add_control( + 'toggle_button_hover_border_color', + [ + 'label' => __('Border Color', 'header-footer-elementor'), + 'type' => Controls_Manager::COLOR, + 'selectors' => [ + '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button:hover,{{WRAPPER}} .hfe-cart-menu-wrap-default:hover .hfe-cart-count:after, {{WRAPPER}} .hfe-cart-menu-wrap-default:hover .hfe-cart-count' => 'border-color: {{VALUE}}', + ], + ] + ); + + $this->end_controls_tab(); + + $this->end_controls_tabs(); + $this->add_control( + 'toggle_icon_size', + [ + 'label' => __('Icon Size', 'header-footer-elementor'), + 'type' => Controls_Manager::SLIDER, + 'range' => [ + 'px' => [ + 'min' => 0, + 'max' => 50, + ], + ], + 'size_units' => [ 'px', 'em' ], + 'selectors' => [ + '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button-icon' => 'font-size: {{SIZE}}{{UNIT}}', + ], + 'condition' => [ + 'hfe_cart_type' => 'custom', + ], + 'separator' => 'before', + ] + ); + + $this->add_control( + 'toggle_icon_spacing', + [ + 'label' => __('Icon Spacing', 'header-footer-elementor'), + 'type' => Controls_Manager::SLIDER, + 'range' => [ + 'px' => [ + 'min' => 0, + 'max' => 50, + ], + ], + 'size-units' => [ 'px', 'em' ], + 'selectors' => [ + 'body:not(.rtl) {{WRAPPER}} .hfe-menu-cart__toggle .elementor-button-text' => 'margin-right: {{SIZE}}{{UNIT}}', + 'body.rtl {{WRAPPER}} .hfe-menu-cart__toggle .elementor-button-text' => 'margin-left: {{SIZE}}{{UNIT}}', + ], + 'condition' => [ + 'hfe_cart_type' => 'custom', + ], + ] + ); + + $this->end_controls_section(); + + $this->start_controls_section( + 'section_icon', + [ + 'label' => __('Items Count', 'header-footer-elementor'), + 'tab' => Controls_Manager::TAB_STYLE, + 'condition' => [ + 'icon[value]!' => '', + 'items_indicator!' => 'none', + 'hfe_cart_type' => 'custom', + ], + ] + ); + + $this->add_control( + 'items_indicator_distance', + [ + 'label' => __('Distance', 'header-footer-elementor'), + 'type' => Controls_Manager::SLIDER, + 'default' => [ + 'unit' => 'em', + ], + 'range' => [ + 'em' => [ + 'min' => 0, + 'max' => 4, + 'step' => 0.1, + ], + ], + 'selectors' => [ + '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button-icon[data-counter]:before' => 'right: -{{SIZE}}{{UNIT}}; top: -{{SIZE}}{{UNIT}}', + ], + 'condition' => [ + 'items_indicator' => 'bubble', + ], + ] + ); + + $this->start_controls_tabs('count_colors'); + + $this->start_controls_tab( + 'count_normal_colors', + [ + 'label' => __('Normal', 'header-footer-elementor'), + ] + ); + + $this->add_control( + 'items_indicator_text_color', + [ + 'label' => __('Text Color', 'header-footer-elementor'), + 'type' => Controls_Manager::COLOR, + 'selectors' => [ + '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button-icon[data-counter]:before' => 'color: {{VALUE}}', + ], + 'condition' => [ + 'items_indicator!' => 'none', + ], + ] + ); + + $this->add_control( + 'items_indicator_background_color', + [ + 'label' => __('Background Color', 'header-footer-elementor'), + 'type' => Controls_Manager::COLOR, + 'selectors' => [ + '{{WRAPPER}} .hfe-menu-cart__toggle .elementor-button-icon[data-counter]:before' => 'background-color: {{VALUE}}', + ], + 'condition' => [ + 'items_indicator' => 'bubble', + ], + ] + ); + + $this->end_controls_tab(); + + $this->start_controls_tab( + 'count_hover_colors', + [ + 'label' => __('Hover', 'header-footer-elementor'), + ] + ); + + $this->add_control( + 'items_indicator_text_hover_color', + [ + 'label' => __('Text Color', 'header-footer-elementor'), + 'type' => Controls_Manager::COLOR, + 'selectors' => [ + '{{WRAPPER}} .hfe-menu-cart__toggle:hover .elementor-button-icon[data-counter]:before' => 'color: {{VALUE}}', + ], + 'condition' => [ + 'items_indicator!' => 'none', + ], + ] + ); + + $this->add_control( + 'items_indicator_background_hover_color', + [ + 'label' => __('Background Color', 'header-footer-elementor'), + 'type' => Controls_Manager::COLOR, + 'selectors' => [ + '{{WRAPPER}} .hfe-menu-cart__toggle:hover .elementor-button-icon[data-counter]:before' => 'background-color: {{VALUE}}', + ], + 'condition' => [ + 'items_indicator' => 'bubble', + ], + ] + ); + + $this->end_controls_tab(); + + $this->end_controls_tabs(); + + $this->end_controls_section(); + } + + /** + * Render Menu Cart output on the frontend. + * + * Written in PHP and used to generate the final HTML. + * + * @since 1.4.0 + * + * @access protected + */ + protected function render(): void + { + if (WC()->cart === null) { + return; + } + + $settings = $this->get_settings_for_display(); + $cart_type = $settings['hfe_cart_type']; + + ?> + + + register_content_copy_right_controls(); - } - /** - * Register Copyright General Controls. - * - * @since 1.2.0 - * @access protected - * @return void - */ - protected function register_content_copy_right_controls() { - $this->start_controls_section( - 'section_title', - [ - 'label' => __( 'Copyright', 'header-footer-elementor' ), - ] - ); - - $this->add_control( - 'shortcode', - [ - 'label' => __( 'Copyright Text', 'header-footer-elementor' ), - 'type' => Controls_Manager::TEXTAREA, - 'dynamic' => [ - 'active' => true, - ], - 'default' => __( 'Copyright © [hfe_current_year] [hfe_site_title] | Powered by [hfe_site_title]', 'header-footer-elementor' ), - ] - ); - - $this->add_control( - 'link', - [ - 'label' => __( 'Link', 'header-footer-elementor' ), - 'type' => Controls_Manager::URL, - 'placeholder' => __( 'https://your-link.com', 'header-footer-elementor' ), - ] - ); - - $this->add_responsive_control( - 'align', - [ - 'label' => __( 'Alignment', 'header-footer-elementor' ), - 'type' => Controls_Manager::CHOOSE, - 'options' => [ - 'left' => [ - 'title' => __( 'Left', 'header-footer-elementor' ), - 'icon' => 'fa fa-align-left', - ], - 'center' => [ - 'title' => __( 'Center', 'header-footer-elementor' ), - 'icon' => 'fa fa-align-center', - ], - 'right' => [ - 'title' => __( 'Right', 'header-footer-elementor' ), - 'icon' => 'fa fa-align-right', - ], - ], - 'selectors' => [ - '{{WRAPPER}} .hfe-copyright-wrapper' => 'text-align: {{VALUE}};', - ], - 'frontend_available' => true, - ] - ); - - $this->add_control( - 'title_color', - [ - 'label' => __( 'Text Color', 'header-footer-elementor' ), - 'type' => Controls_Manager::COLOR, - 'global' => [ - 'default' => Global_Colors::COLOR_TEXT, - ], - 'selectors' => [ - // Stronger selector to avoid section style from overwriting. - '{{WRAPPER}} .hfe-copyright-wrapper a, {{WRAPPER}} .hfe-copyright-wrapper' => 'color: {{VALUE}};', - ], - ] - ); - - $this->add_group_control( - Group_Control_Typography::get_type(), - [ - 'name' => 'caption_typography', - 'selector' => '{{WRAPPER}} .hfe-copyright-wrapper, {{WRAPPER}} .hfe-copyright-wrapper a', - 'global' => [ - 'default' => Global_Typography::TYPOGRAPHY_TEXT, - ], - ] - ); - } - - /** - * Render Copyright output on the frontend. - * - * Written in PHP and used to generate the final HTML. - * - * @since 1.2.0 - * @access protected - * @return void - */ - protected function render() { - $settings = $this->get_settings_for_display(); - $link = isset( $settings['link']['url'] ) ? $settings['link']['url'] : ''; - - if ( ! empty( $link ) ) { - $this->add_link_attributes( 'link', $settings['link'] ); - } - - $copy_right_shortcode = do_shortcode( shortcode_unautop( $settings['shortcode'] ) ); ?> - - get_settings( 'shortcode' ) ); - } - - /** - * Render shortcode widget output in the editor. - * - * Written as a Backbone JavaScript template and used to generate the live preview. - * - * @since 1.3.0 - * @access protected - * @return void - */ - protected function content_template() {} +class Copyright extends Widget_Base +{ + /** + * Retrieve the widget name. + * + * @since 1.2.0 + * + * @access public + * + * @return string Widget name. + */ + public function get_name(): string + { + return 'copyright'; + } + /** + * Retrieve the widget title. + * + * @since 1.2.0 + * + * @access public + * + * @return string Widget title. + */ + public function get_title(): string + { + return __('Copyright', 'header-footer-elementor'); + } + /** + * Retrieve the widget icon. + * + * @since 1.2.0 + * + * @access public + * + * @return string Widget icon. + */ + public function get_icon(): string + { + return 'hfe-icon-copyright-widget'; + } + /** + * Retrieve the list of categories the widget belongs to. + * + * Used to determine where to display the widget in the editor. + * + * Note that currently Elementor supports only one category. + * When multiple categories passed, Elementor uses the first one. + * + * @since 1.2.0 + * + * @access public + * + * @return array Widget categories. + */ + public function get_categories(): array + { + return [ 'hfe-widgets' ]; + } + + /** + * Render shortcode widget as plain content. + * + * Override the default behavior by printing the shortcode instead of rendering it. + * + * @since 1.2.0 + * + * @access public + */ + public function render_plain_content(): void + { + // In plain mode, render without shortcode. + echo esc_attr($this->get_settings('shortcode')); + } + + /** + * Indicates if the widget's content is dynamic. + * + * This method returns true if the widget's output is dynamic and should not be cached, + * or false if the content is static and can be cached. + * + * @since 1.6.41 + * + * @return bool True for dynamic content, false for static content. + */ + protected function is_dynamic_content(): bool // phpcs:ignore + {return false; + } + + /** + * Register Copyright controls. + * + * @since 1.5.7 + * + * @access protected + */ + protected function register_controls(): void + { + $this->register_content_copy_right_controls(); + } + /** + * Register Copyright General Controls. + * + * @since 1.2.0 + * + * @access protected + */ + protected function register_content_copy_right_controls(): void + { + $this->start_controls_section( + 'section_title', + [ + 'label' => __('Copyright', 'header-footer-elementor'), + ] + ); + + $this->add_control( + 'shortcode', + [ + 'label' => __('Copyright Text', 'header-footer-elementor'), + 'type' => Controls_Manager::TEXTAREA, + 'dynamic' => [ + 'active' => true, + ], + 'default' => __('Copyright © [hfe_current_year] [hfe_site_title] | Powered by [hfe_site_title]', 'header-footer-elementor'), + ] + ); + + $this->add_control( + 'link', + [ + 'label' => __('Link', 'header-footer-elementor'), + 'type' => Controls_Manager::URL, + 'placeholder' => __('https://your-link.com', 'header-footer-elementor'), + ] + ); + + $this->add_responsive_control( + 'align', + [ + 'label' => __('Alignment', 'header-footer-elementor'), + 'type' => Controls_Manager::CHOOSE, + 'options' => [ + 'left' => [ + 'title' => __('Left', 'header-footer-elementor'), + 'icon' => 'fa fa-align-left', + ], + 'center' => [ + 'title' => __('Center', 'header-footer-elementor'), + 'icon' => 'fa fa-align-center', + ], + 'right' => [ + 'title' => __('Right', 'header-footer-elementor'), + 'icon' => 'fa fa-align-right', + ], + ], + 'selectors' => [ + '{{WRAPPER}} .hfe-copyright-wrapper' => 'text-align: {{VALUE}};', + ], + 'frontend_available' => true, + ] + ); + + $this->add_control( + 'title_color', + [ + 'label' => __('Text Color', 'header-footer-elementor'), + 'type' => Controls_Manager::COLOR, + 'global' => [ + 'default' => Global_Colors::COLOR_TEXT, + ], + 'selectors' => [ + // Stronger selector to avoid section style from overwriting. + '{{WRAPPER}} .hfe-copyright-wrapper a, {{WRAPPER}} .hfe-copyright-wrapper' => 'color: {{VALUE}};', + ], + ] + ); + + $this->add_group_control( + Group_Control_Typography::get_type(), + [ + 'name' => 'caption_typography', + 'selector' => '{{WRAPPER}} .hfe-copyright-wrapper, {{WRAPPER}} .hfe-copyright-wrapper a', + 'global' => [ + 'default' => Global_Typography::TYPOGRAPHY_TEXT, + ], + ] + ); + } + + /** + * Render Copyright output on the frontend. + * + * Written in PHP and used to generate the final HTML. + * + * @since 1.2.0 + * + * @access protected + */ + protected function render(): void + { + $settings = $this->get_settings_for_display(); + $link = $settings['link']['url'] ?? ''; + + if (! empty($link)) { + $this->add_link_attributes('link', $settings['link']); + } + + $copy_right_shortcode = do_shortcode(shortcode_unautop($settings['shortcode'])); ?> + + classes ) ? [] : (array) $item->classes; - $submenu = $args->has_children ? ' hfe-has-submenu' : ''; - - if ( 0 === $depth ) { - array_push( $classes, 'parent' ); - } - $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args, $depth ) ); - $class_names = ' class="' . esc_attr( $class_names ) . $submenu . ' hfe-creative-menu"'; - $value = apply_filters( 'nav_menu_li_values', $value ); - - $output .= $indent . '
'; - } - } + if (! did_action('wp_body_open')) { + echo '
'; + do_action('hfe_fallback_header'); + echo '
'; + } + } } new Global_Theme_Compatibility(); diff --git a/themes/default/class-hfe-default-compat.php b/themes/default/class-hfe-default-compat.php index 242e3a310..36e9d2095 100644 --- a/themes/default/class-hfe-default-compat.php +++ b/themes/default/class-hfe-default-compat.php @@ -1,4 +1,7 @@ - - + + diff --git a/themes/default/hfe-header.php b/themes/default/hfe-header.php index d2bc82940..95630a602 100644 --- a/themes/default/hfe-header.php +++ b/themes/default/hfe-header.php @@ -1,23 +1,27 @@ > - - - - - + + + + + > - +
- + diff --git a/themes/generatepress/class-hfe-generatepress-compat.php b/themes/generatepress/class-hfe-generatepress-compat.php index 6ecdcb4b2..e0b6def2d 100644 --- a/themes/generatepress/class-hfe-generatepress-compat.php +++ b/themes/generatepress/class-hfe-generatepress-compat.php @@ -1,4 +1,7 @@ '
', - 'xhtml' => '
', - 'xhtml' => '
', - ] - ); - } - - /** - * Open markup for footer. - * - * @return void - */ - public function genesis_footer_markup_open() { - genesis_markup( - [ - 'html5' => '
', - 'xhtml' => '
', - 'xhtml' => '', - ] - ); - } +class HFE_Genesis_Compat +{ + /** + * Instance of HFE_Genesis_Compat. + */ + private static HFE_Genesis_Compat $instance; + + /** + * Initiator + */ + public static function instance(): HFE_Genesis_Compat + { + if (! isset(self::$instance)) { + self::$instance = new HFE_Genesis_Compat(); + + add_action('wp', [ self::$instance, 'hooks' ]); + } + + return self::$instance; + } + + /** + * Run all the Actions / Filters. + */ + public function hooks(): void + { + if (hfe_header_enabled()) { + add_action('template_redirect', [ $this, 'genesis_setup_header' ]); + add_action('genesis_header', [ $this, 'genesis_header_markup_open' ], 16); + add_action('genesis_header', [ $this, 'genesis_header_markup_close' ], 25); + add_action('genesis_header', [ 'Header_Footer_Elementor', 'get_header_content' ], 16); + } + + if (hfe_is_before_footer_enabled()) { + add_action('genesis_footer', [ 'Header_Footer_Elementor', 'get_before_footer_content' ], 16); + } + + if (hfe_footer_enabled()) { + add_action('template_redirect', [ $this, 'genesis_setup_footer' ]); + add_action('genesis_footer', [ $this, 'genesis_footer_markup_open' ], 16); + add_action('genesis_footer', [ $this, 'genesis_footer_markup_close' ], 25); + add_action('genesis_footer', [ 'Header_Footer_Elementor', 'get_footer_content' ], 16); + } + } + + /** + * Disable header from the theme. + */ + public function genesis_setup_header(): void + { + for ($priority = 0; $priority < 16; $priority++) { + remove_all_actions('genesis_header', $priority); + } + } + + /** + * Disable footer from the theme. + */ + public function genesis_setup_footer(): void + { + for ($priority = 0; $priority < 16; $priority++) { + remove_all_actions('genesis_footer', $priority); + } + } + + /** + * Open markup for header. + */ + public function genesis_header_markup_open(): void + { + genesis_markup( + [ + 'html5' => '
', + 'xhtml' => '
', + 'xhtml' => '', + ] + ); + } + + /** + * Open markup for footer. + */ + public function genesis_footer_markup_open(): void + { + genesis_markup( + [ + 'html5' => '
', + 'xhtml' => '
', + 'xhtml' => '', + ] + ); + } } HFE_Genesis_Compat::instance(); diff --git a/themes/hello-elementor/class-hfe-hello-elementor-compat.php b/themes/hello-elementor/class-hfe-hello-elementor-compat.php index 9343db20c..3dad38834 100644 --- a/themes/hello-elementor/class-hfe-hello-elementor-compat.php +++ b/themes/hello-elementor/class-hfe-hello-elementor-compat.php @@ -1,4 +1,7 @@