84% bp-automatic-friends

Code Review | BuddyPress Automatic Friends

WordPress plugin BuddyPress Automatic Friends scored 84% from 54 tests.

About plugin

  • Plugin page: bp-automatic-friends
  • Plugin version: 2.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.9
  • WordPress version: 6.3.1
  • First release: Aug 30, 2011
  • Latest release: Jan 23, 2022
  • Number of updates: 64
  • Update frequency: every 59.5 days
  • Top authors: stevenkword (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

400+ active / 25,010 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼1.20ms] Passed 4 tests

A check of server-side resources used by BuddyPress Automatic Friends
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0244.81 ▲1.26
Dashboard /wp-admin3.33 ▲0.0246.79 ▼3.88
Posts /wp-admin/edit.php3.38 ▲0.0249.01 ▼0.57
Add New Post /wp-admin/post-new.php5.91 ▲0.0286.95 ▼1.60
Media Library /wp-admin/upload.php3.25 ▲0.0235.93 ▲2.92

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for BuddyPress Automatic Friends
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.58 ▼0.801.71 ▼0.3842.70 ▲0.09
Dashboard /wp-admin2,206 ▲245.83 ▲0.95103.82 ▼14.9339.60 ▼5.91
Posts /wp-admin/edit.php2,092 ▼02.00 ▼0.0334.56 ▼2.5132.91 ▲1.54
Add New Post /wp-admin/post-new.php1,531 ▲1723.12 ▲5.68627.45 ▲11.6553.89 ▲6.02
Media Library /wp-admin/upload.php1,391 ▼04.17 ▼0.0298.64 ▲0.6241.83 ▼2.41

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/bp-automatic-friends/inc/admin.php:55
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/bp-automatic-friends/inc/update.php:55
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/bp-automatic-friends/bp-automatic-friends.php:77

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
Attributes that require attention: You can take inspiration from this readme.txt

bp-automatic-friends/bp-automatic-friends.php Passed 13 tests

The main PHP file in "BuddyPress Automatic Friends" ver. 2.0.8 adds more information about the plugin and also serves as the entry point for this plugin
113 characters long description:
Automatically create and accept friendships for specified users upon new user registration. * Requires BuddyPress

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
Everything looks great! No dangerous files found in this plugin1,425 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP3107282405
HTML1565401
CSS22524178
PO File24750142
SVG100133
JavaScript1131095
Markdown152071

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity17.33
▷ Minimum class complexity10.00
▷ Maximum class complexity27.00
Average method complexity2.53
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods32
▷ Static methods721.88%
▷ Public methods2681.25%
▷ Protected methods00.00%
▷ Private methods618.75%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants00.00%
▷ Class constants8100.00%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.30MB with 0.19MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png92.32KB33.44KB▼ 63.78%
screenshot-2.png101.80KB37.14KB▼ 63.51%
screenshot-3.png110.07KB39.78KB▼ 63.86%