84% cargus

Code Review | Cargus

WordPress plugin Cargus scored84%from 54 tests.

About plugin

  • Plugin page: cargus
  • Plugin version: 1.3.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Jul 29, 2022
  • Latest release: Oct 19, 2023
  • Number of updates: 18
  • Update frequency: every 19.8 days
  • Top authors: cargus123 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

300+ active /3,356 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.51MB] [CPU: ▼5.56ms] Passed 4 tests

An overview of server-side resources used by Cargus
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.00 ▲0.5335.41 ▼5.77
Dashboard /wp-admin3.87 ▲0.5248.34 ▼11.57
Posts /wp-admin/edit.php3.92 ▲0.5652.64 ▲4.46
Add New Post /wp-admin/post-new.php6.39 ▲0.5085.04 ▼9.34
Media Library /wp-admin/upload.php3.73 ▲0.5037.32 ▲5.15

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 81 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Cargus
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.69 ▲0.311.74 ▼0.0437.49 ▼6.13
Dashboard /wp-admin2,198 ▲185.63 ▲0.0281.98 ▼8.9038.02 ▼3.98
Posts /wp-admin/edit.php2,100 ▼32.00 ▲0.0137.87 ▲2.7031.02 ▼6.17
Add New Post /wp-admin/post-new.php1,526 ▼223.12 ▼0.02675.04 ▲6.9560.47 ▼4.67
Media Library /wp-admin/upload.php1,403 ▼04.17 ▼0.0398.80 ▲2.5041.70 ▼3.92

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cargus/admin/class-cargus-cache.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cargus/admin/class-cargus-cron.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

cargus/cargus.php Passed 13 tests

This is the main PHP file of "Cargus" version 1.3.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
44 characters long description:
Metoda de livrare Cargus pentru WooCommerce.

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
No dangerous file extensions were detected324,623 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
JSON300313,772
PHP188331,7844,039
SVG15222,920
JavaScript102571831,965
CSS8301731,927

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.77
Average class complexity68.07
▷ Minimum class complexity1.00
▷ Maximum class complexity373.00
Average method complexity5.98
▷ Minimum method complexity1.00
▷ Maximum method complexity54.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods172
▷ Static methods31.74%
▷ Public methods15590.12%
▷ Protected methods00.00%
▷ Private methods179.88%
Functions7
▷ Named functions114.29%
▷ Anonymous functions685.71%
Constants5
▷ Global constants5100.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
11 PNG files occupy 0.16MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/email_cargus_banner_mid_gpay.png3.99KB2.34KB▼ 41.30%
public/images/logo.png22.83KB7.83KB▼ 65.71%
public/css/Leaflet/images/marker-shadow.png0.60KB1.16KB0.00%
public/images/email_cargus_banner_mid.png13.95KB6.72KB▼ 51.82%
public/images/email_cargus_banner_mid_appstore.png4.08KB2.32KB▼ 43.30%