78% csm-shipping

Code Review | CSM Woocoomerce Shipping Plugin

WordPress plugin CSM Woocoomerce Shipping Plugin scored78%from 54 tests.

About plugin

  • Plugin page: csm-shipping
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7.1-5.4.2
  • WordPress version: 6.3.1
  • First release: Jan 15, 2020
  • Latest release: Jun 11, 2020
  • Number of updates: 4
  • Update frequency: every 37.0 days
  • Top authors: csmlogistics (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /486 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.58ms] Passed 4 tests

Analyzing server-side resources used by CSM Woocoomerce Shipping Plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.23 ▼1.97
Dashboard /wp-admin3.33 ▲0.0347.64 ▼0.29
Posts /wp-admin/edit.php3.38 ▲0.0345.22 ▼1.12
Add New Post /wp-admin/post-new.php5.91 ▲0.0380.16 ▼10.93
Media Library /wp-admin/upload.php3.25 ▲0.0334.56 ▲2.43

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for CSM Woocoomerce Shipping Plugin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.25 ▼0.331.74 ▲0.2243.89 ▲4.59
Dashboard /wp-admin2,198 ▲175.61 ▼0.1194.12 ▼9.6642.14 ▼1.34
Posts /wp-admin/edit.php2,097 ▼31.97 ▼0.0237.48 ▲1.6932.71 ▼3.92
Add New Post /wp-admin/post-new.php1,536 ▼123.00 ▲4.76680.01 ▲83.0461.26 ▼20.79
Media Library /wp-admin/upload.php1,400 ▲34.19 ▼0.0392.52 ▼3.0639.89 ▼4.29

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/csm-shipping/includes/trackOrder.php
    • > /wp-content/plugins/csm-shipping/csm-shipping.php
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/csm-shipping/includes/views/add-services.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/csm-shipping/includes/overview.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/csm-shipping/includes/validateCartCheckout.php:67
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/csm-shipping/includes/views/enable-services.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Requires at least: The plugin version is formatted incorrectly
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Plugin Dashboard), #2 (CSM shipping settings)
You can take inspiration from this readme.txt

csm-shipping/csm-shipping.php Passed 13 tests

The entry point to "CSM Woocoomerce Shipping Plugin" version 1.0.0 is a PHP file that has certain tags in its header comment area
38 characters long description:
Custom Shipping Method for WooCommerce

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected1,723 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP13204901,167
CSS35450456
JavaScript23443100

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.17
Average class complexity9.00
▷ Minimum class complexity2.00
▷ Maximum class complexity16.00
Average method complexity1.80
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods21
▷ Static methods00.00%
▷ Public methods21100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
4 PNG files occupy 0.11MB with 0.06MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/assets/images/3.png1.70KB1.55KB▼ 9.12%
screenshot-2.png53.25KB14.21KB▼ 73.32%
includes/assets/images/csmlogo.png11.58KB4.05KB▼ 65.06%
screenshot-1.png43.55KB12.81KB▼ 70.59%