10% invitereferrals-customer-referral-program

Code Review | Customer Referral Program | Refer a Friend Software

WordPress plugin Customer Referral Program | Refer a Friend Software scored10%from 54 tests.

About plugin

  • Plugin page: invitereferrals-c...
  • Plugin version: 2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.7
  • WordPress version: 6.3.1
  • First release: Oct 2, 2013
  • Latest release: Mar 23, 2021
  • Number of updates: 49
  • Update frequency: every 55.7 days
  • Top authors: tagNpin (100%)

Code review

54 tests

User reviews

24 reviews

Install metrics

100+ active /18,847 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/invitereferrals-customer-referral-program/invitereferrals.php+40
    Methods with the same name as their class will not be constructors in a future version of PHP; InviteReferralsWidget has a deprecated constructor

Server metrics [RAM: ▼1.71MB] [CPU: ▼47.40ms] Passed 4 tests

An overview of server-side resources used by Customer Referral Program | Refer a Friend Software
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.28 ▼1.1811.11 ▼26.34
Dashboard /wp-admin2.30 ▼1.0113.84 ▼37.70
Posts /wp-admin/edit.php2.30 ▼1.0610.74 ▼41.65
Add New Post /wp-admin/post-new.php2.30 ▼3.5910.51 ▼83.89
Media Library /wp-admin/upload.php2.30 ▼0.939.64 ▼25.78
InviteReferrals /wp-admin/options-general.php?page=invitereferrals-plugin2.3010.05

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
widget_invitereferralswidget
widget_theysaidso_widget
invitereferrals
can_compress_scripts
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Customer Referral Program | Refer a Friend Software: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲3914.31 ▼0.446.98 ▲5.2343.70 ▼1.96
Dashboard /wp-admin2,202 ▲255.59 ▼0.0886.85 ▼2.2439.90 ▼1.31
Posts /wp-admin/edit.php2,101 ▲42.03 ▲0.0936.15 ▼1.7335.42 ▼3.33
Add New Post /wp-admin/post-new.php1,530 ▲223.27 ▲0.22657.67 ▼9.0652.83 ▼5.37
Media Library /wp-admin/upload.php1,404 ▲44.24 ▲0.07104.57 ▼11.6547.57 ▼2.12
InviteReferrals /wp-admin/options-general.php?page=invitereferrals-plugin9292.0327.8633.02

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in InviteReferralsWidget is deprecated since version 4.3.0! Use __construct() instead.
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_recent-posts
    • db_upgraded
    • widget_invitereferralswidget
    • widget_theysaidso_widget
    • invitereferrals
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=invitereferrals-plugin
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in InviteReferralsWidget is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=invitereferrals-plugin
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=invitereferrals-plugin
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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 perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/invitereferrals-customer-referral-program/invitereferrals.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/invitereferrals-customer-referral-program/invitereferrals_options_form.php:52

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

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: There are too many tags (56 tag instead of maximum 10)
Please take inspiration from this readme.txt

invitereferrals-customer-referral-program/invitereferrals.php 85% from 13 tests

The main PHP file in "Customer Referral Program | Refer a Friend Software" ver. 2.3 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("invitereferrals-customer-referral-program.php" instead of "invitereferrals.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 373 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin218 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP24682218

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity3.50
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity1.38
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods1184.62%
▷ Protected methods00.00%
▷ Private methods215.38%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG files were detected