PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 4.7.0
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v4.7.0
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
← All changes | includes/class-wpo-image-utils.php +4 -4 3.2.21 → 4.7.0 View file →
@@ -15,9 +15,9 @@
15 15 public static function get_attachment_files($attachment_id) {
16 16 $attachment_images = array();
17 17 $upload_dir = wp_get_upload_dir();
18 18
19 - // get sizes info from attachment meta data.
19 + // get sizes info from attachment metadata.
20 20 $meta = wp_get_attachment_metadata($attachment_id);
21 21 if (!is_array($meta) || !array_key_exists('sizes', $meta)) return $attachment_images;
22 22
23 23 $image_sizes = array_keys($meta['sizes']);
@@ -50,13 +50,13 @@
50 50 * Returns given file extension
51 51 *
52 52 * @param string $file
53 53 *
54 - * @return mixed
54 + * @return string
55 55 */
56 - public static function get_extension($file) {
56 + public static function get_extension($file): string {
57 57 $file_type = wp_check_filetype($file);
58 - return $file_type['ext'];
58 + return (string) $file_type['ext'];
59 59 }
60 60
61 61 /**
62 62 * Tests if given extension is present in allowed extensions array