Skip to content

P3: Plugin header metadata — declare PHP/WP requirements and load the text domain #110

Description

@Herm71

Roadmap items 20, 21 (P3). Grouped: both are plugin.php header/bootstrap metadata.

Roadmap item 20 — Declared PHP floor is wrong

The code uses union types (array|string), so the true minimum is PHP 8.0. Meanwhile:

  • CONTRIBUTING says 7.4+
  • phpcs is configured with minimum_supported_wp_version 4.9
  • plugin.php declares no Requires PHP: or Requires at least: headers at all

A 7.4 install will fatal on parse rather than being cleanly blocked by WordPress.

Fix: add Requires PHP: 8.0 and a realistic Requires at least: to the plugin header, bump the phpcs minimum_supported_wp_version to match, and correct CONTRIBUTING.

📍 src/Components/News_Block_Controller.php:27, plugin.php

Roadmap item 21 — Text domain ucsc is never loaded

There is no Text Domain: / Domain Path: header and no load_plugin_textdomain() call, so every __() / _e() / esc_html__() in the plugin is untranslatable — the calls are inert pass-throughs.

Fix: add the headers and load the text domain on init (or rely on WP 6.7+ just-in-time loading, which still requires the header). Ship a languages/ directory with a POT file if translations are actually wanted.

📍 plugin.php

Acceptance

  • Requires PHP, Requires at least, Text Domain, Domain Path present in the plugin header
  • Text domain loads; a test translation resolves
  • phpcs minimum_supported_wp_version and CONTRIBUTING agree with the header

Related: existing issue #27 also proposes adding an Update URI: header — worth landing in the same header pass.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Tooling, packaging, docsdocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions