90% woocommerce-custom-price-label

Code Review | Custom Price Labels for WooCommerce

WordPress plugin Custom Price Labels for WooCommerce scored90%from 54 tests.

About plugin

  • Plugin page: woocommerce-custo...
  • Plugin version: 2.5.12
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2
  • WordPress version: 6.3.1
  • First release: Apr 21, 2013
  • Latest release: Jul 15, 2023
  • Number of updates: 63
  • Update frequency: every 59.3 days
  • Top authors: wpwham (50.79%)algoritmika (50.79%)

Code review

54 tests

User reviews

15 reviews

Install metrics

2,000+ active /51,229 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
The plugin installed gracefully, with no errors

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

A check of server-side resources used by Custom Price Labels for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0033.87 ▼4.76
Dashboard /wp-admin3.31 ▲0.0046.61 ▼3.84
Posts /wp-admin/edit.php3.36 ▲0.0048.50 ▼5.06
Add New Post /wp-admin/post-new.php5.89 ▲0.0093.40 ▼12.39
Media Library /wp-admin/upload.php3.23 ▲0.0036.78 ▲3.50

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Custom Price Labels for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.28 ▼1.374.78 ▲3.0339.94 ▼3.11
Dashboard /wp-admin2,203 ▲155.84 ▲0.95104.68 ▲2.2838.06 ▼7.41
Posts /wp-admin/edit.php2,092 ▲32.02 ▲0.0239.10 ▲3.0439.56 ▲4.94
Add New Post /wp-admin/post-new.php1,533 ▲1623.43 ▲5.63640.47 ▼2.0648.05 ▼12.86
Media Library /wp-admin/upload.php1,385 ▼34.21 ▲0.0094.80 ▲0.4440.52 ▼1.86

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests Passed 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 Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Congratulations! This plugin passed the SRP test

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, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
1 plugin tags: woocommerce

woocommerce-custom-price-label/woocommerce-custom-price-label.php 92% from 13 tests

This is the main PHP file of "Custom Price Labels for WooCommerce" version 2.5.12, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.1" instead of "3.0")

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
Good job! No executable or dangerous file extensions detected1,156 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP101334621,156

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity20.89
▷ Minimum class complexity1.00
▷ Maximum class complexity85.00
Average method complexity4.98
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes111.11%
Methods45
▷ Static methods511.11%
▷ Public methods45100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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