10% af-tell-a-friend

Code Review | AF Tell a Friend

WordPress plugin AF Tell a Friend scored 10% from 54 tests.

About plugin

  • Plugin page: af-tell-a-friend
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.9
  • WordPress version: 5.8.1
  • First release: Feb 23, 2013
  • Latest release: Apr 17, 2014
  • Number of updates: 8
  • Update frequency: every 52.2 days
  • Top authors: argonfactory (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

100+ active / 6,391 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Warning in wp-content/plugins/af-tell-a-friend/af-tell-friend.php+38
    Use of undefined constant ‘af_tf_uninstall’ - assumed '‘af_tf_uninstall’' (this will throw an Error in a future version of PHP)

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

A check of server-side resources used by AF Tell a Friend
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.1537.89 ▲16.27
Dashboard /wp-admin3.09 ▲0.0441.90 ▼4.53
Posts /wp-admin/edit.php3.15 ▲0.0471.33 ▲26.90
Add New Post /wp-admin/post-new.php5.45 ▲0.02109.71 ▼542.49
Media Library /wp-admin/upload.php3.04 ▲0.0435.18 ▼0.64
AF Tell a Friend /wp-admin/options-general.php?page=af-tell-a-friend/af-tell-friend.php2.9830.92

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: no new tables, 1 new option
New WordPress options
af_tf_plugin_options

Browser metrics Passed 4 tests

A check of browser resources used by AF Tell a Friend
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,710 ▲11415.91 ▼0.077.94 ▼0.5649.31 ▲0.46
Dashboard /wp-admin2,972 ▲385.88 ▼0.30147.24 ▼7.40120.40 ▲4.75
Posts /wp-admin/edit.php2,744 ▲52.69 ▲0.0280.77 ▲9.5696.13 ▼1.52
Add New Post /wp-admin/post-new.php1,501 ▼18218.82 ▲0.14391.36 ▲22.34109.27 ▼22.47
Media Library /wp-admin/upload.php1,812 ▲55.02 ▼0.01154.81 ▼11.87126.89 ▲8.38
AF Tell a Friend /wp-admin/options-general.php?page=af-tell-a-friend/af-tell-friend.php1,0932.0958.8178.51

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Warning in wp-includes/class-wp-hook.php+303
    call_user_func_array() expects parameter 1 to be a valid callback, function '‘af_tf_uninstall’' not found or invalid function name
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • af_tf_plugin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=af-tell-a-friend/af-tell-friend.php
    • > Notice in wp-content/plugins/af-tell-a-friend/af-tell-friend.php+73
    Undefined index: af_tf_admin_setting

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
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/af-tell-a-friend/af-tf-window.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/af-tell-a-friend/af-tell-friend.php:53

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: tell a friend, email a friend, email form, refer a friend, tell a friend widget...

af-tell-a-friend/af-tell-friend.php 85% from 13 tests

The primary PHP file in "AF Tell a Friend" version 1.4 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("af-tell-a-friend.php" instead of "af-tell-friend.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 364 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin331 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP210230274
JavaScript19035
CSS14122

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.09
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%
Functions11
▷ Named functions11100.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
PNG images were not found in this plugin