# defender-security/3.1.0/src/integrations/class-smush.php

Defender Security – Malware Scanner, Login Security &amp; Firewall, version 3.1.0. 55 lines.

- Page: https://pluginprobe.com/plugins/defender-security/3.1.0/code/src/integrations/class-smush.php
- Raw: https://pluginprobe.com/plugins/defender-security/3.1.0/raw/src/integrations/class-smush.php
- Modified: 2021-06-08T08:07:08+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/defender-security/3.1.0/code/src/integrations/class-smush.php#L10-L20`.

```php
<?php

namespace WP_Defender\Integrations;

if ( ! defined( 'ABSPATH' ) ) {
	die;
}

/**
 * Smush integration module.
 * Class Smush
 *
 * @since 2.5.1
 * @package WP_Defender\Integrations
 */
class Smush {
	private $table;

	public function __construct() {
		global $wpdb;
		$this->table = $wpdb->base_prefix . 'smush_dir_images';
	}

	/**
	 * Check if the table exists
	 *
	 * @return bool
	 */
	public function exist_image_table() {
		global $wpdb;

		return (bool) $wpdb->get_var( $wpdb->prepare(
			'SHOW TABLES LIKE %s',
			$wpdb->esc_like( $this->table )
		) );
	}

	/**
	 * Check optimized image path
	 * @param string
	 *
	 * @return bool
	 */
	public function exist_image_path( $path ) {
		global $wpdb;

		return (bool) $wpdb->get_var(
			$wpdb->prepare(
				"SELECT id FROM {$this->table} WHERE path = %s",
				$path
			)
		);
	}
}

```
