62% friends

Code Review | Friends

WordPress plugin Friends scored 62% from 54 tests.

About plugin

  • Plugin page: friends
  • Plugin version: 1.9.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9
  • WordPress version: 5.9.2
  • First release: May 6, 2018
  • Latest release: Jan 20, 2022
  • Number of updates: 71
  • Update frequency: every 80.0 days
  • Top authors: akirk (100%)matt (2.82%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 4,626 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲2.31MB] [CPU: ▼287.03ms] Passed 4 tests

Analyzing server-side resources used by Friends
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /5.83 ▲2.3167.90 ▲4.74
Dashboard /wp-admin5.71 ▲2.3071.43 ▲34.83
Posts /wp-admin/edit.php5.94 ▲2.29136.11 ▲66.74
Add New Post /wp-admin/post-new.php9.59 ▲2.62112.38 ▼1,206.21
Media Library /wp-admin/upload.php5.66 ▲2.3644.81 ▲18.52
Add New Friend /wp-admin/admin.php?page=add-friend5.5864.54
Widgets /wp-admin/widgets.php7.71139.40
Settings /wp-admin/admin.php?page=friends-settings5.7639.80
Plugins /wp-admin/admin.php?page=friends-plugins5.67401.07
Menus /wp-admin/nav-menus.php5.7448.97
Notification Manager /wp-admin/admin.php?page=friends-notification-manager5.5947.99
Automatic Status /wp-admin/admin.php?page=friends-auto-status5.7342.36

Server storage [IO: ▲3.11MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 140 new files
Database: no new tables, 10 new options
New WordPress options
widget_friends-widget-friend-request
friends_default_friend_role
widget_friends-widget-header
friends_private_rss_key
widget_friends-widget-new-private-post
widget_friends-widget-friend-list
widget_friends-widget-refresh
friends_plugin_version
widget_friends-widget-post-formats
friends_main_user_id

Browser metrics Passed 4 tests

A check of browser resources used by Friends
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,007 ▲25316.01 ▲0.755.90 ▼0.512.61 ▼0.44
Dashboard /wp-admin3,075 ▲2256.36 ▲0.17124.82 ▼43.72170.22 ▲9.35
Posts /wp-admin/edit.php2,809 ▲1183.28 ▲0.0565.14 ▲1.50136.21 ▼14.09
Add New Post /wp-admin/post-new.php1,756 ▼421.20 ▼1.36440.88 ▼4.22173.82 ▲14.98
Media Library /wp-admin/upload.php1,820 ▲1225.62 ▲0.11131.23 ▼14.81191.54 ▼9.82
Add New Friend /wp-admin/admin.php?page=add-friend1,1682.4658.04142.72
Widgets /wp-admin/widgets.php4,78634.96693.17183.33
Settings /wp-admin/admin.php?page=friends-settings3,1842.92102.50155.62
Plugins /wp-admin/admin.php?page=friends-plugins1,4522.5056.98121.77
Menus /wp-admin/nav-menus.php2,5013.4771.58148.76
Notification Manager /wp-admin/admin.php?page=friends-notification-manager1,1112.6054.77101.07
Automatic Status /wp-admin/admin.php?page=friends-auto-status1,2493.1658.43107.16

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/friends/includes/class-friends.php+932
    Trying to get property 'ID' of non-object
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_friends-widget-friend-list
    • widget_friends-widget-refresh
    • friends_private_rss_key
    • widget_friends-widget-new-private-post
    • widget_friends-widget-header
    • widget_friends-widget-friend-request
    • friends_default_friend_role
    • friends_plugin_version
    • widget_friends-widget-post-formats

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/widgets.php
    • > User notice in wp-includes/functions.php+5768
    wp_enqueue_script() was called incorrectly. "wp-editor" script should not be enqueued together with the new widgets editor (wp-edit-widgets or wp-customize-widgets). Please see Debugging in WordPress for more information. (This message was added in version 5.8.0.)

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/friends/templates/admin/plugin-installer-footer.php
  • 113× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Friends' not found in wp-content/plugins/friends/templates/frontend/parts/title.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/friends/templates/admin/settings.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Friends' not found in wp-content/plugins/friends/templates/admin/reactions-picker.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Friends_Reactions' not found in wp-content/plugins/friends/templates/frontend/parts/reactions.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/friends/templates/admin/edit-rules.php:10
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/friends/templates/email/friend-message-received.text.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/friends/templates/email/footer.text.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_User' not found in wp-content/plugins/friends/includes/class-friend-user.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_author() in wp-content/plugins/friends/templates/frontend/no-posts.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/friends/templates/admin/edit-friend.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: friends, rss, own-your-data, social-network, decentralized

friends/friends.php 92% from 13 tests

The entry point to "Friends" version 1.9.1 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 149 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin90,477 lines of code in 135 files:
LanguageFilesBlank linesComment linesLines of code
JSON150077,391
PHP1012,0034,81712,160
JavaScript149050784
CSS4251140
Markdown1102

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity45.84
▷ Minimum class complexity1.00
▷ Maximum class complexity329.00
Average method complexity4.51
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes38
▷ Abstract classes25.26%
▷ Concrete classes3694.74%
▷ Final classes00.00%
Methods474
▷ Static methods8217.30%
▷ Public methods42990.51%
▷ Protected methods102.11%
▷ Private methods357.38%
Functions46
▷ Named functions2350.00%
▷ Anonymous functions2350.00%
Constants17
▷ Global constants211.76%
▷ Class constants1588.24%
▷ Public constants15100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin