Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get List of WordPress Core Version and Plugins #1

Open
jordantrizz opened this issue Apr 20, 2022 · 0 comments
Open

Get List of WordPress Core Version and Plugins #1

jordantrizz opened this issue Apr 20, 2022 · 0 comments

Comments

@jordantrizz
Copy link
Collaborator

I’m interested in getting a list of WP core versions exported as json, csv, etc. that I can put together as a list quickly/repeatedly as needed. A step further would be doing the same for plugins (list plugin and its version).

I’m thinking this isn’t possible natively with just WP CLI or GP API but maybe doable combining both?

Using WP CLI I can get the info I’m after:

wp core version
wp plugin list --status=active --format=json
but that requires needing to be logged in as the site user or at least providing the site path using sudo -u USER -i – wp plugin list --status=active --format=json --path=sites/SITEURL/htdocs

I could do a dump of all of the users and their associated sites to a csv and then have a script run through those with the commands to get the output but that seems like a lot of manual work. I imagine doing the same leveraging GP API would be possible to do this using get sites and then running the WP CLI to get the WP version & plugins for each result.

Before I go down this method, is there an easier way to accomplish this I’m not seeing?

If there’s a question of ‘why’ would I want this…

Half of my sites are on a care plan, those are integrated into some management such as MainWP where I can easily get and monitor all of this.
The other half are not and are paying for hosting only. This information would let me proactively get their WP version, plugins, etc. that might be vulnerable and reach out to fix that before it becomes a problem for them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant