77% elex-woocommerce-role-based-pricing-plugin-basic

Code Review | ELEX WooCommerce Role Based Pricing

WordPress plugin ELEX WooCommerce Role Based Pricing scored77%from 54 tests.

About plugin

  • Plugin page: elex-woocommerce-...
  • Plugin version: 1.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-6.3
  • WordPress version: 6.3.1
  • First release: Jul 8, 2019
  • Latest release: Nov 1, 2023
  • Number of updates: 54
  • Update frequency: every 29.2 days
  • Top authors: elextensions (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

3,000+ active /57,596 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

This is a short check of server-side resources used by ELEX WooCommerce Role Based Pricing
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0037.84 ▼3.90
Dashboard /wp-admin3.31 ▼0.0446.13 ▼19.99
Posts /wp-admin/edit.php3.36 ▲0.0046.13 ▲0.68
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.96 ▼10.43
Media Library /wp-admin/upload.php3.23 ▲0.0032.85 ▼3.23

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for ELEX WooCommerce Role Based Pricing
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7914.38 ▼0.161.88 ▼0.1437.64 ▼6.50
Dashboard /wp-admin2,195 ▲185.60 ▼0.0791.92 ▼6.1640.68 ▼2.07
Posts /wp-admin/edit.php2,103 ▲32.00 ▼0.0336.36 ▲1.7830.91 ▼5.39
Add New Post /wp-admin/post-new.php1,529 ▲123.31 ▲0.27629.34 ▼67.5051.21 ▼1.03
Media Library /wp-admin/upload.php1,400 ▲94.18 ▲0.0194.39 ▼5.9942.32 ▼3.74

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/elex-woocommerce-role-based-pricing-plugin-basic/review_and_troubleshoot_notify/resources/logo.php
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/elex-woocommerce-role-based-pricing-plugin-basic/review_and_troubleshoot_notify/resources/review.php:58
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/elex-woocommerce-role-based-pricing-plugin-basic/review_and_troubleshoot_notify/resources/troubleshoot.php:59
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/elex-woocommerce-role-based-pricing-plugin-basic/includes/market.php:91

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: role based pricing, dynamic pricing, hide price, prices by user role, wholesale pricing

elex-woocommerce-role-based-pricing-plugin-basic/elex-rolebased-price-basic.php 69% from 13 tests

The principal PHP file in "ELEX WooCommerce Role Based Pricing" v. 1.4.2 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 198 characters long)
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Requires at least: The required version number did not match the one declared in readme.txt ("3.0.1" instead of "2.6.0")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("elex-woocommerce-role-based-pricing-plugin-basic.php" instead of "elex-rolebased-price-basic.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected10,445 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
CSS1606,712
PHP153301833,580
JavaScript1205153

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
The following items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 101)
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity83.67
▷ Minimum class complexity1.00
▷ Maximum class complexity397.00
Average method complexity6.29
▷ Minimum method complexity1.00
▷ Maximum method complexity101.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods83
▷ Static methods56.02%
▷ Public methods8298.80%
▷ Protected methods00.00%
▷ Private methods11.20%
Functions11
▷ Named functions763.64%
▷ Anonymous functions436.36%
Constants2
▷ Global constants2100.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
4 PNG files occupy 0.40MB with 0.30MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/wsdesk.png161.93KB43.90KB▼ 72.89%
resources/Dynamic Pricing & Discounts.png90.78KB22.92KB▼ 74.75%
resources/Advanced Bulk Edit.png69.40KB15.94KB▼ 77.03%
resources/prod-logo.png85.64KB21.17KB▼ 75.28%