uninstall.php: direct wpdb->query() intentional in uninstall (no caching available); add phpcs:ignore DirectDatabaseQuery.DirectQuery and NoCaching. class-prc-rest-controller.php get_presets(): request param required by WP REST API callback contract; add phpcs:ignore UnusedFunctionParameter. Agent-Session: claude/adopt-ci-20260616
37 lines
1.0 KiB
PHP
37 lines
1.0 KiB
PHP
<?php
|
|
/**
|
|
* Uninstall handler — cleans up all plugin data.
|
|
*
|
|
* What: Removes all options and transients created by this plugin.
|
|
* Who calls it: WordPress on plugin deletion.
|
|
* Dependencies: None (standalone, no autoloader).
|
|
*
|
|
* @see ARCHITECTURE.md — Teardown section.
|
|
* @package PeptideReconstitutionCalculator
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
|
exit;
|
|
}
|
|
|
|
global $wpdb;
|
|
|
|
// Delete all prc_ prefixed options.
|
|
$wpdb->query( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
|
|
$wpdb->prepare(
|
|
"DELETE FROM {$wpdb->options} WHERE option_name LIKE %s",
|
|
$wpdb->esc_like( 'prc_' ) . '%'
|
|
)
|
|
);
|
|
|
|
// Delete all prc_ prefixed transients.
|
|
$wpdb->query( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
|
|
$wpdb->prepare(
|
|
"DELETE FROM {$wpdb->options} WHERE option_name LIKE %s OR option_name LIKE %s",
|
|
$wpdb->esc_like( '_transient_prc_' ) . '%',
|
|
$wpdb->esc_like( '_transient_timeout_prc_' ) . '%'
|
|
)
|
|
);
|