PluginProbe ʕ •ᴥ•ʔ
Atarim – AI Agency for WordPress: Edit Pages, Fix Code, Update Plugins, SEO & Client Feedback / 5.1.3
Atarim – AI Agency for WordPress: Edit Pages, Fix Code, Update Plugins, SEO & Client Feedback v5.1.3
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 / wp-activity-log / class-avcf-wpal-detector.php
atarim-visual-collaboration / third-party / wp-activity-log Last commit date
atarim-wpal-integration-guide.txt 4 days ago class-avcf-wpal-abilities.php 4 days ago class-avcf-wpal-detector.php 4 days ago class-avcf-wpal-rest.php 4 days ago class-avcf-wpal-stats.php 4 days ago
class-avcf-wpal-detector.php
62 lines
1 <?php
2 /**
3 * Detects the WP Activity Log plugin and its edition.
4 *
5 * This is the single point of contact for checking whether WPAL is installed,
6 * which edition is active, and which features are available. If Melapress
7 * renames or moves classes in a future WPAL version, this file is the only
8 * place that needs to change.
9 *
10 * @package atarim-visual-collaboration
11 */
12
13 if ( ! defined('ABSPATH') ) {
14 exit; // Exit if accessed directly
15 }
16
17 class AVCF_WPAL_Detector {
18
19 /**
20 * Fully-qualified WPAL class used to retrieve activity log data.
21 */
22 const WPAL_OCCURRENCES_CLASS = '\WSAL\Entities\Occurrences_Entity';
23
24 /**
25 * Method only present in the Premium edition.
26 * Used as the sentinel for edition detection.
27 */
28 const WPAL_PREMIUM_METHOD = 'get_last24_links';
29
30 public function __construct() {}
31
32 /**
33 * Whether WP Activity Log is installed and bootstrapped on this site.
34 */
35 public function avcf_wpal_is_available() {
36 return class_exists( self::WPAL_OCCURRENCES_CLASS );
37 }
38
39 /**
40 * Whether the Premium edition is active.
41 * Premium ships an additional method on Occurrences_Entity that the free
42 * edition does not, so method_exists is a reliable detection signal.
43 */
44 public function avcf_wpal_is_premium() {
45 if ( ! $this->avcf_wpal_is_available() ) {
46 return false;
47 }
48 return method_exists( self::WPAL_OCCURRENCES_CLASS, self::WPAL_PREMIUM_METHOD );
49 }
50
51 /**
52 * Edition label suitable for display or API output.
53 * Returns 'premium', 'free', or 'none'.
54 */
55 public function avcf_wpal_edition() {
56 if ( ! $this->avcf_wpal_is_available() ) {
57 return 'none';
58 }
59 return $this->avcf_wpal_is_premium() ? 'premium' : 'free';
60 }
61 }
62