Plugin Directory

Changeset 3399229


Ignore:
Timestamp:
11/19/2025 06:56:45 PM (4 months ago)
Author:
Rustaurius
Message:

v2.4.22 released and tagged

Location:
food-and-drink-menu
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • food-and-drink-menu/tags/2.4.22/assets/js/fdm-ordering-js.js

    r3284409 r3399229  
    22
    33jQuery(document).ready(function() {
     4
     5    jQuery( '.fdm-options-add-to-cart-button' ).attr( 'tabindex', '0' );
    46
    57    jQuery( '.cart-location-bottom #fdm-ordering-contact-details, .cart-location-bottom #fdm-order-payment-toggle, .cart-location-bottom #fdm-order-submit, .cart-location-bottom #fdm-order-payment-form-div' ).addClass ( 'fdm-hidden' );
  • food-and-drink-menu/tags/2.4.22/assets/js/fdm-sidebar-js.js

    r3005208 r3399229  
    11jQuery(document).ready(function(){
     2
     3    jQuery('.fdm-menu-sidebar-section-title').attr('tabindex', '0');
    24    jQuery('.fdm-menu-sidebar-section-title:first-of-type').addClass('fdm-menu-sidebar-section-title-selected');
    35    jQuery('.fdm-menu-sidebar-section-description:nth-of-type(2)').removeClass('fdm-hidden');
  • food-and-drink-menu/tags/2.4.22/food-and-drink-menu.php

    r3366776 r3399229  
    44 * Plugin URI: https://www.fivestarplugins.com/plugins/five-star-restaurant-menu/
    55 * Description: Restaurant menu and food ordering system that is easy to set up and integrates with any theme. Includes restaurant menu blocks and patterns.
    6  * Version: 2.4.21
     6 * Version: 2.4.22
    77 * Requires at least: 6.0
    88 * Author: Five Star Plugins
     
    4444        define( 'FDM_UPGRADE_URL', 'https://www.fivestarplugins.com/license-payment/?Selected=FDM&Quantity=1' );
    4545        define( 'FDM_TEMPLATE_DIR', 'fdm-templates' );
    46         define( 'FDM_VERSION', '2.4.21' );
     46        define( 'FDM_VERSION', '2.4.22' );
    4747        define( 'FDM_MENU_POST_TYPE', 'fdm-menu' );
    4848        define( 'FDM_MENUITEM_POST_TYPE', 'fdm-menu-item' );
  • food-and-drink-menu/tags/2.4.22/readme.txt

    r3366776 r3399229  
    55Requires at Least: 6.0
    66Tested Up To: 6.8
    7 Stable tag: 2.4.21
     7Stable tag: 2.4.22
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    302302== Changelog ==
    303303
     304= 2.4.22 (2025-11-19) =
     305- Added tabindex to sidebar section titles and add to cart buttons.
     306- Fixes for a number of menu schema notices.
     307
    304308= 2.4.21 (2025-09-23) =
    305309- Updated admin notice capabilities.
  • food-and-drink-menu/tags/2.4.22/views/View.Menu.class.php

    r3064857 r3399229  
    275275            '@context'          => 'https://schema.org',
    276276            '@type'             => 'Menu',
    277             'name'              => $this->title,
     277            'name'              => $this->post->post_title,
    278278            'hasMenuSection'    => array()
    279279        );
     
    288288                    '@type'         => 'MenuSection',
    289289                    'name'          => $section->title,
    290                     'description'   => $section->description,
    291                     'image'         => ! empty( $section->image_url ) ? $section->image_url : '',
     290                    'description'   => $this->clean_schema_description( $section->description ),
    292291                    'hasMenuItem'   => array(),
    293292                );
     293
     294                if ( ! empty( $section->image_url ) ) {
     295
     296                    $menu_section_schema['image'] = $section->image_url;
     297                }
    294298   
    295299                foreach ( $section->items as $item ) {
     
    298302                        '@type'             => 'MenuItem',
    299303                        'name'              => $item->title,
    300                         'image'             => ! empty( $item->image ) ? $item->image : '',
    301                         'description'       => $item->content,
     304                        'description'       => $this->clean_schema_description( $item->content ),
    302305                        'offers'            => array()
    303306                    );
     307
     308                    if ( ! empty( $item->image ) ) {
     309
     310                        $menu_item_schema['image'] = $item->image;
     311                    }
    304312   
    305313                    foreach ( $item->prices as $price ) {
    306314   
    307315                        $menu_item_schema['offers'][] = array(
    308                             '@type'             => 'offer',
    309                             'price'             => $price,
     316                            '@type'             => 'Offer',
     317                            'price'             => preg_replace('/[^0-9.,]/', '', $price),
    310318                            'priceCurrency'     => $fdm_controller->settings->get_setting( 'ordering-currency' )
    311319                        );
     
    320328
    321329        $fdm_controller->schema_menu_data[] = $menu_schema;
     330    }
     331
     332    private function clean_schema_description( $content ) {
     333
     334        if ( empty( $content ) ) {
     335            return '';
     336        }
     337   
     338        // 1. Remove HTML & WP comments
     339        $content = preg_replace( '/<!--.*?-->/s', '', $content );
     340   
     341        // 2. Remove <script> and <style> blocks entirely
     342        $content = preg_replace( '/<script\b[^>]*>(.*?)<\/script>/is', '', $content );
     343        $content = preg_replace( '/<style\b[^>]*>(.*?)<\/style>/is', '', $content );
     344   
     345        // 3. Remove shortcodes (optional — enable if needed)
     346        if ( function_exists( 'strip_shortcodes' ) ) {
     347            $content = strip_shortcodes( $content );
     348        }
     349   
     350        // 4. Remove remaining HTML tags
     351        $content = strip_tags( $content );
     352   
     353        // 5. Decode HTML entities (e.g. &amp; → &, &nbsp; → space)
     354        $content = html_entity_decode( $content, ENT_QUOTES, 'UTF-8' );
     355   
     356        // 6. Normalize whitespace
     357        $content = preg_replace( '/\s+/', ' ', trim( $content ) );
     358   
     359        return $content;
    322360    }
    323361
  • food-and-drink-menu/trunk/assets/js/fdm-ordering-js.js

    r3284409 r3399229  
    22
    33jQuery(document).ready(function() {
     4
     5    jQuery( '.fdm-options-add-to-cart-button' ).attr( 'tabindex', '0' );
    46
    57    jQuery( '.cart-location-bottom #fdm-ordering-contact-details, .cart-location-bottom #fdm-order-payment-toggle, .cart-location-bottom #fdm-order-submit, .cart-location-bottom #fdm-order-payment-form-div' ).addClass ( 'fdm-hidden' );
  • food-and-drink-menu/trunk/assets/js/fdm-sidebar-js.js

    r3005208 r3399229  
    11jQuery(document).ready(function(){
     2
     3    jQuery('.fdm-menu-sidebar-section-title').attr('tabindex', '0');
    24    jQuery('.fdm-menu-sidebar-section-title:first-of-type').addClass('fdm-menu-sidebar-section-title-selected');
    35    jQuery('.fdm-menu-sidebar-section-description:nth-of-type(2)').removeClass('fdm-hidden');
  • food-and-drink-menu/trunk/food-and-drink-menu.php

    r3366776 r3399229  
    44 * Plugin URI: https://www.fivestarplugins.com/plugins/five-star-restaurant-menu/
    55 * Description: Restaurant menu and food ordering system that is easy to set up and integrates with any theme. Includes restaurant menu blocks and patterns.
    6  * Version: 2.4.21
     6 * Version: 2.4.22
    77 * Requires at least: 6.0
    88 * Author: Five Star Plugins
     
    4444        define( 'FDM_UPGRADE_URL', 'https://www.fivestarplugins.com/license-payment/?Selected=FDM&Quantity=1' );
    4545        define( 'FDM_TEMPLATE_DIR', 'fdm-templates' );
    46         define( 'FDM_VERSION', '2.4.21' );
     46        define( 'FDM_VERSION', '2.4.22' );
    4747        define( 'FDM_MENU_POST_TYPE', 'fdm-menu' );
    4848        define( 'FDM_MENUITEM_POST_TYPE', 'fdm-menu-item' );
  • food-and-drink-menu/trunk/readme.txt

    r3366776 r3399229  
    55Requires at Least: 6.0
    66Tested Up To: 6.8
    7 Stable tag: 2.4.21
     7Stable tag: 2.4.22
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    302302== Changelog ==
    303303
     304= 2.4.22 (2025-11-19) =
     305- Added tabindex to sidebar section titles and add to cart buttons.
     306- Fixes for a number of menu schema notices.
     307
    304308= 2.4.21 (2025-09-23) =
    305309- Updated admin notice capabilities.
  • food-and-drink-menu/trunk/views/View.Menu.class.php

    r3064857 r3399229  
    275275            '@context'          => 'https://schema.org',
    276276            '@type'             => 'Menu',
    277             'name'              => $this->title,
     277            'name'              => $this->post->post_title,
    278278            'hasMenuSection'    => array()
    279279        );
     
    288288                    '@type'         => 'MenuSection',
    289289                    'name'          => $section->title,
    290                     'description'   => $section->description,
    291                     'image'         => ! empty( $section->image_url ) ? $section->image_url : '',
     290                    'description'   => $this->clean_schema_description( $section->description ),
    292291                    'hasMenuItem'   => array(),
    293292                );
     293
     294                if ( ! empty( $section->image_url ) ) {
     295
     296                    $menu_section_schema['image'] = $section->image_url;
     297                }
    294298   
    295299                foreach ( $section->items as $item ) {
     
    298302                        '@type'             => 'MenuItem',
    299303                        'name'              => $item->title,
    300                         'image'             => ! empty( $item->image ) ? $item->image : '',
    301                         'description'       => $item->content,
     304                        'description'       => $this->clean_schema_description( $item->content ),
    302305                        'offers'            => array()
    303306                    );
     307
     308                    if ( ! empty( $item->image ) ) {
     309
     310                        $menu_item_schema['image'] = $item->image;
     311                    }
    304312   
    305313                    foreach ( $item->prices as $price ) {
    306314   
    307315                        $menu_item_schema['offers'][] = array(
    308                             '@type'             => 'offer',
    309                             'price'             => $price,
     316                            '@type'             => 'Offer',
     317                            'price'             => preg_replace('/[^0-9.,]/', '', $price),
    310318                            'priceCurrency'     => $fdm_controller->settings->get_setting( 'ordering-currency' )
    311319                        );
     
    320328
    321329        $fdm_controller->schema_menu_data[] = $menu_schema;
     330    }
     331
     332    private function clean_schema_description( $content ) {
     333
     334        if ( empty( $content ) ) {
     335            return '';
     336        }
     337   
     338        // 1. Remove HTML & WP comments
     339        $content = preg_replace( '/<!--.*?-->/s', '', $content );
     340   
     341        // 2. Remove <script> and <style> blocks entirely
     342        $content = preg_replace( '/<script\b[^>]*>(.*?)<\/script>/is', '', $content );
     343        $content = preg_replace( '/<style\b[^>]*>(.*?)<\/style>/is', '', $content );
     344   
     345        // 3. Remove shortcodes (optional — enable if needed)
     346        if ( function_exists( 'strip_shortcodes' ) ) {
     347            $content = strip_shortcodes( $content );
     348        }
     349   
     350        // 4. Remove remaining HTML tags
     351        $content = strip_tags( $content );
     352   
     353        // 5. Decode HTML entities (e.g. &amp; → &, &nbsp; → space)
     354        $content = html_entity_decode( $content, ENT_QUOTES, 'UTF-8' );
     355   
     356        // 6. Normalize whitespace
     357        $content = preg_replace( '/\s+/', ' ', trim( $content ) );
     358   
     359        return $content;
    322360    }
    323361
Note: See TracChangeset for help on using the changeset viewer.