With W3 Total Cache AdRotate output is echo adrotate_group(X, 0, 0, 0);

Home Forums AdRotate for WordPress General Support With W3 Total Cache AdRotate output is echo adrotate_group(X, 0, 0, 0);

This topic contains 4 replies, has 2 voices, and was last updated by  aberbenni 6 months ago.

  • #59628


    Reported from https://wordpress.org/support/topic/with-w3-total-cache-adrotate-output-is-echo-adrotate_groupx-0-0-0/

    WordPress 4.9.8
    AdRotate 4.13.3

    Following instructions on https://ajdg.solutions/manuals/adrotate-manuals/caching-support/ my settings are:

    – In General Settings Page Caching is Disk: Basic.
    – In Page Cache/Advanced Late Initialization is Enabled.
    – Tried with Minify off.
    – Tried with Minify on and ‘mfunc’ in the ignored comment stem field.
    – in wp-config.php i have: define('W3TC_DYNAMIC_SECURITY', 'XxXxxxxxXXxXXXXXXXxXXXxxxXXxxxxx');

    Output in HTML is:

    <!-- mfunc XxXxxxxxXXxXXXXXXXxXXXxxxXXxxxxx -->
    echo adrotate_group(X, 0, 0, 0);
    <!-- /mfunc XxXxxxxxXXxXXXXXXXxXXXxxxXXxxxxx -->

    At line 61 of adrotate-widget.php I found this code:

    if($instance['type'] == "group") {
      echo 'echo adrotate_group('.$instance['adid'].', 0, 0, 0);';

    changing this to:

    if($instance['type'] == "group") {
      echo adrotate_group($instance['adid'], 0, 0, 0);


    Looking at other examples on the web I cannot find any trace of “double echo“, (echoecho adrotate_group()) is it necessary?

    As example see:


    <!--mfunc <?php echo W3TC_DYNAMIC_SECURITY; ?> -->
    echo 'The time is '.date( 'H:i:s', time() );
    <!--/mfunc <?php echo W3TC_DYNAMIC_SECURITY; ?> -->


    <!-- mfunc mycode -->
    echo somefunction();
    <!-- /mfunc mycode -->


    Example 2: <!-- mfunc mysecurestring -->any PHP code<!-- /mfunc mysecurestring -->
    Example 3: <!--mfunc mysecurestring -->echo rand();<!--/mfunc mysecurestring -->



    Hmm – Don’t really know. The Fragmented Caching feature in W3TC always has been vague and dodgy at best.
    I’ve tested it a bunch, sometimes it works as is, then suddenly people would report issues with it and the code in AdRotate has to be different… For no apparent reason.

    The current iteration, however, has worked for over a year as far as I know.

    As a test/experiment. In your setup. Can you try a shortcode and see if that works?
    Maybe that’ll shed some light on how that vs. widgets works and maybe gives a clearer picture of the issue.
    Shortcodes use the same method of output (based on the same manual), just through a different function.



    I have carried out some tests and I have discovered that the problem is caused by compatibility issues with a third plugin: Ginger – EU Cookie Law (https://it.wordpress.org/plugins/ginger/).

    It seems that this plugin blocks mfunc parsing before accepting cookies for not (yet) cached pages or pages that are excluded from cache.

    Reported here: https://wordpress.org/support/topic/compatibility-issues-with-w3-total-cache/

    There is no difference between shortcode and widget output.



    That’s a weird thing to interfere with. But ok…
    So it works now?



    Yes, disabling Ginger – EU Cookie Law everything works as expected.

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘With W3 Total Cache AdRotate output is echo adrotate_group(X, 0, 0, 0);’ is closed to new replies.

You may be interested in