69% the-loyalty-box-woocommerce-rewards-program

Code Review | The Loyalty Box - WooCommerce Rewards Program

WordPress plugin The Loyalty Box - WooCommerce Rewards Program scored 69% from 54 tests.

About plugin

  • Plugin page: the-loyalty-box-w...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1.2-4.5.3
  • WordPress version: 5.8.1
  • First release: May 28, 2015
  • Latest release: Sep 16, 2016
  • Number of updates: 20
  • Update frequency: every 23.9 days
  • Top authors: Double Eye (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,035 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▼141.82ms] Passed 4 tests

Server-side resources used by The Loyalty Box - WooCommerce Rewards Program
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.98 ▲0.2634.06 ▲12.23
Dashboard /wp-admin3.20 ▲0.1555.09 ▲4.64
Posts /wp-admin/edit.php3.25 ▲0.1553.70 ▲3.61
Add New Post /wp-admin/post-new.php5.56 ▲0.1399.60 ▼575.54
Media Library /wp-admin/upload.php3.14 ▲0.1438.40 ▲0.01

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 15 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for The Loyalty Box - WooCommerce Rewards Program
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲13115.92 ▲0.3013.41 ▲0.2049.33 ▲0.63
Dashboard /wp-admin2,970 ▲365.94 ▲0.03156.70 ▼13.81118.38 ▲10.14
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0177.23 ▼1.0594.92 ▼3.24
Add New Post /wp-admin/post-new.php1,683 ▼018.79 ▲0.03430.61 ▲10.22115.78 ▼8.03
Media Library /wp-admin/upload.php1,807 ▼05.03 ▲0.00170.41 ▲8.19121.23 ▼19.01

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Error in wp-content/plugins/the-loyalty-box-woocommerce-rewards-program/uninstall.php+10
    Uncaught Error: Class 'WC_Loyaltybox_Settings' not found in wp-content/plugins/the-loyalty-box-woocommerce-rewards-program/uninstall.php:10
    Stack trace:
    #0 wp-admin/includes/plugin.php(1248): include_once()
    #1 wp-admin/includes/plugin.php(965): uninstall_plugin()
  • The plugin did not uninstall correctly, leaving 15 files (0.25MB) in the plugin directory
    • (new file) includes/wc-loyaltybox-settings.php
    • (new file) assets/screenshot-1.png
    • (new file) error.log
    • (new file) assets/js/local.loyaltybox.js
    • (new file) assets/css/local.loyaltybox.css
    • (new file) assets/css/master.loyaltybox.css
    • (new file) assets/img/lb_loading.gif
    • (new file) includes/loyaltybox.inc.php
    • (new file) assets/screenshot-2.png
    • (new file) assets/screenshot-3.png
    • ...
  • Zombie WordPress options were found after uninstall: 1 option
    • recovery_mode_email_last_sent

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention: The official readme.txt is a good inspiration

the-loyalty-box-woocommerce-rewards-program/loyaltybox.php 77% from 13 tests

Analyzing the main PHP file in "The Loyalty Box - WooCommerce Rewards Program" version 1.0.3
You should first fix the following items:
  • Domain Path: You should use only dashes and lowercase characters for the domain path ("/languages.")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("the-loyalty-box-woocommerce-rewards-program.php" instead of "loyaltybox.php")

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
Good job! No executable or dangerous file extensions detected2,189 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP42409871,943
JavaScript1165225
CSS1812121

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.24
Average class complexity43.50
▷ Minimum class complexity3.00
▷ Maximum class complexity95.00
Average method complexity4.33
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods51
▷ Static methods2650.98%
▷ Public methods51100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants19
▷ Global constants1368.42%
▷ Class constants631.58%
▷ Public constants6100.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.10MB with 0.05MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-3.png24.63KB10.86KB▼ 55.93%
assets/screenshot-1.png44.15KB18.99KB▼ 56.99%
assets/screenshot-2.png29.01KB12.38KB▼ 57.34%