-
Notifications
You must be signed in to change notification settings - Fork 39
create a backup of the original image #98
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
Open
tijmenbruggeman
wants to merge
23
commits into
tinify:master
Choose a base branch
from
wcreateweb:feat/backup-original
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
4680f5c
release: 3.6.10
Sreini e154eb9
Merge branch 'master' of https://github.com/tinify/wordpress-plugin
tijmenbruggeman f53f00b
Merge branch 'tinify:master' into master
tijmenbruggeman ba97e04
Merge branch 'master' of https://github.com/tinify/wordpress-plugin
tijmenbruggeman 3933d3c
Merge branch 'master' of https://github.com/tinify/wordpress-plugin
tijmenbruggeman c91a855
Merge branch 'master' of https://github.com/tinify/wordpress-plugin
tijmenbruggeman 7ea5ea3
add checkbox for backup
tijmenbruggeman 2446827
seperate backup settings from preserve
tijmenbruggeman 24c7c0a
seperate settings
tijmenbruggeman 435823c
create backup of original image
tijmenbruggeman a522659
add docs for tests
tijmenbruggeman 6882d97
add docs for stubs
tijmenbruggeman 9c5b056
add test
tijmenbruggeman b765371
Add more tests
tijmenbruggeman 1d86da6
ensure trailing slash on dir
tijmenbruggeman 43991bf
format
tijmenbruggeman 3a863f7
fix test: also has backup registered
tijmenbruggeman fd2bdc8
wait for healthcheck to resolve in docker compose
tijmenbruggeman 295b1dc
Merge branch 'master' of https://github.com/tinify/wordpress-plugin
tijmenbruggeman 45e082e
Merge branch 'master' of github.com:wcreateweb/wordpress-plugin into …
tijmenbruggeman 2dc0ccd
use action to create filter
tijmenbruggeman 8e11b25
change hook params and only trigger once per image.
tijmenbruggeman c0826fd
change docblocks
tijmenbruggeman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # tiny_image_size_before_compression | ||
|
|
||
| Action that is done before compressing an single image size. | ||
|
|
||
| **Location:** `src/class-tiny-image.php` | ||
| **Since:** 3.7.0 | ||
|
|
||
| ## Arguments | ||
|
|
||
| 1. `int $attachment_id` - The attachment ID. | ||
|
|
||
| ## Example | ||
|
|
||
| ```php | ||
| add_filter( | ||
| 'tiny_image_before_compression', | ||
| function ( $id ) { | ||
| // notify system of compression | ||
| } | ||
| ); | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
str_replace replaces anywhere in a string, if i have /mnt/path/mnt/path/files it will be /files
Maybe use substr()?