check_gatherpress_alpha is hooked to admin_init and immediately prints an admin notice if the Alpha plugin is not installed. This causes markup to be printed even before the opening <html> tag.
<div class="notice notice-warning is-dismissible">
<p>
The GatherPress Alpha plugin is not installed or activated. This plugin is currently in heavy development and requires GatherPress Alpha to handle breaking changes. Please <a href="https://github.com/GatherPress/gatherpress-alpha" target="_blank">download and install GatherPress Alpha</a> to ensure compatibility and avoid issues. </p>
</div>
<!DOCTYPE html>
<html class="wp-toolbar"
lang="de-DE">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
This just so happens to work because browsers and WP doing magic. But this should really not be done like this.
To fix this, change the hook to admin_notices.
Steps to Reproduce
Check source code
Screenshots, screen recording, code snippet
No response
Environment information
No response
WordPress information
No response
Code of Conduct
[X] I agree to follow this project's Code of Conduct
Describe the bug
check_gatherpress_alpha
is hooked toadmin_init
and immediately prints an admin notice if the Alpha plugin is not installed. This causes markup to be printed even before the opening<html>
tag.This just so happens to work because browsers and WP doing magic. But this should really not be done like this.
To fix this, change the hook to
admin_notices
.Steps to Reproduce
Check source code
Screenshots, screen recording, code snippet
No response
Environment information
No response
WordPress information
No response
Code of Conduct