fix: add short descriptions to file docblocks + fix security/Yoda errors in metaboxes

- All 49 PHP includes files: expand minimal file docblocks to include a
  short description (satisfies Generic.Commenting.DocComment.MissingShort)
  Format: <?php\n/**\n * Filename-derived description.\n *\n * @package ...\n */
- settings.php delegation stubs: add compact docblocks to all 8 render_*
  methods (Squiz.Commenting.FunctionComment.Missing, lines 93-231)
- settings.php: compress mirrored @var constant docblocks to single-line;
  remove redundant intermediate class docblock → 273 lines (was 315)
- rest-controller.php: compress 1 mirrored @var docblock → 298 lines
- migration-0004: compress 4 property docblocks → 288 lines
- verification-widget.php line 111: cast days_since to int + phpcs:ignore
- verification-metabox.php line 80: phpcs:ignore on hardcoded badge_class
- peptide-metaboxes.php line 86: phpcs:ignore EscapeOutput (esc_attr'd above)
- peptide-metaboxes.php lines 147/148: Yoda null !== dose_min/dose_max
- peptide-metaboxes.php line 248: phpcs:ignore InputNotSanitized (isset only)
- peptide-metaboxes.php line 259: wrap pr_core_editorial_review_status in wp_unslash()
- peptide-metaboxes.php line 262: Yoda 'published' !== old_status

Agent-Session: claude-adopt-ci-20260616
This commit is contained in:
peptiderepo
2026-06-16 16:12:25 +00:00
parent 53c71dca12
commit b84cc656e5
49 changed files with 153 additions and 75 deletions

View File

@@ -1,16 +1,12 @@
<?php
/**
* Settings.
*
* @package Peptide_Repo_Core
*/
declare(strict_types=1);
/**
* Static admin settings class
*
* @package Peptide_Repo_Core
*/
/**
* Settings page for PR Core plugin configuration.
*
@@ -23,53 +19,25 @@ declare(strict_types=1);
*/
class PR_Core_Settings {
/**
* Option group shared by all PR Core settings.
*
* @var string Option group shared by all PR Core settings.
*/
/** @var string Option group shared by all PR Core settings. */
public const OPTION_GROUP = 'pr_core_settings';
/**
* Option key: enable/disable related articles.
*
* @var string Option key: enable/disable related articles.
*/
/** @var string Option key: enable/disable related articles. */
private const RELATED_ENABLED = 'pr_core_related_posts_enabled';
/**
* Option key: related articles limit (1-6).
*
* @var string Option key: related articles limit (1-6).
*/
/** @var string Option key: related articles limit (1-6). */
private const RELATED_LIMIT = 'pr_core_related_posts_limit';
/**
* Option key: WP-cron scan cadence.
*
* @var string Option key: WP-cron scan cadence.
*/
/** @var string Option key: WP-cron scan cadence. */
private const SCAN_CADENCE = 'pr_core_scan_cadence';
/**
* Option key: default staleness threshold in days.
*
* @var string Option key: default staleness threshold in days.
*/
/** @var string Option key: default staleness threshold in days. */
private const DEFAULT_THRESHOLD = 'pr_core_default_threshold';
/**
* Option key: high-velocity staleness threshold in days.
*
* @var string Option key: high-velocity staleness threshold in days.
*/
/** @var string Option key: high-velocity staleness threshold in days. */
private const HIGH_VELOCITY_THRESHOLD = 'pr_core_high_velocity_threshold';
/**
* Option key: comma-separated notification email list.
*
* @var string Option key: comma-separated notification email list.
*/
/** @var string Option key: comma-separated notification email list. */
private const VERIFICATION_EMAIL = 'pr_core_verification_email';
/**
@@ -90,6 +58,10 @@ class PR_Core_Settings {
);
}
/**
* Render the settings page HTML. Delegates to PR_Core_Settings_Renderer.
* @return void
*/
public static function render_page(): void {
PR_Core_Settings_Renderer::render_page();
}
@@ -140,10 +112,18 @@ class PR_Core_Settings {
add_settings_field( self::RELATED_LIMIT, __( 'Number of Articles', 'peptide-repo-core' ), array( __CLASS__, 'render_limit_field' ), self::OPTION_GROUP, 'pr_core_related_articles' );
}
/**
* Render the enable/disable checkbox field. Delegates to PR_Core_Settings_Renderer.
* @return void
*/
public static function render_enabled_field(): void {
PR_Core_Settings_Renderer::render_enabled_field();
}
/**
* Render the article count limit field. Delegates to PR_Core_Settings_Renderer.
* @return void
*/
public static function render_limit_field(): void {
PR_Core_Settings_Renderer::render_limit_field();
}
@@ -210,22 +190,42 @@ class PR_Core_Settings {
add_settings_field( self::VERIFICATION_EMAIL, __( 'Notification email(s)', 'peptide-repo-core' ), array( __CLASS__, 'render_email_field' ), self::OPTION_GROUP, 'pr_core_verification' );
}
/**
* Render the verification section header. Delegates to PR_Core_Settings_Renderer.
* @return void
*/
public static function render_verification_section(): void {
PR_Core_Settings_Renderer::render_verification_section();
}
/**
* Render the scan cadence select field. Delegates to PR_Core_Settings_Renderer.
* @return void
*/
public static function render_cadence_field(): void {
PR_Core_Settings_Renderer::render_cadence_field();
}
/**
* Render the score threshold input field. Delegates to PR_Core_Settings_Renderer.
* @return void
*/
public static function render_threshold_field(): void {
PR_Core_Settings_Renderer::render_threshold_field();
}
/**
* Render the high-velocity scan toggle field. Delegates to PR_Core_Settings_Renderer.
* @return void
*/
public static function render_high_velocity_field(): void {
PR_Core_Settings_Renderer::render_high_velocity_field();
}
/**
* Render the alert email input field. Delegates to PR_Core_Settings_Renderer.
* @return void
*/
public static function render_email_field(): void {
PR_Core_Settings_Renderer::render_email_field();
}