New internal plugin: weekly LLM probes of core peptides (Perplexity sonar + GPT/Gemini-search via OpenRouter/CF gateway) -> custom table -> wp-admin trendline + standings. Provider interface + cost ledger w/ hard $5/mo cap + collector/panel seam (AI-visibility only). v1 = AI-visibility only. QA: APPROVE-WITH-P2-NOTES — qa-reviews/peptide-geo-monitor/2026-06-13-f488f4a966cbb9e771d3abc20daee3fa49074520.md (P2 follow-ups: ltrim www display bug, PHPCS mandatory, dead cache) Agent-Session: geomonitor v0.1.0 merge
35 lines
1.3 KiB
PHP
35 lines
1.3 KiB
PHP
<?php
|
|
/**
|
|
* Peptide GEO Monitor — full data teardown on uninstall.
|
|
*
|
|
* Drops the custom pgm_ai_visibility table and deletes every wp_options
|
|
* row whose name starts with "pgm_". WP-Cron events are already cleared
|
|
* by PGM_Deactivator on deactivation; this runs after that.
|
|
*
|
|
* @see ARCHITECTURE.md — §Uninstall specification.
|
|
* @see class-pgm-deactivator.php — Clears cron on deactivation.
|
|
*/
|
|
|
|
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
|
exit;
|
|
}
|
|
|
|
global $wpdb;
|
|
|
|
/* ── 1. Drop the custom table ─────────────────────────────────────── */
|
|
|
|
$table = $wpdb->prefix . 'pgm_ai_visibility';
|
|
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
|
|
$wpdb->query( "DROP TABLE IF EXISTS {$table}" );
|
|
|
|
/* ── 2. Delete all pgm_ prefixed options ──────────────────────────── */
|
|
|
|
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery
|
|
$wpdb->query(
|
|
"DELETE FROM {$wpdb->options} WHERE option_name LIKE 'pgm\_%'"
|
|
);
|
|
|
|
/* ── 3. Clear any remaining scheduled cron events ─────────────────── */
|
|
|
|
wp_clear_scheduled_hook( 'pgm_weekly_probe' );
|