73% wp-inventory-manager

Code Review | WP Inventory Manager

WordPress plugin WP Inventory Manager scored 73% from 54 tests.

About plugin

  • Plugin page: wp-inventory-manager
  • Plugin version: 2.1.0.14
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-6.1
  • WordPress version: 6.3.1
  • First release: Sep 1, 2015
  • Latest release: May 30, 2023
  • Number of updates: 151
  • Update frequency: every 18.8 days
  • Top authors: chuck1982 (100%)

Code review

54 tests

User reviews

33 reviews

Install metrics

2,000+ active / 97,504 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.90MB] [CPU: ▲11.90ms] Passed 4 tests

A check of server-side resources used by WP Inventory Manager
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /5.36 ▲1.9056.53 ▲17.51
Dashboard /wp-admin5.20 ▲1.9058.42 ▲4.77
Posts /wp-admin/edit.php5.32 ▲1.9661.24 ▲12.89
Add New Post /wp-admin/post-new.php7.78 ▲1.89103.04 ▲12.44
Media Library /wp-admin/upload.php5.12 ▲1.9058.17 ▲21.15
Add Ons /wp-admin/admin.php?page=wpim_manage_add_ons5.1349.39
Support /wp-admin/admin.php?page=wpim_manage_support5.1348.54
Import / Export /wp-admin/admin.php?page=wpim_promote_ie5.0942.09
Advanced Management /wp-admin/admin.php?page=wpim_promote_aim5.0956.16
Locations Manager /wp-admin/admin.php?page=wpim_promote_locations5.0953.35
Inventory Items /wp-admin/admin.php?page=wpim_manage_inventory_items5.1574.74
Settings /wp-admin/admin.php?page=wpim_manage_settings5.1449.77
Status /wp-admin/admin.php?page=wpinventory5.1560.97
Statuses /wp-admin/admin.php?page=wpim_manage_statuses5.1346.01
Categories /wp-admin/admin.php?page=wpim_manage_categories5.1347.97

Server storage [IO: ▲13.28MB] [DB: ▲0.05MB] 67% from 3 tests

A short overview of filesystem and database impact
Please fix the following
  • There were 1 file (0.00KB) illegally modified outside of "wp-content/plugins/wp-inventory-manager/" and "wp-content/uploads/"
    • (new file) wp-content/themes/twentytwentyone/wpinventory/.empty
Filesystem: 293 new files
Database: 8 new tables, 10 new options
New tables
wp_wpinventory_image
wp_wpinventory_reservation
wp_wpinventory_status
wp_wpinventory_label
wp_wpinventory_category
wp_wpinventory_item
wp_wpinventory_reservation_item
wp_wpinventory_media
New WordPress options
widget_wpinventory_latest_items_widget
widget_wpinventory_categories_widget
can_compress_scripts
theysaidso_admin_options
wpim_default_data
wpinventory_settings
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for WP Inventory Manager
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,968 ▲23313.62 ▼0.869.33 ▲7.6943.50 ▼2.67
Dashboard /wp-admin2,287 ▲994.89 ▼1.0297.34 ▼17.1684.47 ▲42.52
Posts /wp-admin/edit.php2,164 ▲782.03 ▼0.0137.95 ▲3.0135.92 ▲1.87
Add New Post /wp-admin/post-new.php1,740 ▲22622.81 ▲5.36690.74 ▼8.0661.98 ▲0.40
Media Library /wp-admin/upload.php2,174 ▲7865.50 ▲1.29120.19 ▲19.8685.41 ▲36.78
Add Ons /wp-admin/admin.php?page=wpim_manage_add_ons1,1843.3440.0699.39
Support /wp-admin/admin.php?page=wpim_manage_support1,1143.4154.2865.27
Import / Export /wp-admin/admin.php?page=wpim_promote_ie1,5639.59280.36102.31
Advanced Management /wp-admin/admin.php?page=wpim_promote_aim1,5309.53272.7060.10
Locations Manager /wp-admin/admin.php?page=wpim_promote_locations1,5369.60287.6857.19
Inventory Items /wp-admin/admin.php?page=wpim_manage_inventory_items1,4413.3545.2689.34
Settings /wp-admin/admin.php?page=wpim_manage_settings3,1684.2170.74120.51
Status /wp-admin/admin.php?page=wpinventory1,1093.3540.6275.06
Statuses /wp-admin/admin.php?page=wpim_manage_statuses1,1123.3740.6066.33
Categories /wp-admin/admin.php?page=wpim_manage_categories1,1263.2842.7978.80

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure failed, leaving 8 tables in the database
    • wp_wpinventory_category
    • wp_wpinventory_item
    • wp_wpinventory_reservation_item
    • wp_wpinventory_media
    • wp_wpinventory_reservation
    • wp_wpinventory_status
    • wp_wpinventory_label
    • wp_wpinventory_image
  • Zombie WordPress options were found after uninstall: 10 options
    • theysaidso_admin_options
    • widget_wpinventory_categories_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • wpinventory_settings
    • widget_recent-posts
    • wpim_default_data
    • widget_theysaidso_widget
    • widget_wpinventory_latest_items_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
The following issues need your attention
  • 32× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WPIMCore' not found in wp-content/plugins/wp-inventory-manager/includes/wpinventory.default.php:3
    • > PHP Notice
      Undefined variable: display_address in wp-content/plugins/wp-inventory-manager/views/reserve-form.php on line 26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/wp-inventory-manager/views/single-loop-all-table.php:21
    • > PHP Notice
      Undefined variable: display_zip in wp-content/plugins/wp-inventory-manager/views/reserve-form.php on line 53
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpinventory_get_items() in wp-content/plugins/wp-inventory-manager/views/loop-search.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpinventory_get_display_settings() in wp-content/plugins/wp-inventory-manager/views/widget-latest-items-single.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-inventory-manager/includes/wpinventory.reserve.class.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpinventory_is_single() in wp-content/plugins/wp-inventory-manager/views/loop-category.php:19
    • > PHP Notice
      Undefined variable: error in wp-content/plugins/wp-inventory-manager/views/reserve-form.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpinventory_have_items() in wp-content/plugins/wp-inventory-manager/views/widget-latest-items-loop.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

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
2 plugin tags: inventory, inventory manager

wp-inventory-manager/wpinventory.php 85% from 13 tests

The main PHP script in "WP Inventory Manager" version 2.1.0.14 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-inventory-manager.php" instead of "wpinventory.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected59,853 lines of code in 199 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript797,60016,96627,050
PO File83,8534,9039,525
PHP412,2912,0489,376
CSS404471967,416
SVG1002,671
Sass1587372,055
LESS1434441,758
Markdown1002

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity42.44
▷ Minimum class complexity1.00
▷ Maximum class complexity319.00
Average method complexity3.34
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes25
▷ Abstract classes28.00%
▷ Concrete classes2392.00%
▷ Final classes28.70%
Methods422
▷ Static methods25159.48%
▷ Public methods30171.33%
▷ Protected methods5011.85%
▷ Private methods7116.82%
Functions121
▷ Named functions10586.78%
▷ Anonymous functions1613.22%
Constants13
▷ Global constants17.69%
▷ Class constants1292.31%
▷ Public constants12100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
32 PNG files occupy 1.38MB with 0.71MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-5.png73.99KB20.56KB▼ 72.21%
images/icons/disable_detail_page.png2.68KB1.16KB▼ 56.78%
images/admin-h-icon.png17.70KB8.25KB▼ 53.38%
assets/screenshot-2.png67.62KB15.94KB▼ 76.43%
images/icons/advanced_user_control.png4.68KB4.72KB0.00%