Hi Neil,
I hope you are well today and thanks for posting on the forum.
Are you using the following Google Analytics Dashboard for WP plugin?
https://wordpress.org/plugins/google-analytics-dashboard-for-wp/
I have tested it on my site using latest version of the above plugin and gor the following error message.
Fatal error: Cannot redeclare class Google_Utils in wp-content/plugins/google-analytics-dashboard-for-wp/tools/src/Google/Utils.php on line 26
The error message is appearing because both Appointments and Google Analytics Dashboard for WP plugins are using common class names like Google_Utils from the built in library but the Google Analytics Dashboard for WP plugin doesn’t check whether the class exists before declaring it which we check for our Appointments plugin as following.
if ( !class_exists( 'Google_Utils' ) ) {
class Google_Utils {
To resolve this issue you have to either add this type of conditions for the conflicting classes in the Google Analytics Dashboard for WP plugin files or contact the plugin author to add it.
Best Regards,
Vinod Dalvi
Thank you for your reply. I switched SEO plugin to work around the issue..
The Yoast SEO works with Appointment plugin..
Neil
Hi Neil,
Awesome, great to see you got that fixed.
You are most welcome here, if i can be of any further assistance please don’t hesitate to ask 🙂
Have a fantastic day!
Cheers,
Vinod Dalvi
FYI @wpmudev-support1: Actually, you are using an old beta version of this library. You guys should update to latest stable version and use autoload, see:
https://github.com/google/google-api-php-client/blob/master/src/Google/autoload.php
and here are some additional things to consider:
https://github.com/google/google-api-php-client/pull/447
Hello Alin, I would like to use your plugin on my WP site but the conflict still exists with Appointment+ plugin v1.4.8 from WPMUDEV,
I have asked WPMUDEV for a solution and they have responded with this comment below on their internal forum.
I hope you’re well today and thank you for your question!
I’ve run through the thread at wp.org and I must agree that the solution here is on Google Analytics Dashboard plugin developer’s side.
Take a look at this code please:
if ( !class_exists( ‘Google_Utils’ ) ) {
class Google_Utils {
This is taken out of Appointments+ code. What it does is a check if the “Google_Utils” class already exists. If it does, then it’s not created.
Since both plugins do use 3rd-party libraries this is a must here and leaving class’es existence unchecked is actually against the basic OOP rules.
As much as I’d love to give you a ready-to-use solution here, I think it would be good to insist on the other plugin’s developer to re-factor code and improve it.
As for outdated libraries. I think this is a good point here and I’ve passed it to a plugin developer so hopefully he’ll take it into account upon one of the nearest update releases!
Thank you for pointing this out!
Have a nice day!
Adam
Rate my support
Sat Jul 11 2015, 5:34:37 PM
If you have a comment or solution to this issue I’d greatly appreciate it.
Many thanks
Hey Adam,
Thanks for your feedback here 🙂
Have a great day!
Cheers,
Bojan