84% cart-rest-api-for-woocommerce

Code Review | CoCart - Decoupling WooCommerce Made Easy

WordPress plugin CoCart - Decoupling WooCommerce Made Easy scored84%from 54 tests.

About plugin

  • Plugin page: cart-rest-api-for...
  • Plugin version: 3.9.0
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.2.2
  • WordPress version: 6.3.1
  • First release: Feb 26, 2018
  • Latest release: Aug 2, 2023
  • Number of updates: 162
  • Update frequency: every 12.2 days
  • Top authors: sebd86 (100%)

Code review

54 tests

User reviews

21 reviews

Install metrics

1,000+ active /65,334 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.01MB] [CPU: ▼7.09ms] Passed 4 tests

This is a short check of server-side resources used by CoCart - Decoupling WooCommerce Made Easy
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.64 ▼3.76
Dashboard /wp-admin3.31 ▼0.0444.98 ▼16.91
Posts /wp-admin/edit.php3.36 ▲0.0046.22 ▼1.25
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.14 ▼3.81
Media Library /wp-admin/upload.php3.23 ▲0.0033.76 ▼3.87
CoCart /wp-admin/admin.php?page=cocart3.0021.97
Upgrade /wp-admin/admin.php?page=upgrade-cocart3.0023.65

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 141 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options
cocart_admin_notices
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for CoCart - Decoupling WooCommerce Made Easy
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,856 ▲12113.57 ▼1.121.71 ▼0.1243.19 ▼0.83
Dashboard /wp-admin2,206 ▲185.86 ▲0.96100.26 ▼12.3039.13 ▼8.72
Posts /wp-admin/edit.php2,092 ▲32.02 ▲0.0339.32 ▲1.4834.22 ▼0.02
Add New Post /wp-admin/post-new.php1,542 ▲2318.45 ▼4.60617.11 ▼73.8362.06 ▲8.54
Media Library /wp-admin/upload.php1,391 ▲34.31 ▲0.0796.04 ▼15.7642.93 ▼3.57
CoCart /wp-admin/admin.php?page=cocart280.440.093.76
Upgrade /wp-admin/admin.php?page=upgrade-cocart280.440.053.62

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • db_upgraded
    • cocart_admin_notices
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Congratulations! This plugin passed the SRP test

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=cocart
    • > Network (severe)
    wp-admin/admin.php?page=cocart - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=upgrade-cocart
    • > Network (severe)
    wp-admin/admin.php?page=upgrade-cocart - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
8 plugin tags: session, decoupled, products, woocommerce, api...

cart-rest-api-for-woocommerce/cart-rest-api-for-woocommerce.php Passed 13 tests

The main PHP script in "CoCart - Decoupling WooCommerce Made Easy" version 3.9.0 is automatically included on every request by WordPress
84 characters long description:
CoCart makes it easy to decouple your WooCommerce store via a customizable REST API.

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 plugin18,844 lines of code in 135 files:
LanguageFilesBlank linesComment linesLines of code
PHP1193,5569,82817,338
CSS1212441,364
JavaScript23949133
Markdown1708
SVG1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity18.76
▷ Minimum class complexity1.00
▷ Maximum class complexity197.00
Average method complexity3.47
▷ Minimum method complexity1.00
▷ Maximum method complexity66.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes95
▷ Abstract classes44.21%
▷ Concrete classes9195.79%
▷ Final classes11.10%
Methods691
▷ Static methods14921.56%
▷ Public methods56681.91%
▷ Protected methods10214.76%
▷ Private methods233.33%
Functions35
▷ Named functions2262.86%
▷ Anonymous functions1337.14%
Constants31
▷ Global constants2270.97%
▷ Class constants929.03%
▷ Public constants9100.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
2 PNG files occupy 0.16MB with 0.09MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/brand/header-logo.png17.49KB7.39KB▼ 57.73%
assets/images/testimonials/james-rowland.png149.58KB72.67KB▼ 51.42%