62% woo-product-pricing-tables

Code Review | Product Pricing Table by WooBeWoo

WordPress plugin Product Pricing Table by WooBeWoo scored62%from 54 tests.

About plugin

  • Plugin page: woo-product-prici...
  • Plugin version: 1.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.0-5.8
  • WordPress version: 6.3.1
  • First release: Mar 22, 2018
  • Latest release: Nov 25, 2021
  • Number of updates: 46
  • Update frequency: every 29.3 days
  • Top authors: woobewoo (80.43%)woobeewoo (21.74%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /5,052 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.19MB] [CPU: ▼7.43ms] Passed 4 tests

Analyzing server-side resources used by Product Pricing Table by WooBeWoo
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2136.78 ▼4.77
Dashboard /wp-admin3.50 ▲0.1653.14 ▼8.96
Posts /wp-admin/edit.php3.62 ▲0.2649.65 ▼4.77
Add New Post /wp-admin/post-new.php6.09 ▲0.2091.31 ▼11.22
Media Library /wp-admin/upload.php3.43 ▲0.2044.63 ▲7.89
Settings /wp-admin/admin.php?page=pricing-table-for-woo&tab=settings3.5649.74
/wp-admin/admin.php?page=pricing-table-for-woo3.3935.56
Tables Import / Export /wp-admin/admin.php?page=pricing-table-for-woo&tab=tables_import_export3.3933.12
Overview /wp-admin/admin.php?page=pricing-table-for-woo&tab=overview3.4937.64
Add New Table /wp-admin/admin.php?page=pricing-table-for-woo&tab=tables_add_new3.5333.80
Show All Tables /wp-admin/admin.php?page=pricing-table-for-woo&tab=tables3.3934.48

Server storage [IO: ▲5.35MB] [DB: ▲0.05MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 512 new files
Database: 7 new tables, 11 new options
New tables
wp_ptw_product_property_codes
wp_ptw_tables
wp_ptw_modules_type
wp_ptw_product_properties
wp_ptw_modules
wp_ptw_products
wp_ptw_usage_stat
New WordPress options
ptw_plug_was_used
ptw_plugin_activation_errors
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
wp_ptw_db_installed
db_upgraded
wp_ptw_db_version
ptw_optw_data
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Product Pricing Table by WooBeWoo
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲9114.72 ▲0.511.68 ▼0.1340.40 ▼0.77
Dashboard /wp-admin2,240 ▲635.64 ▲0.0288.61 ▼3.9238.65 ▼1.17
Posts /wp-admin/edit.php2,145 ▲452.01 ▼0.0140.14 ▲5.8633.57 ▼2.35
Add New Post /wp-admin/post-new.php1,562 ▲3623.04 ▼0.60680.34 ▲57.8256.29 ▲1.98
Media Library /wp-admin/upload.php1,448 ▲484.23 ▼0.00114.29 ▲12.5449.09 ▲4.96
Settings /wp-admin/admin.php?page=pricing-table-for-woo&tab=settings1,2403.1960.0250.79
/wp-admin/admin.php?page=pricing-table-for-woo1,5453.6170.8765.96
Tables Import / Export /wp-admin/admin.php?page=pricing-table-for-woo&tab=tables_import_export1,6163.5875.5339.67
Overview /wp-admin/admin.php?page=pricing-table-for-woo&tab=overview1,3982.5346.3248.73
Add New Table /wp-admin/admin.php?page=pricing-table-for-woo&tab=tables_add_new1,3092.5244.8236.59
Show All Tables /wp-admin/admin.php?page=pricing-table-for-woo&tab=tables1,5553.6168.1139.19

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The plugin did not uninstall successfully, leaving 4 tables in the database
    • wp_ptw_product_properties
    • wp_ptw_product_property_codes
    • wp_ptw_products
    • wp_ptw_tables
  • Zombie WordPress options were found after uninstall: 9 options
    • ptw_plugin_activation_errors
    • ptw_optw_data
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • ptw_plug_was_used

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pricing-table-for-woo&tab=tables
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)

SRP 50% 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
Please take a closer look at the following
  • 206× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/woo-product-pricing-tables/modules/promo/views/tpl/overviewTabContent.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/woo-product-pricing-tables/config.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression' not found in wp-content/plugins/woo-product-pricing-tables/classes/Twig/Node/Expression/Parent.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/woo-product-pricing-tables/classes/Twig/Node/For.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/woo-product-pricing-tables/classes/Twig/Node/Print.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'modulePtw' not found in wp-content/plugins/woo-product-pricing-tables/modules/pages/mod.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_TokenParser' not found in wp-content/plugins/woo-product-pricing-tables/classes/Twig/TokenParser/Extends.php:20
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/woo-product-pricing-tables/modules/tables/views/tpl/showAdminNotice.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_TokenParser' not found in wp-content/plugins/woo-product-pricing-tables/classes/Twig/TokenParser/Sandbox.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/woo-product-pricing-tables/classes/Twig/Node/Expression.php:18

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/admin.php?page=pricing-table-for-woo&tab=tables_add_new
    • > Network (severe)
    http://woobewoo-14700.kxcdn.com/_assets/tables/img/prev/rainbow.jpg - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=pricing-table-for-woo&tab=tables_add_new
    • > Network (severe)
    http://woobewoo-14700.kxcdn.com/_assets/tables/img/prev/flat-table.jpg - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=pricing-table-for-woo&tab=tables_add_new
    • > Network (severe)
    http://woobewoo-14700.kxcdn.com/_assets/tables/img/prev/gradient-standard.jpg - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=pricing-table-for-woo&tab=tables_add_new
    • > Network (severe)
    http://woobewoo-14700.kxcdn.com/_assets/tables/css/bootstrap.partial.min.css?ver=1.0.7 - Failed to load resource: net::ERR_CONNECTION_RESET

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Tags: There are too many tags (20 tag instead of maximum 10)
  • Screenshots: Please add an image for screenshot #5 ([Pricing Table examples](https://woobewoo.com/plugins/woocommerce-pricing-table/))
The official readme.txt is a good inspiration

woo-product-pricing-tables/ptw.php 85% from 13 tests

The principal PHP file in "Product Pricing Table by WooBeWoo" v. 1.0.7 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woo-product-pricing-tables.php" instead of "ptw.php")
  • Requires at least: Required version does not match the one declared in readme.txt ("3.3" instead of "3.4.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin49,221 lines of code in 448 files:
LanguageFilesBlank linesComment linesLines of code
PHP2852,9657,76421,096
JavaScript1181,4712,50818,764
CSS394144045,814
SVG3002,796
PO File1296349736
JSON10013
Markdown1102

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity11.96
▷ Minimum class complexity1.00
▷ Maximum class complexity189.00
Average method complexity2.73
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces22
Traits0
Classes241
▷ Abstract classes229.13%
▷ Concrete classes21990.87%
▷ Final classes00.00%
Methods1,730
▷ Static methods24414.10%
▷ Public methods1,50086.71%
▷ Protected methods19511.27%
▷ Private methods352.02%
Functions80
▷ Named functions7998.75%
▷ Anonymous functions11.25%
Constants129
▷ Global constants6751.94%
▷ Class constants6248.06%
▷ Public constants62100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
38 PNG files occupy 0.18MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/minimal@2x.png3.38KB2.56KB▼ 24.15%
css/images/ui-icons_cd0a0a_256x240.png4.44KB4.17KB▼ 6.02%
css/images/ui-icons_666666_256x240.png6.82KB4.17KB▼ 38.82%
js/color_picker/images/map-pointer.png0.34KB0.25KB▼ 26.45%
modules/tables/css/images/minimal@2x.png6.41KB2.51KB▼ 60.86%