feat: v2.6.0 3-step AI pipeline, VPS worker, REST worker routes
- 3-step OpenRouter pipeline: Gatekeeper scoring/classification, PubMed+Google URL extraction, Markdown summary generation - REST worker routes /wp-json/peptide-news/v1/worker/* with X-Peptide-News-Token auth - Standalone Coolify worker (tools/vps-worker) with Dockerfile + docker-compose - CLI commands, content extractor, pubmed extractor, google url resolver - 89 PHPUnit tests passing
This commit is contained in:
@@ -117,6 +117,26 @@ class Peptide_News_Admin_Field_Renderers {
|
||||
);
|
||||
}
|
||||
|
||||
public static function render_ncbi_key_field(): void {
|
||||
$value = get_option( 'peptide_news_ncbi_api_key', '' );
|
||||
$display_value = ! empty( $value ) ? self::mask_api_key( $value ) : '';
|
||||
printf(
|
||||
'<input type="password" name="peptide_news_ncbi_api_key" value="%s" class="regular-text" placeholder="%s" />',
|
||||
esc_attr( $display_value ),
|
||||
esc_attr__( 'Enter NCBI API key (optional)', 'peptide-news' )
|
||||
);
|
||||
}
|
||||
|
||||
public static function render_vps_token_field(): void {
|
||||
$value = get_option( 'peptide_news_vps_token', '' );
|
||||
$display_value = ! empty( $value ) ? self::mask_api_key( $value ) : '';
|
||||
printf(
|
||||
'<input type="password" name="peptide_news_vps_token" value="%s" class="regular-text" placeholder="%s" />',
|
||||
esc_attr( $display_value ),
|
||||
esc_attr__( 'Enter secret VPS token (optional)', 'peptide-news' )
|
||||
);
|
||||
}
|
||||
|
||||
public static function render_article_retention_field(): void {
|
||||
$value = get_option( 'peptide_news_article_retention', 90 );
|
||||
printf(
|
||||
|
||||
@@ -61,6 +61,30 @@ class Peptide_News_Admin_Settings {
|
||||
$this->add_setting( 'newsapi_enabled', __( 'Enable NewsAPI', 'peptide-news' ), 'render_newsapi_enabled_field', 'peptide_news_newsapi' );
|
||||
$this->add_setting( 'newsapi_key', __( 'API Key', 'peptide-news' ), 'render_newsapi_key_field', 'peptide_news_newsapi' );
|
||||
|
||||
// --- NCBI E-utilities section ---
|
||||
add_settings_section(
|
||||
'peptide_news_ncbi_section',
|
||||
__( 'NCBI PubMed E-utilities', 'peptide-news' ),
|
||||
function () {
|
||||
echo '<p>' . esc_html__( 'Optional. An NCBI API key raises PubMed rate limits from 3 req/sec to 10 req/sec.', 'peptide-news' ) . '</p>';
|
||||
},
|
||||
'peptide-news-settings'
|
||||
);
|
||||
|
||||
$this->add_setting( 'ncbi_api_key', __( 'NCBI API Key', 'peptide-news' ), 'render_ncbi_key_field', 'peptide_news_ncbi_section' );
|
||||
|
||||
// --- VPS Worker section ---
|
||||
add_settings_section(
|
||||
'peptide_news_vps_section',
|
||||
__( 'VPS Worker Integration', 'peptide-news' ),
|
||||
function () {
|
||||
echo '<p>' . esc_html__( 'Optional. Set a secret token to allow an external VPS worker to sync articles via REST API without admin login.', 'peptide-news' ) . '</p>';
|
||||
},
|
||||
'peptide-news-settings'
|
||||
);
|
||||
|
||||
$this->add_setting( 'vps_token', __( 'VPS Worker Token', 'peptide-news' ), 'render_vps_token_field', 'peptide_news_vps_section' );
|
||||
|
||||
// --- Analytics section ---
|
||||
add_settings_section(
|
||||
'peptide_news_analytics_section',
|
||||
@@ -201,6 +225,12 @@ class Peptide_News_Admin_Settings {
|
||||
'newsapi_key' => function ( $value ) {
|
||||
return $this->sanitize_api_key( $value, 'peptide_news_newsapi_key' );
|
||||
},
|
||||
'ncbi_api_key' => function ( $value ) {
|
||||
return $this->sanitize_api_key( $value, 'peptide_news_ncbi_api_key' );
|
||||
},
|
||||
'vps_token' => function ( $value ) {
|
||||
return $this->sanitize_api_key( $value, 'peptide_news_vps_token' );
|
||||
},
|
||||
'article_retention' => 'absint',
|
||||
'analytics_retention' => 'absint',
|
||||
'anonymize_ip' => 'absint',
|
||||
|
||||
Reference in New Issue
Block a user