90% bp-attachments

Code Review | BP Attachments

WordPress plugin BP Attachments scored90%from 54 tests.

About plugin

  • Plugin page: bp-attachments
  • Plugin version: 1.2.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1-6.3
  • WordPress version: 6.3.1
  • First release: Mar 12, 2023
  • Latest release: Sep 24, 2023
  • Number of updates: 6
  • Update frequency: every 32.8 days
  • Top authors: imath (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active /2,186 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
Install script ran successfully

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

Server-side resources used by BP Attachments
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.36 ▼3.98
Dashboard /wp-admin3.33 ▲0.0251.57 ▼6.86
Posts /wp-admin/edit.php3.38 ▲0.0251.34 ▼4.52
Add New Post /wp-admin/post-new.php5.91 ▲0.0294.06 ▼1.75
Media Library /wp-admin/upload.php3.25 ▲0.0238.81 ▲0.11

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 107 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by BP Attachments
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲4514.72 ▲0.371.91 ▼0.0442.32 ▼2.86
Dashboard /wp-admin2,209 ▲355.52 ▼0.1186.36 ▼15.5139.15 ▼3.62
Posts /wp-admin/edit.php2,117 ▲142.04 ▲0.0838.02 ▼1.6336.77 ▲1.92
Add New Post /wp-admin/post-new.php1,549 ▲2218.20 ▼5.00606.46 ▼117.5382.46 ▲20.61
Media Library /wp-admin/upload.php1,411 ▲144.19 ▼0.02104.46 ▼6.7643.01 ▼3.53

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: media, attachments, add-on, buddypress

bp-attachments/class-bp-attachments.php 92% from 13 tests

"BP Attachments" version 1.2.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("bp-attachments.php" instead of "class-bp-attachments.php")

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 plugin7,261 lines of code in 86 files:
LanguageFilesBlank linesComment linesLines of code
PHP501,2573,4015,974
CSS13225151,197
SVG100074
JavaScript1224115
JSON1001

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity31.00
▷ Minimum class complexity1.00
▷ Maximum class complexity85.00
Average method complexity4.55
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes111.11%
Methods76
▷ Static methods67.89%
▷ Public methods6686.84%
▷ Protected methods911.84%
▷ Private methods11.32%
Functions203
▷ Named functions203100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
bp-attachments/assets/images/image.png2.29KB0.60KB▼ 73.86%
bp-attachments/assets/images/media-icons.png1.52KB2.04KB0.00%