Plugins are a vital part of your WordPress site, adding much of the key functionality to your site. Just as we saw with the Theme Editor in the previous recipe, you can edit plugin files directly from within the WordPress dashboard, without the need of a third party editor. In this recipe, we introduce the basics of working with the Plugin Editor.
Everything you need to complete this recipe is located inside your WordPress dashboard.
Log in to your WordPress Dashboard.
Click on the Plugins menu.
Click on the option Editor.
By default, the system will display one of the files from the first available plugin, as seen in the next screenshot. If you wish to change the view to edit a different file for the plugin, simply click the name of the file in the right hand column. To change to a different plugin, select one from the combo box labeled Select plugin to edit.
Make your changes.
When you're done, click on the Update File button to save your modifications.
The built-in Plugin Editor works in exactly the same way as the Theme Editor. When a file is modified and saved, the modifications are written directly in the source file—there's no copy or backup.
The Plugin Editor is a very useful tool; however, it can also create problems if used improperly.
Unless you're very sure about what you're doing, always deactivate the plugin before editing
Always have a backup of the plugin you're editing, as the Plugin Editor does not save any revisions
If—after editing a plugin—your site does not function correctly, deactivate the plugin, and upload your plugin files backup to your
wp-content/plugins/yourplugin
directory
Chapter 3, Working with Plugins and Widgets, covers WordPress plugins in more detail