WordPress.org

Ready to get started?Download WordPress

Forums

Cookie Law Info
[resolved] 404 because of non-existent settings.background_url (12 posts)

  1. Stefan Boonstra
    Member
    Posted 1 year ago #

    Hi,

    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,
    Stefan

    http://wordpress.org/extend/plugins/cookie-law-info/

  2. Remco Tolsma
    Member
    Posted 1 year ago #

    Is there any news on this issue? This issue is causing some serious hosting issues on some of the larger WordPress websites we maintain.

  3. Remco Tolsma
    Member
    Posted 1 year ago #

    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:

    http://plugins.trac.wordpress.org/browser/cookie-law-info/tags/1.0.1/js/cookielawinfo.js#L21

  4. richardashby
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  5. Remco Tolsma
    Member
    Posted 1 year ago #

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

    http://domain.tld/page/undefined

    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.

    http://plugins.trac.wordpress.org/browser/cookie-law-info/tags/1.0.1/js/cookielawinfo.js#L21

    Thanks for the fix:

    http://plugins.trac.wordpress.org/browser/cookie-law-info/tags/1.0.3/js/cookielawinfo.js#L19

  6. richardashby
    Member
    Plugin Author

    Posted 1 year ago #

    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.

    Thanks

  7. Remco Tolsma
    Member
    Posted 1 year ago #

    Maybe it depends on if you use permalinks:
    http://codex.wordpress.org/Using_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.

    Source: http://theme.fm/2011/11/wordpress-internals-the-rewrite-api-2684/

    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.

    Source: http://wp.smashingmagazine.com/2012/09/12/secrets-high-traffic-wordpress-blogs/

  8. Martijnchel
    Member
    Posted 1 year ago #

    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.

  9. richardashby
    Member
    Plugin Author

    Posted 1 year ago #

    What's the URL?

  10. Martijnchel
    Member
    Posted 1 year ago #

    tabletsmagazine(.)nl
    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).

  11. richardashby
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  12. Martijnchel
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic