77% elex-woo-flexible-pricing

Code Review | ELEX WooCommerce Name Your Price

WordPress plugin ELEX WooCommerce Name Your Price scored77%from 54 tests.

About plugin

  • Plugin page: elex-woo-flexible...
  • Plugin version: 2.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-6.4
  • WordPress version: 6.3.1
  • First release: Sep 16, 2020
  • Latest release: Nov 29, 2023
  • Number of updates: 51
  • Update frequency: every 22.9 days
  • Top authors: elextensions (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

900+ active /15,469 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▲0.90ms] Passed 4 tests

An overview of server-side resources used by ELEX WooCommerce Name Your Price
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0634.87 ▼0.81
Dashboard /wp-admin3.38 ▲0.0750.29 ▲0.30
Posts /wp-admin/edit.php3.49 ▲0.1351.54 ▼1.54
Add New Post /wp-admin/post-new.php5.95 ▲0.0694.55 ▲10.42
Media Library /wp-admin/upload.php3.32 ▲0.0938.16 ▲5.64

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 36 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
elex-woo-flexible-pricing/elex-woo-flexible-pricing.php_activation_date
db_upgraded
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for ELEX WooCommerce Name Your Price
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,009 ▲22214.34 ▲0.101.55 ▼0.2939.50 ▲0.79
Dashboard /wp-admin2,417 ▲2375.63 ▲0.0290.03 ▼7.9847.88 ▲4.18
Posts /wp-admin/edit.php2,323 ▲2232.12 ▲0.1739.64 ▼1.2642.28 ▲3.92
Add New Post /wp-admin/post-new.php1,745 ▲21423.87 ▲0.65629.78 ▲36.8153.74 ▲5.01
Media Library /wp-admin/upload.php1,613 ▲2134.17 ▼0.0297.02 ▼17.9944.80 ▼4.35

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • elex-woo-flexible-pricing/elex-woo-flexible-pricing.php_activation_date
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/elex-woo-flexible-pricing/review_and_troubleshoot_notify/resources/logo.php
    • > /wp-content/plugins/elex-woo-flexible-pricing/elex-woo-flexible-pricing.php
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/elex-woo-flexible-pricing/includes/elex-wfp-variable-product-flexible-pricing.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/elex-woo-flexible-pricing/review_and_troubleshoot_notify/resources/troubleshoot.php:57
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/elex-woo-flexible-pricing/includes/market.php:116
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/elex-woo-flexible-pricing/review_and_troubleshoot_notify/resources/review.php:56
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/elex-woo-flexible-pricing/includes/scripts.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/elex-woo-flexible-pricing/includes/elex-wfp-product-flexible-price.php:82

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)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention: Please take inspiration from this readme.txt

elex-woo-flexible-pricing/elex-woo-flexible-pricing.php 85% from 13 tests

The main file in "ELEX WooCommerce Name Your Price" v. 2.1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 182 characters long)
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.0.1" instead of "2.6")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected9,039 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
CSS21766,765
PHP9147661,384
PO File7245498795
JavaScript327186
XML1009

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity11.50
▷ Minimum class complexity9.00
▷ Maximum class complexity14.00
Average method complexity2.31
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions24
▷ Named functions2395.83%
▷ Anonymous functions14.17%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.61MB with 0.45MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/logo/Dynamic Pricing & Discounts.png90.78KB22.92KB▼ 74.75%
assets/logo/Product_price.png123.05KB32.59KB▼ 73.52%
assets/logo/Request a Quote.png92.71KB24.02KB▼ 74.09%
assets/logo/WSDesk_Helpdesk.png161.93KB43.90KB▼ 72.89%
assets/logo/Role based pricing.png85.64KB21.17KB▼ 75.28%