PluginProbe
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO / 2.11.0
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO v2.11.0
2.11.0 2.10.0 2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.1 2.1.0 2.0.2 2.0.1 2.0.0 1.32.0 1.31.0 1.30.0 1.29.0 1.28.0 1.27.0 1.26.0 1.25.0 trunk 1.0.0 All 52 releases
← All changes | includes/frontend/class-seo-manager.php +3 -7 trunk → 2.11.0 View file →
@@ -1799,16 +1799,12 @@
1799 1799 // Get image dimensions and alt text
1800 1800 $image_id = get_post_thumbnail_id($this->current_post_id);
1801 1801 $image_meta = wp_get_attachment_metadata($image_id);
1802 1802 if ($image_meta) {
1803 - // The `large` file being published, not the original it
1804 - // was generated from: the metadata's own width and height
1805 - // describe an image this tag does not point at (#847).
1806 - $image_file = \ThinkRank\SEO\Attachment_Lookup::describe((int) $image_id, (string) $image_url);
1807 1803 // SVGs (and other vector uploads) report 0x0 — emitting
1808 1804 // those as og:image dimensions is invalid, so skip them.
1809 - $og_width = $image_file['width'];
1810 - $og_height = $image_file['height'];
1805 + $og_width = isset($image_meta['width']) ? (int) $image_meta['width'] : 0;
1806 + $og_height = isset($image_meta['height']) ? (int) $image_meta['height'] : 0;
1811 1807 if ($og_width > 0 && $og_height > 0) {
1812 1808 echo "<meta property=\"og:image:width\" content=\"" . esc_attr($og_width) . "\" />\n";
1813 1809 echo "<meta property=\"og:image:height\" content=\"" . esc_attr($og_height) . "\" />\n";
1814 1810 }
@@ -1813,9 +1809,9 @@
1813 1809 echo "<meta property=\"og:image:height\" content=\"" . esc_attr($og_height) . "\" />\n";
1814 1810 }
1815 1811 // Derive the real mime type instead of hardcoding image/jpeg,
1816 1812 // which mislabels PNG/WebP featured images.
1817 - $image_mime = $image_file['type'];
1813 + $image_mime = get_post_mime_type($image_id);
1818 1814 if ($image_mime) {
1819 1815 echo "<meta property=\"og:image:type\" content=\"" . esc_attr($image_mime) . "\" />\n";
1820 1816 }
1821 1817 }