Support » Plugin: Cookie Law Info » 404 because of non-existent settings.background_url

  • Resolved Stefan Boonstra



    We ran into a 404 error caused by the Cookie Law Info plugin’s ‘cookie-law-info-bar’. For this element, a background is set by javascript to an undefined page.

    ‘settings.background_url’, on line 21 in ‘js/cookielawinfo.js’, is never defined and will therefore always cause a 404 error.

    It would be great if this could be fixed. Many thanks in advance.

    Best regards,

Viewing 11 replies - 1 through 11 (of 11 total)
  • Is there any news on this issue? This issue is causing some serious hosting issues on some of the larger WordPress websites we maintain.

    This issue can cause some serious performance issues, so it would be nice if it could be fixed asap. For now we fixed it by commenting the following line of code:

    Plugin Author Richard


    Fixed in the next release

    I saw your comment in your review re: WordPress 404 routine being invoked. I may be wrong, but I really don’t think that’s actually the case, the offending line of code is called after WP generates the page.

    Anyway, fixed, thank you for your comments which were helpful, and I hope your site is going well. All the best.

    An browser will request the background image, beceause the backound URL was not defined it will request an URL like:


    On those URL’s are normally not posts published, so an 404 page will be returned instead.

    Through this the WordPress 404 routine will be invoked and this is was causing some serious performance issues. You could easily see this by activating Firebug.

    I hope you now realize what kind of impact such an issue can have on an the performance of an website.

    Thanks for the fix:

    Plugin Author Richard


    Hi Remco

    I’m not doubting the 404 on the resource being called which as you say, is easy to see in Firebug. The bit I’m not sure on (and I’m quite prepared to be wrong on) is that a ‘WordPress 404 routine’ is called. The JavaScript runs after WP generates the page, so the 404 is logged in the browser (visible in Firebug) and doesn’t get routed through WP.

    Either way, it’s fixed now so there’s little point in debating. But for my reference, do you have a reference to the wordpress codex on the 404 routine and how it is called? Would be interested to read up on it.


    Maybe it depends on if you use permalinks:

    If you use permalinks i believe all front-end request are handled by WordPress.

    All front-end requests for pages are usually handled by WordPress index.php, it takes care of initializing all of WordPress and returning the page that was requested in a nice and clean response.


    External referrers will link to pages on your website that don’t exist anymore. If a WordPress 404 page is loaded every time, then you’re doing work that can be avoided. Generating a 404 page can be heavy, so it needs to be cacheable in Varnish as well.


    Don’t know why but i’m still getting the /undefined problem on a lot of pages, also after updating en clearing all cache files.

    Plugin Author Richard


    What’s the URL?

    I have set them to a 301 redirect now and the number of hits seems to be declining, maybe Google cache?
    I have 264 hits on /undefined so far this evening (from 2.500 views).

    Plugin Author Richard


    I see plenty of warnings/errors in the Firebug console but none generated by cookie law info (some CSS parse warnings for the webkit declarations, but these don’t cause 404s). Also, it works fine on Firefox and Chrome for me, checked the console in both. I checked the source and you have the latest script which removes the line of code calling the non-existent resource.

    Well.. every website has it’s warnings 🙂
    But, you’re right, nothing seems to cause it. That’s why it’s weird that the problem is still there in some cases.
    Thanks voor your analysis.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘404 because of non-existent settings.background_url’ is closed to new replies.