78% coopcycle

Code Review | CoopCycle

WordPress plugin CoopCycle scored78%from 54 tests.

About plugin

  • Plugin page: coopcycle
  • Plugin version: 0.11.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4.2
  • WordPress version: 6.3.1
  • First release: Jan 18, 2020
  • Latest release: Apr 20, 2021
  • Number of updates: 26
  • Update frequency: every 17.7 days
  • Top authors: alexmex (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,052 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼8.14ms] Passed 4 tests

Analyzing server-side resources used by CoopCycle
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0642.39 ▲1.80
Dashboard /wp-admin3.46 ▲0.0755.82 ▼13.76
Posts /wp-admin/edit.php3.57 ▲0.1754.01 ▼4.43
Add New Post /wp-admin/post-new.php6.04 ▲0.1187.22 ▼16.16
Media Library /wp-admin/upload.php3.38 ▲0.1139.28 ▲2.91
CoopCycle /wp-admin/options-general.php?page=coopcycle-settings3.3537.87

Server storage [IO: ▲0.07MB] [DB: ▲0.00MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

CoopCycle: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.21 ▼0.141.76 ▲0.0246.06 ▲1.42
Dashboard /wp-admin2,202 ▲255.56 ▼0.0691.31 ▼0.4642.87 ▲0.30
Posts /wp-admin/edit.php2,104 ▲11.99 ▼0.0335.87 ▼2.6033.16 ▼1.19
Add New Post /wp-admin/post-new.php1,536 ▲1023.03 ▼0.50702.23 ▲11.0173.69 ▲12.74
Media Library /wp-admin/upload.php1,404 ▲74.23 ▲0.06109.27 ▲8.8448.11 ▲2.22
CoopCycle /wp-admin/options-general.php?page=coopcycle-settings8152.0127.9130.08

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=coopcycle-settings
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=coopcycle-settings
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(http://www.fillyourtaproom.com/wp-json/wp/v2/posts?per_page=10): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Flat_Rate' not found in wp-content/plugins/coopcycle/src/ShippingMethod.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/coopcycle/coopcycle.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === coopcycle === )
The official readme.txt is a good inspiration

coopcycle/coopcycle.php Passed 13 tests

"CoopCycle" version 0.11.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
30 characters long description:
CoopCycle plugin for WordPress

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin719 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP620160663
PO File1192553
CSS1003

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity12.80
▷ Minimum class complexity4.00
▷ Maximum class complexity23.00
Average method complexity2.48
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods35
▷ Static methods925.71%
▷ Public methods3188.57%
▷ Protected methods00.00%
▷ Private methods411.43%
Functions12
▷ Named functions1083.33%
▷ Anonymous functions216.67%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected