Plugin Directory

Changeset 3357524


Ignore:
Timestamp:
09/07/2025 08:46:11 PM (7 months ago)
Author:
braintum
Message:

Preparing for 1.7.2 release

Location:
ultimate-faq-solution/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • ultimate-faq-solution/trunk/inc/Assets.php

    r3322838 r3357524  
    5454     */
    5555    public function render_resources_frontend() {
    56 
    57         if ( $this->is_faq_present() ) {
    58             wp_register_style( 'ufaqsw_fa_css', UFAQSW__PLUGIN_URL . 'assets/css/font-awesome.min.css', array(), UFAQSW_VERSION, 'all' );
    59             wp_register_style( 'ufaqsw_styles_css', UFAQSW__PLUGIN_URL . 'assets/css/styles.min.css', array(), UFAQSW_VERSION, 'all' );
    60 
    61             wp_enqueue_style( 'ufaqsw_fa_css' );
    62             wp_enqueue_style( 'ufaqsw_styles_css' );
    63         }
     56        wp_register_style( 'ufaqsw_fa_css', UFAQSW__PLUGIN_URL . 'assets/css/font-awesome.min.css', array(), UFAQSW_VERSION, 'all' );
     57        wp_register_style( 'ufaqsw_styles_css', UFAQSW__PLUGIN_URL . 'assets/css/styles.min.css', array(), UFAQSW_VERSION, 'all' );
     58        wp_enqueue_style( 'ufaqsw_styles_css' );
    6459
    6560        // jQuery for fronend.
    6661        wp_enqueue_script( 'jquery', 'jquery', array(), UFAQSW_VERSION, true );
    6762        wp_register_script( 'ufaqsw-quicksearch-front-js', UFAQSW__PLUGIN_URL . 'assets/js/jquery.quicksearch.js', array( 'jquery' ), UFAQSW_VERSION, true );
    68 
    69     }
    70 
    71     /**
    72      * Checks if the FAQ shortcode or block is present in the content.
    73      *
    74      * This function checks if the FAQ shortcode or block is used in the current post content.
    75      * If either is found, it returns true, indicating that the FAQ assets should be enqueued.
    76      *
    77      * @return bool True if FAQ shortcode or block is present, false otherwise.
    78      */
    79     private function is_faq_present() {
    80 
    81         // Check if FAQ shortcode is present or FAQ block is used.
    82         global $post;
    83 
    84         $enqueue = false;
    85 
    86         if ( is_a( $post, 'WP_Post' ) ) {
    87             // Check for shortcode in post content.
    88             if ( has_shortcode( $post->post_content, 'ufaqsw-all' ) ) {
    89                 $enqueue = true;
    90             }
    91 
    92             if ( has_shortcode( $post->post_content, 'ufaqsw' ) ) {
    93                 $enqueue = true;
    94             }
    95         }
    96 
    97         // Check for FAQ block in the content (for block editor).
    98         if ( ! $enqueue && function_exists( 'has_block' ) && is_a( $post, 'WP_Post' ) ) {
    99 
    100             if ( has_block( 'ultimate-faq-solution/block', $post ) ) {
    101                 $enqueue = true;
    102             }
    103         }
    104 
    105         // Check if WooCommerce is active and the FAQ tab is enabled for products.
    106         if ( ufaqsw_is_woocommerce_active() && is_product() ) {
    107 
    108             // Check if FAQ is present in WooCommerce product pages.
    109             $is_enable = get_post_meta( $post->ID, '_ufaqsw_enable_faq_tab', true );
    110 
    111             // Global option.
    112             if ( get_option( 'ufaqsw_enable_global_faq' ) === 'on' ) {
    113                 $enqueue = true;
    114             }
    115 
    116             // Product specific.
    117             if ( 'yes' === $is_enable ) {
    118                 $enqueue = true;
    119             }
    120         }
    121 
    122         // Check if FAQ is present in widgets.
    123         if ( ! $enqueue && $this->is_faq_present_in_widgets() ) {
    124             $enqueue = true;
    125         }
    126 
    127         /**
    128          * Filter to allow overriding whether FAQ assets should be enqueued.
    129          *
    130          * @param bool $enqueue Whether to enqueue FAQ assets.
    131          * @param WP_Post|null $post The current post object.
    132          */
    133         return apply_filters( 'ufaqsw_should_enqueue_styles', $enqueue, $post );
    134     }
    135 
    136     /**
    137      * Checks if FAQ shortcodes or blocks are present in widgets.
    138      *
    139      * @return bool True if FAQ is used in any widget, false otherwise.
    140      */
    141     private function is_faq_present_in_widgets() {
    142         $faq_used = false;
    143 
    144         $sidebars_widgets = wp_get_sidebars_widgets();
    145 
    146         foreach ( $sidebars_widgets as $sidebar_id => $widget_ids ) {
    147             if ( is_array( $widget_ids ) ) {
    148                 foreach ( $widget_ids as $widget_id ) {
    149                     $widget_instance = get_option( 'widget_' . _get_widget_id_base( $widget_id ) );
    150 
    151                     if ( is_array( $widget_instance ) ) {
    152                         foreach ( $widget_instance as $instance ) {
    153                             if ( isset( $instance['content'] ) ) {
    154                                 $content = $instance['content'];
    155 
    156                                 // Check for FAQ shortcode.
    157                                 if ( has_shortcode( $content, 'ufaqsw-all' ) || has_shortcode( $content, 'ufaqsw' ) ) {
    158                                     $faq_used = true;
    159                                 }
    160 
    161                                 // Check for FAQ block.
    162                                 if ( strpos( $content, 'wp:ultimate-faq-solution/block' ) !== false ) {
    163                                     $faq_used = true;
    164                                 }
    165                             }
    166                         }
    167                     }
    168                 }
    169             }
    170         }
    171 
    172         return $faq_used;
    17363    }
    17464
  • ultimate-faq-solution/trunk/inc/Shortcodes.php

    r3338582 r3357524  
    7676     */
    7777    private function enqueue_assets() {
     78        wp_enqueue_style( 'ufaqsw_fa_css' );
    7879        wp_enqueue_script( 'ufaqsw-quicksearch-front-js' );
    7980        wp_enqueue_script( self::$js_handler, UFAQSW__PLUGIN_URL . 'assets/js/script.min.js', array( 'jquery', 'ufaqsw-quicksearch-front-js' ), UFAQSW_VERSION, false );
     
    134135                        $faqs,
    135136                        function ( $faq, $index ) use ( $exclude_items ) {
    136                             // Adjust index to start from 1 instead of 0
     137                            // Adjust index to start from 1 instead of 0.
    137138                            $one_based_index = $index + 1;
    138139                            return ! in_array( (string) $one_based_index, $exclude_items, true );
     
    163164                } else {
    164165                    // translators: %s is the name of the template that was not found.
    165                     echo sprintf( esc_html__( '%s Template Not Found', 'ufaqsw' ), esc_html( $template ) );
     166                    printf( esc_html__( '%s Template Not Found', 'ufaqsw' ), esc_html( $template ) );
    166167                }
    167168            }
     
    171172        $content = ob_get_clean();
    172173        return $content;
    173 
    174174    }
    175175
     
    247247                } else {
    248248                    // translators: %s is the name of the template that was not found.
    249                     echo sprintf( esc_html__( '%s Template Not Found', 'ufaqsw' ), esc_html( ucfirst( $template ) ) );
     249                    printf( esc_html__( '%s Template Not Found', 'ufaqsw' ), esc_html( ucfirst( $template ) ) );
    250250                }
    251251
     
    265265        } else {
    266266            // translators: %s is the name of the template that was not found.
    267             echo sprintf( esc_html__( '%s Template Not Found', 'ufaqsw' ), esc_html( ucfirst( $template ) ) );
     267            printf( esc_html__( '%s Template Not Found', 'ufaqsw' ), esc_html( ucfirst( $template ) ) );
    268268        }
    269269        $content = ob_get_clean();
    270270
    271271        return str_replace( '{{content}}', $all_content, $content );
    272 
    273272    }
    274273}
  • ultimate-faq-solution/trunk/inc/languages/ultimate-faq-solution.pot

    r3355614 r3357524  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Ultimate FAQ Solution 1.7.1\n"
     5"Project-Id-Version: Ultimate FAQ Solution 1.7.2\n"
    66"Report-Msgid-Bugs-To: "
    77"https://wordpress.org/support/plugin/ultimate-faq-solution\n"
    8 "POT-Creation-Date: 2025-09-03 18:29:45+00:00\n"
     8"POT-Creation-Date: 2025-09-07 20:40:13+00:00\n"
    99"MIME-Version: 1.0\n"
    1010"Content-Type: text/plain; charset=utf-8\n"
     
    150150msgstr ""
    151151
    152 #: inc/Shortcodes.php:165 inc/Shortcodes.php:249 inc/Shortcodes.php:267
     152#: inc/Shortcodes.php:166 inc/Shortcodes.php:249 inc/Shortcodes.php:267
    153153#. translators: %s is the name of the template that was not found.
    154154msgid "%s Template Not Found"
  • ultimate-faq-solution/trunk/init.php

    r3355614 r3357524  
    1010 *
    1111 * Plugin Name: Ultimate FAQ Solution
    12  * Version: 1.7.1
     12 * Version: 1.7.2
    1313 * Plugin URI: https://www.braintum.com/ultimate-faq-solution/
    1414 * Description: A WordPress plugin to create, organize, and display FAQs with responsive layouts and styles.
     
    3434* Use `plugin_dir_path` and `plugin_dir_url` only when necessary to reduce overhead.
    3535*/
    36 define( 'UFAQSW_VERSION', '1.7.1' );
     36define( 'UFAQSW_VERSION', '1.7.2' );
    3737define( 'UFAQSW_PRFX', 'ufaqsw' );
    3838define( 'UFAQSW_BASE', plugin_basename( __FILE__ ) );
     
    9696register_activation_hook( __FILE__, array( 'UFAQSW_installation', 'plugin_activation' ) );
    9797register_deactivation_hook( __FILE__, array( 'UFAQSW_installation', 'plugin_deactivation' ) );
    98 
  • ultimate-faq-solution/trunk/readme.txt

    r3355614 r3357524  
    55Requires at least: 5.1 
    66Tested up to: 6.8.2 
    7 Stable tag: 1.7.1
     7Stable tag: 1.7.2
    88Requires PHP: 7.4.0 
    99License: GPLv2 or later 
     
    135135
    136136== Changelog ==
     137
     138=1.7.2=
     139* Improved compatibility: Shortcodes now work when inserted dynamically via ACF fields, popular page builders, and widgets.
     140
    137141=1.7.1=
    138142* Fixed: Page information incorrectly populating inside the FAQ Assistant area.
  • ultimate-faq-solution/trunk/vendor/composer/installed.php

    r3355614 r3357524  
    44        'pretty_version' => 'dev-main',
    55        'version' => 'dev-main',
    6         'reference' => '67bdcb706f0b37ab316a4aac9c1a3d89e1ea3364',
     6        'reference' => 'aa5fd8a6a190a9aba02a8ff6ad7f48f9752b228c',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    2323            'pretty_version' => 'dev-main',
    2424            'version' => 'dev-main',
    25             'reference' => '67bdcb706f0b37ab316a4aac9c1a3d89e1ea3364',
     25            'reference' => 'aa5fd8a6a190a9aba02a8ff6ad7f48f9752b228c',
    2626            'type' => 'wordpress-plugin',
    2727            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.