78% buddypress-message-attachment

Code Review | BuddyPress Message Attachment

WordPress plugin BuddyPress Message Attachment scored78%from 54 tests.

About plugin

  • Plugin page: buddypress-messag...
  • Plugin version: 2.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.1.1
  • WordPress version: 6.3.1
  • First release: Oct 23, 2012
  • Latest release: Mar 8, 2015
  • Number of updates: 28
  • Update frequency: every 31.5 days
  • Top authors: ckchaudhary (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

300+ active /18,743 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

This is a short check of server-side resources used by BuddyPress Message Attachment
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0441.91 ▲0.39
Dashboard /wp-admin3.40 ▲0.0552.46 ▼11.85
Posts /wp-admin/edit.php3.52 ▲0.1652.06 ▼1.20
Add New Post /wp-admin/post-new.php5.98 ▲0.0996.88 ▼8.80
Media Library /wp-admin/upload.php3.33 ▲0.0938.07 ▲0.78
Message Attachments /wp-admin/options-general.php?page=bp-msgat3.2733.55

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for BuddyPress Message Attachment
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.69 ▲0.341.98 ▲0.1544.53 ▲2.16
Dashboard /wp-admin2,202 ▲285.64 ▲0.1091.77 ▼12.2237.63 ▼6.01
Posts /wp-admin/edit.php2,104 ▲41.99 ▼0.0240.70 ▲1.2336.17 ▼0.83
Add New Post /wp-admin/post-new.php1,529 ▲323.16 ▼0.31616.69 ▼37.6853.84 ▲4.39
Media Library /wp-admin/upload.php1,401 ▲14.22 ▲0.0398.21 ▼3.3748.45 ▲4.79
Message Attachments /wp-admin/options-general.php?page=bp-msgat9822.0027.3232.49

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

Smoke tests 50% 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
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=bp-msgat
    • > Notice in wp-content/plugins/buddypress-message-attachment/includes/admin.php+178
    A non well formed numeric value encountered

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
Almost there! Just fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/buddypress-message-attachment/templates/form.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function msgat_file_cssclass() in wp-content/plugins/buddypress-message-attachment/templates/file.php:1

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

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
2 plugin tags: message attachment, buddypress

buddypress-message-attachment/loader.php 85% from 13 tests

The main file in "BuddyPress Message Attachment" v. 2.1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("buddypress-message-attachment.php" instead of "loader.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected861 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP8187130672
JavaScript23116163
CSS11026

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity27.33
▷ Minimum class complexity23.00
▷ Maximum class complexity30.00
Average method complexity2.84
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods43
▷ Static methods36.98%
▷ Public methods3581.40%
▷ Protected methods00.00%
▷ Private methods818.60%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin