id, array( 'plugins', 'plugins-network', 'dashboard' ), true ) ) {
return; // only for the people who can act on it, on the Plugins screen and the Dashboard
}
echo '
itsMalicious: ' . esc_html( ITSM_Compat::fatal_reason() ) . '
';
} );
return;
}
// Safe mode (SAFE_MODE file in the data directory or ITSM_SAFE_MODE constant): no runtime hooks, admin only.
if ( ! ITSM_Compat::safe_mode() ) {
// Optional itsmalicious.com services (threat feeds, reputation provider): filters first, so the firewall sees them.
ITSM_Services::boot();
// Firewall must run as early as possible.
ITSM_Firewall::instance()->boot();
ITSM_Login::instance()->boot();
ITSM_Traffic::instance()->boot();
ITSM_Cron::instance()->boot();
ITSM_Hardening::instance()->boot();
ITSM_TwoFactor::instance()->boot();
ITSM_Content_Guard::instance()->boot();
}
// Bookkeeping only (issues follow updates made anywhere), so it also runs in safe mode.
ITSM_Updates::boot();
// Central: one-way reports to itsmalicious.com after scans and once a day, only while the administrator
// keeps the site connected. The plugin exposes no REST routes and accepts no remote commands.
ITSM_Central::boot();
// Memory for a scan step: the administrator's "scan memory limit" setting, used by wp_raise_memory_limit( 'itsm_scan' ).
add_filter( 'itsm_scan_memory_limit', static function () {
return (int) ITSM_Options::get( 'scan_memory_limit', 256 ) . 'M';
} );
// Answers the plugin's own signed loopback question "does a normal page load this file?", asked before a file is deleted.
if ( isset( $_SERVER['HTTP_X_ITSM_PROBE'] ) ) {
add_action( 'shutdown', array( 'ITSM_Repair', 'answer_probe' ), 0 );
}
if ( is_admin() ) {
ITSM_Admin::instance()->boot();
}
add_action( 'plugins_loaded', array( $this, 'maybe_upgrade' ), -1000 ); // before the firewall (-100) reads the plugin's tables, also on a network site visited for the first time
}
public function maybe_upgrade() {
if ( get_option( 'itsm_version' ) !== ITSM_VERSION ) {
ITSM_Installer::install();
}
}
}
ITSM_Plugin::instance();