94% profile-picture

Code Review | Profile Picture

WordPress plugin Profile Picture scored 94% from 54 tests.

About plugin

  • Plugin page: profile-picture
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.5.2
  • WordPress version: 5.8.1
  • First release: Sep 21, 2015
  • Latest release: Jun 3, 2016
  • Number of updates: 13
  • Update frequency: every 19.7 days
  • Top authors: aruljayarajs (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active / 7,699 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼139.63ms] Passed 4 tests

Server-side resources used by Profile Picture
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.0434.96 ▼0.31
Dashboard /wp-admin3.09 ▲0.0441.23 ▼6.08
Posts /wp-admin/edit.php3.18 ▲0.0739.24 ▼5.30
Add New Post /wp-admin/post-new.php5.46 ▲0.0394.17 ▼546.83
Media Library /wp-admin/upload.php3.04 ▲0.0436.86 ▲4.13

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Profile Picture
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,817 ▲22116.37 ▲0.7014.48 ▲3.9246.89 ▼2.45
Dashboard /wp-admin2,977 ▲495.99 ▲0.00140.79 ▼0.26112.33 ▼0.13
Posts /wp-admin/edit.php2,762 ▲232.76 ▲0.0474.40 ▲2.0082.13 ▼6.65
Add New Post /wp-admin/post-new.php1,624 ▲12421.41 ▲2.77291.60 ▼109.24101.96 ▼9.94
Media Library /wp-admin/upload.php1,827 ▲205.09 ▲0.04145.29 ▼9.56111.56 ▲0.76

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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 take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/profile-picture/profile-picture.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_upload_dir() in wp-content/plugins/profile-picture/html/profile_fields.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Donate link: Please fix this invalid url: ""
The official readme.txt might help

profile-picture/profile-picture.php 92% from 13 tests

The entry point to "Profile Picture" version 1.0 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 181 characters long)

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
Success! There were no dangerous files found in this plugin219 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP43324175
JavaScript11724
CSS11320

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity25.00
▷ Minimum class complexity25.00
▷ Maximum class complexity25.00
Average method complexity3.67
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/trash.png0.63KB1.08KB0.00%
assets/images/picture_edit.png0.81KB0.90KB0.00%