WordPress plugin intelligence profile

Gallery From Regex Matches

Maintain a gallery by including all published images in your library which match a regex (in title or description).

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 5.2
Current version0.6.3
WordPress coverageTested up to WordPress 5.2
Minimum stackWP 4.9.1 · PHP 7.0
Directory statusactive
Last directory update30 May 20197y ago
Active installationsNewAdoption metric — not a quality score
WordPress.org rating5.0 / 5 from 1 ratings
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 Gallery From Regex Matches version 0.6.3 as active, updated 7y ago and tested up to WordPress 5.2.

Overview

About this plugin

A plugin which adds a shortcode: [gallery_from_regex_matches] in which a regex attribute should be specified. It will then look for matches in the descriptions and titles of all published images in your library, and create a gallery from the matches it finds.

  • Use for example like this [gallery_from_regex_matches regex="lillill" exclude_ids="764"], and it will generate a gallery of all your pictures of “Lillill”, except the one which has ID 764.
  • Sometimes it might be advicable to limit the amount of matches. that can be achieved by adding limit to the shortcode. [gallery_from_regex_matches regex="lillill" exclude_ids="764" limit="10"].
  • Sometimes you want to make a gallery of “cats” but not “catsup”, but you don’t want to add word boundary [[:>:]], in this case you can exclude_regex=catsup. Then it could look something along the line of [gallery_from_regex_matches regex="cats" exclude_regex="catsup"].
  • The same params (except for ids ) as for the [media] shortcode can be used (as this plugin calls that shortcodes callback function ( gallery_shortcode() ) to generate the gallery), so if you want to specify a particular type (style) of gallery from for example your cat pictures, this might do the trick: [gallery_from_regex_matches regex="(cat|kitten)" type="square"].
  • The regular expressions follows the MySQL Regexp syntax
  • Some characters will per default not work inside of the shortcode, see the “Caveats” section.
  • There are no bells and whistles for this plugin but it could potentionally be added in the futre.

Caveats

Since the regex used by the plugin is specified as an attribute value inside of a shortcode, and the Shortcode Api disallows the use of certain characters which could be a part of a valid, useful regex, there are some things to consider.

>

Attribute values must never contain the following characters:

* Square braces: [ ]

* Quotes: ” ‘

[ … ]

The recommended method of escaping special characters in shortcode attributes is HTML encoding. Most importantly, any user input appearing in a shortcode attribute must be escaped or stripped of special characters.

  • if in the regex you need to macth a character set [a-z], then (following the shortcode Api documentation guidline), they need to be encoded. There are two encodings which the plugin accepts: “html” and “base64”
  • Currently there is no way to encode these things with help of the plugin, although it is planned for a future release, so the regexes must be encoded manually for now’

For example, for regex w[0u][0u]ti can be expressed either:

With HTML encoding:

[gallery_from_regex_matches regex="w[0u][0u]ti" encoding="html"]

With Base64 encoding:

[gallery_from_regex_matches regex="d1swdV1bMHVddGk=" encoding="base64"]

To encode a string to base64, it can be done from the terminal like this:

% echo -n "catsup" | base64

Y2F0c3Vw

% echo -n Y2F0c3Vw | base64 --decode

catsup%

WordPress.org metadata

Plugin tags

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

  • gallery
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 4.9.1 · PHP 7.0
Update activity30 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.