• Resolved davidrichied

    (@davidrichied)


    This is a really strange error. When I include either of the following snippets in my functions.php file (or any php file), I get a JS error (POST https://dev5.pixelmark.net/wp-admin/admin-ajax.php 404 (Not Found)).

    This is the first code that causes that JS error.

    require_once (ABSPATH.'/wp-admin/includes/media.php');
    require_once (ABSPATH.'/wp-admin/includes/file.php');
    require_once (ABSPATH.'/wp-admin/includes/image.php');

    This is the second piece of code that causes that JS error, even if it’s commented out.
    file_put_contents($file, $current);

    I tried taking a look at ace.js, but it’s minified. I’m not sure if that’s the main JS file, but if you point me to the right file, I’d be glad to try and troubleshoot. I know the error must be happening somewhere where the JS uses the admin-ajax.php localized variable.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author shanept

    (@shanept)

    Hi davidrichied,

    That sounds like a rather peculiar error. I’m not quite sure where to start with that, but I would be surprised if it is directly related to this plugin.

    In regards to the mention of ace.js – yes, this is minified. It provides only the text editor element. The integration with WordPress is done in load-editor.js, so I think that is where you probably want to be looking. However, I start looking at your PHP error logs, server setup and WordPress install first, to see if there are any issues there, before jumping into the javascript to find a solution.

    I hope this helps. If you can not find a solution there, then we shall see what we can do to get everything back on track.

    Kind Regards,
    Shane Thompson

    Thread Starter davidrichied

    (@davidrichied)

    Hi Shane,

    You’re right. It must be an issue with Namecheap’s servers. I added the code to my functions.php file on a website using a Digital Ocean server, and it worked fine. I will take a look at load-editor.js. Thanks.

    Plugin Author shanept

    (@shanept)

    Hi davidrichied,

    It seems this is a server-related issue, so I’m going to go ahead and close this issue.

    Kind Regards,
    Shane Thompson

    Thread Starter davidrichied

    (@davidrichied)

    Hi Shane,

    Yes, I think it’s an issue with NameCheap’s servers. You can close the ticket. Namecheap has some mod security thing that sometimes affects plugins. The issue happens to any sites on NameCheap, but it does not happen on any sites I have on Digital Ocean.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Cannot save file due to JS error.’ is closed to new replies.