• Hi guys,

    I’m receiving the following error whenever I publish a post on my site:

    Warning: preg_match(): Compilation failed: nothing to repeat at offset 1 in /home/totalgee/public_html/wp-includes/class-wp.php on line 218

    Warning: preg_match(): Compilation failed: nothing to repeat at offset 1 in /home/totalgee/public_html/wp-includes/class-wp.php on line 219

    The error message disappears whenever I flush the site’s permalinks, but reoccurs EVERY time I publish a post… since I run a news site, this occurs often and the error has even been scraped by Google News as an excerpt. Not great. Weirdly, it doesn’t seem to happen when I publish Events (which I’m using to track film release dates).

    I’ve tried cleaning up and optimizing my DB and have even tried completely removing and reinstalling Events Manager… but the errors persist. They only stop when EM is removed.

    I have tried debugged using the Rewrite Rules plugin, and it states the following rewrite rule is ‘missing’:

    Rule “release-dates/(\d{4}-\d{2}-\d{2})$”
    Rewrite “index.php?post_type=event&calendar_day=$matches[1]”

    I’d really appreciate some help to sort this out as I’d rather continue using the plugin – it’s extremely helpful to create a calendar of release dates for both myself and my visitors.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 24 total)
  • Hi,

    Which version of Events Manager and WordPress are you using?

    Thread Starter totalgeeks

    (@totalgeeks)

    Hi there,

    I’m using WordPress 4.9.1 and EM 5.8.1.1.
    PHP version: 5.6.30 and the info under ‘Database Server in PHPMyAdmin is as follows:

    Server: Localhost via UNIX socket
    Server type: Percona Server
    Server version: 5.6.36-82.1-log – Percona Server (GPL), Release 82.1, Revision 1a00d79
    Protocol version: 10

    Do you see the error on every page of the site? If not, which ones?

    Do you have WordPress Event Archives enabled under Events > Settings > Pages > Event List/Archives?

    It would be worth upgrading to the latest version of Events Manager to rule out any issues with the older version.

    Thread Starter totalgeeks

    (@totalgeeks)

    Hi there,

    The error isn’t on every page when it happens – it only appears on Posts.
    I didn’t have archives enabled but just tried enabling them to see if it makes a difference – still seems to cause the error.

    And apologies, I thought I had the latest version? I can’t update it within wordpress itself so I assume it’s the latest version?

    Although you have the latest version, it might be worth upgrading to the Dev version under Events > Settings > General > Admin Tools.

    https://wp-events-plugin.com/documentation/upgrade-dev-version/

    Am I correct in thinking the error messages only appear on post pages, not on events pages? Do you have any custom code running relating to Events Manager?

    Thread Starter totalgeeks

    (@totalgeeks)

    I’ve just updated to the latest Dev version so will make a few posts and report back if it works! And yes, the error only appears on Post pages, not Events pages. And only when posting Posts, not when posting Events.

    Ok, let us know if switching to the Dev version didn’t help.

    Thread Starter totalgeeks

    (@totalgeeks)

    No, it doesn’t seem to have helped – still kicking out the error whenever I publish a post.

    Do you have any kind of code, widget, shortcode, etc. running on your post pages that’s connected with Events Manager?

    I also have this error. I just updated to the latest version of the plugin, i have the latest version of wordpress, i disabled every other plugin and confirmed it was events manager. Here are the steps to recreate if the error is displayed.
    1) Disable Events Manager (error still displayed)
    2) Change permalinks from Post Name to Plain
    3) Save (error gone)
    4) Change permalinks from Plain to Post Name (Error still gone)
    5) Enable Events Manager (Error Reappears)
    If Events Manager is left enabled and permalinks are switch from Post Name to Plain the error goes away, but if they are set back to Post Name and Events Manager is still enabled the error will persist. Hope this helps, let me know what else i can test.

    I was able to resolve this by resetting the Permalink slugs in the Events Manager settings.

    @codescout89 Thanks, this info might be of help.

    @totalgeeks As @codescout89 mentioned, it would be worth checking what you have set under Events > Settings > Pages > Permalink Slugs.

    Thread Starter totalgeeks

    (@totalgeeks)

    Hi guys, this is very helpful indeed.

    I did have a widget appearing on all posts which showed upcoming events. When I removed the widget, the error seems to disappear. But that’s not a practical solution for me, as the widget is a big feature of what I’m doing with the plugin!

    @codescout89 That info is hugely helpful – I will try fiddling with the permalinks and get back to you both to see if this resolves it!

    Thread Starter totalgeeks

    (@totalgeeks)

    Okay, I’ve given this a try and it ‘s not exactly the result I hoped.

    As I said, when I remove the sidebar widget, I don’t get the error on publishing posts.
    With the widget back in place, the error happens every time I publish a post. Changing the events permalinks (or just saving them) does get rid of the error when it’s already present as it essentially flushes the permalinks. But as soon as I publish another post, the error returns, and flushing permalinks (or flushing the rewrite rules) is the only way to get rid of the error.

    I’m having the same issue, exactly as you’ve both described. Would really like a permanent fix to this as it’s a client’s website so I can’t exactly tell them to flush their permalinks each time they want to post an event…

Viewing 15 replies - 1 through 15 (of 24 total)
  • The topic ‘Events Manager creates error Warning: preg_match() on new posts’ is closed to new replies.