PluginProbe ʕ •ᴥ•ʔ
Atarim – AI Agency for WordPress: Edit Pages, Fix Code, Update Plugins, SEO & Client Feedback / trunk
Atarim – AI Agency for WordPress: Edit Pages, Fix Code, Update Plugins, SEO & Client Feedback vtrunk
5.1.3 5.1.2 5.1.1 5.1 5.0 trunk 3.10 3.11 3.12 3.13 3.14 3.15 3.16 3.17 3.18 3.19 3.2.0 3.2.1 3.22 3.22.1 3.22.2 3.22.3 3.22.4 3.22.5 3.22.6 3.3.0 3.3.1 3.3.2 3.3.2.1 3.3.2.2 3.3.3 3.30 3.31 3.32 3.4 3.4.1 3.4.3 3.4.4 3.5 3.5.1 3.6 3.6.1 3.7 3.8 3.9 3.9.1 3.9.2 3.9.3 3.9.4 3.9.6 3.9.6.1 4.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.0.9 4.1.0 4.1.1 4.1.2 4.1.3 4.2 4.2.1 4.2.2 4.3 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.4
atarim-visual-collaboration / third-party / image-optimizer / shortpixel / class-avcf-shortpixel-detector.php
atarim-visual-collaboration / third-party / image-optimizer / shortpixel Last commit date
class-avcf-abilities-shortpixel.php 2 weeks ago class-avcf-shortpixel-detector.php 2 weeks ago class-avcf-shortpixel-helpers.php 2 weeks ago
class-avcf-shortpixel-detector.php
50 lines
1 <?php
2 /**
3 * ShortPixel Image Optimizer detector.
4 *
5 * ShortPixel is a CLOUD/async optimizer: compression runs on ShortPixel's
6 * servers via a background queue. Our abilities DRIVE the installed plugin
7 * (enqueue work, read status); they never hold or read its API key and never
8 * reimplement compression.
9 *
10 * Verified against ShortPixel Image Optimizer 6.5.5 (namespaced controllers +
11 * custom queue). Availability is keyed on the plugin's version constant.
12 *
13 * @package atarim-visual-collaboration
14 */
15
16 if ( ! defined( 'ABSPATH' ) ) {
17 exit;
18 }
19
20 class AVCF_ShortPixel_Detector {
21
22 /** Whether ShortPixel Image Optimizer is active on this site. */
23 public function avcf_shortpixel_is_available() {
24 return defined( 'SHORTPIXEL_IMAGE_OPTIMISER_VERSION' )
25 && class_exists( '\\ShortPixel\\Controller\\QueueController' )
26 && class_exists( '\\ShortPixel\\Controller\\ApiKeyController' );
27 }
28
29 /**
30 * Whether ShortPixel is configured with a verified API key. Uses the
31 * plugin's own ApiKeyModel::is_verified() and NEVER reads the key value.
32 * Returns false if unavailable or unconfigured.
33 */
34 public function avcf_shortpixel_is_configured() {
35 if ( ! $this->avcf_shortpixel_is_available() ) {
36 return false;
37 }
38 try {
39 $key_control = \ShortPixel\Controller\ApiKeyController::getInstance();
40 if ( ! is_object( $key_control ) || ! method_exists( $key_control, 'getKeyModel' ) ) {
41 return false;
42 }
43 $model = $key_control->getKeyModel();
44 return is_object( $model ) && method_exists( $model, 'is_verified' ) && (bool) $model->is_verified();
45 } catch ( \Throwable $e ) {
46 return false;
47 }
48 }
49 }
50