• Hi,
    I noticed that the plugin enqueues apd-public.js with jquery as a dependency:

    wp_enqueue_script(
        'apd-public',
        APD_PLUGIN_URL . 'public/js/apd-public.js',
        array( 'jquery' ),
        APD_VERSION,
        true
    );

    This seems unnecessary because the functionality implemented in apd-public.js is already implemented in the plugin’s CSS.

    The CSS already handles the checked state:

    .apd-deposit-option input:checked + .apd-option-content .apd-option-radio {
        border-color: #6366f1;
    }

    So the plugin is currently loading an additional JavaScript file, jQuery, and consequently jQuery Migrate, just to implement functionality that is already covered by CSS.

    This is especially problematic for modern WordPress sites using FSE/block themes, where jQuery is generally not used on the frontend. Adding jQuery solely for this small visual interaction unnecessarily increases the frontend dependencies.

    Is there a reason for keeping apd-public.js and the jQuery dependency here? From what I can see, this JavaScript can be removed without losing any functionality.

    Thanks for looking into this!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.