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

Make it possible to donate to plugin creators from within piwik #8561

Merged
merged 4 commits into from Aug 26, 2015

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Aug 12, 2015

As discussed at the meetup in Berlin we should make it possible to donate to plugin creators directly from within Piwik.

I've updated the list of plugins (within the piwik admin) to show an additional text if there are donation possibilities available:

image

Clicking on the link opens a small popover, showing all available possibilities.

image

Any suggestions / thoughts for improvements?
Guess the displayed text could be improved, maybe someone has a good suggestion for a better wording?!

@sgiehl sgiehl added Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. RFC Indicates the issue is a request for comments where the author is looking for feedback. labels Aug 12, 2015
@tsteur
Copy link
Member

tsteur commented Aug 13, 2015

I haven't tested it, only had a quick look at the code and looks good. Also like the idea of displaying it in the app

<p>{{ 'CorePluginsAdmin_ConsiderDonatingCreatorOf'|translate("<b>" ~ name ~ "</b>")|raw }}</p>
<div class="donation-links">
{% if plugin.info.donate.paypal is defined and plugin.info.donate.paypal %}
<a class="donation-link paypal" target="_blank" href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&item_name=Piwik%20Plugin%20{{ name|escape('url') }}&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted&business={{ plugin.info.donate.paypal|escape('url') }}"><img src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" height="30"/></a>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for privacy, we should not load resources from outside of Piwik - can you bundle the paypal image in Piwik?

(same with Flattr image)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Will move that images to piwik

@mattab
Copy link
Member

mattab commented Aug 13, 2015

Great idea @sgiehl - I put couple comments, otherwise good to merge

@mattab
Copy link
Member

mattab commented Aug 14, 2015

Re; bitcoin, alternatively you could just show the bitcoin address and users could copy paste it to send money to?

@sgiehl
Copy link
Member Author

sgiehl commented Aug 15, 2015

@mattab I've changed the bitcoin stuff. I've updated the screenshot in the PR description above.
Do you have suggestions to improve the text? Otherwise guess we could merge!

@sgiehl sgiehl added Needs Review PRs that need a code review and removed Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. RFC Indicates the issue is a request for comments where the author is looking for feedback. labels Aug 15, 2015
@MagicFab
Copy link

Bitcoin could be specified in one of two ways:

It is against best practices to reuse a single address but possible (and may be used for any of many valid reasons). Bitcoin payment processors take care of generating a new address, forwarding/converting payments, etc.

When clicking a Bitcoin URI it will open the local Bitcoin app for payment if one is installed (for example Electrum).

I can test this if/when implemented.

@sgiehl
Copy link
Member Author

sgiehl commented Aug 16, 2015

@MagicFab Plugin developers can set exactly one bitcoin address per plugin, so we need to use that one.
I don't have an account at bitpay.com, but I guess it's mostly like coinbase.com. Problem with that is, we do not want to include external javascripts. So I guess using the bitcoin uri might be the best solution for now.

@MagicFab
Copy link

@sgiehl ok, using a single Bitcoin address is fine.

Adding the possibility to have a direct URL link to self-shoted pages or to service like Bitpay does not require Javascript, however. It's a direct link, just like the current Paypal / Flatter links.

@mnapoli mnapoli added this to the 2.15.0 milestone Aug 19, 2015
@sgiehl
Copy link
Member Author

sgiehl commented Aug 20, 2015

@MagicFab not sure if I got you wrong, that would require to let the user define the full URL to their bitcoin donation page. Guess it should be possible to check if the value is a full url or a bitcoin address and handle the link according to that.

@mattab what do you think about that?

@mattab
Copy link
Member

mattab commented Aug 20, 2015

@sgiehl sounds good to me if bitcoin can be either a bitcoin address, or a URL to a custom bitcoin donate page. btw let's also mention this possibility in the dev guide in http://developer.piwik.org/guides/distributing-your-plugin#prepare-your-plugin

@sgiehl
Copy link
Member Author

sgiehl commented Aug 20, 2015

@mattab ok. do we have any validation checks on the marketplace for the value of the donation fields?

@mattab
Copy link
Member

mattab commented Aug 20, 2015

Good point! I just found this code:

            if (empty($donate['bitcoin'])
                || !ctype_xdigit($donate['bitcoin'])
                || strlen($donate['bitcoin']) < 10
                || strlen($donate['bitcoin']) > 100) {
                $donate['bitcoin'] = null;
            }

so URLs will not work in the bitcoin field!

Could you get in touch with Thomas to discuss/have this changed?

@sgiehl
Copy link
Member Author

sgiehl commented Aug 20, 2015

Hm... on the other hand I'm not sure if it would really be good to link to a custom URL. That would allow users to inject "bad" links in piwik and the marketplace. Maybe it would be better to whitelist some urls (domains), but I don't know which services might be good to whitelist

@sgiehl
Copy link
Member Author

sgiehl commented Aug 23, 2015

@mattab: I'd suggest to leave it as it is for now. Maintaining kind of a whitelist for serious bitcoin donation service does not really seem to be a good option.. So guess we can merge, if the wording is fine for you.

@mattab
Copy link
Member

mattab commented Aug 26, 2015

Nice change!

mattab pushed a commit that referenced this pull request Aug 26, 2015
Make it possible to donate to plugin creators from within piwik
@mattab mattab merged commit fdf3561 into master Aug 26, 2015
@sgiehl sgiehl deleted the plugin_donation branch September 16, 2015 15:09
@mattab mattab added the Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. label Oct 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants