10% tp-products-compare-for-woocommerce

Code Review | TP Products Compare for Woocommerce

WordPress plugin TP Products Compare for Woocommerce scored 10% from 54 tests.

About plugin

  • Plugin page: tp-products-compa...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.7.0
  • WordPress version: 6.3.1
  • First release: Mar 17, 2021
  • Latest release: Mar 27, 2021
  • Number of updates: 8
  • Update frequency: every 1.3 days
  • Top authors: tplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 396 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • The plugin did not install without errors
    • > User deprecated in wp-includes/functions.php+5453
    Function get_page_by_title is deprecated since version 6.2.0! Use WP_Query instead.

Server metrics [RAM: ▲0.05MB] [CPU: ▼0.64ms] Passed 4 tests

Analyzing server-side resources used by TP Products Compare for Woocommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0538.30 ▼2.31
Dashboard /wp-admin3.35 ▲0.0542.63 ▼5.69
Posts /wp-admin/edit.php3.40 ▲0.0549.36 ▲5.29
Add New Post /wp-admin/post-new.php5.95 ▲0.0796.18 ▲4.69
Media Library /wp-admin/upload.php3.28 ▲0.0537.07 ▲0.77

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 42 new files
Database: no new tables, 27 new options
New WordPress options
tpwc_display_share_buttons
widget_theysaidso_widget
tpwc_product_compare_button_padding
can_compress_scripts
tpwc_add_to_cart_padding
tpwc_fields_to_show
db_upgraded
tpwc_product_compare_button_color
tpwc_open_compare_button_color
widget_recent-comments
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for TP Products Compare for Woocommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,943 ▲20813.64 ▼0.747.34 ▲5.5239.66 ▼9.98
Dashboard /wp-admin2,232 ▲445.88 ▲0.7897.45 ▼20.0778.77 ▲29.15
Posts /wp-admin/edit.php2,112 ▲232.03 ▲0.0338.88 ▲1.7036.47 ▲1.00
Add New Post /wp-admin/post-new.php1,535 ▲223.14 ▼0.23700.06 ▲17.9637.75 ▼19.07
Media Library /wp-admin/upload.php1,411 ▲234.15 ▼0.0297.61 ▼15.6578.07 ▲30.21

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • tp_woocommerce_compare_page_id
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

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
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tp-products-compare-for-woocommerce/admin/partials/tp-woocommerce-compare-admin-display.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/tp-products-compare-for-woocommerce/public/partials/tp-woocommerce-compare-public-display.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: woocommerce product compare, compare, woocommerce compare, product compare

tp-products-compare-for-woocommerce/tp-products-compare-for-woocommerce.php 92% from 13 tests

This is the main PHP file of "TP Products Compare for Woocommerce" version 1.0.0, 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 is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected3,444 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
CSS10142961,694
PHP123086241,082
HTML1110322
JavaScript46550185
JSON100130
SVG119031

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity6.71
▷ Minimum class complexity1.00
▷ Maximum class complexity35.00
Average method complexity2.18
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods34
▷ Static methods25.88%
▷ Public methods2985.29%
▷ Protected methods00.00%
▷ Private methods514.71%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.13MB with 0.08MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/partials/images/tp.png1.24KB0.26KB▼ 79.08%
admin/partials/images/jquery.minicolors.png67.02KB34.31KB▼ 48.80%
admin/images/jquery.minicolors.png67.02KB34.31KB▼ 48.80%