fix: resolve PR_Core_Settings_Renderer undefined constant fatal (v0.7.1) (#24)

Squash-merge of PR #24 — QA APPROVED (2026-06-17 SHA ad2b1d9a)

Agent-Session: 2026-06-17-phase1-vps-runner-deploy-500fixes
This commit is contained in:
peptiderepo
2026-06-17 13:16:33 +07:00
committed by GitHub
parent 6a8c43496e
commit a7a2bb2f6d
5 changed files with 229 additions and 20 deletions

View File

@@ -35,8 +35,8 @@ class PR_Core_Settings_Renderer {
<h1><?php esc_html_e( 'PR Core Settings', 'peptide-repo-core' ); ?></h1>
<form method="post" action="options.php">
<?php
settings_fields( self::OPTION_GROUP );
do_settings_sections( self::OPTION_GROUP );
settings_fields( PR_Core_Settings::OPTION_GROUP );
do_settings_sections( PR_Core_Settings::OPTION_GROUP );
submit_button();
?>
</form>
@@ -50,10 +50,10 @@ class PR_Core_Settings_Renderer {
* @return void
*/
public static function render_enabled_field(): void {
$enabled = (bool) get_option( self::RELATED_ENABLED, true );
$enabled = (bool) get_option( PR_Core_Settings::RELATED_ENABLED, true );
printf(
'<input type="checkbox" name="%s" value="1"%s /> %s',
esc_attr( self::RELATED_ENABLED ),
esc_attr( PR_Core_Settings::RELATED_ENABLED ),
checked( $enabled, true, false ),
esc_html__( 'Show related monographs on single peptide pages', 'peptide-repo-core' )
);
@@ -67,8 +67,8 @@ class PR_Core_Settings_Renderer {
public static function render_limit_field(): void {
printf(
'<input type="number" name="%s" value="%d" min="1" max="6" />',
esc_attr( self::RELATED_LIMIT ),
absint( get_option( self::RELATED_LIMIT, 3 ) )
esc_attr( PR_Core_Settings::RELATED_LIMIT ),
absint( get_option( PR_Core_Settings::RELATED_LIMIT, 3 ) )
);
echo '<p class="description">' . esc_html__( 'Number of articles to display (1-6). Default: 3.', 'peptide-repo-core' ) . '</p>';
}
@@ -88,8 +88,8 @@ class PR_Core_Settings_Renderer {
* @return void
*/
public static function render_cadence_field(): void {
$current = get_option( self::SCAN_CADENCE, 'weekly' );
echo '<select name="' . esc_attr( self::SCAN_CADENCE ) . '">';
$current = get_option( PR_Core_Settings::SCAN_CADENCE, 'weekly' );
echo '<select name="' . esc_attr( PR_Core_Settings::SCAN_CADENCE ) . '">';
foreach ( array(
'daily' => 'Daily',
'weekly' => 'Weekly',
@@ -106,7 +106,7 @@ class PR_Core_Settings_Renderer {
* @return void
*/
public static function render_threshold_field(): void {
printf( '<input type="number" name="%s" value="%d" min="1" />', esc_attr( self::DEFAULT_THRESHOLD ), absint( get_option( self::DEFAULT_THRESHOLD, 180 ) ) );
printf( '<input type="number" name="%s" value="%d" min="1" />', esc_attr( PR_Core_Settings::DEFAULT_THRESHOLD ), absint( get_option( PR_Core_Settings::DEFAULT_THRESHOLD, 180 ) ) );
}
/**
@@ -115,7 +115,7 @@ class PR_Core_Settings_Renderer {
* @return void
*/
public static function render_high_velocity_field(): void {
printf( '<input type="number" name="%s" value="%d" min="1" />', esc_attr( self::HIGH_VELOCITY_THRESHOLD ), absint( get_option( self::HIGH_VELOCITY_THRESHOLD, 60 ) ) );
printf( '<input type="number" name="%s" value="%d" min="1" />', esc_attr( PR_Core_Settings::HIGH_VELOCITY_THRESHOLD ), absint( get_option( PR_Core_Settings::HIGH_VELOCITY_THRESHOLD, 60 ) ) );
}
/**
@@ -126,8 +126,8 @@ class PR_Core_Settings_Renderer {
public static function render_email_field(): void {
printf(
'<input type="text" name="%s" value="%s" class="regular-text" placeholder="admin@example.com" />',
esc_attr( self::VERIFICATION_EMAIL ),
esc_attr( (string) get_option( self::VERIFICATION_EMAIL, '' ) )
esc_attr( PR_Core_Settings::VERIFICATION_EMAIL ),
esc_attr( (string) get_option( PR_Core_Settings::VERIFICATION_EMAIL, '' ) )
);
echo '<p class="description">' . esc_html__( 'Comma-separated. Leave blank to disable email digests.', 'peptide-repo-core' ) . '</p>';
}