Skip to content
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

Developer doc: build very simple example plugins #5700

Closed
mattab opened this issue Jul 6, 2008 · 9 comments
Closed

Developer doc: build very simple example plugins #5700

mattab opened this issue Jul 6, 2008 · 9 comments
Assignees
Labels
Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. worksforme The issue cannot be reproduced and things work as intended.

Comments

@mattab
Copy link
Member

mattab commented Jul 6, 2008

It’s hard to write a good developer documentation. Examples are easier to understand and to maintain. We will write a number of plugins, that each uses one feature of Piwik:
- ExampleDBAccess
- ExampleFeedburner
- ExampleWidget
- ExampleEditMenu
- Other features to cover in example plugins: API, plotting data, recording new data in new db table, running tests, using a config file, using the “option” mechanism, etc.

Then we would:
- build a wiki page listing all the Example plugins
- print their quick description
- link to their source code

Examples of other open source project plugin documentation
\* writing a plugin http://codex.wordpress.org/Writing_a_Plugin
\* plugin api http://codex.wordpress.org/Plugin_API
\* mediawiki plugin hooks http://www.mediawiki.org/wiki/Manual:Hooks

Ideas of simple useful plugins
- “You have X websites and Y users registered in Piwik. You are using Piwik A.B version.”
- “Featured user” that randomly picks a use case from our use case base.
- “Piwik has been downloaded N times.”

Technical notes:
\* content loaded from piwik.org via highly cached proxy pages
\* if piwik.org is down, should not affect loading time of dashboard
\* have one widget for general purpose content (Piwik has been downloaded X times)

@gka
Copy link
Contributor

gka commented Aug 18, 2010

I added two new widgets in changeset 2958

  • "You have X websites and Y users registered in Piwik. You are using Piwik A.B version."
  • "Piwik has been downloaded N times."

They demonstrate simple database queries and a remote API call to demo.piwik.org (via jquery ajax request). Both widgets use templates.

@halfdan
Copy link
Member

halfdan commented Aug 18, 2010

greg: You forgot to check in the en.php - both widgets appear but their translations are missing.

@mattab
Copy link
Member Author

mattab commented Nov 23, 2010

We should also have the documentation point to ExampleUI plugin

@mattab
Copy link
Member Author

mattab commented Nov 23, 2010

It would be nice to document how plugins can create new sections in the config file.

Something like this (but finding a way not to call the __destruct would be better)

$config = Zend_Registry::get('config');
$config->MobileAnalytics = array("TeraWurflURL"=>"unconfigured");
$config->__destruct();
Piwik::createConfigObject();

I'm not sure why it wasn't working before, but this works great now.
Result:

[MobileAnalytics]
TeraWurflURL = "unconfigured"


@robocoder
Copy link
Contributor

Agree. Planning a cleaner config writer should already be in #1713.

@mattab
Copy link
Member Author

mattab commented Nov 24, 2010

Also, while writing dev doc, I recommend going through the config.ini.php settings to find out which ones could be of interest to the Piwik plugin developer (I'm thinking eg. disable_merged_assets, track_visits_inside_piwik_ui, always_archive_* etc.)

@julienmoumne
Copy link
Member

The new general layout of the documentation is now in place (piwik.org/docs).

Plugin guides are part of the new organization but are yet to be written. The proposed list is :

Development Guides
Basic architecture
Adding a widget
Use Smarty templates
Accessing the database
Editing the menu
Using Piwik's API
Plotting Data
Recording new Data
Adding options in config.ini

@julienmoumne
Copy link
Member

Should include guide :
Internationalization and localization
See forum post

@mattab
Copy link
Member Author

mattab commented Mar 11, 2013

Mostly we have such simple plugins now. The docs are still missing but will be covered in separate plugin. For latest docs on plugin development see: http://new.piwik.org/docs/plugins/

@mattab mattab added this to the Community and Marketing milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. worksforme The issue cannot be reproduced and things work as intended.
Projects
None yet
Development

No branches or pull requests

5 participants