83% calculation-shipping

Code Review | Calculation Shipping

WordPress plugin Calculation Shipping scored83%from 54 tests.

About plugin

  • Plugin page: calculation-shipping
  • Plugin version: 0.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: May 3, 2015
  • Latest release: May 3, 2015
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: caicedo1089 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,102 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼6.27ms] Passed 4 tests

Analyzing server-side resources used by Calculation Shipping
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0444.24 ▲0.89
Dashboard /wp-admin3.35 ▲0.0545.86 ▼6.50
Posts /wp-admin/edit.php3.47 ▲0.1146.94 ▼3.07
Add New Post /wp-admin/post-new.php5.96 ▲0.0784.90 ▼16.41
Media Library /wp-admin/upload.php3.28 ▲0.0537.91 ▲5.48
Calculation Shipping /wp-admin/options-general.php?page=calship-key-config3.2636.18

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 14 new files
Database: 1 new table, 7 new options
New tables
wp_calship
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
calship_db_version

Browser metrics Passed 4 tests

A check of browser resources used by Calculation Shipping
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,906 ▲12014.13 ▼0.1418.25 ▲16.2843.40 ▼0.35
Dashboard /wp-admin2,199 ▲194.84 ▼0.7192.04 ▲0.6638.90 ▼4.11
Posts /wp-admin/edit.php2,088 ▼122.30 ▲0.3349.49 ▲11.5334.66 ▼0.38
Add New Post /wp-admin/post-new.php1,529 ▲223.02 ▼0.16658.28 ▲11.2036.77 ▼16.66
Media Library /wp-admin/upload.php1,406 ▲64.50 ▲0.2799.42 ▲0.9143.12 ▼3.84
Calculation Shipping /wp-admin/options-general.php?page=calship-key-config1,0352.7756.1837.88

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 were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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 take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/calculation-shipping/cal-ship.php

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, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
6 plugin tags: carrier, envios, shipping, calculation shipping, calculator...

calculation-shipping/cal-ship.php 77% from 13 tests

The entry point to "Calculation Shipping" version 0.2.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("calculation-shipping.php" instead of "cal-ship.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Domain Path: The domain path folder was not found ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected401 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP36758232
JavaScript2211292
HTML214053
CSS12013
Markdown13011

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity11.00
▷ Minimum class complexity10.00
▷ Maximum class complexity12.00
Average method complexity2.11
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods18
▷ Static methods18100.00%
▷ Public methods1372.22%
▷ Protected methods00.00%
▷ Private methods527.78%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants685.71%
▷ Class constants114.29%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin