WordPress.org

Ready to get started?Download WordPress

Forums

Easy AdSense
Easy Adsense Lite and Jetpack (2 posts)

  1. Michael Adams (mdawaffe)
    Member
    Posted 1 year ago #

    Hi,

    I work at Automattic/WordPress.com, and we've received a couple reports that Jetpack is causing problems with your Easy Adsense Lite plugin.

    I'm reasonably sure the problem is that, under certain configurations, Jetpack will call get_the_excerpt() (which applies the the_content filter) prior to any posts being displayed. That ends up incrementing the EzAdSense::$ezCount variable, which can prevent the Easy Adsense ads from showing up in posts if that variable gets incremented past the EzAdSense::$ezMax limit.

    It might be possible to fix this issue in our Jetpack plugin, and we're looking into it, but I've thought of a couple options that may increase your plugin's compatibility with other plugins (and themes).

    The first: https://gist.github.com/4273896

    Only output ads for posts in the loop. If a plugin or theme calls the_content outside of the loop, no ad will be output (and the incrementor won't increment).

    The second: https://gist.github.com/4273972

    When Jetpack calls get_the_excerpt() on a post with no excerpt, WordPress automatically generates an excerpt from the post's content (via the the_content filter). This patch prevents ads from showing up (and the incrementor from incrementing) in these generated excerpts.

    It seems like the first patch is probably more useful for you.

    As I said, we're looking into fixing this in Jetpack, but wanted to pass these thoughts along to you in any case.

    http://wordpress.org/extend/plugins/easy-adsense-lite/

  2. manojtd
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for the suggestions. I will implement one of them and make a release in a day or so.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags