Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Globalize new variables after loading plugin file #17

Merged
merged 3 commits into from
Feb 26, 2025

Conversation

dlh01
Copy link
Member

@dlh01 dlh01 commented Feb 26, 2025

Fixes #16. As noted there, this approach was previously implemented at https://l.alley.dev/c0cc8fb23c, which is derived from https://github.com/Automattic/vip-go-mu-plugins/blob/60780fee97674a77a9ada2b25ce6dd4b6ebbd583/vip-helpers/vip-utils.php#L1381-L1424.

Worth noting that even with this update, the plugin loader still can't correctly load the Disqus plugin, which was one that has been causing us difficulty: https://l.alley.dev/636711d9c8. The reason is that the Disqus plugin doesn't explicitly globalize the variable in question, but tries to reference it later in the plugin entry file with the global keyword in function scope, the result being that we don't have any opportunity to actually globalize the variable before the global keyword is used.

Copy link

@renatonascalves renatonascalves left a comment

Choose a reason for hiding this comment

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

🌵

@dlh01 dlh01 merged commit 41c33c7 into develop Feb 26, 2025
5 checks passed
@dlh01 dlh01 deleted the fix/issue-16/global-variables branch February 26, 2025 20:45
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.

Global variables not loaded into global scope
2 participants