-
Notifications
You must be signed in to change notification settings - Fork 5
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
Feature: Add compatibility layer and compatibility status output #48
Feature: Add compatibility layer and compatibility status output #48
Conversation
Insecure Access Control (1)
More info on how to fix Insecure Access Control in PHP. 👉 Go to the dashboard for detailed results. 📥 Happy? Share your feedback with us. |
@scottbuscemi compatibility layer PR here ^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! I've left some comments. A couple thoughts before really digging in...
I use the 🔢 emoji throughout to indicate "this is a comment that applies elsewhere in the code". It should be pretty obvious in the context but I'm not saying "this only needs to be changed in this file", I'm saying "anywhere there is code that is like this, it should be fixed there, too".
I would expect any new major functionality added to the mu-plugin to add equivalent tests for that functionality. We have WPUnit tests running against the plugin and, with this big of a change, I would expect at least some tests. (Unfortunately, forks don't trigger the GitHub actions, but we can manually trigger them ad hoc if necessary, which I did for this PR.) While I don't think you necessarily need to test every compatibility and fix class, it is at least worth writing tests for the base class with example/test compatibility checks/fixes.
We don't fully support translations in the mu-plugin, but all of our code should be internationalized with the expectation that at some point in the future, we could. There are a lot of plain text strings here that are not i18nized or not using the correct textdomain. The current codebase isn't consistent with what that is, but any new code should use 'pantheon'
as the textdomain.
Many functions lack docblocks. For future maintainability, I would expect those to exist at least in the base class(es) and factory class.
Everything else looks great. Happy to chat next week if necessary to go into any of the fine grain details.
TYSM for the review @jazzsequence! The team is currently addressing your comments and will have an update ASAP. Thanks again! 🙌 |
@al-esc Feel free to hit me up if y'all want to chat. I'm around on Slack. :) |
40261ca
to
8c4798f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good :)
A couple smaller changes requested, but this looks really close. The spacing issues are minor, and it's the inconsistency that I'm more concerned about. I know we're already inconsistent, and I don't want to add more inconsistency to the codebase.
One last thought now that I'm actually testing it: I like that we have our own separate tab. But I'm afraid it will get ignored too easily. It would be nice if manual fixes and things that "need review" also showed up in the main Site Health checks as recommendations with links to the Pantheon Compatibility tab for more information |
@jazzsequence main site health info tab should now also output compatibility layer tests.
|
Hey @al-esc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some very weird linting regressions. Did we get our PHPCS wires crossed? Some regressions broke URL strings and others affected code that was there before the compatibility layer feature you wrote. Not sure what happened. I'm fixing as many as I can find.
I guess I can't actually apply the suggestions in the PR. I will pull down and make the changes manually. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I've opened a PR against your fork since I can't merge changes directly into this PR: crowdfavorite#3
This fixes the various linting regressions that are in this last round.
Additionally, although I'm happy that we're now showing up on the main site health tab, it looks like there is a regression with the plugin names (presumably related to pulling out the hard-coded plugin names in favor of something more dynamic) that are displayed in both the main site health tab and the Pantheon Compatibility tab
Indeed, it looks like across the board, Plugin names are either not displaying or displaying the wrong data:
If we could get these things cleaned up I think we'll be good to go.
fix linting regressions
d124a33
to
fbbe122
Compare
Hi @jazzsequence ! Apologies for the wait, this should hopefully solve plugin name retrieval. Let me know whenever you get a chance, please and thank you! 🙌 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good so far. I'm going to pull this into my test site and take a peek but if that checks out we're good to go. A couple minor questions but nothing I'm going to block this on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@al-esc I clicked approve but it looks like there's one minor linting issue
|
@jazzsequence thank you! I would definitely like to maybe spend a bit of time looking at this together, not quite sure what's going on there with the plugin names using the fallback values for you 🤔 |
@al-esc I did some digging/testing. Looks like paths are failing when you construct |
Oh wait, maybe it's actually because the plugins weren't active? I think there are a couple different things at work here. Partially I think the names were wrong because the files didn't exist. And I think the files didn't exist because I had installed them in SFTP mode and then maybe didn't actually commit them to the repository -- meaning the checks ran, and cached in the database, but the plugins weren't actually there so when the plugin files were pulled for plugin information, there was nothing there. I think this is probably an edge case but maybe something worth collaborating on in the future (specifically retaining check data if the plugin in question has been deactivated or uninstalled) but not worth pursuing at this time. I'm getting mostly correct plugin names now. |
1.5.0
Adds automated compatibility fixes & reports on compatibility status for the following plugins:
Reports on required manual plugin compatibility fixes:
Reports on plugins with known compatibility issues that need review (are either incompatible or partially compatible):
Reports compatibility status in a new tab on the Site Health admin page (screenshot attached)