%s
',
esc_html__( 'ErrorWatcher requires PHP 7.4 or higher to function properly. Please upgrade your PHP version.', 'errorwatcher' )
);
}
);
return;
}
// Check minimum WordPress version requirement.
global $wp_version;
if ( isset( $wp_version ) && version_compare( $wp_version, '6.0', '<' ) ) {
add_action(
'admin_notices',
static function () {
printf(
'',
esc_html__( 'ErrorWatcher requires WordPress 6.0 or higher to function properly. Please upgrade your WordPress installation.', 'errorwatcher' )
);
}
);
return;
}
/**
* Include core plugin classes.
*/
require_once ERRORWATCHER_DIR . 'includes/class-errorwatcher-activator.php';
require_once ERRORWATCHER_DIR . 'includes/class-errorwatcher-deactivator.php';
require_once ERRORWATCHER_DIR . 'includes/class-errorwatcher-db.php';
require_once ERRORWATCHER_DIR . 'includes/class-errorwatcher-handler.php';
require_once ERRORWATCHER_DIR . 'includes/class-errorwatcher-cron.php';
require_once ERRORWATCHER_DIR . 'includes/class-errorwatcher-admin.php';
require_once ERRORWATCHER_DIR . 'includes/class-errorwatcher.php';
/**
* Plugin activation hook.
*/
function errorwatcher_activate(): void {
ErrorWatcher_Activator::activate();
}
register_activation_hook( __FILE__, 'errorwatcher_activate' );
/**
* Plugin deactivation hook.
*/
function errorwatcher_deactivate(): void {
ErrorWatcher_Deactivator::deactivate();
}
register_deactivation_hook( __FILE__, 'errorwatcher_deactivate' );
/**
* Initialize and run the plugin.
*/
function errorwatcher_run(): ErrorWatcher_Plugin {
return ErrorWatcher_Plugin::get_instance();
}
// Start plugin execution.
errorwatcher_run();