74% piwi-warehouse

Code Review | Piwi Warehouse

WordPress plugin Piwi Warehouse scored74%from 54 tests.

About plugin

  • Plugin page: piwi-warehouse
  • Plugin version: 3.1.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Dec 13, 2020
  • Latest release: Sep 26, 2023
  • Number of updates: 13
  • Update frequency: every 136.8 days
  • Top authors: roccomarco (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /587 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.35MB] [CPU: ▲3.66ms] Passed 4 tests

An overview of server-side resources used by Piwi Warehouse
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.3141.02 ▲7.22
Dashboard /wp-admin3.66 ▲0.3651.48 ▲6.43
Posts /wp-admin/edit.php3.80 ▲0.4450.18 ▲4.68
Add New Post /wp-admin/post-new.php6.26 ▲0.3885.58 ▼1.20
Media Library /wp-admin/upload.php3.59 ▲0.3638.42 ▲4.72
Manage Capabilities /wp-admin/admin.php?page=pwwh_capabilities3.9038.22
Consistency Tool /wp-admin/admin.php?page=pwwh_consistency3.5533.56
Piwi Warehouse /wp-admin/admin.php?page=pwwh_main3.5431.57

Server storage [IO: ▲0.75MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 130 new files
Database: 1 new table, 7 new options
New tables
pwwh_movement_history
New WordPress options
widget_recent-comments
theysaidso_admin_options
pwwh_caps_rev
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Piwi Warehouse: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,980 ▲19413.65 ▼0.641.64 ▼0.2843.69 ▼3.30
Dashboard /wp-admin2,386 ▲2065.49 ▼0.1686.88 ▲1.4737.23 ▼2.46
Posts /wp-admin/edit.php2,291 ▲1912.67 ▲0.6537.06 ▲1.6134.49 ▼0.11
Add New Post /wp-admin/post-new.php1,870 ▲34425.45 ▲2.46588.73 ▼62.7036.50 ▼15.70
Media Library /wp-admin/upload.php1,591 ▲1884.91 ▲0.72103.28 ▲3.8642.66 ▼0.84
Manage Capabilities /wp-admin/admin.php?page=pwwh_capabilities4,1412.2333.7052.14
Consistency Tool /wp-admin/admin.php?page=pwwh_consistency9482.3229.2223.97
Piwi Warehouse /wp-admin/admin.php?page=pwwh_main1,0612.3230.5525.18

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie tables were found after uninstall: 1 table
    • pwwh_movement_history
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • pwwh_caps_rev
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
  • 112× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/piwi-warehouse/core/items/item-hook.php:85
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/piwi-warehouse/core/movements/movement-ajax.php:51
    • > PHP Warning
      Use of undefined constant PWWH_PREFIX - assumed 'PWWH_PREFIX' (this will throw an Error in a future version of PHP) in wp-content/plugins/piwi-warehouse/core/movements/movement.php on line 14
    • > PHP Warning
      Use of undefined constant PWWH_LIB_DIR - assumed 'PWWH_LIB_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/piwi-warehouse/lib/ui/ui-flexboxes.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/piwi-warehouse/admin/_common/common-hook.php:57
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/piwi-warehouse/admin/caps/caps-hook.php:66
    • > PHP Warning
      Use of undefined constant PWWH_PREFIX - assumed 'PWWH_PREFIX' (this will throw an Error in a future version of PHP) in wp-content/plugins/piwi-warehouse/admin/_main/main.php on line 19
    • > PHP Warning
      Use of undefined constant PWWH_ADMIN_DIR - assumed 'PWWH_ADMIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/piwi-warehouse/admin/admin.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/piwi-warehouse/core/movements/movement-hook.php:94
    • > PHP Fatal error
      require_once(): Failed opening required 'PWWH_CORE_DIR/core-api.php' (include_path='.:/usr/share/php') in wp-content/plugins/piwi-warehouse/core/core.php on line 40

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: Please add images for these screenshots: #1 (Overview of the main Warehouse menu), #2 (An example of a Movement), #3 (Screenshot of the Capability Engine)
The official readme.txt is a good inspiration

piwi-warehouse/piwi-warehouse.php Passed 13 tests

"Piwi Warehouse" version 3.1.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
18 characters long description:
Warehouse manager.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin13,012 lines of code in 105 files:
LanguageFilesBlank linesComment linesLines of code
PHP652,1545,6929,578
JavaScript305931,1762,184
CSS102662331,250

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity12.12
▷ Minimum class complexity4.00
▷ Maximum class complexity40.00
Average method complexity3.34
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods38
▷ Static methods00.00%
▷ Public methods3694.74%
▷ Protected methods12.63%
▷ Private methods12.63%
Functions316
▷ Named functions31599.68%
▷ Anonymous functions10.32%
Constants189
▷ Global constants189100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected