• Resolved wayneljw

    (@wayneljw)


    This plugin uses str_contains() which is provided only on PHP v8 or up. Somewhere in this plugin, we need this snippet:

    if (!function_exists(‘str_contains’)) {
    function str_contains (string $haystack, string $needle)
    {
    return empty($needle) || strpos($haystack, $needle) !== false;
    }
    }

    This fixes these 2 issues:

    • the task spinner won’t stop.
    • it can’t bulk rename

    Quote from https://www.php.net/manual/en/function.str-contains.php#126277

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author crossi72

    (@crossi72)

    Hi @wayneljw,
    thank you for reporting the issue e for pointing out the solution, I’ll release an update as soon as possible (I only need to complete the test protocol).

    C.

    Plugin Author crossi72

    (@crossi72)

    Version 3.11 is live, many thanks for your fix ??
    C.

    Thread Starter wayneljw

    (@wayneljw)

    Thank you @crossi72 ,

    The other issue I noticed is that when I have many posts and many post_meta data, the update_posts() would never ends. I have to comment out the two lines which states: “self::update_posts($post_types, $searches, $replaces);”.

    I can understand that it spends time to search the database for the original media file name and replacing, but I’m not sure what is the best strategy to improve this task. And I’m also not sure what the side effects are when I ignore update_posts(). I’m just reporting this to you for your reference.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Call to undefined function str_contains()’ is closed to new replies.