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

Remove business plugins (cleanup of #3079) #3170

Merged
merged 4 commits into from
Feb 25, 2016
Merged

Conversation

Tug
Copy link
Contributor

@Tug Tug commented Feb 8, 2016

In the context of removing the eCommerce feature from the Business plan upgrade, the plugins page becomes available to Jetpack sites only. The "Plugins" menu entry is being removed on #3079

This PR removes references to plugins related to the Business plan (eCommerce plugins) and display the "Plugins not supported" page at /plugins/:site for all wp.com sites.

Testing instructions

  • git fetch -a && git checkout remove/business-plugins && make run
Test 1 (Wp.com)
  • Go to Calypso and select a wordpress.com site. Check that the Plugins menu is not displayed (because the site does not have any plugin not because Sidebar: Remove Plugins menu item for all sites except Jetpack ones #3079 changes are included in this PR)
  • Go to /plugins/:site and check that the "Plugins not supported" page is displayed
  • Go to /plugins/browse/:site and check that the "Plugins not supported" page is displayed
  • Go to /plugins/akismet/:site and check that the "Plugins not supported" page is displayed
  • Go to /plugins and check that only your jetpack sites are counted.
Test 2 (Jetpack, test that nothing broke)
  • Go to Calypso and select a jetpack site. Check that the Plugins menu is displayed
  • Go to the Plugins page and check that your plugins are all there
  • Try to install, activate, deactivate, remove a plugin, (and update if you have one which is not updated) it should work without any error
  • Back to the main Plugins page, click on the Edit All and try to bulk remove, bulk update, bulk activate bulk deactivate, bulk autoupdate and bulk disable autoupdate your plugins, it should work without any error

Code Review Instructions

  • Review first commit first and check that all mentions and related features of wpcom plugins were removed
  • Review second commit

Reviewing

  • Product Review
  • Code Review

cc: @fabianapsimoes @drewblaisdell @scruffian

@Tug Tug self-assigned this Feb 8, 2016
@Tug Tug added this to the Amber: Backlog milestone Feb 8, 2016
@Tug Tug force-pushed the remove/business-plugins branch from c321890 to 4dfa2aa Compare February 8, 2016 23:16
@Tug Tug force-pushed the remove/business-plugins branch 2 times, most recently from 359e8a7 to 5dfe4c6 Compare February 9, 2016 14:23
@fabianapsimoes fabianapsimoes removed this from the Amber: Backlog milestone Feb 11, 2016
@Tug Tug force-pushed the remove/business-plugins branch 4 times, most recently from 2e5defe to 6153696 Compare February 12, 2016 11:28
@Tug Tug added this to the Amber: Backlog milestone Feb 12, 2016
@Tug Tug added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] In Progress labels Feb 12, 2016
@scruffian
Copy link
Member

@Tug - one small piece of feedback - the first commit here could have been smaller, which would have made it easier to grok. Not a big deal, but just something to think about.

@Tug
Copy link
Contributor Author

Tug commented Feb 12, 2016

I tried to but all those changes are related and once you decide to remove a feature it isn't easy to group the changes into several commit or you end up with a broken version between each commits.
Anyway I understand how it might be a pain to review at the moment, I'll try harder next time ;)

@scruffian
Copy link
Member

These changes look good and work as expected. Its probably a good idea to have @drewblaisdell take a look too, since he knows this code better than me.

@drewblaisdell
Copy link
Contributor

👍 The changes look good and work as expected. I added two commits to remove some remaining .com plugins code.

These changes aren't complex, but touch many lines of code - @enejb or @lezama would probably be interested in looking at this.

@@ -52,10 +51,6 @@ module.exports = React.createClass( {
return null;
}

if ( ! this.props.wporg ) {
Copy link
Member

Choose a reason for hiding this comment

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

I haven't tested the code but I don't think this looks right.
A plugin can be a non .org plugin and still be visible in calypso.

The this.props.wporg indicated if a plugin is found in the .org repo or not.

Copy link
Contributor

Choose a reason for hiding this comment

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

yep, this is used for custom plugins, not for business ones

@enejb
Copy link
Member

enejb commented Feb 12, 2016

I haven't tested the code yet but it looks like some assumptions here are wrong.

There is a different between a not wporg plugin and a plugin that is found on .com.

A non wporg plugins is custom plugin that was build for the jetpack site that is not available for updates from .org. These plugins are often paid plugins for example. Sensei is one of them.

We currently don't support plugin updates and autoupdates for such plugins.

const { isWpCom } = this.props;
let options = [];
let actions = [];
const options = [];
Copy link
Contributor

Choose a reason for hiding this comment

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

wow, I didn't know you can push new elements in an array declared as constant! nice to know!

Copy link
Contributor

Choose a reason for hiding this comment

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

:) Yeah, the difference between const and let is related to assignment, not mutation.

@drewblaisdell drewblaisdell added [Status] Needs Author Reply and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Feb 12, 2016
@@ -19,10 +18,6 @@ module.exports = React.createClass( {
return;
}

if ( ! this.props.wporg ) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one is a bit confusing though.
Since PluginSite is used at /plugins/:pluginName to list the sites a plugin can be install on, I think it makes sense to disable the "Available sites" list component for non wporg plugins (in plugins.jsx)
Otherwise we'll get a nice error if we click on Install:
image

@Tug Tug force-pushed the remove/business-plugins branch 2 times, most recently from a427990 to 5d6186a Compare February 13, 2016 19:48
this.props.wporgFetchPluginData( plugin.slug );
}
return assign( {}, plugin, pluginData );
let pluginData = WporgPluginsSelectors.getPlugin( this.props.wporgPlugins, plugin.slug );
Copy link
Contributor

Choose a reason for hiding this comment

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

this could be a const :)

@Tug
Copy link
Contributor Author

Tug commented Feb 14, 2016

@lezama Thank you for reviewing,
I followed your comments and did some other code cleanup ;)

@Tug Tug force-pushed the remove/business-plugins branch from 3d07c22 to f918f1c Compare February 15, 2016 00:13
@fabianapsimoes
Copy link
Contributor

Product 👍

Very nice, Tug. Thanks for the detailed instructions!

@lezama
Copy link
Contributor

lezama commented Feb 15, 2016

Thanks Tug! I think @enejb or @johnHackworth should be the ones giving the final 👍

@johnHackworth
Copy link
Contributor

I've been testing it and both code and product-wise looks good

good work! :shipit:

@johnHackworth johnHackworth added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Feb 15, 2016
@enejb
Copy link
Member

enejb commented Feb 15, 2016

Great work Tug!

@Tug
Copy link
Contributor Author

Tug commented Feb 15, 2016

Thanks, it's always fun removing code ;)

@@ -207,42 +204,6 @@ PluginUtils = {
} );
},

addWpcomIcon: function( plugin ) {
if ( plugin.slug && plugin.wpcom ) {
return _assign( {}, plugin, { icon: '/calypso/images/upgrades/plugins/' + plugin.slug + '.png' } );
Copy link
Contributor

Choose a reason for hiding this comment

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

We should also remove the corresponding images.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well spotted!

@stephanethomas
Copy link
Contributor

Great job, that wasn't an easy one!

@fabianapsimoes fabianapsimoes removed this from the Amber: Backlog milestone Feb 24, 2016
@Tug Tug force-pushed the remove/business-plugins branch 3 times, most recently from 8040c4a to 575f899 Compare February 25, 2016 19:31
Tug added 4 commits February 25, 2016 21:07
- Fix deactivating bulk plugins
- Prefer const instead of let
- Use Object.assign which is available in Babel now
- Simplify a render method: print the elements of a dropdown selector directly instead of appendinf them to an array
- Remove unused code
@Tug Tug force-pushed the remove/business-plugins branch from 575f899 to cdf53d3 Compare February 25, 2016 20:08
Tug added a commit that referenced this pull request Feb 25, 2016
@Tug Tug merged commit 48392a2 into master Feb 25, 2016
@Tug Tug deleted the remove/business-plugins branch February 25, 2016 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants