------ Change Log ------
On May 4, 2026  (WPMathPub v3.0.5 — continued; not a separate release)
	Rosetta [pmath] import: color name support and validation warnings
	  - Color names accepted: black, white, gray, grey, red, green, blue, yellow, orange,
	    purple, magenta, cyan, teal, navy. Standard CSS hex values; case-insensitive.
	  - 3-hex shorthand also accepted ("abc" -> "aabbcc")
	  - Misspelled color names (e.g. "purpel", "orang") trigger a "did you mean..." warning
	    using levenshtein distance against the 14 known names
	  - Unknown shortcode attributes (e.g. typo "siz=14" or "colour=red") trigger a
	    "did you mean..." warning against the 3 known attrs (size/color/latex)
	  - Out-of-range size (outside 8-24) warns; Math Test Area's existing size is preserved
	  - Non-numeric size warns (e.g. size="big")
	  - All warnings collected into one yellow banner above the result; multiple warnings
	    render as a bulleted list. Render still happens — feedback without blocking.
	uninstall.php: clean up new v3.0.5 options/user_meta on delete-data uninstall
	  - Was missing wpmathpub_last_seen_version, wpmathpub_version_changed_at,
	    wpmathpub_cache_notice_dismissed (per-user). Without these in the cleanup list,
	    a delete-data uninstall would leave stale notice state in the DB; a later
	    reinstall would inherit that state and behave inconsistently.
	Plugin Description text refresh
	  - "Bundled standalone Math-Pub Rosetta app lets anonymous visitors try and share equations"
	  - Live demo / full Rosetta app: math-pub.org (unchanged)
	  - Dropped the "(Tools › WPMathPub)" parenthetical — action-row "Open Rosetta" link
	    handles discovery
	Rosetta optional [pmath] shortcode import
	  - Pasted [pmath ...]...[/pmath] shortcodes are auto-stripped when user clicks See
	  - First shortcode's size/color/latex attributes flow into the form fields
	  - All shortcode wrappers stripped in one pass (multiple paste OK; surrounding text preserved)
	  - WordPress shortcode semantics: latex=1 -> LaTeX mode; absence of latex= -> PMath mode
	  - One-line tip "Optionally supports [pmath] tags" added to Step 2 of Getting Started panel
	Malformed [pmath] shortcode warning (rosetta.php and wpmathpub.php)
	  - Detect stray "[pmath" or "[/pmath" substrings after shortcode parsing — indicates a
	    user-typed broken or nested shortcode
	  - Rosetta shows a yellow warning banner above the rendering area and skips no work
	  - WordPress shortcode handler (wpmathpub.php) returns a red error message instead of
	    sending bracket tokens to the math engine where they render as huge delim glyphs
	  - Reported via screenshot 2026-05-04: "[pmath size=11]y=[/pmath" rendering as comically
	    oversized delim glyphs over the literal text "pmath size=11"
	Re-arm "Refresh image cache" notice on every plugin activation
	  - Activation hook now bumps version_changed_at and clears all users' per-version
	    dismissal flags, so the notice reappears after rollback->reinstall, downgrade->upgrade,
	    same-version reinstall, etc. Previous behavior only fired on version-string mismatch
	    detected by admin_init, missing the rollback/reinstall scenarios
	  - Fresh-install suppression (60s window between activated_at and version_changed_at)
	    still prevents the notice from showing on a brand new install where there's no
	    stale cache to clean
	Soften "Refresh image cache" notice tone
	  - Notice text reads "WPMathPub updated to X with rendering improvements. To see them
	    in equations you've already published, refresh the image cache. Equations rebuild
	    themselves automatically on first page view."
	  - Button label changed from "Clear image cache" to "Refresh image cache"
	  - Success toast says "Refreshed N cached image(s)" matching the verb
	Add Settings + Open Rosetta links to the Plugins page action row
	  - Adds a one-click "Settings" link to /wp-admin/plugins.php → Tools > WPMathPub
	  - Adds a one-click "Open Rosetta" link → bundled local rosetta.php demo (plugins_url-resolved
	    so it works in any WordPress install layout)
	  - Plugin Description text on the same page also now mentions "Tools › WPMathPub" so users
	    who read the description still discover where the local Rosetta lives
	  - Live demo at math-pub.org still linked from Description for pre-install users browsing
	    the WordPress.org Plugin Directory
	Fix LaTeX big-operator body capture when body starts with backslash command (translator v1.2.2)
	  - "\sum_{n=0}^{\infty} \frac{(n!)^2 2^{n+1}}{(2n+1)!}" (rosetta Example 6 Pi series)
	    rendered as literal "\sum_{n=0}" text plus a separate \frac fraction
	  - Body alternation accepted only brace groups or runs of plain chars; backslash-led
	    bodies (starting with \frac, \sqrt, etc.) failed to match → whole regex fell through
	  - Fix: extended body alternation to recognize \name{...} and \name{...}{...} backslash
	    commands with one level of nested braces inside their args. Applied uniformly to
	    sum/iiint/iint/int/oint
	Fix LaTeX big-operator body capture (translator v1.2.1)
	  - Greedy (.+)$ body in \iiint, \iint, \int, \oint patterns made any leading integral-style
	    big op swallow all subsequent operators into its body
	  - "\iiint_{a}^{b}x \prod_{a}^{b}x \oint_{a}^{b}f(t)dt" rendered as one giant triple-integral
	    wrapping the literal prod and oint commands inside its body
	  - All five integral-style big operators now use the same bounded body pattern \sum has
	    used since v1.0, matching token-by-token surface behavior across all big operators
	Add version-change "Clear image cache" admin notice
	  - Surfaces on Dashboard, Plugins page, and Tools > WPMathPub the first time an admin
	    loads any of those pages after a plugin version bump
	  - One "Clear image cache" button wipes BOTH the main cache (img/) AND the Rosetta
	    demo cache (demo/img/) in a single action
	  - Per-user, per-version dismissal: dismissing on v3.0.5 doesn't suppress the notice
	    on v3.0.6
	  - Auto-suppressed if cache was already cleared after the version change (e.g. via
	    Tools > WPMathPub) — no nag if user already did the right thing
	  - Auto-suppressed on fresh install (only shows on actual upgrades — there's no
	    stale cache to clean on a brand new install)
	  - Rationale: most users never visit Tools > WPMathPub. Engine/font fixes don't reach
	    end-readers because cached PNGs are content-hashed and the hash didn't change. This
	    notice exposes the one-click fix without requiring users to know about the settings
	    page. No cache-salt change involved (deliberate) — bumping salt would change <img>
	    URLs in published posts and risk RSS feed image 404s; clearing files leaves URLs
	    intact and lets the engine regenerate each PNG transparently on next page view.
	Fix descender clipping in math glyph rendering (engine v1.4.1)
	  - Pre-existing engine bug: canvas height in affiche_math/affiche_texte was 1 pixel short
	    of the bbox-reported descender extent, clipping the bottom row of g j p q y and
	    Greek lowercase β γ η μ ρ φ ψ χ ξ ζ
	  - Never noticed before because cmr10 trig/operator function names have no descenders;
	    became visible once \text{}/mathrm{} routed real text (with g, p, q, y) through the
	    same render path
	  - Fix: $dy = (bottom - top) + top_pad + 1 (was: + top_pad). Off-by-one corrected.
	  - Side benefit: Greek lowercase descender clipping that had been there for years is now fixed
	  - Verified with full a-z / A-Z render at sizes 12/14/18, all 17 math operators from the
	    syntax page, and all 10 Greek lowercase descender letters. No content regressions
	    (181-row syntax-table comparison still 168 match, 7 whitespace, 6 pre-existing diffs).
	Font hinting cleanup at small sizes
	  - Trig/operator/Greek-capital tokens (~40 entries in $fontesmath) swapped from cmr10 to lmroman10-regular
	  - Fixes blob-like rendering at sizes 12–15 where letters merged together (e.g. "tan x" had "t" looking bolder than "an")
	  - cmr10 was designed for 300+ dpi print, lmroman10-regular is the OpenType descendant with proper screen hinting
	  - Greek capital $symboles entries (Gamma Lambda Sigma Psi Delta Xi Upsilon Theta Pi Phi) re-mapped from
	    cmr10's AMS/CM-legacy 8-bit slots to standard Unicode codepoints (U+0393 .. U+03A8) so they render in
	    lmroman10-regular which has standard Unicode encoding only
	  - lmroman10-regular.ttf added to phpmathpublisher/fonts/ (Latin Modern Roman 10pt, GUST Font License,
	    .otf renamed to .ttf for drop-in compatibility with the existing $fontesmath ".ttf"-suffix lookup)
	Add \text{} / \mathrm{} / \mbox{} upright text rendering
	  - LaTeX translator now produces pmath mathrm{...} (was: aliased to mathit{...} which is italic — incorrect)
	  - PMath has a new mathrm{...} wrapper (text{...} alias) parallel to existing mathit{...}
	  - Implementation: pre-processor splits chars and prefixes letters with "rm" so they tokenize as
	    single T_STRING tokens (rmA-rmZ, rma-rmz). Each token routes via $symboles back to the bare letter
	    and via $fontesmath to lmroman10-regular for clean upright Latin Modern Roman rendering.
	  - Spaces become ~ (thin space); digits and punctuation pass through unchanged
	  - \mathit{} continues mapping to mathit{} (italic), unchanged
	  - Use case: "x_{\text{init}} + 5" renders subscript "init" upright instead of italic
	Fix LaTeX translator: \lim_{x\to a} expr was producing wrong pmath shape
	  - Old: lim{a}{x}  (2-arg, swapped order, body dropped)
	  - New: lim{x right a}{expr}  (3-token shape matching PMath dessine_limite() expectations)
	  - Both \to and \rightarrow recognized as the limit arrow
	  - Body capture extended to include \name{...} commands like \frac{...}{...} that are still unexpanded
	    at this point in the translator pipeline
	  - Bare \lim_{x\to a} (no body) falls through to lim{x right a}{} for syntactic completeness
	Update phpmathpublisher/mathpublisher.php to version 1.4
	  - cmr10 -> lmroman10-regular swap in $fontesmath
	  - Greek capital symbol map switched to Unicode codepoints
	  - Add mathrm{...}/text{...} pre-processor and rmA-rmZ/rma-rmz token system
	Update mathpub_latex.php to version 1.2
	  - \text/\mathrm/\mbox split off from \mathit (now produce pmath mathrm{} not mathit{})
	  - \lim translator rewritten for correct PMath shape and \frac body capture
	Validation
	  - Ran 181-row syntax-table regression (PMath direct vs LaTeX-translated): 168 exact match,
	    7 whitespace-only, 6 pre-existing differences (down from 7 — \lim is now fixed). Zero new diffs.
	  - Pixel-diff against v3.0.5 baseline: 140/181 native renders pixel-identical; 41 changed renders
	    are exactly the rows we intended to change (trig/operators/Greek caps). LaTeX-translated renders
	    show one additional change (the \lim row, the legitimate translator fix). No corrupted glyphs.
	Deferred to v3.0.6
	  - Italic font swap (\mathit{} via cmmi10 has same hinting issues; lmroman10-italic.otf available)
	  - Math italic letter rendering for single variables (x, y, z) — affects every formula
	  - Translator rewrite (replace preg_replace pipeline with structured tokenizer/parser)
	  - Rosetta demo button consistency, ordering, missing symbols (per user notes 2026-05-03)
	  - Leading-space preservation inside \text{ ... } (pre-existing whitespace-stripping behavior)
	Skipped this round (planned for v3.0.6)
	  - Rosetta page (demo/rosetta.php) ordering/tooltip/missing-symbol cleanups
	  - Syntax-page bullet/category renames (Brackets and Parentheses, Trigonometry, Math operators)

On May 2, 2026
	Create WPMathPub version 3.0.5
	Refactor: extract inline LaTeX-to-pmath translator from wpmathpub.php into standalone mathpub_latex.php module
	  - wpmathpub.php now loads the translator via require_once __DIR__ . '/mathpub_latex.php'
	  - Same wpmathpub_latex_to_pmath() function name preserved → zero behavior change for existing users
	  - mathpub_latex_to_pmath() alias added for non-WordPress callers
	  - mathpub_latex.php usable in WordPress, Drupal, Joomla, or standalone (multi-platform access guard)
	Fix LaTeX translator: matrix-with-delimiter wrappers were silently dropped
	  - \left[ \begin{matrix}...\end{matrix} \right]   was rendering matrix without [ ] wrapper
	  - \left| \begin{matrix}...\end{matrix} \right|   was rendering matrix without | | wrapper (determinant form)
	  - \left\{ \begin{matrix}...\end{matrix}          was rendering matrix without { wrapper (piecewise form)
	  - Root cause: marker cleanup was nuking L*_MATRIX markers before the matrix callback could detect them
	  - Fix: changed cleanup to negative-lookahead regex preserving markers followed by \begin{matrix}
	Fix LaTeX translator: half-open interval bracket forms were not converting
	  - \left[x\right[  was leaving literal "x\right[" in output (regression introduced in mathpub_latex.php v1.0)
	  - Added LBRACK_MATRIX...\right[ marker-form pattern restoring v3.0.4 behavior
	Fix LaTeX translator: thin space \, was producing regular space instead of pmath ~ token
	  - \, now correctly maps to ~ (pmath thin space)
	  - \; (medium space) and \: (thick space) also map to ~ (pmath has only one space-token width)
	  - \! (negative thin space) maps to empty string (no pmath equivalent)
	Fix LaTeX translator: missing function-keyword mappings
	  - Added explicit entries for: \sin \cos \ln \log \exp \det \ker \dim \max \min
	  - These were previously passing through as literal "\sin" etc.; engine rendered them correctly
	    but cache fingerprints differed between pmath and LaTeX columns
	Fix Math-Pub Rosetta button consistency (demo/rosetta.php)
	  - "matrix left brace" button in Delimiters category was using \left\{...\right. (invisible delim workaround)
	  - Matrix category "piecewise" button used the dangling \left\{ form (translator marker system)
	  - Both buttons now use the dangling form for consistency; both render identically
	Update phpmathpublisher/mathpublisher.php to version 1.3
	  - Fix pmb{} bold dilation at small font sizes (10–12) — skip dilation, prevent blocky/filled glyphs
	  - Add bbQ (rational numbers Q) to Unicode and FreeSerif font maps
	  - Fix {a}over{b} and {a}under{b} argument order — intuitive syntax now renders correctly
	Update mathpub_latex.php to version 1.1
	  - Promoted to standalone module loaded via require_once
	  - Multiple translator bug fixes (see above)
	Add Math-Pub Rosetta demo (demo/rosetta.php) — bundled standalone math expression tester
	  - Lives in plugin demo/ subfolder, shares mathpublisher.php and fonts/ with the plugin (no duplication)
	  - Same file works as portable single-folder demo on math-pub.org
	Validation
	  - Full button audit: 109/109 buttons in rosetta.php produce correct translator output
	  - Regression corpus: 166/172 LaTeX commands match expected output (6 remaining are
	    pre-existing v3.0.4 cosmetic differences with no visual impact, deferred to v3.0.6 rewrite)
On April 14, 2026
	Create WPMathPub version 3.0.4
	Add \hbar symbol (reduced Planck constant ℏ, Unicode U+210F)
	Fix LaTeX \frac rendering for multi-token numerators and denominators
	Fix image rendering failure at certain font sizes caused by decimal value in cached filename
	Fix Gutenberg output with <div> tag so each block starts on a new line
	Set Gutenberg default math syntax mode to LaTeX, optional pmath native syntax selection (here and in pmath-block.js)
	Fix vertical alignment for math images so they are aligned with inline text
	Security: added direct file access protection (ABSPATH check) to wpmathpub.php, mathpublisher.php, and fonts/index.php
	Security: replaced unlink() with wp_delete_file() in wpmathpub.php and uninstall.php
	Security: replaced rmdir() with WP_Filesystem in uninstall.php
	Security: escaped admin page output with wp_kses_post()
	Fix readme.txt Requires at least version 5.0 mismatch
On April 6, 2026
	Create WPMathPub version 3.0.3
	Add missing file hardening, include error messaging inline with pmath tags and error_log.
	Improve quality of PNG image rendering, fix glyph clipping in mathpublisher.php.
On March 19, 2026
	Create WPMathPub version 3.0.2
	Add color parameter
	Add LaTeX parameter with full syntax coverage within wpmathpublisher codebase limitation
	Improved Dashboard Tools WPMathPub Admin Panel
	Add Gutenberg WPMathPub math block
	Add blocks/math-block.js for Gutenberg block, Admin Tool, and donation/review request UI
	Rendering stability improvements
	Change. image cache directory to the uploads directory	
	Add WordPress database variables: starting with wpmathpub_ 
	Add one-time Dashboard request for donation or review with dismiss option
	Add uninstall.php to remove cache and database variables under admin panel control
	Update  phpmathpublisher/mathpublisher.php to version 1.0
	Change PNG image creation for transparency, no halo effects
	Add WpMathPub version to PNG cache salt
	Fix Greek Omega symbol rendering
	Remove old and broken docs directory for standalone phpmathpublisher use on PHP pages without WordPress plugin
On December 05, 2025
	Create WPMathPub version 2.1.4
	Handle case where an empty shortcode tag is used. Now an error message shows on the blog post indicating the shortcode cannot be empty
	Updater Wordpress developer function add_management_page $capability to use 'manage_options' instead of integer value of 8
	Update  phpmathpublisher/mathpublisher.php to version 0.6
	Fix count function error when trying to count an uncountable array, such as an empty shortcode tag
	Add screenshot 6 to demonstrate img image directory PNG files generated from pmath shortcode tags and MD5 caching technique
On November 22, 2022
	Create WPMathPub version 2.0.1
	Remove obsolete files for improved security
	Minor documentation fixes
On November 21, 2022 
	Create WPMathPub version 2.0.0
	Fix ">" bug using Gutenberg blocks editor, 
	Add "del" math operator in support of vector differential calculus
	Update obsolete references/links, improve documentation
	Test WPMathPub using PHP 7.4, High Responsive Theme, and WordPress 6.1.1
	Updated donate link
	New web page for additional support: https://www.biophysicslab.com/wordpress-math-publisher-plugin/
	Remove obsolete links for security reasons
On September 6, 2019 
	Fix plugin for PHP 7, tested using PHP 7.2 and High Responsive Theme
	Create WPMathPub version 1.3.0
	Fix warnings in wpmathpub.php to support future versions of PHP
	Create phpmathpublisher/mathpublisher.php version 0.4
	Fix fatal errors in phpmathpublisher/mathpublisher.php related to PHP 7 deprecation of ereg()
	Fix warnings in phpmathpublisher/mathpublisher.php related to class constructor usage for future PHP versions
	Note: The previous version of WPMathPub 1.2.0 would still not work on any PHP 7 Wordpress platform - my bad
On November 9, 2017 
    	Replace deprecated preg_replace()/e option with preg_replace_callback() in support of PHP 7
    	Create WPMathPub version 1.2.0
On January 12, 2011 
	Create a documentation fix. 
	Last upload to wordpress.org svn repository seems to have had some failure with publishing screenshots. This version only attempts to fix this one issue.
On September 6, 2008 
	Create WPMathPub version 1.0.7 plugin for WordPress
	Start with Ron's WPMathPub version 1.0.6:
	Add new feature: a status display that a blog admin can view after installation from Site Admin > Manage > WPMathPub
	Change priority from default to 5 within content filter [line 239 of wpmathpub.php]. This change allows the plugin to co-exist with streaming video plugins that use this same content.filter.
	Update the FAQ and add screenshot-5 to document these changes
On March 19, 2008 
	Create WPMathPub version 1.0.6 plugin for WordPress 
	Start with Ron's WPMathPub version 1.0.5:
	Fix a bug in relative address scheme that affected admin and rss feed display of math equations in comments
	Fix a bug in control of automatic write control of 'img' display
	Add new control variable, named ENGAGECOMMENTS, to allow easy control of comment display
	Update FAQ and Screenshots to support these bug fixes and new the feature
On March 19, 2008 
	Create WPMathPub version 1.0.5 plugin for WordPress 
	Start with Ron's WPMathPub version 1.0.4:
	Add support for auto-assignment of write access to ./phpmathpublisher/img directory
	Decode HTML entities used in ASCII math text so symbols like ">" and "<" work properly within pmath tags.
	Change the priority of add_filter commands from 5 to default
	Add support for using [pmath] tags within WordPress comments
	Test the new WPMathPub plugin on WordPress versions 2.5.1 and 2.3.3
On March 17, 2008 
	Create WPMathPub version 1.0.4 plugin for WordPress 
	Start with Matteo Bertini's sample code base:
	Plugin Name: PHP Math Publisher
	Plugin URI: http://www.slug.it/naufraghi/programmazione-web/wpmathpublisher
	Version: 1.0.3
	Author: Matteo Bertini
	Author URI: http://www.slug.it/naufraghi/
	Changes made to Matteo Bertini's Version: 1.0.3:
	a) Automate the original site-specific configuration 
	b) Add optional font size attribute to the [pmath] tag. New tag format: [pmath size=xx]...[/pmath], where xx represents a one or two digit font size
	c) Maintain backward compatiblility with Matteo's original tag scheme, [pmath]...[/pmath], define default value for size attribute of 12.
	d) Shorten plugin name and edit code comments
	e) Pull in the complete code tree from Pascal Brachet's current phpmathpublisher offering: http://www.xm1math.net/phpmathpublisher/

---- End Change Log ----
