83% points-and-rewards-for-woocommerce

Code Review | Points and Rewards for WooCommerce - Create Loyalty Programs, Reward Customer Purchases, Referral Points, User Badges, and Gamification

WordPress plugin Points and Rewards for WooCommerce - Create Loyalty Programs, Reward Customer Purchases, Referral Points, User Badges, and Gamification scored83%from 54 tests.

About plugin

  • Plugin page: points-and-reward...
  • Plugin version: 2.1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Nov 22, 2019
  • Latest release: Dec 1, 2023
  • Number of updates: 74
  • Update frequency: every 19.9 days
  • Top authors: makewebbetter (62.16%)wpswings (39.19%)

Code review

54 tests

User reviews

114 reviews

Install metrics

7,000+ active /148,173 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

This is a short check of server-side resources used by Points and Rewards for WooCommerce - Create Loyalty Programs, Reward Customer Purchases, Referral Points, User Badges, and Gamification
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0035.83 ▼7.87
Dashboard /wp-admin3.31 ▼0.0445.44 ▼18.94
Posts /wp-admin/edit.php3.36 ▲0.0047.87 ▲2.07
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.61 ▼12.35
Media Library /wp-admin/upload.php3.24 ▲0.0034.89 ▲2.52

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 113 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Points and Rewards for WooCommerce - Create Loyalty Programs, Reward Customer Purchases, Referral Points, User Badges, and Gamification
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.27 ▼0.471.77 ▲0.0839.84 ▼3.78
Dashboard /wp-admin2,195 ▲155.60 ▲0.0592.40 ▼0.6637.76 ▼3.82
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0739.80 ▲0.5535.42 ▼0.38
Add New Post /wp-admin/post-new.php1,526 ▼023.95 ▲0.76590.06 ▼19.7749.30 ▼9.30
Media Library /wp-admin/upload.php1,400 ▼04.24 ▲0.0396.38 ▼1.5840.34 ▲0.09

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/points-and-rewards-for-woocommerce/admin/index.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/points-and-rewards-for-woocommerce/admin/partials/index.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/points-and-rewards-for-woocommerce/includes/index.php:10
    • > PHP Notice
      Undefined variable: user_ID in wp-content/plugins/points-and-rewards-for-woocommerce/public/partials/wps-wpr-points-log-template.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/points-and-rewards-for-woocommerce/index.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/points-and-rewards-for-woocommerce/public/index.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
10 plugin tags: badges, rewards, points rewards, gamification, loyalty...

points-and-rewards-for-woocommerce/points-rewards-for-woocommerce.php 85% from 13 tests

The entry point to "Points and Rewards for WooCommerce - Create Loyalty Programs, Reward Customer Purchases, Referral Points, User Badges, and Gamification" version 2.1.0 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("points-and-rewards-for-woocommerce.php" instead of "points-rewards-for-woocommerce.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 404 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin19,547 lines of code in 63 files:
LanguageFilesBlank linesComment linesLines of code
PHP311,3963,04512,150
JavaScript135447032,924
CSS6469532,841
PO File16781,0641,526
SVG111072
XML10034

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
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 102)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity130.90
▷ Minimum class complexity1.00
▷ Maximum class complexity765.00
Average method complexity6.64
▷ Minimum method complexity1.00
▷ Maximum method complexity102.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods229
▷ Static methods41.75%
▷ Public methods22096.07%
▷ Protected methods20.87%
▷ Private methods73.06%
Functions44
▷ Named functions4295.45%
▷ Anonymous functions24.55%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
34 PNG files occupy 0.31MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/coins.png1.51KB1.58KB0.00%
public/images/500X500.png1.50KB1.44KB▼ 4.22%
admin/images/Reward-Points-for-Different-Actions.png3.35KB1.76KB▼ 47.36%
admin/images/Customer-Notification-Feature.png4.05KB1.92KB▼ 52.64%
public/images/documentation.png1.48KB1.58KB0.00%