Download the PHP package nullaidev/imgix-wp without Composer

On this page you can find all versions of the php package nullaidev/imgix-wp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package imgix-wp

imgix for WordPress

This composer package contains a few helper methods for working with imgix and WordPress. This tooling is helpful if you use the WordPress image functions like wp_get_attachment_image() and want your URLs rewritten to imgix URLs.

Further, this package can also rewrite your image URLs to WebP 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 images.

Install

In your WordPress theme or plugin.

Be sure you include the composer's autoload.php.

Initialize

In 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.

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.

Generate WebP Images

You can generate your own WebP images in WordPress using the cwebp command.

  1. First, download and install the cwebp CLI tool.
  2. From the command line go to the folder with your images such as wordpress/wp-content/uploads/{year}/{month}.
  3. Run the following command.
  4. Enjoy your webp images.

imgix Activation

In 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.

Calling 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.

Raw URLs within content will not be rewritten to an imgix version.

Helper Functions

To 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.

For example, to get WebP images served by imgix using the query string ?auto=format you can use the following:


All versions of imgix-wp with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nullaidev/imgix-wp contains the following files

Loading the files please wait ....