87% inventorypress

Code Review | InventoryPress

WordPress plugin InventoryPress scored 87% from 54 tests.

About plugin

  • Plugin page: inventorypress
  • Plugin version: v1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.4.1
  • WordPress version: 5.8.1
  • First release: Jul 24, 2012
  • Latest release: Mar 19, 2013
  • Number of updates: 15
  • Update frequency: every 15.9 days
  • Top authors: NolanD626 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 7,399 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

Server-side resources used by InventoryPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.16 ▲0.4435.06 ▲13.83
Dashboard /wp-admin3.40 ▲0.3446.15 ▲2.67
Posts /wp-admin/edit.php3.48 ▲0.3847.57 ▲4.56
Add New Post /wp-admin/post-new.php4.38 ▼1.0642.73 ▼609.14
Media Library /wp-admin/upload.php3.34 ▲0.3434.79 ▲9.59
New Product /wp-admin/post-new.php?post_type=products3.2223.35
New Material /wp-admin/post-new.php?post_type=materials3.2226.90
Brands /wp-admin/edit.php?post_type=brands3.3833.63
New Brand /wp-admin/post-new.php?post_type=brands3.2224.63
Products /wp-admin/edit.php?post_type=products3.3830.47
Materials /wp-admin/edit.php?post_type=materials3.3843.08
Inventory /wp-admin/edit.php?post_type=inventory3.3933.90
New Inventory Item /wp-admin/post-new.php?post_type=inventory3.2226.60

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 26 new files
Database: no new tables, no new options

Browser metrics 75% from 4 tests

InventoryPress: an overview of browser usage
Having an awesome user experience is important, so please improve the following
  • Nodes: For the best user experience, please reduce the number of DOM nodes under 25,000 (currently 26,477 on /wp-admin/post-new.php?post_type=inventory)
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,830 ▲23415.85 ▲0.168.64 ▼1.4144.66 ▼3.11
Dashboard /wp-admin3,096 ▲1655.92 ▼0.04134.90 ▼6.62134.74 ▲29.79
Posts /wp-admin/edit.php2,873 ▲1342.64 ▼0.0860.81 ▼0.5883.91 ▼17.13
Add New Post /wp-admin/post-new.php1,764 ▲9218.78 ▼0.04381.46 ▲2.53110.63 ▼0.17
Media Library /wp-admin/upload.php1,887 ▲805.06 ▲0.02129.55 ▼17.45144.82 ▲9.57
New Product /wp-admin/post-new.php?post_type=products2,1043.3481.62112.28
New Material /wp-admin/post-new.php?post_type=materials2,1043.3381.66113.42
Brands /wp-admin/edit.php?post_type=brands1,5752.6553.2773.40
New Brand /wp-admin/post-new.php?post_type=brands2,1653.3378.1189.09
Products /wp-admin/edit.php?post_type=products1,5272.6554.5170.25
Materials /wp-admin/edit.php?post_type=materials1,5272.6357.5177.68
Inventory /wp-admin/edit.php?post_type=inventory1,7962.6859.0867.15
New Inventory Item /wp-admin/post-new.php?post_type=inventory26,4773.74115.2281.53

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=inventory
    • > Notice in wp-content/plugins/inventorypress/inventory_type.php+5158
    Trying to get property 'post_type' of non-object
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=inventory
    • > Notice in wp-content/plugins/inventorypress/inventory_type.php+5033
    Undefined index: inv-nonce
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=inventory
    • > Notice in wp-content/plugins/inventorypress/brand_type.php+111
    Undefined index: csp-nonce
  • 16 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=inventory
    • > Notice in wp-content/plugins/inventorypress/brand_type.php+49
    Undefined variable: post_id
  • 64 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=inventory
    • > Notice in wp-content/plugins/inventorypress/brand_type.php+61
    Undefined variable: post_ID
  • 16 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=inventory
    • > Notice in wp-content/plugins/inventorypress/brand_type.php+60
    Undefined variable: post
  • 16 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=inventory
    • > Notice in wp-content/plugins/inventorypress/brand_type.php+60
    Trying to get property 'post_date' of non-object
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=brands
    • > Notice in wp-content/plugins/inventorypress/brand_type.php+77
    Undefined index: notes
  • 28 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=inventory
    • > Notice in wp-content/plugins/inventorypress/inventory_type.php+107
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/post-new.php?post_type=brands
    • > Notice in wp-content/plugins/inventorypress/brand_type.php+72
    Undefined index: company
    • > GET request to /wp-admin/post-new.php?post_type=brands
    • > Notice in wp-content/plugins/inventorypress/brand_type.php+73
    Undefined index: address1
    • > GET request to /wp-admin/post-new.php?post_type=brands
    • > Notice in wp-content/plugins/inventorypress/brand_type.php+74
    Undefined index: address2
    • > GET request to /wp-admin/post-new.php?post_type=brands
    • > Notice in wp-content/plugins/inventorypress/brand_type.php+75
    Undefined index: address3
    • > GET request to /wp-admin/post-new.php?post_type=brands
    • > Notice in wp-content/plugins/inventorypress/brand_type.php+76
    Undefined index: phone
    • > GET request to /wp-admin/post-new.php?post_type=brands
    • > Notice in wp-content/plugins/inventorypress/brand_type.php+78
    Undefined index: email
    • > GET request to /wp-admin/post-new.php?post_type=brands
    • > Notice in wp-content/plugins/inventorypress/brand_type.php+79
    Undefined index: password
    • > GET request to /wp-admin/post-new.php?post_type=inventory
    • > Notice in wp-content/plugins/inventorypress/inventory_type.php+88
    Undefined index: inventory_item_at_cost
    • > GET request to /wp-admin/post-new.php?post_type=inventory
    • > Notice in wp-content/plugins/inventorypress/inventory_type.php+89
    Undefined index: inventory_item_at_msrp
    • > GET request to /wp-admin/post-new.php?post_type=inventory
    • > Notice in wp-content/plugins/inventorypress/inventory_type.php+90
    Undefined index: inventory_item_reg_price
    • > GET request to /wp-admin/post-new.php?post_type=inventory
    • > Notice in wp-content/plugins/inventorypress/inventory_type.php+91
    Undefined index: inventory_item_on_sale
    • > GET request to /wp-admin/post-new.php?post_type=inventory
    • > Notice in wp-content/plugins/inventorypress/inventory_type.php+92
    Undefined index: inventory_item_desc
    • > GET request to /wp-admin/post-new.php?post_type=inventory
    • > Notice in wp-content/plugins/inventorypress/inventory_type.php+93
    Undefined index: inventory_item_upc
    • > GET request to /wp-admin/post-new.php?post_type=inventory
    • > Notice in wp-content/plugins/inventorypress/inventory_type.php+94
    Undefined index: inventory_item_part_grp
    • > GET request to /wp-admin/post-new.php?post_type=inventory
    • > Notice in wp-content/plugins/inventorypress/inventory_type.php+95
    Undefined index: inventory_item_style
    • > GET request to /wp-admin/post-new.php?post_type=inventory
    • > Notice in wp-content/plugins/inventorypress/inventory_type.php+96
    Undefined index: inventory_item_quantity
    • > GET request to /wp-admin/post-new.php?post_type=inventory
    • > Notice in wp-content/plugins/inventorypress/inventory_type.php+97
    Undefined index: inventory_material_color1
    • > GET request to /wp-admin/post-new.php?post_type=inventory
    • > Notice in wp-content/plugins/inventorypress/inventory_type.php+98
    Undefined index: inventory_material_color2
    • > GET request to /wp-admin/post-new.php?post_type=inventory
    • > Notice in wp-content/plugins/inventorypress/inventory_type.php+99
    Undefined index: inventory_material_size1
    • > GET request to /wp-admin/post-new.php?post_type=inventory
    • > Notice in wp-content/plugins/inventorypress/inventory_type.php+100
    Undefined index: inventory_material_size2
    • > GET request to /wp-admin/post-new.php?post_type=inventory
    • > Notice in wp-content/plugins/inventorypress/inventory_type.php+101
    Undefined index: inventory_material_size3
    • > GET request to /wp-admin/post-new.php?post_type=inventory
    • > Notice in wp-content/plugins/inventorypress/inventory_type.php+102
    Undefined index: inventory_materialtype
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=inventory
    • > Notice in wp-content/plugins/inventorypress/inventory_type.php+107
    Undefined index: inventory_producttype
    • > GET request to /wp-admin/post-new.php?post_type=inventory
    • > Notice in wp-content/plugins/inventorypress/inventory_type.php+105
    Undefined index: inventory_brandname

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
Please fix the following items
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/inventorypress/product_type.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/inventorypress/material_type.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/inventorypress/inventory_type.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/inventorypress/brand_type.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_custom() in wp-content/plugins/inventorypress/themefiles/single-inventory.php:13

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Plugin Name: You should set the name of your plugin on the first line ( === inventorypress === )
  • Screenshots: Add images for these screenshots: #1 (Easy "backend" Administration), #2 (Track data about your products better), #3 (Define Common Materials), #4 (Define Common Product Types), #5 (Define Common Brands)
The official readme.txt might help

inventorypress/inventory_type.php 85% from 13 tests

Analyzing the main PHP file in "InventoryPress" version v1.7
It is important to fix the following:
  • Version: The version number should only use digits and periods (ex. "1.0.3" instead of "v1.7")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("inventorypress.php" instead of "inventory_type.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin5,428 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP5153635,428

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.22
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%
Functions31
▷ Named functions31100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
14 PNG files occupy 1.93MB with 1.26MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
Screenshot3.png188.55KB67.97KB▼ 63.95%
Screenshot5.png189.95KB68.20KB▼ 64.10%
Screenshot2.png214.25KB77.24KB▼ 63.95%
images/brand_icon.png3.47KB0.97KB▼ 71.91%
screenshot-2.png214.25KB77.24KB▼ 63.95%