83% buddypress-upload-avatar-ajax

Code Review | Buddypress Upload Avatar Ajax

WordPress plugin Buddypress Upload Avatar Ajax scored83%from 54 tests.

About plugin

  • Plugin page: buddypress-upload...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jul 16, 2014
  • Latest release: Jul 16, 2014
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: huuhabro (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

80+ active /9,192 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 gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼3.31ms] Passed 4 tests

An overview of server-side resources used by Buddypress Upload Avatar Ajax
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0738.41 ▼3.13
Dashboard /wp-admin3.36 ▲0.0641.55 ▼7.12
Posts /wp-admin/edit.php3.41 ▲0.0645.30 ▼0.23
Add New Post /wp-admin/post-new.php5.94 ▲0.0685.22 ▼1.96
Media Library /wp-admin/upload.php3.29 ▲0.0634.88 ▼1.04

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Buddypress Upload Avatar Ajax
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,949 ▲20314.25 ▼0.0318.27 ▲15.7942.34 ▼19.30
Dashboard /wp-admin2,203 ▲155.83 ▼0.06102.16 ▼14.8538.10 ▼4.25
Posts /wp-admin/edit.php2,086 ▼32.00 ▲0.0134.29 ▼3.1634.08 ▲0.06
Add New Post /wp-admin/post-new.php1,537 ▲923.11 ▼0.07676.49 ▼2.5654.91 ▲2.20
Media Library /wp-admin/upload.php1,382 ▼94.18 ▼0.0698.54 ▼6.3442.00 ▼2.06

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/buddypress-upload-avatar-ajax/bp-signup-avatar.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Tested up to: Invalid version format
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (This shows avatar upload button screenshot-1.png), #2 (This shows crop new avatar screenshot-2.png), #3 (This shows success avatar screenshot-3.png), #4 (This shows success avatar screenshot-4.png)
  • Requires at least: Invalid version format
The official readme.txt is a good inspiration

buddypress-upload-avatar-ajax/bp-signup-avatar.php 92% from 13 tests

Analyzing the main PHP file in "Buddypress Upload Avatar Ajax" version 1.0.1
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("buddypress-upload-avatar-ajax.php" instead of "bp-signup-avatar.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected415 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP17140277
JavaScript13415138

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
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%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.41MB with 0.23MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png294.61KB75.02KB▼ 74.54%
screenshot-3.png57.14KB19.18KB▼ 66.44%
screenshot-4.png59.88KB20.01KB▼ 66.59%
screenshot-1.png8.04KB6.61KB▼ 17.88%