Repository navigation
Write alt text, internal links and robots.txt fixes - #3
Open
Alt-Charlie wants to merge 8 commits into
Open
Alt-Charlie wants to merge 8 commits into
Alt-Charlie wants to merge 8 commits into
Conversation
Alt text goes to the media library and the page's own copy, wherever each still holds what the scan saw, and cover blocks keep their attribute in step. Links go into the first mention in the page's content or an ACF editor field, saved without kses so embeds and scripts survive, and come off again on a revert. robots.txt is created or given a sitemap line, through the robots_txt filter where WordPress prints it. Page builder pages are left alone.
… and more page builders
… a folder of its own get_home_path() reads the folder from the script being run, which during a REST request is the root index.php, so on a site with WordPress in its own folder it answered / and every robots.txt write failed. Where the site address and ABSPATH do not agree the change is skipped rather than guessed at.
update_field() answers false for a group or flexible content field whose sub fields were written, because the parent's own stored value is unchanged, so a link written there was reported as write_failed.
The scan reads the page as printed, so Terms & Conditions stored as Terms & Conditions, or an apostrophe typed straight and printed curly, came back as mention_not_found, and skipping withdrew the approval.
The library's alt text shows on every page that prints the image, and only the scanned page was purged, so the others kept the old wording until their cache expired.
# Conflicts: # README.md # tests/SettingsPageTest.php # uninstall.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Writes image alt text to the media library and to the page's own copy (cover blocks included), links the first mention of another page in a page's content or ACF editor fields, and fixes robots.txt as a file at the web root or through the
robots_txtfilter. From review: the web root is found from ABSPATH when WordPress sits in its own folder, a link in an ACF group or flexible content field is no longer reported as failed, a mention stored with entities or straight quotes is found, and alt text in the media library clears the whole page cache.https://linear.app/alt-design/issue/DEV-9477
Testing: 271 tests pass locally on PHP 8.4 and 8.1. The tests install free ACF, so ACF PRO's repeater and flexible content storage is not exercised.
Risk: once approved, these change post content, attachment alt text and robots.txt on a live site. Content edits leave a revision; an earlier robots.txt is not kept.
How to revert: revert the merge commit. Values already written stay until reverted from Altimiser. Based on #2.