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 / integrations / class-smush.php

class-smush.php in Defender Security – Malware Scanner, Login Security & Firewall 3.1.0, at src/integrations/class-smush.php

55 lines 844 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WP_Defender\Integrations;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 die;
7 }
8
9 /**
10 * Smush integration module.
11 * Class Smush
12 *
13 * @since 2.5.1
14 * @package WP_Defender\Integrations
15 */
16 class Smush {
17 private $table;
18
19 public function __construct() {
20 global $wpdb;
21 $this->table = $wpdb->base_prefix . 'smush_dir_images';
22 }
23
24 /**
25 * Check if the table exists
26 *
27 * @return bool
28 */
29 public function exist_image_table() {
30 global $wpdb;
31
32 return (bool) $wpdb->get_var( $wpdb->prepare(
33 'SHOW TABLES LIKE %s',
34 $wpdb->esc_like( $this->table )
35 ) );
36 }
37
38 /**
39 * Check optimized image path
40 * @param string
41 *
42 * @return bool
43 */
44 public function exist_image_path( $path ) {
45 global $wpdb;
46
47 return (bool) $wpdb->get_var(
48 $wpdb->prepare(
49 "SELECT id FROM {$this->table} WHERE path = %s",
50 $path
51 )
52 );
53 }
54 }
55