89% wtt-woo-stock-addon

Code Review | Wtt stock addon for WooCommerce

WordPress plugin Wtt stock addon for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: wtt-woo-stock-addon
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.0-5.7
  • WordPress version: 6.3.1
  • First release: Jun 13, 2021
  • Latest release: Jun 13, 2021
  • Number of updates: 2
  • Update frequency: every 1.5 days
  • Top authors: kardi420 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /391 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

Server-side resources used by Wtt stock addon for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.78 ▼6.62
Dashboard /wp-admin3.31 ▲0.0049.86 ▲0.37
Posts /wp-admin/edit.php3.36 ▲0.0050.17 ▼0.68
Add New Post /wp-admin/post-new.php5.89 ▲0.0094.99 ▼8.02
Media Library /wp-admin/upload.php3.23 ▲0.0040.37 ▲4.56

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Wtt stock addon for WooCommerce: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.38 ▲0.221.87 ▲0.0540.29 ▼4.22
Dashboard /wp-admin2,198 ▲215.60 ▼0.1190.82 ▲1.5943.06 ▲1.31
Posts /wp-admin/edit.php2,103 ▼02.02 ▲0.0139.51 ▲1.5436.37 ▲0.78
Add New Post /wp-admin/post-new.php1,550 ▲2423.13 ▲5.53656.13 ▼35.1161.52 ▲1.68
Media Library /wp-admin/upload.php1,397 ▼04.27 ▲0.05107.62 ▲8.4346.29 ▲0.44

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 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 does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: stock, woocommerce, wordpress

wtt-woo-stock-addon/index.php 69% from 13 tests

"Wtt stock addon for WooCommerce" version 1.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:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wtt-woo-stock-addon.php" instead of "index.php")
  • Domain Path: The domain path points to a folder that does not exist ("/languages/")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.8" instead of "4.2.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin17 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1121317

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.67
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin