đź’» Personal Code Project: WordPress Plugin Info Grabber
I built a simple JavaScript console script to automate plugin inventory, capturing active and inactive plugins before troubleshooting—saving manual tracking and making it easier to restore my WordPress setup afterward.
đź“…Â Date Written:Â 2026-11-01
Here is a short console script I wrote today. It uses vanilla JavaScript to scrape the plugins installed on my WordPress website and list which ones are active and inactive.
I needed to document that starting point before troubleshooting an Action Scheduler “past-due actions” warning. My plan was to deactivate the plugins, then re-enable them one by one to help isolate a possible culprit. The warning alone doesn’t prove a plugin is broken; Action Scheduler notes that some past-due actions are normal.
Rather than copy everything manually, I wrote a browser-console script that outputs:
- Active and inactive plugins in separate groups.
- Each plugin’s name.
- Its version and author details.
The initial code took about 15 minutes. Troubleshooting took another 5–10 minutes after I hit a “can’t read innerText of null” error. I was checking too late: the selected element itself could be null. Perplexity helped explain how optional chaining (?.) and nullish coalescing (??) addressed that issue.
Then I spent about 30 minutes locating my ehw-lib repository, settling on a naming convention, and organizing the file header. I used Copilot in VS Code to draft the header from my previous formats and the script’s details.
Tip: You can just go to wp-admin/site-health.php?tab=debug on your website to view the active and inactive plugins, but I wanted to use it as real-life coding challenge.
đź”— GitHub Repositories Referenced
đź§ ehd-lib
WordPress JavaScript Console Plugin Info Scraper: View Repo →
/* ==========================================================================
Program Name: WordPress Plugin Info Grabber (Vanilla JS)
File Name: ehCode_ScrapeWPPluginInfo_01.js
Snippet Type: Browser-console snippet
Programmer: Eric Hepperle
Date Created: 2026-11-01
Date Modified: --
Version: 1.00
Status: Full Working - 11/01/26
Known Issues: Depends on the WordPress Plugins page markup; assigned
variables are not declared.
Purpose:
Scrapes active and inactive plugin names and version/author details
from the WordPress Plugins page and prints them to the browser console.
Usage:
Cut and paste into the browser's developer console (F12) while viewing
the WordPress admin Plugins page. Outputs active and inactive plugins
as plugin-name and version/author-detail pairs.
Sample Results:
********* DISABLED WP PLUGINS **************
Plugin Name | Version details
WPForms Lite | Version 2.0.3.1 | By WPForms | View details
Yoast SEO | Version 28.8 | By Team Yoast | View details
...
********* ACTIVE WP PLUGINS **************
Better Search Replace | Version 1.4.11 | By WP Engine | View details
Classic Editor | Version 1.7.0 | By WordPress Contributors | View details
Duplicator | Version 5.1.0 | By Duplicator | View details | Help
...
Requires:
* A browser tab open to the WordPress admin Plugins page.
* Browser support for optional chaining and nullish coalescing.
Demonstrates:
* Vanilla JavaScript
* DOM selection and iteration
* Optional chaining and nullish coalescing
* WordPress plugin-list markup
========================================================================== */
rows_inactive = document.querySelectorAll('#the-list > tr.inactive');
console.log('********* DISABLED WP PLUGINS **************')
rows_inactive.forEach((row) => {
pluginTitle = row.querySelector('th.plugin-title > strong')?.innerText ?? ''
pluginVer = row.querySelector('.plugin-version-author-uri')?.innerText ?? ''
console.log(`${pluginTitle} | ${pluginVer} `)
})
rows_active = document.querySelectorAll('#the-list > tr.active');
console.log('********* ACTIVE WP PLUGINS **************')
rows_active.forEach((row) => {
pluginTitle = row.querySelector('th.plugin-title > strong')?.innerText ?? ''
pluginVer = row.querySelector('.plugin-version-author-uri')?.innerText ?? ''
console.log(`${pluginTitle} | ${pluginVer} `)
})