62% premmerce-woocommerce-wholesale-pricing

Code Review | Premmerce Wholesale Pricing for WooCommerce

WordPress plugin Premmerce Wholesale Pricing for WooCommerce scored 62% from 54 tests.

About plugin

  • Plugin page: premmerce-woocomm...
  • Plugin version: 1.1.10
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Jan 10, 2018
  • Latest release: Aug 11, 2023
  • Number of updates: 28
  • Update frequency: every 72.8 days
  • Top authors: premmerce (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

700+ active / 17,424 total downloads

Benchmarks

Plugin footprint 47% 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: ▲0.55MB] [CPU: ▼1.15ms] 75% from 4 tests

A check of server-side resources used by Premmerce Wholesale Pricing for WooCommerce
Please fix the following
  • CPU: You should keep total CPU usage under 500.00ms (currently 1,756.06ms on /wp-admin/admin.php?page=premmerce-woocommerce-wholesale-pricing)
PageMemory (MB)CPU Time (ms)
Home /4.05 ▲0.5941.01 ▼2.34
Dashboard /wp-admin3.91 ▲0.6152.42 ▲5.50
Posts /wp-admin/edit.php3.96 ▲0.6154.72 ▲6.95
Add New Post /wp-admin/post-new.php6.43 ▲0.5587.15 ▼13.80
Media Library /wp-admin/upload.php3.68 ▲0.4540.98 ▲6.04
Premmerce Wholesale Pricing for WooCommerce /wp-admin/admin.php?page=premmerce-woocommerce-wholesale-pricing4.181,756.06
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius4.0040.09
Prices /wp-admin/admin.php?page=premmerce-price-types3.6938.59

Server storage [IO: ▲3.27MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 224 new files
Database: 2 new tables, 9 new options
New tables
wp_premmerce_price_types_roles
wp_premmerce_price_types
New WordPress options
widget_recent-comments
fs_accounts
widget_theysaidso_widget
fs_active_plugins
can_compress_scripts
db_upgraded
widget_recent-posts
fs_debug_mode
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Premmerce Wholesale Pricing for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,869 ▲11213.30 ▼1.391.71 ▼0.7632.07 ▼16.48
Dashboard /wp-admin2,273 ▲815.80 ▲0.8298.34 ▼14.6343.45 ▼6.41
Posts /wp-admin/edit.php2,157 ▲682.05 ▲0.0440.15 ▲3.1539.43 ▲8.42
Add New Post /wp-admin/post-new.php1,557 ▲2918.44 ▼0.06651.07 ▲46.9360.74 ▲1.57
Media Library /wp-admin/upload.php1,460 ▲754.12 ▼0.09101.80 ▲2.1743.77 ▲0.53
Premmerce Wholesale Pricing for WooCommerce /wp-admin/admin.php?page=premmerce-woocommerce-wholesale-pricing1,0141.6927.2156.61
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,1121.7026.7831.47
Prices /wp-admin/admin.php?page=premmerce-price-types1,1002.1837.0332.18

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/premmerce-woocommerce-wholesale-pricing/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_premmerce_price_types_roles
    • wp_premmerce_price_types
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_recent-posts
    • fs_accounts
    • widget_theysaidso_widget
    • fs_active_plugins
    • can_compress_scripts
    • fs_debug_mode
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% 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 50% from 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
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/premmerce-woocommerce-wholesale-pricing/src/Admin/PriceTypesTable.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: wholesale prices, custom prices, woocommerce custom prices, custom product prices, woocommerce wholesale pricing

premmerce-woocommerce-wholesale-pricing/premmerce-price-types.php 69% from 13 tests

This is the main PHP file of "Premmerce Wholesale Pricing for WooCommerce" version 1.1.10, 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:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Requires at least: Required version does not match the one declared in readme.txt ("4.8" instead of "3.0.0")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("premmerce-woocommerce-wholesale-pricing.php" instead of "premmerce-price-types.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 177 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected35,556 lines of code in 175 files:
LanguageFilesBlank linesComment linesLines of code
PHP1488,46618,17834,808
Markdown31290326
JavaScript53859215
PO File26386130
JSON20060
CSS150017

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity75.26
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.39
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces9
Interfaces1
Traits0
Classes61
▷ Abstract classes23.28%
▷ Concrete classes5996.72%
▷ Final classes00.00%
Methods1,394
▷ Static methods21815.64%
▷ Public methods97069.58%
▷ Protected methods231.65%
▷ Private methods40128.77%
Functions108
▷ Named functions10193.52%
▷ Anonymous functions76.48%
Constants153
▷ Global constants9864.05%
▷ Class constants5535.95%
▷ Public constants55100.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
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/premmerce-woocommerce-wholesale-pricing.png9.50KB5.07KB▼ 46.67%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%