Skip to content

Fix error when activating MailPoet#7864

Merged
m1r0 merged 2 commits intotrunkfrom
fix/mailpoet-error-on-plugin-activation
Nov 21, 2025
Merged

Fix error when activating MailPoet#7864
m1r0 merged 2 commits intotrunkfrom
fix/mailpoet-error-on-plugin-activation

Conversation

@m1r0
Copy link
Member

@m1r0 m1r0 commented Nov 21, 2025

Resolves SEN-26

Proposed Changes

  • Fix the MailPoet activation error by moving the initialization to the mailpoet_initialized hook.

Testing Instructions

  1. Have the Sensei LMS plugin active.
  2. Activate the MailPoet plugin.
  3. MailPoet should be activated successfully, and there should be no errors.
  4. Make sure the MailPoet initialization is still working as before.

Pre-Merge Checklist

  • PR title and description contain sufficient detail and accurately describe the changes
  • Adheres to coding standards (PHP, JavaScript, CSS, HTML)
  • All strings are translatable (without concatenation, handles plurals)
  • Follows our naming conventions (P6rkRX-4oA-p2)
  • Hooks (p6rkRX-1uS-p2) and functions are documented
  • New UIs are responsive and use a mobile-first approach
  • Code is tested on the minimum supported PHP and WordPress versions

@m1r0 m1r0 self-assigned this Nov 21, 2025
Copilot AI review requested due to automatic review settings November 21, 2025 13:59
@m1r0 m1r0 added this to the 4.25.2 milestone Nov 21, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a critical error that occurred when activating the MailPoet plugin while Sensei LMS is active. The fix defers MailPoet integration initialization to the mailpoet_initialized action hook instead of attempting immediate initialization.

  • Moves MailPoet API initialization from initialize_global_objects() to a new initialize_mailpoet() method
  • Registers the new method as a callback for the mailpoet_initialized action hook
  • Prevents initialization timing conflicts during plugin activation

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
includes/class-sensei.php Defers MailPoet integration initialization to the mailpoet_initialized hook to prevent activation errors
changelog/fix-mailpoet-error-on-plugin-activation Documents the bug fix in the changelog

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@m1r0 m1r0 merged commit 015c8e9 into trunk Nov 21, 2025
28 of 29 checks passed
@m1r0 m1r0 deleted the fix/mailpoet-error-on-plugin-activation branch November 21, 2025 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants