Skip to content

Releases

ascii-slugs 0.1.0

Choose a tag to compare

@makriman makriman released this 14 Nov 07:19
1b98dda

Added

  • Library IndianOpinion\AsciiSlugs with no dependencies: Slugger,
    SlugOptions, SlugResult, Transliterator, ScriptTable,
    ArrayScriptTable, clocks and typed exceptions. Usable through Composer
    or one require of bootstrap.php.
  • Built-in tables for Devanagari, Bengali-Assamese, Gurmukhi, Gujarati,
    Odia, Tamil, Telugu, Kannada, Malayalam, Arabic script with Urdu rules
    (plus a 20-word Urdu exception list), Cyrillic, Greek and Latin with
    diacritics. Tables load on first use.
  • Optional ICU transliteration through intl for other scripts, with the
    modes auto, never and prefer.
  • Readability floor and a dated SHA-256 hash fallback.
  • Uniqueness helper for use outside WordPress.
  • WordPress plugin: sanitize_title main path, wp_unique_post_slug
    safety net, a pre_term_slug guard that keeps stored term slugs when the
    term edit screen sends them back decoded, filters and actions for every
    default, kill switch constant ASCII_SLUGS_DISABLED.
  • WP-CLI commands preview, status, audit and repair (dry run by
    default).
  • Site Health Info section with intl availability and the count of
    percent-encoded slugs, skipped above 100,000 published posts
    (ascii_slugs_site_health_scan_limit).

Performance: the first-call speed budget of 0.5 ms is not met. The README measures about 1.2 ms for the first slug in a request with OPcache on (0.45 ms of it loading the table), about 0.5 to 0.6 ms once the table is loaded, and about 4 ms with OPcache off (shared 2 vCPU VM, PHP 8.3, median of 50 requests, 200-code-point Devanagari title).

Install: composer require indianopinion/ascii-slugs