90% dolibarr-rest-api

Code Review | Dolibarr REST API

WordPress plugin Dolibarr REST API scored 90% from 54 tests.

About plugin

  • Plugin page: dolibarr-rest-api
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.8
  • WordPress version: 6.3.1
  • First release: Nov 29, 2018
  • Latest release: Nov 29, 2018
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: opendsi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 2,138 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.08MB] [CPU: ▼5.37ms] Passed 4 tests

Analyzing server-side resources used by Dolibarr REST API
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0841.86 ▼7.36
Dashboard /wp-admin3.39 ▲0.0846.60 ▲1.30
Posts /wp-admin/edit.php3.50 ▲0.1449.67 ▲3.33
Add New Post /wp-admin/post-new.php5.97 ▲0.0885.88 ▼16.36
Media Library /wp-admin/upload.php3.31 ▲0.0837.81 ▲0.94

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 29 new files
Database: no new tables, 7 new options
New WordPress options
dolibarr_rest_api_version
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Dolibarr REST API
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.19 ▼1.104.58 ▲2.8243.27 ▼3.25
Dashboard /wp-admin2,206 ▲174.91 ▼0.9894.12 ▼18.5937.90 ▼1.85
Posts /wp-admin/edit.php2,089 ▲32.18 ▲0.2033.10 ▼3.2433.78 ▲2.40
Add New Post /wp-admin/post-new.php1,534 ▲2023.18 ▲5.65639.30 ▼68.3151.94 ▼25.77
Media Library /wp-admin/upload.php1,391 ▲64.18 ▼0.0495.17 ▼7.0942.71 ▼3.23

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • dolibarr_rest_api_version
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Everything seems fine, however this is by no means an exhaustive test

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: wordpress, template, plugin

dolibarr-rest-api/dolibarr-rest-api.php Passed 13 tests

This is the main PHP file of "Dolibarr REST API" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
61 characters long description:
Plugin helper to connect to the Dolibarr (free ERP) REST API.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin1,271 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP94458851,078
JavaScript52515134
PO File171045
JSON10014

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity28.83
▷ Minimum class complexity5.00
▷ Maximum class complexity67.00
Average method complexity3.42
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods69
▷ Static methods34.35%
▷ Public methods6797.10%
▷ Protected methods00.00%
▷ Private methods22.90%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 compressed PNG files occupy 0.01MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/icon-256x256.png3.73KB3.94KB0.00%
assets/img/icon.png4.22KB4.47KB0.00%
assets/img/icon-128x128.png1.65KB1.72KB0.00%