77% elex-product-price-custom-text-before-after-text-and-discount-for-woocommerce

Code Review | ELEX WooCommerce Product Price Custom Text (Before & After Text) and Discount

WordPress plugin ELEX WooCommerce Product Price Custom Text (Before & After Text) and Discount scored77%from 54 tests.

About plugin

  • Plugin page: elex-product-pric...
  • Plugin version: 3.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-6.3
  • WordPress version: 6.3.1
  • First release: Sep 28, 2020
  • Latest release: Oct 13, 2023
  • Number of updates: 47
  • Update frequency: every 23.8 days
  • Top authors: elextensions (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

2,000+ active /24,318 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by ELEX WooCommerce Product Price Custom Text (Before & After Text) and Discount
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0040.55 ▼0.49
Dashboard /wp-admin3.31 ▼0.0449.56 ▼13.67
Posts /wp-admin/edit.php3.36 ▲0.0045.00 ▲1.47
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.80 ▼10.71
Media Library /wp-admin/upload.php3.23 ▲0.0035.10 ▲1.51

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 31 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for ELEX WooCommerce Product Price Custom Text (Before & After Text) and Discount
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.32 ▼0.041.80 ▲0.0943.13 ▼0.70
Dashboard /wp-admin2,195 ▲185.55 ▼0.0984.01 ▼12.1740.50 ▼4.47
Posts /wp-admin/edit.php2,100 ▼02.01 ▼0.0333.10 ▼2.0534.45 ▼2.68
Add New Post /wp-admin/post-new.php1,526 ▼023.28 ▲0.29643.73 ▼17.7655.51 ▲4.02
Media Library /wp-admin/upload.php1,400 ▼34.21 ▲0.0193.00 ▼11.7240.16 ▼8.49

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

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
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
The following issues need your attention
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/elex-product-price-custom-text-before-after-text-and-discount-for-woocommerce/review_and_troubleshoot_notify/resources/logo.php
    • > /wp-content/plugins/elex-product-price-custom-text-before-after-text-and-discount-for-woocommerce/includes/market.php
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/elex-product-price-custom-text-before-after-text-and-discount-for-woocommerce/includes/market.php:302
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/elex-product-price-custom-text-before-after-text-and-discount-for-woocommerce/review_and_troubleshoot_notify/resources/review.php:58
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/elex-product-price-custom-text-before-after-text-and-discount-for-woocommerce/review_and_troubleshoot_notify/resources/troubleshoot.php:59

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: woocommerce dynamic pricing, before after text, woocommerce discounts

elex-product-price-custom-text-before-after-text-and-discount-for-woocommerce/elex-woocommerce-product-price-custom-text-discount.php 62% from 13 tests

The main file in "ELEX WooCommerce Product Price Custom Text (Before & After Text) and Discount" v. 3.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Plugin Name: Please shorten the plugin name (currently 77 characters long instead of max. 70)
  • Main file name: Name the main plugin file the same as the plugin slug ("elex-product-price-custom-text-before-after-text-and-discount-for-woocommerce.php" instead of "elex-woocommerce-product-price-custom-text-discount.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Description: The description should be shorter than 140 characters (currently 174 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.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin2,849 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP8209871,953
PO File7246354826
CSS16660
XML10010

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity10.50
▷ Minimum class complexity7.00
▷ Maximum class complexity14.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions28
▷ Named functions2796.43%
▷ Anonymous functions13.57%
Constants1
▷ Global constants1100.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
6 PNG files occupy 0.39MB with 0.28MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/gpf.png28.76KB9.54KB▼ 66.84%
resources/Advanced Bulk Edit.png69.40KB15.94KB▼ 77.03%
resources/Dynamic Pricing & Discounts.png90.78KB22.92KB▼ 74.75%
resources/Catalog Mode.png85.64KB21.17KB▼ 75.28%
resources/wschat.png27.57KB9.62KB▼ 65.10%