82% swiss-knife-for-woocommerce

Code Review | Swiss Knife for WooCommerce

WordPress plugin Swiss Knife for WooCommerce scored82%from 54 tests.

About plugin

  • Plugin page: swiss-knife-for-w...
  • Plugin version: 0.2
  • PHP compatiblity: 5.6 or higher+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-5.9.2
  • WordPress version: 6.3.1
  • First release: Apr 2, 2021
  • Latest release: Mar 28, 2022
  • Number of updates: 9
  • Update frequency: every 41.0 days
  • Top authors: wpvibes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /651 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.73ms] Passed 4 tests

A check of server-side resources used by Swiss Knife for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.78 ▼3.22
Dashboard /wp-admin3.31 ▲0.0145.72 ▼4.30
Posts /wp-admin/edit.php3.36 ▲0.0046.69 ▲0.15
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.94 ▲1.10
Media Library /wp-admin/upload.php3.23 ▲0.0035.62 ▼7.55

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

Input-output and database impact of this plugin
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-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Swiss Knife for WooCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲7413.30 ▼1.081.95 ▼0.1740.92 ▼2.43
Dashboard /wp-admin2,212 ▲215.82 ▼0.10100.97 ▼11.2240.22 ▼1.64
Posts /wp-admin/edit.php2,095 ▲62.02 ▲0.0239.38 ▲6.0838.10 ▲3.89
Add New Post /wp-admin/post-new.php1,548 ▲1218.44 ▼4.90618.45 ▼44.2362.88 ▲2.85
Media Library /wp-admin/upload.php1,394 ▲64.18 ▼0.1396.92 ▼3.9245.05 ▲0.28

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Please take a closer look at the following
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WPV_SKW\\Base\\Settings' not found in wp-content/plugins/swiss-knife-for-woocommerce/includes/modules/cancel-order/settings.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Settings_Page' not found in wp-content/plugins/swiss-knife-for-woocommerce/includes/core/settings.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WPV_SKW\\Base\\Settings' not found in wp-content/plugins/swiss-knife-for-woocommerce/includes/modules/repeat-order/settings.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 76% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes: You can look at the official readme.txt

swiss-knife-for-woocommerce/swiss-knife-woo.php 62% from 13 tests

Analyzing the main PHP file in "Swiss Knife for WooCommerce" version 0.2
Please make the necessary changes and fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/i18n/languages/")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Requires PHP: Required version number formatted incorrectly (ex. "7.0" instead of "5.6 or higher")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.0" instead of "5.4")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("swiss-knife-for-woocommerce.php" instead of "swiss-knife-woo.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
There were no executable files found in this plugin1,204 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP183262431,005
CSS1207101
JavaScript130151
SVG10147

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity7.79
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.30
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces8
Interfaces0
Traits0
Classes14
▷ Abstract classes17.14%
▷ Concrete classes1392.86%
▷ Final classes00.00%
Methods75
▷ Static methods810.67%
▷ Public methods6586.67%
▷ Protected methods22.67%
▷ Private methods810.67%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants9
▷ Global constants9100.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
No PNG files were detected