72% referral-program-parrainage-clients

Code Review | Fidélité et parrainage

WordPress plugin Fidélité et parrainage scored72%from 54 tests.

About plugin

  • Plugin page: referral-program-...
  • Plugin version: 2.6.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-6.1
  • WordPress version: 6.3.1
  • First release: Jul 30, 2017
  • Latest release: Oct 11, 2023
  • Number of updates: 96
  • Update frequency: every 23.6 days
  • Top authors: loicm (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /3,678 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.19MB] [CPU: ▼3.04ms] Passed 4 tests

This is a short check of server-side resources used by Fidélité et parrainage
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1536.59 ▼1.17
Dashboard /wp-admin3.50 ▲0.1946.54 ▼3.73
Posts /wp-admin/edit.php3.61 ▲0.2548.09 ▼3.62
Add New Post /wp-admin/post-new.php6.10 ▲0.2182.48 ▼3.62
Media Library /wp-admin/upload.php3.42 ▲0.1937.22 ▼0.80
Aide /wp-admin/admin.php?page=help3.4034.24
Paramétrage /wp-admin/admin.php?page=referral3.37440.07
Reports /wp-admin/admin.php?page=referral_reports3.37250.65

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Fidélité et parrainage: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲8013.30 ▼1.294.50 ▲2.6138.30 ▼2.14
Dashboard /wp-admin2,247 ▲705.92 ▲0.2185.04 ▼1.2634.47 ▼9.44
Posts /wp-admin/edit.php2,155 ▲552.29 ▲0.2741.61 ▲0.9836.24 ▲0.23
Add New Post /wp-admin/post-new.php1,576 ▲5023.37 ▼0.41667.48 ▼49.6134.90 ▼17.98
Media Library /wp-admin/upload.php1,444 ▲414.43 ▲0.2794.86 ▼3.1241.59 ▼4.38
Aide /wp-admin/admin.php?page=help1,0761.8825.8033.87
Paramétrage /wp-admin/admin.php?page=referral1,6592.7552.2630.41
Reports /wp-admin/admin.php?page=referral_reports8261.9425.0424.61

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

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
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=referral
    • > Warning in wp-content/plugins/referral-program-parrainage-clients/class.wlc-referral-admin.php+104
    fopen(https://pixel.welovecustomers.fr/api/getNPS/): failed to open stream: HTTP request failed! HTTP/1.0 401 Unauthorized

  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=referral_reports
    • > Warning in wp-content/plugins/referral-program-parrainage-clients/class.wlc-referral-admin.php+104
    fopen(https://pixel.welovecustomers.fr/api/referralInfos/): failed to open stream: HTTP request failed! HTTP/1.0 401 Unauthorized

    • > GET request to /wp-admin/admin.php?page=referral
    • > Notice in wp-content/plugins/referral-program-parrainage-clients/views/display.php+13
    Undefined index: wlcUrl
    • > GET request to /wp-admin/admin.php?page=referral
    • > Notice in wp-content/plugins/referral-program-parrainage-clients/views/display.php+137
    Undefined index: color
    • > GET request to /wp-admin/admin.php?page=referral
    • > Notice in wp-content/plugins/referral-program-parrainage-clients/views/display.php+147
    Undefined index: background-color
    • > GET request to /wp-admin/admin.php?page=referral
    • > Notice in wp-content/plugins/referral-program-parrainage-clients/views/display.php+157
    Undefined index: header-color
    • > GET request to /wp-admin/admin.php?page=referral
    • > Notice in wp-content/plugins/referral-program-parrainage-clients/views/display.php+167
    Undefined index: header-background-color
    • > GET request to /wp-admin/admin.php?page=referral
    • > Notice in wp-content/plugins/referral-program-parrainage-clients/views/display.php+227
    Undefined index: enabled
    • > GET request to /wp-admin/admin.php?page=referral
    • > Notice in wp-content/plugins/referral-program-parrainage-clients/views/display.php+228
    Undefined index: position
    • > GET request to /wp-admin/admin.php?page=referral
    • > Notice in wp-content/plugins/referral-program-parrainage-clients/views/display.php+229
    Undefined index: image
    • > GET request to /wp-admin/admin.php?page=referral
    • > Notice in wp-content/plugins/referral-program-parrainage-clients/views/display.php+230
    Undefined index: syncTrigger
    • > GET request to /wp-admin/admin.php?page=referral
    • > Notice in wp-content/plugins/referral-program-parrainage-clients/views/display.php+231
    Undefined index: syncAmount
    • > GET request to /wp-admin/admin.php?page=referral_reports
    • > Warning in wp-content/plugins/referral-program-parrainage-clients/class.wlc-referral-admin.php+104
    fopen(https://pixel.welovecustomers.fr/api/getStats/): failed to open stream: HTTP request failed! HTTP/1.0 401 Unauthorized

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 7× PHP files output text when accessed directly:
    • > /wp-content/plugins/referral-program-parrainage-clients/views/tag/wlc-giftshop-link.php
    • > /wp-content/plugins/referral-program-parrainage-clients/views/tag/wlc-badge.php
    • > /wp-content/plugins/referral-program-parrainage-clients/views/tag/wlc-box.php
    • > /wp-content/plugins/referral-program-parrainage-clients/views/tag/wlc-purchase.php
    • > /wp-content/plugins/referral-program-parrainage-clients/views/tag/wlc-dashboard.php
    • > /wp-content/plugins/referral-program-parrainage-clients/wlc-referral.php
    • > /wp-content/plugins/referral-program-parrainage-clients/views/tag/wlc-loyalty.php
  • 83× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: param in wp-content/plugins/referral-program-parrainage-clients/views/tag/wlc-box.php on line 1
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/referral-program-parrainage-clients/views/tag/wlc-corner-box.php on line 2
    • > PHP Notice
      Undefined variable: param in wp-content/plugins/referral-program-parrainage-clients/views/tag/wlc-box.php on line 1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/referral-program-parrainage-clients/views/tag/wlc-loyalty.php on line 1
    • > PHP Notice
      Undefined variable: param in wp-content/plugins/referral-program-parrainage-clients/views/tag/wlc-box.php on line 1
    • > PHP Warning
      Use of undefined constant WLC_PLUGIN_URL - assumed 'WLC_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/referral-program-parrainage-clients/views/help.php on line 1
    • > PHP Notice
      Undefined variable: param in wp-content/plugins/referral-program-parrainage-clients/views/tag/wlc-dashboard.php on line 2
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/referral-program-parrainage-clients/views/tag/wlc-corner-box.php on line 2
    • > PHP Notice
      Undefined variable: param in wp-content/plugins/referral-program-parrainage-clients/views/tag/wlc-dashboard.php on line 2
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/referral-program-parrainage-clients/views/tag/wlc-corner-box.php on line 2

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: Add images for these screenshots: #1 (http://www.welovecustomers.fr/wp-content/uploads/2017/07/woo-commerce-plugin-parrainage-1080x88.png), #2 (http://www.welovecustomers.fr/wp-content/uploads/2017/07/woo-commerce-plugin-parrainage-configuration.png), #3 (http://www.welovecustomers.fr/wp-content/uploads/2017/07/screenshot-wlc-referral-front-1080x563.png)
  • Tags: You are using too many tags: 19 tag instead of maximum 10
The official readme.txt is a good inspiration

referral-program-parrainage-clients/wlc-referral.php 92% from 13 tests

The main PHP file in "Fidélité et parrainage" ver. 2.6.2 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: Please rename the main PHP file in this plugin to the plugin slug ("referral-program-parrainage-clients.php" instead of "wlc-referral.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin1,827 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP16270991,529
PO File1880185
CSS217077
JavaScript42036

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity79.50
▷ Minimum class complexity27.00
▷ Maximum class complexity132.00
Average method complexity3.80
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods56
▷ Static methods56100.00%
▷ Public methods5496.43%
▷ Protected methods00.00%
▷ Private methods23.57%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants787.50%
▷ Class constants112.50%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/referral_icon.png0.55KB0.71KB0.00%
img/icon_suivi.png1.13KB0.95KB▼ 16.12%