77% price-bands-for-woocommerce

Code Review | Price Bands for WooCommerce

WordPress plugin Price Bands for WooCommerce scored 77% from 54 tests.

About plugin

  • Plugin page: price-bands-for-w...
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.5
  • WordPress version: 5.8.1
  • First release: Feb 5, 2018
  • Latest release: Apr 21, 2018
  • Number of updates: 18
  • Update frequency: every 4.2 days
  • Top authors: nplugins (72.22%)pluginninja (33.33%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active / 557 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
Installer ran successfully

Server metrics [RAM: ▲2.40MB] [CPU: ▼130.34ms] Passed 4 tests

Server-side resources used by Price Bands for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /5.55 ▲2.7149.38 ▲11.85
Dashboard /wp-admin5.57 ▲2.5162.50 ▲4.81
Posts /wp-admin/edit.php5.57 ▲2.4658.24 ▲4.57
Add New Post /wp-admin/post-new.php7.50 ▲2.07112.22 ▼542.59
Media Library /wp-admin/upload.php5.57 ▲2.5648.68 ▲12.05
Upgrade  ➤ /wp-admin/edit.php?post_type=pbfwc_price_band&page=price-bands-for-woocommerce-pricing5.5738.03
Contact Us /wp-admin/edit.php?post_type=pbfwc_price_band&page=price-bands-for-woocommerce-contact5.5733.16
Freemius Debug [v.1.2.4] /wp-admin/admin.php?page=freemius5.5746.03

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 182 new files
Database: no new tables, 5 new options
New WordPress options
fs_active_plugins
fs_accounts
fs_api_cache
fs_debug_mode
fs_options

Browser metrics Passed 4 tests

An overview of browser requirements for Price Bands for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,723 ▲15115.87 ▲0.148.99 ▼2.0548.19 ▼5.34
Dashboard /wp-admin2,990 ▲605.91 ▼0.06148.63 ▼25.08108.09 ▼3.26
Posts /wp-admin/edit.php2,762 ▲232.71 ▼0.1371.11 ▲4.3392.87 ▼5.16
Add New Post /wp-admin/post-new.php1,596 ▲8817.49 ▼2.83454.26 ▲36.20117.98 ▲5.01
Media Library /wp-admin/upload.php1,828 ▲215.01 ▼0.03190.62 ▲42.57148.67 ▲26.82
Upgrade  ➤ /wp-admin/edit.php?post_type=pbfwc_price_band&page=price-bands-for-woocommerce-pricing280.900.3411.46
Contact Us /wp-admin/edit.php?post_type=pbfwc_price_band&page=price-bands-for-woocommerce-contact280.900.4010.03
Freemius Debug [v.1.2.4] /wp-admin/admin.php?page=freemius1,4572.1255.3685.20

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 5 options in the database
    • fs_options
    • fs_accounts
    • fs_active_plugins
    • fs_debug_mode
    • fs_api_cache

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 no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/price-bands-for-woocommerce/freemius/templates/ajax-loader.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/edit.php?post_type=pbfwc_price_band&page=price-bands-for-woocommerce-pricing
    • > Network (severe)
    wp-admin/edit.php?post_type=pbfwc_price_band&page=price-bands-for-woocommerce-pricing - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/edit.php?post_type=pbfwc_price_band&page=price-bands-for-woocommerce-contact
    • > Network (severe)
    wp-admin/edit.php?post_type=pbfwc_price_band&page=price-bands-for-woocommerce-contact - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
You can take inspiration from this readme.txt

price-bands-for-woocommerce/price-bands-for-woocommerce.php 69% from 13 tests

This is the main PHP file of "Price Bands for WooCommerce" version 1.0.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Domain Path: The domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages")
  • Description: Please don't use more than 140 characters for the plugin description (currently 236 characters long)
  • Domain Path: Prefix the domain path with a forward slash character ("/languages")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin27,842 lines of code in 143 files:
LanguageFilesBlank linesComment linesLines of code
PHP964,61610,86919,087
PO File62,7783,0586,111
Sass21345762,159
Markdown2680214
JavaScript33459194
YAML22028
JSON10027
CSS121022

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 1,332)
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity45.91
▷ Minimum class complexity1.00
▷ Maximum class complexity1,332.00
Average method complexity3.62
▷ Minimum method complexity1.00
▷ Maximum method complexity80.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes45
▷ Abstract classes24.44%
▷ Concrete classes4395.56%
▷ Final classes00.00%
Methods804
▷ Static methods12515.55%
▷ Public methods60875.62%
▷ Protected methods141.74%
▷ Private methods18222.64%
Functions87
▷ Named functions87100.00%
▷ Anonymous functions00.00%
Constants105
▷ Global constants8580.95%
▷ Class constants2019.05%
▷ Public constants20100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/price-bands-for-woocommerce.png4.59KB2.45KB▼ 46.59%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%