• Resolved Imageyuka23

    (@yuka23)


    As noted in other topics, it is not possible to add or edit code snippets. In other topics, everyone seems to have cured the problem by clearing the browser cache, but for me the problem still remains.
    Please help.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author ImageShea Bunge

    (@bungeshea)

    Can you provide some more information on the sort of error you’re experiencing? Where does the problem occur – does the edit page not load at all, or is the issue encountered when attempting to save?

    Also, have you ensured you’ve cleared the Code Snippets cache (under Settings > Debug) and any persistent caching your web host might use?

    Thread Starter Imageyuka23

    (@yuka23)

    The console displays the following message. There is nothing like that in the debug log file.
    “Failed to load resource: the server responded with a status of 403 ()”
    The list of snippets appears, but when I press the edit or add new button, the words “loading edit page…” appear for a moment and then disappear and nothing appears.
    The same thing happened when I cleared the browser cache and tried opening the website in private mode again.
    The plug-ins I use are listed below.
    All-in-One Wp Migration, HivePress, HivePress Messages, HivePress Favorite, Loco Translate, Wordfence security, YaySMTP

    Thread Starter Imageyuka23

    (@yuka23)

    I have cleared the cache of Code Snippets as you have told me, but the problem is still not solved.
    Sometimes the code editing screen appears for just a split second and then immediately goes to a blank screen.

    Imagegenerosus

    (@generosus)

    Hi @yuka23,

    If you don’t mind, please allow me to help.

    I had the same issue and learned that Cloudflare (CDN) was the culprit. To solve the issue with Cloudflare, I created a WAF rule that Whitelisted the endpoints of Code Snippets with the following WAF settings.

    Since then, however, the issue has been fixed. So, most likely, your fix will involve one (or several) of the following:

    Potential Solutions:

    Note: I highly recommend trying these potential solutions with a staging site.

    1. Clear all cache layers (theme, plugins, CDN, browers) and all cookies from your browsers.
    2. Perform a plugin conflict test.
    3. Ensure you’re using the latest version of WordPress (6.7.1) and Code Snippets (3.6.6.1).
    4. Check your .htaccess file for any rules that could be blocking Code Snippets. To check this, disable your current .htaccess file and use instead the original WP .htaccess file which can be found here. Many times, for example, security headers added via .htaccess rules can cause these issues.
    5. Contact your host and ask them to reset your file and directory permissions.
    6. Disable any CDNs or VPNs you might be using. If disabling them fixes your issue, contact them via ticket or forum for a fix.
    7. Perform a malware check of your site. I recommend using SucuriSitecheck, VirusTotal, and SiteGuarding.
    8. Perform a code snippet conflict test. That is, disable a group of code snippets (one group at a time) to see if this helps. If so, you could have a code snippet that’s causing the issue.

    One of the above should fix your issue. If you tried all of the above and are still having the issue, let us know. Also, please share screenshots of your issue (including the console errors you’re getting – example).

    Best wishes!

    ————-

    Note: I’m not affiliated with Code Snippets nor any website referenced above. Simply offering goodwill support.

    Thread Starter Imageyuka23

    (@yuka23)

    Hi, @generosus

    Thank you for your kind reply.

    No change after clearing the cache, browsing in other browsers, incognito mode and super reloading.
    No CDNs used.
    No change after disabling individual snippets.
    No change after disabling wordfence.
    No change after setting file permissions to 644 and 755.
    No change after re-uploading code-editor.min.js
    The code-editor.min.js file returns HTTP/2 200.
    No change after re-uploading wordpress.
    No change after reverting .htaccess to initial state

    A link to the error image is attached below.

    Image
    Imagegenerosus

    (@generosus)

    Hey @yuka23,

    Interesting.

    1. What version of Code Snippets and WordPress are you using?
    2. What PHP version are you using?
    3. Did you reach out to your host?
    4. Did you perform a malware check?
    5. If you can share your website’s URL, I may be able to investigate further.
    6. Your link to the message is not shown. Share screenshots instead (Code Snippets screen error, console errors, etc.)

    Cheers!

    Thread Starter Imageyuka23

    (@yuka23)

    Hi, @generosus

    I apologise for the link not showing up.
    https://prnt.sc/o7i_lF1ZDRA7

    ・ WordPress ver. 6.7.1 , CodeSnippets ver.3.6.6.1
    ・ php74
    ・ I’m owner.
    ・ Malware scanning by wordfence was not a problem.

    Look at the error code and let me know what you find out.
    I would also consider asking the server I rent if it has any restrictions on loading code-editor.min.js, common.min.js or editor.min.js.

    Thank you

    Imagegenerosus

    (@generosus)

    Hey @yuka23,

    Based on what you shared, here’s what I can offer (final recommendations):

    Note: Please test these proposed solutions with a staging site.

    1. Check this solution.
    2. Upgrade to PHP 8.1 or higher.
    3. If enabled, disable Object Cache (i.e. Memcached). Memcached is known to create a lot of issues for websites with low traffic or websites using certain cache plugins.
    4. Export your code snippets, clean uninstall Code Snippets, clear all cache, clean your database, re-install Code Snippets, import your code snippets.
    5. Log out from your website, then delete the .htaccess file that is in your root folder. Afterwards, log in to your wordpress dashboard, go to Settings > Permalinks, and then just simply click Save Changes. This will generate a new .htaccess for your wordpress installation.
    6. Downgrade WordPress and/or Code Snippets to a lower level (say, 2-3 levels).
    7. Review and implement the 403() solutions provided in this article.

    Honestly, your issue does not appear to be related to Code Snippets. Our site is using PHP 8.4.1, WP 6.7.1, Code Snippets 3.6.6.1, Wordfence 8.0.1, and WP Fastest Cache 1.3.3 (all latest revisions) with no issues whatsoever.

    Best wishes!

    Thread Starter Imageyuka23

    (@yuka23)

    Thanks for the suggestions.
    I have tried everything and it did not work.
    When I created a backup file and imported and built it in the local environment, the problem did not occur and it displayed properly. It is the same file but it is correct in the local environment and not in the production environment, what does this mean?

    Imagegenerosus

    (@generosus)

    It means Code Snippets (plugin) is not the issue. It’s being blocked by your host, server, or 3rd-party entity.

    To prevent confusion, consider closing this topic as “Resolved” since your issue is not being caused by this plugin.

    Cheers 🙂

    Thread Starter Imageyuka23

    (@yuka23)

    Thank you

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

The topic ‘Snippets code editing screen does not appear’ is closed to new replies.