10% order-and-inventory-manager-for-woocommerce

Code Review | Order and Inventory Manager for WooCommerce

WordPress plugin Order and Inventory Manager for WooCommerce scored 10% from 54 tests.

About plugin

  • Plugin page: order-and-invento...
  • Plugin version: 1.3.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.8.1
  • WordPress version: 5.9.2
  • First release: Jan 2, 2020
  • Latest release: Oct 18, 2021
  • Number of updates: 52
  • Update frequency: every 12.6 days
  • Top authors: stylingwebben (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 2,084 total downloads

Benchmarks

Plugin footprint 22% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5768
    wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)

Server metrics [RAM: ▲4.46MB] [CPU: ▼290.15ms] Passed 4 tests

A check of server-side resources used by Order and Inventory Manager for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /8.42 ▲4.9175.33 ▲19.90
Dashboard /wp-admin8.44 ▲5.0357.92 ▲24.10
Posts /wp-admin/edit.php8.44 ▲4.8059.66 ▲21.92
Add New Post /wp-admin/post-new.php10.07 ▲3.09114.22 ▼1,223.03
Media Library /wp-admin/upload.php8.44 ▲5.1443.12 ▲20.60
Freemius Debug [v.2.4.2] /wp-admin/admin.php?page=freemius8.4441.19

Server storage [IO: ▲28.17MB] [DB: ▲0.01MB] 67% from 3 tests

A short overview of filesystem and database impact
Please try to fix the following items
  • Try to limit filesystem usage to 25MB (currently using 28.17MB)
Filesystem: 863 new files
Database: 3 new tables, 5 new options
New tables
wp_order_inventory
wp_additional_supplier_info
wp_oim_product_stock
New WordPress options
fs_accounts
fs_active_plugins
fs_debug_mode
fs_gdpr
oim_product_stock

Browser metrics Passed 4 tests

Checking browser requirements for Order and Inventory Manager for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,866 ▲11215.98 ▼0.087.08 ▲1.112.69 ▲0.12
Dashboard /wp-admin2,960 ▲1096.12 ▼0.01116.33 ▼21.35177.14 ▲12.55
Posts /wp-admin/edit.php2,757 ▲663.36 ▲0.1363.34 ▼3.50157.33 ▲17.24
Add New Post /wp-admin/post-new.php1,697 ▲3616.95 ▼5.35411.75 ▼24.93159.50 ▼0.92
Media Library /wp-admin/upload.php1,770 ▲695.50 ▲0.01139.94 ▲2.07204.41 ▲21.40
Freemius Debug [v.2.4.2] /wp-admin/admin.php?page=freemius1,4732.5052.93110.52

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/order-and-inventory-manager-for-woocommerce/freemius/includes/class-freemius.php+8552
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 3 tables in the database
    • wp_additional_supplier_info
    • wp_order_inventory
    • wp_oim_product_stock
  • This plugin does not fully uninstall, leaving 5 options in the database
    • fs_gdpr
    • fs_active_plugins
    • fs_accounts
    • fs_debug_mode
    • oim_product_stock

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/order-and-inventory-manager-for-woocommerce/freemius/templates/ajax-loader.php
    • > /wp-content/plugins/order-and-inventory-manager-for-woocommerce/js-templates/completed_po_tmpl.php
  • 410× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/order-and-inventory-manager-for-woocommerce/includes/mPDF/vendor/mpdf/mpdf/src/Tag/Time.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'PhpOffice\\PhpSpreadsheet\\Writer\\IWriter' not found in wp-content/plugins/order-and-inventory-manager-for-woocommerce/includes/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/BaseWriter.php:5
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/order-and-inventory-manager-for-woocommerce/classes/class.data_delivery_table.php on line 12
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpWord\\Writer\\Word2007\\Part\\AbstractPart' not found in wp-content/plugins/order-and-inventory-manager-for-woocommerce/includes/PhpOffice/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Part/DocPropsCore.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpWord\\Writer\\Word2007\\Part\\AbstractPart' not found in wp-content/plugins/order-and-inventory-manager-for-woocommerce/includes/PhpOffice/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Part/Numbering.php:30
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/order-and-inventory-manager-for-woocommerce/classes/class.order_status_list.php on line 10
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/order-and-inventory-manager-for-woocommerce/includes/mPDF/vendor/mpdf/mpdf/src/Tag/DotTab.php:5
    • > PHP Warning
      Use of undefined constant OIMWC_PLUGIN_DIR - assumed 'OIMWC_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/order-and-inventory-manager-for-woocommerce/modules/wp-search/wp-search.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpWord\\Writer\\Word2007\\Style\\Frame' not found in wp-content/plugins/order-and-inventory-manager-for-woocommerce/includes/PhpOffice/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Image.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/order-and-inventory-manager-for-woocommerce/templates/display_product_stock.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

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: woocommerce, order management, inventory management

order-and-inventory-manager-for-woocommerce/order-and-inventory-manager-for-woocommerce.php 92% from 13 tests

The main PHP file in "Order and Inventory Manager for WooCommerce" ver. 1.3.4 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("4.0" instead of "3.0.0")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected181,927 lines of code in 757 files:
LanguageFilesBlank linesComment linesLines of code
PHP69826,19150,431142,897
PO File158,15010,33018,085
SVG30128,777
JavaScript119044315,996
CSS191632035,606
Markdown41810388
JSON430146
XML10019
YAML11110
Bourne Shell1203

PHP code 0% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
The following items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 7,012)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 460)
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity51.54
▷ Minimum class complexity1.00
▷ Maximum class complexity7,012.00
Average method complexity6.52
▷ Minimum method complexity1.00
▷ Maximum method complexity460.00
Code structure
Namespaces74
Interfaces16
Traits6
Classes508
▷ Abstract classes285.51%
▷ Concrete classes48094.49%
▷ Final classes193.96%
Methods4,865
▷ Static methods64013.16%
▷ Public methods3,99682.14%
▷ Protected methods1943.99%
▷ Private methods67513.87%
Functions221
▷ Named functions19085.97%
▷ Anonymous functions3114.03%
Constants1,067
▷ Global constants12011.25%
▷ Class constants94788.75%
▷ Public constants947100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
15 PNG files occupy 0.08MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/OIMWC_admin_menu_icon_grey.png3.25KB3.11KB▼ 4.24%
images/OIMWC_admin_menu_icon_blue.png3.25KB3.11KB▼ 4.29%
images/logo.png7.02KB7.01KB0.13%
images/tooltip-corner1.png1.17KB0.19KB▼ 84.07%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%