Project

General

Profile

Actions

Feature #14736

closed

Tool for querying active plugins and themes across the network

Added by Boone Gorges over 2 years ago. Updated over 2 years ago.

Status:
Resolved
Priority name:
Normal
Assignee:
Category name:
Internal Tools and Workflow
Target version:
Start date:
2021-08-30
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

For years I've struggled with the task of figuring out which sites on the network are using a given theme/plugin. I have found a few existing tools, and I've written a few quick-and-dirty scripts of my own, but they are all extremely slow and somewhat unreliable. The crux of the issue is that WP stores theme and plugin info in individual site `options` tables, and you can't really do queries across these tables.

I've begun work on a tool that syncs theme and plugin data to its own set of network tables, which can then easily be queried to generate reports, etc. https://github.com/cuny-academic-commons/cac-network-info

Currently it supports only themes, and has no feature other than the 'sync' tools. Briefly:

wp cac-network-info database install

installs a database with columns for site_id, template, and stylesheet.

wp cac-network-info sync 5 cunypie.commons.gc.cuny.edu

will copy information from site #5 and cunypie.commons.gc.cuny.edu into the themes table (it supports both of these formats for easy chaining, and it does an internal URL lookup if you pass the URL rather than the blog_id).

wp cac-network-info sync --all-sites

syncs all sites to the table (takes about half an hour on the production site).

There are also mechanisms to ensure that the data is synced whenever a site is created, or on switch_theme

At some point soon, I'll add parallel support for plugins. This minimum amount of work will let us query a single set of MySQL tables to find out what's active across the network. Down the road, I'll add additional CLI tools that allow you to generate reports, perhaps including export to CSV files.

Actions #1

Updated by Raymond Hoh over 2 years ago

Big +1 here!

Actions #2

Updated by Matt Gold over 2 years ago

this sounds very cool!!!!

Actions #3

Updated by Boone Gorges over 2 years ago

I wrote the "plugin" half of the tool this morning and the sync is currently running for the production site. I'll leave this ticket open in case I have the resources to write any reporting tools before the 1.19.0 release.

Actions #4

Updated by Boone Gorges over 2 years ago

  • Status changed from New to Resolved

Let's mark this resolved for now, and add new reporting functionality etc as needed.

Actions

Also available in: Atom PDF