Files
peptide-reconstitution-calc…/uninstall.php
peptiderepo 8e1405d5a5 fix(ci): resolve latent PHPCS + JS lint failures
Latent debt surfaced by the reusable PHPCS job (previously continue-on-error).

PHPCS fixes (all pre-existing, not introduced by this PR):
- Add @package PeptideReconstitutionCalculator to file docblocks in all 12 PHP
  files (previously missing; phpcbf cannot insert missing docblock tags).
- Replace two short-ternary ?: operators in class-prc-preset-provider.php with
  full ternary (Universal.Operators.DisallowShortTernary.Found; lines 136+152).

JS lint fix:
- Add package.json + package-lock.json (no deps; lint script = node --check)
  so the reusable lint-js job's npm ci / cache: npm steps succeed. The
  calculator ships vanilla JS with no build toolchain — package.json is the
  minimal stub the reusable workflow requires for has_js: true.

Agent-Session: claude/adopt-ci-20260616
2026-06-16 15:24:19 +00:00

37 lines
852 B
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(
$wpdb->prepare(
"DELETE FROM {$wpdb->options} WHERE option_name LIKE %s",
$wpdb->esc_like( 'prc_' ) . '%'
)
);
// Delete all prc_ prefixed transients.
$wpdb->query(
$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_' ) . '%'
)
);