90% cocart-cors

Code Review | CoCart - CORS Support

WordPress plugin CoCart - CORS Support scored90%from 54 tests.

About plugin

  • Plugin page: cocart-cors
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3
  • WordPress version: 6.3.1
  • First release: Apr 5, 2021
  • Latest release: Aug 8, 2023
  • Number of updates: 7
  • Update frequency: every 122.1 days
  • Top authors: sebd86 (85.71%)cocartforwc (28.57%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /3,044 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by CoCart - CORS Support
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.52 ▼3.99
Dashboard /wp-admin3.31 ▲0.0149.06 ▲2.17
Posts /wp-admin/edit.php3.37 ▲0.0160.06 ▲8.28
Add New Post /wp-admin/post-new.php5.90 ▲0.0191.67 ▼14.98
Media Library /wp-admin/upload.php3.24 ▲0.0139.15 ▲4.98

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for CoCart - CORS Support
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.72 ▲0.371.88 ▲0.1143.41 ▲3.86
Dashboard /wp-admin2,198 ▲185.64 ▲0.0691.67 ▲3.5745.15 ▲5.60
Posts /wp-admin/edit.php2,103 ▲32.07 ▲0.0442.25 ▲6.0144.79 ▲10.57
Add New Post /wp-admin/post-new.php1,526 ▼023.36 ▲0.39660.55 ▼24.4562.54 ▲6.69
Media Library /wp-admin/upload.php1,400 ▼04.20 ▼0.0296.04 ▲1.2241.75 ▼3.43

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
6 plugin tags: woocommerce, cors, cart, headless, decoupled...

cocart-cors/cocart-cors.php Passed 13 tests

The principal PHP file in "CoCart - CORS Support" v. 1.0.3 is loaded by WordPress automatically on each request
73 characters long description:
Enables support for CORS to allow CoCart to work across multiple domains.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin65 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3228865

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods4
▷ Static methods4100.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions250.00%
▷ Anonymous functions250.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin