PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 5.5.1
Defender Security – Malware Scanner, Login Security & Firewall v5.5.1
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
defender-security / src / traits / hummingbird.php

hummingbird.php in Defender Security – Malware Scanner, Login Security & Firewall 5.5.1, at src/traits/hummingbird.php

47 lines 889 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Hummingbird trait.
4 *
5 * @since 2.6.1
6 * @package WP_Defender\Traits
7 */
8
9 namespace WP_Defender\Traits;
10
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit;
13 }
14
15 trait Hummingbird {
16
17 /**
18 * Check if Hummingbird is active.
19 *
20 * @return bool
21 */
22 public function is_hummingbird_enabled() {
23 return class_exists( 'Hummingbird\\WP_Hummingbird' );
24 }
25
26 /**
27 * Check if Hummingbird has lazy load comments enabled.
28 *
29 * @return bool
30 */
31 public function is_lazy_load_comments_enabled() {
32 if ( ! $this->is_hummingbird_enabled() ) {
33 return false;
34 }
35
36 $settings = is_multisite() ? get_site_option( 'wphb_settings', array() ) : get_option(
37 'wphb_settings',
38 array()
39 );
40 if ( ! is_array( $settings ) || array() === $settings ) {
41 return false;
42 }
43
44 return isset( $settings['advanced']['lazy_load']['enabled'] ) && $settings['advanced']['lazy_load']['enabled'];
45 }
46 }
47