GatherPress / gatherpress

Powering our community's event management needs.
https://wordpress.org/plugins/gatherpress/
GNU General Public License v2.0
86 stars 30 forks source link

GatherPress Alpha check running too early #830

Closed swissspidy closed 1 month ago

swissspidy commented 1 month ago

Describe the bug

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

carstingaxion commented 1 month ago

Thank you for reporting.

I guess you mentioned this in the old PR about the i18n loading, but this has already been fixed in the meantime.

Thanks.

swissspidy commented 1 month ago

Ah, yeah that's where I noticed this. Good to know!