class-avcf-abilities-wpforms-pro.php
1 month ago
class-avcf-abilities-wpforms.php
1 month ago
class-avcf-wpforms-detector.php
1 month ago
class-avcf-wpforms-helpers.php
1 month ago
class-avcf-wpforms-detector.php
30 lines
| 1 | <?php |
| 2 | /** |
| 3 | * WPForms detector. |
| 4 | * |
| 5 | * Detects WPForms (Lite or Pro). The Pro check is used internally by the |
| 6 | * adapter to gate entry-related methods, since WPForms Lite stores no entries. |
| 7 | * |
| 8 | * @package atarim-visual-collaboration |
| 9 | */ |
| 10 | |
| 11 | if ( ! defined('ABSPATH') ) { |
| 12 | exit; |
| 13 | } |
| 14 | |
| 15 | class AVCF_WPForms_Detector { |
| 16 | |
| 17 | public function avcf_wpforms_is_available() { |
| 18 | return function_exists( 'wpforms' ); |
| 19 | } |
| 20 | |
| 21 | public function avcf_wpforms_is_pro() { |
| 22 | if ( ! $this->avcf_wpforms_is_available() ) { |
| 23 | return false; |
| 24 | } |
| 25 | // Pro registers \WPForms\Pro\Pro; Lite does not. WPFORMS_VERSION_DB |
| 26 | // is also a Pro-only constant in older versions. |
| 27 | return class_exists( '\\WPForms\\Pro\\Pro' ) || defined( 'WPFORMS_VERSION_DB' ); |
| 28 | } |
| 29 | } |
| 30 |