77% ship-safely

Code Review | Ship-Safely

WordPress plugin Ship-Safely scored 77% from 54 tests.

About plugin

  • Plugin page: ship-safely
  • Plugin version: 3.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.3
  • WordPress version: 6.3.1
  • First release: Jun 15, 2022
  • Latest release: Aug 18, 2023
  • Number of updates: 11
  • Update frequency: every 42.1 days
  • Top authors: shipsafely (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 275 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.15ms] Passed 4 tests

Server-side resources used by Ship-Safely
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0241.61 ▲1.02
Dashboard /wp-admin3.32 ▲0.0246.11 ▼2.18
Posts /wp-admin/edit.php3.37 ▲0.0246.50 ▲2.99
Add New Post /wp-admin/post-new.php5.93 ▲0.0483.16 ▼14.20
Media Library /wp-admin/upload.php3.25 ▲0.0236.71 ▲2.76

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 55 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
shpsafe_woo_user_api_token
shpsafe_woo_admin_api_token
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Ship-Safely
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,863 ▲9214.86 ▲0.5714.96 ▲13.1643.53 ▲0.88
Dashboard /wp-admin2,233 ▲456.01 ▲1.10129.46 ▲28.1041.94 ▲0.07
Posts /wp-admin/edit.php2,116 ▲272.69 ▲0.6952.47 ▲15.9136.87 ▲3.19
Add New Post /wp-admin/post-new.php1,537 ▲2323.93 ▲6.44632.61 ▼32.5769.56 ▲7.80
Media Library /wp-admin/upload.php1,409 ▲215.07 ▲0.83111.46 ▲9.6843.69 ▼0.32

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

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
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/ship-safely/public/partials/nano-insurance-public-display.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ship-safely/route/index.php:45

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% 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
These attributes need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Wordpress admin console), #2 (Login and registration page), #3 (One-click cart protection on checkout), #4 (Track and earn commission for each policy sold), #5 (View and manage policies sold through your shop)
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === ship-safely === )
You can look at the official readme.txt

ship-safely/nano-insurance.php 85% from 13 tests

The main file in "Ship-Safely" v. 3.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("ship-safely.php" instead of "nano-insurance.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected36,537 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript43,9436,36334,349
CSS6158241815
SVG201788
PHP15196638583
HTML2002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity5.90
▷ Minimum class complexity1.00
▷ Maximum class complexity31.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods41
▷ Static methods1536.59%
▷ Public methods3482.93%
▷ Protected methods00.00%
▷ Private methods717.07%
Functions7
▷ Named functions685.71%
▷ Anonymous functions114.29%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/dist/glyph-c.png19.54KB7.94KB▼ 59.37%
public/dist/logo-min-c.png9.22KB4.49KB▼ 51.25%
public/dist/logo-glyph-b.png1.60KB1.57KB▼ 1.77%