feat: add browsable peptide directory with category filtering, REST API, and extended meta fields (v4.3.0)

Adds [peptide_directory] shortcode with card grid, category taxonomy (8 terms),
search, pagination, detail modal, and /v1/compounds REST endpoint. Includes 9
new meta fields (half-life, stability, solubility, etc.), admin data tools for
migration/re-enrichment, integration hooks for cross-plugin extensibility,
dark mode support, and full uninstall cleanup. Refactors AI generator into
PSA_OpenRouter + PSA_KB_Builder classes. Adds PHPUnit tests for PostType and
Directory classes. Fixes QA findings: dead JS selector, renderError loading
state, numeric meta validation, prepared SQL in uninstall.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
peptiderepo
2026-04-13 21:30:11 +07:00
parent 0fa2707163
commit ed65b6ab90
28 changed files with 3380 additions and 783 deletions

View File

@@ -1,4 +1,5 @@
<?php
declare( strict_types=1 );
/**
* Handles encryption/decryption of sensitive data at rest.
*
@@ -25,7 +26,7 @@ class PSA_Encryption {
* @param string $plaintext The plaintext to encrypt.
* @return string|false Base64-encoded IV + ciphertext, or false on failure.
*/
public static function encrypt( $plaintext ) {
public static function encrypt( string $plaintext ) {
if ( empty( $plaintext ) ) {
return false;
}
@@ -61,7 +62,7 @@ class PSA_Encryption {
* @param string $ciphertext The base64-encoded IV + ciphertext.
* @return string|false Decrypted plaintext, or false on failure.
*/
public static function decrypt( $ciphertext ) {
public static function decrypt( string $ciphertext ) {
if ( empty( $ciphertext ) ) {
return false;
}
@@ -96,7 +97,7 @@ class PSA_Encryption {
* @param string $value The value to check.
* @return bool True if the value appears to be encrypted.
*/
public static function is_encrypted( $value ) {
public static function is_encrypted( $value ): bool {
if ( empty( $value ) || ! is_string( $value ) ) {
return false;
}