83% buddypics

Code Review | BuddyPics

WordPress plugin BuddyPics scored 83% from 54 tests.

About plugin

  • Plugin page: buddypics
  • Plugin version: 0.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.1
  • WordPress version: 6.3.1
  • First release: Jun 17, 2013
  • Latest release: Dec 28, 2014
  • Number of updates: 15
  • Update frequency: every 37.3 days
  • Top authors: modemlooper (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

40+ active / 9,757 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼7.84ms] Passed 4 tests

Server-side resources used by BuddyPics
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.83 ▼1.23
Dashboard /wp-admin3.31 ▲0.0143.66 ▼5.16
Posts /wp-admin/edit.php3.36 ▲0.0046.88 ▼3.57
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.32 ▼19.99
Media Library /wp-admin/upload.php3.23 ▲0.0033.48 ▼2.63

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for BuddyPics
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲7713.27 ▼1.111.69 ▼0.1741.84 ▼2.56
Dashboard /wp-admin2,221 ▲334.80 ▼1.04104.19 ▼11.9938.93 ▼4.31
Posts /wp-admin/edit.php2,103 ▲141.97 ▲0.0035.75 ▼1.7832.40 ▼4.03
Add New Post /wp-admin/post-new.php1,551 ▲3723.14 ▲5.61680.26 ▲10.8353.47 ▲2.06
Media Library /wp-admin/upload.php1,394 ▲124.18 ▼0.0495.98 ▲0.5445.67 ▲1.19

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/buddypics/includes/bpa.filters.php:35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/buddypics/includes/bpa.screens.php:532
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bp_album_picture_has_activity() in wp-content/plugins/buddypics/includes/templates/album/comments.php:1
    • > PHP Fatal error
      Uncaught Error: Call to a member function db_version() on null in wp-content/plugins/buddypics/includes/utils/class.version.check.php:449
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/buddypics/loader.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/buddypics/includes/bpa.cssjs.php:49

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% 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
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 24 tag instead of maximum 10
The official readme.txt is a good inspiration

buddypics/loader.php 85% from 13 tests

"BuddyPics" version 0.3.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("buddypics.php" instead of "loader.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 plugin5,234 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP129901,0432,763
PO File91,0561,6712,310
CSS1277159
JavaScript1292

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.42
Average class complexity50.75
▷ Minimum class complexity21.00
▷ Maximum class complexity80.00
Average method complexity6.53
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods36
▷ Static methods38.33%
▷ Public methods36100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions109
▷ Named functions109100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin