Google-Analytics-Popular-Posts
Google-Analytics-Popular-Posts copied to clipboard
Adding stats_get_csv() to replace Jetpack stats
This is tricky:
- if stats_get_csv() is not defined yet, it’s effectively replaced by fv_ga_stats_get_csv() which we did here. However if JetPack plugin is loaded before this plugin, it won’t be replaced.
However that function is in a JetPack module so perhaps it never loads with the plugin, but later on once JetPack reads its options.
- it uses “option_jetpack_active_modules” filter to disable JetPack stats module if it’s active to make sure if won’t try to redefine the stats_get_csv() function.
This whole code could be changed to an option, or it could first check if JetPack is indeed not active.