| @@ -8,12 +8,20 @@ | ||
| 8 | 8 | class SodiumCompat |
| 9 | 9 | { |
| 10 | 10 | public function __construct() |
| 11 | 11 | { |
| 12 | - if (!class_exists('ParagonIE_Sodium_Compat')) { | |
| 13 | - require_once ABSPATH . WPINC . '/sodium_compat/autoload.php'; | |
| 14 | - Log::debug_log(class_exists('ParagonIE_Sodium_Compat') ? 'Found' : 'ParagonIE\Sodium\Compat not found'); | |
| 12 | + if (class_exists('ParagonIE_Sodium_Compat')) { | |
| 13 | + return; | |
| 15 | 14 | } |
| 15 | + | |
| 16 | + $autoloader = ABSPATH . WPINC . '/sodium_compat/autoload.php'; | |
| 17 | + if (!is_readable($autoloader)) { | |
| 18 | + Log::debug_log('WordPress sodium_compat autoloader not readable at ' . $autoloader); | |
| 19 | + | |
| 20 | + return; | |
| 21 | + } | |
| 22 | + | |
| 23 | + require_once $autoloader; | |
| 16 | 24 | } |
| 17 | 25 | |
| 18 | 26 | /** |
| 19 | 27 | * Wrap crypto_aead_*_encrypt() in a drop-dead-simple encryption interface |