78% invitereferrals-referral-program-for-woocommerce

Code Review | Customer Referral Program For WooCommerce

WordPress plugin Customer Referral Program For WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: invitereferrals-r...
  • Plugin version: 2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.7
  • WordPress version: 6.3.1
  • First release: May 27, 2015
  • Latest release: Apr 15, 2021
  • Number of updates: 23
  • Update frequency: every 93.5 days
  • Top authors: tagNpin (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active /3,974 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼6.73ms] Passed 4 tests

A check of server-side resources used by Customer Referral Program For WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.86 ▼6.25
Dashboard /wp-admin3.33 ▲0.0343.38 ▼5.31
Posts /wp-admin/edit.php3.39 ▲0.0345.54 ▼4.22
Add New Post /wp-admin/post-new.php5.91 ▲0.0383.48 ▼10.59
Media Library /wp-admin/upload.php3.26 ▲0.0335.23 ▼4.75
Invitereferrals_wc /wp-admin/options-general.php?page=Invitereferrals_wc-options3.2430.74

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Customer Referral Program For WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.23 ▼1.141.51 ▼0.2440.61 ▼1.92
Dashboard /wp-admin2,210 ▲194.85 ▼0.01104.19 ▼3.8139.65 ▼5.66
Posts /wp-admin/edit.php2,093 ▲42.00 ▼0.0239.45 ▲4.2336.77 ▲1.52
Add New Post /wp-admin/post-new.php1,516 ▼15123.68 ▲1.22630.50 ▼42.1745.87 ▼10.23
Media Library /wp-admin/upload.php1,392 ▲44.17 ▼0.0496.09 ▼12.7843.56 ▼1.73
Invitereferrals_wc /wp-admin/options-general.php?page=Invitereferrals_wc-options7942.1724.4825.01

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • Invitereferrals_wc

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/invitereferrals-referral-program-for-woocommerce/Invitereferrals_wc.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/invitereferrals-referral-program-for-woocommerce/Invitereferrals_options.php:45

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 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: You are using too many tags: 56 tag instead of maximum 10
The official readme.txt is a good inspiration

invitereferrals-referral-program-for-woocommerce/Invitereferrals_wc.php 85% from 13 tests

The main PHP script in "Customer Referral Program For WooCommerce" version 2.2 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("invitereferrals-referral-program-for-woocommerce.php" instead of "Invitereferrals_wc.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 273 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected237 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP23652237

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods787.50%
▷ Protected methods00.00%
▷ Private methods112.50%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
No PNG images were found in this plugin