78% gratisfaction-all-in-one-loyalty-contests-referral-program-for-woocommerce

Code Review | Gratisfaction- Loyalty, Rewards , Referral, Birthday and Giveaway Program

WordPress plugin Gratisfaction- Loyalty, Rewards , Referral, Birthday and Giveaway Program scored78%from 54 tests.

About plugin

  • Plugin page: gratisfaction-all...
  • Plugin version: 4.3.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.4
  • WordPress version: 6.3.1
  • First release: Jun 19, 2015
  • Latest release: Nov 15, 2023
  • Number of updates: 294
  • Update frequency: every 10.5 days
  • Top authors: akashmalik (100%)

Code review

54 tests

User reviews

185 reviews

Install metrics

1,000+ active /129,025 total downloads

Benchmarks

Plugin footprint 83% 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: ▲1.18ms] Passed 4 tests

A check of server-side resources used by Gratisfaction- Loyalty, Rewards , Referral, Birthday and Giveaway Program
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0047.00 ▲7.08
Dashboard /wp-admin3.31 ▼0.0446.38 ▼8.13
Posts /wp-admin/edit.php3.36 ▲0.0047.91 ▲4.75
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.00 ▲6.58
Media Library /wp-admin/upload.php3.23 ▲0.0033.57 ▲1.50

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 41 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Gratisfaction- Loyalty, Rewards , Referral, Birthday and Giveaway Program
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲4314.32 ▼0.021.69 ▲0.2046.45 ▲5.80
Dashboard /wp-admin2,195 ▲175.60 ▼0.1083.41 ▼14.8739.13 ▼0.17
Posts /wp-admin/edit.php2,103 ▲32.02 ▲0.0540.64 ▲4.4436.55 ▲3.42
Add New Post /wp-admin/post-new.php1,526 ▼023.19 ▼0.01591.53 ▼69.1148.98 ▲0.45
Media Library /wp-admin/upload.php1,403 ▲64.30 ▲0.19100.27 ▼2.3441.11 ▼4.56

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/gratisfaction-all-in-one-loyalty-contests-referral-program-for-woocommerce/grconnect.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/gratisfaction-all-in-one-loyalty-contests-referral-program-for-woocommerce/templates/settings.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention: The official readme.txt might help

gratisfaction-all-in-one-loyalty-contests-referral-program-for-woocommerce/grconnect.php 92% from 13 tests

"Gratisfaction- Loyalty, Rewards , Referral, Birthday and Giveaway Program" version 4.3.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("gratisfaction-all-in-one-loyalty-contests-referral-program-for-woocommerce.php" instead of "grconnect.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin6,631 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP101,2467755,472
JavaScript22782701,095
JSON10062
CSS2062

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity171.00
▷ Minimum class complexity1.00
▷ Maximum class complexity852.00
Average method complexity8.83
▷ Minimum method complexity1.00
▷ Maximum method complexity53.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods152
▷ Static methods1912.50%
▷ Public methods12682.89%
▷ Protected methods42.63%
▷ Private methods2214.47%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants120.00%
▷ Class constants480.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/tick-green.png1.11KB0.35KB▼ 68.64%
img/tick-black.png1.02KB0.26KB▼ 74.42%
img/appsmav-logo.png5.23KB2.71KB▼ 48.20%
img/icon-error.png1.36KB0.78KB▼ 43.12%
img/icon-link.png1.26KB0.35KB▼ 71.95%