From a60ca84dc0abcf329a39ce5974b9fe56dae4f4fe Mon Sep 17 00:00:00 2001 From: peptiderepo Date: Tue, 16 Jun 2026 13:54:00 +0000 Subject: [PATCH] style: auto-fix PHPCS violations via phpcbf --- includes/class-peptide-news-content-filter-rules.php | 2 +- includes/class-peptide-news-content-filter.php | 6 +++--- includes/class-peptide-news-fetcher.php | 2 +- includes/class-peptide-news-llm-client.php | 2 +- includes/class-peptide-news-llm.php | 2 +- includes/class-peptide-news-source-resolver.php | 2 +- uninstall.php | 6 +++--- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/includes/class-peptide-news-content-filter-rules.php b/includes/class-peptide-news-content-filter-rules.php index 13e091c..d053205 100644 --- a/includes/class-peptide-news-content-filter-rules.php +++ b/includes/class-peptide-news-content-filter-rules.php @@ -107,7 +107,7 @@ class Peptide_News_Content_Filter_Rules { continue; } if ( false !== strpos( $body_text, $keyword ) ) { - $body_matches++; + ++$body_matches; $matched_keys[] = $keyword; $score += 15; } diff --git a/includes/class-peptide-news-content-filter.php b/includes/class-peptide-news-content-filter.php index 98f3828..5fd298f 100755 --- a/includes/class-peptide-news-content-filter.php +++ b/includes/class-peptide-news-content-filter.php @@ -79,7 +79,7 @@ class Peptide_News_Content_Filter { ); if ( 'promotional' === $result['verdict'] ) { - $removed++; + ++$removed; self::log( sprintf( 'Blocked (rule: %s, score: %d): %s', $result['rule'], $result['score'], $article['title'] ) ); continue; } @@ -87,10 +87,10 @@ class Peptide_News_Content_Filter { // Borderline articles go to LLM for a second opinion. if ( 'borderline' === $result['verdict'] && self::is_llm_filter_enabled() ) { $llm_verdict = self::classify_with_llm( $article ); - $llm_checked++; + ++$llm_checked; if ( 'promotional' === $llm_verdict ) { - $removed++; + ++$removed; self::log( sprintf( 'Blocked (LLM confirmed borderline): %s', $article['title'] ) ); continue; } diff --git a/includes/class-peptide-news-fetcher.php b/includes/class-peptide-news-fetcher.php index f41a5d0..23508b2 100755 --- a/includes/class-peptide-news-fetcher.php +++ b/includes/class-peptide-news-fetcher.php @@ -87,7 +87,7 @@ class Peptide_News_Fetcher { $stored = 0; foreach ( $articles as $article ) { if ( $this->store_article( $article ) ) { - $stored++; + ++$stored; } } diff --git a/includes/class-peptide-news-llm-client.php b/includes/class-peptide-news-llm-client.php index 67f99b7..1df1319 100644 --- a/includes/class-peptide-news-llm-client.php +++ b/includes/class-peptide-news-llm-client.php @@ -137,7 +137,7 @@ class Peptide_News_LLM_Client { $retry_after = wp_remote_retrieve_header( $response, 'retry-after' ); $wait = $retry_after ? min( (int) $retry_after, 30 ) : $backoff; sleep( $wait ); - $retries++; + ++$retries; $backoff *= 2; continue; } diff --git a/includes/class-peptide-news-llm.php b/includes/class-peptide-news-llm.php index 57abb61..ee39df2 100755 --- a/includes/class-peptide-news-llm.php +++ b/includes/class-peptide-news-llm.php @@ -183,7 +183,7 @@ class Peptide_News_LLM { $result = self::process_article( $article ); if ( ! empty( $result['success'] ) ) { - $processed++; + ++$processed; } if ( ! empty( $result['errors'] ) ) { $last_errors = $result['errors']; diff --git a/includes/class-peptide-news-source-resolver.php b/includes/class-peptide-news-source-resolver.php index 2a4d1c2..6f31316 100644 --- a/includes/class-peptide-news-source-resolver.php +++ b/includes/class-peptide-news-source-resolver.php @@ -126,7 +126,7 @@ class Peptide_News_Source_Resolver { if ( ! empty( $new_source ) && $new_source !== $article->source ) { $wpdb->update( $table, array( 'source' => $new_source ), array( 'id' => $article->id ), array( '%s' ), array( '%d' ) ); - $updated++; + ++$updated; } } diff --git a/uninstall.php b/uninstall.php index d8e808a..907bc94 100755 --- a/uninstall.php +++ b/uninstall.php @@ -2,7 +2,7 @@ declare( strict_types=1 ); if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { - exit; + exit; } global $wpdb; $prefix = $wpdb->prefix; @@ -16,12 +16,12 @@ $wpdb->query( "DROP TABLE IF EXISTS {$prefix}peptide_news_articles" ); // Delete all plugin options. $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. $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.