PluginProbe
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO / 2.14.1
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO v2.14.1
2.14.2 2.14.1 2.14.0 2.13.0 2.12.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 All 57 releases
← All changes | includes/seo/class-social-meta-manager.php +11 -31 2.14.2 → 2.14.1 View file →
@@ -523,29 +523,12 @@
523 523 $validation['valid'] = false;
524 524 }
525 525 }
526 526
527 - // The default Open Graph and Twitter images are checked in the field
528 - // details above only while their feature is switched on, but they are
529 - // stored (and shown in the admin preview's src) either way.
530 - $flagged = [];
531 - foreach ($field_details as $field) {
532 - if ('error' === ($field['status'] ?? '')) {
533 - $flagged[] = $field['field'] ?? '';
534 - }
535 - }
536 - foreach (['default_og_image' => 'Default Open Graph image', 'default_twitter_image' => 'Default Twitter Card image'] as $key => $label) {
537 - if (!empty($settings[$key]) && !in_array($key, $flagged, true)
538 - && !\ThinkRank\Core\Url_Validator::is_http_url($settings[$key])) {
539 - $validation['errors'][] = $label . ' must be an http or https URL.';
540 - $validation['valid'] = false;
541 - }
542 - }
543 -
544 527 // Validate default image
545 528 if (isset($settings['default_image']) && !empty($settings['default_image'])) {
546 - if (!\ThinkRank\Core\Url_Validator::is_http_url($settings['default_image'])) {
547 - $validation['errors'][] = 'default_image must be an http or https URL';
529 + if (!filter_var($settings['default_image'], FILTER_VALIDATE_URL)) {
530 + $validation['errors'][] = 'default_image must be a valid URL';
548 531 $validation['valid'] = false;
549 532 } else {
550 533 // Check image dimensions and format
551 534 $image_validation = $this->validate_social_image($settings['default_image']);
@@ -783,12 +766,9 @@
783 766 }
784 767
785 768 // Default Image validation
786 769 if (!empty($settings['default_og_image'])) {
787 - // http(s) only, and refused rather than warned about: the
788 - // value becomes og:image and the admin preview's src, and a
789 - // javascript: URL passed is_valid().
790 - if (\ThinkRank\Core\Url_Validator::is_http_url($settings['default_og_image'])) {
770 + if (filter_var($settings['default_og_image'], FILTER_VALIDATE_URL)) {
791 771 $field_details[] = [
792 772 'field' => 'default_og_image',
793 773 'label' => 'Default Open Graph image is configured.',
794 774 'status' => 'valid',
@@ -796,11 +776,11 @@
796 776 ];
797 777 } else {
798 778 $field_details[] = [
799 779 'field' => 'default_og_image',
800 - 'label' => 'Default Open Graph image must be an http or https URL.',
801 - 'status' => 'error',
802 - 'icon' => '✗'
780 + 'label' => 'Default Open Graph image URL appears invalid.',
781 + 'status' => 'warning',
782 + 'icon' => '⚠'
803 783 ];
804 784 }
805 785 } else {
806 786 $field_details[] = [
@@ -920,9 +900,9 @@
920 900 }
921 901
922 902 // Default Twitter Image validation
923 903 if (!empty($settings['default_twitter_image'])) {
924 - if (\ThinkRank\Core\Url_Validator::is_http_url($settings['default_twitter_image'])) {
904 + if (filter_var($settings['default_twitter_image'], FILTER_VALIDATE_URL)) {
925 905 $field_details[] = [
926 906 'field' => 'default_twitter_image',
927 907 'label' => 'Default Twitter Card image is configured.',
928 908 'status' => 'valid',
@@ -930,11 +910,11 @@
930 910 ];
931 911 } else {
932 912 $field_details[] = [
933 913 'field' => 'default_twitter_image',
934 - 'label' => 'Default Twitter Card image must be an http or https URL.',
935 - 'status' => 'error',
936 - 'icon' => '✗'
914 + 'label' => 'Default Twitter Card image URL appears invalid.',
915 + 'status' => 'warning',
916 + 'icon' => '⚠'
937 917 ];
938 918 }
939 919 } else {
940 920 $field_details[] = [
@@ -3055,9 +3035,9 @@
3055 3035 return $validation;
3056 3036 }
3057 3037
3058 3038 // Check if URL is valid
3059 - if (!\ThinkRank\Core\Url_Validator::is_http_url($image_url)) {
3039 + if (!filter_var($image_url, FILTER_VALIDATE_URL)) {
3060 3040 $validation['warnings'][] = 'Invalid image URL';
3061 3041 return $validation;
3062 3042 }
3063 3043