Support » Plugin: Search Regex » PHP 8.0 Parse error

  • Resolved Malae

    (@malae)


    Hello John,

    The plugin is throwing a deprecated code error in PHP 8.0. Could you please fix this?

    Parse error: syntax error, unexpected token "::", expecting "(" in /wp-content/plugins/search-regex/models/search.php on line 322

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author John Godley

    (@johnny5)

    Yes, it is not compatible with PHP 8 at the moment.

    extremecarver

    (@extremecarver)

    would be great if this were updated soon. PHP8 is getting more popular and most plugins are fixed by now…

    Indeed. Have 70+ plugins active, and this is the only one still throwing fatal errors (or any errors/warnings at all) that are even stopping a website from working. The issue isn’t cosmetic nor “Resolved”, and hope the dev would fix that soon.

    Plugin Author John Godley

    (@johnny5)

    Thread Starter Malae

    (@malae)

    Many thanks John for your work with this very useful plugin. Initial tests with WP 5.7.2 and PHP 8.0.6 have shown no issues.

    For me with just one simple exchange test it was also fine. Thanks for upgrading this (even though I rarely need ity sometimes it comes very handy, like once in a year big time savings)

    Jon Dennis

    (@jondennis)

    Hi, Search Regex is still throwing a Fatal Error on installation

    Plugin Author John Godley

    (@johnny5)

    @jondennis you need the beta version, as mentioned above

    Jon Dennis

    (@jondennis)

    Thank you John, apologies for not reading the whole thread.

    Yes, can confirm the Beta version installs correctly 🙂

    The beta is now six months old, so I tried hacking the search.php and changing this on line 322:

    $contexts = Match::get_all( $this->search, $source->get_flags(), $replacement, $row[ $column ] );

    to this:

    $contexts = get_all( $this->search, $source->get_flags(), $replacement, $row[ $column ] );

    And the plugin seems to work fine. If you are not aware of any ill-effects from making this change, an update with this included would be great.

    Plugin Author John Godley

    (@johnny5)

    It would be easier to use the beta version instead of hacking the old version.

    Thanks for getting back to me @johnny5.

    I’ll give it a try, but I usually try to avoid using beta plugins on a production site if possible.

    Will the beta be auto-updated to a production version when you release it?

    Regards,
    Martin.

Viewing 12 replies - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.