79% enquir3-referrals

Code Review | Enquir3 Referral

WordPress plugin Enquir3 Referral scored 79% from 54 tests.

About plugin

  • Plugin page: enquir3-referrals
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Jun 17, 2020
  • Latest release: Sep 6, 2021
  • Number of updates: 8
  • Update frequency: every 55.8 days
  • Top authors: enquir3 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 203 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

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

Server-side resources used by Enquir3 Referral
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0040.28 ▼24.78
Dashboard /wp-admin3.06 ▲0.0056.43 ▲6.72
Posts /wp-admin/edit.php3.11 ▼0.0142.64 ▼19.81
Add New Post /wp-admin/post-new.php5.42 ▼0.02100.78 ▼1,358.98
Media Library /wp-admin/upload.php3.00 ▲0.0039.45 ▲0.95

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 19 new files
Database: no new tables, 1 new option
New WordPress options
eq3r_options

Browser metrics Passed 4 tests

Checking browser requirements for Enquir3 Referral
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,678 ▲6515.57 ▼0.0710.05 ▼2.6455.17 ▼9.49
Dashboard /wp-admin2,967 ▲335.92 ▼0.06169.98 ▲5.55150.03 ▲18.57
Posts /wp-admin/edit.php2,736 ▼32.86 ▲0.1465.02 ▼10.20109.50 ▲0.95
Add New Post /wp-admin/post-new.php1,615 ▼6821.44 ▲5.28325.07 ▼82.25126.59 ▼14.62
Media Library /wp-admin/upload.php1,807 ▼05.13 ▲0.12179.39 ▼6.33133.96 ▲2.96

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 1 option in the database
    • eq3r_options

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)
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/enquir3-referrals/views/mail-referred-reward-body.tpl.php
    • > /wp-content/plugins/enquir3-referrals/views/referral-step-two-form.tpl.php
    • > /wp-content/plugins/enquir3-referrals/views/mail-referral-request-body.tpl.php
    • > /wp-content/plugins/enquir3-referrals/views/voucher-redeem-confirmation-form.tpl.php
    • > /wp-content/plugins/enquir3-referrals/views/mail-referrer-reward-body.tpl.php
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/enquir3-referrals/includes/class-eq3r-voucher-management-table.php on line 7
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/enquir3-referrals/includes/class-eq3r-voucher-management-table.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/enquir3-referrals/views/voucher-redeem-confirmation-form.tpl.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in /var/www/wordpress/wp-content/plugins/enquir3-referrals/includes/enquir3-referrals-settings.inc:6
    • > PHP Notice
      Undefined variable: vars in wp-content/plugins/enquir3-referrals/views/voucher-redeem-confirmation-form.tpl.php on line 5
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/enquir3-referrals/views/voucher-redeem-confirmation-form.tpl.php on line 5
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/enquir3-referrals/includes/class-eq3r-voucher-management-table.php on line 7

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)
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: referral feedback, testimonial

enquir3-referrals/enquir3-referrals.php Passed 13 tests

"Enquir3 Referral" version 1.0.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
25 characters long description:
Handle Enquir3 Referrals.

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
Success! There were no dangerous files found in this plugin1,096 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP7110239689
Twig5130176
Pascal253261146
CSS29550
JavaScript18035

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity22.00
▷ Minimum class complexity17.00
▷ Maximum class complexity27.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods28
▷ Static methods27.14%
▷ Public methods2796.43%
▷ Protected methods00.00%
▷ Private methods13.57%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin