WordPress plugin intelligence profile

WAJ Image

Simple classes & shortcodes for easy image HTML generation from common image directories.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 5.2
Current version3.0.0
WordPress coverageTested up to WordPress 5.2
Minimum stackWP 5.0.0 · PHP 7.0
Directory statusactive
Last directory update20 May 20197y ago
Active installations10Adoption metric — not a quality score
WordPress.org ratingNo WordPress.org ratings yet
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records WAJ Image version 3.0.0 as active, updated 7y ago and tested up to WordPress 5.2.

Overview

About this plugin

This plugin has 3 main classes, with a shortcode for each 1.

Shorcodes:

* [image src=”%url%”]

* [theme-image src=”%url%”]

* [upload-image src=”%url%”]

* [picture src=”%baseurl%” ext=”%ext%” sizes=”%sizes%”]

* [theme-picture src=”%baseurl%” ext=”%ext%” sizes=”%sizes%”]

* [upload-picture src=”%baseurl%” ext=”%ext%” sizes=”%sizes%”]

* [thumbnail]

Classes:

* WaughJ\HTMLImage\HTMLImage

* WaughJ\WPThemeImage\WPThemeImage

* WaughJ\WPUploadImage\WPUploadImage

* WaughJ\HTMLPicture\HTMLPicture

* WaughJ\WPThemePicture\WPThemePicture

* WaughJ\WPUploadPicture\WPUploadPicture

* WaughJ\WPPostThumbnail\WPPostThumbnail

The regular image shortcode loads the exact source URL given, without a cache-corruption-breaking version parameter. It is mainly for use by other classes, like the next 2.

%ext%, as well as extra sources based on the sizes given. org/en-US/docs/Web/HTML/Element/picture for mo’ info on how the picture element works.

The theme image & picture shortcodes load images from the current theme directory.

The upload image & picture shortcodes load images from the uploads directory.

The thumbnail shortcode loads a post’s thumbnail. If the post-id attribute is given, it loads the thumbnail o’ that ID. If no ID is given, it tries to supply the ID o’ whatever the current post is ( whatever get_the_ID() gives ).

Img, source, & picture attributes can be given through %tag-name%-%attribute-name%. For example, to set the image’s class, add img-class=”%class%”.

The HTML & Theme classes have near the same interface: a mandatory source & optional arguments. For the shortcodes, this means a “src” attribute as well as any other valid HTML attributes; for the classes, it means a hash map as an optional 2nd argument.

The WPUploadImage class takes a mandatory ID integer representing the ID o’ the image in the media section o’ the WordPress admin, the 2nd argument is an optional size string representing the slug o’ the size type as registered in WordPress, with “responsive” for automatically an image that uses srcset to dynamically load the size for different window sizes, & the optional 3rd argument is a hash map for extra attributes, as ‘bove.

The WPUploadPicture takes a mandatory ID integer & the optional attributes hash map.

In addition to any valid HTML attributes, the WPThemeImage & WPThemePicture classes also accept “directory” & they & the uploads classes accept the “show-version” attributes. The former, if set, will automatically put the source in the given directory; the “show-version” attribute, if set to false, won’t try to find the image’s last modified type to give it a version parameter for breaking cache corruption.

If “alt” attribute is not set, an empty 1 will automatically be added to the HTML generated, ensuring that all images made through these will have an alt tag.

To make working with theme image objects with minimal inconvenience for images that are all in the same directory that is not the topmost directory o’ the theme directory, you can globally set the inner shared directory in the WordPress admin through Appearances -> Theme -> Directories, or directly in PHP with WPThemeImage’s static setDefaultSharedDirectory method on the class itself.

After that, all initialized WPThemeImage & WPThemePicture instances, including the shortcodes, will automatically use that shared directory if a different 1 isn’t provided.

To add HTML attributes to WPThemePicture & WPUploadPicture shortcodes, prefix them with “img-“, “picture-“, or “source-” depending on what tag you want the attribute given to. For example, to apply a class to the img tag, give the shortcode the attribute “img-class”.

Examples

use WaughJ\WPUploadImage\WPUploadImage; echo new WPUploadImage ( 31, [ 'class' => 'center-img portrait', 'alt' => 'King' ] );

&

[upload-image media-id="31" class="center-img portrait" alt="King"]

m=1543875777" />

jpg' );

m=1543875777" alt="" />

[upload-picture media-id="8"]

m=1543875777" alt="" /></picture>

tab=repositories

WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • html generator
  • image
  • loader
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 5.2

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 5.2.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to5.2
Minimum requirementsWordPress 5.0.0 · PHP 7.0
Update activity20 May 20197y ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.