| 开发者 | gsrcoimbatore |
|---|---|
| 更新时间 | 2026年8月22日 22:51 |
| PHP版本: | 8.0 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPL-2.0-or-later |
| 版权网址: | 版权信息 |
set_error_handler() and register_shutdown_function() at priority 1, before any other plugin fires. If an undefined function call occurs at runtime, Omni Guard catches it, logs the incident, and — in admin — shows a clean recovery page instead of a blank screen.
3. Dependency Pre-flight Check
On every admin request, reads the dependency map and verifies that every mapped cross-plugin function actually exists right now. If any is missing, an admin notice fires before any plugin code tries to call it.
4. Developer Safety Shims — og_call(), og_exists(), og_guard()
Global helper functions that plugin developers can use to make their cross-plugin calls crash-proof:
```php
// Returns WP_Error if missing — never crashes
$result = og_call( 'some_plugin_function', $arg1, $arg2 );
// Boolean existence check
if ( og_exists( 'some_plugin_function' ) ) { ... }
// Call with a fallback
$result = og_guard( 'some_plugin_function', fn() => 'default', $arg1 );
```
Admin Dashboard includes:
omni-guard.zip via Plugins → Add New → Upload PluginNo. It prevents your site from crashing when they go missing, logs the incident, and alerts you. You still need to re-activate the missing plugin or remove the dependency.
Never. Omni Guard is read-only at the filesystem level. It analyses files but never writes to them.
No. Scanning runs in WP-Cron background tasks. The runtime guard registers one error handler — effectively zero overhead.
PHP 8.0 or higher (uses match expressions, named arguments, first-class callables).
High (3): Functions related to auth, payment, security, or sanitisation. Medium (2): Data functions — get_, set_, update_, delete_, etc. Low (1): Utility/helper functions unlikely to cause data loss if missing.