=== Fortune ===
Contributors: robertjwallace
Tags: fortune, quotes, shortcode
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPL-2.0-or-later

A small tribute to the classic Unix fortune program: one random fortune on your WordPress page.

== Description ==

Inspired by Ken Arnold's classic fortune program, Fortune selects a random entry from the supplied JSON collection. The collection originally came from this site's /fortune/scripts/fortunes.json and is bundled in data/fortunes.json so the plugin works on another site without additional setup.

Fortune is a new WordPress implementation, not a port of the original program's source code. Pattern matching is a case-insensitive literal substring search, not a regular expression. Every matching entry has an equal chance of being selected. Original line breaks are preserved, and text is escaped for safe display.

== Installation ==

1. In WordPress, go to Plugins > Add New Plugin > Upload Plugin.
2. Upload fortune.zip, install it, and activate Fortune.
3. Add a Shortcode block containing [fortune] to a page or post.

== Usage ==

[fortune]
Choose any random fortune.

[fortune wisdom]
Choose a random fortune containing wisdom (case-insensitive).

[fortune "project manager"]
Choose a random fortune containing the phrase project manager.

[fortune project manager]
Unquoted positional words are also joined into a phrase.

[fortune pattern="project manager"]
Named attribute syntax is also supported.

If no fortune matches, the shortcode displays "No fortunes match that pattern."

To replace the collection, supply a UTF-8 JSON array of strings in data/fortunes.json. Back up custom changes before updating the plugin. The bundled fortunes are supplied as-is from the site's existing collection; the plugin does not filter their topics or language.

A new random choice is made whenever WordPress renders the shortcode; consecutive choices can repeat. The plugin signals page-cache plugins not to cache that response, but an upstream server or CDN cache may still need an exclusion for the page. No JavaScript, external API, accounts, or database tables are required.

== Changelog ==

= 1.0.0 =
Initial release: random fortunes, optional text matching, and the bundled JSON collection.
