You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #2753, @nlemoine mentioned quite a few points we can improve in the file and attachment classes in a future version of Timber. I’m adding these as a separate issue so we don’t lose track of it.
Things to consider:
Remove path() methods in all models. Same reason as n°1 mentioned above: I don't think models need this method. If you want a relative path for something (src, link, etc.): use the relative filter or use a WP filter/plugin. Plus I don't think we need a helper to get the relative URL, there's already one in WP.
I think we should remove the maybe_secure_url helper. If the URL is http, then it's a somewhere else problem that will be hidden (and not fixed and brought to the developer attention) by this fix that's not Timber in Timber's scope IMHO.
Same goes for remove_double_slashes: we shouldn't aim at fixing every issues whose causes are elsewhere in the stack.
and
image dimensions are still read from file, which could be avoided by getting image metadata for registered sizes and improve performance. But would require quite some refactoring (ImageDimensions doesn't takes some $metadata to look for dimensions)
I noticed that ImageHelper::sideload_image() is very optimistic 😅 There are some places in that method that can go wrong and are not handled:
In #2753, @nlemoine mentioned quite a few points we can improve in the file and attachment classes in a future version of Timber. I’m adding these as a separate issue so we don’t lose track of it.
and
The text was updated successfully, but these errors were encountered: