PluginProbe
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO / 1.3.53
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO v1.3.53
1.4.17 1.4.16 1.4.15 1.4.14 1.4.13 1.4.12 1.4.11 1.4.10 1.4.9 1.4.8 1.4.7 1.4.6 1.4.5 1.4.4 1.4.3 1.4.2 1.4.1 1.4.0 1.3.54 1.3.53 1.3.52 1.3.51 1.3.50 1.3.49 1.3.48 All 180 releases
disco / vendor / micropackage / requirements / src / Checker / SSL.php

SSL.php in Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO 1.3.53, at vendor/micropackage/requirements/src/Checker/SSL.php

50 lines 951 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * SSL Checker class
4 *
5 * @package micropackage/requirements
6 */
7
8 namespace Micropackage\Requirements\Checker;
9
10 use Micropackage\Requirements\Abstracts;
11 use Micropackage\Requirements\Requirements;
12
13 /**
14 * SSL Checker class
15 */
16 class SSL extends Abstracts\Checker {
17
18 /**
19 * Checker name
20 *
21 * @var string
22 */
23 protected $name = 'ssl';
24
25 /**
26 * Checks if the requirement is met
27 *
28 * @since 1.1.0
29 * @throws \Exception When provided value is not a string or numeric.
30 * @param string $enabled If SSL should be enabled or disabled.
31 * @return void
32 */
33 public function check( $enabled ) {
34
35 if ( ! is_bool( $enabled ) ) {
36 throw new \Exception( 'SSL Check requires bool parameter' );
37 }
38
39 if ( $enabled && ! is_ssl() ) {
40 $this->add_error( __( 'SSL is required', Requirements::$textdomain ) );
41 }
42
43 if ( ! $enabled && is_ssl() ) {
44 $this->add_error( __( 'SSL is superfluous', Requirements::$textdomain ) );
45 }
46
47 }
48
49 }
50