feat: v0.2.1 — fix encryption, diverse multi-topic generation, UX fixes
- Rewrite encryption with "enc:" prefix to permanently eliminate the double-encryption bug on settings save - Add one-time migration to clear legacy non-prefixed encrypted values - Rewrite content analyzer prompts to request N distinct diverse topics across 5 categories (question, complaint, comparison, news, guide) - Pass target_count*2 from pipeline to analyzer for headroom - Add skip_dedup flag so manual Generate Now always produces content - Generate Now button now sends force=1 to clear stale locks - Rename OpenRouter provider files to PSR-4 convention (hyphenated) - Switch default models to google/gemini-2.5-flash-lite - Clean up reddit_debug log channel to standard 'reddit' - Bump version to 0.2.1 Cost: ~$0.003/article with Gemini 2.0 Flash, ~34s pipeline. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -17,6 +17,19 @@ declare(strict_types=1);
|
||||
*/
|
||||
class PRAutoBlogger_Idea_Scorer {
|
||||
|
||||
/** @var bool Whether to skip the has_similar_post() check. */
|
||||
private bool $skip_dedup = false;
|
||||
|
||||
/**
|
||||
* @param bool $skip True to skip deduplication.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function set_skip_dedup( bool $skip ): self {
|
||||
$this->skip_dedup = $skip;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Score, deduplicate, and rank article ideas.
|
||||
*
|
||||
@@ -35,8 +48,13 @@ class PRAutoBlogger_Idea_Scorer {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Skip if we've already published something very similar.
|
||||
if ( $this->has_similar_post( $result->get_topic() ) ) {
|
||||
// Skip if we've already published something very similar
|
||||
// (unless dedup is disabled for manual runs).
|
||||
if ( ! $this->skip_dedup && $this->has_similar_post( $result->get_topic() ) ) {
|
||||
PRAutoBlogger_Logger::instance()->info(
|
||||
sprintf( 'Skipping topic "%s" — similar post exists.', substr( $result->get_topic(), 0, 80 ) ),
|
||||
'scorer'
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -136,6 +154,8 @@ class PRAutoBlogger_Idea_Scorer {
|
||||
'question' => 'guide',
|
||||
'complaint' => 'solution',
|
||||
'comparison' => 'comparison',
|
||||
'news' => 'news',
|
||||
'guide' => 'guide',
|
||||
];
|
||||
return $map[ $analysis_type ] ?? 'article';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user