-
Notifications
You must be signed in to change notification settings - Fork 21
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
Consistent usage of ContainerAware #2761
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2761 +/- ##
===========================================
- Coverage 67.0% 67.0% -0.1%
+ Complexity 4692 4684 -8
===========================================
Files 480 480
Lines 19601 19581 -20
===========================================
- Hits 13141 13116 -25
- Misses 6460 6465 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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 refactoring to use ContainerAware consistently and also add / fix the conditional loading for some classes . I have gone through the onboarding and tested all the pages within the extension, the requests were successful as normal.
Changes proposed in this Pull Request:
This PR standardizes the usage of ContainerAware across various classes. This makes it more consistent with what was decided in issue #563
I've also fixed some of the AdminConditional loading to ensure that some of the classes are not loaded on the frontend.
I was considering adding
is_admin() && ! wp_doing_ajax()
to the AdminConditional. But for now I left it since there could be a possibility that coupon bulk editing or activating plugin is done through an ajax request, which might silently break some of the actions. So for now I've left it as we'd need to do some extensive testing to make sure we aren't missing any ajax requests.When looking at a front end request we can thus see a small decrease in the time spent resolving classes.
Before:
After:
PR #2758 takes that a step further. We can still decrease it even more, but considering that it needs specific testing for each change, I think it's better to improve that through multiple separate PR's.
Closes #563
Detailed test instructions:
Changelog entry