For each WordPress plugin you install, you are adding to the bandwidth/server overhead of your site. As a plugin author, there are some simple steps to take to reduce the footprint of your plugin (whether it be helping with server load or conserving bandwidth), even if your plugin still requires a lot of code. Break Out Admin Panels Into Separate Files Even for simple plugins, adding admin panels can easily balloon a plugin’s file size. A simple, yet effective technique, is to copy the code used for the admin panel to a separate file and simply provide an include in the function that loads the admin panel. For example, say you load in your admin panel using this code: add_options_page(‘Plugin Name’, ‘Plugin Name’, 10, basename(__FILE__), ‘printAdminPage’); The function printAdminPage is going to be the function that loads the admin panel. Within this function you could have: function printAdminPage() { include […]
[Continue Reading...]