Skip to content
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

[WIP] Close #490: Restore compat with Perfect Images Retina Support #655

Closed
wants to merge 13 commits into from

Conversation

iCaspar
Copy link
Contributor

@iCaspar iCaspar commented Jan 26, 2022

Closes #490

  • Put back the compatibility code removed after #68c489b4.
  • Refactor and align with "new" imagify architecture.
  • Integrate with webp.

This is just grabbing the WPR2X code that was deleted. It's no longer wired into our stuff, so it won't do anything yet.
@iCaspar iCaspar marked this pull request as draft January 26, 2022 18:10
@iCaspar iCaspar self-assigned this Jan 26, 2022
- Rename the filenames and classnames to comply with PSR4
- Add PSR4 namespacing to classes
- Add revised namespace to composer for autoloading
Add the check for Perfect Images plugin install present, and load compatibility classes when it's there.

Clean more comments and rename static $_instance property -> $instance
There is no default context; it must be provided.
The intention is that we have 2 contexts to choose from.
(should be replaced with an enum when we get to use php8.1)
The can_backup() method is identical in both contexts, so we can move the logic to the parent method here, and only overload it in the Noop context where it returns differently.
Re-namespace and change filenames to bring the compatibility classes more in line with PS4 in preparation for adding unit tests. Adjust composer to point namespace to proper directory.

Create a method to filter media sizes, where we can add @2x sizes into into the files array of a media we are about to optimize. (Starts by just returning the given files array.)
We don't need these. Classes will not directly output anything, and they're killing the unit tests before they can run when we need to mock them.
@iCaspar
Copy link
Contributor Author

iCaspar commented Feb 7, 2022

Closing this. Replacement is #656.

@iCaspar iCaspar closed this Feb 7, 2022
@remyperona remyperona deleted the enhancement/490-restore-retina-2x-compat branch July 5, 2022 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add compatibility with "WP Retina 2x" plugin back
1 participant