67% tier-pricing-table

Code Review | Tiered Pricing Table for WooCommerce

WordPress plugin Tiered Pricing Table for WooCommerce scored67%from 54 tests.

About plugin

  • Plugin page: tier-pricing-table
  • Plugin version: 4.0.7
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Aug 29, 2018
  • Latest release: Nov 27, 2023
  • Number of updates: 99
  • Update frequency: every 19.4 days
  • Top authors: bycrik (100%)

Code review

54 tests

User reviews

80 reviews

Install metrics

10,000+ active /210,143 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲5.55MB] [CPU: ▲23.91ms] 75% from 4 tests

An overview of server-side resources used by Tiered Pricing Table for WooCommerce
Please take the time to fix the following items
  • Extra RAM: The extra memory usage should kept under 5MB (currently 5.55MB on /wp-admin/admin.php?page=tiered-pricing-table-contact-us)
PageMemory (MB)CPU Time (ms)
Home /9.25 ▲5.7865.59 ▲26.83
Dashboard /wp-admin9.27 ▲5.9279.84 ▲10.92
Posts /wp-admin/edit.php9.27 ▲5.9186.06 ▲35.55
Add New Post /wp-admin/post-new.php10.46 ▲4.57122.09 ▲22.35
Media Library /wp-admin/upload.php9.27 ▲6.0473.72 ▲39.39
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius9.2762.42
WooCommerce Tiered Price Table /wp-admin/admin.php?page=tier-pricing-table9.2767.50
Freemius Account /wp-admin/admin.php?page=tiered-pricing-table-account9.2761.52
Contact Us /wp-admin/admin.php?page=tiered-pricing-table-contact-us9.2772.74

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 378 new files
Database: no new tables, 9 new options
New WordPress options
can_compress_scripts
fs_debug_mode
widget_theysaidso_widget
db_upgraded
widget_recent-comments
fs_active_plugins
theysaidso_admin_options
fs_accounts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Tiered Pricing Table for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲7114.36 ▼0.011.66 ▼0.0226.95 ▼17.81
Dashboard /wp-admin2,220 ▲435.63 ▼0.0192.24 ▼0.2246.00 ▲4.06
Posts /wp-admin/edit.php2,132 ▲322.10 ▲0.0140.83 ▲5.6240.04 ▲5.41
Add New Post /wp-admin/post-new.php1,545 ▲1823.07 ▲0.02584.44 ▼91.9148.67 ▼4.50
Media Library /wp-admin/upload.php1,425 ▲284.16 ▼0.0099.37 ▲5.2848.76 ▲5.94
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,0851.6625.8429.94
WooCommerce Tiered Price Table /wp-admin/admin.php?page=tier-pricing-table9791.6525.8560.41
Freemius Account /wp-admin/admin.php?page=tiered-pricing-table-account6891.517.5522.65
Contact Us /wp-admin/admin.php?page=tiered-pricing-table-contact-us1,5463.1252.3558.23

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/tier-pricing-table/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • fs_accounts
    • widget_recent-posts
    • fs_debug_mode
    • widget_theysaidso_widget
    • fs_active_plugins
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=tiered-pricing-table-account
    • > Warning in wp-content/plugins/tier-pricing-table/src/Freemius.php+61
    Cannot modify header information - headers already sent by (output started at wp-includes/script-loader.php:2838)

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 70× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Trait 'TierPricingTable\\Core\\ServiceContainerTrait' not found in wp-content/plugins/tier-pricing-table/src/Addons/Addons.php on line 15
    • > PHP Fatal error
      Uncaught Error: Class 'TierPricingTable\\Forms\\Form' not found in wp-content/plugins/tier-pricing-table/src/Forms/RegularPricingForm.php:5
    • > PHP Fatal error
      Trait 'TierPricingTable\\Core\\ServiceContainerTrait' not found in wp-content/plugins/tier-pricing-table/src/Addons/AbstractAddon.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'TierPricingTable\\Settings\\Sections\\SubsectionAbstract' not found in wp-content/plugins/tier-pricing-table/src/Settings/Sections/GeneralSection/Subsections/SummarySubsection.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'TierPricingTable\\Integrations\\Plugins\\PluginIntegrationAbstract' not found in wp-content/plugins/tier-pricing-table/src/Integrations/Plugins/MixMatch.php:3
    • > PHP Fatal error
      Trait 'TierPricingTable\\Core\\ServiceContainerTrait' not found in wp-content/plugins/tier-pricing-table/src/Admin/ProductPage/TieredPricingTab.php on line 14
    • > PHP Fatal error
      Uncaught Error: Class 'TierPricingTable\\Addons\\CustomColumns\\Columns\\AbstractCustomColumn' not found in wp-content/plugins/tier-pricing-table/src/Addons/CustomColumns/Columns/PriceIncludingTaxesColumn.php:5
    • > PHP Fatal error
      Trait 'TierPricingTable\\Core\\ServiceContainerTrait' not found in wp-content/plugins/tier-pricing-table/src/Settings/Settings.php on line 24
    • > PHP Fatal error
      Uncaught Error: Class 'TierPricingTable\\Addons\\AbstractAddon' not found in wp-content/plugins/tier-pricing-table/src/Addons/CategoryTiers/CategoryTierAddon.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'TierPricingTable\\Integrations\\Plugins\\PluginIntegrationAbstract' not found in wp-content/plugins/tier-pricing-table/src/Integrations/Plugins/WPAllImport.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (Tiered Pricing on the product page), #2 (Set up Tiered Pricing), #3 (Global pricing rules), #4 (Tiered Pricing in the product catalog)
You can take inspiration from this readme.txt

tier-pricing-table/tier-pricing-table.php 92% from 13 tests

"Tiered Pricing Table for WooCommerce" version 4.0.7's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.2" instead of "4.0")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin49,073 lines of code in 316 files:
LanguageFilesBlank linesComment linesLines of code
PHP28511,16619,37147,025
JavaScript8169237965
CSS1719353945
JSON20055
SVG20147
XML27036

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity31.34
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity3.83
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces41
Interfaces1
Traits1
Classes186
▷ Abstract classes84.30%
▷ Concrete classes17895.70%
▷ Final classes00.00%
Methods2,071
▷ Static methods32415.64%
▷ Public methods1,60477.45%
▷ Protected methods763.67%
▷ Private methods39118.88%
Functions242
▷ Named functions10543.39%
▷ Anonymous functions13756.61%
Constants185
▷ Global constants9953.51%
▷ Class constants8646.49%
▷ Public constants86100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
11 PNG files occupy 0.18MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/admin/integrations/wpallimport-icon.png6.60KB2.77KB▼ 57.99%
assets/admin/integrations/mix-match-icon.png43.68KB15.91KB▼ 63.58%
assets/admin/integrations/wpml-multicurrency-icon.png5.07KB2.02KB▼ 60.20%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
assets/admin/integrations/placeholder.png0.57KB0.30KB▼ 46.99%