WP Manifestindependent plugin directory
manifest / multisite / wp-multisite-unused-plugin-finder

Multisite Unused Plugins Finder

Multisite Unused Plugins Finder

by https://github.com/kosarlukascz/ · github.com/kosarlukascz/wp-multisite-unused-plugin-finder

1stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/kosarlukascz/wp-multisite-unused-plugin-finder/archive/refs/heads/main.zip

A WordPress multisite plugin that helps you identify and safely remove plugins that are deactivated on ALL sites in your network. Perfect for cleaning up your WordPress multisite installation and recovering disk space.

🎯 Purpose

Managing plugins across a large multisite network can be challenging. Over time, you accumulate plugins that are no longer used anywhere but still consume disk space and create security/maintenance overhead. This plugin solves that problem by:

  • Finding plugins unused everywhere - Shows only plugins deactivated on ALL sites
  • Safe removal - Prevents accidental deletion of plugins still in use somewhere
  • Network overview - Provides complete usage statistics across your entire network
  • Bulk operations - Select and delete multiple unused plugins at once

✨ Features

🗑️ Safe Removal

  • Red-highlighted section showing plugins safe to remove
  • Bulk selection with "Select All" / "Deselect All" buttons
  • Bulk deletion with confirmation dialogs
  • Double-check protection - Verifies plugins are still unused before deletion

📊 Usage Analytics

  • Usage percentage for each plugin across the network
  • Color-coded indicators:
    • 🔴 Red (0%) - Completely unused, safe to remove
    • 🟡 Yellow (<50%) - Low usage, consider reviewing
    • 🟢 Green (≥50%) - High usage, actively used
  • Detailed breakdown showing exactly which sites use each plugin

💾 Data Management

  • File size calculation - See how much disk space you'll recover
  • CSV export - Download complete reports for record keeping
  • Real-time updates - Data refreshes automatically after deletions

🔐 Security & Safety

  • Permission checks - Requires network admin and plugin deletion capabilities
  • Nonce verification - Protects against CSRF attacks
  • Network-active plugin protection - Never suggests removing network-active plugins
  • Usage verification - Double-checks plugin status before deletion

📋 Requirements

  • WordPress Multisite installation
  • PHP 7.4+ (recommended)
  • Network Admin access
  • Plugin deletion permissions

🚀 Installation

Method 1: Manual Installation

  1. Download the plugin file (multisite-unused-plugins-finder.php)
  2. Upload to your /wp-content/plugins/ directory
  3. Network Activate the plugin from Network Admin → Plugins
  4. Access via Network Admin → Plugins → Unused Plugins

Method 2: FTP Upload

# Upload via FTP to your server
/wp-content/plugins/multisite-unused-plugins-finder.php

📖 Usage Guide

Step 1: Access the Plugin

Navigate to Network Admin → Plugins → Unused Plugins

Step 2: Review Unused Plugins

Look for the 🗑️ Completely Unused Plugins (Safe to Remove) section (highlighted in red)

Step 3: Select Plugins to Remove

  • Use "Select All" to select all unused plugins
  • Or manually check individual plugins
  • Review the file sizes to see disk space impact

Step 4: Delete Selected Plugins

  1. Click "Delete Selected Plugins"
  2. Confirm the deletion in the popup dialog
  3. Wait for the process to complete
  4. Review the success message

Step 5: Monitor Usage (Optional)

  • Review the 📊 Plugin Usage Overview section
  • Identify plugins with low usage that might be candidates for future removal
  • Export data for record keeping using the "Export List" button

🛡️ Safety Features

What the Plugin WON'T Delete

  • Network-active plugins - Never suggested for removal
  • Plugins active on any site - Only shows completely unused plugins
  • WordPress core files - Only handles plugins in /wp-content/plugins/

Built-in Protections

  • Double verification before deletion
  • Detailed confirmation dialogs showing exactly what will be deleted
  • Real-time usage checks - Verifies plugin status immediately before deletion
  • Permission validation at every step

📊 Understanding the Interface

Summary Statistics

Total Sites in Network: 15
Total Plugins Installed: 47
Completely Unused Plugins: 8

Plugin Usage Table

Plugin Name Usage Active on Sites Sites Using It
Old Plugin 0% (0/15 sites) 0 None - Safe to remove
Low Usage 13.3% (2/15 sites) 2 ID: 5, ID: 12
Popular Plugin 86.7% (13/15 sites) 13 [Expandable list]

Color Coding

  • 🔴 Red (0%): Completely unused - safe to remove
  • 🟡 Yellow (<50%): Low usage - consider reviewing
  • 🟢 Green (≥50%): High usage - actively used

🔧 Technical Details

Performance

  • Efficient scanning - Optimized database queries
  • Memory conscious - Handles large networks without timeout
  • Batch processing - Processes deletions safely in groups

Database Impact

  • Read-only analysis - No database changes during scanning
  • Minimal queries - Uses WordPress caching when available
  • Network optimized - Designed for large multisite installations

File Operations

  • Recursive directory scanning - Accurate file size calculations
  • Safe deletion - Uses WordPress native delete_plugins() function
  • Cleanup verification - Confirms successful removal

📁 File Structure

multisite-unused-plugins-finder.php    # Main plugin file
├── MultisiteUnusedPluginsFinder       # Main class
├── Admin interface methods
├── Plugin analysis methods
├── Bulk deletion handlers
├── CSV export functionality
└── Security & permission checks

🐛 Troubleshooting

Common Issues

Problem: "You do not have sufficient permissions" Solution: Ensure you're logged in as a Network Super Admin

Problem: Plugin shows as unused but is actually needed Solution: Check if it's a "must-use" plugin or has custom activation logic

Problem: Deletion fails for some plugins Solution: Check file permissions and ensure WordPress can write to the plugins directory

Problem: Large networks timeout during scanning Solution: Increase PHP max_execution_time or scan smaller batches

Support

  • Check WordPress error logs for detailed error messages
  • Verify file and directory permissions
  • Ensure WordPress multisite is properly configured
  • Test on a staging environment first

⚠️ Important Notes

Before Using This Plugin

  1. Backup your site - Always maintain recent backups
  2. Test on staging - Verify behavior in a non-production environment
  3. Review carefully - Double-check which plugins you're removing
  4. Document changes - Keep records of what you remove

Best Practices

  • Regular maintenance - Run monthly checks for unused plugins
  • Gradual cleanup - Remove plugins in small batches
  • Monitor impact - Check sites after plugin removal
  • Keep records - Export CSV reports before major cleanups

🔒 Security Considerations

  • Only Network Super Admins can use this plugin
  • All actions require proper nonce verification
  • Plugin deletion requires explicit confirmation
  • No remote code execution or file inclusion vulnerabilities

🤝 Contributing

This plugin is designed to be lightweight and focused. If you have suggestions:

  1. Test thoroughly on staging environments
  2. Document any issues with specific plugin types
  3. Provide detailed reproduction steps
  4. Consider performance impact on large networks

👨‍💻 Development

This plugin was developed by vibe coding with assistance from Claude AI.

  • Developer: vibe coding
  • AI Assistant: Claude (Anthropic)
  • Development approach: Human creativity + AI efficiency

📄 License

GPL v2 or later - Same as WordPress core

📝 Changelog

Version 1.0.0

  • Initial release
  • Basic unused plugin detection
  • Bulk deletion functionality
  • CSV export feature
  • Usage statistics overview
  • Network multisite support

⚡ Clean up your WordPress multisite network efficiently and safely!