INN / Google-Analytics-Popular-Posts

A WordPress plugin that uses Google Analytics data to determine the most popular posts on your site and display a list of popular posts via the included widget.
https://wordpress.org/plugins/ga-popular-posts/
23 stars 7 forks source link

Adding stats_get_csv() to replace Jetpack stats #69

Open foliovision opened 7 years ago

foliovision commented 7 years ago

This is tricky:

1) 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.

2) 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.