84% cdek-delivery-calculator

Code Review | Калькулятор стоимости доставки СДЭК для WooCommerce

WordPress plugin Калькулятор стоимости доставки СДЭК для WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: cdek-delivery-cal...
  • Plugin version: 0.0.2
  • PHP compatiblity: 5.6.30+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.9.6
  • WordPress version: 6.3.1
  • First release: Aug 16, 2018
  • Latest release: Aug 16, 2018
  • Number of updates: 5
  • Update frequency: every 8.6 days
  • Top authors: mintstudio (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active /6,513 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

This is a short check of server-side resources used by Калькулятор стоимости доставки СДЭК для WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.42 ▼0.0531.59 ▼9.94
Dashboard /wp-admin3.34 ▲0.0348.28 ▲3.14
Posts /wp-admin/edit.php3.39 ▲0.0352.65 ▼2.50
Add New Post /wp-admin/post-new.php5.94 ▲0.05100.82 ▼7.84
Media Library /wp-admin/upload.php3.26 ▲0.0336.54 ▼0.14

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Калькулятор стоимости доставки СДЭК для WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,467 ▼26813.29 ▼1.350.86 ▼0.9322.47 ▼23.63
Dashboard /wp-admin2,202 ▲145.88 ▲0.00102.93 ▼2.3741.30 ▼5.07
Posts /wp-admin/edit.php2,091 ▲22.04 ▲0.0339.07 ▼23.6032.62 ▼9.82
Add New Post /wp-admin/post-new.php1,531 ▼223.15 ▼0.18677.14 ▼3.8369.16 ▲15.14
Media Library /wp-admin/upload.php1,384 ▼14.25 ▲0.02118.94 ▼24.4046.24 ▼1.02

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 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • 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 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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cdek-delivery-calculator/inc/CDS_CDEK_admin_function.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/cdek-delivery-calculator/CargoDeliveryServiceCDEK.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 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
5 plugin tags: delivery, mint-studio, cdek, delivery plugin, woocommerce

cdek-delivery-calculator/CargoDeliveryServiceCDEK.php 92% from 13 tests

The main PHP script in "Калькулятор стоимости доставки СДЭК для WooCommerce" version 0.0.2 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("cdek-delivery-calculator.php" instead of "CargoDeliveryServiceCDEK.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected492 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP481185372
JavaScript17383
Markdown122037

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity27.50
▷ Minimum class complexity13.00
▷ Maximum class complexity42.00
Average method complexity3.65
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods1785.00%
▷ Protected methods00.00%
▷ Private methods315.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
No PNG images were found in this plugin