-
Notifications
You must be signed in to change notification settings - Fork 10
Feat/client optimizations #905
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
Conversation
selul
commented
Mar 27, 2025
•
edited
Loading
edited
- https://github.com/Codeinwp/optimole-service/issues/1441
- https://github.com/Codeinwp/optimole-service/issues/1277
- https://github.com/Codeinwp/optimole-service/issues/1170
- Image in mega menu is detected as hero image #780
- https://github.com/Codeinwp/optimole-service/issues/1385
- https://github.com/Codeinwp/optimole-service/issues/1400
- https://github.com/Codeinwp/optimole-service/issues/1401
- Added new classes for page profiling and storage management. - Introduced functionality to store above-the-fold image data and background selectors for different device types. - Enhanced lazy loading and preloading mechanisms for images. - Updated REST API to handle optimization data submissions. - Integrated new profiling features into existing components for improved performance tracking.
- Added support for time and HMAC parameters in optimization data submissions. - Improved validation for optimization requests in the REST API. - Updated the optimizer script to include new parameters for better tracking. - Refactored code for clarity and consistency across various components. - Enhanced lazy loading and preloading mechanisms for improved performance.
- Updated the version of the optimole-sdk to v1.2.2 in composer.lock. - Added new CSS variables for improved styling in the dashboard. - Introduced a new radio control for lazy loading behavior options. - Enhanced the settings for retina images and lazy loading configurations. - Refactored code to improve clarity and maintainability across various components.
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.
Pull Request Overview
This PR refactors several dashboard settings components to support client optimizations. Key changes include updates to the Resize component to conditionally show scale options based on lazyload, a new lazyload behavior radio control in the Lazyload component, and reordered/updated toggles in the Compression component.
Reviewed Changes
Copilot reviewed 16 out of 32 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
assets/src/dashboard/parts/connected/settings/Resize.js | Introduces lazyload‐based conditional rendering and a new scale toggle |
assets/src/dashboard/parts/connected/settings/Lazyload.js | Adds a lazyload behavior radio control and removes the separate exclude-first control |
assets/src/dashboard/parts/connected/settings/Compression.js | Reorders toggle controls and replaces the GIF replacement toggle with retina and CDN toggles |
assets/src/dashboard/parts/connected/settings/CloudLibrary.js | Wraps the cloud library button in a conditional render based on isCloudLibraryEnabled |
Files not reviewed (16)
- assets/src/dashboard/style.scss: Language not supported
- composer.json: Language not supported
- inc/admin.php: Language not supported
- inc/app_replacer.php: Language not supported
- inc/dam.php: Language not supported
- inc/lazyload_replacer.php: Language not supported
- inc/manager.php: Language not supported
- inc/media_offload.php: Language not supported
- inc/rest.php: Language not supported
- inc/settings.php: Language not supported
- inc/tag_replacer.php: Language not supported
- inc/traits/normalizer.php: Language not supported
- inc/url_replacer.php: Language not supported
- inc/v2/BgOptimizer/Lazyload.php: Language not supported
- inc/v2/PageProfiler/Profile.php: Language not supported
- inc/v2/PageProfiler/Storage/Base.php: Language not supported
Comments suppressed due to low confidence (3)
assets/src/dashboard/parts/connected/settings/Resize.js:42
- [nitpick] The naming and logic for isScaleEnabled (using an inverted comparison) might be unclear at first glance; consider renaming the variable or adding a comment to clarify its intended behavior.
const isScaleEnabled = 'disabled' === settings.scale;
assets/src/dashboard/parts/connected/settings/Compression.js:137
- The toggle control now updates the 'retina_images' setting in Compression, replacing the original network optimization control; please verify that this change aligns with the intended functionality in the compression settings.
label={ optimoleDashboardApp.strings.options_strings.enable_retina_title }
assets/src/dashboard/parts/connected/settings/Compression.js:165
- Ensure that swapping the control for GIF replacement with a CDN toggle is intentional and that the backend processing correctly handles the updated 'cdn' setting.
label={ optimoleDashboardApp.strings.options_strings.toggle_cdn }
Co-authored-by: Copilot <[email protected]>
- Replaced `get_image_count` with `move_images` in the media offload process for better clarity. - Updated the rollback process to use `move_images` instead of `get_image_count`. - Introduced a new REST API endpoint for moving images, allowing for offloading and rollback actions. - Enhanced the admin interface by adding scripts and styles for the media management screen. - Improved action handling for image processing, ensuring better performance and user experience.
- Removed redundant image handling from the ConnectedLayout and OffloadMedia components. - Simplified the callSync function by eliminating unnecessary image parameters. - Enhanced clarity and maintainability of the codebase by reducing complexity in state management and effect hooks.
Co-authored-by: Copilot <[email protected]>
- Added a new toggle group control for selecting compression modes: Speed Optimized, Quality Optimized, and Custom. - Updated the Compression component to handle the new compression mode logic and state management. - Enhanced the admin settings to include compression mode options and their descriptions. - Updated styles for the toggle group control to improve UI consistency.
Co-authored-by: Copilot <[email protected]>
- Removed the updateCompressionMode function to streamline state management. - Moved the logic for setting compression mode directly into the existing update function. - Ensured that the canSave state is updated appropriately when changing compression modes.
Add Image editor to prevent errors with offloaded images
- Added 'autoquality' option to the compression settings. - Updated logic to handle 'autoquality' in various compression modes. - Ensured compatibility with existing settings for improved user experience.
Implement compression mode settings in the dashboard
Refactor media offload functionality and enhance REST API integration
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.
Looks great! 🚀
@@ -119,6 +122,7 @@ public static function get_background_lazyload_selectors() { | |||
'.elementor-section[data-settings*="background_background"]', | |||
'.elementor-section > .elementor-background-overlay', | |||
'[class*="wp-block-cover"][style*="background-image"]', | |||
'[style*="background-image:url("]', '[style*="background-image: url("]', |
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.
Should we maybe also consider only the background
css property? As it can also have an URL as value
🎉 This PR is included in version 4.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |