10% shelf-planner

Code Review | Inventory Management Free

WordPress plugin Inventory Management Free scored10%from 54 tests.

About plugin

  • Plugin page: shelf-planner
  • Plugin version: 1.0.16
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-6.3
  • WordPress version: 6.3.1
  • First release: Oct 15, 2021
  • Latest release: Oct 13, 2023
  • Number of updates: 67
  • Update frequency: every 10.9 days
  • Top authors: shelfplanner (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

90+ active /4,169 total downloads

Benchmarks

Plugin footprint 57% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > Error in wp-content/plugins/shelf-planner/shelf-planner.php+361
    Uncaught Error: Call to undefined function get_woocommerce_currency() in wp-content/plugins/shelf-planner/shelf-planner.php:361
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): {closure}()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/includes/plugin.php(693): do_action()

Server metrics [RAM: ▼0.01MB] [CPU: ▼7.99ms] Passed 4 tests

An overview of server-side resources used by Inventory Management Free
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.89 ▼2.54
Dashboard /wp-admin3.31 ▼0.0445.55 ▼15.56
Posts /wp-admin/edit.php3.36 ▲0.0043.96 ▼2.91
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.51 ▼10.96
Media Library /wp-admin/upload.php3.23 ▲0.0037.26 ▲6.07

Server storage [IO: ▲43.56MB] [DB: ▲0.07MB] 67% from 3 tests

A short overview of filesystem and database impact
These are issues you should consider
  • The filesystem usage should be lower than 25MB (currently using 43.56MB)
Filesystem: 470 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
sp.wizard_in_progress
sp.full_screen
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Inventory Management Free
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.25 ▼0.011.63 ▼0.0439.56 ▼1.04
Dashboard /wp-admin2,195 ▲185.50 ▼0.0882.88 ▼7.0337.27 ▼3.07
Posts /wp-admin/edit.php2,100 ▼32.01 ▲0.0533.34 ▼2.9034.26 ▼0.71
Add New Post /wp-admin/post-new.php1,526 ▼322.90 ▼0.04649.77 ▼17.7752.23 ▲1.91
Media Library /wp-admin/upload.php1,400 ▲94.22 ▲0.02101.22 ▲1.4143.76 ▲1.61

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • sp.wizard_in_progress
    • widget_theysaidso_widget
    • sp.full_screen
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/shelf-planner/footer.php
    • > /wp-content/plugins/shelf-planner/pages/admin_page_header.php
    • > /wp-content/plugins/shelf-planner/pages/header_js.php
  • 91× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/shelf-planner/vendor/stephenharris/wp-query-builder/tests/UnitTests/DeleteTest.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/shelf-planner/header.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/shelf-planner/popups.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_woocommerce_currencies() in wp-content/plugins/shelf-planner/pages/settings-forecast.php:53
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sp_get_categories() in wp-content/plugins/shelf-planner/pages/stock_analyses.php:13
    • > PHP Warning
      Use of undefined constant SP_ROOT_DIR - assumed 'SP_ROOT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/shelf-planner/pages/integrations.php on line 21
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/shelf-planner/vendor/stephenharris/wp-query-builder/tests/UnitTests/InsertTest.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sp_get_categories() in wp-content/plugins/shelf-planner/pages/ajax/replenish-table-stat-second.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'SPHD_Wizard' not found in wp-content/plugins/shelf-planner/wizard/_footer.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/shelf-planner/pages/settings-product.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 96% 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
3 plugin tags: sales forecast, demand planning, inventory management

shelf-planner/shelf-planner.php 92% from 13 tests

This is the main PHP file of "Inventory Management Free" version 1.0.16, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin394,883 lines of code in 379 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2169,27051,996251,443
CSS2821,71359694,896
PHP1444,1075,85625,867
Sass102,127013,545
SVG16721288,107
Markdown22000723
HTML101129
JSON20088
XML20050
Bourne Shell1101022
YAML15013

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity22.47
▷ Minimum class complexity1.00
▷ Maximum class complexity169.00
Average method complexity3.31
▷ Minimum method complexity1.00
▷ Maximum method complexity73.00
Code structure
Namespaces13
Interfaces3
Traits0
Classes72
▷ Abstract classes22.78%
▷ Concrete classes7097.22%
▷ Final classes2637.14%
Methods709
▷ Static methods15321.58%
▷ Public methods57781.38%
▷ Protected methods10214.39%
▷ Private methods304.23%
Functions84
▷ Named functions7083.33%
▷ Anonymous functions1416.67%
Constants57
▷ Global constants1628.07%
▷ Class constants4171.93%
▷ Public constants41100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
37 PNG files occupy 1.49MB with 1.27MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/media/illustrate.png15.75KB0.36KB▼ 97.69%
assets/img/brand/logo.png3.53KB2.22KB▼ 37.03%
assets/img/media/illustrate2.png15.54KB0.36KB▼ 97.66%
assets/img/media/calendar.png8.33KB0.20KB▼ 97.64%
assets/img/mastercard.png2.78KB0.08KB▼ 97.02%