-
-
Notifications
You must be signed in to change notification settings - Fork 853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugins can send usage data #1150
Conversation
return $data; | ||
} | ||
|
||
private function _add_plugin_usage_data(&$data){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be protected
I think the event name is not adhering to our naming scheme https://www.dokuwiki.org/devel:events_list#naming_structure. Though I am not 100% sure we have one for plugins. PLUGIN_POPULARITY_DATA_SETUP maybe? |
They just need to register to the PLUGIN_USAGE_DATA event, and then to add either a simple string, or an array of key / value. For example: function register(Doku_Event_Handler $controller) { $controller->register_hook('PLUGIN_USAGE_DATA', 'AFTER', $this, 'usage_data'); } function usage_data(&$event){ $event->data['my_plugin_name'] = 'my usage data'; //or: $event->data['my_plugin_name'] = array ('k1' => 'v1', 'k2' => 'v2'); }
ce02cbe
to
5875e53
Compare
Thanks for this feedback. Here is an update. |
Plugins can send usage data
The inspection completed: 1 updated code elements |
Thanks! I just documented this feature on https://www.dokuwiki.org/devel:plugin_programming_tips#sending_popularity_data |
Can you document the event also at https://www.dokuwiki.org/devel:event:PLUGIN_POPULARITY_DATA_SETUP |
Done |
They just need to register to the PLUGIN_USAGE_DATA event, and then to add
either a simple string, or an array of key / value. For example: