| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
@aristath The change looks good to me, but I think we need to evaluate whether this is generally considered useful enough to take a spot in the admin bar. I think it's a bit too late for 1.8.0 since it's an enhancement that was just opened today and needs a bit of thought, so will move this to 1.9.0. |
Sorry, something went wrong.
|
@aristath We still haven't had any conversation about this. For example here's some questions I have which would be good to discuss:
Last but not least, should we do this or should we not do this? @bethanylang This is probably not a massive conversation to reserve an entire chat for, but still it could be a good topic to cover in one of the next ones. For now I'll move this to the next release (2.0.0) since we need to create the 1.9.0 release branch today. |
Sorry, something went wrong.
|
@aristath Wondering what your take is on the above? What led you to opening this PR? :) |
Sorry, something went wrong.
|
Initially, when someone was activating the module, they were getting the install screen where they would set their site-name etc. With that workflow, I was just setting the site-name to SQLite test and I could immediately see (by the site-title) which db I'm working with. |
Sorry, something went wrong.
|
Thanks @aristath, makes sense. I was just a bit concerned to use the limited WP Admin bar space, but that use-case is reasonable to me. However, I would advise we also show that menu item when not using SQLite, just as long as the module is active. We also need to consider the value of the DATABASE_TYPE constant. Maybe like this:
Or alternatively, we could just rely on $wpdb->db_server_info() to determine which DB is being used, this way we wouldn't need to deal with the constants at all, and it would look at the real source of truth (arguably the $wpdb class is the source of truth for what is actually being used). If we do that, we can even differentiate between "SQLite", "MySQL", and "MariaDB" if we want (the latter isn't really necessary but nice to have). Let me know what you think. My main feedback would be to show the menu even when SQLite is not enabled but the module is enabled, as that would be a good indicator that something is wrong. |
Sorry, something went wrong.
Sounds good to me 👍 |
Sorry, something went wrong.
Done. |
Sorry, something went wrong.
There was a problem hiding this comment.
@aristath A bit of additional follow up feedback.
Sorry, something went wrong.
| /* translators: %s: SQLite icon. */ | ||
| 'title' => defined( 'PERFLAB_SQLITE_DB_DROPIN_VERSION' ) && defined( 'DATABASE_TYPE' ) && 'sqlite' === DATABASE_TYPE | ||
| ? '<span style="color:#46B450;">' . __( 'Database: SQLite', 'performance-lab' ) . '</span>' | ||
| : '<span style="color:#DC3232;">' . __( 'Database: MySQL', 'performance-lab' ) . '</span>', |
There was a problem hiding this comment.
See my comment #604 (comment) (also #604 (comment)), we should use $wpdb->db_server_info() to display more accurate information. It's not always MySQL, it can also be MariaDB.
Also noting that inlining this conditional here makes this hard to parse, we can simplify this by e.g. using a $title variable.
Sorry, something went wrong.
| add_action( 'admin_notices', 'perflab_sqlite_plugin_admin_notice' ); // Add the admin notices. | ||
|
|
||
| /** | ||
| * Add a link to the admin bar. |
There was a problem hiding this comment.
Function descriptions should start with a third-person verb per WP docs standards. Also, we need to add a @since annotation.
| * Add a link to the admin bar. | |
| * Adds a link to the admin bar. | |
| * | |
| * @since n.e.x.t |
Sorry, something went wrong.
|
@aristath In the interest of time, I've quickly addressed the outstanding feedback myself in 6bf9328, since we preferably need to merge this today to get it into the 2.0.0 release. @SergeyBiryukov Can you give this a quick review, since you previously commented (and I rather don't just approve my own additions 😄)? |
Sorry, something went wrong.
|
@aristath Can you add this change to the standalone plugin as well please? |
Sorry, something went wrong.
|
Will do 👍 |
Sorry, something went wrong.
|
I'm gonna go ahead and merge this in order to create the new release branch. If there's anything that should be changed, we can always open a quick follow up PR against that branch release/2.0.0. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Adds an indicator in the adminbar to show when using SQLite:
Checklist