Plugin Directory

Changeset 3385611


Ignore:
Timestamp:
10/28/2025 06:11:04 AM (3 months ago)
Author:
plugincy
Message:

Changelog - 1.4.2 - Fixed: mobile style 1 related issues

Location:
dynamic-ajax-product-filters-for-woocommerce
Files:
77 added
5 edited

Legend:

Unmodified
Added
Removed
  • dynamic-ajax-product-filters-for-woocommerce/trunk/admin/admin-page.php

    r3378752 r3385611  
    556556                </div>
    557557                <div class="version-badge">
    558                     <span><?php echo esc_html__('Version', 'dynamic-ajax-product-filters-for-woocommerce'); ?> 1.4.1</span>
     558                    <span><?php echo esc_html__('Version', 'dynamic-ajax-product-filters-for-woocommerce'); ?> 1.4.2</span>
    559559                </div>
    560560            </div>
  • dynamic-ajax-product-filters-for-woocommerce/trunk/dynamic-ajax-product-filters-for-woocommerce.php

    r3378752 r3385611  
    55 * Plugin URI:  https://plugincy.com/
    66 * Description: A WooCommerce plugin to filter products by attributes, categories, and tags using AJAX for seamless user experience.
    7  * Version:     1.4.1
     7 * Version:     1.4.2
    88 * Author:      Plugincy
    99 * Author URI:  https://plugincy.com
     
    2424}
    2525
    26 define('DAPFFORWC_VERSION', '1.4.1');
     26define('DAPFFORWC_VERSION', '1.4.2');
    2727
    2828// Global Variables
     
    15211521
    15221522    wp_enqueue_script('jquery');
    1523     wp_enqueue_script($script_handle, plugin_dir_url(__FILE__) . $script_path, ['jquery'], '1.4.1', true);
     1523    wp_enqueue_script($script_handle, plugin_dir_url(__FILE__) . $script_path, ['jquery'], '1.4.2', true);
    15241524    wp_script_add_data($script_handle, 'async', true); // Load script asynchronously
    15251525    wp_localize_script($script_handle, 'dapfforwc_data', compact('dapfforwc_options', 'dapfforwc_seo_permalinks_options', 'dapfforwc_slug', 'dapfforwc_styleoptions', 'dapfforwc_advance_settings', 'dapfforwc_front_page_slug'));
     
    15321532    ]);
    15331533
    1534     wp_enqueue_style('filter-style', plugin_dir_url(__FILE__) . 'assets/css/style.min.css', [], '1.4.1');
    1535     wp_enqueue_style('select2-css', plugin_dir_url(__FILE__) . 'assets/css/select2.min.css', [], '1.4.1');
    1536     wp_enqueue_script('select2-js', plugin_dir_url(__FILE__) . 'assets/js/select2.min.js', ['jquery'], '1.4.1', true);
     1534    wp_enqueue_style('filter-style', plugin_dir_url(__FILE__) . 'assets/css/style.min.css', [], '1.4.2');
     1535    wp_enqueue_style('select2-css', plugin_dir_url(__FILE__) . 'assets/css/select2.min.css', [], '1.4.2');
     1536    wp_enqueue_script('select2-js', plugin_dir_url(__FILE__) . 'assets/js/select2.min.js', ['jquery'], '1.4.2', true);
    15371537    $css = '';
    15381538    // Generate inline css for sidebartop in mobile
     
    15741574    wp_enqueue_style('wp-color-picker');
    15751575    wp_enqueue_script('wp-color-picker');
    1576     wp_enqueue_style('dapfforwc-admin-style', plugin_dir_url(__FILE__) . 'assets/css/admin-style.min.css', [], '1.4.1');
     1576    wp_enqueue_style('dapfforwc-admin-style', plugin_dir_url(__FILE__) . 'assets/css/admin-style.min.css', [], '1.4.2');
    15771577    wp_enqueue_code_editor(array('type' => 'text/html'));
    15781578    wp_enqueue_script('wp-theme-plugin-editor');
    15791579    wp_enqueue_style('wp-codemirror');
    1580     wp_enqueue_script('dapfforwc-admin-script', plugin_dir_url(__FILE__) . 'assets/js/admin-script.min.js', [], '1.4.1', true);
     1580    wp_enqueue_script('dapfforwc-admin-script', plugin_dir_url(__FILE__) . 'assets/js/admin-script.min.js', [], '1.4.2', true);
    15811581    wp_enqueue_media();
    15821582    wp_enqueue_script('dapfforwc-media-uploader', plugin_dir_url(__FILE__) . 'assets/js/media-uploader.min.js', ['jquery'], '1.0.0', true);
     
    18711871    );
    18721872
    1873     wp_enqueue_style('custom-box-control-styles', plugin_dir_url(__FILE__) . 'assets/css/block-editor.min.css', [], '1.4.1');
     1873    wp_enqueue_style('custom-box-control-styles', plugin_dir_url(__FILE__) . 'assets/css/block-editor.min.css', [], '1.4.2');
    18741874}
    18751875add_action('enqueue_block_editor_assets', 'dapfforwc_enqueue_dynamic_ajax_filter_block_assets');
     
    21722172            '01',
    21732173            'https://plugincy.com/wp-json/product-analytics/v1',
    2174             "1.4.1",
     2174            "1.4.2",
    21752175            'One Page Quick Checkout for WooCommerce',
    21762176            __FILE__ // Pass the main plugin file
     
    21862186
    21872187        // Handle deactivation feedback AJAX
    2188         add_action('wp_ajax_send_deactivation_feedback', array($this, 'handle_deactivation_feedback'));
     2188        add_action('wp_ajax_dapfforwc_send_deactivation_feedback', array($this, 'handle_deactivation_feedback'));
    21892189    }
    21902190
  • dynamic-ajax-product-filters-for-woocommerce/trunk/includes/analytics.php

    r3355413 r3385611  
    214214            $plugin_slug = dirname($plugin_basename);
    215215?>
    216             <div id="plugin-deactivation-feedback" style="display:none;">
     216            <div id="dapfforwc-plugin-deactivation-feedback" style="display:none;">
    217217                <div class="feedback-overlay">
    218218                    <div class="feedback-modal">
     
    238238                        <div class="modal-body">
    239239                            <p>If you have a moment, please share why you are deactivating <?php echo esc_html($this->plugin_name); ?>:</p>
    240                             <form id="deactivation-feedback-form">
     240                            <form id="dapfforwc-deactivation-feedback-form">
    241241                                <div class="feedback-options">
    242242                                    <label class="feedback-option">
     
    509509                            e.preventDefault();
    510510                            deactivateUrl = $(this).attr('href');
    511                             $('#plugin-deactivation-feedback').show();
     511                            $('#dapfforwc-plugin-deactivation-feedback').show();
    512512                        });
    513513                    });
     
    520520                                e.preventDefault();
    521521                                deactivateUrl = $(this).attr('href');
    522                                 $('#plugin-deactivation-feedback').show();
     522                                $('#dapfforwc-plugin-deactivation-feedback').show();
    523523                            });
    524524                        }
     
    526526
    527527                    // Handle feedback form submission
    528                     $('#deactivation-feedback-form').on('submit', function(e) {
     528                    $('#dapfforwc-deactivation-feedback-form').on('submit', function(e) {
    529529                        e.preventDefault();
    530530
     
    543543                            type: 'POST',
    544544                            data: {
    545                                 action: 'send_deactivation_feedback',
     545                                action: 'dapfforwc_send_deactivation_feedback',
    546546                                reason: reason || 'no-reason-provided',
    547547                                nonce: '<?php echo esc_js(wp_create_nonce('deactivation_feedback')); ?>'
    548548                            },
    549                             complete: function() {
    550                                 // Proceed with deactivation
    551                                 window.location.href = deactivateUrl;
     549                            success: function(response) {
     550                                // Wait a moment to ensure the request completed
     551                                setTimeout(function() {
     552                                    window.location.href = deactivateUrl;
     553                                }, 500);
     554                            },
     555                            error: function(xhr, status, error) {
     556                                console.error('Feedback send failed:', status, error);
     557                                console.error('Response:', xhr.responseText);
     558
     559                                // Even if feedback fails, proceed with deactivation
     560                                setTimeout(function() {
     561                                    window.location.href = deactivateUrl;
     562                                }, 500);
    552563                            }
    553564                        });
     
    565576                    // Handle close button
    566577                    $('.close-button').click(function() {
    567                         $('#plugin-deactivation-feedback').hide();
     578                        $('#dapfforwc-plugin-deactivation-feedback').hide();
    568579                    });
    569580
     
    571582                    $('.feedback-overlay').click(function(e) {
    572583                        if (e.target === this) {
    573                             $('#plugin-deactivation-feedback').hide();
     584                            $('#dapfforwc-plugin-deactivation-feedback').hide();
    574585                        }
    575586                    });
     
    578589                    $(document).keyup(function(e) {
    579590                        if (e.keyCode === 27) { // ESC key
    580                             $('#plugin-deactivation-feedback').hide();
     591                            $('#dapfforwc-plugin-deactivation-feedback').hide();
    581592                        }
    582593                    });
  • dynamic-ajax-product-filters-for-woocommerce/trunk/includes/filter-template.php

    r3378752 r3385611  
    13801380
    13811381<?php if ($atts['mobile_responsive'] === 'style_1') {
    1382         wp_add_inline_script('urlfilter-ajax', "
    1383          function initializeMobileFilters() {
    1384   if (window.innerWidth <= 768) {
    1385     const titles = document.querySelectorAll('.filter-group .title');
    1386     const items  = document.querySelectorAll('.filter-group .items');
    1387 
    1388     function hideAll() {
    1389       items.forEach(item => {
    1390         item.classList.add('dapfforwc-hidden-important');
    1391         item.style.removeProperty('display');
     1382        wp_add_inline_script('urlfilter-ajax', '
     1383(() => {
     1384  const MOBILE_BP = 768;
     1385  const WRAPPER = ".plugincy_filter_wrapper";
     1386  const TITLE_SEL = ".filter-group .title";
     1387  const ITEMS_SEL = ".filter-group .items";
     1388
     1389  // guard so we only wire up once
     1390  if (window.__mobileFiltersWired) return;
     1391  window.__mobileFiltersWired = true;
     1392
     1393  const isMobile = () => window.innerWidth <= MOBILE_BP;
     1394
     1395  function hideAll(root = document) {
     1396    root.querySelectorAll(ITEMS_SEL).forEach(item => {
     1397      item.classList.add("dapfforwc-hidden-important");
     1398      item.style.removeProperty("display");
     1399    });
     1400    root.querySelectorAll(`${TITLE_SEL} svg`).forEach(svg => svg.classList.remove("rotated"));
     1401  }
     1402
     1403  function showItems(itemsEl) {
     1404    itemsEl.classList.remove("dapfforwc-hidden-important");
     1405    let display = "block";
     1406    const c = itemsEl.classList;
     1407    if (c.contains("image") || c.contains("image_no_border") || c.contains("button_check")) {
     1408      display = "grid";
     1409    } else if (c.contains("plugincy_color") || c.contains("color_no_border") || c.contains("color_circle")) {
     1410      display = "flex";
     1411    }
     1412    itemsEl.style.setProperty("display", display, "important");
     1413  }
     1414
     1415  // initial mobile state
     1416  if (isMobile()) hideAll();
     1417
     1418  // Reapply state when crossing the breakpoint
     1419  const mm = window.matchMedia(`(max-width: ${MOBILE_BP}px)`);
     1420  mm.addEventListener("change", e => {
     1421    if (e.matches) {
     1422      hideAll();               // just entered mobile
     1423    } else {
     1424      // leaving mobile: clear inline styles + classes
     1425      document.querySelectorAll(ITEMS_SEL).forEach(item => {
     1426        item.classList.remove("dapfforwc-hidden-important");
     1427        item.style.removeProperty("display");
    13921428      });
    1393       titles.forEach(title => {
    1394         const svg = title.querySelector('svg');
    1395         if (svg) svg.classList.remove('rotated');
    1396       });
    1397     }
    1398 
    1399     // Start hidden
    1400     hideAll();
    1401 
    1402     titles.forEach(title => {
    1403       title.addEventListener('click', function (e) {
    1404         e.stopPropagation();
    1405 
    1406         // Toggle current
    1407         const currentItems = this.nextElementSibling;
    1408         if (!currentItems.classList.contains('dapfforwc-hidden-important')) {
    1409             currentItems.style.removeProperty('display');
    1410         } else {
    1411             hideAll(); // Hide all first                               
    1412             if (currentItems.classList.contains('image') || currentItems.classList.contains('image_no_border') || currentItems.classList.contains('button_check')) {
    1413                 currentItems.style.setProperty('display', 'grid', 'important');
    1414             } else if (currentItems.classList.contains('plugincy_color') || currentItems.classList.contains('color_no_border') || currentItems.classList.contains('color_circle')) {
    1415                 currentItems.style.setProperty('display', 'flex', 'important');
    1416             } else {
    1417                 currentItems.style.setProperty('display', 'block', 'important');
    1418             }
    1419         }
    1420       });
    1421     });
    1422 
    1423     // Click outside to hide all
    1424     document.addEventListener('click', function (e) {
    1425       if (!e.target.closest('.plugincy_filter_wrapper')) {
    1426         hideAll();
     1429      document.querySelectorAll(`${TITLE_SEL} svg`).forEach(svg => svg.classList.remove("rotated"));
     1430    }
     1431  });
     1432
     1433  // Single delegated click handler for all current/future titles
     1434  document.addEventListener("click", e => {
     1435    if (!isMobile()) return;
     1436
     1437    const title = e.target.closest(TITLE_SEL);
     1438    if (title && title.closest(WRAPPER)) {
     1439      e.stopPropagation();
     1440
     1441      const currentItems = title.nextElementSibling;
     1442      const container = title.closest(WRAPPER);
     1443
     1444      // collapse everything inside this wrapper first
     1445      hideAll(container);
     1446
     1447      // then expand the clicked one (if it was closed)
     1448      if (currentItems && currentItems.classList.contains("dapfforwc-hidden-important")) {
     1449        showItems(currentItems);
     1450        const svg = title.querySelector("svg");
     1451        if (svg) svg.classList.add("rotated");
    14271452      }
    1428     });
    1429   }}
    1430 
    1431     // Call function on DOM content loaded
    1432     document.addEventListener('DOMContentLoaded', function() {
    1433         initializeMobileFilters();
    1434     });
    1435 
    1436     // Call function after AJAX requests complete
    1437     jQuery(document).ajaxComplete(function() {
    1438         initializeMobileFilters();
    1439     });
    1440 ");
     1453    } else if (!e.target.closest(WRAPPER)) {
     1454      // click outside -> hide all (mobile only)
     1455      hideAll();
     1456    }
     1457  });
     1458
     1459  // Reapply hidden state after AJAX updates (no re-binding needed)
     1460  if (window.jQuery) {
     1461    jQuery(document).ajaxComplete(() => { if (isMobile()) hideAll(); });
     1462  }
     1463})();
     1464');
     1465
     1466
    14411467    }
    14421468
  • dynamic-ajax-product-filters-for-woocommerce/trunk/readme.txt

    r3381795 r3385611  
    55Requires at least: 4.7
    66Tested up to: 6.8
    7 Stable tag: 1.4.1
     7Stable tag: 1.4.2
    88Requires PHP: 7.0
    99License: GPLv2 or later
     
    310310
    311311== Changelog ==
     312
     313= 1.4.2 =
     314* Fixed: mobile style 1 related issues
    312315
    313316= 1.4.1 =
Note: See TracChangeset for help on using the changeset viewer.