10% shipany

Code Review | ShipAny WooCommerce: Ship, Label, Tracking

WordPress plugin ShipAny WooCommerce: Ship, Label, Tracking scored10%from 54 tests.

About plugin

  • Plugin page: shipany
  • Plugin version: 1.1.32
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-6.2.2
  • WordPress version: 6.3.1
  • First release: Oct 1, 2021
  • Latest release: Dec 1, 2023
  • Number of updates: 185
  • Update frequency: every 4.3 days
  • Top authors: shipany (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /10,599 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/shipany/shipany-woocommerce.php+526
    fopen(wp-content/uploads/woocommerce_shipany_label/.htaccess): failed to open stream: No such file or directory

Server metrics [RAM: ▼1.97MB] [CPU: ▼51.33ms] Passed 4 tests

Server-side resources used by ShipAny WooCommerce: Ship, Label, Tracking
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.18 ▼38.17
Dashboard /wp-admin2.05 ▼1.305.21 ▼50.96
Posts /wp-admin/edit.php2.05 ▼1.315.18 ▼40.83
Add New Post /wp-admin/post-new.php2.05 ▼3.846.18 ▼75.37
Media Library /wp-admin/upload.php2.05 ▼1.185.52 ▼28.93

Server storage [IO: ▲18.11MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Please try to fix the following items
  • Illegal file modification found: 1 file (0.00KB) outside of "wp-content/plugins/shipany/" and "wp-content/uploads/"
    • (new file) "wp-content/plugins/shipany/assets/icon-256\303\227256.png"
Filesystem: 289 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
shipany_permalinks_flushed

Browser metrics Passed 4 tests

An overview of browser requirements for ShipAny WooCommerce: Ship, Label, Tracking
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,460 ▼27614.23 ▼0.110.52 ▼1.8517.78 ▼36.48
Dashboard /wp-admin2,201 ▲235.63 ▼0.0989.32 ▼18.2543.52 ▲0.63
Posts /wp-admin/edit.php2,107 ▲71.98 ▼0.0141.42 ▲3.4634.16 ▲2.95
Add New Post /wp-admin/post-new.php1,532 ▲323.35 ▲0.18596.73 ▼17.1358.30 ▲3.85
Media Library /wp-admin/upload.php1,406 ▲34.17 ▼0.1397.77 ▼2.6244.97 ▲0.55

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/shipany/shipany-woocommerce.php+526
    fopen(wp-content/uploads/woocommerce_shipany_label/.htaccess): failed to open stream: No such file or directory
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • shipany_permalinks_flushed
    • 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
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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 take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/shipany/lib/PDFMerger-master/tcpdf/tools/tcpdf_addfont.php
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'FPDF' not found in wp-content/plugins/shipany/lib/PDFMerger-master/tcpdf/fpdf_tpl.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'TCPDF' not found in wp-content/plugins/shipany/lib/PDFMerger-master/tcpdf/tcpdi.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'PR\\REST_API\\Interfaces\\API_Auth_Interface' not found in wp-content/plugins/shipany/includes/REST_API/Auths/Function_Auth.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'PR\\REST_API\\Interfaces\\API_Driver_Interface' not found in wp-content/plugins/shipany/includes/REST_API/Drivers/Logging_Driver.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'PR\\REST_API\\Interfaces\\API_Driver_Interface' not found in wp-content/plugins/shipany/includes/REST_API/Drivers/JSON_API_Driver.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_script() in wp-content/plugins/shipany/pages/click-collect-widget.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: There are too many tags (14 tag instead of maximum 10)
Please take inspiration from this readme.txt

shipany/shipany-woocommerce.php 77% from 13 tests

The primary PHP file in "ShipAny WooCommerce: Ship, Label, Tracking" version 1.1.32 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: Please keep the plugin description shorter than 140 characters (currently 368 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("shipany.php" instead of "shipany-woocommerce.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected67,982 lines of code in 155 files:
LanguageFilesBlank linesComment linesLines of code
PHP1223,41814,86256,617
JavaScript185246394,361
CSS8139903,180
SVG2002,817
PO File2404382908
JSON20067
Markdown121032

PHP code 0% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please tend to the following items
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 4,349)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 499)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity155.77
▷ Minimum class complexity1.00
▷ Maximum class complexity4,349.00
Average method complexity8.19
▷ Minimum method complexity1.00
▷ Maximum method complexity499.00
Code structure
Namespaces9
Interfaces3
Traits0
Classes49
▷ Abstract classes36.12%
▷ Concrete classes4693.88%
▷ Final classes00.00%
Methods1,112
▷ Static methods14813.31%
▷ Public methods72465.11%
▷ Protected methods36332.64%
▷ Private methods252.25%
Functions57
▷ Named functions1933.33%
▷ Anonymous functions3866.67%
Constants152
▷ Global constants13085.53%
▷ Class constants2214.47%
▷ Public constants22100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
10 PNG files occupy 2.20MB with 1.54MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256×256.png35.51KB9.68KB▼ 72.74%
assets/screenshot-7.png317.64KB112.32KB▼ 64.64%
assets/screenshot-2.png214.60KB66.89KB▼ 68.83%
assets/screenshot-6.png382.40KB138.83KB▼ 63.69%
assets/screenshot-1.png310.92KB59.50KB▼ 80.86%