Download the PHP package firstinternet/wordpress-responsive-image without Composer

On this page you can find all versions of the php package firstinternet/wordpress-responsive-image. 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 wordpress-responsive-image

First Internet Responsive Image Class

Overview

The responsive image class was built by a team of developers at First Internet.

The ResponsiveImage class is a PHP utility designed to generate responsive images for WordPress. It supports multiple image sources, lazy loading, WebP format, and dynamic sizing based on Bootstrap-like breakpoints.

Features

Installation

Ensure that your WordPress theme or plugin includes this class and that you have the necessary WordPress functions available.

  1. Copy the ResponsiveImage.php file into your theme or plugin.
  2. Include it in your project:

Usage

Basic Example

This outputs a responsive <picture> element for the image with ID 123, using the medium size.

Customizing Output

Using get() Instead of generate()

If you need to store the image markup in a variable:

Methods

__construct(int $imageId, string $size = 'full')

setSources(array $sources)

Sets different image sources for various breakpoints.

lazyLoad(string $lazyClass = 'lazy')

Enables lazy loading by default with the 'lazy' class.

webp()

Enables WebP format support.

setClass(string $class)

Adds custom classes to the <img> element.

setAlt(string $alt)

Sets the image alt text.

setAttributes(array $attributes)

Adds custom attributes to the <img> element.

setSizes(string $sizes)

Sets the sizes attribute manually.

autoSizes(string $classes)

Automatically calculates image sizes based on Bootstrap grid classes.

generate()

Outputs the <picture> element directly.

get()

Returns the <picture> element as a string.

Example Output

License

This project is licensed under the MIT License - see the LICENSE file for details.


This class provides a flexible way to manage responsive images in WordPress, improving performance and user experience.

For more information, visit First Internet.


All versions of wordpress-responsive-image with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.2
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 firstinternet/wordpress-responsive-image contains the following files

Loading the files please wait ...