Making WordPress.org

Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#3202 closed enhancement (fixed)

Allow WordCamp organizers to activate/deactivate whitelisted plugins

Reported by: iandunn's profile iandunn Owned by: rmarks's profile RMarks
Milestone: Priority: normal
Component: WordCamp Site & Plugins Keywords: needs-patch needs-testing
Cc:

Description

There are several plugins installed on WordCamp.org that aren't network-activated, but that organizers occasionally want to activate on their sites. Currently, they have to request a member of the community team manually activate it for them.

WordPress 4.9 enhances the `activate_plugin` and `deactivate_plugin` capability checks to accept a specific plugin. That means we can now easily let organizers activate those plugins themselves.

Activating or deactivating any plugin not in in the whitelist should still require the manage_network capability.

Attachments (1)

3202-new-code.txt (1.1 KB) - added by RMarks 5 years ago.
This isn't a diff, but should be added to wordcamp's wcorg-misc.php in mu-plugins.

Download all attachments as: .zip

Change History (13)

#1 @coreymckrill
6 years ago

Good idea. Here's a tentative list of plugins that could be whitelisted:

  • campt-indian-payment-gateway/campt-indian-payment-gateway.php
  • camptix-kdcpay-gateway/camptix-kdcpay.php
  • camptix-mercadopago/camptix-mercadopago.php
  • camptix-pagseguro/camptix-pagseguro.php
  • camptix-payfast-gateway/camptix-payfast.php
  • camptix-trustcard/camptix-trustcard.php
  • camptix-trustpay/camptix-trustpay.php
  • camptix-mailchimp/camptix-mailchimp.php
  • polldaddy/polldaddy.php

#2 @iandunn
6 years ago

#3052 was marked as a duplicate.

#3 @iandunn
6 years ago

I'd like to leave Polldaddy off the list for now, since I think we can actually get rid of that. Jetpack has a shortcode for it, so it's just a matter of making sure that disabling it doesn't break old sites.

The organizer handbook has a list of the other plugins we'd want to whitelist.

#4 @RMarks
6 years ago

I'm interested in taking a stab at this. Should this be code in a new or existing plugin? Possibly a mu-plugin?

My approach would be to let any organizer with the admin role on a WordCamp site be able to activate or deactivate a plugin if on the list.

Per Corey and Ian's suggestions, plus three more I've found in the plugin repo (which I've bolded below), here are the list of plugins this should allow:

bbpress/bbpress.php
campt-indian-payment-gateway/campt-indian-payment-gateway.php
campt-instamojo-payment-gateway/camptix-instamojo.php
campt-razorpay-payment-gateway/camptix-razorpay.php
camptix-kdcpay-gateway/camptix-kdcpay.php
camptix-mercadopago/camptix-mercadopago.php
camptix-pagseguro/camptix-pagseguro.php
camptix-payfast-gateway/camptix-payfast.php
camptix-payment-payupaisa/camptix-payupaisa.php
camptix-trustcard/camptix-trustcard.php
camptix-trustpay/camptix-trustpay.php
camptix-mailchimp/camptix-mailchimp.php
edit-flow/edit_flow.php
liveblog/liveblog.php

#5 @coreymckrill
6 years ago

  • Owner set to RMarks
  • Status changed from new to assigned

@RMarks Cool! I'll make you the owner of this one. I personally think an mu-plugin would be the best approach here.

Regarding the additional three plugins you found:

  • camptix-instamojo.php and camptix-razorpay.php are deprecated in favor of campt-indian-payment-gateway.php
  • camptix-payupaisa.php isn't installed on WordCamp.org, and I suspect it is also deprecated, so I would probably leave it off the list at this point.

@RMarks
5 years ago

This isn't a diff, but should be added to wordcamp's wcorg-misc.php in mu-plugins.

#6 @RMarks
5 years ago

  • Keywords needs-testing added; good-first-bug removed

This ticket was mentioned in Slack in #meta-wordcamp by rmarks. View the logs.


5 years ago

#8 @iandunn
5 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 8013:

WordCamp Misc: Allow site admins to activate optional plugins.

Fixes #3202.
Props RMarks for the initial patch.

#9 @iandunn
5 years ago

Thanks for the patch Ryan. IIRC, we talked about re-mapping the (de)activate_plugin caps at the WCUS contributor day, but couldn't figure out how. I took another look at it, and got it working in r8013.

This ticket was mentioned in Slack in #community-team by iandunn. View the logs.


5 years ago

This ticket was mentioned in Slack in #meta-wordcamp by rmarks. View the logs.


5 years ago

This ticket was mentioned in Slack in #community-events by bph. View the logs.


5 years ago

Note: See TracTickets for help on using tickets.