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

Not one for queueing up? Get faster support with AdRotate Pro!
The forum is checked a few times per week. With AdRotate Pro you can get answers faster using email support.
More private, more direct and usually a solution within a day! Learn more »

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 3 weeks, 5 days ago.

  • #59628

    aberbenni
    Badges:

    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);
    }

    Works.

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

    As example see:

    https://www.justinsilver.com/technology/wordpress/w3-total-cache-fragment-caching-wordpress/

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

    https://www.w3-edge.com/solutions/w3-total-cache-pro/

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

    https://github.com/Auctollo/w3-total-cache/wiki/FAQ:-Developers

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

    #59663

    Arnan
    Badges:

    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.

    #59742

    aberbenni
    Badges:

    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.

    #59757

    Arnan
    Badges:

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

    #59828

    aberbenni
    Badges:

    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.