Theme Switcher Shim plugin now obsolete

It appears that the author has updated Theme Switcher Plugin to version 1.1 and now includes the functionality I put into Theme Switcher Shim Plugin. So I’ll see if I can delete the shim from the Plugin Manager database.

I have noticed that Theme Switcher Plugin really slows down my WordPress page display. When I install all 140 or so plugins from the theme site, it takes about 5 seconds to display my WP home page. With the plugin disabled it takes 0.78 seconds, according to the timing stats in the footer.

The problem is that the plugin calls get_themes in order to have the theme file names for the links, because all it stores in the plugin options are the theme names. get_themes reads all the theme information in the themes subdirectory, reading not only the directory contents but some information from files in every theme in the directory whether or not it is selected for the Theme Switcher list.

The solution is very simple: Store the file name in the plugin options along with the theme name.

The few line change to the plugin reduces the load time of my front page from 5 seconds down to under a second. Even better, it makes the time independent of the number of themes in the themes directory.

I’m going to email the changes to the author.

You can download this zip file containing the patch in diff format.

Leave a Reply

Your email address will not be published. Required fields are marked *