feat: v0.2.2 — CI hardening, remove dead stubs, strengthen tests

Address CTO audit findings for PRAutoBlogger:
- CI pipeline now runs PHPCS (WordPress standards) and PHPUnit before deploy
- Removed TikTok/Instagram/YouTube stub providers (dead code, not registered)
- Rewrote PublisherTest with real behavioral assertions (post_status, metadata,
  taxonomy, log linking, hooks) instead of method-existence checks
- Added cross-system LLM budget coordination docs to ARCHITECTURE.md
- Bumped version to 0.2.2

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
peptiderepo
2026-04-12 22:41:10 +07:00
parent 03074180d4
commit b21d102afb
13 changed files with 317 additions and 231 deletions

View File

@@ -186,9 +186,6 @@ class PRAutoBlogger_Settings_Fields {
'section' => 'prautoblogger_sources',
'options' => [
'reddit' => __( 'Reddit (RSS + .json)', 'prautoblogger' ),
'tiktok' => __( 'TikTok (coming soon)', 'prautoblogger' ),
'instagram' => __( 'Instagram (coming soon)', 'prautoblogger' ),
'youtube' => __( 'YouTube (coming soon)', 'prautoblogger' ),
],
'default' => '["reddit"]',
'description' => __( 'Select which platforms to monitor for topics.', 'prautoblogger' ),

View File

@@ -4,7 +4,7 @@ declare(strict_types=1);
/**
* Orchestrates data collection from all enabled source providers.
*
* Iterates through enabled sources (Reddit, TikTok, etc.), calls their
* Iterates through enabled sources (currently Reddit), calls their
* collect_data() method, and stores results in the ab_source_data table.
* Handles deduplication via UNIQUE index on (source_type, source_id).
*
@@ -115,7 +115,7 @@ class PRAutoBlogger_Source_Collector {
private function get_provider( string $source_type ): ?PRAutoBlogger_Source_Provider_Interface {
$providers = [
'reddit' => PRAutoBlogger_Reddit_Provider::class,
// Future providers: 'tiktok', 'instagram', 'youtube'
// New providers can be added here — see CONVENTIONS.md for how-to.
];
/**

View File

@@ -3,7 +3,7 @@ declare(strict_types=1);
/**
* Value object representing a single piece of collected social media data
* (a Reddit post, a TikTok comment, etc.).
* (e.g., a Reddit post or comment).
*
* Triggered by: Source providers create these; Content_Analyzer consumes them.
* Dependencies: None — pure data object.

View File

@@ -1,39 +0,0 @@
<?php
declare(strict_types=1);
/**
* Instagram source provider — STUB for future implementation.
*
* Will integrate with Instagram's Graph API to collect post captions,
* comments, and hashtag trends. Requires Meta developer app credentials.
*
* Triggered by: Source_Collector when 'instagram' is in enabled_sources.
* Dependencies: TBD — Instagram Graph API credentials.
*
* @see interface-source-provider.php — Interface this class implements.
*/
class PRAutoBlogger_Instagram_Provider implements PRAutoBlogger_Source_Provider_Interface {
/**
* @param array<string, mixed> $config
* @return PRAutoBlogger_Source_Data[]
* @throws \RuntimeException Always — not yet implemented.
*/
public function collect_data( array $config ): array {
throw new \RuntimeException(
__( 'Instagram source provider is not yet implemented. Remove "instagram" from enabled sources.', 'prautoblogger' )
);
}
public function get_source_type(): string {
return 'instagram';
}
public function validate_credentials(): bool {
return false;
}
public function get_rate_limit_status(): array {
return [ 'remaining' => 0, 'limit' => 0, 'resets_at' => '' ];
}
}

View File

@@ -1,40 +0,0 @@
<?php
declare(strict_types=1);
/**
* TikTok source provider — STUB for future implementation.
*
* Will integrate with TikTok's API to collect video descriptions, comments,
* and trending topics. Requires TikTok developer app credentials.
*
* Triggered by: Source_Collector when 'tiktok' is in enabled_sources.
* Dependencies: TBD — TikTok API credentials.
*
* @see interface-source-provider.php — Interface this class implements.
* @see ARCHITECTURE.md — Planned source providers.
*/
class PRAutoBlogger_Tiktok_Provider implements PRAutoBlogger_Source_Provider_Interface {
/**
* @param array<string, mixed> $config
* @return PRAutoBlogger_Source_Data[]
* @throws \RuntimeException Always — not yet implemented.
*/
public function collect_data( array $config ): array {
throw new \RuntimeException(
__( 'TikTok source provider is not yet implemented. Remove "tiktok" from enabled sources.', 'prautoblogger' )
);
}
public function get_source_type(): string {
return 'tiktok';
}
public function validate_credentials(): bool {
return false;
}
public function get_rate_limit_status(): array {
return [ 'remaining' => 0, 'limit' => 0, 'resets_at' => '' ];
}
}

View File

@@ -1,39 +0,0 @@
<?php
declare(strict_types=1);
/**
* YouTube source provider — STUB for future implementation.
*
* Will integrate with YouTube Data API v3 to collect video titles,
* descriptions, comments, and trending topics. Requires Google API key.
*
* Triggered by: Source_Collector when 'youtube' is in enabled_sources.
* Dependencies: TBD — YouTube Data API key.
*
* @see interface-source-provider.php — Interface this class implements.
*/
class PRAutoBlogger_Youtube_Provider implements PRAutoBlogger_Source_Provider_Interface {
/**
* @param array<string, mixed> $config
* @return PRAutoBlogger_Source_Data[]
* @throws \RuntimeException Always — not yet implemented.
*/
public function collect_data( array $config ): array {
throw new \RuntimeException(
__( 'YouTube source provider is not yet implemented. Remove "youtube" from enabled sources.', 'prautoblogger' )
);
}
public function get_source_type(): string {
return 'youtube';
}
public function validate_credentials(): bool {
return false;
}
public function get_rate_limit_status(): array {
return [ 'remaining' => 0, 'limit' => 0, 'resets_at' => '' ];
}
}

View File

@@ -2,7 +2,7 @@
declare(strict_types=1);
/**
* Contract for any social media source provider (Reddit, TikTok, Instagram, YouTube).
* Contract for any social media source provider (e.g., Reddit).
*
* Any class implementing this interface can be registered as a data source.
* The Source_Collector iterates through enabled providers and calls collect_data().