[Plugin: Google Analytics for WordPress] Bug in application
-
When we push our wordpress site from our staging server to our production server, this app causes the site to crash with a PHP error.
The error is:
PHP Fatal error: Call to a member function set_defaults() on a non-object in /Volumes/Code/web/website/wp-content/plugins/google-analytics-for-wordpress/googleanalytics.php on line 1517
Line 1517 is the $ga_admin->set_defaults(); in the block below.
$options = get_option('Yoast_Google_Analytics'); if (!is_array($options)) { $options = get_option('GoogleAnalyticsPP'); if (!is_array($options)) { $ga_admin->set_defaults(); } else { delete_option('GoogleAnalyticsPP'); if ($options['admintracking']) { $options["ignore_userlevel"] = '8'; unset($options['admintracking']); } else { $options["ignore_userlevel"] = '11'; } update_option('Yoast_Google_Analytics', $options); } } else {
The problem is that $ga_admin is undefined at this point. Adding
$ga_admin = new GA_admin;
solves that problem but I’m not sure if this was the original author’s intent for this code.My other question is why doesn’t the get_option function return the options that are in the table? Is it somehow tied to the baseurl of the site?
My current push procedure involves dumping the wordpress database, replacing the URLs with sed and then loading the site on the production server. This seems to work for everything but this plugin.
Is there a better way to push between a staging and production server?
Thanks,
Marc Runkel
http://wordpress.org/extend/plugins/google-analytics-for-wordpress/
- The topic ‘[Plugin: Google Analytics for WordPress] Bug in application’ is closed to new replies.