-
Notifications
You must be signed in to change notification settings - Fork 140
Introduce UI for managing Performance Lab standalone plugins. #864
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
Introduce UI for managing Performance Lab standalone plugins. #864
Conversation
…es-to-standalone-plugins
…ation-ui-from-old-modules-to-standalone-plugins
… plugin managment UI and REST endpoints.
…in applicable load files, enqueue necessary scripts for settings screen.
…dules-to-standalone-plugins
… plugin install actions.
…rocess triggering UI and JS errors.
…Press/performance into feature/creating-standalone-plugins
…settings-screen-manage-standalone-plugins
@10upsimon there are still suggestions that haven't been committed. For example:
|
… of github.com:WordPress/performance into issue/651-pl-settings-screen-manage-standalone-plugins
…ons within plugin cards.
Co-authored-by: Weston Ruter <westonruter@google.com>
Co-authored-by: Weston Ruter <westonruter@google.com>
Co-authored-by: Weston Ruter <westonruter@google.com>
Co-authored-by: Weston Ruter <westonruter@google.com>
Co-authored-by: Weston Ruter <westonruter@google.com>
Co-authored-by: Weston Ruter <westonruter@google.com>
Thanks @westonruter I suspect these were being hidden in "outdated" accordions when other changes were made to the same file(s), I've addressed them all in recent commits, thank you. |
… of github.com:WordPress/performance into issue/651-pl-settings-screen-manage-standalone-plugins
felixarntz
left a comment
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.
@10upsimon As you've pointed out already, there's at least one issue with "over-escaped" content.
|
@felixarntz this is ready for the final review, I've removed the over escaping on the author output as identified in a prior comment. I've also removed the unnecessary package-lock.json file change, simply checking out the last commit when this file changed for a reason (10 Aug 2023). This file had changed due to initial iterations I had done on this issue, prior to the refactoring where we decided to use as much of core's |
felixarntz
left a comment
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 @10upsimon!
Summary
Addresses: #651
Relevant technical choices
PerformanceLab\Plugin_Managerclassget_standalone_plugins()static method as a means to reference the available standalone plugins. This will need to be updated in PL plugin releases as more standalone plugins are released to the WordPress plugin directory.render_plugins_ui()static method as a catch all use-once method to handle rendering of the standalone plugins UI within the PL setting screen. Used withinadmin/load.phpas the main means of rendering the view. This borrows heavily from cores implementation of the UI viaPlugins > Add New.render_plugin_card()static method that handles rendering of the UI for each individual plugin card. This borrows heavily from cores implementation of the UI viaPlugins > Add New.admin/load.phpperflab_render_modules_page()function to include a call toPlugin_Manager::render_plugins_ui()in order to render the standalone plugins UI as the first UI section within the PL settings screen.perflab_handle_inline_plugin_actions()hooked to actionadmin_initin order to successfully redirect the end user back to the PL Settings screen upon activation or deactivation of a standalone plugin from the standalone plugins UI rendered within the PL settings screen.perflab_admin_scriptshooked to actionadmin_enqueue_scriptsin order to:updatesscript, used to handle plugin actions within the rendered UI as a result ofPerformanceLab\Plugin_Manager::render_plugins_ui().updatesscript viawp_localize_script()and provide the following data:settingsAn array of settings necessary for correct functionality ofpluginsscript, most notably thetotalskey which contains plugin update totals, facilitate via a call towp_get_update_data(). Without this, theupdatesscript does not function as intended as it utilizes this data for retrieving and updating data stores.thickboxscript, necessary for correct lightbox handling from within each plugin UI card.thickboxstyle, necessary for correct lightbox appearance as triggered from within each plugin UI card.Checklist
[Focus]orInfrastructurelabel.[Type]label.no milestonelabel.