Post merge cleanup#213
Conversation
|
👍 |
|
Joe, I have a question: I'm currently using WordPress 4.31 + the 2.5.2 version on this Plugin. I'm contemplating converting to the nightly build of WordPress, to use the embedded version. Would it be better for me to do that NOW before the plugin update goes to version 3.0, or AFTER the update. Which would leave me with a cleaner install of plugin components, AND would the plugin just "disappear" when I move to the WP nightly build, OR would I still have to uninstall it? |
|
Hey shapeshifter! I'd probably suggest waiting until we get version 3.0 out On Fri, Oct 9, 2015 at 2:46 PM Shapeshifter 3 notifications@github.com
|
|
Oh well, I got antsy and just uninstalled the plugin, used another plugin to optimize my database, deleted my cache, and then updated to the nightly build. I'll let you know if I run into any problems (sometimes I don't have any self-control and just jump the gun). Anyhow, thanks for your quick response! |
There was a problem hiding this comment.
Shouldn't this be return wp_get_attachment_image_srcset( $id, $size );?
|
While reviewing this I noticed that I found our function descriptions a bit confusing sometimes so I created PR #214. If we decide to merge it we should also update the descriptions in this PR. |
|
Thanks @jaspermdegroot. For the two srcset functions, I left the old logic chain intact in order to preserve any filters someone had applied to |
dc81243 to
8d7669d
Compare
Move all of the core functions into a new file named `wp-tevko-core-functions.php` that is only loaded if `wp_get_attachment_image_srcset()` does not exist. Otherwise, we load a set of compatability shims, `wp-tevko-compat-shims`, for people using our core functions in their themes.
* Deprecates core functions that have been merged into WordPress core in 4.4. * Adds compatibility shims for sites using the plugin's internal functions and hooks.
* Add a notice to the WP.org page about the change to a display filter. * Change minimum required version to 4.0 to match our tests. * Minor typos, whitespace fixes.
The old version of the install-wp-tests.sh script would only install the latest stable version. This update uses the latest template from WP-CLI, which includes support for testing against trunk.
This changes the name of our helper function, `_make_attachment()` to `create_upload_object` to avoid a name collision with a public method introduced to the `WP_UnitTestCase` class during the 4.4 cycle. I also mimicked the test performance improvements in core that uses a single upload for all the tests, where applicable so that we don't have the overhead of uploading an image during each test. Finally, this changes the main class name for our tests to `RICG_Responsive_Images_Tests`.
The 'medium_large' size was added to core during the 4.4 cycle, which caused our expected `srcset` attributes to be off. This adds a whitelist for testing the default soft crops if they exist, which will make use of the 'meduim_large' size when applicable and still work when testing against versions of WP before the image size was added.
If someone is calling `tevkori_filter_attachment_image_attributes` they should not get an undefined function error once they upgrade to WP 4.4. Instead of wrapping that function in a `function_exists` check, we do the check inside the function and return a deprecated notice and an unfiltered $attr array.
This adds expected deprecated notices for `tevkori_filter_attachment_image_attributes`
If no size name is found, we fall back to the full size image, which results in a srcset array containing all soft-resized images.
In core, we rely on `get_media_embedded_in_content()` to match images embedded in post content. However, in previous versions of WP, this function didn't support searching for images. This change provides consistency for any install making use of our included functions.
The file is only included if wp_get_attachment_image_srcset() does not exists. That is sufficient.
f2ab328 to
1f12f40
Compare
We keep using this function for WP 4.3 and older and there is no alternative. Deprecating the function would show a warning when the filter is added.
This reverts commit 0163649.
This comes after reverting 0163649 since we have to transform data-sizes attributes no matter which version of WP is installed. Since this filter uses a simple `str_replace()` instead of a preg_match, it's probably cleaner to add a separate filter than trying to piggyback on our `wp_make_content_images_responsive()` filter, and the performance should be similar either way.
26b9bf5 to
c38194a
Compare
Move all of the core functions into a new file named
wp-tevko-core-functions.phpthat is only loaded if
wp_get_attachment_image_srcset()does not exist. Otherwise,we load a set of compatability shims,
wp-tevko-compat-shims, for people using ourcore functions in their themes.
Resolves #199