Lessons Learned: Quick Way to Upload Custom WordPress Plugins
While writing my first WordPress plugin, there is one thing I wish I would have known sooner. Much of the early development time was spent zipping, uploading, activating, and deactivating files. There was a lot of monotonous work that is easily avoided. Let's take at quick look at how.
Background
My last post (My First WordPress Plugin: Generates a Bulleted List of Clickable Blog Post Titles) briefly described one way to upload a plugin to your WordPress. However, there is a much faster way to upload those plugin files. To fully appreciate the improved upload method, let's look closer at the slow way.
Slow Way to Upload
When developing a plugin for WordPress, you can test it out at any time. Before uploading the files, however, they need to be zipped. On Windows 7, for example, you can zip a file by right clicking it, clicking "Send to", and clicking "Compressed (zipped) folder" (see Figure 1).
Figure 1. Zipping a File
Now you can log into your WordPress account, if you haven't done so already, and click the Plugins options in the left menu (see Figure 2).
Figure 2. Plugins Option
If the plugin has already been installed, it needs to be deactivated before uploading the new version. You just need to click Deactivate (see Figure 3).
Figure 3. Deactivate Option
Once deactivated, the old plugin file(s) need to be removed by clicking the corresponding Delete option (see Figure 4).
Figure 4. Delete Option
WordPress then asks if you meant to delete the indicated plugin. Assuming that you are removing the right plugin, click "Yes, Delete these files" (see Figure 5).
Figure 5. Delete Plugin Confirmation
With the old plugin removed, the new version can be uploaded by clicking the Add New button on the Plugins page (see Figure 6).
Figure 6. Add New Plugin
Now you can click Upload Plugin (see Figure 7), choose the ZIP file with your plugin file(s), and click Install Now.
Figure 7. Upload Plugin
Assuming the plugin uploads successfully, it can be activated by clicking Activate Plugin (see Figure 8).
Figure 8. Activate Plugin
Now that may not seem like a lot of steps, but the feeling quickly changes after uploading the plugin several times. Luckily there is a faster way.
Fast Way to Upload
The alternate way of uploading the plugin doesn't require the plugin file(s) being zipped, activated, deactivated, etc. All you need to do is develop the PHP file as normal and upload it using an FTP solution like WinSCP.
If the plugin has been uploaded before, you just need to log into your FTP software. Then go into the "wp-content" folder for the WordPress website where the "plugins" folder is found. Under the plugins folder, locate and open the folder for your plugin, and replace the file(s).
Figure 9. Plugin Folder
0 Comments
There are currently no comments.
Leave a Comment