Roadmap items 11, 13, 22, 25. Grouped: each is a small, independent, low-risk correction. One PR.
Roadmap item 11 (P1, verified) — esc_html__( '', 'ucsc' )
Translating the empty string returns the PO file's metadata header (Project-Id-Version: …), not ''. Whatever this label is meant to be, it should either be a real string or not call a translation function at all.
📍 src/Blocks/Query_Loop.php:102
Roadmap item 13 (P1) — dead null-coalesce on posts_per_page
(int) get_field( 'posts_per_page' ) ?? self::PER_PAGE
A cast never yields null, so ?? is unreachable. When the field is missing — which is the case for News blocks inserted before the field was added — the expression is 0, which flows into array_slice( …, 0, 0 ) and renders an empty block.
Fix: resolve the field first, then fall back when it is empty/non-numeric, and cast after.
📍 src/Components/News_Block_Controller.php:42
Roadmap item 22 (P3) — hardcoded plugin path
Settings page hardcodes WP_PLUGIN_DIR . '/ucsc-custom-functionality/plugin.php', which breaks if the plugin directory is renamed (it is, on some installs and in some deploy flows).
Fix: derive from plugin_dir_path() / plugin_basename() or a constant defined in plugin.php.
📍 lib/functions/settings.php:42
Roadmap item 25 (P3) — echo _e( … )
_e() already echoes; the surrounding echo prints its void return. Harmless but phpcs-flagged.
📍 src/views/news-block/index.php:37
Acceptance
Roadmap items 11, 13, 22, 25. Grouped: each is a small, independent, low-risk correction. One PR.
Roadmap item 11 (P1, verified) —
esc_html__( '', 'ucsc' )Translating the empty string returns the PO file's metadata header (
Project-Id-Version: …), not''. Whatever this label is meant to be, it should either be a real string or not call a translation function at all.📍 src/Blocks/Query_Loop.php:102
Roadmap item 13 (P1) — dead null-coalesce on
posts_per_pageA cast never yields
null, so??is unreachable. When the field is missing — which is the case for News blocks inserted before the field was added — the expression is0, which flows intoarray_slice( …, 0, 0 )and renders an empty block.Fix: resolve the field first, then fall back when it is empty/non-numeric, and cast after.
📍 src/Components/News_Block_Controller.php:42
Roadmap item 22 (P3) — hardcoded plugin path
Settings page hardcodes
WP_PLUGIN_DIR . '/ucsc-custom-functionality/plugin.php', which breaks if the plugin directory is renamed (it is, on some installs and in some deploy flows).Fix: derive from
plugin_dir_path()/plugin_basename()or a constant defined inplugin.php.📍 lib/functions/settings.php:42
Roadmap item 25 (P3) —
echo _e( … )_e()already echoes; the surroundingechoprints itsvoidreturn. Harmless but phpcs-flagged.📍 src/views/news-block/index.php:37
Acceptance
posts_per_pagevalue renders the default count, not zero posts