Post Pay Counter

The best way to pay authors on WordPress

  • Features
    • PRO version
  • Cart
    • Addons
  • Documentation
  • Support

Unconditionally loads out-dated Google SDK, breaking other plugins

by

› Forums › Post Pay Counter PRO › Support › Unconditionally loads out-dated Google SDK, breaking other plugins

We are based in Europe with a GMT+1/GMT+2 time zone - support replies may be delayed due to time zone differences with your country.

Tagged: analytics

  • This topic has 2 replies, 2 voices, and was last updated 11 years ago by Stefano.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • May 13, 2014 at 12:14 am #1173
    David Anderson
    Guest

    Hi,

    The Pro version of this plugin unconditionally (i.e. on every page load, every AJAX call, every CRON call) loads an old version of the Google SDK.

    post-pay-counter-pro.php unconditionally does require_once( ‘classes/ppcp_google_analytics_class.php’ ); – and that file does require_once ‘google-api-php-client/src/Google_Client.php’;

    The Google SDK loaded is also out of date. As a result, any other plugin that wants to load a current version of the Google SDK gets a fatal error.

    Solution: Please only load the Google SDK when it is needed. Do not load it on AJAX calls, or when WP_CRON is set, for example. Do not load it in the admin dashboard on settings pages for other plugins.

    Please see this link, which exactly describes the problem in another plugin which does exactly the same – http://wordpress.org/support/topic/dont-unconditionally-load-old-google-sdk – excapt that in Post Pay Counter Pro, there is no work-around.

    Many thanks,
    David

    May 14, 2014 at 9:14 am #1181
    Stefano
    Keymaster

    Hello,
    I am sorry that is happening, unfortunately I’m on holiday right now (attending IPSC 2014) and can’t look into the issue. I’ll be back on 18th, I can surely help you then.

    However, make sure you have the latest version. I remember putting a class_exists conditional statement some time ago to prevent this specifically. There may be some problems with that, but I remember putting it.

    I’ll check back on 18th, sorry for the delay!

    May 17, 2014 at 1:34 pm #1188
    Stefano
    Keymaster

    Hello,
    sorry for the delay.

    As far as I can see, the issue should have been solved as of version 1.11, which introduced the following in the the plugin’s Analytics class:

    if( ! class_exists( 'Google_Client' ) )
    	require_once 'google-api-php-client/src/Google_Client.php';
    if( ! class_exists( 'Google_AnalyticsService' ) )
    	require_once 'google-api-php-client/src/contrib/Google_AnalyticsService.php';

    Unless the class names are different then, it’s unlikely the root of the problem could be my plugin. Are you using the new beta?

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Unconditionally loads out-dated Google SDK, breaking other plugins’ is closed to new replies.

Your cart

Number of items in cart: 0

  • Your cart is empty.
  • Total: €0.00
  • Checkout

What are you looking for?

BEFORE POSTING

Before posting, please please please do have a look at our Documentation section. Your problem may be addressed there, allowing you to solve it without help from us :)

Copyright © 2025 · Centric Theme on Genesis Framework · WordPress · Log in