Problem/Motivation

It would be good to have the module install with some default / example rules and settings so that site builders do not have to start from scratch. This will also aid in writing tests as we will have some known rules to start with.

Blocked by #3495141: Add custom field for alt text validation rules to settings form

Default settings

  • Validation disabled
  • Cron disabled
  • cron delay 7 days
  • Rules
    • enabled: prevent can not contain filename - guidance message TBD
    • enabled: warn title cannot match alt - guidance message TBD
    • enabled: warn photo of - guidance message TBD

Remaining tasks

Determine the feedback messages for the rules

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

swirt created an issue. See original summary.

swirt’s picture

swirt’s picture

Issue summary: View changes
swirt’s picture

The exact set of starter rules has not been determined yet. This ticket is blocked until we have decided on the set of rules.

maggiewachs’s picture

In addition to the rules defined in default settings above, I'd check for the following (examples of bad alt text I've encountered in the wild):

  • file extension
  • hyphenated text that doesn't match file name ("red-car-at-stoplight")
  • keywords: "placeholder", "screenshot"
swirt’s picture

Thanks maggiewachs, that hyphenated one is interesting. I am not sure how to even support that one. We could probably use regex to look for words with too many hyphens but what is too many hyphens? Greater than one per word?

swirt credited rkoller.

swirt’s picture

I ended up creating 5 "starter rules" that can be edited by the site admins.

  1. Prevent: Can not match image filename.
  2. Warn: Cannot begin with "image of ".
  3. Warn: Cannot begin with "photo of ".
  4. Warn: Can not contain the pattern "copyright ####" and other variations.
  5. Off: Cannot match image title.

This is a healthy yet conservative starter set of example rules.

Crediting rkoller for the suggestion about the copyright in #3503625: Create a list of recommended rules #5

  • swirt committed 7baf0f8a on 1.0.x
    Resolve #3505126 "Create default settings"
    
swirt’s picture

Status: Active » Fixed
swirt’s picture

Status: Fixed » Closed (fixed)

The rules from this went out with 1.0.0-alpha8.