Skip to content

Post merge cleanup#213

Merged
joemcgill merged 49 commits into
devfrom
199-post-merge-cleanup
Nov 5, 2015
Merged

Post merge cleanup#213
joemcgill merged 49 commits into
devfrom
199-post-merge-cleanup

Conversation

@joemcgill

Copy link
Copy Markdown
Member

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.

Resolves #199

@tevko

tevko commented Oct 7, 2015

Copy link
Copy Markdown
Member

👍

@Shapeshifter3

Copy link
Copy Markdown

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?

@joemcgill

Copy link
Copy Markdown
Member Author

Hey shapeshifter! I'd probably suggest waiting until we get version 3.0 out
if you can.

On Fri, Oct 9, 2015 at 2:46 PM Shapeshifter 3 notifications@github.com
wrote:

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.0 OR do it AFTER the update.

Which would leave me with a cleaner install of plugin components?


Reply to this email directly or view it on GitHub
#213 (comment)
.

@Shapeshifter3

Copy link
Copy Markdown

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!

Comment thread wp-tevko-compat-shims.php Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be return wp_get_attachment_image_srcset( $id, $size );?

@jaspermdegroot

Copy link
Copy Markdown
Member

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.

@joemcgill

Copy link
Copy Markdown
Member Author

Thanks @jaspermdegroot. For the two srcset functions, I left the old logic chain intact in order to preserve any filters someone had applied to tevkori_srcset_array. Your function descriptions in #214 were an improvement so I merged and will apply the changes to this PR before we merge.

@joemcgill joemcgill force-pushed the 199-post-merge-cleanup branch 3 times, most recently from dc81243 to 8d7669d Compare October 17, 2015 17:20
joemcgill and others added 18 commits November 4, 2015 21:28
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.
jaspermdegroot and others added 19 commits November 4, 2015 22:11
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.
jaspermdegroot and others added 7 commits November 5, 2015 00:20
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 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.
@joemcgill joemcgill force-pushed the 199-post-merge-cleanup branch from 26b9bf5 to c38194a Compare November 5, 2015 02:37
@joemcgill joemcgill merged commit c38194a into dev Nov 5, 2015
@jaspermdegroot jaspermdegroot deleted the 199-post-merge-cleanup branch November 5, 2015 06:47
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.

4 participants