84% buddypress-xprofile-image-field

Code Review | BuddyPress XProfile Custom Image Field

WordPress plugin BuddyPress XProfile Custom Image Field scored84%from 54 tests.

About plugin

  • Plugin page: buddypress-xprofi...
  • Plugin version: 2.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2.1-6.3
  • WordPress version: 6.3.1
  • First release: Mar 12, 2014
  • Latest release: Oct 12, 2023
  • Number of updates: 74
  • Update frequency: every 47.3 days
  • Top authors: kalengi (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

400+ active /16,649 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼2.71ms] Passed 4 tests

Analyzing server-side resources used by BuddyPress XProfile Custom Image Field
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0735.99 ▼1.96
Dashboard /wp-admin3.38 ▲0.0746.21 ▲1.61
Posts /wp-admin/edit.php3.49 ▲0.1447.36 ▲1.56
Add New Post /wp-admin/post-new.php5.96 ▲0.0782.71 ▼6.57
Media Library /wp-admin/upload.php3.30 ▲0.0733.14 ▼3.88

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by BuddyPress XProfile Custom Image Field
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.32 ▼0.081.80 ▲0.1240.92 ▲1.13
Dashboard /wp-admin2,192 ▲125.56 ▼0.0880.44 ▼6.4638.98 ▼2.34
Posts /wp-admin/edit.php2,100 ▲182.00 ▼0.1538.78 ▲0.2037.00 ▼0.44
Add New Post /wp-admin/post-new.php1,537 ▲918.30 ▼4.75630.72 ▼35.6559.54 ▲10.65
Media Library /wp-admin/upload.php1,394 ▼04.29 ▲0.0295.66 ▼1.2442.54 ▼0.54

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/buddypress-xprofile-image-field/bp-xprofile-image-field.php:534

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
8 plugin tags: xprofile, buddypress, custom profile field, user profile, image...

buddypress-xprofile-image-field/bp-xprofile-image-field.php 92% from 13 tests

The entry point to "BuddyPress XProfile Custom Image Field" version 2.4.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("buddypress-xprofile-image-field.php" instead of "bp-xprofile-image-field.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin541 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP2198340219
JavaScript25944162
PO File2172287
CSS1191273

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity27.00
▷ Minimum class complexity7.00
▷ Maximum class complexity47.00
Average method complexity3.26
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods23
▷ Static methods28.70%
▷ Public methods2191.30%
▷ Protected methods14.35%
▷ Private methods14.35%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected