Select converted images via .htaccess#94
Open
tijmenbruggeman wants to merge 39 commits intotinify:masterfrom
Open
Select converted images via .htaccess#94tijmenbruggeman wants to merge 39 commits intotinify:masterfrom
tijmenbruggeman wants to merge 39 commits intotinify:masterfrom
Conversation
- use global vars to detect for apache - check if mod rewrite is available - return object with server information
…task/conversion-server-side
- not recommended to render html in a class - keep view rendering logic away from business logic
…task/conversion-server-side
Remove redundant rewrite rules that append file extensions (image.jpg.avif). Keep only the extension replacement rules (image.avif). - Rename install() to install_rules() and uninstall() to uninstall_rules() - Remove duplicate AVIF and WebP rules that check for appended extensions - Update MARKER constant to match plugin name - Remove redundant comments and empty lines
Add delivery parameter to setConversionSettings helper to configure picture tag or htaccess delivery methods in integration tests.
Add data-testid attribute to radio input elements to improve test selector reliability in integration tests.
- Refactor Tiny_Apache_Rewrite to support dynamic rule toggling - Add init() method and toggle_rules() hook for option changes - Update get_webp_rules() to remove Chrome-specific check - Make get_rewrite_rules() and install_rules() private - Initialize Apache rewrite in plugin constructor - Add conditional Tiny_Picture initialization for 'picture' delivery - Add integration tests for htaccess delivery method Co-Authored-By: Warp <agent@warp.dev>
…task/conversion-server-side
…task/conversion-server-side
The logger fix has been moved to the separate diagnostic-logging branch
rkoopmans
reviewed
Feb 20, 2026
|
|
||
| /** | ||
| * Detect the web server software using WordPress globals. | ||
| * WordPress sets $is_apache, $is_IIS, $is_iis7, and $is_nginx in wp-includes/vars.php |
Contributor
There was a problem hiding this comment.
You miss is_caddy. it is a very small market share, so no big deal but maybe add it for completeness
rkoopmans
reviewed
Feb 20, 2026
| public static function get_capabilities() { | ||
| return array( | ||
| 'server' => self::get_server_type(), | ||
| 'is_apache' => self::is_apache(), |
Contributor
There was a problem hiding this comment.
we have is_apache seperately here. Can just as well call $is_apache in the code block where you use it
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR will extend our conversion feature with the delivery of converted images through htaccess.
When selecting and saving the delivery "htaccess", it will write the following block into the htaccess on the home path and the uploads directory.
Settings

There is a new setting to allow the optimized image delivery via .htaccess. This setting is only visible when the user is on apache and has mod_rewrite.
Follow-up
htaccess, it will not install the rules. Because it requires quite a bit of refactoring to reset the settings as well, this will be done in a seperate PR.