WordPress.org

Ready to get started?Download WordPress

Forums

Google Analytics for WordPress
Google Analytics - checking for existance of W3TC functions before use (10 posts)

  1. markkelnar
    Member
    Posted 3 years ago #

    In plugin http://yoast.com/wordpress/google-analytics/, wouldn't it be better code practice to check for the existance of each of the w3tc_ functions individually before calling them.

    if ( function_exists('w3tc_pgcache_flush') ) {
    w3tc_pgcache_flush();
    w3tc_dbcache_flush();
    w3tc_minify_flush();
    w3tc_objectcache_flush();
    $cache = ' and W3TC Caches cleared';
    } else if ( function_exists('wp_cache_clear_cache') ) {
    wp_cache_clear_cache();
    $cache = ' and WP Super Cache cleared';
    }

  2. Joost de Valk
    Member
    Plugin Author

    Posted 2 years ago #

    Why would that be an issue? If the first exists, W3TC is loaded and all should normally exist?

  3. Joost de Valk
    Member
    Plugin Author

    Posted 2 years ago #

    Anyway, I'll check my code. Next time, try and be nice :)

  4. Aaron Brazell
    Member
    Posted 2 years ago #

    No, Joost. That's not how it works. W3TC is modular and you can load all or some of it.

    Yes the function_exists() verifes that the plugin is active, but the pgcache, dbcache, minify and objectcache stuff can all be turned on or off selectively.

  5. Joost de Valk
    Member
    Plugin Author

    Posted 2 years ago #

    I'll fix, next time, please drop me an email if you're having issues on your setup.

  6. Aaron Brazell
    Member
    Posted 2 years ago #

    That's what a support forum is for. :P

  7. Joost de Valk
    Member
    Plugin Author

    Posted 2 years ago #

    Well, not if you have a relationship were you could have just emailed me.

  8. Aaron Brazell
    Member
    Posted 2 years ago #

    "Well, yes, until you go out and tell people my stuff doesn't work before getting a reply."

    I have no idea what you're on about. Really very confused. As far as I know, Mark posted that one post above... and that's it until you responded today. So I'd highly recommend you actually email me before causing a scene. You have my contact info.

  9. Joost de Valk
    Member
    Plugin Author

    Posted 2 years ago #

    just reached out on Skype. Let's talk.

  10. markkelnar
    Member
    Posted 2 years ago #

    No harsh tone intended. Glad we were able to come together to resolve the issue.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic