PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
← All changes | src/helpers/open-graph/image-helper.php +2 -39 28.0 → trunk View file →
@@ -10,15 +10,8 @@
10 10 */
11 11 class Image_Helper {
12 12
13 13 /**
14 - * The URL helper.
15 - *
16 - * @var Url_Helper
17 - */
18 - private $url;
19 -
20 - /**
21 14 * The base image helper.
22 15 *
23 16 * @var Base_Image_Helper
24 17 */
@@ -28,43 +21,13 @@
28 21 * Image_Helper constructor.
29 22 *
30 23 * @codeCoverageIgnore
31 24 *
32 - * @param Url_Helper $url The url helper.
25 + * @param Url_Helper $url The url helper. Deprecated since 28.6 and no longer used.
33 26 * @param Base_Image_Helper $image The image helper.
34 27 */
35 - public function __construct( Url_Helper $url, Base_Image_Helper $image ) {
36 - $this->url = $url;
28 + public function __construct( Url_Helper $url, Base_Image_Helper $image ) { // @phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found, VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable -- $url is deprecated, kept for BC reasons.
37 29 $this->image = $image;
38 - }
39 -
40 - /**
41 - * Determines whether the passed URL is considered valid.
42 - *
43 - * @deprecated 22.4
44 - * @codeCoverageIgnore
45 - *
46 - * @param array<array<string, string|int>> $image The image array.
47 - *
48 - * @return bool Whether or not the URL is a valid image.
49 - */
50 - public function is_image_url_valid( array $image ) {
51 - \_deprecated_function( __METHOD__, 'Yoast SEO 22.4' );
52 -
53 - if ( empty( $image['url'] ) || ! \is_string( $image['url'] ) ) {
54 - return false;
55 - }
56 -
57 - $image_extension = $this->url->get_extension_from_url( $image['url'] );
58 - $is_valid = $this->image->is_extension_valid( $image_extension );
59 -
60 - /**
61 - * Filter: 'wpseo_opengraph_is_valid_image_url' - Allows extra validation for an image url.
62 - *
63 - * @param bool $is_valid Current validation result.
64 - * @param string $url The image url to validate.
65 - */
66 - return (bool) \apply_filters( 'wpseo_opengraph_is_valid_image_url', $is_valid, $image['url'] );
67 30 }
68 31
69 32 /**
70 33 * Retrieves the overridden image size value.