Skip to content

Plugin Audit proposal #58

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
255 changes: 255 additions & 0 deletions proposals/PluginsAudit2015/audit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,255 @@
# Cordova Plugins



| Plugin | Downloads (Oct 2015) | Downloads (Jan 2017) | Open Issues | Open PRs | Downloads 2016 | Notes |
| ------------------ | -------------------- | -------------------- | ----------- | -------- | -------------- | -------- |
| Battery-Status | 5,116 | 20,828 | 20 | 8 | 196,062 | |
| Camera | 17,503 | 49,591 | 109 | 30 | 482,544 | |
| Console | 45,894 | 120,655 | 8 | 0 | 1,065,062 | |
| Contacts | 6,096 | 23,401 | 52 | 15 | 229,234 | |
| Device | 53,695 | 147,953 | 10 | 2 | 1,350,410 | |
| Device Orientation | 3,823 | 24,683 | 5 | 1 | 216,981 | |
| Device Motion | 3,886 | 24,042 | 6 | 0 | 213,622 | |
| Dialogs | 12,456 | 40,495 | 19 | 14 | 396,914 | |
| File | 21,252 | 55,151 | 68 | 17 | 542,885 | |
| File Transfer | 16,597 | 35,835 | 65 | 23 | 371,373 | |
| Geolocation | 14,709 | 42,863 | 26 | 12 | 436,409 | |
| Globalization | 5,108 | 29,420 | 11 | 1 | 252,174 | |
| In App Browser | 17,904 | 57,857 | 83 | 40 | 574,204 | |
| Media | 6,396 | 29,105 | 97 | 27 | 268,085 | |
| Media-Capture | 5,092 | 24,251 | 50 | 13 | 218,818 | |
| Network Info | 13,418 | 45,352 | 15 | 0 | 430,246 | |
| Statusbar | 33,072 | 142,814 | 22 | 5 | 1,239,827 | |
| Splashscreen | 52,474 | 132,845 | 39 | 14 | 1,305,126 | |
| Test-Framework | 215 | 898 | 1 | 0 | 6,373 | |
| Vibration | 4,851 | 26,760 | 13 | 2 | 244,349 | |
| Whitelist | 92,152 | 187,396 | 9 | 2 | 1,701,793 | |
| Ionic Keyboard | 27,169 | 82,263 | 87 | 9 | 895,361 | |
| Local Notifications| 265 | 214 | 306 | 27 | 3,046 | |
| Ads | 2621 | 3,218 | 35 | 0 | 47,620 | |



**NOTE**: Data below was collected on October 28th, 2015.

## Battery-Status

* 1 Month Downloads: 5116
* Open Issues: 18
* Open Pull Requests: 3
* Spec: http://www.w3.org/TR/battery-status/
* android 5 has the ability to grab battery info in uiwebview built in
* isPlugged is useful but not being used much
Copy link

Choose a reason for hiding this comment

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

How can you tell that isPlugged is not being used much?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good Question. I don't think we have any stats.

* Recommendation: Deprecate!

## Camera
* 1 Month Downloads: 17503
* Open Issues: 85
* Open Pull Requests: 20
* Recommendation: Keep. Continue merging PRs and avoiding adding too many new features

## Console
* 1 Month Downloads: 45894
* Open Issues: 5
* Open Pull Requests: 1
* console output should show up in Xcode by default.
* Recommendation: Move functionality back into platforms

## Contacts
* 1 Month Downloads: 6096
* Open Issues: 71
* Open Pull Requests: 10
* Spec: http://www.w3.org/TR/contacts-api/ (discontinued)
* API needs to be redone. Currently brittle and many platform specific quirks
Copy link

Choose a reason for hiding this comment

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

Can you provide an example of brittleness? I'm curious what the perceived failings are.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it was more around the fact that the tests pass/fail randomly it seems.

Copy link

Choose a reason for hiding this comment

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

Can we properly reflect that in the audit document, then?

* Recommendation: Keep. Leave it as is and revist if new Contacts API is published by W3C. Api does need to be redone, but low priority.

## Device
* 1 Month Downloads: 53695
* Open Issues: 7
* Open Pull Requests: 1
* Refactor: Update interface to be async?
* Maybe keep it the same
* Recommendation: Keep. Discuss if it makes sense to add it to hello world template as a default plugin. Add it to phonegap template. Add it as a dependency on tests that need it (Device-motion). Discuss if switching api async makes sense.

## Device Orientation (compass)
* 1 Month Downloads: 3823
* Open Issues: 8
* Open Pull Requests: 3
* No Spec
* maybe combine device-motion + compass?
* Needs better API
* rename to cordova plugin compass?
* Recommendation: Keep. Consider renaming plugin to cordova-plugin-compass. Needs improved API but low priority.

## Device Motion (Accelerometer)
* 1 Month Downloads: 3886
* Open Issues: 8
* Open Pull Requests: 0
* spec http://www.w3.org/TR/orientation-event/
* Starting to become available in browsers http://caniuse.com/#search=orientation
* rename to cordova-plugin-device-orientation-motion?
* low priority: polish code, update code to remove accelerometer references.
* Recommendation: Keep. Code needs a cleanup but low priority.

## Dialogs
* 1 Month Downloads: 12456
* Open Issues: 13
* Open Pull Requests: 17
* Using custom styled divs should be used instead of alerts
* In HTML 5.1 there is a proposed dialog element which actually seems pretty good. http://www.w3.org/html/wg/drafts/html/master/single-page.html#the-dialog-element
* looks good on android
* looks ugly on ios
* currently not sync which is how default alerts work
* window.alert still available but says index.html
* Recommendation: Deprecate! Encourage use of HTML/CSS/JS divs instead.
Copy link

@brody4hire brody4hire Dec 15, 2016

Choose a reason for hiding this comment

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

-1 please do not deprecate, reasons given in comments below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Appreciate you providing feedback :)


## File
* 1 Month Downloads: 21252
* Open Issues: 60
* Open Pull Requests: 15
* phonegap-plugin-file or phonegap-plugin-fs. Consumes cordova-plugin-file. Create downstream version with a better interface. Current one is based on standard which is ugly. (rip shelljs file ops)
* Can we treat some urls consistency across all platforms? Possibly use Flex Air package for inspiration.
* ex: app:, temp:,
* cdvfile wasn’t consistent enough across platforms
* Recommendation: Keep. Work on creating more consistency across platforms. Especially with cdvfile. Create phonegap-plugin-file with improved api.
Copy link

Choose a reason for hiding this comment

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

Worth noting that our current implementation is a superset of the actual W3C spec: https://www.w3.org/TR/FileAPI

Things like FileEntry and similar APIs look to be discontinued now.

Our implementation is out of date.


## File Transfer
* 1 Month Downloads: 16597
* Open Issues: 72
* Open Pull Requests: 8
* xhr2 is an alternative
* available on all the platforms now.
* http://caniuse.com/#search=xhr2
* Recommendation: Keep for now, but also start recommending xhr2 instead. Create tutorials using xhr2 instead of file-transfer.

## Geolocation
* 1 Month Downloads: 14709
* Open Issues: 35
* Open Pull Requests: 10
* Spec: http://dev.w3.org/geo/api/spec-source.html
* Recommendation: Keep.

## Globalization
* 1 Month Downloads: 5108
* Open Issues: 12
* Open Pull Requests: 0
* Deprecate async calls
* query all these values at startup and provide a synchronous API to get these values
* Maybe it would be better to have JS libraries handle this?
* Recommendation: Keep. Deprecate async calls and make plugin sync.

## In-App-Browser
* 1 Month Downloads: 17904
* Open Issues: 116
* Open Pull Requests: 36
* API needs a refactor
* Cordova Webview based inappbrowser as a replacement would have big security issues if we opened up third party links in it. So we shouldn’t do it.
* Carlos suggested new inappbrowser based on safariview. He can elaborate more.
* encourage people to use it through apis instead of window.open shims
* demo of oauth workflow + demo of closing inappbrowser via js (url change)
* http://ngcordova.com/docs/plugins/oauth/
* get rid of insertcss & executescript. Use fileapi instead
* Recommendation: Keep. Needs a refactor. Remove insertcss & executescript. Encourage use through apis instead of window.open. Make demos doing oAuth. Maybe phonegap-plugin-oauth.

## Media
* 1 Month Downloads: 6396
* Open Issues: 68
* Open Pull Requests: 19
* Too many quirks between platforms
* Maybe implement web audio api spec instead as a plugin
* web audio supported in iOS 8.4+ and Android 5+
* create web audio plugin for Android 4 to 4.4
Copy link

@filmaj filmaj Dec 14, 2016

Choose a reason for hiding this comment

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

I think the latest cordova-android release dropped support for Android 4, no?

Copy link
Member

Choose a reason for hiding this comment

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

4.1 and up are still supported, it was just 4.0.x that was dropped

* alternative: https://www.npmjs.com/package/cordova-plugin-nativeaudio
* Recommendation: Deprecate! Recommend using web audio api instead and look into creating a web audio api plugin to polyfill support for android 4 to 4.4.

## Media-Capture
* 1 Month Downloads: 5092
* Open Issues: 37
* Open Pull Requests: 9
* Spec: http://www.w3.org/TR/mediacapture-streams/ (Last call draft)
* Needs a api refactor
* Issues with localization/globalization for custom UI
* Alternatives?
* https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Browser_compatibility or https://developer.mozilla.org/en-US/docs/Web/API/Navigator/getUserMedia (deprecated)
* WebAudio can handle playing audio
* camera plugin can handle video and pics
* recording audio is missing. Options:
* https://www.npmjs.com/package/cordova-plugin-audio-recorder-api
* https://www.npmjs.com/package/cordova-plugin-audiorecorder
* Recommendation: Keep for now, but look at alternatives and see if we can deprecate. If we do want to keep it long term, it will need a big refactor to catch up to spec

## Network-Information
* 1 Month Downloads: 13418
* Open Issues: 14
* Open Pull Requests: 0
* Spec http://www.w3.org/TR/netinfo-api/ (discountinued)
* Maybe this should be extended?
* extra properties if cell data?
* Recommendation: Keep, investigate to see if extending functionality makes sense

## Status-Bar
* 1 Month Downloads: 33072
* Open Issues: 27
* Open Pull Requests: 3
* no spec
* pretty much required for iOS
* Recommendation: Keep, add to hello world template

## SplashScreen
* 1 Month Downloads: 52474
* Open Issues: 33
* Open Pull Requests: 16
* Does two things:
1. What device does when app is open
2. mimic same image on screen while webview is loaded
* issue on WP: flash between these two steps
* Recommendation: Move functionality back into platforms

## Test-Framework
* 1 Month Downloads: 215
* Open Issues: 2
* Open Pull Requests: 2
* Recommendation: Keep

## Vibration
* 1 Month Downloads: 4851
* Open Issues: 14
* Open Pull Requests: 4
* Spec: http://www.w3.org/TR/vibration/
* Recommendation: Keep, but low priority

## Whitelist
* 1 Month Downloads: 92152
* Open Issues: 2
* Open Pull Requests: 3
* Android requires whitelist plugin due to native intent URI whitelisting which isn’t handled by CSP. CSP for webview whitelisting.
* iOS will just use ATS & CSP. No need for whitelist anymore.
* Windows only uses CSP
* Recommendation: Remove support for iOS due to AST, keep for Android due to intent whitelisting.

# Third Party

## Ionic Keyboard
* 1 Month Downloads: 27169
* Open Issues: 56
* Open Pull Requests: 5
* Pretty much required for iOS dev. Should this be in core in iOS or ship with hello world?
* Recommendation: Discuss if this should be in iOS or cordova core plugin & chat with ionic about it. Maybe ship with hello world template. We would want ionic to keep taking care of it.

## Local Notifications
* 1 Month Downloads: 265
* Open Issues: 173
* Open Pull Requests: 14
* npm package (fork) at: https://www.npmjs.com/package/cordova-plugin-local-notifications
* Github repo (original) at https://github.com/katzer/cordova-plugin-local-notifications
* Need to help these two merge, add `ecosystem:cordova` so it shows up on search
* Recommendation: promote & contribute back to https://github.com/katzer/cordova-plugin-local-notifications

## Ads
* 1 Month Downloads: 2621
* Open Issues: 64
* Open Pull Requests: 4
* npm package at https://www.npmjs.com/package/cordova-plugin-admobpro
* Github repo at https://github.com/floatinghotpot/cordova-admob-pro
* Recommendation: promote
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions proposals/PluginsAudit2015/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
After some long sessions, Simon, Jesse and Steve have come up with some recommendations on plugins. Please read through and provide feedback on this pull request. Some of these recommendations will need to be broken up into their own proposals.

* [Audit](audit.md)
* [Plugin Downloads in Jan'17](charts/downloads/Plugins_Jan'17.png)
* [Plugin Downloads in 2016](charts/downloads/Plugins_2016.png)
* [Growth in Plugin Downloads (Oct'15 vs Jan'17)](charts/downloads/Growth_downloads.png)
* [Plugin Downloads in Oct'15](charts/downloads/downloads.png)
* [Defects & Pull Requests in Jan'17](charts/Issues/IssuesandPRs.png)
* [Defects & Pull Requests in Oct'15](charts/Issues/defectsPRs.png)

**NOTE**: Data for this proposal was collected on February 1st, 2017 and October 28th, 2015.


# Cordova Plugins:
## Keep:
* Camera
* Contacts (needs refactor but low priority)
* Device
* Device Motion (needs more discussion, low priority)
* Device Orientation (rename, low priority)
* File
* File-Transfer
* Geolocation
* Globalization (make sync, available at startup)
* In-App-Browser (refactor)
* Media Capture (needs more discussion)
* Network-Information (investigate extending)
* Status Bar
* Test-Framework
* Vibration (low priority, low maintenance)
* Whitelist (remove iOS support since AST takes over)

## Deprecate:
* Battery-Status
* Dialogs (Should use HTML/CS/JS dialogs instead)
* Media (Suggest alternatives + webAudio)

## Integrate into core platforms:
* Console
* Splashscreen

## Add to hello world template as default plugins:
* Status Bar
* Device (Need to discuss)

## Recommendation Highlights:
* **In-App-Browser**: Needs a refactor. Remove insertcss & executescript. Encourage use through apis instead of window.open.
* **Media-capture**: Look at alternatives and see if we can deprecate. If we do want to keep it long term, it will need a big refactor to catch up to spec
* **Media**: Recommend using web audio api instead and look into creating a web audio api plugin to polyfill support for android 4 to 4.4.
* **Globalization**: Deprecate async calls and make plugin sync.
* **File-Transfer**: Start recommending xhr2 instead. Create tutorials using xhr2 instead of file-transfer.
* **Device-Orientation**: Consider renaming plugin to cordova-plugin-compass. Needs improved API but low priority.
* **Whitelist**: Remove support for iOS due to AST, keep for Android due to intent whitelisting. [Proposal](https://github.com/cordova/cordova-discuss/pull/2://github.com/cordova/cordova-discuss/pull/27)

# Third Party Plugins Recommendations:
* **cordova-plugin-ionic-keyboard**: Discuss if this should be installed by deafault for iOS apps. If so, should it be a cordova core plugin? Should it ship with hello world template or be included in ios core? We would want ionic to keep taking care of it.
* **cordova-plugin-local-notifications**: promote & contribute back to https://github.com/katzer/cordova-plugin-local-notifications
* **cordova-admob-pro**: Promote https://github.com/floatinghotpot/cordova-admob-pro

To view more info on recommendation and stats on downloads, open PRs and open issues, please view the full [audit](audit.md). Every plugin has a recommendation.

# Deprecation process
Update readmes of those plugins with notice of deprecation and possibly suggesting alternatives. Remove components from JIRA and stop any current or future work on them. Encourage people from the community to take ownership by forking if desired.

Feedback requested!