63% beans-woocommerce-loyalty-rewards

Code Review | Beans · Loyalty and Rewards programs for Woocommerce

WordPress plugin Beans · Loyalty and Rewards programs for Woocommerce scored63%from 54 tests.

About plugin

  • Plugin page: beans-woocommerce...
  • Plugin version: 3.6.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.3
  • WordPress version: 6.3.1
  • First release: Nov 4, 2016
  • Latest release: Sep 5, 2023
  • Number of updates: 99
  • Update frequency: every 25.2 days
  • Top authors: yan_dah (51.52%)nas2lor (34.34%)corentinalcoy (11.11%)corentinal (6.06%)

Code review

54 tests

User reviews

21 reviews

Install metrics

100+ active /12,136 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼5.01ms] Passed 4 tests

An overview of server-side resources used by Beans · Loyalty and Rewards programs for Woocommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.29 ▼3.35
Dashboard /wp-admin3.31 ▼0.0444.93 ▼20.65
Posts /wp-admin/edit.php3.36 ▲0.0046.28 ▲0.14
Add New Post /wp-admin/post-new.php5.89 ▲0.00124.33 ▲24.83
Media Library /wp-admin/upload.php3.23 ▲0.0034.92 ▲3.81

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 52 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Beans · Loyalty and Rewards programs for Woocommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.29 ▼0.051.83 ▼0.2538.33 ▼5.50
Dashboard /wp-admin2,195 ▲155.55 ▼0.0784.42 ▼5.0339.60 ▼3.47
Posts /wp-admin/edit.php2,100 ▼02.00 ▼0.0235.60 ▼2.8732.19 ▼4.33
Add New Post /wp-admin/post-new.php1,531 ▲523.19 ▲0.09691.66 ▲37.7960.08 ▲5.24
Media Library /wp-admin/upload.php1,397 ▼34.15 ▼0.07100.79 ▲1.0744.09 ▼0.56

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Error in wp-content/plugins/beans-woocommerce-loyalty-rewards/uninstall.php+14
    Uncaught Error: Class 'BeansWoo\Helper' not found in wp-content/plugins/beans-woocommerce-loyalty-rewards/uninstall.php:14
    Stack trace:
    #0 wp-admin/includes/plugin.php(1245): include_once()
    #1 wp-admin/includes/plugin.php(960): uninstall_plugin()
  • The plugin did not uninstall correctly, leaving 52 files (0.64MB) in the plugin directory
    • (new file) admin/Connect/connector-settings.html.php
    • (new file) admin/Inspector/inspector-debug.html.php
    • (new file) assets/css/beans-admin.css
    • (new file) admin/Connect/connector-connect.html.php
    • (new file) assets/css/beans-storefront.css
    • (new file) admin/Router.php
    • (new file) .gitignore
    • (new file) admin/init.php
    • (new file) admin/Connect/Connector.php
    • (new file) admin/Inspector/Inspector.php
    • ...
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • 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)
Even though no errors were found, this is by no means an exhaustive test

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
Please fix the following items
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'BeansWoo\\StoreFront\\LianaObserver' not found in wp-content/plugins/beans-woocommerce-loyalty-rewards/storefront/liana/Observer/LianaSubscriptionObserver.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'BeansWoo\\StoreFront\\LianaObserver' not found in wp-content/plugins/beans-woocommerce-loyalty-rewards/storefront/liana/Observer/LianaCartObserver.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/beans-woocommerce-loyalty-rewards/server/Api.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/beans-woocommerce-loyalty-rewards/server/Api.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'BeansWoo\\StoreFront\\LianaObserver' not found in wp-content/plugins/beans-woocommerce-loyalty-rewards/storefront/liana/Observer/LianaProductObserver.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Tags: You are using too many tags: 44 tag instead of maximum 10
The official readme.txt might help

beans-woocommerce-loyalty-rewards/beans-woocommerce.php 85% from 13 tests

The main PHP file in "Beans · Loyalty and Rewards programs for Woocommerce" ver. 3.6.2 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("beans-woocommerce-loyalty-rewards.php" instead of "beans-woocommerce.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected4,651 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
PHP315635552,962
SVG10001,183
CSS29357450
PO File1232856

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity10.68
▷ Minimum class complexity1.00
▷ Maximum class complexity32.00
Average method complexity2.99
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes28
▷ Abstract classes00.00%
▷ Concrete classes28100.00%
▷ Final classes00.00%
Methods138
▷ Static methods11784.78%
▷ Public methods12288.41%
▷ Protected methods42.90%
▷ Private methods128.70%
Functions10
▷ Named functions330.00%
▷ Anonymous functions770.00%
Constants20
▷ Global constants420.00%
▷ Class constants1680.00%
▷ Public constants16100.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.11MB with 0.06MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/admin/onboarding/foxx-hero.png65.47KB24.57KB▼ 62.48%
assets/img/connector/beans-review-logo.png2.23KB0.99KB▼ 55.52%
assets/img/admin/onboarding/snow-hero.png44.52KB21.04KB▼ 52.73%