Plugin Directory

Changeset 3337250


Ignore:
Timestamp:
07/31/2025 11:56:05 AM (8 months ago)
Author:
vertim
Message:

upgrade to v2.2.0

Location:
neon-product-designer-for-woocommerce
Files:
136 added
6 edited

Legend:

Unmodified
Added
Removed
  • neon-product-designer-for-woocommerce/trunk/README.txt

    r3130043 r3337250  
    55Requires at least: 5.0
    66Requires PHP: 7.0
    7 Tested up to: 6.6.1
    8 Stable tag: 2.1.1
     7Tested up to: 6.8.2
     8Stable tag: 2.2.0
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    117117
    118118== Changelog ==
     119= 2.2.0 =
     120* 31 Jul 2025*
     121-Change in the version of WordPress used for testing.
     122-Addition of admin notice to present new plugins currently under maintenance.
     123
    119124= 2.1.1 =
    120125* 02 August 2024*
  • neon-product-designer-for-woocommerce/trunk/admin/class-neon-product-designer-admin.php

    r2937134 r3337250  
    2020 * @author     Vertim Coders <[email protected]>
    2121 */
    22 class Neon_Product_Designer_Admin {
     22class Neon_Product_Designer_Admin
     23{
    2324
    2425    /**
     
    4748     * @param      string $version    The version of this plugin.
    4849     */
    49     public function __construct( $npd, $version ) {
    50 
    51         $this->npd     = $npd;
     50    public function __construct($npd, $version)
     51    {
     52
     53        $this->npd = $npd;
    5254        $this->version = $version;
    5355
     
    5961     * @since    1.0.0
    6062     */
    61     public function enqueue_styles() {
     63    public function enqueue_styles()
     64    {
    6265
    6366        /**
     
    7275         * class.
    7376         */
    74         wp_enqueue_style( 'wp-color-picker' );
     77        wp_enqueue_style('wp-color-picker');
    7578
    7679        wp_enqueue_style(
    7780            $this->npd,
    78             plugin_dir_url( __FILE__ ) . 'css/neon-product-designer-admin.css',
     81            plugin_dir_url(__FILE__) . 'css/neon-product-designer-admin.css',
    7982            array(),
    8083            $this->version,
     
    101104            'kali-modal',
    102105            NPD_URL . 'includes/kali-admin-tools/js/modal/modal.min.css',
    103             array( 'jquery' ),
     106            array('jquery'),
    104107            $this->version,
    105108            false
     
    113116     * @since    1.0.0
    114117     */
    115     public function enqueue_scripts() {
     118    public function enqueue_scripts()
     119    {
    116120
    117121        /**
     
    129133        wp_enqueue_script(
    130134            'iris',
    131             admin_url( 'js/iris.min.js' ),
     135            admin_url('js/iris.min.js'),
    132136            array(
    133137                'jquery-ui-draggable',
     
    140144
    141145        $colorpicker_l10n = array(
    142             'clear'         => __( 'Clear' ),
    143             'defaultString' => __( 'Default' ),
    144             'pick'          => __( 'Select Color' ),
    145             'current'       => __( 'Current Color' ),
     146            'clear' => __('Clear'),
     147            'defaultString' => __('Default'),
     148            'pick' => __('Select Color'),
     149            'current' => __('Current Color'),
    146150        );
    147151
     
    154158        wp_enqueue_script(
    155159            $this->npd,
    156             plugin_dir_url( __FILE__ ) .
     160            plugin_dir_url(__FILE__) .
    157161            'js/neon-product-designer-admin.js',
    158             array( 'jquery' ),
     162            array('jquery'),
    159163            $this->version,
    160164            false
     165        );
     166        wp_enqueue_script(
     167            "npd-free-promo",
     168            NPD_URL .
     169            'admin/js/npd-free-promo.js',
     170            array('jquery'),
     171            $this->version,
     172            true
    161173        );
    162174
     
    164176            'select2',
    165177            NPD_URL . 'includes/kali-admin-tools/js/select2.min.js',
    166             array( 'jquery' ),
     178            array('jquery'),
    167179            $this->version,
    168180            false
     
    172184            'SpryTabbedPanels',
    173185            NPD_URL . 'includes/kali-admin-tools/js/SpryTabbedPanels.min.js',
    174             array( 'jquery' ),
     186            array('jquery'),
    175187            $this->version,
    176188            false
     
    188200            'kali-admin-tools',
    189201            NPD_URL . 'includes/kali-admin-tools/js/kali-admin-tools-scripts.js',
    190             array( 'jquery' ),
     202            array('jquery'),
    191203            $this->version,
    192204            true
     
    196208            'home_url',
    197209            array(
    198                 'ajaxurl'    => admin_url( 'admin-ajax.php' ),
     210                'ajaxurl' => admin_url('admin-ajax.php'),
    199211                'data_var_1' => 'value 1',
    200212                'data_var_2' => 'value 2',
     
    207219     * Builds all the plugin menu and submenu
    208220     */
    209     public function add_npd_parts_submenu() {
    210         if ( class_exists( 'WooCommerce' ) ) {
     221    public function add_npd_parts_submenu()
     222    {
     223        if (class_exists('WooCommerce')) {
    211224            global $submenu;
    212225            $icon = NPD_URL . 'admin/images/npd-dashicon.png';
     
    217230                'manage_product_terms',
    218231                'npd-manage-dashboard',
    219                 array( $this, 'get_fonts_page' ),
     232                array($this, 'get_fonts_page'),
    220233                $icon,
    221234                10
     
    224237            add_submenu_page(
    225238                'npd-manage-dashboard',
    226                 __( 'Manage Fonts', 'neon-product-designer' ),
    227                 __( 'Manage Fonts', 'neon-product-designer' ),
     239                __('Manage Fonts', 'neon-product-designer'),
     240                __('Manage Fonts', 'neon-product-designer'),
    228241                'manage_product_terms',
    229242                'npd-manage-fonts',
    230                 array( $this, 'get_fonts_page' )
     243                array($this, 'get_fonts_page')
    231244            );
    232245
    233246            add_submenu_page(
    234247                'npd-manage-dashboard',
    235                 __( 'Manage Scenes', 'neon-product-designer' ),
    236                 __( 'Manage Scenes', 'neon-product-designer' ),
     248                __('Manage Scenes', 'neon-product-designer'),
     249                __('Manage Scenes', 'neon-product-designer'),
    237250                'manage_product_terms',
    238251                'edit.php?post_type=npd-scenes',
     
    246259                    'neon-product-designer'
    247260                ),
    248                 __( 'Manage Colors', 'neon-product-designer' ),
     261                __('Manage Colors', 'neon-product-designer'),
    249262                'manage_product_terms',
    250263                'edit.php?post_type=npd-colors-palette',
     
    259272                    'neon-product-designer'
    260273                ),
    261                 __( 'Configurations', 'neon-product-designer' ),
     274                __('Configurations', 'neon-product-designer'),
    262275                'manage_product_terms',
    263276                'edit.php?post_type=npd-config',
    264277                false
    265278            );
    266            
     279
    267280
    268281            add_submenu_page(
    269282                'npd-manage-dashboard',
    270                 __( 'Settings', 'neon-product-designer' ),
    271                 __( 'Settings', 'neon-product-designer' ),
     283                __('Settings', 'neon-product-designer'),
     284                __('Settings', 'neon-product-designer'),
    272285                'manage_product_terms',
    273286                'npd-manage-settings',
    274                 array( $this, 'get_settings_page' )
     287                array($this, 'get_settings_page')
    275288            );
    276289
    277             $submenu[ 'npd-manage-dashboard' ][] = array( '<div id="user-manual">Go Pro</div>', 'manage_product_terms', 'https://neon-configurator.vertimcoders.com?utm_source=free_version&utm_medium=cpc&utm_campaign=Neon%20Product%20Designer' );
    278            
     290            $submenu['npd-manage-dashboard'][] = array('<div id="user-manual">Go Pro</div>', 'manage_product_terms', 'https://neon-configurator.vertimcoders.com?utm_source=free_version&utm_medium=cpc&utm_campaign=Neon%20Product%20Designer');
     291
    279292        }
    280293    }
     
    283296     * Builds the fonts management page
    284297     */
    285     public function get_fonts_page() {
     298    public function get_fonts_page()
     299    {
    286300        include_once NPD_DIR . '/includes/npd-add-fonts.php';
    287301        npd_add_fonts();
     
    294308     * @return array $mimes
    295309     */
    296     public function npd_add_custom_mime_types( $mimes ) {
     310    public function npd_add_custom_mime_types($mimes)
     311    {
    297312        return array_merge(
    298313            $mimes,
     
    305320    }
    306321
    307     public function vc_get_max_input_vars_php_ini() {
    308         $total_max_normal = ini_get( 'max_input_vars' );
    309         $msg              = __( "Your max input var is <strong>$total_max_normal</strong> but this page contains <strong>{nb}</strong> fields. You may experience a lost of data after saving. In order to fix this issue, please increase <strong>the max_input_vars</strong> value in your php.ini file.", 'neon-product-designer' );
    310        
     322    public function vc_get_max_input_vars_php_ini()
     323    {
     324        $total_max_normal = ini_get('max_input_vars');
     325        $msg = __("Your max input var is <strong>$total_max_normal</strong> but this page contains <strong>{nb}</strong> fields. You may experience a lost of data after saving. In order to fix this issue, please increase <strong>the max_input_vars</strong> value in your php.ini file.", 'neon-product-designer');
     326
    311327        $allowed_html = array(
    312             'br'    => array(),
    313             'b'    => array(),
    314             'em'    => array(),
    315             'strong' => array(),
     328            'br' => array(),
     329            'b' => array(),
     330            'em' => array(),
     331            'strong' => array(),
    316332        );
    317333
     
    320336        <script type="text/javascript">
    321337            var vc_max_input_vars = <?php echo esc_html($total_max_normal); ?>;
    322             var vc_max_input_msg = "<?php echo wp_kses( $msg, $allowed_html) ; ?>";
    323         </script>         
     338            var vc_max_input_msg = "<?php echo wp_kses($msg, $allowed_html); ?>";
     339        </script>
    324340        <?php
    325341    }
     
    328344     * Initialize the plugin sessions
    329345     */
    330     function init_sessions() {
    331         if ( ! session_id() ) {
     346    function init_sessions()
     347    {
     348        if (!session_id()) {
    332349            session_start();
    333350        }
    334351
    335         if ( ! isset( $_SESSION['npd-data-to-load'] ) ) {
     352        if (!isset($_SESSION['npd-data-to-load'])) {
    336353            $_SESSION['npd-data-to-load'] = '';
    337354        }
     
    345362     * @global array $npd_settings Settings
    346363     */
    347     function init_globals() {
     364    function init_globals()
     365    {
    348366        global $npd_settings;
    349         $npd_settings['npd-general-options'] = get_option( 'npd-general-options' );
    350     }
    351 
    352     private function get_admin_option_field( $title, $option_group, $field_name, $type, $default, $class, $css, $tip, $options_array ) {
     367        $npd_settings['npd-general-options'] = get_option('npd-general-options');
     368    }
     369
     370    private function get_admin_option_field($title, $option_group, $field_name, $type, $default, $class, $css, $tip, $options_array)
     371    {
    353372        $field = array(
    354             'title'   => __( $title, 'neon-product-designer' ),
    355             'name'    => $option_group . '[' . $field_name . ']',
    356             'type'    => $type,
     373            'title' => __($title, 'neon-product-designer'),
     374            'name' => $option_group . '[' . $field_name . ']',
     375            'type' => $type,
    357376            'default' => $default,
    358             'class'   => $class,
    359             'css'     => $css,
    360             'desc'    => __( $tip, 'neon-product-designer' ),
    361         );
    362         if ( ! empty( $options_array ) ) {
     377            'class' => $class,
     378            'css' => $css,
     379            'desc' => __($tip, 'neon-product-designer'),
     380        );
     381        if (!empty($options_array)) {
    363382            $field['options'] = $options_array;
    364383        }
     
    371390     * Builds the settings page
    372391     */
    373     function get_settings_page() {
     392    function get_settings_page()
     393    {
    374394        npd_remove_transients();
    375395
    376         if ( isset( $_POST ) && ! empty( $_POST ) ) {
     396        if (isset($_POST) && !empty($_POST)) {
    377397            $this->save_npd_settings_tab_options();
    378398            global $wp_rewrite;
    379             $wp_rewrite->flush_rules( false );
     399            $wp_rewrite->flush_rules(false);
    380400        }
    381401
    382402        $tab = array(
    383             'title' => 'General',
    384             'content'   => $this->get_general_settings()
     403            'title' => 'General',
     404            'content' => $this->get_general_settings()
    385405        );
    386406
    387407        $pannel_block = array();
    388408
    389         array_push( $pannel_block, $tab);
    390 
    391         $pannel_block = apply_filters( 'npd_general_setting_panel', $pannel_block );
     409        array_push($pannel_block, $tab);
     410
     411        $pannel_block = apply_filters('npd_general_setting_panel', $pannel_block);
    392412
    393413        wp_enqueue_media();
     
    396416            <div id="npd-settings">
    397417                <div class="wrap">
    398                     <h2><?php esc_html_e( 'Neon Product Designer Settings', 'neon-product-designer' ); ?></h2>
     418                    <h2><?php esc_html_e('Neon Product Designer Settings', 'neon-product-designer'); ?></h2>
    399419                </div>
    400420
    401421                <?php
    402                     $panel_id = 1;
    403                     foreach ($pannel_block as $key => $panel) {
    404                         ?>
    405                             <div id="TabbedPanels<?php echo esc_attr($panel_id) ;?>" class="TabbedPanels">
    406                                 <ul class="TabbedPanelsTabGroup ">
    407                                     <li class="TabbedPanelsTab " tabindex="1"><span><strong><?php esc_html_e( $panel['title'], 'neon-product-designer' ); ?></strong></span> </li>
    408                                 </ul>
    409 
    410                                 <div class="TabbedPanelsContentGroup">
    411                                     <div class="TabbedPanelsContent">
    412                                         <div class='npd-grid npd-grid-pad'>
    413                                             <?php echo $panel['content'];
    414                                         ?>
    415                                         </div>
    416                                     </div>
     422                $panel_id = 1;
     423                foreach ($pannel_block as $key => $panel) {
     424                    ?>
     425                    <div id="TabbedPanels<?php echo esc_attr($panel_id); ?>" class="TabbedPanels">
     426                        <ul class="TabbedPanelsTabGroup ">
     427                            <li class="TabbedPanelsTab " tabindex="1">
     428                                <span><strong><?php esc_html_e($panel['title'], 'neon-product-designer'); ?></strong></span>
     429                            </li>
     430                        </ul>
     431
     432                        <div class="TabbedPanelsContentGroup">
     433                            <div class="TabbedPanelsContent">
     434                                <div class='npd-grid npd-grid-pad'>
     435                                    <?php echo $panel['content'];
     436                                    ?>
    417437                                </div>
    418438                            </div>
    419                         <?php
    420                         $panel_id += 1;
    421                     }
     439                        </div>
     440                    </div>
     441                    <?php
     442                    $panel_id += 1;
     443                }
    422444                ?>
    423            
     445
    424446            </div>
    425             <input type="hidden" name="npdw-nonce-security" value="<?php echo esc_attr(wp_create_nonce('npdw-nonce-security-action')) ;?>" class="">
    426             <input type="submit" value="<?php esc_attr_e( 'Save', 'neon-product-designer' ); ?>" class="button button-primary button-large mg-top-10-i">
     447            <input type="hidden" name="npdw-nonce-security"
     448                value="<?php echo esc_attr(wp_create_nonce('npdw-nonce-security-action')); ?>" class="">
     449            <input type="submit" value="<?php esc_attr_e('Save', 'neon-product-designer'); ?>"
     450                class="button button-primary button-large mg-top-10-i">
    427451        </form>
    428452        <?php
     
    432456     * Save the settings
    433457     */
    434     private function save_npd_settings_tab_options() {
    435         if(isset($_POST['npdw-nonce-security']))
    436         {
    437             if ( wp_verify_nonce($_POST['npdw-nonce-security'], 'npdw-nonce-security-action')) {
    438                
    439                 if ( isset( $_POST ) && ! empty( $_POST ) ) {
    440                     foreach ( $_POST as $key => $values ) {
    441                         $opt_value = map_deep( $values, 'sanitize_text_field' );
    442                         update_option( $key, $opt_value);
     458    private function save_npd_settings_tab_options()
     459    {
     460        if (isset($_POST['npdw-nonce-security'])) {
     461            if (wp_verify_nonce($_POST['npdw-nonce-security'], 'npdw-nonce-security-action')) {
     462
     463                if (isset($_POST) && !empty($_POST)) {
     464                    foreach ($_POST as $key => $values) {
     465                        $opt_value = map_deep($values, 'sanitize_text_field');
     466                        update_option($key, $opt_value);
    443467                    }
    444                    
     468
    445469                    $this->init_globals();
    446470                    ?>
    447                     <div id="message" class="updated below-h2"><p><?php echo __( 'Settings successfully saved.', 'neon-product-designer' ); ?></p></div>
     471                    <div id="message" class="updated below-h2">
     472                        <p><?php echo __('Settings successfully saved.', 'neon-product-designer'); ?></p>
     473                    </div>
    448474                    <?php
    449475                }
     
    458484     * @param type $option_array
    459485     */
    460     public function transform_checkbox_value( $option_name, $option_array ) {
    461         foreach ( $option_array as $option ) {
    462             if ( ! isset( $_POST[ $option_name ][ $option ] ) ) {
    463                 $_POST[ $option_name ][ $option ] = 'no';
     486    public function transform_checkbox_value($option_name, $option_array)
     487    {
     488        foreach ($option_array as $option) {
     489            if (!isset($_POST[$option_name][$option])) {
     490                $_POST[$option_name][$option] = 'no';
    464491            }
    465492        }
     
    469496
    470497    // Builds the general settings options
    471     private function get_general_settings() {
     498    private function get_general_settings()
     499    {
    472500        $options = array();
    473501
    474502        $general_options_begin = array(
    475             'type'  => 'sectionbegin',
    476             'id'    => 'npd-general-options',
    477             'table' => 'options',
    478             'title' => __( 'General Settings', 'neon-product-designer' ),
     503            'type' => 'sectionbegin',
     504            'id' => 'npd-general-options',
     505            'table' => 'options',
     506            'title' => __('General Settings', 'neon-product-designer'),
    479507        );
    480508
    481509        $args = array(
    482510            'post_type' => 'page',
    483             'nopaging'  => true,
     511            'nopaging' => true,
    484512        );
    485513
    486514        $customizer_page = array(
    487             'title'   => __( 'Design page', 'neon-product-designer' ),
    488             'desc'    => __( 'This setting allows the plugin to locate the page where customizations are made. Please note that this page can only be accessed by our plugin and should not appear in any menu.', 'neon-product-designer' ),
    489             'name'    => 'npd-general-options[page_id]',
    490             'type'    => 'post-type',
     515            'title' => __('Design page', 'neon-product-designer'),
     516            'desc' => __('This setting allows the plugin to locate the page where customizations are made. Please note that this page can only be accessed by our plugin and should not appear in any menu.', 'neon-product-designer'),
     517            'name' => 'npd-general-options[page_id]',
     518            'type' => 'post-type',
    491519            'default' => '',
    492             'table' => 'options',
    493             'class'   => 'chosen_select_nostd',
    494             'args'    => $args,
     520            'table' => 'options',
     521            'class' => 'chosen_select_nostd',
     522            'args' => $args,
    495523        );
    496524
    497525        $content_filter = array(
    498             'title'   => __( 'Manage the configuration page', 'neon-product-designer' ),
    499             'name'    => 'npd-general-options[npd-content-filter]',
     526            'title' => __('Manage the configuration page', 'neon-product-designer'),
     527            'name' => 'npd-general-options[npd-content-filter]',
    500528            'default' => '1',
    501             'type'    => 'radio',
    502             'table' => 'options',
    503             'desc'    => __( 'If yes, automatically append editor to the design page. This option allows you to define whether or not you want to use a shortcode to display the the customizer in the selected page.', 'neon-product-designer' ),
     529            'type' => 'radio',
     530            'table' => 'options',
     531            'desc' => __('If yes, automatically append editor to the design page. This option allows you to define whether or not you want to use a shortcode to display the the customizer in the selected page.', 'neon-product-designer'),
    504532            'options' => array(
    505                 '1' => __( 'Yes', 'neon-product-designer' ),
    506                 '0' => __( 'No', 'neon-product-designer' ),
    507             ),
    508             'class'   => 'chosen_select_nostd',
     533                '1' => __('Yes', 'neon-product-designer'),
     534                '0' => __('No', 'neon-product-designer'),
     535            ),
     536            'class' => 'chosen_select_nostd',
    509537        );
    510538
    511539        $customizer_cart_display = array(
    512             'title'   => __( 'Parts position in cart', 'neon-product-designer' ),
    513             'name'    => 'npd-general-options[npd-parts-position-cart]',
     540            'title' => __('Parts position in cart', 'neon-product-designer'),
     541            'name' => 'npd-general-options[npd-parts-position-cart]',
    514542            'default' => 'thumbnail',
    515             'type'    => 'radio',
    516             'table' => 'options',
    517             'desc'    => __( 'This option allows you to set where to show your customized products parts on the cart page', 'neon-product-designer' ),
     543            'type' => 'radio',
     544            'table' => 'options',
     545            'desc' => __('This option allows you to set where to show your customized products parts on the cart page', 'neon-product-designer'),
    518546            'options' => array(
    519                 'thumbnail' => __( 'Thumbnail column', 'neon-product-designer' ),
    520                 'name'      => __( 'Name column', 'neon-product-designer' ),
    521             ),
    522             'class'   => 'chosen_select_nostd',
     547                'thumbnail' => __('Thumbnail column', 'neon-product-designer'),
     548                'name' => __('Name column', 'neon-product-designer'),
     549            ),
     550            'class' => 'chosen_select_nostd',
    523551        );
    524552
    525553        $send_attachments = array(
    526             'title'   => __( 'Send the design as an attachment', 'neon-product-designer' ),
    527             'name'    => 'npd-general-options[npd-send-design-mail]',
     554            'title' => __('Send the design as an attachment', 'neon-product-designer'),
     555            'name' => 'npd-general-options[npd-send-design-mail]',
    528556            'default' => '1',
    529             'type'    => 'radio',
    530             'table' => 'options',
    531             'desc'    => __( 'This option allows you to send or not the design by mail after checkout', 'neon-product-designer' ),
     557            'type' => 'radio',
     558            'table' => 'options',
     559            'desc' => __('This option allows you to send or not the design by mail after checkout', 'neon-product-designer'),
    532560            'options' => array(
    533                 '1' => __( 'Yes', 'neon-product-designer' ),
    534                 '0' => __( 'No', 'neon-product-designer' ),
    535             ),
    536             'class'   => 'chosen_select_nostd',
    537         );
    538 
    539         $cart_button                   = array(
    540             'title'   => __( 'Add to cart', 'neon-product-designer' ),
    541             'name'    => 'npd-general-options[npd-cart-btn]',
     561                '1' => __('Yes', 'neon-product-designer'),
     562                '0' => __('No', 'neon-product-designer'),
     563            ),
     564            'class' => 'chosen_select_nostd',
     565        );
     566
     567        $cart_button = array(
     568            'title' => __('Add to cart', 'neon-product-designer'),
     569            'name' => 'npd-general-options[npd-cart-btn]',
    542570            'default' => '1',
    543             'type'    => 'radio',
    544             'table' => 'options',
    545             'desc'    => __( 'This option allows you to show/hide the cart button on the customization page', 'neon-product-designer' ),
     571            'type' => 'radio',
     572            'table' => 'options',
     573            'desc' => __('This option allows you to show/hide the cart button on the customization page', 'neon-product-designer'),
    546574            'options' => array(
    547                 '1' => __( 'Yes', 'neon-product-designer' ),
    548                 '0' => __( 'No', 'neon-product-designer' ),
    549             ),
    550             'class'   => 'chosen_select_nostd',
     575                '1' => __('Yes', 'neon-product-designer'),
     576                '0' => __('No', 'neon-product-designer'),
     577            ),
     578            'class' => 'chosen_select_nostd',
    551579        );
    552580        $hide_design_buttons_cart_page = array(
    553             'title'   => __( 'Hide design buttons on shop page', 'neon-product-designer' ),
    554             'name'    => 'npd-general-options[npd-hide-btn-shop-pages]',
     581            'title' => __('Hide design buttons on shop page', 'neon-product-designer'),
     582            'name' => 'npd-general-options[npd-hide-btn-shop-pages]',
    555583            'default' => '0',
    556             'type'    => 'radio',
    557             'table' => 'options',
    558             'desc'    => __( 'This option allows you to show/hide the cart button on the customization page', 'neon-product-designer' ),
     584            'type' => 'radio',
     585            'table' => 'options',
     586            'desc' => __('This option allows you to show/hide the cart button on the customization page', 'neon-product-designer'),
    559587            'options' => array(
    560                 '1' => __( 'Yes', 'neon-product-designer' ),
    561                 '0' => __( 'No', 'neon-product-designer' ),
    562             ),
    563             'class'   => 'chosen_select_nostd',
    564         );
    565         $add_to_cart_action            = array(
    566             'title'   => __( 'Redirect after adding a custom design to the cart?', 'neon-product-designer' ),
    567             'name'    => 'npd-general-options[npd-redirect-after-cart]',
     588                '1' => __('Yes', 'neon-product-designer'),
     589                '0' => __('No', 'neon-product-designer'),
     590            ),
     591            'class' => 'chosen_select_nostd',
     592        );
     593        $add_to_cart_action = array(
     594            'title' => __('Redirect after adding a custom design to the cart?', 'neon-product-designer'),
     595            'name' => 'npd-general-options[npd-redirect-after-cart]',
    568596            'default' => '0',
    569             'type'    => 'radio',
    570             'table' => 'options',
    571             'desc'    => __( 'This option allows you to define what to do after adding a design to the cart', 'neon-product-designer' ),
     597            'type' => 'radio',
     598            'table' => 'options',
     599            'desc' => __('This option allows you to define what to do after adding a design to the cart', 'neon-product-designer'),
    572600            'options' => array(
    573                 '1' => __( 'Yes', 'neon-product-designer' ),
    574                 '0' => __( 'No', 'neon-product-designer' ),
    575             ),
    576             'class'   => 'chosen_select_nostd',
     601                '1' => __('Yes', 'neon-product-designer'),
     602                '0' => __('No', 'neon-product-designer'),
     603            ),
     604            'class' => 'chosen_select_nostd',
    577605        );
    578606
    579607        $hide_requirements_notices = array(
    580             'title'     => __( 'Hide requirements notices', 'neon-product-designer' ),
    581             'name'      => 'npd-general-options[hide-requirements-notices]',
    582             'default'   => '0',
    583             'type'      => 'radio',
    584             'table' => 'options',
    585             'desc'      => __( 'This option allows you to define whether or not you want to hide the requirement notice.', 'neon-product-designer' ),
    586             'options'   => array(
    587                 '0' => __( 'No', 'neon-product-designer' ),
    588                 '1' => __( 'Yes', 'neon-product-designer' ),
     608            'title' => __('Hide requirements notices', 'neon-product-designer'),
     609            'name' => 'npd-general-options[hide-requirements-notices]',
     610            'default' => '0',
     611            'type' => 'radio',
     612            'table' => 'options',
     613            'desc' => __('This option allows you to define whether or not you want to hide the requirement notice.', 'neon-product-designer'),
     614            'options' => array(
     615                '0' => __('No', 'neon-product-designer'),
     616                '1' => __('Yes', 'neon-product-designer'),
    589617            ),
    590618            'row_class' => 'npd_hide_requirements',
    591             'class'     => 'chosen_select_nostd',
     619            'class' => 'chosen_select_nostd',
    592620        );
    593621
    594622        $hide_cart_button_for_custom_products = array(
    595             'title'   => __( 'Hide add to cart button for custom products', 'neon-product-designer' ),
    596             'name'    => 'npd-general-options[npd-hide-cart-button]',
     623            'title' => __('Hide add to cart button for custom products', 'neon-product-designer'),
     624            'name' => 'npd-general-options[npd-hide-cart-button]',
    597625            'default' => '1',
    598             'type'    => 'radio',
    599             'table' => 'options',
    600             'desc'    => __( 'This option allows you to define whether or not you want to hide the add to cart button for custom products on the products page.', 'neon-product-designer' ),
     626            'type' => 'radio',
     627            'table' => 'options',
     628            'desc' => __('This option allows you to define whether or not you want to hide the add to cart button for custom products on the products page.', 'neon-product-designer'),
    601629            'options' => array(
    602                 '1' => __( 'Yes', 'neon-product-designer' ),
    603                 '0' => __( 'No', 'neon-product-designer' ),
    604             ),
    605             'class'   => 'chosen_select_nostd',
     630                '1' => __('Yes', 'neon-product-designer'),
     631                '0' => __('No', 'neon-product-designer'),
     632            ),
     633            'class' => 'chosen_select_nostd',
    606634        );
    607635
    608636        $follow_scroll = array(
    609             'title'   => __( 'Follow scroll', 'neon-product-designer' ),
    610             'name'    => 'npd-general-options[follow-scroll]',
     637            'title' => __('Follow scroll', 'neon-product-designer'),
     638            'name' => 'npd-general-options[follow-scroll]',
    611639            'default' => '1',
    612             'type'    => 'radio',
    613             'table' => 'options',
    614             'desc'    => __( 'This option allows you to define whether or not you want to enable follow scroll.', 'neon-product-designer' ),
     640            'type' => 'radio',
     641            'table' => 'options',
     642            'desc' => __('This option allows you to define whether or not you want to enable follow scroll.', 'neon-product-designer'),
    615643            'options' => array(
    616                 '1' => __( 'Yes', 'neon-product-designer' ),
    617                 '0' => __( 'No', 'neon-product-designer' ),
    618             ),
    619             'class'   => 'chosen_select_nostd',
    620         );
    621 
    622         $general_options_end = array( 'type' => 'sectionend' );
    623        
     644                '1' => __('Yes', 'neon-product-designer'),
     645                '0' => __('No', 'neon-product-designer'),
     646            ),
     647            'class' => 'chosen_select_nostd',
     648        );
     649
     650        $general_options_end = array('type' => 'sectionend');
     651
    624652        //array_push( $options, $nonce_security );
    625         array_push( $options, $general_options_begin );
    626         array_push( $options, $customizer_page );
    627         array_push( $options, $content_filter );
    628         array_push( $options, $customizer_cart_display );
    629         array_push( $options, $send_attachments );
    630         array_push( $options, $cart_button );
    631         array_push( $options, $add_to_cart_action );
    632         array_push( $options, $hide_cart_button_for_custom_products );
    633         array_push( $options, $hide_design_buttons_cart_page );
    634         array_push( $options, $hide_requirements_notices );
    635         array_push( $options, $follow_scroll );
    636         array_push( $options, $general_options_end );
    637         $options = apply_filters( 'npd_general_options', $options );
    638         return Kali_Admin_Tools::get_fields( $options );
     653        array_push($options, $general_options_begin);
     654        array_push($options, $customizer_page);
     655        array_push($options, $content_filter);
     656        array_push($options, $customizer_cart_display);
     657        array_push($options, $send_attachments);
     658        array_push($options, $cart_button);
     659        array_push($options, $add_to_cart_action);
     660        array_push($options, $hide_cart_button_for_custom_products);
     661        array_push($options, $hide_design_buttons_cart_page);
     662        array_push($options, $hide_requirements_notices);
     663        array_push($options, $follow_scroll);
     664        array_push($options, $general_options_end);
     665        $options = apply_filters('npd_general_options', $options);
     666        return Kali_Admin_Tools::get_fields($options);
    639667    }
    640668
     
    646674     * @global array $npd_settings
    647675     */
    648     function notify_customization_page_missing() {
    649         $options      = get_option('npd-general-options');
    650         $hide_notices = Kali_Admin_Tools::get_parse_value( $options, 'hide-requirements-notices', false );
    651         if ( isset( $options['page_id'] ) ) {
     676    function notify_customization_page_missing()
     677    {
     678        $options = get_option('npd-general-options');
     679        $hide_notices = Kali_Admin_Tools::get_parse_value($options, 'hide-requirements-notices', false);
     680        if (isset($options['page_id'])) {
    652681            $npd_page_id = $options['page_id'];
    653682        } else {
     
    655684        }
    656685
    657         $settings_url = get_bloginfo( 'url' ) . '/wp-admin/admin.php?page=npd-manage-settings';
    658         if ( ! class_exists( 'WooCommerce' ) ) {
     686        $settings_url = get_bloginfo('url') . '/wp-admin/admin.php?page=npd-manage-settings';
     687        if (!class_exists('WooCommerce')) {
    659688            echo '<div class="error">
    660689                       <p><b>Neon Product Designer: </b>WooCommerce is not installed on your website. You will not be able to use the features of the plugin.</p>
    661690                    </div>';
    662691        } else {
    663             if ( empty( $npd_page_id ) ) {
     692            if (empty($npd_page_id)) {
    664693                echo '<div class="error">
    665694                       <p><b>Neon Product Designer: </b>The design page is not defined. Please configure it in <a href="' . esc_url($settings_url) . '">plugin settings page</a>: .</p>
    666695                    </div>';
    667696            }
    668             if ( ! extension_loaded( 'zip' ) && ! $hide_notices ) {
     697            if (!extension_loaded('zip') && !$hide_notices) {
    669698                echo '<div class="error">
    670699                       <p><b>Neon Product Designer: </b>ZIP extension not loaded on this server. You won\'t be able to generate zip outputs.</p>
     
    682711     * Alerts the administrator if the minimum requirements are not met
    683712     */
    684     function notify_minmimum_required_parameters() {
     713    function notify_minmimum_required_parameters()
     714    {
    685715        global $npd_settings;
    686         $general_options = Kali_Admin_Tools::get_parse_value( $npd_settings, 'npd-general-options' );
    687         $hide_notices    = Kali_Admin_Tools::get_parse_value( $general_options, 'hide-requirements-notices', false );
     716        $general_options = Kali_Admin_Tools::get_parse_value($npd_settings, 'npd-general-options');
     717        $hide_notices = Kali_Admin_Tools::get_parse_value($general_options, 'hide-requirements-notices', false);
    688718        $allowed_html = array(
    689             'a'      => array(
    690                 'href' => array(),
    691                 'title' => array(),
    692                 'class' =>array(),
    693             ),
    694             'div'      => array(
    695                 'class' => array(),
    696                 'id' => array(),
    697             ),
    698             'br'    => array(),
    699             'b'    => array(),
    700             'em'    => array(),
    701             'strong' => array(),
    702         );
    703         if ( $hide_notices ) {
     719            'a' => array(
     720                'href' => array(),
     721                'title' => array(),
     722                'class' => array(),
     723            ),
     724            'div' => array(
     725                'class' => array(),
     726                'id' => array(),
     727            ),
     728            'br' => array(),
     729            'b' => array(),
     730            'em' => array(),
     731            'strong' => array(),
     732        );
     733        if ($hide_notices) {
    704734            return;
    705735        }
    706        
    707 
    708         $message              = '';
    709         $permalinks_structure = get_option( 'permalink_structure' );
    710         if ( strpos( $permalinks_structure, 'index.php' ) !== false ) {
     736
     737
     738        $message = '';
     739        $permalinks_structure = get_option('permalink_structure');
     740        if (strpos($permalinks_structure, 'index.php') !== false) {
    711741            $message .= 'Your permalinks structure is currently set to <b>custom</b> with index.php present in the structure. We recommand to set this value to <b>Post name</b> to avoid any issue with our plugin.<br>';
    712742        }
    713         if ( ! empty( $message ) ) {
    714             echo '<div class="error"><p><b>Neon Product Designer: </b><br>' . wp_kses($message,$allowed_html) . '</p></div>';
    715         }
    716     }
    717 
    718     public function npd_check_filetype_and_ext($data, $file, $filename, $mimes, $real_mime) {
    719         if ( ! empty( $data['ext'] ) && ! empty( $data['type'] ) ) {
    720             return $data;
    721         }
    722 
    723         $wp_file_type = wp_check_filetype( $filename, $mimes );
    724 
    725         // Check for the file type you want to enable, e.g. 'svg'.
    726         if ( 'ttf' === $wp_file_type['ext'] ) {
    727             $data['ext'] = 'ttf';
    728             $data['type'] = 'font/ttf';
    729         }
    730 
    731         if ( 'otf' === $wp_file_type['ext'] ) {
    732             $data['ext'] = 'otf';
    733             $data['type'] = 'font/otf';
    734         }
    735 
    736         return $data;
    737     }
    738 
     743        if (!empty($message)) {
     744            echo '<div class="error"><p><b>Neon Product Designer: </b><br>' . wp_kses($message, $allowed_html) . '</p></div>';
     745        }
     746    }
     747
     748    public function npd_check_filetype_and_ext($data, $file, $filename, $mimes, $real_mime)
     749    {
     750        if (!empty($data['ext']) && !empty($data['type'])) {
     751            return $data;
     752        }
     753
     754        $wp_file_type = wp_check_filetype($filename, $mimes);
     755
     756        // Check for the file type you want to enable, e.g. 'svg'.
     757        if ('ttf' === $wp_file_type['ext']) {
     758            $data['ext'] = 'ttf';
     759            $data['type'] = 'font/ttf';
     760        }
     761
     762        if ('otf' === $wp_file_type['ext']) {
     763            $data['ext'] = 'otf';
     764            $data['type'] = 'font/otf';
     765        }
     766
     767        return $data;
     768    }
     769    public function npd_clean_promo_widget_products()
     770    {
     771        // Vérifier si l'utilisateur a déjà dismissé la promo
     772        if (get_user_meta(get_current_user_id(), 'npd_clean_promo_dismissed', true)) {
     773            return;
     774        }
     775
     776        // Vérifier si l'utilisateur a choisi "Plus tard"
     777        $later_time = get_user_meta(get_current_user_id(), 'npd_clean_promo_later', true);
     778        if ($later_time && time() < $later_time) {
     779            return;
     780        }
     781
     782        // Si le délai "Plus tard" est écoulé, supprimer la meta
     783        if ($later_time && time() >= $later_time) {
     784            delete_user_meta(get_current_user_id(), 'npd_clean_promo_later');
     785        }
     786
     787        // Liste des produits à promouvoir
     788        $promoted_products = [
     789            [
     790                'slug' => 'neon-product-designer',
     791                'name' => __('Neon Channel Product Customizer Free', 'neon-product-designer'),
     792                'description' => __('Advanced product customization tool with real-time preview, and unlimited design options like backboard, height auto calculator.', 'neon-product-designer'),
     793                'icon' => plugin_dir_url(__FILE__) . 'images/im_ncpc-icon.png',
     794                'url' => 'https://wordpress.org/plugins/neon-channel-product-customizer-free/',
     795                'features' => [__('Easy Setup', 'neon-product-designer'), __('Profitable', 'neon-product-designer'), __('Multi Language', 'neon-product-designer'), __('Real-time Preview', 'neon-product-designer'), __('Height Auto Calculator', 'neon-product-designer')],
     796                'is_new' => true,
     797                'demo_url' => 'https://demos.signsdesigner.us/aso-live-demo/',
     798                'type' => 'wordpress'
     799            ],
     800            [
     801                'slug' => 'all-signs-options-free',
     802                'name' => __('All Signs Options (ASO)', 'neon-product-designer'),
     803                'description' => __('Expand beyond neon signs with custom stickers, banners, magnetic plates, and plastic signs. Easy setup, powerful features.', 'neon-product-designer'),
     804                'icon' => plugin_dir_url(__FILE__) . 'images/im_asowp-icon.png',
     805                'url' => 'https://wordpress.org/plugins/all-signs-options-free/',
     806                'features' => [__('Multi-product', 'neon-product-designer'), __('Easy Setup', 'neon-product-designer'), __('Multi Language', 'neon-product-designer'), __('Profitable', 'neon-product-designer')],
     807                'is_new' => true,
     808                'demo_url' => 'https://demos.signsdesigner.us/ncpc-live-demo/',
     809                'type' => 'wordpress'
     810            ]
     811
     812        ];
     813
     814        ?>
     815        <div id="npd-clean-promo-widget" class="notice notice-info npd-clean-promo-widget">
     816            <!-- En-tête -->
     817            <div class="npd-clean-promo-header">
     818                <h3 class="npd-clean-promo-title">
     819                    <span class="npd-clean-promo-title-icon">🚀</span>
     820                    <?php _e('Boost Your Store with These Amazing Tools', 'neon-product-designer'); ?>
     821                </h3>
     822                <p class="npd-clean-promo-subtitle">
     823                    <?php _e('Discover powerful plugins to enhance your product customization capabilities and increase sales.', 'neon-product-designer'); ?>
     824                </p>
     825            </div>
     826
     827            <!-- Container des produits -->
     828            <div class="npd-clean-products-container">
     829                <div class="npd-clean-products-grid">
     830                    <?php foreach ($promoted_products as $product): ?>
     831                        <div class="npd-clean-product-card" data-product-slug="<?php echo esc_attr($product['slug']); ?>">
     832                            <?php if ($product['is_new']): ?>
     833                                <div class="npd-clean-new-badge"><?php _e('New', 'neon-product-designer'); ?></div>
     834                            <?php endif; ?>
     835
     836                            <div class="npd-clean-product-content">
     837                                <div class="npd-clean-product-icon">
     838                                    <!-- <?php echo $product['icon']; ?> -->
     839                                    <img src="<?php echo esc_url($product['icon']); ?>"
     840                                        alt="<?php echo esc_attr($product['name']); ?>" class="npd-clean-product-icon-image" />
     841                                </div>
     842
     843                                <div class="npd-clean-product-info">
     844                                    <h4 class="npd-clean-product-name"><?php echo esc_html($product['name']); ?></h4>
     845                                    <p class="npd-clean-product-description"><?php echo esc_html($product['description']); ?></p>
     846
     847                                    <?php if (!empty($product['features'])): ?>
     848                                        <div class="npd-clean-product-features">
     849                                            <?php foreach ($product['features'] as $feature): ?>
     850                                                <span class="npd-clean-feature-tag"><?php echo esc_html($feature); ?></span>
     851                                            <?php endforeach; ?>
     852                                        </div>
     853                                    <?php endif; ?>
     854
     855                                    <div class="npd-clean-product-actions">
     856                                        <a href="<?php echo esc_url($product['url']); ?>" target="_blank"
     857                                            class="npd-clean-btn npd-clean-btn-primary npd-clean-discover-plugin"
     858                                            data-plugin="<?php echo esc_attr($product['slug']); ?>"
     859                                            data-type="<?php echo esc_attr($product['type']); ?>">
     860                                            <span>👀</span>
     861                                            <?php
     862                                            if ($product['type'] === 'premium') {
     863                                                _e('View Details', 'neon-product-designer');
     864                                            } else {
     865                                                _e('View Plugin', 'neon-product-designer');
     866                                            }
     867                                            ?>
     868                                        </a>
     869                                        <?php if (!empty($product['demo_url'])): ?>
     870                                            <a href="<?php echo esc_url($product['demo_url']); ?>" target="_blank"
     871                                                class="npd-clean-btn npd-clean-btn-demo npd-clean-view-demo"
     872                                                data-plugin="<?php echo esc_attr($product['slug']); ?>">
     873                                                <span>🚀</span>
     874                                                <?php _e('Live Demo', 'neon-channel-product-customizer-free'); ?>
     875                                            </a>
     876                                        <?php endif; ?>
     877
     878                                        <?php if ($product['type'] === 'wordpress'): ?>
     879                                            <a href="<?php echo admin_url('plugin-install.php?s=' . urlencode($product['name']) . '&tab=search&type=term'); ?>"
     880                                                class="npd-clean-btn npd-clean-btn-secondary npd-clean-install-plugin"
     881                                                data-plugin="<?php echo esc_attr($product['slug']); ?>">
     882                                                <span>⬇️</span>
     883                                                <?php _e('Install', 'neon-product-designer'); ?>
     884                                            </a>
     885                                        <?php endif; ?>
     886                                    </div>
     887                                </div>
     888                            </div>
     889                        </div>
     890                    <?php endforeach; ?>
     891                </div>
     892            </div>
     893
     894            <!-- Pied de page avec actions globales -->
     895            <div class="npd-clean-promo-footer">
     896                <div class="npd-clean-footer-actions">
     897                    <a href="#" class="npd-clean-btn npd-clean-btn-secondary npd-clean-btn-footer npd-clean-dismiss-promo"
     898                        data-action="done">
     899                        <?php _e('Hide these suggestions', 'neon-product-designer'); ?>
     900                    </a>
     901                    <a href="#" class="npd-clean-btn npd-clean-btn-primary npd-clean-btn-footer npd-clean-dismiss-promo"
     902                        data-action="later">
     903                        <?php _e('Remind me later', 'neon-product-designer'); ?>
     904                    </a>
     905                </div>
     906
     907                <a href="#" class="npd-clean-dismiss-link npd-clean-dismiss-promo" data-action="done">
     908                    <?php _e('✕ Close permanently', 'neon-product-designer'); ?>
     909                </a>
     910            </div>
     911        </div>
     912        <?php
     913        wp_localize_script('npd-free-promo', "npdPromoNonce", wp_create_nonce('npd_clean_promo_nonce'));
     914        wp_localize_script('npd-free-promo', "npd_clean_tracking_nonce", wp_create_nonce('npd_clean_tracking_nonce'));
     915    }
     916
     917    public function npd_clean_handle_dismiss_promo()
     918    {
     919        check_ajax_referer('npd_clean_promo_nonce', 'nonce');
     920
     921        $action = sanitize_text_field($_POST['dismiss_action']);
     922        $user_id = get_current_user_id();
     923
     924        if ($action === 'done') {
     925            update_user_meta($user_id, 'npd_clean_promo_dismissed', true);
     926        } elseif ($action === 'later') {
     927            // Rappel dans 7 jours
     928            $later_time = time() + (7 * 24 * 60 * 60);
     929            update_user_meta($user_id, 'npd_clean_promo_later', $later_time);
     930        }
     931
     932        wp_die();
     933    }
     934
     935    // Handler AJAX pour le tracking
     936    public function npd_clean_handle_tracking()
     937    {
     938        check_ajax_referer('npd_clean_tracking_nonce', 'nonce');
     939
     940        $plugin_slug = sanitize_text_field($_POST['plugin_slug']);
     941        $plugin_type = sanitize_text_field($_POST['plugin_type']);
     942        $action_type = sanitize_text_field($_POST['action_type']);
     943
     944        // Enregistrer les statistiques si nécessaire
     945        $stats = get_option('npd_clean_promo_stats', []);
     946        $date = date('Y-m-d');
     947
     948        if (!isset($stats[$date])) {
     949            $stats[$date] = [];
     950        }
     951
     952        if (!isset($stats[$date][$plugin_slug])) {
     953            $stats[$date][$plugin_slug] = [
     954                'views' => 0,
     955                'installs' => 0
     956            ];
     957        }
     958
     959        if ($action_type === 'view') {
     960            $stats[$date][$plugin_slug]['views']++;
     961        } elseif ($action_type === 'install') {
     962            $stats[$date][$plugin_slug]['installs']++;
     963        }
     964
     965        update_option('npd_clean_promo_stats', $stats);
     966
     967        wp_die();
     968    }
    739969
    740970}
  • neon-product-designer-for-woocommerce/trunk/admin/css/neon-product-designer-admin.css

    r2937134 r3337250  
    44 */
    55
    6  .font_style_table {
    7     width: 100%;
    8     border: 1px solid #DFD8D8;
    9     margin-top: 10px;
    10     border-spacing: 0;
     6.font_style_table {
     7  width: 100%;
     8  border: 1px solid #dfd8d8;
     9  margin-top: 10px;
     10  border-spacing: 0;
    1111}
    1212.font_style_table thead {
    13     border-bottom: 1px solid #DFD8D8;
    14 }
    15  .font_style_table th {
    16     width: 33%;
    17     padding: 8px 0px;
    18     border-bottom: 1px solid #DFD8D8;
    19     border-right: 1px solid #DFD8D8;
    20 }
    21 #toplevel_page_npd-manage-dashboard .wp-menu-image img{
    22     width: 25px;
    23     height: auto;
    24 }
    25 
    26 #npd-texts-options table tbody tr{
    27     width: 50%;
    28     display: inline-block;
    29 }
    30 .select2-selection{
    31    min-width: 200px;
    32 }
    33 .pattern_option{
    34    min-width: 200px;
    35 }
    36 #bouton{
    37    background-color: green;
    38    border-radius: 5px;
    39    padding: 10px 20px;
    40    text-decoration: none;
    41    text-align: center;
    42    color: white;
    43    margin-top: 5px;
    44    font-size: 15px;
     13  border-bottom: 1px solid #dfd8d8;
     14}
     15.font_style_table th {
     16  width: 33%;
     17  padding: 8px 0px;
     18  border-bottom: 1px solid #dfd8d8;
     19  border-right: 1px solid #dfd8d8;
     20}
     21#toplevel_page_npd-manage-dashboard .wp-menu-image img {
     22  width: 25px;
     23  height: auto;
     24}
     25
     26#npd-texts-options table tbody tr {
     27  width: 50%;
     28  display: inline-block;
     29}
     30.select2-selection {
     31  min-width: 200px;
     32}
     33.pattern_option {
     34  min-width: 200px;
     35}
     36#bouton {
     37  background-color: green;
     38  border-radius: 5px;
     39  padding: 10px 20px;
     40  text-decoration: none;
     41  text-align: center;
     42  color: white;
     43  margin-top: 5px;
     44  font-size: 15px;
    4545}
    4646
    4747/*UI STYLES START*/
    48 .remove-rf-row{
    49    border-radius: 50%;
    50    padding: 3px;
    51    opacity: 1;
    52    border: silver 1px solid;
    53    background-color: white!important;
    54 }
    5548.remove-rf-row {
    56     background: url(../images/sprite.png) -66px -116px no-repeat #fff;
    57     display: block;
    58     height: 12px;
    59     width: 12px;
    60     border-radius: 50%;
    61     box-shadow: 0 0 3px rgb(0 0 0 / 30%);
     49  border-radius: 50%;
     50  padding: 3px;
     51  opacity: 1;
     52  border: silver 1px solid;
     53  background-color: white !important;
     54}
     55.remove-rf-row {
     56  background: url(../images/sprite.png) -66px -116px no-repeat #fff;
     57  display: block;
     58  height: 12px;
     59  width: 12px;
     60  border-radius: 50%;
     61  box-shadow: 0 0 3px rgb(0 0 0 / 30%);
    6262}
    6363.remove-rf-row:hover {
    64     background: url(../images/sprite.png) -66px -166px no-repeat #fff;
    65     color:red !important;
     64  background: url(../images/sprite.png) -66px -166px no-repeat #fff;
     65  color: red !important;
    6666}
    6767.block-form .label {
    68     background-color: #F3F5FF;
    69     width: 25%;
    70     font-weight: bold;
    71     color: #000;
    72 }
    73 .block-form .kali-desc, .kali-wrap > label {
     68  background-color: #f3f5ff;
     69  width: 25%;
     70  font-weight: bold;
     71  color: #000;
     72}
     73.block-form .kali-desc,
     74.kali-wrap > label {
    7475  font-weight: normal;
    7576  line-height: 16px;
     
    7879  color: #000;
    7980}
    80 table.widefat,table.repeatable-fields-table{
     81table.widefat,
     82table.repeatable-fields-table {
    8183  table-layout: fixed;
    8284}
    83 .block-form td textarea{
     85.block-form td textarea {
    8486  max-width: 100%;
    8587  width: 100%;
     
    8991
    9092.meta-box-sortables input {
    91     vertical-align: middle;
    92     max-width: 100%;
     93  vertical-align: middle;
     94  max-width: 100%;
    9395}
    9496
    9597.media-preview img {
    96     max-width: 50px;
    97     max-height: 50px;
    98 }
    99 
    100 .npdw-disabed-options{
    101    display: none !important;
    102 }
    103 
    104 .npd-cart-item-data-wrap{
    105   display: flex;
    106     justify-content: space-between;
    107     padding: 5px;
    108 }
    109 .npd-cart-item-data-container{
     98  max-width: 50px;
     99  max-height: 50px;
     100}
     101
     102.npdw-disabed-options {
     103  display: none !important;
     104}
     105
     106.npd-cart-item-data-wrap {
     107  display: flex;
     108  justify-content: space-between;
     109  padding: 5px;
     110}
     111.npd-cart-item-data-container {
    110112  max-width: 300px;
    111113  margin-bottom: 20px;
    112114  border: 1px solid #e8e8e8;
    113115}
    114 .npd-cart-item-data-wrap:nth-child(even){
    115   background-color:#e8e8e8;
    116 }
    117 .cart-item-data-color{
     116.npd-cart-item-data-wrap:nth-child(even) {
     117  background-color: #e8e8e8;
     118}
     119.cart-item-data-color {
    118120  display: inline-block;
    119121  width: 30px;
     
    123125  vertical-align: middle;
    124126}
    125 .npd-cartitem-img{
     127.npd-cartitem-img {
    126128  height: auto;
    127129  width: 100px;
    128     max-width: 100px
    129 }
     130  max-width: 100px;
     131}
     132
     133/** Notice for others plugin*/
     134.npd-free-notation-widget {
     135  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
     136  border-radius: 8px;
     137  padding: 15px 20px;
     138  margin: 20px 0;
     139  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
     140  color: white;
     141  position: relative;
     142  overflow: hidden;
     143}
     144
     145.npd-free-notation-widget::before {
     146  content: "";
     147  position: absolute;
     148  top: -50%;
     149  right: -50%;
     150  width: 100px;
     151  height: 100px;
     152  background: rgba(255, 255, 255, 0.1);
     153  border-radius: 50%;
     154  z-index: 0;
     155}
     156
     157.npd-free-widget-content {
     158  display: flex;
     159  align-items: center;
     160  justify-content: space-between;
     161  gap: 20px;
     162  position: relative;
     163  z-index: 1;
     164}
     165
     166.npd-free-rating-section {
     167  display: flex;
     168  align-items: center;
     169  gap: 12px;
     170  flex: 1;
     171}
     172
     173.npd-free-stars {
     174  font-size: 20px;
     175  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
     176}
     177
     178.npd-free-message {
     179  font-weight: 500;
     180  font-size: 14px;
     181  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
     182}
     183
     184.npd-free-actions {
     185  display: flex;
     186  align-items: center;
     187  gap: 10px;
     188  flex-shrink: 0;
     189}
     190
     191.npd-free-actions .button {
     192  border: none !important;
     193  border-radius: 20px !important;
     194  padding: 6px 16px !important;
     195  font-size: 13px !important;
     196  font-weight: 500 !important;
     197  text-decoration: none !important;
     198  transition: all 0.2s ease !important;
     199  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
     200}
     201
     202.npd-free-actions .button-primary {
     203  background: #fff !important;
     204  color: #667eea !important;
     205}
     206
     207.npd-free-actions .button-primary:hover {
     208  background: #f8f9ff !important;
     209  transform: translateY(-1px) !important;
     210  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
     211}
     212
     213.npd-free-actions .button-secondary {
     214  background: rgba(255, 255, 255, 0.2) !important;
     215  color: white !important;
     216  backdrop-filter: blur(10px) !important;
     217}
     218
     219.npd-free-actions .button-secondary:hover {
     220  background: rgba(255, 255, 255, 0.3) !important;
     221  transform: translateY(-1px) !important;
     222}
     223
     224.npd-free-rate-dismiss-link {
     225  color: rgba(255, 255, 255, 0.8) !important;
     226  font-size: 12px !important;
     227  text-decoration: none !important;
     228  padding: 4px 8px !important;
     229  border-radius: 12px !important;
     230  transition: all 0.2s ease !important;
     231}
     232
     233.npd-free-rate-dismiss-link:hover {
     234  color: white !important;
     235  background: rgba(255, 255, 255, 0.1) !important;
     236}
     237
     238/* Responsive */
     239@media (max-width: 768px) {
     240  .npd-free-widget-content {
     241    flex-direction: column;
     242    gap: 15px;
     243    text-align: center;
     244  }
     245
     246  .npd-free-actions {
     247    justify-content: center;
     248    flex-wrap: wrap;
     249  }
     250}
     251
     252/* Widget principal de promotion */
     253.npd-clean-promo-widget {
     254  background: #ffffff;
     255  border: 1px solid #e2e8f0;
     256  border-radius: 12px !important;
     257  padding: 0 !important;
     258  margin: 20px 20px 20px 0 !important;
     259  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
     260  overflow: hidden;
     261  position: relative;
     262}
     263
     264.npd-clean-promo-widget::before {
     265  content: "";
     266  position: absolute;
     267  top: 0;
     268  left: 0;
     269  right: 0;
     270  height: 4px;
     271  background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 50%, #06b6d4 100%);
     272  z-index: 1;
     273}
     274
     275/* En-tête du widget */
     276.npd-clean-promo-header {
     277  padding: 20px 24px 16px;
     278  border-bottom: 1px solid #f1f5f9;
     279  position: relative;
     280  z-index: 2;
     281}
     282
     283.npd-clean-promo-title {
     284  display: flex;
     285  align-items: center;
     286  gap: 12px;
     287  margin: 0;
     288  font-size: 18px;
     289  font-weight: 600;
     290  color: #1e293b;
     291}
     292
     293.npd-clean-promo-title-icon {
     294  font-size: 24px;
     295  animation: npd-clean-pulse 3s infinite;
     296}
     297
     298@keyframes npd-clean-pulse {
     299  0%,
     300  100% {
     301    transform: scale(1);
     302  }
     303  50% {
     304    transform: scale(1.1);
     305  }
     306}
     307
     308.npd-clean-promo-subtitle {
     309  margin: 8px 0 0 36px;
     310  font-size: 14px;
     311  color: #64748b;
     312  line-height: 1.4;
     313}
     314
     315/* Container des produits */
     316.npd-clean-products-container {
     317  padding: 20px 24px;
     318  max-height: 400px;
     319  overflow-y: auto;
     320}
     321
     322.npd-clean-products-container::-webkit-scrollbar {
     323  width: 6px;
     324}
     325
     326.npd-clean-products-container::-webkit-scrollbar-track {
     327  background: #f1f5f9;
     328  border-radius: 3px;
     329}
     330
     331.npd-clean-products-container::-webkit-scrollbar-thumb {
     332  background: #cbd5e1;
     333  border-radius: 3px;
     334}
     335
     336.npd-clean-products-container::-webkit-scrollbar-thumb:hover {
     337  background: #94a3b8;
     338}
     339
     340/* Grille des produits */
     341.npd-clean-products-grid {
     342  display: grid;
     343  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
     344  gap: 16px;
     345}
     346
     347/* Carte individuelle de produit */
     348.npd-clean-product-card {
     349  background: #f8fafc;
     350  border: 1px solid #e2e8f0;
     351  border-radius: 8px;
     352  padding: 16px;
     353  transition: all 0.3s ease;
     354  position: relative;
     355  overflow: hidden;
     356}
     357
     358.npd-clean-product-card:hover {
     359  transform: translateY(-2px);
     360  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
     361  border-color: #3b82f6;
     362}
     363
     364.npd-clean-product-card::before {
     365  content: "";
     366  position: absolute;
     367  top: 0;
     368  left: 0;
     369  right: 0;
     370  height: 3px;
     371  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
     372  transform: scaleX(0);
     373  transition: transform 0.3s ease;
     374}
     375
     376.npd-clean-product-card:hover::before {
     377  transform: scaleX(1);
     378}
     379
     380/* Contenu de la carte produit */
     381.npd-clean-product-content {
     382  display: flex;
     383  gap: 16px;
     384  align-items: flex-start;
     385}
     386
     387.npd-clean-product-icon {
     388  flex-shrink: 0;
     389  width: 48px;
     390  height: 48px;
     391  background: transparent;
     392  border-radius: 10px;
     393  display: flex;
     394  align-items: center;
     395  justify-content: center;
     396  font-size: 24px;
     397  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
     398}
     399
     400.npd-clean-product-icon-image {
     401  width: 32px;
     402  height: 32px;
     403  object-fit: contain;
     404}
     405
     406.npd-clean-product-info {
     407  flex: 1;
     408  min-width: 0;
     409}
     410
     411.npd-clean-product-name {
     412  font-size: 16px;
     413  font-weight: 600;
     414  color: #1e293b;
     415  margin: 0 0 6px 0;
     416  line-height: 1.3;
     417}
     418
     419.npd-clean-product-description {
     420  font-size: 13px;
     421  color: #64748b;
     422  line-height: 1.4;
     423  margin: 0 0 12px 0;
     424}
     425
     426.npd-clean-product-features {
     427  display: flex;
     428  flex-wrap: wrap;
     429  gap: 4px;
     430  margin-bottom: 12px;
     431}
     432
     433.npd-clean-feature-tag {
     434  background: #e0f2fe;
     435  color: #0369a1;
     436  font-size: 11px;
     437  padding: 2px 8px;
     438  border-radius: 12px;
     439  font-weight: 500;
     440}
     441
     442/* Actions de la carte produit */
     443.npd-clean-product-actions {
     444  display: flex;
     445  gap: 6px;
     446  align-items: center;
     447  flex-wrap: wrap;
     448}
     449
     450.npd-clean-btn {
     451  border: none;
     452  border-radius: 6px;
     453  font-size: 12px;
     454  font-weight: 500;
     455  text-decoration: none;
     456  cursor: pointer;
     457  transition: all 0.2s ease;
     458  display: inline-flex;
     459  align-items: center;
     460  gap: 4px;
     461  white-space: nowrap;
     462}
     463
     464.npd-clean-btn-primary {
     465  background: linear-gradient(135deg, #3b82f6, #2563eb);
     466  color: white;
     467  padding: 6px 12px;
     468  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
     469}
     470
     471.npd-clean-btn-primary:hover {
     472  background: linear-gradient(135deg, #2563eb, #1d4ed8);
     473  transform: translateY(-1px);
     474  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
     475  color: white;
     476  text-decoration: none;
     477}
     478
     479.npd-clean-btn-secondary {
     480  background: transparent;
     481  color: #64748b;
     482  padding: 6px 10px;
     483  border: 1px solid #e2e8f0;
     484}
     485
     486.npd-clean-btn-secondary:hover {
     487  background: #f1f5f9;
     488  color: #475569;
     489  border-color: #cbd5e1;
     490  text-decoration: none;
     491}
     492
     493.npd-clean-btn-demo {
     494  background: linear-gradient(135deg, #10b981, #059669);
     495  color: white;
     496  padding: 6px 12px;
     497  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
     498}
     499
     500.npd-clean-btn-demo:hover {
     501  background: linear-gradient(135deg, #059669, #047857);
     502  transform: translateY(-1px);
     503  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
     504  color: white;
     505  text-decoration: none;
     506}
     507
     508/* Actions globales du widget */
     509.npd-clean-promo-footer {
     510  padding: 16px 24px;
     511  background: #f8fafc;
     512  border-top: 1px solid #e2e8f0;
     513  display: flex;
     514  justify-content: space-between;
     515  align-items: center;
     516  gap: 16px;
     517}
     518
     519.npd-clean-footer-actions {
     520  display: flex;
     521  gap: 12px;
     522  align-items: center;
     523}
     524
     525.npd-clean-btn-footer {
     526  padding: 8px 16px;
     527  font-size: 13px;
     528}
     529
     530.npd-clean-dismiss-link {
     531  color: #64748b;
     532  font-size: 12px;
     533  text-decoration: none;
     534  transition: color 0.2s ease;
     535}
     536
     537.npd-clean-dismiss-link:hover {
     538  color: #3b82f6;
     539  text-decoration: underline;
     540}
     541
     542/* Badge "Nouveau" */
     543.npd-clean-new-badge {
     544  position: absolute;
     545  top: 8px;
     546  right: 8px;
     547  background: linear-gradient(135deg, #ef4444, #dc2626);
     548  color: white;
     549  font-size: 10px;
     550  font-weight: 600;
     551  padding: 2px 6px;
     552  border-radius: 4px;
     553  text-transform: uppercase;
     554  letter-spacing: 0.5px;
     555}
     556
     557/* Responsive Design */
     558@media (max-width: 968px) {
     559  .npd-clean-products-grid {
     560    grid-template-columns: 1fr;
     561  }
     562
     563  .npd-clean-promo-footer {
     564    flex-direction: column;
     565    align-items: stretch;
     566    gap: 12px;
     567  }
     568
     569  .npd-clean-footer-actions {
     570    justify-content: center;
     571    flex-wrap: wrap;
     572  }
     573}
     574
     575@media (max-width: 600px) {
     576  .npd-clean-promo-widget {
     577    margin: 16px 10px 16px 0 !important;
     578  }
     579
     580  .npd-clean-promo-header,
     581  .npd-clean-products-container,
     582  .npd-clean-promo-footer {
     583    padding-left: 16px;
     584    padding-right: 16px;
     585  }
     586
     587  .npd-clean-product-content {
     588    flex-direction: column;
     589    gap: 12px;
     590  }
     591
     592  .npd-clean-product-icon {
     593    align-self: flex-start;
     594  }
     595
     596  .npd-clean-product-actions {
     597    flex-direction: column;
     598    align-items: stretch;
     599    gap: 8px;
     600  }
     601
     602  .npd-clean-btn {
     603    justify-content: center;
     604  }
     605}
     606
     607/* Animation d'apparition */
     608.npd-clean-promo-widget {
     609  animation: npd-clean-slideIn 0.5s ease-out;
     610}
     611
     612@keyframes npd-clean-slideIn {
     613  from {
     614    opacity: 0;
     615    transform: translateY(20px);
     616  }
     617  to {
     618    opacity: 1;
     619    transform: translateY(0);
     620  }
     621}
     622
     623/* États de chargement */
     624.npd-clean-loading {
     625  display: flex;
     626  justify-content: center;
     627  align-items: center;
     628  padding: 40px;
     629  color: #64748b;
     630}
     631
     632.npd-clean-loading-spinner {
     633  width: 20px;
     634  height: 20px;
     635  border: 2px solid #e2e8f0;
     636  border-top: 2px solid #3b82f6;
     637  border-radius: 50%;
     638  animation: npd-clean-spin 1s linear infinite;
     639  margin-right: 8px;
     640}
     641
     642@keyframes npd-clean-spin {
     643  0% {
     644    transform: rotate(0deg);
     645  }
     646  100% {
     647    transform: rotate(360deg);
     648  }
     649}
  • neon-product-designer-for-woocommerce/trunk/includes/class-neon-product-designer.php

    r2937134 r3337250  
    2828 * @author     Vertim Coders <[email protected]>
    2929 */
    30 class Neon_Product_Designer {
     30class Neon_Product_Designer
     31{
    3132
    3233    /**
     
    6768     * @since    1.0.0
    6869     */
    69     public function __construct() {
    70    
     70    public function __construct()
     71    {
     72
    7173        $this->npd = 'npd';
    7274        $this->version = NPD_VERSION;
     
    9597     * @access   private
    9698     */
    97     private function load_dependencies() {
     99    private function load_dependencies()
     100    {
    98101
    99102        /**
     
    101104         * core plugin.
    102105         */
    103         require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-neon-product-designer-loader.php';
     106        require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-neon-product-designer-loader.php';
    104107
    105108        /**
     
    107110         * of the plugin.
    108111         */
    109         require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-neon-product-designer-i18n.php';
     112        require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-neon-product-designer-i18n.php';
    110113
    111114        /**
    112115         * The class responsible for defining all actions that occur in the admin area.
    113116         */
    114         require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-neon-product-designer-admin.php';
     117        require_once plugin_dir_path(dirname(__FILE__)) . 'admin/class-neon-product-designer-admin.php';
    115118
    116119        /**
     
    118121         * side of the site.
    119122         */
    120         require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-neon-product-designer-public.php';
     123        require_once plugin_dir_path(dirname(__FILE__)) . 'public/class-neon-product-designer-public.php';
    121124
    122125        $this->loader = new Neon_Product_Designer_Loader();
     
    133136     * @access   private
    134137     */
    135     private function set_locale() {
     138    private function set_locale()
     139    {
    136140
    137141        $plugin_i18n = new Neon_Product_Designer_i18n();
    138142
    139         $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
     143        $this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain');
    140144
    141145    }
     
    148152     * @access   private
    149153     */
    150     private function define_admin_hooks() {
    151 
    152         $plugin_admin = new Neon_Product_Designer_Admin( $this->get_plugin_name(), $this->get_version() );
    153 
    154         $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
    155         $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
    156         $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_npd_parts_submenu' );
    157         $this->loader->add_action( 'init', $plugin_admin, 'init_sessions', 1 );
    158         $this->loader->add_action( 'init', $plugin_admin, 'init_globals' );
    159         $this->loader->add_filter( 'upload_mimes', $plugin_admin, 'npd_add_custom_mime_types' );
    160         $this->loader->add_action( 'admin_notices', $plugin_admin, 'vc_get_max_input_vars_php_ini' );
    161          $this->loader->add_action( 'admin_notices', $plugin_admin, 'notify_customization_page_missing' );
    162         $this->loader->add_action( 'admin_notices', $plugin_admin, 'notify_minmimum_required_parameters' );
    163         $this->loader->add_filter('wp_check_filetype_and_ext', $plugin_admin, 'npd_check_filetype_and_ext',99, 5);
    164        
     154    private function define_admin_hooks()
     155    {
     156
     157        $plugin_admin = new Neon_Product_Designer_Admin($this->get_plugin_name(), $this->get_version());
     158
     159        $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles');
     160        $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts');
     161        $this->loader->add_action('admin_menu', $plugin_admin, 'add_npd_parts_submenu');
     162        $this->loader->add_action('init', $plugin_admin, 'init_sessions', 1);
     163        $this->loader->add_action('init', $plugin_admin, 'init_globals');
     164        $this->loader->add_filter('upload_mimes', $plugin_admin, 'npd_add_custom_mime_types');
     165        $this->loader->add_action('admin_notices', $plugin_admin, 'vc_get_max_input_vars_php_ini');
     166        $this->loader->add_action('admin_notices', $plugin_admin, 'notify_customization_page_missing');
     167        $this->loader->add_action('admin_notices', $plugin_admin, 'notify_minmimum_required_parameters');
     168        $this->loader->add_action('admin_notices', $plugin_admin, 'npd_clean_promo_widget_products');
     169        $this->loader->add_filter('wp_check_filetype_and_ext', $plugin_admin, 'npd_check_filetype_and_ext', 99, 5);
     170        //ajax hooks
     171        $this->loader->add_action('wp_ajax_npd_clean_dismiss_promo', $plugin_admin, 'npd_clean_handle_dismiss_promo');
     172        $this->loader->add_action('wp_ajax_npd_clean_track_plugin_click', $plugin_admin, 'npd_clean_handle_tracking');
     173
    165174        // Scenes hooks
    166175        $scene = new NPD_Scene();
    167         $this->loader->add_action( 'init', $scene, 'register_cpt_scenes' );
    168         $this->loader->add_action( 'add_meta_boxes', $scene, 'get_scenes_metabox' );
    169         $this->loader->add_action( 'save_post_npd-scenes', $scene, 'save_scenes' );
    170        
     176        $this->loader->add_action('init', $scene, 'register_cpt_scenes');
     177        $this->loader->add_action('add_meta_boxes', $scene, 'get_scenes_metabox');
     178        $this->loader->add_action('save_post_npd-scenes', $scene, 'save_scenes');
     179
    171180
    172181        // Colors hooks
    173182        $color = new NPD_Color();
    174         $this->loader->add_action( 'init', $color, 'register_cpt_colors_palette' );
    175         $this->loader->add_action( 'add_meta_boxes', $color, 'get_colors_palette_metabox' );
    176         $this->loader->add_action( 'save_post_npd-colors-palette', $color, 'save_colors_palette', 1 );
     183        $this->loader->add_action('init', $color, 'register_cpt_colors_palette');
     184        $this->loader->add_action('add_meta_boxes', $color, 'get_colors_palette_metabox');
     185        $this->loader->add_action('save_post_npd-colors-palette', $color, 'save_colors_palette', 1);
    177186
    178187        // Config hooks
    179188        $npd_config = new NPD_Config();
    180189        // -----------------------------------------------------------------
    181         $this->loader->add_action( 'init', $npd_config, 'register_cpt_config' );
    182         $this->loader->add_action( 'save_post_npd-config', $npd_config, 'save_config' );
    183         $this->loader->add_action( 'save_post_product', $npd_config, 'save_config' );
    184         $this->loader->add_action( 'add_meta_boxes', $npd_config, 'get_config_metabox' );
    185         $this->loader->add_action( 'woocommerce_product_options_general_product_data', $npd_config, 'get_product_config_selector' );
    186          $this->loader->add_action( 'woocommerce_product_after_variable_attributes', $npd_config, 'get_variation_product_config_selector', 10, 3 );
    187         $this->loader->add_filter( 'get_user_option_meta-box-order_npd-config', $npd_config, 'get_metabox_order' );
    188         $this->loader->add_action( 'admin_action_npd_duplicate_config', $npd_config, 'npd_duplicate_config' );
    189         $this->loader->add_filter( 'post_row_actions', $npd_config, 'get_duplicate_post_link', 10, 2 );
    190         $this->loader->add_action( 'woocommerce_save_product_variation', $npd_config, 'save_variation_settings_fields' );
    191         $this->loader->add_filter( 'screen_layout_columns', $npd_config, 'get_npd_config_screen_layout_columns' );
    192         $this->loader->add_filter( 'get_user_option_screen_layout_npd-config', $npd_config, 'get_npd_config_config_screen_layout' );
     190        $this->loader->add_action('init', $npd_config, 'register_cpt_config');
     191        $this->loader->add_action('save_post_npd-config', $npd_config, 'save_config');
     192        $this->loader->add_action('save_post_product', $npd_config, 'save_config');
     193        $this->loader->add_action('add_meta_boxes', $npd_config, 'get_config_metabox');
     194        $this->loader->add_action('woocommerce_product_options_general_product_data', $npd_config, 'get_product_config_selector');
     195        $this->loader->add_action('woocommerce_product_after_variable_attributes', $npd_config, 'get_variation_product_config_selector', 10, 3);
     196        $this->loader->add_filter('get_user_option_meta-box-order_npd-config', $npd_config, 'get_metabox_order');
     197        $this->loader->add_action('admin_action_npd_duplicate_config', $npd_config, 'npd_duplicate_config');
     198        $this->loader->add_filter('post_row_actions', $npd_config, 'get_duplicate_post_link', 10, 2);
     199        $this->loader->add_action('woocommerce_save_product_variation', $npd_config, 'save_variation_settings_fields');
     200        $this->loader->add_filter('screen_layout_columns', $npd_config, 'get_npd_config_screen_layout_columns');
     201        $this->loader->add_filter('get_user_option_screen_layout_npd-config', $npd_config, 'get_npd_config_config_screen_layout');
    193202
    194203        // Products
    195         $product_admin = new NPD_Product( false );
    196         $this->loader->add_filter( 'manage_edit-product_columns', $product_admin, 'get_product_columns' );
    197         $this->loader->add_action( 'manage_product_posts_custom_column', $product_admin, 'get_products_columns_values', 10, 2 );
    198         $this->loader->add_action( 'save_post_product', $product_admin, 'save_product_settings_fields' );
    199         $this->loader->add_action( 'woocommerce_save_product_variation', $product_admin, 'save_product_settings_fields' );
    200         $this->loader->add_action( 'woocommerce_product_options_inventory_product_data', $product_admin, 'get_variable_product_details_location_notice' );
     204        $product_admin = new NPD_Product(false);
     205        $this->loader->add_filter('manage_edit-product_columns', $product_admin, 'get_product_columns');
     206        $this->loader->add_action('manage_product_posts_custom_column', $product_admin, 'get_products_columns_values', 10, 2);
     207        $this->loader->add_action('save_post_product', $product_admin, 'save_product_settings_fields');
     208        $this->loader->add_action('woocommerce_save_product_variation', $product_admin, 'save_product_settings_fields');
     209        $this->loader->add_action('woocommerce_product_options_inventory_product_data', $product_admin, 'get_variable_product_details_location_notice');
    201210
    202211        // custom line
    203         $this->loader->add_action( 'woocommerce_after_add_to_cart_button', $product_admin, 'hide_cart_button' );
     212        $this->loader->add_action('woocommerce_after_add_to_cart_button', $product_admin, 'hide_cart_button');
    204213
    205214    }
     
    212221     * @access   private
    213222     */
    214     private function define_public_hooks() {
    215 
    216         $plugin_public = new Neon_Product_Designer_Public( $this->get_plugin_name(), $this->get_version() );
    217         $plugin_admin = new Neon_Product_Designer_Admin( $this->get_plugin_name(), $this->get_version() );
    218 
    219         $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
    220         $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
    221 
    222         $this->loader->add_action( 'init', $plugin_public, 'register_shortcodes' );
    223         $this->loader->add_action( 'woocommerce_after_add_to_cart_button', $plugin_public, 'get_customize_btn' );
    224        
    225         $this->loader->add_filter( 'woocommerce_loop_add_to_cart_link', $plugin_public, 'get_customize_btn_loop', 10, 2 );
     223    private function define_public_hooks()
     224    {
     225
     226        $plugin_public = new Neon_Product_Designer_Public($this->get_plugin_name(), $this->get_version());
     227        $plugin_admin = new Neon_Product_Designer_Admin($this->get_plugin_name(), $this->get_version());
     228
     229        $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles');
     230        $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts');
     231
     232        $this->loader->add_action('init', $plugin_public, 'register_shortcodes');
     233        $this->loader->add_action('woocommerce_after_add_to_cart_button', $plugin_public, 'get_customize_btn');
     234
     235        $this->loader->add_filter('woocommerce_loop_add_to_cart_link', $plugin_public, 'get_customize_btn_loop', 10, 2);
    226236
    227237        // Add query vars and rewrite rules
    228         $this->loader->add_filter( 'query_vars', $plugin_public, 'npd_add_query_vars' );
    229         $this->loader->add_filter( 'init', $plugin_public, 'npd_add_rewrite_rules', 99 );
     238        $this->loader->add_filter('query_vars', $plugin_public, 'npd_add_query_vars');
     239        $this->loader->add_filter('init', $plugin_public, 'npd_add_rewrite_rules', 99);
    230240
    231241        // Products
    232         $npd_product = new NPD_Product( false );
     242        $npd_product = new NPD_Product(false);
    233243        //$this->loader->add_action( 'woocommerce_add_to_cart', $npd_product, 'set_custom_upl_cart_item_data', 99, 6 );
    234         $this->loader->add_filter( 'body_class', $npd_product, 'get_custom_products_body_class', 10, 2 );
     244        $this->loader->add_filter('body_class', $npd_product, 'get_custom_products_body_class', 10, 2);
    235245
    236246        // Variable filters
    237         $this->loader->add_action( 'init', $plugin_public, 'set_variable_action_filters', 99 );
     247        $this->loader->add_action('init', $plugin_public, 'set_variable_action_filters', 99);
    238248
    239249
    240250        // Body class
    241         $this->loader->add_filter( 'body_class', $plugin_public, 'add_class_to_body' );
     251        $this->loader->add_filter('body_class', $plugin_public, 'add_class_to_body');
    242252
    243253        // Shop loop item class
    244         $this->loader->add_filter( 'post_class', $plugin_public, 'get_item_class', 10, 3 );
     254        $this->loader->add_filter('post_class', $plugin_public, 'get_item_class', 10, 3);
    245255
    246256        // Sessions
    247         $this->loader->add_action( 'init', $plugin_admin, 'init_sessions', 1 );
     257        $this->loader->add_action('init', $plugin_admin, 'init_sessions', 1);
    248258
    249259        // Emails
    250         $this->loader->add_action( 'woocommerce_order_item_meta_start', $plugin_public, 'set_email_order_item_meta', 10, 3 );
     260        $this->loader->add_action('woocommerce_order_item_meta_start', $plugin_public, 'set_email_order_item_meta', 10, 3);
    251261
    252262        // Save variation attributes in transients
    253         $this->loader->add_action( 'wp_ajax_npd_store_variation_attributes', $plugin_public, 'npd_store_variation_attributes' );
    254         $this->loader->add_action( 'wp_ajax_nopriv_npd_store_variation_attributes', $plugin_public, 'npd_store_variation_attributes' );
     263        $this->loader->add_action('wp_ajax_npd_store_variation_attributes', $plugin_public, 'npd_store_variation_attributes');
     264        $this->loader->add_action('wp_ajax_nopriv_npd_store_variation_attributes', $plugin_public, 'npd_store_variation_attributes');
    255265
    256266        // Design hooks
    257267        $npd_design = new NPD_Design();
    258268
    259         $this->loader->add_action( 'wp_ajax_add_custom_design_to_cart', $npd_design, 'add_custom_design_to_cart_ajax' );
    260         $this->loader->add_action( 'wp_ajax_nopriv_add_custom_design_to_cart', $npd_design, 'add_custom_design_to_cart_ajax' );
    261         $this->loader->add_filter( 'woocommerce_cart_item_thumbnail', $npd_design, 'get_npd_data_image', 99, 3 );
    262         $this->loader->add_filter( 'woocommerce_cart_item_name', $npd_design, 'get_product_name', 99, 3 );
    263         $this->loader->add_filter( 'woocommerce_after_cart_item_name', $npd_design, 'get_npd_data', 99, 3 );
    264 
    265         $this->loader->add_action( 'woocommerce_after_order_itemmeta', $npd_design, 'get_order_custom_admin_data', 10, 3 );
    266        
    267         $this->loader->add_action( 'woocommerce_checkout_create_order_line_item', $npd_design, 'save_cart_item_custom_meta_as_order_item_meta', 10, 4 );
     269        $this->loader->add_action('wp_ajax_add_custom_design_to_cart', $npd_design, 'add_custom_design_to_cart_ajax');
     270        $this->loader->add_action('wp_ajax_nopriv_add_custom_design_to_cart', $npd_design, 'add_custom_design_to_cart_ajax');
     271        $this->loader->add_filter('woocommerce_cart_item_thumbnail', $npd_design, 'get_npd_data_image', 99, 3);
     272        $this->loader->add_filter('woocommerce_cart_item_name', $npd_design, 'get_product_name', 99, 3);
     273        $this->loader->add_filter('woocommerce_after_cart_item_name', $npd_design, 'get_npd_data', 99, 3);
     274
     275        $this->loader->add_action('woocommerce_after_order_itemmeta', $npd_design, 'get_order_custom_admin_data', 10, 3);
     276
     277        $this->loader->add_action('woocommerce_checkout_create_order_line_item', $npd_design, 'save_cart_item_custom_meta_as_order_item_meta', 10, 4);
    268278
    269279        //$this->loader->add_filter( 'woocommerce_email_attachments', $npd_design, 'add_order_design_to_mail', 10, 3 );
    270280
    271         $this->loader->add_action( 'woocommerce_before_calculate_totals', $npd_design, 'get_cart_item_price', 10 );
    272        
     281        $this->loader->add_action('woocommerce_before_calculate_totals', $npd_design, 'get_cart_item_price', 10);
     282
    273283        // Emails
    274         $this->loader->add_action( 'woocommerce_order_item_meta_start', $plugin_public, 'set_email_order_item_meta', 10, 3 );
     284        $this->loader->add_action('woocommerce_order_item_meta_start', $plugin_public, 'set_email_order_item_meta', 10, 3);
    275285    }
    276286
     
    280290     * @since    1.0.0
    281291     */
    282     public function run() {
     292    public function run()
     293    {
    283294        $this->loader->run();
    284295    }
     
    291302     * @return    string    The name of the plugin.
    292303     */
    293     public function get_plugin_name() {
     304    public function get_plugin_name()
     305    {
    294306        return $this->npd;
    295307    }
     
    301313     * @return    Neon_Product_Designer_Loader    Orchestrates the hooks of the plugin.
    302314     */
    303     public function get_loader() {
     315    public function get_loader()
     316    {
    304317        return $this->loader;
    305318    }
     
    311324     * @return    string    The version number of the plugin.
    312325     */
    313     public function get_version() {
     326    public function get_version()
     327    {
    314328        return $this->version;
    315329    }
  • neon-product-designer-for-woocommerce/trunk/neon-product-designer.php

    r3130043 r3337250  
    1717 * Plugin URI:        https://neon-configurator.vertimcoders.com/
    1818 * Description:       The ultimate woocommerce neon product designer plugin for your signs.
    19  * Version:           2.1.1
     19 * Version:           2.2.0
    2020 * Author:            Vertim Coders
    2121 * Author URI:        https://www.vertimcoders.com/
     
    2727
    2828// If this file is called directly, abort.
    29 if ( ! defined( 'WPINC' ) ) {
     29if (!defined('WPINC')) {
    3030    die;
    3131}
     
    3636 * Rename this for your plugin and update it as you release new versions.
    3737 */
    38 define( 'NPD_VERSION', '2.1.1' );
    39 define( 'NPD_URL', plugins_url( '/', __FILE__ ) );
    40 define( 'NPD_DIR', dirname( __FILE__ ) );
    41 define( 'NPD_MAIN_FILE', 'neon-product-designer/neon-product-designer.php' );
    42 define( 'NPD_PLUGIN_NAME', 'Neon Product Designer' );
     38define('NPD_VERSION', '2.2.0');
     39define('NPD_URL', plugins_url('/', __FILE__));
     40define('NPD_DIR', dirname(__FILE__));
     41define('NPD_MAIN_FILE', 'neon-product-designer/neon-product-designer.php');
     42define('NPD_PLUGIN_NAME', 'Neon Product Designer');
    4343
    4444$upload_dir = wp_upload_dir();
     
    5656 * This action is documented in includes/class-neon-product-designer-activator.php
    5757 */
    58 function activate_neon_product_designer() {
    59     require_once plugin_dir_path( __FILE__ ) . 'includes/class-neon-product-designer-activator.php';
     58function activate_neon_product_designer()
     59{
     60    require_once plugin_dir_path(__FILE__) . 'includes/class-neon-product-designer-activator.php';
    6061    Neon_Product_Designer_Activator::activate();
    6162}
     
    6566 * This action is documented in includes/class-neon-product-designer-deactivator.php
    6667 */
    67 function deactivate_neon_product_designer() {
    68     require_once plugin_dir_path( __FILE__ ) . 'includes/class-neon-product-designer-deactivator.php';
     68function deactivate_neon_product_designer()
     69{
     70    require_once plugin_dir_path(__FILE__) . 'includes/class-neon-product-designer-deactivator.php';
    6971    Neon_Product_Designer_Deactivator::deactivate();
    7072}
    7173
    72 register_activation_hook( __FILE__, 'activate_neon_product_designer' );
    73 register_deactivation_hook( __FILE__, 'deactivate_neon_product_designer' );
     74register_activation_hook(__FILE__, 'activate_neon_product_designer');
     75register_deactivation_hook(__FILE__, 'deactivate_neon_product_designer');
    7476
    7577/**
     
    7779 * admin-specific hooks, and public-facing site hooks.
    7880 */
    79 require plugin_dir_path( __FILE__ ) . 'includes/class-neon-product-designer.php';
     81require plugin_dir_path(__FILE__) . 'includes/class-neon-product-designer.php';
    8082
    81 if ( ! class_exists( 'Kali_Admin_Tools' ) ) {
    82     require_once plugin_dir_path( __FILE__ ) . 'includes/kali-admin-tools/kali-admin-tools.php';
     83if (!class_exists('Kali_Admin_Tools')) {
     84    require_once plugin_dir_path(__FILE__) . 'includes/kali-admin-tools/kali-admin-tools.php';
    8385}
    8486
    8587
    86 require_once plugin_dir_path( __FILE__ ) . 'includes/functions.php';
     88require_once plugin_dir_path(__FILE__) . 'includes/functions.php';
    8789
    88 require_once plugin_dir_path( __FILE__ ) . 'includes/class-npd-design.php';
     90require_once plugin_dir_path(__FILE__) . 'includes/class-npd-design.php';
    8991
    9092require_once NPD_DIR . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'skins' . DIRECTORY_SEPARATOR . 'default' . DIRECTORY_SEPARATOR . 'class-npd-skin-default.php';
     
    105107 * @since    1.0.0
    106108 */
    107 function run_neon_product_designer() {
     109function run_neon_product_designer()
     110{
    108111
    109112    $plugin = new Neon_Product_Designer();
  • neon-product-designer-for-woocommerce/trunk/public/css/neon-product-designer-public.css

    r2937134 r3337250  
    44 */
    55
    6 
    7 .npd-cart-item-data-wrap{
     6.npd-cart-item-data-wrap {
    87  display: flex;
    9     justify-content: space-between;
    10     padding: 5px;
     8  justify-content: space-between;
     9  padding: 5px;
    1110}
    12 .npd-cart-item-data-container{
     11.npd-cart-item-data-container {
    1312  max-width: 300px;
    1413  margin-bottom: 20px;
    1514  border: 1px solid #e8e8e8;
    1615}
    17 .npd-cart-item-data-wrap:nth-child(even){
    18     background-color:#e8e8e8;
     16.npd-cart-item-data-wrap:nth-child(even) {
     17  background-color: #e8e8e8;
    1918}
    20 .cart-item-data-color{
    21     display: inline-block;
    22     width: 30px;
    23     height: 30px;
    24     border-radius: 4px;
    25     margin-right: 10px;
    26     vertical-align: middle;
     19.cart-item-data-color {
     20  display: inline-block;
     21  width: 30px;
     22  height: 30px;
     23  border-radius: 4px;
     24  margin-right: 10px;
     25  vertical-align: middle;
    2726}
    28 .npd-cartitem-img{
    29     height: auto;
    30     width: 100px;
    31     max-width: 100px
     27.npd-cartitem-img {
     28  height: auto;
     29  width: 100px;
     30  max-width: 100px;
    3231}
    33 .npd-design-product{
    34     border-radius: 4px !important;
    35     height: 40px !important;
    36     background-color: #55C1CA !important;
    37     outline: none !important;
    38     box-shadow: none !important;
    39     display: inline-block;
    40     line-height: 40px !important;
    41     color: #fff !important;
    42     padding: 0px 15px !important;
    43     margin: 5px 0px !important;
    44     text-decoration: none !important;
    45     font-size: 14px !important;
     32.npd-design-product {
     33  border-radius: 4px !important;
     34  height: 40px !important;
     35  background-color: #55c1ca !important;
     36  outline: none !important;
     37  box-shadow: none !important;
     38  display: inline-block;
     39  line-height: 40px !important;
     40  color: #fff !important;
     41  padding: 0px 15px !important;
     42  margin: 5px 0px !important;
     43  text-decoration: none !important;
     44  font-size: 14px !important;
    4645}
    47 .npd-grid .cat-item-ctn{
    48     display: inline-block;
    49     vertical-align: middle;
    50     float: left;
    51     margin: 20px 10px;
     46.npd-grid .cat-item-ctn {
     47  display: inline-block;
     48  vertical-align: middle;
     49  float: left;
     50  margin: 20px 10px;
    5251}
    5352
    54 .npd-grid .cat-item-ctn .cat-item{
    55     border: 1px solid #eee;
    56     text-align: center;
     53.npd-grid .cat-item-ctn .cat-item {
     54  border: 1px solid #eee;
     55  text-align: center;
    5756}
    58 .npd-grid .cat-item-ctn .cat-item h3{
    59     padding: 0px 10px;
     57.npd-grid .cat-item-ctn .cat-item h3 {
     58  padding: 0px 10px;
    6059}
    61 .npd-grid .cat-item-ctn .cat-item hr{
    62     margin-bottom: 0px;
     60.npd-grid .cat-item-ctn .cat-item hr {
     61  margin-bottom: 0px;
    6362}
    64 .npd-grid .cat-item-ctn .cat-item a{
    65     margin: 10px auto !important;
     63.npd-grid .cat-item-ctn .cat-item a {
     64  margin: 10px auto !important;
    6665}
    67 .woocommerce-cart-form__cart-item .product-name .omodal .omodal-dialog .omodal-content .omodal-body img{
     66.woocommerce-cart-form__cart-item
     67  .product-name
     68  .omodal
     69  .omodal-dialog
     70  .omodal-content
     71  .omodal-body
     72  img {
    6873  width: 100% !important;
    6974  height: auto !important;
Note: See TracChangeset for help on using the changeset viewer.