| 开发者 | maghsoudi |
|---|---|
| 更新时间 | 2026年11月16日 02:15 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
gerdoo-orphan-media-cleaner directory into /wp-content/plugins/, or install the ZIP through WordPress.gerdoo-omc-full-scan-YYYY-MM-DD.json automatically, containing index counts and explicit limitations. This does not quarantine or delete real files. The browser must remain open while the scan runs; a completed WP-CLI scan can also be loaded with its ID from the collapsed "Advanced server scan" panel. On a large media library this operation may take a long time. The report does not prove that any candidate is safe to remove.
For large libraries with WP-CLI and an administrator user ID, the scan can be advanced in the server process without keeping the browser open:
wp gerdoo-omc start --as-user=1 --seconds=300
The command prints a 32-character scan ID. Re-run it with resume, the same user ID and the scan ID until the phase is done:
wp gerdoo-omc resume SCAN_ID --as-user=1 --seconds=300
wp gerdoo-omc status SCAN_ID --as-user=1
To reclaim indexes belonging to expired scans in bounded batches without touching quarantined files, use:
wp gerdoo-omc cleanup --as-user=1 --seconds=300
Replace 1 with an authorized administrator's numeric ID and SCAN_ID with the exact returned ID. The scan is not a cleanup command and never deletes files. In "Quarantine and Recovery", expand "Advanced server scan", enter the ID while signed in as that same administrator, then select "Show scan results" to review completed results. Schema upgrades invalidate prior scan IDs, and ordinary content/reference changes still invalidate the scan for safety. The lifetime is renewed on checkpoints (default seven days; filter gerdoo_omc_scan_lifetime, constrained to one through thirty days). Only standard attachment metadata additions on single sites are reconciled incrementally; this does not provide a fully transactionally consistent snapshot of an arbitrarily changing WordPress site. Plan a maintenance window for active publishing, uploads and unsupported integrations.
Private quarantine can now be configured through the initial setup panel in WordPress Tools without editing wp-config.php. The UI suggests a location only when it detects a conventional public-root boundary and its parent is writable; the administrator must verify that other virtual hosts or aliases cannot expose the folder. A location is created and validated only after the administrator explicitly clicks Save. The path is saved per site as the gerdoo_omc_vault_path option. The GERDOO_OMC_VAULT_PATH constant in wp-config.php remains supported and takes precedence over the option. The vault must be outside the document root, ABSPATH, WP_CONTENT_DIR and the uploads base directory. If this boundary or write access cannot be established, scans still work and quarantine is blocked. Changing the option is refused while active recovery records exist.
The WordPress database account must be able to create/alter plugin tables. The quarantine and reserved-paths tables must use InnoDB for crash-safe atomic reservations. New file operations are blocked if this cannot be verified.
Example on Linux: define( 'GERDOO_OMC_VAULT_PATH', '/home/example/private/gerdoo-media-vault' );
Example on Windows: define( 'GERDOO_OMC_VAULT_PATH', 'E:/WordPress-Private/gerdoo-media-vault' );
If using the optional constant, pre-create its parent directory and grant the PHP service account appropriate access. Use the same vault configuration for web requests and WP-CLI. Include the private vault in your backups.
Developer diagnostics and integration fixtures are not included in this plugin package. They have no public admin screen or callable AJAX endpoint.No. References in arbitrary custom tables, theme/plugin source files, dynamic PHP, remote consumers or a CDN with an unrelated path scheme cannot be exhaustively proven absent. Ambiguous numeric/basename evidence conservatively retains possible matches. Direct SQL edits can bypass WordPress change hooks. Do not edit/import content concurrently with a scan or deletion. Offloaded, unmapped or incomplete attachment families are not eligible for file changes; an unindexable family can stop the scan.
An incomplete scan cannot authorize file changes. A quarantine operation has a durable private manifest before any source removal. Open the trash tab to continue or restore an interrupted operation. Conflicting destinations, changed checksums and changed references stop operations rather than overwriting data. A failed copy can leave a partial private payload; restore the retained source and inspect the journal before retrying. Permanent deletion is irreversible once it starts.
No. Its table and files are preserved exactly during upgrade. Use the explicit private migration action. Until that succeeds, the old uploads/gerdoo-trash-bin location remains public. Old records that are corrupt or not raster images require manual recovery.
Tables, scans, upload boundaries and vault directories are per blog. Each blog upgrades lazily on admin access, including blogs created after network activation. References across blogs, network metadata and shared user metadata are scanned conservatively, with a shared invalidation token. The default maximum is 1,000 sites; larger installations stop safely unless trusted code adjusts gerdoo_omc_max_sites. Network-wide content/file mutations outside standard WordPress hooks still require operator coordination.
Yes. Trusted code may use gerdoo_omc_reference_sources, gerdoo_omc_attachment_files, and gerdoo_omc_excluded_directories. Source definitions are developer configuration, not user input. Limits can be adjusted with gerdoo_omc_max_document_bytes, gerdoo_omc_max_document_references, gerdoo_omc_max_large_html_bytes and gerdoo_omc_max_file_bytes. Increasing limits may exceed hosting resources. Do not remove necessary exclusions without understanding their ownership boundaries.
Recoverable files, attachment quarantine markers, legacy data, operation journals and database recovery tables are deliberately retained. Reinstall with the same uploads/vault locations to regain access. Restore or permanently delete active quarantine entries before any manual cleanup. Only then may an administrator remove the plugin's gerdoo_omc_* tables/options, the old gerdoo_media_trash table if empty, and the empty vault. Do not remove quarantine markers while their files are still missing.