84% woocommerce-price-matrix

Code Review | WooCommerce Price Matrix

WordPress plugin WooCommerce Price Matrix scored84%from 54 tests.

About plugin

  • Plugin page: woocommerce-price...
  • Plugin version: 1.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-4.1
  • WordPress version: 6.3.1
  • First release: Feb 5, 2015
  • Latest release: Oct 16, 2015
  • Number of updates: 17
  • Update frequency: every 14.9 days
  • Top authors: Shane Welland (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

50+ active /5,713 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
This plugin's installer ran successfully

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

Analyzing server-side resources used by WooCommerce Price Matrix
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.39 ▲4.31
Dashboard /wp-admin3.31 ▲0.0044.02 ▼4.68
Posts /wp-admin/edit.php3.36 ▲0.0045.33 ▼6.59
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.49 ▼6.34
Media Library /wp-admin/upload.php3.23 ▲0.0034.61 ▲1.47

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce Price Matrix
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7914.76 ▲0.352.06 ▲0.4444.22 ▼0.63
Dashboard /wp-admin2,206 ▲185.83 ▲0.96108.50 ▲7.6436.46 ▼6.70
Posts /wp-admin/edit.php2,092 ▲32.02 ▲0.0138.73 ▲2.5335.79 ▲3.54
Add New Post /wp-admin/post-new.php1,528 ▲1423.05 ▲5.38662.72 ▼11.7049.64 ▼2.49
Media Library /wp-admin/upload.php1,391 ▲34.19 ▲0.00103.02 ▲5.2646.26 ▲3.85

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-price-matrix/includes/admin/post-types/class-wpm-admin-meta-boxes.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-price-matrix/includes/admin/class-wpm-admin.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-price-matrix/includes/class-wpm-frontend-scripts.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/woocommerce-price-matrix/woocommerce_price_matrix.php:42
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-price-matrix/includes/wpm-template-hooks.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-price-matrix/includes/admin/class-wpm-admin-assets.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/woocommerce-price-matrix/includes/admin/views/html-price-matrix-data.php: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)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === woocommerce-price-matrix === )
The official readme.txt is a good inspiration

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

"WooCommerce Price Matrix" version 1.1.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("woocommerce-price-matrix.php" instead of "woocommerce_price_matrix.php")

Code Analysis Passed 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
Good job! No executable or dangerous file extensions detected478 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP8127174347
JavaScript319270
CSS12961

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity3.80
▷ Minimum class complexity2.00
▷ Maximum class complexity6.00
Average method complexity1.56
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods25
▷ Static methods28.00%
▷ Public methods2184.00%
▷ Protected methods00.00%
▷ Private methods416.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin