78% refer-a-friend-program-for-woocommerce

Code Review | Refer a Friend Program for WooCommerce

WordPress plugin Refer a Friend Program for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: refer-a-friend-pr...
  • Plugin version: 01...
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.2
  • WordPress version: 6.3.1
  • First release: Apr 14, 2014
  • Latest release: May 5, 2019
  • Number of updates: 152
  • Update frequency: every 12.2 days
  • Top authors: storeya (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

30+ active /9,436 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.03MB] [CPU: ▼0.21ms] Passed 4 tests

Analyzing server-side resources used by Refer a Friend Program for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0342.90 ▲0.33
Dashboard /wp-admin3.34 ▲0.0348.85 ▲0.65
Posts /wp-admin/edit.php3.39 ▲0.0348.18 ▼5.58
Add New Post /wp-admin/post-new.php5.92 ▲0.0391.19 ▲3.75
Media Library /wp-admin/upload.php3.26 ▲0.0337.72 ▲4.75
Refer a Friend /wp-admin/options-general.php?page=storeya-refer-a-friend3.2031.88

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Refer a Friend Program for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲7713.34 ▼0.814.73 ▲2.6941.59 ▼9.77
Dashboard /wp-admin2,218 ▲275.80 ▲0.9694.21 ▼23.5841.50 ▼2.93
Posts /wp-admin/edit.php2,100 ▲112.01 ▲0.0136.39 ▼2.6429.82 ▼5.85
Add New Post /wp-admin/post-new.php1,545 ▲1223.27 ▲0.25678.22 ▼4.9855.47 ▲1.72
Media Library /wp-admin/upload.php1,403 ▲154.23 ▲0.0597.60 ▲3.0344.77 ▼1.45
Refer a Friend /wp-admin/options-general.php?page=storeya-refer-a-friend8622.1526.7837.05

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=storeya-refer-a-friend
    • > 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=storeya-refer-a-friend
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/refer-a-friend-program-for-woocommerce/storeya-refer-a-friend.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

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
Attributes that require attention:
  • Tags: Please delete some tags, you are using 16 tag instead of maximum 10
You can look at the official readme.txt

refer-a-friend-program-for-woocommerce/storeya-refer-a-friend.php 85% from 13 tests

This is the main PHP file of "Refer a Friend Program for WooCommerce" version 01..., providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("refer-a-friend-program-for-woocommerce.php" instead of "storeya-refer-a-friend.php")
  • Version: Use periods and digits only for your plugin's version number (ex. "1.0.3" instead of "01...")

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
No dangerous file extensions were detected143 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP11910143

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.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
2 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
storeya-refer-a-friend.png43.69KB24.39KB▼ 44.17%
lock.png0.73KB0.91KB0.00%