Changeset 318838
- Timestamp:
- 03/20/2026 01:12:30 PM (7 months ago)
- Location:
- food-restro-zone/0.1.6
- Files:
-
- 9 edited
- 1 copied
-
. (copied) (copied from food-restro-zone/0.1.5 )
-
assets/js/theme-importer.js (modified) (1 diff)
-
footer.php (modified) (1 diff)
-
functions.php (modified) (11 diffs)
-
inc/template-tags.php (modified) (1 diff)
-
inc/theme-installation/assets/js/theme-installation.js (modified) (2 diffs)
-
inc/theme-installation/theme-installation.php (modified) (2 diffs)
-
index.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
style.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
food-restro-zone/0.1.6/assets/js/theme-importer.js
r294053 r318838 66 66 }); 67 67 } catch (err) { 68 console.log('Installation failed for:', plugin.slug, err);68 // Installation failed, continue to activation attempt 69 69 } 70 70 } -
food-restro-zone/0.1.6/footer.php
r290267 r318838 106 106 <?php } ?> 107 107 <?php if(get_theme_mod('food_restro_zone_scroll_hide',true)){ ?> 108 <a id="button"><?php esc_html_e('TOP','food-restro-zone'); ?></a>108 <a href="#" id="button"><?php esc_html_e('TOP','food-restro-zone'); ?></a> 109 109 <?php } ?> 110 110 </div> -
food-restro-zone/0.1.6/functions.php
r309561 r318838 106 106 function tm_install_and_activate_plugin() { 107 107 108 $post_plugin_details = $_POST['plugin_details']; 109 $plugin_text_domain = $post_plugin_details['plugin_text_domain']; 110 $plugin_main_file = $post_plugin_details['plugin_main_file']; 111 $plugin_url = $post_plugin_details['plugin_url']; 108 if ( ! isset( $_POST['_ajax_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['_ajax_nonce'] ) ), 'theme_importer_nonce' ) ) { 109 wp_send_json_error( 'Invalid nonce.' ); 110 wp_die(); 111 } 112 113 if ( ! current_user_can( 'install_plugins' ) ) { 114 wp_send_json_error( 'Insufficient permissions.' ); 115 wp_die(); 116 } 117 118 $post_plugin_details = isset( $_POST['plugin_details'] ) ? $_POST['plugin_details'] : array(); 119 $plugin_text_domain = isset( $post_plugin_details['plugin_text_domain'] ) ? sanitize_text_field( wp_unslash( $post_plugin_details['plugin_text_domain'] ) ) : ''; 120 $plugin_main_file = isset( $post_plugin_details['plugin_main_file'] ) ? sanitize_text_field( wp_unslash( $post_plugin_details['plugin_main_file'] ) ) : ''; 121 $plugin_url = isset( $post_plugin_details['plugin_url'] ) ? esc_url_raw( wp_unslash( $post_plugin_details['plugin_url'] ) ) : ''; 112 122 113 123 $plugin = array( … … 124 134 $activate_plugin = activate_plugin( $plugin_path ); 125 135 126 if($activate_plugin) { 127 128 echo $activate_plugin; 129 130 } else { 131 echo $activate_plugin; 136 // activate_plugin() returns WP_Error on failure, null on success 137 if ( is_wp_error( $activate_plugin ) ) { 138 wp_send_json_error( $activate_plugin->get_error_message() ); 139 wp_die(); 132 140 } 133 141 … … 140 148 141 149 function tm_check_plugin_exists() { 142 $plugin_text_domain = $_POST['plugin_text_domain']; 143 $main_plugin_file = $_POST['main_plugin_file']; 150 if ( ! isset( $_POST['_ajax_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['_ajax_nonce'] ) ), 'theme_importer_nonce' ) ) { 151 wp_send_json_error( 'Invalid nonce.' ); 152 wp_die(); 153 } 154 if ( ! current_user_can( 'install_plugins' ) ) { 155 wp_send_json_error( 'Insufficient permissions.' ); 156 wp_die(); 157 } 158 $plugin_text_domain = isset( $_POST['plugin_text_domain'] ) ? sanitize_text_field( wp_unslash( $_POST['plugin_text_domain'] ) ) : ''; 159 $main_plugin_file = isset( $_POST['main_plugin_file'] ) ? sanitize_text_field( wp_unslash( $_POST['main_plugin_file'] ) ) : ''; 144 160 $plugin_path = $plugin_text_domain . '/' . $main_plugin_file; 145 161 … … 589 605 //Admin Notice For Getstart 590 606 function food_restro_zone_ajax_notice_handler() { 607 if (!wp_verify_nonce($_POST['wpnonce'], 'food_restro_zone_dismissed_notice_nonce')) { 608 exit; 609 } 591 610 if ( isset( $_POST['type'] ) ) { 592 611 $type = sanitize_text_field( wp_unslash( $_POST['type'] ) ); 593 612 update_option( 'dismissed-' . $type, TRUE ); 594 613 } 595 } 614 wp_die(); 615 } 616 add_action( 'wp_ajax_food_restro_zone_dismissed_notice_handler', 'food_restro_zone_ajax_notice_handler' ); 596 617 597 618 function food_restro_zone_deprecated_hook_admin_notice() { … … 613 634 </div> 614 635 <div class="tm-admin-content" style="padding-left: 30px; align-self: center"> 615 <h2 style="font-weight: 600;line-height: 1.3; margin: 0px;"><?php esc_html_e('Thank You For Choosing ', 'food-restro-zone'); ?><?php echo wp_get_theme(); ?><h2>616 <p style="color: #3c434a; font-weight: 400; margin-bottom: 30px;"><?php _e('Get Started With Theme By Clicking On Getting Started.', 'food-restro-zone'); ?><p>636 <h2 style="font-weight: 600;line-height: 1.3; margin: 0px;"><?php esc_html_e('Thank You For Choosing ', 'food-restro-zone'); ?><?php echo esc_html( wp_get_theme() ); ?></h2> 637 <p style="color: #3c434a; font-weight: 400; margin-bottom: 30px;"><?php esc_html_e('Get Started With Theme By Clicking On Getting Started.', 'food-restro-zone'); ?></p> 617 638 <a class="admin-notice-btn button button-primary button-hero" href="<?php echo esc_url( admin_url( 'themes.php?page=food-restro-zone-info' )); ?>"><?php esc_html_e( 'Get started', 'food-restro-zone' ) ?></a> 618 639 <a class="admin-notice-btn button button-primary button-hero notice-pro-btn" target="_blank" href="<?php echo esc_url( FOOD_RESTRO_ZONE_GET_PREMIUM_PRO ); ?>"><?php esc_html_e( 'Get Premium ', 'food-restro-zone' ) ?></a> … … 634 655 add_action('after_switch_theme', 'food_restro_zone_switch_theme'); 635 656 function food_restro_zone_dismissable_notice() { 657 check_ajax_referer( 'food_restro_zone_dismissed_notice_nonce', 'wpnonce' ); 636 658 update_user_meta(get_current_user_id(), 'food_restro_zone_dismissable_notice', true); 637 die();659 wp_die(); 638 660 } 639 661 … … 646 668 647 669 // Add the AJAX action to trigger theme mods import 648 add_action('wp_ajax_import_theme_mods', ' demo_importer_ajax_handler');670 add_action('wp_ajax_import_theme_mods', 'food_restro_zone_demo_importer_ajax_handler'); 649 671 650 672 // Handle the AJAX request 651 function demo_importer_ajax_handler() { 673 function food_restro_zone_demo_importer_ajax_handler() { 674 675 check_ajax_referer( 'theme_importer_nonce' ); 676 677 if ( ! current_user_can( 'edit_theme_options' ) ) { 678 wp_send_json_error( 'Permission denied.' ); 679 return; 680 } 681 652 682 // Sample data to import 653 683 $theme_mods_data = array( … … 659 689 660 690 // Call the function to import theme mods 661 if ( demo_theme_importer($theme_mods_data)) {691 if (food_restro_zone_demo_theme_importer($theme_mods_data)) { 662 692 // After importing theme mods, create the menu 663 create_demo_menu();693 food_restro_zone_create_demo_menu(); 664 694 wp_send_json_success(array( 665 695 'msg' => 'Theme mods imported successfully.', … … 674 704 675 705 // Function to set theme mods 676 function demo_theme_importer($import_data) {706 function food_restro_zone_demo_theme_importer($import_data) { 677 707 if (is_array($import_data)) { 678 708 foreach ($import_data as $mod_name => $mod_value) { … … 686 716 687 717 // Function to create demo menu 688 function create_demo_menu() {718 function food_restro_zone_create_demo_menu() { 689 719 690 720 // Page import process … … 738 768 use (&$create_page_and_menu, &$created_pages, $menu_id) { 739 769 740 $page = get_page_by_title($item['title']); 770 $pages = get_posts( array( 'post_type' => 'page', 'title' => $item['title'], 'post_status' => 'all', 'numberposts' => 1 ) ); 771 $page = ! empty( $pages ) ? $pages[0] : null; 741 772 742 773 if (!$page) { -
food-restro-zone/0.1.6/inc/template-tags.php
r275291 r318838 153 153 <div class="media-body-wrap card"> 154 154 <div class="card-header"> 155 <h5 class="mt-0"><?php /* translators: %s: author */ printf( '<cite class="fn">%s</cite>', esc_url( get_comment_author_link()) ); ?></h5>155 <h5 class="mt-0"><?php /* translators: %s: author */ printf( '<cite class="fn">%s</cite>', get_comment_author_link() ); ?></h5> 156 156 <div class="comment-meta"> 157 157 <a href="<?php echo esc_url(get_comment_link($comment->comment_ID)); ?>"> 158 158 <time datetime="<?php comment_time('c'); ?>"> 159 <?php /* translators: %s: Date */ printf( esc_ attr('%1$s at %2$s', '1: date, 2: time', 'food-restro-zone'), esc_attr( get_comment_date() ), esc_attr( get_comment_time() ) ); ?>159 <?php /* translators: %s: Date */ printf( esc_html__( '%1$s at %2$s', 'food-restro-zone' ), esc_html( get_comment_date() ), esc_html( get_comment_time() ) ); ?> 160 160 </time> 161 161 </a> -
food-restro-zone/0.1.6/inc/theme-installation/assets/js/theme-installation.js
r298973 r318838 19 19 action: 'tm_theme_info_update_recommend_action', 20 20 id: id, 21 todo: action 21 todo: action, 22 _ajax_nonce: tm_theme_info_box_object.recommend_action_nonce 22 23 }, 23 24 dataType : "html", … … 32 33 }, 33 34 error : function (jqXHR, textStatus, errorThrown) { 34 console.log(jqXHR + " :: " + textStatus + " :: " + errorThrown);35 // Handle error silently 35 36 } 36 37 }); -
food-restro-zone/0.1.6/inc/theme-installation/theme-installation.php
r298973 r318838 55 55 public function food_restro_zone_update_recommended_action_callback() { 56 56 57 check_ajax_referer( 'tm_recommend_action_nonce' ); 58 59 if ( ! current_user_can( 'edit_theme_options' ) ) { 60 wp_send_json_error( 'Permission denied.' ); 61 return; 62 } 63 57 64 /*getting for provided array*/ 58 65 $recommended_actions = isset( $this->config['recommended_actions'] ) ? $this->config['recommended_actions'] : array(); 59 66 60 67 /*from js action*/ 61 $action_id = esc_attr( ( isset( $_GET['id'] ) ) ? $_GET['id'] : 0 );62 $todo = esc_attr( ( isset( $_GET['todo'] ) ) ? $_GET['todo'] : '' );68 $action_id = isset( $_GET['id'] ) ? sanitize_key( wp_unslash( $_GET['id'] ) ) : ''; 69 $todo = isset( $_GET['todo'] ) ? sanitize_key( wp_unslash( $_GET['todo'] ) ) : ''; 63 70 64 71 /*getting saved actions*/ … … 804 811 $count = $this->food_restro_zone_count_recommended_actions(); 805 812 wp_localize_script( 'food-restro-zone-theme-installation-js', 'tm_theme_info_box_object', array( 806 ' nr_actions_recommended' => $count,813 'count_actions_recommended' => $count, 807 814 'ajaxurl' => admin_url( 'admin-ajax.php' ), 808 815 'template_directory' => get_template_directory_uri(), 809 'nonce' => wp_create_nonce('free_mnssp_create_pagination_nonce_action') 816 'nonce' => wp_create_nonce('free_mnssp_create_pagination_nonce_action'), 817 'recommend_action_nonce' => wp_create_nonce('tm_recommend_action_nonce') 810 818 ) ); 811 819 -
food-restro-zone/0.1.6/index.php
r298973 r318838 27 27 <div class="row"> 28 28 <?php 29 get_template_part( 'template-parts/patterns'); 29 get_template_part( 'template-parts/patterns'); ?> 30 </div> 30 31 31 } else {32 <?php } else { 32 33 33 34 get_template_part('template-parts/content', 'none'); 34 35 35 36 } ?> 36 </div>37 37 38 38 </main> -
food-restro-zone/0.1.6/readme.txt
r309561 r318838 4 4 Tested up to: 6.9 5 5 Requires PHP: 7.2 6 Stable tag: 0.1. 56 Stable tag: 0.1.6 7 7 License: GNU General Public License v3.0 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 107 107 108 108 == Changelog == 109 110 = 0.1.6 = 111 112 * Fixed malformed HTML closing tags in admin notice (h2, p). 113 * Fixed missing output escaping: replaced echo wp_get_theme() with esc_html(), _e() with esc_html_e(). 114 * Fixed security: added check_ajax_referer() and current_user_can() to tm_install_and_activate_plugin(), tm_check_plugin_exists(), food_restro_zone_demo_importer_ajax_handler() AJAX handlers. 115 * Fixed security: added nonce verification to food_restro_zone_dismissable_notice() and food_restro_zone_ajax_notice_handler(). 116 * Fixed security: added nonce verification and capability check to food_restro_zone_update_recommended_action_callback() in theme-installation.php. 117 * Fixed sanitization of $_POST inputs in AJAX handlers using sanitize_key(), sanitize_file_name(), wp_unslash(). 118 * Fixed incorrect esc_attr() usage with multiple arguments in comment date/time display in template-tags.php. 119 * Fixed esc_url() incorrectly applied to get_comment_author_link() HTML output in template-tags.php. 120 * Fixed orphaned </div> in index.php when no posts are found. 121 * Fixed scroll-to-top anchor missing href attribute in footer.php. 122 * Fixed deprecated get_page_by_title() replaced with WP_Query via get_posts() per WordPress 6.2 handbook. 123 * Fixed key name mismatch: nr_actions_recommended -> count_actions_recommended in theme-installation localize script. 124 * Replaced console.log() calls in theme-installation.js and theme-importer.js with silent error handling. 125 * Added nonce to recommend-action AJAX call in theme-installation.js. 126 * Replaced die() with wp_die() in AJAX handler functions. 109 127 110 128 = 0.1.5 -
food-restro-zone/0.1.6/style.css
r309561 r318838 6 6 Author URI: https://www.themagnifico.net/ 7 7 Description: The Food Restro Zone Theme is a stylish, modern, and visually captivating lite theme designed specifically for food and beverage businesses like food restaurants, cafes, bistros, diners, takeaway joints, eateries, and also juice bars, tea houses, ice cream parlors, bakeries, and dessert cafés, making it ideal for a variety of culinary businesses. Whether you run a fine dining establishment, casual dining spot, fast food outlet, easter catering, themed party catering, destination event catering, cultural event dining, family reunion catering, social event catering, engagement party catering, bridal shower catering, baby shower catering, rooftop lounge, themed diner, or a gourmet kitchen, this theme offers the ideal digital platform to showcase your culinary brand online. Built with clean code and a mobile-responsive layout, it caters perfectly to family eateries, vegan cafés, burger houses, pizza places, food courts, and food trucks. With built-in customization tools and an intuitive structure, the theme allows restaurant owners to efficiently manage digital food menus, promote chef specials, announce happy hour deals, and enable table reservations, takeaway orders, or food delivery services. Its visual design includes elegant homepage sliders, high-resolution food image galleries, menu display sections, and interactive blocks for customer reviews, daily specials, lunch combos, and dinner menus. The theme is perfect for showcasing seasonal dishes, tasting menus, romantic dinner events, or promotional offers in an engaging way. It supports core features like online table booking, browse-by-category food items, reservation forms, order tracking, and contactless delivery information—integrating seamlessly with plugins like RestaurantPress for optimized menu management. Whether you’re operating a cozy corner café or a bustling downtown restaurant, the Food Restro Zone Theme helps you create a compelling, search-friendly online presence that attracts food lovers, increases reservations, and enhances your culinary brand’s visibility across major search engines. 8 Version: 0.1. 58 Version: 0.1.6 9 9 Requires at least: 5.0 10 10 Tested up to: 6.9
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)