• Resolved ryanbaron

    (@ryanbaron)


    I installed the plugin, then went to the settings and checked:
    Initialize GeoIP checking this will do the initial install of Country/IP look up files from Maxmind (it takes < 1 second).
    along with checking
    Update data files now, and add to WP scheduler for auto update every 3 weeks
    and saved

    Then I checked: Check this box to set Cookie Notice to only display its cookie bar for these countries and this error is occurring
    Warning: stristr():Empty needle in wp-content/plugins/category-country-aware/cca_textwidget.php on line 400

    this code: $cca_ISOcode = CCAgeoip::do_lookup(‘ccode’); seems to be returning an empty string.

    Thanks for the help.

    Ryan

    • This topic was modified 7 years, 4 months ago by ryanbaron.
    • This topic was modified 7 years, 4 months ago by ryanbaron.
    • This topic was modified 7 years, 4 months ago by ryanbaron.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author wrigs1

    (@wrigs1)

    Hi Ryan,
    Sorry for the delay in response – notifications from this forum are going don’t go to my main email and worse yours ended up in Yahoos Bulk Mail (spam folder)(I’ll see if I can change that later). Edit: DONE – support forum notifications now go to my main email.

    Thanks for all the info – from the detail provided I’ll assume you are technical and are using Maxmind not Cloudflare. My rushed thoughts are that Maxmind data failed to install possibly due to file/dir permissions – but this should have displayed a warning.

    Go to CCA settings (Dashboard->settings->Category Country Aware Goodies
    Select the Country Tab. You should see info like this:

    Maxmind Directory: “/home/acc/public_html/wp-content/cca_maxmind_data/”
    File “GeoIP.dat” last successfully updated : July 30 2017 07:40:33.
    File “GeoIPv6.dat” last successfully updated : July 30 2017 07:40:33.

    Can you let me know the details. (but don’t show your dir structure prefix before “public_html” bit) If a directory is displayed can you check whether it exists and contains the files.

    Andy

    • This reply was modified 7 years, 4 months ago by wrigs1.
    • This reply was modified 7 years, 4 months ago by wrigs1.
    Plugin Author wrigs1

    (@wrigs1)

    If Maxmind files are present, then another possibility is that the check (which uses standard PHP validation) for whether your server is IPv4 or IPv6 is failing (it should be one or the other!). An online IP 6 checker should tell you.

    IF you are familiar with PHP see Line 292:

    if( filter_var($visitorIP, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) ) {
         $geoIPdb = 'GeoIP.dat';
    } elseif ( filter_var($visitorIP, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) ) {
        $geoIPdb = 'GeoIPv6.dat';}
    else return '';

    Editing plugins in situ can bring your site down. But if you know whether your server is using IPv4 or 6, and are confident you can solve problems then you could try commenting out the above and add a new line (let me know if it works):
    “$geoIPdb = ‘GeoIP.dat’;” for (IPv4) OR
    “$geoIPdb = ‘GeoIPv6.dat’;” if you are IPv6

    From your post I’m assuming you know PHP. If not, no worries just let me know whether files are present, whether server is IP 6 and also your website address if you are happy to disclose it.

    Andy

    Plugin Author wrigs1

    (@wrigs1)

    Unfortunately no more info from poster. Likely cause: failure to identify valid visitors IP address.

    The new version (1.1.0) of this plugin checks additional server variables for a valid IP. Additionally Admin Panel CCA settings now includes a checkbox (under the “Testing” tab) to list values contained in a variety of Server variables. This should provide useful info in any future support requests.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Empty needle error’ is closed to new replies.