• 1 year and 5 months after the Updated code post, the plugin YASR – Yet Another Star Rating Plugin for WordPress is still logging PHP deprecation warnings:

    [14-May-2026 13:31:37 UTC] PHP Deprecated: Automatic conversion of false to array is deprecated in /home/munged/domains/saotn.org/public_html/wp-content/plugins/yet-another-stars-rating/includes/yasr-includes-functions.php on line 337
    [14-May-2026 13:31:38 UTC] PHP Deprecated: Automatic conversion of false to array is deprecated in /home/munged/domains/saotn.org/public_html/wp-content/plugins/yet-another-stars-rating/includes/yasr-includes-functions.php on line 337

    The GitHub repo you refer to in your “Read this” post doesn’t exist anymore. Too bad you handle this so badly, I sure won’t pay for your (otherwise great working) plugin now.

    Here is a fixed function yasr_getimagesize for you:

    function yasr_getimagesize($url) {
    //check if url is valid
    if (yasr_check_valid_url($url) === true) {
    $image_size = @getimagesize($url);

    //be sure that getimagesize has returned an array
    if (!is_array($image_size)) {
    $image_size = array(0, 0);
    }

    return $image_size;
    }

    return array(0,0);
    }

    The error occurs because getimagesize($url) returns the value false if it cannot find a valid image.

    In older PHP versions, you were allowed to silently override a false value by using it as an array ($image_size[0] = 0;). However, as of PHP 8.1, this automatic conversion (autovivification) is deprecated, and in PHP 9.0, this will even result in a fatal error.

    Regards,
    Jan

    • This topic was modified 1 day, 17 hours ago by Jan Reilink. Reason: Munged my user home directory

You must be logged in to reply to this topic.