Support » Fixing WordPress » [Plugin: W3 Total Cache] Call to Undefined Function after Update

  • Resolved Sarah F

    (@gamingexamier)


    Ever since the update i am getting this error over and over again, almost every 3 seconds. I’m not too green with code but this i can not figure out at all. Can anyone help?

    [28-Aug-2011 01:49:30] PHP Fatal error: Call to undefined function w3_url_format() in /home/gamingex/public_html/wp-content/plugins/w3-total-cache/lib/W3/Plugin/PgCacheAdmin.php on line 213

    http://wordpress.org/extend/plugins/w3-total-cache/

Viewing 15 replies - 1 through 15 (of 16 total)
  • I have exactly the same problem. I upgraded minutes ago to v0.9.2.4 and I already have 3 error messages in my (always empty) error_log :

    [28-Aug-2011 16:56:51] PHP Fatal error:  Call to undefined function w3_url_format() in /home/USERNAME/public_html/wp-content/plugins/w3-total-cache/lib/W3/Plugin/PgCacheAdmin.php on line 213
    [28-Aug-2011 17:18:39] PHP Fatal error:  Call to undefined function w3_url_format() in /home/USERNAME/public_html/wp-content/plugins/w3-total-cache/lib/W3/Plugin/PgCacheAdmin.php on line 213
    [28-Aug-2011 17:34:28] PHP Fatal error:  Call to undefined function w3_url_format() in /home/USERNAME/public_html/wp-content/plugins/w3-total-cache/lib/W3/Plugin/PgCacheAdmin.php on line 213

    I hope this gets corrected as soon as possible.

    Well, I am not a PHP expert, but this should solve the problem. Open the problematic PgCacheAdmin.php, and after the line :

    require_once W3TC_INC_DIR . '/functions/rule.php';

    add :

    require_once W3TC_INC_DIR . '/functions/url.php';

    and cross your fingers 🙂

    thank you tgeorge! seems to have solved it

    My logs were swamped, thanks tgeorge for the solution 🙂

    that did the trick. amazing how quickly that one error can turn into a 600 MB error log in 24 hours!

    Thanks so much tgeorge!

    Hmm I’m adding this to my post about W3T… it actually just gave me a weird issue today, which I resolved already. These support forums are really irreplaceable. Thanks for the info! 🙂

    Mike

    (@maddogmike)

    I just started getting these errors, too, starting a couple of days ago.

    1.) How could this error just pop-up on it’s own out of nowhere, after having this version of W3TC installed and running fine for months?
    2.) I worry about modifying the plugin files. Is this a known issue in W3TC? I wonder if the author agrees with this fix. (Frederick, are you out there?)

    thanks,
    Mike

    This looks like a completely valid fix to me. 😉

    This fix makes sense because the w3_url_format function is defined in the /functions/url.php file. The only thing i did slightly differently was to add the require_once right above the foreach array, but of course anywhere in the file is the same thing. Nice one tgeorge. 😉

    /**
             * Make HTTP requests and prime cache
             */
            require_once W3TC_INC_DIR . '/functions/http.php';
    		require_once W3TC_INC_DIR . '/functions/url.php';
    
            foreach ($queue as $url) {
                $url = w3_url_format($url, array('w3tc_preload' => 1));
    
                w3_http_get($url);
            }
        }

    If you try Development version this should be fixed there. http://wordpress.org/extend/plugins/w3-total-cache/download/

    Stupid question but where is the “PgCacheAdmin.php”?

    /plugins/w3-total-cache/lib/W3/Plugin/PgCacheAdmin.php

    Thank you ATIpro

    Issue is more than 9 months old and not fixed officially yet? I still get these errors. I hope the fix mentioned above is the right one

    Doesnt look like this fix has been posted to the latest release. i just added it to my W3 plugin

    Thanks for this – fixed my “missed schedule” problem.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘[Plugin: W3 Total Cache] Call to Undefined Function after Update’ is closed to new replies.