78% shipsmart

Code Review | Shipping with ShipSmart for WooCommerce

WordPress plugin Shipping with ShipSmart for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: shipsmart
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 6.3.1
  • First release: Oct 22, 2021
  • Latest release: Oct 22, 2021
  • Number of updates: 4
  • Update frequency: every 5.3 days
  • Top authors: apiki (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /416 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.73MB] [CPU: ▼4.43ms] Passed 4 tests

This is a short check of server-side resources used by Shipping with ShipSmart for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.33 ▲0.8647.16 ▲5.90
Dashboard /wp-admin4.17 ▲0.8753.18 ▲6.62
Posts /wp-admin/edit.php4.12 ▲0.7740.92 ▼12.16
Add New Post /wp-admin/post-new.php6.32 ▲0.4373.43 ▼17.06
Media Library /wp-admin/upload.php4.09 ▲0.8641.56 ▲5.61
ShipSmart /wp-admin/admin.php?page=shipsmart4.0033.73

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 355 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Shipping with ShipSmart for WooCommerce: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,932 ▲18615.92 ▲1.5432.66 ▲30.6539.94 ▼7.95
Dashboard /wp-admin2,234 ▲465.88 ▲0.09114.94 ▼4.7641.05 ▼3.54
Posts /wp-admin/edit.php2,110 ▲242.80 ▲0.7651.12 ▲14.4535.52 ▼2.31
Add New Post /wp-admin/post-new.php1,527 ▼623.63 ▲0.67687.87 ▲19.6465.28 ▲12.66
Media Library /wp-admin/upload.php1,400 ▲125.14 ▲0.94105.21 ▲1.7542.06 ▲0.35
ShipSmart /wp-admin/admin.php?page=shipsmart1,0812.5540.5526.68

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for 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 | 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 items
  • 190× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/shipsmart/vendor/dusank/knapsack/tests/scenarios/CustomPassthroughFunctionTest.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ShipSmart\\Providers\\ShipSmart\\add_filter() in wp-content/plugins/shipsmart/src/Providers/Config/SSFW_Shipping_Method.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Console\\Helper\\Table' not found in wp-content/plugins/shipsmart/vendor/dusank/knapsack/tests/performance/map_vs_array_map.php:230
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/shipsmart/vendor/dusank/knapsack/tests/scenarios/CallableFuctionNamesTest.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\Container\\Definition\\DefinitionAggregateInterface' not found in wp-content/plugins/shipsmart/vendor/league/container/src/Definition/DefinitionAggregate.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Container\\ContainerExceptionInterface' not found in wp-content/plugins/shipsmart/vendor/league/container/src/Exception/ContainerException.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PhpSpec\\ObjectBehavior' not found in wp-content/plugins/shipsmart/vendor/dusank/knapsack/tests/spec/Exceptions/NoMoreItemsSpec.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Cedaro\\WP\\Plugin\\PluginInterface' not found in wp-content/plugins/shipsmart/vendor/cedaro/wp-plugin/src/AbstractPlugin.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/shipsmart/vendor/cedaro/wp-plugin/tests/PluginTest.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\Container\\Inflector\\InflectorAggregateInterface' not found in wp-content/plugins/shipsmart/vendor/league/container/src/Inflector/InflectorAggregate.php:8

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=shipsmart
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=shipsmart 190 The specified value "Atualizar pedidos" cannot be parsed, or is out of range.
    • > GET request to /wp-admin/admin.php?page=shipsmart
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=shipsmart 192 The specified value "Atualizar pedidos" cannot be parsed, or is out of range.
    • > GET request to /wp-admin/admin.php?page=shipsmart
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=shipsmart 194 The specified value "Atualizar pedidos" cannot be parsed, or is out of range.
    • > GET request to /wp-admin/admin.php?page=shipsmart
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=shipsmart 196 The specified value "Atualizar pedidos" cannot be parsed, or is out of range.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Screenshots: Add images for these screenshots: #1 (Configuração Geral), #2 (Lista de Shipping Methods), #3 (Configurações da Ship Smart), #4 (Página do carrinho), #5 (Página de produto)
You can look at the official readme.txt

shipsmart/shipsmart.php 92% from 13 tests

"Shipping with ShipSmart for WooCommerce" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin30,816 lines of code in 321 files:
LanguageFilesBlank linesComment linesLines of code
JSON130016,745
PHP2372,2464,2659,793
Markdown1337801,785
JavaScript252112381,137
Sass1516740843
YAML9533239
PO File24878147
XML582125
CSS2002

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity3.24
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity1.81
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces36
Interfaces26
Traits12
Classes183
▷ Abstract classes147.65%
▷ Concrete classes16992.35%
▷ Final classes00.00%
Methods692
▷ Static methods486.94%
▷ Public methods62189.74%
▷ Protected methods628.96%
▷ Private methods91.30%
Functions274
▷ Named functions10538.32%
▷ Anonymous functions16961.68%
Constants23
▷ Global constants14.35%
▷ Class constants2295.65%
▷ Public constants22100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/images/sprite/refresh-icon.png14.26KB4.75KB▼ 66.67%
dist/images/refresh-icon.6e7225bab3.png4.72KB4.75KB0.00%