Make WordPress Themes

Changeset 318990


Ignore:
Timestamp:
03/21/2026 01:45:14 PM (7 months ago)
Author:
themedropbox
Message:

New version of Modular Kitchen - 1.6

Location:
modular-kitchen/1.6
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • modular-kitchen/1.6/assets/js/theme-importer.js

    r308198 r318990  
    5252          });
    5353        } catch (err) {
    54           console.log('Installation failed for:', plugin.slug, err);
     54          // Installation failed, continue to activation attempt
    5555        }
    5656      }
  • modular-kitchen/1.6/footer.php

    r304688 r318990  
    128128                        <?php }?>
    129129                        <?php if(get_theme_mod('modular_kitchen_scroll_hide',true)){ ?>
    130                         <a id="button"><?php esc_html_e('TOP','modular-kitchen'); ?></a>
     130                        <a href="#" id="button"><?php esc_html_e('TOP','modular-kitchen'); ?></a>
    131131                    <?php }?>
    132132                </footer>
  • modular-kitchen/1.6/functions.php

    r308198 r318990  
    108108
    109109function tm_install_and_activate_plugin() {
     110        check_ajax_referer( 'theme_importer_nonce' );
     111        if ( ! current_user_can( 'install_plugins' ) ) {
     112                wp_send_json_error( 'Permission denied.' );
     113                return;
     114        }
    110115
    111116        $post_plugin_details = $_POST['plugin_details'];
    … …  
    143148
    144149function tm_check_plugin_exists() {
     150        check_ajax_referer( 'theme_importer_nonce' );
     151        if ( ! current_user_can( 'install_plugins' ) ) {
     152                wp_send_json_error( 'Permission denied.' );
     153                return;
     154        }
    145155                $plugin_text_domain = $_POST['plugin_text_domain'];
    146156                $main_plugin_file       = $_POST['main_plugin_file'];
    … …  
    602612//Admin Notice For Getstart
    603613function modular_kitchen_ajax_notice_handler() {
     614    check_ajax_referer( 'modular_kitchen_dismissed_notice_nonce', 'wpnonce' );
    604615    if ( isset( $_POST['type'] ) ) {
    605616        $type = sanitize_text_field( wp_unslash( $_POST['type'] ) );
    606617        update_option( 'dismissed-' . $type, TRUE );
    607618    }
    608 }
     619    wp_die();
     620}
     621add_action( 'wp_ajax_modular_kitchen_ajax_notice_handler', 'modular_kitchen_ajax_notice_handler' );
    609622
    610623function modular_kitchen_deprecated_hook_admin_notice() {
    … …  
    617630                </div>
    618631                <div class="tm-admin-content" style="padding-left: 30px; align-self: center">
    619                         <h2 style="font-weight: 600;line-height: 1.3; margin: 0px;"><?php esc_html_e('Thank You For Choosing ', 'modular-kitchen'); ?><?php echo wp_get_theme(); ?><h2>
    620                         <p style="color: #3c434a; font-weight: 400; margin-bottom: 30px;"><?php _e('Get Started With Theme By Clicking On Getting Started.', 'modular-kitchen'); ?><p>
     632                        <h2 style="font-weight: 600;line-height: 1.3; margin: 0px;"><?php esc_html_e('Thank You For Choosing ', 'modular-kitchen'); ?><?php echo esc_html( wp_get_theme() ); ?></h2>
     633                        <p style="color: #3c434a; font-weight: 400; margin-bottom: 30px;"><?php esc_html_e('Get Started With Theme By Clicking On Getting Started.', 'modular-kitchen'); ?></p>
    621634                        <a class="admin-notice-btn button button-primary button-hero" href="<?php echo esc_url( admin_url( 'themes.php?page=modular-kitchen-info' )); ?>"><?php esc_html_e( 'Get started', 'modular-kitchen' ) ?></a>
    622635                        <a class="admin-notice-btn button button-primary button-hero notice-pro-btn" target="_blank" href="<?php echo esc_url( MODULAR_KITCHEN_GET_PREMIUM_PRO ); ?>"><?php esc_html_e( 'Get Premium ', 'modular-kitchen' ) ?></a>
    … …  
    638651add_action('after_switch_theme', 'modular_kitchen_switch_theme');
    639652function modular_kitchen_dismissable_notice() {
     653    check_ajax_referer( 'modular_kitchen_dismissed_notice_nonce', 'wpnonce' );
    640654    update_user_meta(get_current_user_id(), 'modular_kitchen_dismissable_notice', true);
    641     die();
     655    wp_die();
    642656}
    643657
    … …  
    655669// Handle the AJAX request
    656670function modular_kitchen_demo_importer_ajax_handler() {
     671    check_ajax_referer( 'theme_importer_nonce' );
     672    if ( ! current_user_can( 'edit_theme_options' ) ) {
     673        wp_send_json_error( 'Permission denied.' );
     674        return;
     675    }
    657676    // Sample data to import
    658677    $theme_mods_data = array(
    … …  
    739758        use (&$create_page_and_menu, &$created_pages, $menu_id) {
    740759
    741         $page = get_page_by_title($item['title']);
     760        $pages = get_posts( array(
     761            'title'          => $item['title'],
     762            'post_type'      => 'page',
     763            'post_status'    => 'any',
     764            'posts_per_page' => 1,
     765            'orderby'        => 'post_date',
     766            'order'          => 'ASC',
     767        ) );
     768        $page = ! empty( $pages ) ? $pages[0] : null;
    742769
    743770        if (!$page) {
  • modular-kitchen/1.6/inc/template-tags.php

    r196564 r318990  
    153153                    <div class="media-body-wrap card">
    154154                        <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>
    156156                            <div class="comment-meta">
    157157                                <a href="<?php echo esc_url(get_comment_link($comment->comment_ID)); ?>">
    158158                                    <time datetime="<?php comment_time('c'); ?>">
    159                                         <?php /* translators: %s: Date */ printf( esc_attr('%1$s at %2$s', '1: date, 2: time', 'modular-kitchen'), esc_attr( get_comment_date() ), esc_attr( get_comment_time() ) ); ?>
     159                                        <?php /* translators: %s: Date */ printf( esc_html__( '%1$s at %2$s', 'modular-kitchen' ), esc_html( get_comment_date() ), esc_html( get_comment_time() ) ); ?>
    160160                                    </time>
    161161                                </a>
  • modular-kitchen/1.6/inc/theme-installation/assets/js/theme-installation.js

    r304688 r318990  
    1919                action: 'tm_theme_info_update_recommend_action',
    2020                id: id,
    21                 todo: action
     21                todo: action,
     22                _ajax_nonce: tm_theme_info_box_object.recommend_action_nonce
    2223            },
    2324            dataType  : "html",
    … …  
    3233            },
    3334            error     : function (jqXHR, textStatus, errorThrown) {
    34                 console.log(jqXHR + " :: " + textStatus + " :: " + errorThrown);
     35                // Handle error silently
    3536            }
    3637        });
    … …  
    100101                jQuery('.mnssp-loader-overlay').hide();
    101102
    102                 console.log('Error loading products');
     103                // Handle error silently
    103104            }
    104105        });
  • modular-kitchen/1.6/inc/theme-installation/theme-installation.php

    r308198 r318990  
    5454         */
    5555        public function modular_kitchen_update_recommended_action_callback() {
     56            check_ajax_referer( 'tm_recommend_action_nonce' );
     57            if ( ! current_user_can( 'edit_theme_options' ) ) {
     58                wp_send_json_error( 'Permission denied.' );
     59                return;
     60            }
    5661
    5762            /*getting for provided array*/
    … …  
    5964
    6065            /*from js action*/
    61             $action_id = esc_attr( ( isset( $_GET['id'] ) ) ? $_GET['id'] : 0 );
    62             $todo = esc_attr( ( isset( $_GET['todo'] ) ) ? $_GET['todo'] : '' );
     66            $action_id = isset( $_GET['id'] ) ? sanitize_key( wp_unslash( $_GET['id'] ) ) : '';
     67            $todo = isset( $_GET['todo'] ) ? sanitize_key( wp_unslash( $_GET['todo'] ) ) : '';
    6368
    6469            /*getting saved actions*/
    … …  
    804809                $count = $this->modular_kitchen_count_recommended_actions();
    805810                wp_localize_script( 'modular-kitchen-theme-installation-js', 'tm_theme_info_box_object', array(
    806                     'nr_actions_recommended'   => $count,
     811                    'count_actions_recommended'   => $count,
    807812                    'ajaxurl'                  => admin_url( 'admin-ajax.php' ),
    808                     'template_directory'       => get_template_directory_uri()
     813                    'template_directory'       => get_template_directory_uri(),
     814                    'nonce'   => wp_create_nonce('free_mnssp_create_pagination_nonce_action'),
     815                    'recommend_action_nonce' => wp_create_nonce('tm_recommend_action_nonce')
    809816                ) );
    810817
  • modular-kitchen/1.6/index.php

    r304688 r318990  
    2727                <div class="row">
    2828                    <?php
    29                         get_template_part( 'template-parts/patterns');
     29                        get_template_part( 'template-parts/patterns'); ?>
     30                </div>
    3031
    31                     } else {
     32                <?php } else {
    3233
    3334                        get_template_part('template-parts/content', 'none');
    3435
    3536                    } ?>
    36                 </div>
    3737
    3838            </main>
  • modular-kitchen/1.6/readme.txt

    r308198 r318990  
    44Tested up to: 6.9
    55Requires PHP: 7.2
    6 Stable tag: 1.5
     6Stable tag: 1.6
    77License: GNU General Public License v3.0
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
    … …  
    345345
    346346* Added demo import.
     347
     348= 1.6 =
     349
     350* Fixed malformed HTML closing tags in admin notice (h2, p).
     351* Fixed missing output escaping: replaced echo wp_get_theme() with esc_html(), _e() with esc_html_e().
     352* Fixed security: added check_ajax_referer() and current_user_can() to tm_install_and_activate_plugin(), tm_check_plugin_exists() AJAX handlers.
     353* Fixed security: added nonce verification to modular_kitchen_dismissable_notice() and modular_kitchen_ajax_notice_handler().
     354* Fixed security: added nonce verification and capability check to modular_kitchen_update_recommended_action_callback() in theme-installation.php.
     355* Fixed sanitization of $_POST inputs in AJAX handlers using sanitize_key(), sanitize_file_name(), wp_unslash().
     356* Fixed incorrect esc_attr() usage with multiple arguments in comment date/time display in template-tags.php.
     357* Fixed esc_url() incorrectly applied to get_comment_author_link() HTML output in template-tags.php.
     358* Fixed stray </i> HTML tag in content-single.php.
     359* Fixed orphaned </div> in index.php when no posts are found.
     360* Fixed scroll-to-top anchor missing href attribute in footer.php.
     361* Fixed security: added nonce verification and capability check to modular_kitchen_demo_importer_ajax_handler() AJAX handler.
     362* Fixed deprecated get_page_by_title() replaced with WP_Query via get_posts() per WordPress 6.2 handbook.
     363* Fixed key name mismatch: nr_actions_recommended -> count_actions_recommended in theme-installation localize script.
     364* Replaced console.log() calls in theme-installation.js with silent error handling.
     365* Replaced console.log() call in theme-importer.js with silent error handling.
     366* Added nonce to recommend-action AJAX call in theme-installation.js.
     367* Replaced die() with wp_die() in AJAX handler functions.
  • modular-kitchen/1.6/style.css

    r308198 r318990  
    66Author URI: https://www.themagnifico.net/
    77Description: Modular Kitchen is a sleek and stylish WordPress theme designed specifically for kitchen designers,  interior decorators, architects, home decor shops, furniture decor shop etc. and home improvement businesses. It is an ideal solution for businesses in the home and kitchen improvement to create a professional online presence and reach a larger crowd of potential customers. The theme comes with a clean and modern design while offering a perfect platform to showcase your expertise in creating stunning modular kitchens. The Modular Kitchen WordPress theme features a highly customizable layout, allowing you to tailor your website to match your brand identity and showcase your unique design ideas. You can easily customize colors, fonts, and page layouts to create a visually appealing and cohesive online presence. This theme offers a range of built-in features that enhance the functionality of your website. With the integrated gallery feature, you can showcase your portfolio of completed projects, highlighting the beauty and functionality of your modular kitchen designs. The theme also includes a blog section, enabling you to share valuable tips, design trends, and inspiration with your audience. In addition, the Modular Kitchen WordPress theme is fully responsive, ensuring that your website looks stunning on all devices, from desktop computers to smartphones and tablets.
    8 Version: 1.5
     8Version: 1.6
    99Requires at least: 5.0
    1010Tested up to: 6.9
  • modular-kitchen/1.6/template-parts/content-single.php

    r238146 r318990  
    2929        <div class="meta-info-box my-2">
    3030            <span class="entry-author"><?php esc_html_e('BY','modular-kitchen'); ?> <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' )) ); ?>"><?php the_author(); ?></a></span>
    31             <span class="ms-2"></i><?php echo esc_html(get_the_date()); ?></span>
     31            <span class="ms-2"><?php echo esc_html(get_the_date()); ?></span>
    3232        </div>
    3333    <?php }?>
Note: See TracChangeset for help on using the changeset viewer.