{"id":15292270,"url":"https://github.com/nullaidev/imgix-wp","last_synced_at":"2026-03-05T22:08:41.200Z","repository":{"id":57029257,"uuid":"439064517","full_name":"nullaidev/imgix-wp","owner":"nullaidev","description":"Lite imgix integration and helpers for WordPress","archived":false,"fork":false,"pushed_at":"2025-06-02T15:41:03.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-10T03:35:29.735Z","etag":null,"topics":["imgix","php","wordpress","wordpress-development"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nullaidev.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2021-12-16T16:55:30.000Z","updated_at":"2025-06-02T15:41:06.000Z","dependencies_parsed_at":"2025-08-10T03:33:54.250Z","dependency_job_id":"b815ffc5-1829-4890-abee-242768336d5e","html_url":"https://github.com/nullaidev/imgix-wp","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/nullaidev/imgix-wp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullaidev%2Fimgix-wp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullaidev%2Fimgix-wp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullaidev%2Fimgix-wp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullaidev%2Fimgix-wp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nullaidev","download_url":"https://codeload.github.com/nullaidev/imgix-wp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullaidev%2Fimgix-wp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30152090,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T21:15:50.531Z","status":"ssl_error","status_checked_at":"2026-03-05T21:15:11.173Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","php","wordpress","wordpress-development"],"created_at":"2024-09-30T16:17:10.851Z","updated_at":"2026-03-05T22:08:41.176Z","avatar_url":"https://github.com/nullaidev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## imgix for WordPress\n\nThis composer package contains a few helper methods for working with [imgix](https://imgix.com/) and [WordPress](https://wordpress.org/). This tooling is helpful if you use the WordPress image functions like `wp_get_attachment_image()` and want your URLs rewritten to imgix URLs.\n\nFurther, this package can also rewrite your image URLs to [WebP](https://developers.google.com/speed/webp/docs/using) versions if you are not using imgix. Note, this package does not generate WebP images it only rewrites them to WebP if you are not using imgix. If you are using imgix, use [imgix to serve WebP](https://docs.imgix.com/tutorials/improved-compression-auto-content-negotiation) images.\n\n### Install\n\nIn your WordPress theme or plugin.\n\n```bash\ncomposer require nullaidev/imgix-wp\n```\n\nBe sure you include the composer's `autoload.php`.\n\n```php\n// Composer\nif(file_exists(__DIR__ . '/vendor/autoload.php')) {\n    require __DIR__ . '/vendor/autoload.php';\n}\n```\n\n### Initialize\n\nIn your themes `functions.php` file call `\\ImgixWp\\Core::init()`. When no options are used all image URLs created with `wp_get_attachment_image_src()`, `wp_get_attachment_image()`, and `wp_calculate_image_srcset()` will be rewritten as WebP versions.\n\n```php\n// functions.php\n\\ImgixWp\\Core::init();\n```\n\n*IMPORTANT*: If you don't have WebP versions of your images on your server calling `\\ImgixWp\\Core::init()` will break your website images leading to 404 errors. \n\n### Generate WebP Images\n\nYou can generate your own WebP images in WordPress using the `cwebp` command. \n\n1. First, [download and install the cwebp CLI tool](https://developers.google.com/speed/webp/docs/precompiled).\n2. From the command line go to the folder with your images such as `wordpress/wp-content/uploads/{year}/{month}`.\n3. Run the following command.\n4. Enjoy your webp images.\n\n```bash\n# Example from path, wordpress/wp-content/uploads/2021/01\nfor file in *; do cwebp -q 50 \"$file\" -o \"${file%.*}.webp\"; done\n```\n\n### imgix Activation\n\nIn your themes `functions.php` file call `\\ImgixWp\\Core::init()` and provide your imgix source URL host name (exclude `https`). The imgix source must point to your `wp-content/uploads` folder.\n\n```php\n// functions.php\n\\ImgixWp\\Core::init([\n    'imgix_host' =\u003e 'your-source-name-here.imgix.net'\n]);\n```\n\nCalling the `\\ImgixWp\\Core::init()` method will automatically rewrite all of your image URLs to the imgix URL generated by `wp_get_attachment_image_src()`, `wp_get_attachment_image()`, and `wp_calculate_image_srcset()` when they are using on the front-end of your WordPress website.\n\nRaw URLs within content will not be rewritten to an imgix version.\n\n### Helper Functions\n\nTo apply the special query parameters to an image when using `wp_get_attachment_image()` you can use `\\ImgixWp\\Image::getImage()` instead. The `\\ImgixWp\\Image::getImage()` has the same signature as `wp_get_attachment_image()` but include another parameter for the query.\n\nFor example, to get WebP images served by imgix using the query string `?auto=format` you can use the following:\n\n```php\n// page.php\n$attachment_id = 1;\n\n// WordPress version - ?auto=format is NOT applied\necho wp_get_attachment_image($attachment_id, 'full', false, []);\n\n// imgix version - ?auto=format is applied\necho \\ImgixWp\\Image::getImage($attachment_id, 'full', false, [], [\n    'auto' =\u003e 'format'\n]);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullaidev%2Fimgix-wp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnullaidev%2Fimgix-wp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullaidev%2Fimgix-wp/lists"}