Search code examples
wordpressmultisite

Tables from uninstalled plugin still being created when new multisite blogs are added


I was looking through our database and discovered a lot of empty tables like wp_[blogId]ngg_gallery, wp[blogId]ngg_pictures and wp[blogId]_ngg_album, in addition to the non-multisite tables wp_ngg_pictures, wp_ngg_album and wp_ngg_gallery.

After some investigation I figured out it’s most likely from a Nextgen Gallery plugin, and that it was last installed many years ago, as I didn’t know we’ve ever had it myself. For example in the plugins-folder I found the folder nextgen-gallery. However the only files left in that folder is nextgen-gallery/index.html and nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/images/ui-anim_basic_16x16.gif. The plugin does not appear in the plugin list. The folder mu-plugins is empty.

There is also folder wp-content/ngg, but that just consists of a bunch of empty folders.

Regardless of the fact the plugin apparently hasn’t been installed for a long time, and there seems to be no residual plugin php files, these tables are somehow still created when a new blog is created.

I would like to remove these tables, since they are empty anyway and of no value to us. However, I would also like to prevent them being added to future blogs added to the multisite installation.

I’ve tried to look search for ngg in both option_name/meta_name and option_value/meta_value in both wp_options and wp_sitemeta tables, and while I’ve found some entries relating to the plugin, I haven’t found something that would help explain the creation of tables.

Hope you can help and put me on the right track to solving this.

Would it be as simple as just dropping the "core tables" wp_ngg_album, wp_ngg_pictures and wp_ngg_gallery ? Since I sort of assume at this point that Wordpress must do some magic that simply creates a copy of the table structure from these ones. However, how does Wordpress pick/figure out which tables should be copied into wp_[blog_id]_ tables and not? I would assume that plugin authors and wordpress themselves must have some sort of whitelist or blacklist defined somewhere.

Best regards


Solution

  • I finally figured this out, it turns out we have a plugin Multisite Cloner which I somehow missed to spot the other day. When a new site is added that plugin basicly deletes the default tables and instead proceeds to make a copy of the tables a blog defined in the settings for that plugin has.

    The site that is cloned still had the ngg tables.