Make WordPress Themes

Changeset 325536


Ignore:
Timestamp:
04/28/2026 06:40:10 PM (6 months ago)
Author:
themedropbox
Message:

New version of Car Dealership Carkit - 1.0.2

Location:
car-dealership-carkit/1.0.2
Files:
4 added
5 deleted
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • car-dealership-carkit/1.0.2/assets/js/welcome.js

    r317746 r325536  
    11jQuery(function ($) {
    2     $('.car-dealership-carkit-install-plugin').on('click', function (event) {
     2    $('.car-dealership-carkit-install-activate-plugin').on('click', function (event) {
    33        event.preventDefault();
    44        var $button = $(this);
    5 
     5        var success = true;
     6   
     7        var slugString = $button.data('slug'); 
     8        var pluginsRequired = typeof slugString === "string" ? slugString.split(',') : [];
     9        const { __ } = wp.i18n;
     10       
    611        if ($button.hasClass('updating-message')) {
    712            return;
    813        }
    9 
    10         wp.updates.installPlugin({
    11             slug: $button.data('slug')
     14        $button.html(importer_params.activating_text).addClass('updating-message');
     15        console.log(pluginsRequired);
     16        // step 1 — get all installed plugins
     17        wp.apiFetch({ path: '/wp/v2/plugins' }).then(plugins => {
     18   
     19            let chain = Promise.resolve();
     20           
     21            pluginsRequired.forEach(slug => {
     22   
     23                chain = chain.then(() => {
     24                    console.log('Processing:', slug);
     25   
     26                    const pluginObj = plugins.find(p => p.plugin === slug + '/' + slug);
     27   
     28                    if (pluginObj) {
     29                        console.log('FOUND plugin:', pluginObj.plugin);
     30   
     31                        if (pluginObj.status !== 'active') {
     32                            return  car_dealership_carkit_ActivateViaRest(pluginObj.plugin).then(() => {
     33                                console.log(`Activated: ${pluginObj.plugin}`);
     34                                $('.data-plugin-status[data-plugin="'+slug+'"]').html( `<span class="label label-success">${__('Activated', 'wpdirectorykit')}</span>`)
     35                            });
     36                        } else {
     37                            console.log('Already active');
     38                            return Promise.resolve();
     39                        }
     40   
     41                    } else {
     42                        return  car_dealership_carkit_installViaRest(slug).then(() => {
     43                            console.log(`Installed + activated: ${slug}`);
     44                            $('.data-plugin-status[data-plugin="'+slug+'"]').html( `<span class="label label-success">${__('Activated', 'directorykit-car-dealer-addon')}</span>`)
     45                        });
     46                    }
     47                });
     48   
     49            });
     50   
     51            //  end
     52            chain.then(() => {
     53                console.log('All plugins done');
     54                if (success && importer_params.success_redirect == '1') {
     55                    setInterval(() => {
     56                        window.location.href = importer_params.importer_url;
     57                    }, 2000);
     58                } else if (success) {
     59                    $button.parent().append('<a href="'+importer_params.importer_url+'" class="button button-primary">'+importer_params.importer_page+'</a>')
     60                    $button.remove();
     61                } else {
     62                    $button.removeClass('updating-message').html(importer_params.error);
     63                }
     64            });
     65   
    1266        });
    1367    });
    1468
    15     $(document).on('click', '.car-dealership-carkit-activate-plugin', function (event) {
    16         event.preventDefault();
    17         var $button = $(this);
    18         $button.addClass('updating-message').html( );
    19 
    20         car_dealership_carkit_activate_plugin($button);
    21 
    22     });
    23 
    24     $(document).on('wp-plugin-installing', function (event, args) {
    25         event.preventDefault();
    26 
    27         $('.car-dealership-carkit-install-plugin').addClass('updating-message').html(importer_params.installing_text);
    28 
    29     });
    30 
    31     $(document).on('wp-plugin-install-success', function (event, response) {
    32 
    33         event.preventDefault();
    34         var $button = $('.car-dealership-carkit-install-plugin');
    35 
    36         $button.html(importer_params.activating_text);
    37 
    38         setTimeout(function () {
    39             car_dealership_carkit_activate_plugin($button);
    40         }, 1000);
    41 
    42     });
    43 
    44     function car_dealership_carkit_activate_plugin($button) {
    45         $.ajax({
    46             url: ajaxurl,
    47             type: 'POST',
    48             data: {
    49                 action: 'carkit_activate_plugin',
    50                 slug: $button.data('slug'),
    51                 file: $button.data('filename'),
    52                 _wpnonce: importer_params.wpnonce,
    53             },
    54         }).done(function (result) {
    55             var result = JSON.parse(result)
    56             if (result.success && importer_params.success_redirect == '1') {
    57                 window.location.href = importer_params.importer_url;
    58             } else if (result.success) {
    59                 $button.parent().append('<a href="'+importer_params.importer_url+'" class="button button-primary">'+importer_params.success_import+'</a>')
    60                 $button.remove();
    61             } else {
    62                 $button.removeClass('updating-message').html(importer_params.error);
    63             }
     69    function  car_dealership_carkit_installViaRest(slug) {
     70        const { __ } = wp.i18n;
     71       
     72        return wp.apiFetch({
     73            path: '/wp/v2/plugins',
     74            method: 'POST',
     75            data: { slug: slug }
     76        })
     77        .then(plugin => {
     78            $('.data-plugin-status[data-plugin="'+slug+'"]').html( `<span class="label label-success">${__('Installed', 'directorykit-car-dealer-addon')}</span>`)
     79            return  car_dealership_carkit_ActivateViaRest(plugin.plugin);
     80        })
     81        .catch(err => {
     82            console.error('Install REST error:', err);
    6483        });
    6584    }
     85   
     86    function  car_dealership_carkit_ActivateViaRest(pluginFile, retry = false) {
     87        return jQuery.post(ajaxurl, {
     88            action: 'carkit_activate_plugin',
     89            plugin: pluginFile,
     90            _wpnonce: importer_params.wpnonce,
     91        }).then(r => {
     92   
     93            // If return html, based on elementor redirect on install
     94            if (typeof r === 'string' && r.startsWith("<")) {
     95                console.warn('HTML detected during activation');
     96   
     97                if (!retry) {
     98                    console.log('Retrying activation for:', pluginFile);
     99                    return  car_dealership_carkit_ActivateViaRest(pluginFile, true);
     100                }
     101   
     102                console.error('Second HTML response — aborting.');
     103                return false;
     104            }
     105            console.log('AJAX activate result:', r);
     106            return r;
     107        });
     108    }
     109   
    66110});
  • car-dealership-carkit/1.0.2/functions.php

    r321344 r325536  
    2727function car_dealership_carkit_setup()
    2828{
    29         add_editor_style('./assets/css/style-shared.css');
    30 
    31         /*
     29    add_editor_style('./assets/css/style-shared.css');
     30
     31    /*
    3232         * Load additional block styles.
    3333         * See details on how to add more styles in the readme.txt.
    3434         */
    35         $styled_blocks = ['button', 'quote', 'navigation', 'search'];
    36         foreach ($styled_blocks as $block_name) {
    37                 $args = array(
    38                         'handle' => "car_dealership_carkit-$block_name",
    39                         'src'    => get_theme_file_uri("assets/css/blocks/$block_name.min.css"),
    40                         'path'   => get_theme_file_path("assets/css/blocks/$block_name.min.css"),
    41                 );
    42                 // Replace the "core" prefix if you are styling blocks from plugins.
    43                 wp_enqueue_block_style("core/$block_name", $args);
    44         }
    45 
    46         load_theme_textdomain('car-dealership-carkit', get_template_directory() . '/languages');
    47 
    48         // Add support for WooCommerce
    49         add_theme_support('woocommerce');
    50         add_theme_support('wc-product-gallery-zoom');
    51         //add_theme_support('wc-product-gallery-lightbox');
    52         //add_theme_support('wc-product-gallery-slider');
    53 
    54         remove_theme_support('wc-product-gallery-zoom');
    55         // custom logo
    56         add_theme_support('custom-logo');
    57 
    58         // Add theme support for selective refresh for widgets.
    59         add_theme_support('customize-selective-refresh-widgets');
    60         add_theme_support("wp-block-styles");
    61         add_theme_support("responsive-embeds");
    62         add_theme_support('custom-header');
    63         add_theme_support("custom-background");
    64         add_theme_support("align-wide");
    65 
    66         /*
     35    $styled_blocks = ['button', 'quote', 'navigation', 'search'];
     36    foreach ($styled_blocks as $block_name) {
     37        $args = array(
     38            'handle' => "car_dealership_carkit-$block_name",
     39            'src'    => get_theme_file_uri("assets/css/blocks/$block_name.min.css"),
     40            'path'   => get_theme_file_path("assets/css/blocks/$block_name.min.css"),
     41        );
     42        // Replace the "core" prefix if you are styling blocks from plugins.
     43        wp_enqueue_block_style("core/$block_name", $args);
     44    }
     45
     46    load_theme_textdomain('car-dealership-carkit', get_template_directory() . '/languages');
     47
     48    // Add support for WooCommerce
     49    add_theme_support('woocommerce');
     50    add_theme_support('wc-product-gallery-zoom');
     51    //add_theme_support('wc-product-gallery-lightbox');
     52    //add_theme_support('wc-product-gallery-slider');
     53
     54    remove_theme_support('wc-product-gallery-zoom');
     55    // custom logo
     56    add_theme_support('custom-logo');
     57
     58    // Add theme support for selective refresh for widgets.
     59    add_theme_support('customize-selective-refresh-widgets');
     60    add_theme_support("wp-block-styles");
     61    add_theme_support("responsive-embeds");
     62    add_theme_support('custom-header');
     63    add_theme_support("custom-background");
     64    add_theme_support("align-wide");
     65
     66    /*
    6767                * Switch default core markup for search form, comment form, and comments
    6868                * to output valid HTML5.
    6969                */
    70         add_theme_support('html5', array(
    71                 'search-form',
    72                 'comment-form',
    73                 'comment-list',
    74                 'gallery',
    75                 'caption',
    76         ));
    77 
    78         // Add default posts and comments RSS feed links to head.
    79         add_theme_support('automatic-feed-links');
    80 
    81         /*
     70    add_theme_support('html5', array(
     71        'search-form',
     72        'comment-form',
     73        'comment-list',
     74        'gallery',
     75        'caption',
     76    ));
     77
     78    // Add default posts and comments RSS feed links to head.
     79    add_theme_support('automatic-feed-links');
     80
     81    /*
    8282                 * Let WordPress manage the document title.
    8383                 * By adding theme support, we declare that this theme does not use a
    … …  
    8585                 * provide it for us.
    8686                 */
    87         add_theme_support('title-tag');
    88 
    89 
    90         /*
     87    add_theme_support('title-tag');
     88
     89
     90    /*
    9191                 * Enable support for Post Thumbnails on posts and pages.
    9292                 *
    9393                 * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
    9494                 */
    95         add_theme_support('post-thumbnails');
    96 
    97         // This theme uses wp_nav_menu() in one location.
    98         register_nav_menus(array(
    99                 'main_menu' => esc_html__('Primary Menu', 'car-dealership-carkit'),
    100                 'footer_links' => esc_html__('Footer Links', 'car-dealership-carkit'),
    101                 'mobile_menu' => esc_html__('Mobile Menu', 'car-dealership-carkit'),
    102         ));
     95    add_theme_support('post-thumbnails');
     96
     97    // This theme uses wp_nav_menu() in one location.
     98    register_nav_menus(array(
     99        'main_menu' => esc_html__('Primary Menu', 'car-dealership-carkit'),
     100        'footer_links' => esc_html__('Footer Links', 'car-dealership-carkit'),
     101        'mobile_menu' => esc_html__('Mobile Menu', 'car-dealership-carkit'),
     102    ));
    103103}
    104104
    … …  
    115115function car_dealership_carkit_styles()
    116116{
    117         wp_enqueue_style(
    118                 'car_dealership_carkit-style',
    119                 get_stylesheet_uri(),
    120                 [],
    121                 CAR_DEALERSHIP_CARKIT
    122         );
    123         wp_enqueue_style(
    124                 'car_dealership_carkit-shared-styles',
    125                 get_theme_file_uri('assets/css/style-shared.css'),
    126                 [],
    127                 CAR_DEALERSHIP_CARKIT
    128         );
    129 
    130         $remote_url = 'https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=Space+Grotesk:wght@300..700&family=Quicksand:wght@300;400;500;600;700&display=swap';
    131         if (function_exists('wptt_get_webfont_url')) {
    132                 wp_enqueue_style('google-fonts',  wptt_get_webfont_url($remote_url), false);
    133         }
    134 
    135         wp_enqueue_style(
    136                 'bootstrap-grid-5',
    137                 get_theme_file_uri('assets/libs/bootstrap-5.3.3/css/bootstrap-grid.min.css'),
    138                 [],
    139                 '5.3.3'
    140         );
    141         wp_enqueue_script('bootstrap-5', get_theme_file_uri('assets/libs/bootstrap-5.3.3/js/bootstrap.min.js'), ['jquery'], '5.3.3', true);
    142 
    143         wp_enqueue_style(
    144                 'fontawesome-6.5',
    145                 get_theme_file_uri('assets/libs/fontawesome-6.7/css/all.min.css'),
    146                 [],
    147                 '6.7'
    148         );
    149         wp_enqueue_style(
    150                 'car_dealership_carkit',
    151                 get_theme_file_uri('assets/css/theme.css'),
    152                 [],
    153                 CAR_DEALERSHIP_CARKIT
    154         );
    155         wp_enqueue_style(
    156                 'car_dealership_carkit-responsive',
    157                 get_theme_file_uri('assets/css/theme-responsive.css'),
    158                 [],
    159                 CAR_DEALERSHIP_CARKIT
    160         );
    161 
    162         wp_enqueue_script('car_dealership_carkit', get_theme_file_uri('assets/js/theme.js'), ['jquery'], CAR_DEALERSHIP_CARKIT, true);
     117    wp_enqueue_style(
     118        'car_dealership_carkit-style',
     119        get_stylesheet_uri(),
     120        [],
     121        CAR_DEALERSHIP_CARKIT
     122    );
     123    wp_enqueue_style(
     124        'car_dealership_carkit-shared-styles',
     125        get_theme_file_uri('assets/css/style-shared.css'),
     126        [],
     127        CAR_DEALERSHIP_CARKIT
     128    );
     129
     130    $remote_url = 'https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=Space+Grotesk:wght@300..700&family=Quicksand:wght@300;400;500;600;700&display=swap';
     131    if (function_exists('wptt_get_webfont_url')) {
     132        wp_enqueue_style('google-fonts',  wptt_get_webfont_url($remote_url), false);
     133    }
     134
     135    wp_enqueue_style(
     136        'bootstrap-grid-5',
     137        get_theme_file_uri('assets/libs/bootstrap-5.3.3/css/bootstrap-grid.min.css'),
     138        [],
     139        '5.3.3'
     140    );
     141    wp_enqueue_script('bootstrap-5', get_theme_file_uri('assets/libs/bootstrap-5.3.3/js/bootstrap.min.js'), ['jquery'], '5.3.3', true);
     142
     143    wp_enqueue_style(
     144        'fontawesome-6.5',
     145        get_theme_file_uri('assets/libs/fontawesome-6.7/css/all.min.css'),
     146        [],
     147        '6.7'
     148    );
     149    wp_enqueue_style(
     150        'car_dealership_carkit',
     151        get_theme_file_uri('assets/css/theme.css'),
     152        [],
     153        CAR_DEALERSHIP_CARKIT
     154    );
     155    wp_enqueue_style(
     156        'car_dealership_carkit-responsive',
     157        get_theme_file_uri('assets/css/theme-responsive.css'),
     158        [],
     159        CAR_DEALERSHIP_CARKIT
     160    );
     161
     162    wp_enqueue_script('car_dealership_carkit', get_theme_file_uri('assets/js/theme.js'), ['jquery'], CAR_DEALERSHIP_CARKIT, true);
    163163}
    164164add_action('wp_enqueue_scripts', 'car_dealership_carkit_styles');
    165165
    166 function wdk_allow_svg_upload($mimes) {
     166function wdk_allow_svg_upload($mimes)
     167{
    167168    $mimes['svg'] = 'image/svg+xml';
    168169    return $mimes;
    … …  
    194195 */
    195196
    196  add_action('admin_head', function () {
     197add_action('admin_head', function () {
    197198    echo '<style>
    198199      .appearance_page-dashboard #setting-error-tgmpa {
    … …  
    239240    }
    240241    </style>';
    241   });
     242});
    242243
    243244
    244245add_filter('intermediate_image_sizes_advanced', function ($sizes) {
    245         if(get_option('apartment_install_ocdi_images_sizes_enable') == 1) {
    246                 unset($sizes['thumb']);
    247                 unset($sizes['thumbnail']);
    248                 unset($sizes['medium']);
    249                 unset($sizes['large']);
    250                 unset($sizes['medium_large']);
    251                 unset($sizes['big_image_size_threshold']);
    252                 unset($sizes['post-thumbnail']);
    253                 unset($sizes['1536x1536']);
    254                 unset($sizes['nexproperty-footer-thumbnail']);
    255                 unset($sizes['nexproperty-slider-thumbnail']);
    256                 unset($sizes['nexproperty-post-thumbnail']);
    257                 unset($sizes['woocommerce_thumbnail']);
    258                 unset($sizes['woocommerce_single']);
    259                 unset($sizes['woocommerce_gallery_thumbnail']);
    260                 unset($sizes['shop_single']);
    261                 unset($sizes['shop_thumbnail']);
    262         }
    263 
    264         return $sizes;
     246    if (get_option('apartment_install_ocdi_images_sizes_enable') == 1) {
     247        unset($sizes['thumb']);
     248        unset($sizes['thumbnail']);
     249        unset($sizes['medium']);
     250        unset($sizes['large']);
     251        unset($sizes['medium_large']);
     252        unset($sizes['big_image_size_threshold']);
     253        unset($sizes['post-thumbnail']);
     254        unset($sizes['1536x1536']);
     255        unset($sizes['nexproperty-footer-thumbnail']);
     256        unset($sizes['nexproperty-slider-thumbnail']);
     257        unset($sizes['nexproperty-post-thumbnail']);
     258        unset($sizes['woocommerce_thumbnail']);
     259        unset($sizes['woocommerce_single']);
     260        unset($sizes['woocommerce_gallery_thumbnail']);
     261        unset($sizes['shop_single']);
     262        unset($sizes['shop_thumbnail']);
     263    }
     264
     265    return $sizes;
    265266});
    266267
    267268
    268269if (get_option('wdk_theme_carkit_installed') == 1) {
    269                
    270         add_filter( 'template_include', function ( $template ) {
    271                 // Check if the template is in the /templates/ directory and is an HTML file
    272                 $html_templates_dir = get_template_directory() . '/templates/';
    273 
    274                 if ( strpos( $template, 'template-canvas.php' ) ) {
    275                         // No need to escape paths when including, only escape when outputting
    276                         return get_template_directory() . '/html-template-wrapper.php';
    277                 }
    278 
    279                 if ( strpos( $template, $html_templates_dir ) === 0 && pathinfo( $template, PATHINFO_EXTENSION ) === 'html' ) {
    280                         // No need to escape paths when including, only escape when outputting
    281                         return get_template_directory() . '/html-template-wrapper.php';
    282                 }
    283                 return $template;
    284 
    285         } );
    286 
    287     add_action('wp_head', function() {
     270
     271    add_filter('template_include', function ($template) {
     272        // Check if the template is in the /templates/ directory and is an HTML file
     273        $html_templates_dir = get_template_directory() . '/templates/';
     274
     275        if (strpos($template, 'template-canvas.php')) {
     276            // No need to escape paths when including, only escape when outputting
     277            return get_template_directory() . '/html-template-wrapper.php';
     278        }
     279
     280        if (strpos($template, $html_templates_dir) === 0 && pathinfo($template, PATHINFO_EXTENSION) === 'html') {
     281            // No need to escape paths when including, only escape when outputting
     282            return get_template_directory() . '/html-template-wrapper.php';
     283        }
     284        return $template;
     285    });
     286
     287    add_action('wp_head', function () {
    288288        echo '<style>
    289289            /* Inline CSS for wdk_theme_carkit_installed */
    … …  
    298298
    299299/**
    300 * Add Sub Menu Page to the Layers Menu Item
    301 */
    302 if( ! function_exists('carkit_register_submenu_page') ) {
    303         function carkit_register_submenu_page(){
    304                 add_theme_page( esc_html__( 'Car Dealership Carkit Help' , 'car-dealership-carkit'  ), esc_html__( 'Car Dealership Carkit Help' , 'car-dealership-carkit'  ),
    305                                                         'edit_theme_options', 'car-dealership-carkit-dashboard', 'carkit_get_child_onboarding' );
    306         }
    307 }
    308 function carkit_get_child_onboarding(){
    309         require_once get_stylesheet_directory() . '/includes/theme-help.php';
     300 * Add Sub Menu Page to the Layers Menu Item
     301 */
     302if (! function_exists('carkit_register_submenu_page')) {
     303    function carkit_register_submenu_page()
     304    {
     305        add_theme_page(
     306            esc_html__('Car Dealership Carkit Help', 'car-dealership-carkit'),
     307            esc_html__('Car Dealership Carkit Help', 'car-dealership-carkit'),
     308            'edit_theme_options',
     309            'car-dealership-carkit-dashboard',
     310            'carkit_get_child_onboarding'
     311        );
     312    }
     313}
     314function carkit_get_child_onboarding()
     315{
     316    require_once get_stylesheet_directory() . '/includes/theme-help.php';
    310317}
    311318add_action('admin_menu', 'carkit_register_submenu_page', 60);
  • car-dealership-carkit/1.0.2/inc/patterns/brands-row.php

    r321344 r325536  
    1515<!-- wp:cover {"overlayColor":"base","isUserOverlayColor":true,"minHeight":144,"minHeightUnit":"px","contentPosition":"center center","isDark":false,"style":{"layout":{"selfStretch":"fixed","flexSize":"190px"},"spacing":{"blockGap":"0"},"border":{"radius":"10px","color":"#adadad","width":"1px"}}} -->
    1616<div class="wp-block-cover is-light has-border-color wp-container-content-6610010d" style="border-color:#adadad;border-width:1px;border-radius:10px;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;min-height:144px;aspect-ratio:unset;"><span aria-hidden="true" class="wp-block-cover__background has-base-background-color has-background-dim-100 has-background-dim"></span><div class="wp-block-cover__inner-container has-global-padding is-layout-constrained wp-container-core-cover-is-layout-8604e950 wp-block-cover-is-layout-constrained">
    17 <figure class="wp-block-image aligncenter size-full is-resized is-style-default" style="margin-top:0;margin-bottom:0"><img src="' . esc_url(get_template_directory_uri()) . '/assets/images/brand-bmv.jpg" alt="" class="wp-image-1902" style="object-fit:cover;width:190px;height:150px"></figure>
     17<figure class="wp-block-image aligncenter size-full is-resized is-style-default" style="margin-top:0;margin-bottom:0"><img src="' . esc_url(get_template_directory_uri()) . '/assets/images/brand-varion.jpg" alt="" class="wp-image-1902" style="object-fit:cover;width:190px;height:150px"></figure>
    1818</div></div>
    1919<!-- /wp:cover -->
    2020
    2121<!-- wp:heading {"textAlign":"center","level":3,"style":{"typography":{"fontSize":"18px"},"elements":{"link":{"color":{"text":"var:preset|color|contrast"}}}},"textColor":"contrast"} -->
    22 <h3 class="wp-block-heading has-text-align-center has-contrast-color has-text-color has-link-color" style="font-size:18px">Bmv</h3>
     22<h3 class="wp-block-heading has-text-align-center has-contrast-color has-text-color has-link-color" style="font-size:18px">Varion</h3>
    2323<!-- /wp:heading -->
    2424</div>
    … …  
    3131<!-- wp:cover {"overlayColor":"base","isUserOverlayColor":true,"minHeight":144,"minHeightUnit":"px","contentPosition":"center center","isDark":false,"style":{"layout":{"selfStretch":"fixed","flexSize":"190px"},"spacing":{"blockGap":"0"},"border":{"radius":"10px","color":"#adadad","width":"1px"}}} -->
    3232<div class="wp-block-cover is-light has-border-color wp-container-content-6610010d" style="border-color:#adadad;border-width:1px;border-radius:10px;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;min-height:144px;aspect-ratio:unset;"><span aria-hidden="true" class="wp-block-cover__background has-base-background-color has-background-dim-100 has-background-dim"></span><div class="wp-block-cover__inner-container has-global-padding is-layout-constrained wp-container-core-cover-is-layout-8604e950 wp-block-cover-is-layout-constrained">
    33 <figure class="wp-block-image aligncenter size-full is-resized is-style-default" style="margin-top:0;margin-bottom:0"><img src="' . esc_url(get_template_directory_uri()) . '/assets/images/brand-mazda.jpg" alt="" class="wp-image-1902" style="object-fit:cover;width:190px;height:150px"></figure>
     33<figure class="wp-block-image aligncenter size-full is-resized is-style-default" style="margin-top:0;margin-bottom:0"><img src="' . esc_url(get_template_directory_uri()) . '/assets/images/brand-solara.jpg" alt="" class="wp-image-1902" style="object-fit:cover;width:190px;height:150px"></figure>
    3434</div></div>
    3535<!-- /wp:cover -->
    3636
    3737<!-- wp:heading {"textAlign":"center","level":3,"style":{"typography":{"fontSize":"18px"},"elements":{"link":{"color":{"text":"var:preset|color|contrast"}}}},"textColor":"contrast"} -->
    38 <h3 class="wp-block-heading has-text-align-center has-contrast-color has-text-color has-link-color" style="font-size:18px">Mazda</h3>
     38<h3 class="wp-block-heading has-text-align-center has-contrast-color has-text-color has-link-color" style="font-size:18px">Solara</h3>
    3939<!-- /wp:heading -->
    4040</div>
    … …  
    4747<!-- wp:cover {"overlayColor":"base","isUserOverlayColor":true,"minHeight":144,"minHeightUnit":"px","contentPosition":"center center","isDark":false,"style":{"layout":{"selfStretch":"fixed","flexSize":"190px"},"spacing":{"blockGap":"0"},"border":{"radius":"10px","color":"#adadad","width":"1px"}}} -->
    4848<div class="wp-block-cover is-light has-border-color wp-container-content-6610010d" style="border-color:#adadad;border-width:1px;border-radius:10px;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;min-height:144px;aspect-ratio:unset;"><span aria-hidden="true" class="wp-block-cover__background has-base-background-color has-background-dim-100 has-background-dim"></span><div class="wp-block-cover__inner-container has-global-padding is-layout-constrained wp-container-core-cover-is-layout-8604e950 wp-block-cover-is-layout-constrained">
    49 <figure class="wp-block-image aligncenter size-full is-resized is-style-default" style="margin-top:0;margin-bottom:0"><img src="' . esc_url(get_template_directory_uri()) . '/assets/images/brand-honda.jpg" alt="" class="wp-image-1902" style="object-fit:cover;width:190px;height:150px"></figure>
     49<figure class="wp-block-image aligncenter size-full is-resized is-style-default" style="margin-top:0;margin-bottom:0"><img src="' . esc_url(get_template_directory_uri()) . '/assets/images/brand-auren.jpg" alt="" class="wp-image-1902" style="object-fit:cover;width:190px;height:150px"></figure>
    5050</div></div>
    5151<!-- /wp:cover -->
    5252
    5353<!-- wp:heading {"textAlign":"center","level":3,"style":{"typography":{"fontSize":"18px"},"elements":{"link":{"color":{"text":"var:preset|color|contrast"}}}},"textColor":"contrast"} -->
    54 <h3 class="wp-block-heading has-text-align-center has-contrast-color has-text-color has-link-color" style="font-size:18px">Honda</h3>
     54<h3 class="wp-block-heading has-text-align-center has-contrast-color has-text-color has-link-color" style="font-size:18px">Auren</h3>
    5555<!-- /wp:heading -->
    5656</div>
    … …  
    6363<!-- wp:cover {"overlayColor":"base","isUserOverlayColor":true,"minHeight":144,"minHeightUnit":"px","contentPosition":"center center","isDark":false,"style":{"layout":{"selfStretch":"fixed","flexSize":"190px"},"spacing":{"blockGap":"0"},"border":{"radius":"10px","color":"#adadad","width":"1px"}}} -->
    6464<div class="wp-block-cover is-light has-border-color wp-container-content-6610010d" style="border-color:#adadad;border-width:1px;border-radius:10px;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;min-height:144px;aspect-ratio:unset;"><span aria-hidden="true" class="wp-block-cover__background has-base-background-color has-background-dim-100 has-background-dim"></span><div class="wp-block-cover__inner-container has-global-padding is-layout-constrained wp-container-core-cover-is-layout-8604e950 wp-block-cover-is-layout-constrained">
    65 <figure class="wp-block-image aligncenter size-full is-resized is-style-default" style="margin-top:0;margin-bottom:0"><img src="' . esc_url(get_template_directory_uri()) . '/assets/images/brand-volvo.jpg" alt="" class="wp-image-1902" style="object-fit:cover;width:190px;height:150px"></figure>
     65<figure class="wp-block-image aligncenter size-full is-resized is-style-default" style="margin-top:0;margin-bottom:0"><img src="' . esc_url(get_template_directory_uri()) . '/assets/images/brand-revvan.jpg" alt="" class="wp-image-1902" style="object-fit:cover;width:190px;height:150px"></figure>
    6666</div></div>
    6767<!-- /wp:cover -->
    6868
    6969<!-- wp:heading {"textAlign":"center","level":3,"style":{"typography":{"fontSize":"18px"},"elements":{"link":{"color":{"text":"var:preset|color|contrast"}}}},"textColor":"contrast"} -->
    70 <h3 class="wp-block-heading has-text-align-center has-contrast-color has-text-color has-link-color" style="font-size:18px">Volvo</h3>
     70<h3 class="wp-block-heading has-text-align-center has-contrast-color has-text-color has-link-color" style="font-size:18px">Revvan</h3>
    7171<!-- /wp:heading -->
    7272</div>
    … …  
    8484
    8585<!-- wp:heading {"textAlign":"center","level":3,"style":{"typography":{"fontSize":"18px"},"elements":{"link":{"color":{"text":"var:preset|color|contrast"}}}},"textColor":"contrast"} -->
    86 <h3 class="wp-block-heading has-text-align-center has-contrast-color has-text-color has-link-color" style="font-size:18px">Citroen</h3>
     86<h3 class="wp-block-heading has-text-align-center has-contrast-color has-text-color has-link-color" style="font-size:18px">Elysian</h3>
    8787<!-- /wp:heading -->
    8888</div>
    … …  
    100100
    101101<!-- wp:heading {"textAlign":"center","level":3,"style":{"typography":{"fontSize":"18px"},"elements":{"link":{"color":{"text":"var:preset|color|contrast"}}}},"textColor":"contrast"} -->
    102 <h3 class="wp-block-heading has-text-align-center has-contrast-color has-text-color has-link-color" style="font-size:18px">Hyundai</h3>
     102<h3 class="wp-block-heading has-text-align-center has-contrast-color has-text-color has-link-color" style="font-size:18px">Zentor</h3>
    103103<!-- /wp:heading -->
    104104</div>
  • car-dealership-carkit/1.0.2/inc/patterns/car-footer.php

    r321344 r325536  
    8181
    8282<!-- wp:paragraph {"style":{"elements":{"link":{"color":{"text":"var:preset|color|base"}}},"typography":{"fontSize":"16px","fontStyle":"normal","fontWeight":"700"}},"textColor":"base"} -->
    83 <p class="has-base-color has-text-color has-link-color" style="font-size:16px;font-style:normal;font-weight:700"><a href="tel:101091812347"></a><a href="mailto:username@domain.com">username@domain.com</a></p>
     83<p class="has-base-color has-text-color has-link-color" style="font-size:16px;font-style:normal;font-weight:700"><a href="tel:101091812347"></a><a href="mailto:example@example.com">example@example.com</a></p>
    8484<!-- /wp:paragraph --></div>
    8585<!-- /wp:group -->
  • car-dealership-carkit/1.0.2/includes/init.php

    r317746 r325536  
    22
    33locate_template( '/includes/theme-setup.php', true, true );
    4 
    5 if(file_exists(get_stylesheet_directory() .'/addons/configuration.php')) {
    6     locate_template( '/addons/configuration.php', true, true );
    7 } else {
    8     locate_template( '/includes/ocdi/configuration.php', true, true );
    9 }
    10 
    11 locate_template( '/includes/tgm_pa/configuration.php', true, true );
  • car-dealership-carkit/1.0.2/includes/welcome.php

    r317746 r325536  
    5151                                <?php if ( version_compare( PHP_VERSION, '7.0', '>=' ) || ($elementor_version && version_compare( $elementor_version, '3.7', '<') )) :?>
    5252                                    <?php if ( file_exists(ABSPATH . 'wp-content/plugins/one-click-demo-import/one-click-demo-import.php') && !in_array( 'one-click-demo-import/one-click-demo-import.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ):?>
    53                                         <p><a data-slug="one-click-demo-import" data-filename="one-click-demo-import" href="#" class="button button-primary car-dealership-carkit-activate-plugin"><?php esc_html_e('Activate Demo Importer Plugin', 'car-dealership-carkit'); ?></a></p>
     53                                        <p><a data-slug="one-click-demo-import,directorykit-car-dealer-addon" data-filename="one-click-demo-import" href="#" class="button button-primary car-dealership-carkit-install-activate-plugin"><?php esc_html_e('Activate Demo Importer Plugin', 'car-dealership-carkit'); ?></a></p>
    5454                                    <?php elseif ( file_exists(ABSPATH . 'wp-content/plugins/one-click-demo-import/one-click-demo-import.php') && in_array( 'one-click-demo-import/one-click-demo-import.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) )):?>
    5555                                        <p><a href="<?php echo esc_url(get_admin_url() . "themes.php?page=one-click-demo-import");?>" class="button button-primary"><?php esc_html_e('Go to Demo Importer Page', 'car-dealership-carkit'); ?></a></p>
    5656                                    <?php else:?>
    57                                         <p><a data-slug="one-click-demo-import" data-filename="one-click-demo-import" href="<?php echo esc_url(admin_url('themes.php?page=one-click-demo-import'));?>" class="button button-primary car-dealership-carkit-install-plugin"><?php esc_html_e('Install Demo Importer Plugin', 'car-dealership-carkit'); ?></a></p>
     57                                        <p><a data-slug="one-click-demo-import,directorykit-car-dealer-addon" data-filename="one-click-demo-import" href="<?php echo esc_url(admin_url('themes.php?page=one-click-demo-import'));?>" class="button button-primary car-dealership-carkit-install-activate-plugin"><?php esc_html_e('Install Demo Importer Plugin', 'car-dealership-carkit'); ?></a></p>
    5858                                    <?php endif;?>
    5959                                <?php else: ?>
    … …  
    100100
    101101        wp_enqueue_style('car-dealership-carkit-welcome', get_stylesheet_directory_uri() . '/assets/css/welcome.css', array(), '1.0');
    102         wp_enqueue_script('car-dealership-carkit-welcome', get_stylesheet_directory_uri() . '/assets/js/welcome.js', ['jquery','updates'], '1.0', true );
     102        wp_enqueue_script('car-dealership-carkit-welcome', get_stylesheet_directory_uri() . '/assets/js/welcome.js', ['jquery','updates','wp-api-fetch'], '1.0', true );
    103103        wp_localize_script('car-dealership-carkit-welcome', 'importer_params', $importer_params);
    104104}
    … …  
    120120        }
    121121
    122         $slug = isset($_POST['slug']) ? $_POST['slug'] : '';
    123         $file = isset($_POST['file']) ? $_POST['file'] : '';
    124         $success = false;
     122        $allowed_plugins = [
     123            'elementor/elementor',
     124            'wpdirectorykit/wpdirectorykit',
     125            'elementinvader-addons-for-elementor/elementinvader-addons-for-elementor',
     126            'elementinvader/elementinvader',
     127            'one-click-demo-import/one-click-demo-import',
     128            'directorykit-car-dealer-addon/directorykit-car-dealer-addon',
     129        ];
    125130
    126         if (!empty($slug) && !empty($file)) {
    127             $result = activate_plugin($slug . '/' . $file . '.php');
     131
     132        $plugin = sanitize_text_field( wp_unslash( $_POST['plugin'] ) );
     133        if ( ! in_array( $plugin, $allowed_plugins, true ) ) {
     134            wp_send_json_error( 'Plugin is not allowed.' );
     135        }
     136     
     137        if (!empty($plugin)) {
     138            $result = activate_plugin($plugin . '.php');
    128139            update_option('carkit_hide_notice', true);
    129140            if (!is_wp_error($result)) {
  • car-dealership-carkit/1.0.2/readme.txt

    r321344 r325536  
    55Requires at least: 6.0
    66Requires PHP: 7.4
    7 Stable tag: 1.0.1
    8 Version: 1.0.1
     7Stable tag: 1.0.2
     8Version: 1.0.2
    99License: GNU General Public License v2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    309309License URL: https://pxhere.com/en/license 
    310310Source: https://pxhere.com/en/photo/1166111
     311
     312
     313https://chatgpt.com/s/m_69ef3caa05b481919f4e3ee88947eab8
  • car-dealership-carkit/1.0.2/style.css

    r321344 r325536  
    55Author: WPDirectoryKit Team
    66Author URI: https://wpdirectorykit.com
    7 Version: 1.0.1
     7Version: 1.0.2
    88Requires at least: 6.3
    99Tested up to: 6.9
Note: See TracChangeset for help on using the changeset viewer.