78% lootly-for-woocommerce

Code Review | Lootly Loyalty & Rewards

WordPress plugin Lootly Loyalty & Rewards scored78%from 54 tests.

About plugin

  • Plugin page: lootly-for-woocom...
  • Plugin version: 1.25
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7.1-6.3
  • WordPress version: 6.3.1
  • First release: Aug 3, 2019
  • Latest release: Aug 23, 2023
  • Number of updates: 38
  • Update frequency: every 39.8 days
  • Top authors: ryanlootly (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /2,975 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

This is a short check of server-side resources used by Lootly Loyalty & Rewards
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.78 ▼2.73
Dashboard /wp-admin3.31 ▼0.0452.49 ▼11.30
Posts /wp-admin/edit.php3.36 ▲0.0049.63 ▲1.75
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.38 ▼16.73
Media Library /wp-admin/upload.php3.23 ▲0.0039.51 ▲4.61

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Lootly Loyalty & Rewards
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.24 ▼1.141.85 ▲0.0143.73 ▲0.08
Dashboard /wp-admin2,206 ▲185.83 ▲0.93113.99 ▲4.2142.40 ▲3.65
Posts /wp-admin/edit.php2,092 ▲32.01 ▼0.0436.32 ▲0.0732.61 ▼1.19
Add New Post /wp-admin/post-new.php1,514 ▼017.44 ▼0.02681.93 ▼32.7558.79 ▲1.38
Media Library /wp-admin/upload.php1,388 ▼34.21 ▼0.02110.37 ▲1.6448.84 ▲4.25

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% 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 0% 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
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/lootly-for-woocommerce/templates/admin.php
  • 24× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/lootly-for-woocommerce/templates/admin.php on line 42
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/lootly-for-woocommerce/templates/admin.php on line 42
    • > PHP Fatal error
      Uncaught Error: Class 'plugins\\lootly\\classes\\base\\Base' not found in wp-content/plugins/lootly-for-woocommerce/classes/rest/WooClasses.php:16
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/lootly-for-woocommerce/templates/admin.php on line 29
    • > PHP Fatal error
      Uncaught Error: Class 'plugins\\lootly\\classes\\base\\Base' not found in wp-content/plugins/lootly-for-woocommerce/classes/api/Events.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'plugins\\lootly\\classes\\rest\\lootly' not found in wp-content/plugins/lootly-for-woocommerce/classes/rest/Adapter.php:14
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/lootly-for-woocommerce/templates/admin.php on line 64
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/lootly-for-woocommerce/templates/admin.php on line 64
    • > PHP Fatal error
      Uncaught Error: Class 'plugins\\lootly\\classes\\base\\Base' not found in wp-content/plugins/lootly-for-woocommerce/classes/api/API.php:14
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/lootly-for-woocommerce/templates/admin.php on line 56

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 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: rewards, loyalty, vip program, lootly, referrals...

lootly-for-woocommerce/lootly-woocommerce.php 77% from 13 tests

Analyzing the main PHP file in "Lootly Loyalty & Rewards" version 1.25
Please make the necessary changes and fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Domain Path: The domain path points to a folder that does not exist ("/i18n/")
  • Main file name: Name the main plugin file the same as the plugin slug ("lootly-for-woocommerce.php" instead of "lootly-woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin1,661 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP172643701,565
CSS13090
JavaScript1006

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity10.47
▷ Minimum class complexity1.00
▷ Maximum class complexity58.00
Average method complexity2.28
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces4
Interfaces2
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods122
▷ Static methods108.20%
▷ Public methods9174.59%
▷ Protected methods75.74%
▷ Private methods2419.67%
Functions2
▷ Named functions2100.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
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/favicon.png3.26KB1.64KB▼ 49.67%
assets/img/logo-black.png12.88KB4.91KB▼ 61.87%