84% better-management-reserved-stock-for-woocommerce

Code Review | Better Management Reserved Stock - WooCommerce

WordPress plugin Better Management Reserved Stock - WooCommerce scored 84% from 54 tests.

About plugin

  • Plugin page: better-management...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.7.2
  • WordPress version: 6.3.1
  • First release: Jul 21, 2021
  • Latest release: Jul 21, 2021
  • Number of updates: 4
  • Update frequency: every 1.5 days
  • Top authors: tiagohellodev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 3,048 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
Installer ran successfully

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

Analyzing server-side resources used by Better Management Reserved Stock - WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.40 ▼0.0623.86 ▼16.38
Dashboard /wp-admin3.32 ▲0.0252.73 ▲3.00
Posts /wp-admin/edit.php3.37 ▲0.0248.55 ▲1.69
Add New Post /wp-admin/post-new.php5.92 ▲0.0491.01 ▼6.01
Media Library /wp-admin/upload.php3.25 ▲0.0235.23 ▲0.99

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Better Management Reserved Stock - WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,489 ▼24614.45 ▲0.000.53 ▼1.4616.26 ▼26.90
Dashboard /wp-admin2,230 ▲455.83 ▼0.0794.19 ▼4.9039.77 ▲0.40
Posts /wp-admin/edit.php2,116 ▲272.05 ▲0.0840.28 ▲0.6135.18 ▼1.08
Add New Post /wp-admin/post-new.php1,547 ▲1223.17 ▲0.36642.50 ▼11.7569.92 ▲10.30
Media Library /wp-admin/upload.php1,412 ▲244.19 ▼0.0394.31 ▼10.9243.97 ▲0.97

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/better-management-reserved-stock-for-woocommerce/admin/partials/bm-reserved-stock-wc-admin-display.php
    • > /wp-content/plugins/better-management-reserved-stock-for-woocommerce/public/partials/bm-reserved-stock-wc-public-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
7 plugin tags: stock, manage stock, checkout, cart, woocommerce...

better-management-reserved-stock-for-woocommerce/bm-reserved-stock-wc.php 85% from 13 tests

Analyzing the main PHP file in "Better Management Reserved Stock - WooCommerce" version 1.0.0
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("better-management-reserved-stock-for-woocommerce.php" instead of "bm-reserved-stock-wc.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin355 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12160563326
JavaScript282729
CSS2080

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity5.14
▷ Minimum class complexity1.00
▷ Maximum class complexity22.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods29
▷ Static methods26.90%
▷ Public methods2482.76%
▷ Protected methods00.00%
▷ Private methods517.24%
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

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin