{"id":19366799,"url":"https://github.com/rsoury/wp-imgix","last_synced_at":"2025-04-23T14:31:41.142Z","repository":{"id":45047500,"uuid":"297580877","full_name":"rsoury/wp-imgix","owner":"rsoury","description":"Simple WordPress ImgIX Plugin - For use with S3-Uploads","archived":false,"fork":false,"pushed_at":"2024-08-23T14:55:58.000Z","size":2199,"stargazers_count":15,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T16:11:26.245Z","etag":null,"topics":["imgix","imgix-plugin","wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rsoury.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-22T08:13:26.000Z","updated_at":"2025-04-01T17:25:27.000Z","dependencies_parsed_at":"2023-02-18T23:55:15.520Z","dependency_job_id":null,"html_url":"https://github.com/rsoury/wp-imgix","commit_stats":{"total_commits":115,"total_committers":12,"mean_commits":9.583333333333334,"dds":0.6956521739130435,"last_synced_commit":"bb2c246b48c8fbb624098022dc4266e1ac967237"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsoury%2Fwp-imgix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsoury%2Fwp-imgix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsoury%2Fwp-imgix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsoury%2Fwp-imgix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rsoury","download_url":"https://codeload.github.com/rsoury/wp-imgix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250451794,"owners_count":21432900,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["imgix","imgix-plugin","wordpress","wordpress-plugin"],"created_at":"2024-11-10T07:46:34.741Z","updated_at":"2025-04-23T14:31:39.995Z","avatar_url":"https://github.com/rsoury.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[WP ImgIX](https://github.com/rsoury/wp-imgix) is a Wordpress Plugin to automatically load all your existing (and future) WordPress images via the imgix service for smaller, faster, and better looking images.\n\nThis plugin handles modifying WordPress image URLs to use the ImgIX service.\nIt works very well with [S3-Uploads](https://github.com/humanmade/S3-Uploads)\n\n## Installation\n\n1. [Download the zipped main branch of this plugin from github](https://github.com/rsoury/wp-imgix/archive/refs/heads/master.zip).\n2. Extract the plugin to your `plugins` folder.\n3. Enable the plugin.\n4. Add `define( 'WP_IMGIX_URL', 'your.imgix.net' )` to your `wp-config.php` file.\n5. If you're signing urls, Add `define( 'WP_IMGIX_SIGNING_TOKEN', 'abcdefg123456' )` to your `wp-config.php` file.\n\n## Usage\n\nTypically the above steps are all you need to do however you can use the following public facing functions and filters.\n\n### Functions\n\n#### `imgix_url( string $image_url, array $args = [] )`\n\nThis function returns the ImgIX URL for a given image.\n\n```php\n$image_url = 'https://my-bucket.s3.us-east-1.amazonaws.com/path/to/image.jpg';\n$args      = [\n\t'x'  =\u003e '300'\n\t'y' =\u003e '300',\n\t'fit' =\u003e 'crop'\n];\n\n$url = imgix_url( $image_url, $args );\n```\n\n### Filters\n\nThe following filters allow you to modify the output and behaviour of the plugin. The filters below can be added to your theme's `functions.php` to modify the behavior of your imgix URLs.\n\n#### `imgix_disable_in_admin`\n\nDefaults to `true`.\n\n```php\nadd_filter( 'imgix_disable_in_admin', '__return_false' );\n```\n\n#### `imgix_override_image_downsize`\n\nDefaults to `false`. Provides a way of preventing ImgIX from being applied to images retrieved from WordPress Core at the lowest level, you might use this if you wanted to use `imgix_url()` manually in specific cases.\n\n```php\nadd_filter( 'imgix_override_image_downsize', '__return_true' );\n```\n\n#### `imgix_skip_for_url`\n\nAllows skipping the ImgIX URL for a given image URL. Defaults to `false`.\n\n```php\nadd_filter( 'imgix_skip_for_url', function ( $skip, $image_url, $args ) {\n\tif ( strpos( $image_url, 'original' ) !== false ) {\n\t\treturn true;\n\t}\n\n\treturn $skip;\n}, 10, 3 );\n```\n\n#### `imgix_pre_image_url`\n\nFilters the ImgIX image URL excluding the query string arguments.\n\n```php\nadd_filter( 'imgix_pre_image_url', function ( $image_url, $args ) {\n\tif ( rand( 1, 2 ) === 2 ) {\n\t\t$image_url = str_replace( WP_IMGIX_URL, WP_IMGIX_URL_2, $image_url );\n\t}\n\n\treturn $image_url;\n}, 10, 2 );\n```\n\n#### `imgix_pre_args`\n\nFilters the query string parameters appended to the imgix image URL.\n\n```php\nadd_filter( 'imgix_pre_args', function ( $args ) {\n\tif ( isset( $args['fit'] ) ) {\n\t\t$args['fill'] = 'blur';\n\t}\n\n\treturn $args;\n} );\n```\n\n#### `imgix_remove_size_attributes`\n\nDefaults to `true`. `width` \u0026 `height` attributes on image tags are removed by default to prevent aspect ratio distortion that can happen in some unusual cases where `srcset` sizes have different aspect ratios.\n\n\n```php\nadd_filter( 'imgix_remove_size_attributes', '__return_true' );\n```\n\n## Credits\nCreated by Web Doodle\n\nForked from [HumanMade's Tachyon Plugin](https://github.com/humanmade/tachyon-plugin) -- Special thanks to the HumanMade team for working on accelerated Wordpress projects.\n\nWritten and maintained by [Ryan Soury](https://github.com/rsoury).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsoury%2Fwp-imgix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frsoury%2Fwp-imgix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsoury%2Fwp-imgix/lists"}