83% refer-a-friend-for-woocommerce-by-wpgens

Code Review | Refer A Friend for WooCommerce by WPGens

WordPress plugin Refer A Friend for WooCommerce by WPGens scored83%from 54 tests.

About plugin

  • Plugin page: refer-a-friend-fo...
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-6.3
  • WordPress version: 6.3.1
  • First release: Oct 29, 2015
  • Latest release: Sep 10, 2023
  • Number of updates: 108
  • Update frequency: every 26.6 days
  • Top authors: Goran87 (100%)

Code review

54 tests

User reviews

36 reviews

Install metrics

2,000+ active /80,678 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.11MB] [CPU: ▼7.15ms] Passed 4 tests

A check of server-side resources used by Refer A Friend for WooCommerce by WPGens
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▼0.0041.95 ▼14.75
Dashboard /wp-admin3.33 ▲0.0355.28 ▲4.99
Posts /wp-admin/edit.php3.38 ▼0.4653.57 ▼6.07
Add New Post /wp-admin/post-new.php5.91 ▲0.0299.60 ▼9.15
Media Library /wp-admin/upload.php3.25 ▲0.0237.56 ▲1.36

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Refer A Friend for WooCommerce by WPGens
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,900 ▲13913.42 ▼0.738.37 ▲6.6241.19 ▼3.46
Dashboard /wp-admin2,217 ▲405.58 ▼0.0889.43 ▼8.8944.18 ▲1.18
Posts /wp-admin/edit.php2,125 ▲252.15 ▲0.1340.71 ▼7.4436.25 ▲1.59
Add New Post /wp-admin/post-new.php1,545 ▲1922.95 ▼0.22635.55 ▼1.7345.85 ▼6.42
Media Library /wp-admin/upload.php1,425 ▲254.22 ▲0.08101.55 ▼18.5449.60 ▼0.36

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 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 were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/refer-a-friend-for-woocommerce-by-wpgens/admin/gens-notifications.php:139
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Settings_Page' not found in wp-content/plugins/refer-a-friend-for-woocommerce-by-wpgens/admin/class-gens-raf-woo-integration.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
10 plugin tags: referral, referral marketing, reward, sponsorship, refer...

refer-a-friend-for-woocommerce-by-wpgens/gens-raf.php 77% from 13 tests

The main PHP file in "Refer A Friend for WooCommerce by WPGens" ver. 1.3.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 208 characters long)
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("refer-a-friend-for-woocommerce-by-wpgens.php" instead of "gens-raf.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin1,274 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP10169582686
PO File298110565
JavaScript14323

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity6.38
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity1.90
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods48
▷ Static methods36.25%
▷ Public methods4287.50%
▷ Protected methods00.00%
▷ Private methods612.50%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin