&$value ) { $value = ( 0 === strpos( $option, 'sucuriscan_notify_' ) ) ? 'disabled' : $value; } $options['sucuriscan_use_wpmail'] = 'enabled'; $options['sucuriscan_diff_utility'] = 'enabled'; $options['sucuriscan_lastlogin_redirection'] = 'enabled'; return $options; } ); add_action( 'current_screen', function ( $current_screen ) { if ( ! class_exists( 'SucuriScanCache' ) || empty( $current_screen->id ) || 'toplevel_page_sucuriscan' !== $current_screen->id ) { return; } $cache = new SucuriScanCache( 'integrity' ); $whitelist = [ 'gd-config.php' => 'added', 'wp-admin/install.php' => 'removed', 'wp-admin/includes/upgrade.php' => 'modified', ]; // Prevent our files from affecting integrity checks. foreach ( $whitelist as $file_path => $file_status ) { $key = md5( $file_path ); if ( ! $cache->exists( $key ) ) { $cache->add( $key, [ 'file_path' => $file_path, 'file_status' => $file_status, 'ignored_at' => time() ] ); } } } ); } /** * Keep the plugin up-to-date. * * @action auto_update_plugin - PHP_INT_MAX * * @param boolean $update Whether to update. * @param object $item The plugin info. */ public function auto_update_plugin( $update, $item ) { return ( self::BASENAME === $item->plugin ) ? true : $update; } }