Skip to content

Restore and backup image sizes alongside the sources properties #242

New issue

Have a question about this project? Sign up for a free account to open an issue and contact its maintainers and the community.

By clicking “Sign up for ”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on ? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a6f5e07
Add class to mimic image operations on the editor.
mitoghMar 19, 2022
4820501
Restore and backup image sizes including `sources`.
mitoghMar 19, 2022
ab7bf05
Merge branch 'trunk' into feature/228-restore-and-backup-image-sources
mitoghMar 22, 2022
7e82041
Remove handling of edited images
mitoghMar 23, 2022
a2b82e3
Update the `success` logic to handle additional cases.
mitoghMar 23, 2022
ba0cbdf
Update logic to store and restore backup.
mitoghMar 23, 2022
2dd29d8
Remove empty space
mitoghMar 23, 2022
b16cee1
Update prefix on functions
mitoghMar 23, 2022
8a8e967
Update prefix on functions
mitoghMar 23, 2022
322dd3d
Update prefix on functions
mitoghMar 23, 2022
226a5aa
Update hooks reference
mitoghMar 23, 2022
8a809ed
Backup the data from previous metadata
mitoghMar 23, 2022
6d134e5
Merge branch 'trunk' into feature/228-restore-and-backup-image-sources
mitoghMar 24, 2022
76307e6
Merge branch 'trunk' into feature/228-restore-and-backup-image-sources
mitoghMar 24, 2022
951c4ca
Remove the need of auxilary variable to hold the sources
mitoghMar 26, 2022
61e25e8
Add `since` doc block
mitoghMar 28, 2022
4c26f4f
Align parameters on the doc block
mitoghMar 28, 2022
973a7b8
Removal of non required parameter
mitoghMar 28, 2022
cb35f42
Align parameters to follow WordPress guidelines
mitoghMar 28, 2022
7880f6b
Include the `@since` tags on missing functions
mitoghMar 28, 2022
ca8d28e
Move logic of the hook into a variable
mitoghMar 28, 2022
c381398
Add white spaces on tests
mitoghMar 30, 2022
93e0d01
Add white spaces on tests
mitoghMar 30, 2022
c165a11
Removal of `sanitize_text_field` due this value is not required.
mitoghMar 30, 2022
7d96583
Run logic only if was executed when doing ajax.
mitoghMar 30, 2022
7a113d3
Update code flow for more performant checks
mitoghMar 30, 2022
e202548
Split conditionals into separate statements
mitoghMar 30, 2022
188c7df
Removal of non requried conditional
mitoghMar 30, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
Next Next commit
Add white spaces on tests
Co-authored-by: Eugene Manuilov <[email protected]>
  • Loading branch information
mitogh and eugene-manuilov authoredMar 30, 2022
commit c381398f6a27839d2bc79c885565268fb2d1f309
4 changes: 3 additions & 1 deletion tests/modules/images/webp-uploads/webp-uploads-test.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -861,9 +861,11 @@ public function it_should_backup_the_sources_structure_alongside_the_full_size()
public function it_should_restore_the_sources_array_from_the_backup_when_an_image_is_edited() {
$attachment_id = $this->factory->attachment->create_upload_object( TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/leafs.jpg' );
$metadata = wp_get_attachment_metadata( $attachment_id );
$editor = new WP_Image_Edit( $attachment_id );

$editor = new WP_Image_Edit( $attachment_id );
$editor->rotate_right()->save();
$this->assertTrue( $editor->success() );

$backup_sources = get_post_meta( $attachment_id, '_wp_attachment_backup_sources', true );
$this->assertArrayHasKey( 'full-orig', $backup_sources );
$this->assertIsArray( $backup_sources['full-orig'] );
Expand Down