• gudi

    (@wordoping)


    Hello, I discovered when using Multisite, trashing a network snippet activates it regardless of its previous state. The Trash essentially functions as a hidden “enabled snippets” list. This is counterintuitive and potentially dangerous behavior.

    Steps to Reproduce

    1. Open this WordPress Playground with Multisite: https://playground.wordpress.net/?multisite=yes&plugin=code-snippets&url=/wp-admin/network/admin.php?page=add-snippet
    2. Add this test code below:

    add_action('wp_footer', 'snippet_active_banner'); add_action('admin_footer', 'snippet_active_banner'); function snippet_active_banner() { echo '<div style="position:fixed;bottom:0;left:0;right:0;background:#4caf50;color:#fff;text-align:center;padding:10px;font-weight:600;z-index:999999;">✓ This Code Snippet is active!</div>'; }

    1. Click Save and Activate, navigate back to All Snippets → green banner appears
    2. Deactivate the snippet → green banner disappears
    3. Trash the deactivated snippet
    4. Bug: Green banner reappears → trashing has activated the snippet

    Observations

    Trashing an inactive snippet → becomes active until deleted from Trash

    Trashing an active snippet → remains active until deleted from Trash

    Expected Trashing should deactivate a snippet. Trashed snippets should never execute.

    Actual Trashing activates the snippet. All trashed snippets execute their code.

    The page I need help with: [log in to see the link]

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

You must be logged in to reply to this topic.