PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 3.1.0
Defender Security – Malware Scanner, Login Security & Firewall v3.1.0
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 3.1.0, at src/traits/hummingbird.php

45 lines 902 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 /**
16 * Trait Hummingbird
17 */
18 trait Hummingbird {
19 /**
20 * Check if Hummingbird is active.
21 *
22 * @return bool
23 */
24 public function is_hummingbird_enabled() {
25 return class_exists( 'Hummingbird\\WP_Hummingbird' );
26 }
27
28 /**
29 * Check if Hummingbird has lazy load comments enabled.
30 *
31 * @return bool
32 */
33 public function is_lazy_load_comments_enabled() {
34 if ( ! $this->is_hummingbird_enabled() ) {
35 return false;
36 }
37
38 $settings = is_multisite() ? get_site_option( 'wphb_settings', array() ) : get_option( 'wphb_settings', array() );
39 if ( empty( $settings ) || ! is_array( $settings ) ) {
40 return false;
41 }
42
43 return ! empty( $settings['advanced']['lazy_load']['enabled'] ) && $settings['advanced']['lazy_load']['enabled'];
44 }
45 }