78% price-matrix-for-woocommerce

Code Review | Price Matrix for WooCommerce

WordPress plugin Price Matrix for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: price-matrix-for-...
  • Plugin version: 1.2.2
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.9.3
  • WordPress version: 6.3.1
  • First release: Apr 8, 2018
  • Latest release: Apr 7, 2022
  • Number of updates: 20
  • Update frequency: every 73.0 days
  • Top authors: azmarket (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,851 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼10.64ms] Passed 4 tests

A check of server-side resources used by Price Matrix for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.59 ▼5.92
Dashboard /wp-admin3.32 ▲0.0252.10 ▲0.11
Posts /wp-admin/edit.php3.38 ▲0.0245.88 ▼4.62
Add New Post /wp-admin/post-new.php5.91 ▲0.0283.48 ▼29.49
Media Library /wp-admin/upload.php3.25 ▲0.0235.42 ▼2.53

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 41 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Price Matrix for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,798 ▲3714.28 ▼0.011.88 ▼0.2943.25 ▲0.68
Dashboard /wp-admin2,201 ▲215.59 ▼0.0086.08 ▼1.6341.43 ▼4.82
Posts /wp-admin/edit.php2,113 ▲131.99 ▼0.0235.61 ▼3.2640.01 ▲2.82
Add New Post /wp-admin/post-new.php1,535 ▲922.96 ▼0.64685.24 ▲12.2958.55 ▲0.82
Media Library /wp-admin/upload.php1,412 ▲154.19 ▼0.09104.46 ▲0.5845.46 ▲0.58

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

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
The smoke test was a success, however most plugin functionality was not tested

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
  • 8× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/price-matrix-for-woocommerce/templates/table-4.php
    • > /wp-content/plugins/price-matrix-for-woocommerce/templates/table-2.php
    • > /wp-content/plugins/price-matrix-for-woocommerce/templates/table-horizontal-1.php
    • > /wp-content/plugins/price-matrix-for-woocommerce/templates/table-horizontal-3.php
    • > /wp-content/plugins/price-matrix-for-woocommerce/templates/table-vertical-3.php
    • > /wp-content/plugins/price-matrix-for-woocommerce/admin/metabox/tpl.notice.php
    • > /wp-content/plugins/price-matrix-for-woocommerce/templates/table-vertical-1.php
    • > /wp-content/plugins/price-matrix-for-woocommerce/admin/metabox/tpl.order.php
  • 43× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/price-matrix-for-woocommerce/templates/table-horizontal-3.php on line 20
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/price-matrix-for-woocommerce/templates/table-2.php on line 10
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/price-matrix-for-woocommerce/templates/table-horizontal-1.php on line 9
    • > PHP Notice
      Undefined variable: is_admin in wp-content/plugins/price-matrix-for-woocommerce/templates/table-horizontal-1.php on line 1
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/price-matrix-for-woocommerce/templates/table-vertical-3.php on line 6
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/price-matrix-for-woocommerce/admin/metabox/tpl.metabox.php:16
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/price-matrix-for-woocommerce/templates/table-vertical-1.php on line 3
    • > PHP Notice
      Undefined variable: horizontal_one_array in wp-content/plugins/price-matrix-for-woocommerce/templates/table-horizontal-3.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/price-matrix-for-woocommerce/admin/templates/general.php:5
    • > PHP Notice
      Undefined variable: data_array in wp-content/plugins/price-matrix-for-woocommerce/templates/table-horizontal-1.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention: Please take inspiration from this readme.txt

price-matrix-for-woocommerce/price-matrix-for-woocommerce.php 92% from 13 tests

The main PHP script in "Price Matrix for WooCommerce" version 1.2.2 is automatically included on every request by WordPress
It is important to fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin4,369 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
PHP234141802,429
CSS56691,336
JavaScript513036583
SVG20121

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity21.20
▷ Minimum class complexity4.00
▷ Maximum class complexity115.00
Average method complexity4.42
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes110.00%
▷ Concrete classes990.00%
▷ Final classes00.00%
Methods60
▷ Static methods915.00%
▷ Public methods5490.00%
▷ Protected methods11.67%
▷ Private methods58.33%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin