10% woocommerce-recommendations

Code Review | WooCommerce Recommendations

WordPress plugin WooCommerce Recommendations scored10%from 54 tests.

About plugin

  • Plugin page: woocommerce-recom...
  • Plugin version: : 1.0.1...
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.9.1
  • WordPress version: 6.3.1
  • First release: Jul 31, 2014
  • Latest release: Oct 22, 2014
  • Number of updates: 25
  • Update frequency: every 3.4 days
  • Top authors: nToklo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,494 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/woocommerce-recommendations/widgets/recommendation_widget.php+17
    Function create_function() is deprecated

Server metrics [RAM: ▼1.74MB] [CPU: ▼55.53ms] Passed 4 tests

A check of server-side resources used by WooCommerce Recommendations
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.25 ▼1.215.73 ▼37.33
Dashboard /wp-admin2.27 ▼1.037.08 ▼45.51
Posts /wp-admin/edit.php2.27 ▼1.086.88 ▼48.62
Add New Post /wp-admin/post-new.php2.27 ▼3.628.77 ▼90.67
Media Library /wp-admin/upload.php2.27 ▼0.966.81 ▼29.65
nToklo Recommendation /wp-admin/admin.php?page=ntoklo_options2.279.42

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 29 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_chart_widget
widget_theysaidso_widget
widget_recent-posts
widget_recommendation_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Recommendations
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,484 ▼26213.50 ▼0.683.45 ▲1.7715.63 ▼25.13
Dashboard /wp-admin2,211 ▲235.76 ▲0.89107.44 ▲0.6440.62 ▼5.85
Posts /wp-admin/edit.php2,097 ▲82.05 ▲0.0644.68 ▲7.8835.89 ▼1.38
Add New Post /wp-admin/post-new.php1,522 ▲323.46 ▲0.22653.58 ▼1.8777.64 ▲26.32
Media Library /wp-admin/upload.php1,390 ▲54.18 ▼0.0397.77 ▼7.1144.21 ▲2.67
nToklo Recommendation /wp-admin/admin.php?page=ntoklo_options8742.1823.8030.75

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
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/woocommerce-recommendations/widgets/recommendation_widget.php+17
    Function create_function() is deprecated
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_recommendation_widget
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_chart_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ntoklo_options
    • > Deprecated in wp-content/plugins/woocommerce-recommendations/admin/classes/class-wc-admin-tabs.php+547
    Function create_function() is deprecated
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ntoklo_options
    • > Notice in wp-content/plugins/woocommerce-recommendations/classes/class-wc-event-get.php+30
    Undefined property: Event_Get::$general_settings_key
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ntoklo_options
    • > Notice in wp-content/plugins/woocommerce-recommendations/admin/classes/class-wc-admin-tabs.php+147
    Undefined index: key_secret
    • > GET request to /wp-admin/admin.php?page=ntoklo_options
    • > Notice in wp-content/plugins/woocommerce-recommendations/admin/classes/class-wc-admin-tabs.php+92
    Undefined index: saved_key_secret
    • > GET request to /wp-admin/admin.php?page=ntoklo_options
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/admin.php?page=ntoklo_options
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ntoklo_options
    • > Notice in wp-content/plugins/woocommerce-recommendations/admin/classes/class-wc-admin-tabs.php+189
    Undefined index: tab

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
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/woocommerce-recommendations/util/class-wc-chart-shortcode.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-recommendations/widgets/recommendation_widget.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-recommendations/admin/classes/class-wc-admin-tabs.php:547
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-recommendations/util/class-wc-setcookie.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-recommendations/widgets/chart_widget.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/woocommerce-recommendations/woocommerce-recommendations.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/woocommerce-recommendations/util/class-wc-rec-shortcode.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-recommendations/admin/recommendation_init.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=ntoklo_options
    • > Network (severe)
    https://console.ntoklo.com/js/ntoklo.js - Failed to load resource: net::ERR_CERT_AUTHORITY_INVALID

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: wordpress, ntoklo, recommedations, retail, e-commerce

woocommerce-recommendations/woocommerce-recommendations.php 92% from 13 tests

"WooCommerce Recommendations" version : 1.0.1...'s primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Version: The version number should be digits and periods (ex. "1.0.3" instead of ": 1.0.1...")

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
Everything looks great! No dangerous files found in this plugin2,533 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP152593361,565
CSS37796910
SVG40452
JavaScript2106

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity15.78
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.87
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods71
▷ Static methods45.63%
▷ Public methods71100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants990.00%
▷ Class constants110.00%
▷ Public constants1100.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.11MB with 0.06MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/console.png104.75KB30.51KB▼ 70.87%
img/ntoklo_logo_2x.png7.58KB4.04KB▼ 46.73%
img/ntoklo_logo.png4.89KB2.92KB▼ 40.26%