84% cts-wc-shipping

Code Review | Shipping plugin for WooCommerce

WordPress plugin Shipping plugin for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: cts-wc-shipping
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-5.6
  • WordPress version: 6.3.1
  • First release: Feb 5, 2021
  • Latest release: Feb 5, 2021
  • Number of updates: 3
  • Update frequency: every 5.7 days
  • Top authors: nishadup (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /321 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

A check of server-side resources used by Shipping plugin for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0143.35 ▼3.29
Dashboard /wp-admin3.31 ▲0.0148.89 ▼2.64
Posts /wp-admin/edit.php3.37 ▲0.0148.09 ▼9.51
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.66 ▼19.16
Media Library /wp-admin/upload.php3.24 ▲0.0141.75 ▲4.11

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Shipping plugin for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.26 ▼0.021.70 ▼0.4144.11 ▼6.57
Dashboard /wp-admin2,195 ▲185.60 ▲0.0688.25 ▼16.1640.29 ▼3.45
Posts /wp-admin/edit.php2,100 ▲32.04 ▲0.0535.77 ▼4.1932.39 ▼4.47
Add New Post /wp-admin/post-new.php1,526 ▼023.39 ▲0.14685.37 ▲27.0455.75 ▲6.90
Media Library /wp-admin/upload.php1,403 ▲64.20 ▲0.0197.94 ▼2.6946.28 ▲3.10

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • 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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/cts-wc-shipping/spfw_woocommerce-shipping.php:20

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)
No browser errors were detected

Optimizations

Plugin configuration 93% 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
3 plugin tags: woocommerce, shipping rate, shipping

cts-wc-shipping/spfw_woocommerce-shipping.php 85% from 13 tests

The primary PHP file in "Shipping plugin for WooCommerce" version 1.0.0 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("cts-wc-shipping.php" instead of "spfw_woocommerce-shipping.php")
  • Requires at least: The required version number must match the one declared in readme.txt ("3.0.1" instead of "2.6")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected137 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP33825135
JavaScript1102

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity4.50
▷ Minimum class complexity1.00
▷ Maximum class complexity8.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods1392.86%
▷ Protected methods00.00%
▷ Private methods17.14%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
There were not PNG files found in your plugin