• Resolved robaxxx

    (@robaxxx)


    Same issue may others are reporting here.

    I’m trying to make any new snippet at network level on my multisite WP 6.3.1 instance. If I tick the box to allow activation on individual sites, the snippet won’t save and reports the error below. If I don’t tick that box then it will save. But if I then edit and try ticking that box again, it won’t save. It doesn’t matter what’s in the snippet or what type it is.

    I’ve got the full paid version 3.4.2.2?

    Regards
    Rob

    {
    "message": "Request failed with status code 500",
    "name": "AxiosError",
    "stack": "AxiosError: Request failed with status code 500\n at https://xyxyxyxyxyxy.com/wp-content/plugins/code-snippets-pro/dist/edit.js?ver=3.4.2.2:2:23767\n at XMLHttpRequest.p (https://xyxyxyxyxyxy.com/wp-content/plugins/code-snippets-pro/dist/edit.js?ver=3.4.2.2:2:23915)",
    "config": {
    "transitional": {
    "silentJSONParsing": true,
    "forcedJSONParsing": true,
    "clarifyTimeoutError": false
    },
    "adapter": [
    "xhr",
    "http"
    ],
    "transformRequest": [
    null
    ],
    "transformResponse": [
    null
    ],
    "timeout": 0,
    "xsrfCookieName": "XSRF-TOKEN",
    "xsrfHeaderName": "X-XSRF-TOKEN",
    "maxContentLength": -1,
    "maxBodyLength": -1,
    "env": {},
    "headers": {
    "Accept": "application/json, text/plain, /",
    "Content-Type": "application/json",
    "X-WP-Nonce": "6fa4726076"
    },
    "method": "post",
    "url": "https://xyxyxyxyxyxy.com/wp-json/code-snippets/v1/snippets/47?network=true",
    "data": "{\"id\":47,\"name\":\"sdfwafdaf\",\"desc\":\"\",\"code\":\"<b/>\",\"tags\":[],\"scope\":\"footer-content\",\"active\":false,\"priority\":10,\"network\":true,\"shared_network\":true,\"modified\":\"2023-09-08 09:31:38\",\"code_error\":null,\"encoded\":true}"
    },
    "code": "ERR_BAD_RESPONSE",
    "status": 500
    }
Viewing 15 replies - 1 through 15 (of 17 total)
  • The issue you’re encountering with saving network-level snippets in your WordPress Multisite 6.3.1 instance appears to be related to the “Allow activation on individual sites” option. This option allows you to activate the snippet on individual sites within your multisite network.

    It seems like you are able to save the snippet successfully when this option is unchecked but encounter an error when trying to save it with the option enabled. Additionally, if you edit the snippet and try to enable the option afterward, it still won’t save.

    Here are some steps you can take to troubleshoot and potentially resolve this issue:

    1. Plugin/Theme Conflict: Check if there’s a conflict with another plugin or your active theme. Deactivate all other plugins and switch to a default theme (e.g., Twenty Twenty-One) temporarily. Try creating/editing the snippet again with the option enabled to see if it saves. If it does, you can gradually reactivate your plugins and switch back to your theme to identify the conflicting one.
    2. Update Everything: Ensure that your WordPress core, the Code Snippets plugin, and any other related plugins are up to date. Sometimes, compatibility issues are resolved in newer versions.
    3. Check Server Logs: Examine your server error logs for any specific error messages related to the issue. The error message you provided doesn’t give much detail. Server logs can often provide more insight into the problem.
    4. Memory Limit: It’s possible that the issue is related to PHP memory limits. Increase the PHP memory limit in your server’s PHP configuration or by adding the following line to your wp-config.php file:phpCopy codedefine('WP_MEMORY_LIMIT', '256M'); // Adjust the limit as needed
    5. Plugin Support: Reach out to the support team for the Code Snippets plugin. They may have encountered this issue before and can provide specific guidance or a fix for your version.
    6. WordPress Multisite Configuration: Ensure that your WordPress Multisite network is configured correctly. Check your network settings and verify that your network is functioning as expected.
    7. Debug Mode: Enable WordPress debug mode by adding the following lines to your wp-config.php file:phpCopy codedefine('WP_DEBUG', true); define('WP_DEBUG_LOG', true); This will log any PHP errors to a debug.log file in your wp-content directory. Check this log for any errors related to saving network-level snippets.
    8. Backup: Before making significant changes, always backup your WordPress site, including the database, so that you can restore it if something goes wrong.

    By following these steps, you should be able to diagnose and potentially resolve the issue you’re facing with saving network-level snippets in your WordPress Multisite instance. If the problem persists, consider seeking assistance from the Code Snippets plugin’s support or the WordPress community forums, providing them with detailed information about your setup and the error messages you encounter.

    Plugin Author Shea Bunge

    (@bungeshea)

    @robaxxx I appreciate you reporting this! I’ve taken a look and included a fix in the most recent release, 3.5.0. If you could give it a try and let us know whether it fixes things, that’d be fantastic.

    Thread Starter robaxxx

    (@robaxxx)

    Thanks Shea

    I’ve updated and have tested it now.

    The same thing still happens when I tick the option to allow activation on individual sites in the network.

    I get the same Axios error in the console except that it now shows the new version number.

    But this time I also get the error when I save without ticking that box. So now it’s not saving in either manner.

    If there’s anything else I can send through, let me know.

    Regards
    Rob

    Plugin Author Shea Bunge

    (@bungeshea)

    Ah this sounds like it might be an issue with some security software you have installed blocking the snippet code. If you try saving a blank snippet, does it still fail?

    If it is to do with security software, we’re working on a patch that should hopefully reduce those sorts of issues.

    Thread Starter robaxxx

    (@robaxxx)

    hmm… I’ve just been updating a test copy of the same multisite WP instance on the same server. Am doing this so that I could disable plugins to debug an Elementor problem.

    On that instance, I can save a blank snippet both with and without a title, but cannot save with the network sites activation ticked.

    But on the original live copy of the same instance, I cannot save any snippets, whether blank or not.

    Both instances are updated and match in all ways. So, it’s odd that one can save a blank and the other can’t.

    I’m about to start disabling plugins on the copy instance as will see if I can spot any differences. I’ll update here if I find anything.

    Thread Starter robaxxx

    (@robaxxx)

    Ok, I’ve now disabled all plugins at site and network level apart from Code Snippets, which I use at network level, and I changed to the default 2023 theme.

    The outcome is I get the same error when saving with that tick box enabled.

    This is the same issue I continue to have and reported previously, which was responded to, that 3.5.0 would fix the issue, it did not. Again pointing out that the text label on the form input is not selectable for that check box either (you have to check the box, text is inactive), in addition to it not allowing you to save.

    Seems like a much more previous version before these issues started popping up left and right is the best option for now on multisites.

    Plugin Author Shea Bunge

    (@bungeshea)

    Thank you @robaxxx and @umduck.

    We have hopefully pinpointed the correct issue this time. In my testing, the error is only thrown if you try to check the box and save when the snippet is already active – if its inactive, then it appears to work as expected.

    Is this consistent with how it’s working on your site? We’ll release a patch to fix this in the next version. Fingers crossed it does the trick this time.

    umduck

    (@umduck)

    Here is the behavior using the “Example HTML shortcode” currently deactivated.

    1. When attempting to check the option “Allow this snippet to be activated on individual sites on the network” and then save without activating
    2. Produces the error message at the top of the page that indicates “Could not update snippet. Request failed with status code 500”

    Here is the behavior after activating the “Example HTML shortcode” code snippet.

    1. Activation works as expected.
    2. Attempting to check the option “Allow this snippet to be activated on individual sites on the network” and saving the currently active snippet
    3. Upon saving it produces the same status code 500 message and deactivates the snippet.
    Plugin Author Shea Bunge

    (@bungeshea)

    We’ve just released version 3.6.2, which should contain a fix for this issue.

    bhenselmann

    (@bhenselmann)

    Unfortunately it seems not to be resolved: Exactly the same issue occured with WP 6.4.1 and Code Snippets 3.6.2, PHP 7.4

    bhenselmann

    (@bhenselmann)

    I just tried on an other Multisite with WP 6.3.1, Code Snippets 3.6.2, PHP 8.2.11: Same issue!

    bhenselmann

    (@bhenselmann)

    and the same issue on WP 6.4.1, Code Snippets 3.6.2 and PHP 8.2.11

    Thread Starter robaxxx

    (@robaxxx)

    Ok, I’ve tested this here on the WP 6.3 multisite in my original post above. This is after upgrading Code Snippets to 3.6.3

    I created a new CSS and then a new HMTL snippet. I enable “Allow this snippet to be activated on individual sites on the network” eaxch tioem before saving. Saving reports ‘Snippet updated’ on screen. No errors in browser console.

    However, when edited, the option is no longer enabled and the snippets don’t appear on the sub-sites.

    So we’ve got past the ability to save the snippets, but still can’t use them on the sub-sites.

    I seem to recall this was working again in 3.5.1 recently, but is certainly not now.

    Hopefully it can still be fixed.

    Regards
    Rob

    umduck

    (@umduck)

    I am seeing similar behavior as @robaxxx I can now save the snippet, as choosing the Allow snippet to be activated option removes the activation button, however, it does not show the label as the other ones currently working on the network level that say “Shared on Network” and they do not appear on the other subsites to activate. Progress, but still not functioning as before. If we were to acquire licenses for all of our subsites on our multisite will this ensure we get dedicated support to resolve this issue quicker? We haven’t needed this option recently, however, at some point we will again and I really do not want to roll back dozens of versions to find one that still works? If you need access to a non-prod environment I’d be happy to provide.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Cannot save for individual site activation – status code 500’ is closed to new replies.