Skip to content

v1.376.0

Choose a tag to compare

@planet-4 planet-4 released this 15 Jul 09:54
· 51 commits to main since this release
e146306
PLANET-8174 Make images alt-text mandatory for publishing (#2989)

* PLANET-8174 Make images alt-text mandatory for publishing

Ref. https://greenpeace-planet4.atlassian.net/browse/PLANET-8174

* PLANET-8174 Fix PHPCS errors

Ref. https://greenpeace-planet4.atlassian.net/browse/PLANET-8174

* PLANET-8174 Add feature flag for 'Enforce images alt-text' in P4 settings

Make images alt-text mandatory for publishing will work, when a 'Enforce images alt-text' feature flag is enabled (under Planet 4 > Features). By default it's off.

* PLANET-8174 Refactor checkImageBlocksAltText() function to reduce Cognitive Complexity

The SonarCloud Code Analysis flags a checkImageBlocksAltText() function has Cognitive Complexity of 21 which should be lower than 15 hence refactor the function

* PLANET-8174 Refector blocks_have_image_without_alt() function to reduce Cognitive Complexity

The SonarCloud Code Analysis flags a blocks_have_image_without_alt() function has Cognitive Complexity of 27 which should be lower than 15 hence refactor the function

* PLANET-8174 Refector count_image_blocks_missing_alt() function to reduce Cognitive Complexity

The SonarCloud Code Analysis flags a count_image_blocks_missing_alt() function has Cognitive Complexity of 25 which should be lower than 15 hence refactor the function

* PLANET-8174 Fix PHPCS error

Ref. https://greenpeace-planet4.atlassian.net/browse/PLANET-8174

* Fix use DateTime methods instead of accessing internal properties directly

Replace direct access of internal DateTime properties (, ) with proper API methods (format() and getTimezone()->getName()) to fix PHP 8.x deprecation warnings in MigrationStatus.php

* PLANET-8174 Fix review feedback changes

Ref. https://greenpeace-planet4.atlassian.net/browse/PLANET-8174

* PLANET-8174 Add image core block alt text min 10 char validation

When uploading a new image or selecting an existing image from the Media Library, the Image block must contain alt text with a minimum of 10 characters.

* PLANET-8174 Remove logging missing img alt text PIDs

Ref. https://greenpeace-planet4.atlassian.net/browse/PLANET-8174

* PLANET-8174 Rename the function names

Update isImageBlockMissingAlt to isImageblockAltValid

Update is_image_block_missing_alt() to is_image_block_alt_valid()

* PLANET-8174 Update PHP side img alt validation text

Ref. https://greenpeace-planet4.atlassian.net/browse/PLANET-8174