I started developing a wordpress plugin for my site and was using the wordpress plugin editor. Whenever I make a PHP error I get a message to say my plugin was 'rolled back'.

I then attempt to fix the changes, but when I click apply I get a message saying 'invalid plugin'.

I attempt to open the plugin again from the menu, when I do, the editor opens with an empty document. Leaving the editor, and returning, the plugin will disappear.

The plugin will no longer appear on the plugin list. On first attempt at re-upload, it will fail saying the file already exists, on second attempt I can install the plugin.

As you can imagine, having the plugin uninstall itself every time I make an error is inconvenient to say the least. Any way to fix this?

  • 1
    Thomas, it's much much easier to develop locally on a localhost with wamp, mamp, or xamp. Worth the effort to install a local server, tweak the plugin till you get it right, then upload it.
    – anmari
    Jul 6, 2018 at 11:46
  • 1
    Don't use the WP editor. Instead turn debugging on and use localhost.
    – user2015
    Jul 6, 2018 at 12:09
  • Even if you're developing on a remote server, editing is much safer when you edit the files on your computer and FTP them up. The plugin and theme editors are turned off entirely on many hosts because they can cause so many issues.
    – WebElaine
    Jul 6, 2018 at 14:12

1 Answer 1

  1. Put this line into wp-config.php:

    define('DISALLOW_FILE_EDIT', true);

  2. Now that plugin and theme editors are gone, you're forced to do it the proper way, managing files with FTP or Git

  3. Install nice text editor like Visual studio code or Sublime text 3 with all them fancy highlighting and autocompletion and stuff :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.