style: auto-fix PHPCS violations via phpcbf
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ class Peptide_News_Fetcher {
|
||||
$stored = 0;
|
||||
foreach ( $articles as $article ) {
|
||||
if ( $this->store_article( $article ) ) {
|
||||
$stored++;
|
||||
++$stored;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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'];
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user