84% stock-count-report-for-woocommerce

Code Review | Stock Count Report for WooCommerce

WordPress plugin Stock Count Report for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: stock-count-repor...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.3
  • WordPress version: 6.3.1
  • First release: Nov 18, 2019
  • Latest release: Nov 18, 2019
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: woofx (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /1,235 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.06MB] [CPU: ▼2.37ms] Passed 4 tests

Analyzing server-side resources used by Stock Count Report for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0635.93 ▼4.05
Dashboard /wp-admin3.36 ▲0.0544.57 ▼7.42
Posts /wp-admin/edit.php3.47 ▲0.1250.33 ▲1.93
Add New Post /wp-admin/post-new.php5.94 ▲0.0596.33 ▲2.14
Media Library /wp-admin/upload.php3.28 ▲0.0535.93 ▲0.07

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Stock Count Report for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.29 ▼1.001.74 ▲0.0143.07 ▼0.91
Dashboard /wp-admin2,206 ▲154.84 ▼1.03111.46 ▲8.4841.70 ▼2.66
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0639.34 ▲1.8234.06 ▲1.89
Add New Post /wp-admin/post-new.php1,522 ▼1123.45 ▲0.15614.33 ▼75.8155.67 ▼5.18
Media Library /wp-admin/upload.php1,388 ▼04.27 ▲0.0495.08 ▼9.3540.09 ▼6.81

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/stock-count-report-for-woocommerce/admin/class-stock-table.php on line 14
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/stock-count-report-for-woocommerce/admin/class-stock-table.php on line 14
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/stock-count-report-for-woocommerce/admin/class-stock-table.php on line 14

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: stock, inventory, reports, woocommerce, stock count

stock-count-report-for-woocommerce/stock-count-report-woocommerce.php 85% from 13 tests

The principal PHP file in "Stock Count Report for WooCommerce" v. 1.0.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("stock-count-report-for-woocommerce.php" instead of "stock-count-report-woocommerce.php")
  • 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 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin408 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP10164573335
JavaScript1294773

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity5.00
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity1.80
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods35
▷ Static methods38.57%
▷ Public methods2982.86%
▷ Protected methods00.00%
▷ Private methods617.14%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin