79% inventory-history

Code Review | Inventory History

WordPress plugin Inventory History scored79%from 54 tests.

About plugin

  • Plugin page: inventory-history
  • Plugin version: 0.1.2
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4.2
  • WordPress version: 6.3.1
  • First release: Jun 23, 2020
  • Latest release: Jun 27, 2020
  • Number of updates: 5
  • Update frequency: every 0.8 days
  • Top authors: yashar_hv (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

500+ active /1,776 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

This is a short check of server-side resources used by Inventory History
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0231.16 ▼9.31
Dashboard /wp-admin3.33 ▲0.0341.82 ▼6.43
Posts /wp-admin/edit.php3.38 ▲0.0246.02 ▲5.01
Add New Post /wp-admin/post-new.php5.91 ▲0.0275.00 ▼19.80
Media Library /wp-admin/upload.php3.25 ▲0.0233.63 ▲3.41

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 8 new files
Database: 1 new table, 7 new options
New tables
wp_wc_inventory_history
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
WCIH_version
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Inventory History
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.26 ▼1.361.59 ▼0.1839.64 ▼4.35
Dashboard /wp-admin2,206 ▲154.86 ▲0.01113.60 ▲8.6042.62 ▲3.73
Posts /wp-admin/edit.php2,086 ▼32.06 ▲0.0540.00 ▲0.7736.11 ▼2.69
Add New Post /wp-admin/post-new.php1,534 ▼822.72 ▲4.62639.65 ▲13.0855.63 ▼12.44
Media Library /wp-admin/upload.php1,388 ▲34.20 ▼0.0195.13 ▼22.8941.67 ▼9.18

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_wc_inventory_history
  • The uninstall procedure has failed, leaving 7 options in the database
    • WCIH_version
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: stock history, woocommerce, stock log, products

inventory-history/wc-inventory-history.php 85% from 13 tests

The principal PHP file in "Inventory History" v. 0.1.2 is loaded by WordPress automatically on each request
The following require your attention:
  • 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: Name the main plugin file the same as the plugin slug ("inventory-history.php" instead of "wc-inventory-history.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
No dangerous file extensions were detected808 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP7165172808

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.34
Average class complexity15.17
▷ Minimum class complexity6.00
▷ Maximum class complexity32.00
Average method complexity2.57
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods54
▷ Static methods1222.22%
▷ Public methods4685.19%
▷ Protected methods00.00%
▷ Private methods814.81%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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