• Resolved jstneti

    (@jstneti)


    Hi there,

    The plugin was working fine so far.
    All I did yesterday, was to clean expired transients. No updates or anything else.

    Today 3 people have reported issues that they can’t login with the social login plugin we use and one of them sent a screenshot where it says ‘Warning: preg_match(): Unknown modifier ‘4’ in …/plugins/user-login-history/admin/class-user-login-history-user-tracker.php on line 142′ and ‘Warning: preg_match(): Unknown modifier ‘c’ in …/plugins/user-login-history/admin/class-user-login-history-user-tracker.php on line 142′. And then some other warning ‘Cannot modify header information – header already sent by (output started at …/plugins/user-login-history/admin/class-user-login-history-user-tracker.php:142) in …/wp-includes/pluggable.php on line 1210’.

    Do you know why this would happen all of the sudden?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Faiyaz Alam

    (@faiyazalam)

    Hi @jstneti

    Please replace the following code:

    if (preg_match("/$pattern/i", $user_agent)) {
                    return $browser;
                }

    with this one:

    if (preg_match("@$pattern@i", $user_agent)) {
                    return $browser;
                }

    and let me know if any issue.

    Plugin version: 1.4.1
    File path: wordpress\wp-content\plugins\user-login-history\admin\class-user-login-history-user-tracker.php

    Thanks.

    Thread Starter jstneti

    (@jstneti)

    Hi,

    Thanks for the answer, but honestly I can’t test this as I can’t reproduce the error (it’s been reported by 3 users in 1 day and then we’ve disabled the plugin) and can’t have this on a live site for users to get a possible error.

    Do you happen to know why this only happened to some users and why none of our team with different devices and browsers can’t reproduce it?

    Thanks and have a great weekend,
    Vale

    Plugin Author Faiyaz Alam

    (@faiyazalam)

    @jstneti

    I am also unable to reproduce the error.
    I think that the error is due to delimeter.
    In some regex I used “/” and used the same delimeter i.e. “/” in the function “preg_match”.
    To fix this, either we can escape “/” or can use different delimiter e.g. “@”.
    So, I request you to test the above code with delimeter “@” either on live site or staging site.
    I am sure that this will fix the error.

    Thanks.

    Thread Starter jstneti

    (@jstneti)

    The fix would probably work, but I got the order not to try it out on the live site (can’t reproduce it on staging) and just return ‘Unknown’ at the start of that function – since this info is not of big importance for us.

    Thanks anyways for all your help ??

    Plugin Author Faiyaz Alam

    (@faiyazalam)

    Thanks bro.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Sudden error when using it with a social login plugin’ is closed to new replies.