PluginProbe
Image Optimizer – Compress Images and Convert to WebP or AVIF / 1.7.7
Image Optimizer – Compress Images and Convert to WebP or AVIF v1.7.7
1.7.7 1.7.6 1.7.5 1.7.4 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 All 33 releases
← All changes | classes/async-operation/queries/image-optimization-operation-query.php +7 -3 1.0.21.7.7 View file →
@@ -1,9 +1,9 @@
1 1 <?php
2 2
3 -namespace ImageOptimizer\Classes\Async_Operation\Queries;
3 +namespace ImageOptimization\Classes\Async_Operation\Queries;
4 4
5 -use ImageOptimizer\Classes\Async_Operation\{
5 +use ImageOptimization\Classes\Async_Operation\{
6 6 Async_Operation_Hook,
7 7 Async_Operation_Queue,
8 8 Interfaces\Operation_Query_Interface,
9 9 };
@@ -8,14 +8,18 @@
8 8 Interfaces\Operation_Query_Interface,
9 9 };
10 10 use TypeError;
11 11
12 +if ( ! defined( 'ABSPATH' ) ) {
13 + exit; // Exit if accessed directly.
14 +}
15 +
12 16 class Image_Optimization_Operation_Query implements Operation_Query_Interface {
13 17 private array $query;
14 18
15 19 public function set_hook( string $hook ): self {
16 20 if ( ! in_array( $hook, Async_Operation_Hook::get_values(), true ) ) {
17 - throw new TypeError( "Hook $hook is not a part of Async_Operation_Hook values" );
21 + throw new TypeError( esc_html( "Hook $hook is not a part of Async_Operation_Hook values" ) );
18 22 }
19 23
20 24 $this->query['hook'] = $hook;
21 25