feat: ship Peptide Reconstitution Calculator v1.0.0
Interactive reconstitution calculator with peptide-specific presets. Core features: - [prc_calculator] shortcode with instant client-side math - Concentration (mg/mL), mcg/unit, injection volume, syringe units, doses/vial - Live presets from PR Core dosing data (graceful fallback to 8 defaults) - REST API (prc/v1): presets list/detail + server-side calculate - Transient-cached presets with event-driven invalidation - Dark mode + responsive design (320px+) - Full teardown in uninstall.php 12 PHP files (max 241 lines), 1 JS file, 1 CSS file. CI: PHP lint 8.1-8.3, PHPCS WordPress, 300-line check. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
35
uninstall.php
Normal file
35
uninstall.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
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_' ) . '%'
|
||||
)
|
||||
);
|
||||
Reference in New Issue
Block a user