• Resolved randon

    (@randon)


    Hi there,

    Thanks for your work on this plugin!!

    I’ve noticed that Copy Delete Posts is loading all its CSS and JavaScript files on every page of my website, including the frontend where visitors browse.

    Specifically, these files are loading site-wide:

    • cdp.min.css
    • cdp-global.min.css
    • cdp-select.min.css
    • cdp-user.min.css
    • cdp.tooltip.min.css
    • cdp.min.js
    • cdp-global.min.js
    • cdp-select.min.js
    • cdp-user.min.js
    • cdp-modal.min.js
    • cdp.tooltip.min.js

    Since this plugin is only used in the WordPress admin area to copy and delete posts, is there a reason these assets need to load on the frontend? This adds unnecessary HTTP requests and file size to every page load for visitors.

    Would it be possible to add a check like if (is_admin()) to only enqueue these assets in the admin area where they’re actually needed? This would significantly improve frontend performance.

    For now, I’ve used Asset CleanUp to prevent these files from loading on the frontend, but it would be great if this was handled by the plugin itself.

    Thanks again.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support MixHa

    (@mixha)

    Hello @randon ,

    Thank you for your kind words and for taking the time to share such a detailed report — we really appreciate it.

    To clarify, Copy Delete Posts does not enqueue its scripts and styles unconditionally across the frontend. These assets are loaded only when both of the following conditions are met:

    – The request is made by a logged-in, authorized user with a role that has permission to copy or delete posts (this can be configured in the plugin’s options).
    – The current page is a context where copying content is actually possible (e.g. a post, page, or other supported content type).

    Because of this, the plugin does not rely on a simple is_admin() check. Some Copy Delete Posts features are intentionally available on the frontend for authorized users, so restricting assets to the admin area only would break valid use cases.

    In most reports like this, the assets appear to be “site-wide” simply because the site is being viewed while logged in as an administrator or editor. If these files are loading for non-logged-in visitors, that would not be expected behavior and is usually caused by site-specific factors such as caching, optimization plugins, themes, or custom hooks.

    Using Asset CleanUp as a temporary workaround is perfectly fine, and we understand the performance concerns. If you can confirm that these assets are loading for logged-out users, please let us know along with details about your setup so we can investigate further.

    Thanks again for your feedback and support!

    Kind regards

    Thread Starter randon

    (@randon)

    Hi, thanks for the clarification.

    I tested it with a logged-out session and you’re absolutely right, the files don’t load for regular visitors. My apologies for the confusion. Great plugin, keep up the good work!

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.