84% cocolis

Code Review | Cocolis

WordPress plugin Cocolis scored84%from 54 tests.

About plugin

  • Plugin page: cocolis
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.9
  • WordPress version: 6.3.1
  • First release: Mar 26, 2021
  • Latest release: Nov 8, 2023
  • Number of updates: 42
  • Update frequency: every 22.8 days
  • Top authors: cocolis (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,479 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.02MB] [CPU: ▼5.85ms] Passed 4 tests

This is a short check of server-side resources used by Cocolis
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0238.52 ▼0.49
Dashboard /wp-admin3.32 ▲0.0243.90 ▼9.45
Posts /wp-admin/edit.php3.37 ▲0.0145.34 ▼1.89
Add New Post /wp-admin/post-new.php5.91 ▲0.0379.32 ▼11.55
Media Library /wp-admin/upload.php3.24 ▲0.0134.72 ▲3.29

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 99 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Cocolis
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲314.25 ▼0.021.62 ▼0.5444.90 ▲2.10
Dashboard /wp-admin2,195 ▲155.59 ▼0.0685.22 ▼16.7441.53 ▼1.97
Posts /wp-admin/edit.php2,100 ▼01.96 ▼0.0435.19 ▼1.3833.93 ▼2.71
Add New Post /wp-admin/post-new.php1,526 ▼523.33 ▲0.53636.81 ▼42.8453.86 ▲4.31
Media Library /wp-admin/upload.php1,400 ▲94.25 ▼0.0093.95 ▼13.3641.00 ▼2.90

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options

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 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 items
  • 20× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Cocolis\\Api\\Errors\\CocolisException' not found in wp-content/plugins/cocolis/vendor/cocolis/php/src/Errors/InternalErrorException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/cocolis/vendor/cocolis/php/tests/CocolisTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Tests\\Api\\CocolisTest' not found in wp-content/plugins/cocolis/vendor/cocolis/php/tests/models/RideTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PhpCsFixer\\Finder' not found in wp-content/plugins/cocolis/vendor/cocolis/php/.php-cs-fixer.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Cocolis\\Api\\Models\\AbstractModel' not found in wp-content/plugins/cocolis/vendor/cocolis/php/src/Models/Webhook.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Cocolis\\Api\\Clients\\AbstractClient' not found in wp-content/plugins/cocolis/vendor/cocolis/php/src/Clients/WebhookClient.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Cocolis\\Api\\Clients\\AbstractClient' not found in wp-content/plugins/cocolis/vendor/cocolis/php/tests/WrongResPathClient.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Cocolis\\Api\\Errors\\CocolisException' not found in wp-content/plugins/cocolis/vendor/cocolis/php/src/Errors/UnauthorizedException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Cocolis\\Api\\Errors\\CocolisException' not found in wp-content/plugins/cocolis/vendor/cocolis/php/src/Errors/UnprocessableEntityException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Tests\\Api\\CocolisTest' not found in wp-content/plugins/cocolis/vendor/cocolis/php/tests/clients/AbstractClientTest.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: delivery, livraison, cocolis, woocommerce

cocolis/wc-cocolis-shipping.php 92% from 13 tests

The entry point to "Cocolis" version 1.1.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cocolis.php" instead of "wc-cocolis-shipping.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin4,309 lines of code in 56 files:
LanguageFilesBlank linesComment linesLines of code
PHP385237872,788
JSON800764
Markdown82130568
PO File15665159
XML11030

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity10.00
▷ Minimum class complexity1.00
▷ Maximum class complexity61.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes32
▷ Abstract classes26.25%
▷ Concrete classes3093.75%
▷ Final classes13.33%
Methods184
▷ Static methods3820.65%
▷ Public methods17394.02%
▷ Protected methods21.09%
▷ Private methods94.89%
Functions8
▷ Named functions675.00%
▷ Anonymous functions225.00%
Constants6
▷ Global constants00.00%
▷ Class constants6100.00%
▷ Public constants6100.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
There were not PNG files found in your plugin