-
Notifications
You must be signed in to change notification settings - Fork 27
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
Refactoring plugin-initial code structure - part 3: Organizing Omise_Admin class #96
Refactoring plugin-initial code structure - part 3: Organizing Omise_Admin class #96
Conversation
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.
As before, cannot fully approve until a quick test is done. Some comments here though
omise-woocommerce.php
Outdated
*/ | ||
public function init_error_messages(){ | ||
?> | ||
<div class="error"> |
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.
Again, this REALLY feels wrong. Does WP advocate this?
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.
Welcome to WordPress world.
I cannot tell if WP advocates for this but the WP codebase is even worse..
But yup, this is kind of common thing in WordPress (even WooCommerce and many plugins also go with this way everywhere in their code).
We can go a little advance by moving this thing into a template file and load it but I guess that would be out of scope for this pull request. Maybe we can discuss further in a future PR :)
omise-woocommerce.php
Outdated
public function init_error_messages(){ | ||
?> | ||
<div class="error"> | ||
<p><?php echo __( 'Omise WooCommerce plugin requires <strong>WooCommerce</strong> to be activated.', 'omise' ); ?></p> |
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.
Need to add 'The'
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 will be automatically solved after merge #94
8d0bb07
to
d7f349b
Compare
1. Objective
Omise-WooCommerce has always been coupled with WooCommerce plugin, which the plugin cannot be used as a stand-alone plugin and always require WooCommerce plugin to be activated first.
However, the legacy-codebase itself wasn't really aware of a case where WooCommerce plugin is disabled as much as it should be.
Although we have prevented such cases #78, and #83. But by the current design of the plugin-initial step, it still remains some issue (#90) that could be ceased out by redesigning the initial-step with a proper awareness of WooCommerce plugin.
Related issue(s):
2. Description of change
Part 1
See, #94: "Refactoring plugin-initial code structure, part 1"
Part 2
See, #95: "Refactoring plugin-initial code structure, part 2"
Part 3
The last piece of code,
This part is aiming to organizing
Omise_Admin
class, by moving all admin-related code fromOmise
class back toOmise_Admin
.3. Quality assurance
🔧 Environments:
✏️ Details:
The main test-case will be separated into 3 cases as follows:
Omise-WooCommerce plugin can be activated, but all functions should be disabled, including no Omise menu at the WordPress admin-sidebar.
4. Impact of the change
No
5. Priority of change
Normal
6. Additional Notes
No