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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user