style: auto-fix PHPCS violations via phpcbf

This commit is contained in:
peptiderepo
2026-06-16 13:54:00 +00:00
parent b580f9e2e1
commit a60ca84dc0
7 changed files with 11 additions and 11 deletions

View File

@@ -107,7 +107,7 @@ class Peptide_News_Content_Filter_Rules {
continue; continue;
} }
if ( false !== strpos( $body_text, $keyword ) ) { if ( false !== strpos( $body_text, $keyword ) ) {
$body_matches++; ++$body_matches;
$matched_keys[] = $keyword; $matched_keys[] = $keyword;
$score += 15; $score += 15;
} }

View File

@@ -79,7 +79,7 @@ class Peptide_News_Content_Filter {
); );
if ( 'promotional' === $result['verdict'] ) { if ( 'promotional' === $result['verdict'] ) {
$removed++; ++$removed;
self::log( sprintf( 'Blocked (rule: %s, score: %d): %s', $result['rule'], $result['score'], $article['title'] ) ); self::log( sprintf( 'Blocked (rule: %s, score: %d): %s', $result['rule'], $result['score'], $article['title'] ) );
continue; continue;
} }
@@ -87,10 +87,10 @@ class Peptide_News_Content_Filter {
// Borderline articles go to LLM for a second opinion. // Borderline articles go to LLM for a second opinion.
if ( 'borderline' === $result['verdict'] && self::is_llm_filter_enabled() ) { if ( 'borderline' === $result['verdict'] && self::is_llm_filter_enabled() ) {
$llm_verdict = self::classify_with_llm( $article ); $llm_verdict = self::classify_with_llm( $article );
$llm_checked++; ++$llm_checked;
if ( 'promotional' === $llm_verdict ) { if ( 'promotional' === $llm_verdict ) {
$removed++; ++$removed;
self::log( sprintf( 'Blocked (LLM confirmed borderline): %s', $article['title'] ) ); self::log( sprintf( 'Blocked (LLM confirmed borderline): %s', $article['title'] ) );
continue; continue;
} }

View File

@@ -87,7 +87,7 @@ class Peptide_News_Fetcher {
$stored = 0; $stored = 0;
foreach ( $articles as $article ) { foreach ( $articles as $article ) {
if ( $this->store_article( $article ) ) { if ( $this->store_article( $article ) ) {
$stored++; ++$stored;
} }
} }

View File

@@ -137,7 +137,7 @@ class Peptide_News_LLM_Client {
$retry_after = wp_remote_retrieve_header( $response, 'retry-after' ); $retry_after = wp_remote_retrieve_header( $response, 'retry-after' );
$wait = $retry_after ? min( (int) $retry_after, 30 ) : $backoff; $wait = $retry_after ? min( (int) $retry_after, 30 ) : $backoff;
sleep( $wait ); sleep( $wait );
$retries++; ++$retries;
$backoff *= 2; $backoff *= 2;
continue; continue;
} }

View File

@@ -183,7 +183,7 @@ class Peptide_News_LLM {
$result = self::process_article( $article ); $result = self::process_article( $article );
if ( ! empty( $result['success'] ) ) { if ( ! empty( $result['success'] ) ) {
$processed++; ++$processed;
} }
if ( ! empty( $result['errors'] ) ) { if ( ! empty( $result['errors'] ) ) {
$last_errors = $result['errors']; $last_errors = $result['errors'];

View File

@@ -126,7 +126,7 @@ class Peptide_News_Source_Resolver {
if ( ! empty( $new_source ) && $new_source !== $article->source ) { if ( ! empty( $new_source ) && $new_source !== $article->source ) {
$wpdb->update( $table, array( 'source' => $new_source ), array( 'id' => $article->id ), array( '%s' ), array( '%d' ) ); $wpdb->update( $table, array( 'source' => $new_source ), array( 'id' => $article->id ), array( '%s' ), array( '%d' ) );
$updated++; ++$updated;
} }
} }

View File

@@ -2,7 +2,7 @@
declare( strict_types=1 ); declare( strict_types=1 );
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit; exit;
} }
global $wpdb; global $wpdb;
$prefix = $wpdb->prefix; $prefix = $wpdb->prefix;
@@ -16,12 +16,12 @@ $wpdb->query( "DROP TABLE IF EXISTS {$prefix}peptide_news_articles" );
// Delete all plugin options. // Delete all plugin options.
$wpdb->query( $wpdb->query(
"DELETE FROM {$wpdb->options} WHERE option_name LIKE 'peptide\_news\_%'" "DELETE FROM {$wpdb->options} WHERE option_name LIKE 'peptide\_news\_%'"
); );
// Remove transient caches. // Remove transient caches.
$wpdb->query( $wpdb->query(
"DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient_peptide\_news\_%' OR option_name LIKE '_transient_timeout_peptide\_news\_%'" "DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient_peptide\_news\_%' OR option_name LIKE '_transient_timeout_peptide\_news\_%'"
); );
// Clear scheduled events. // Clear scheduled events.