90% custom-post-avatar

Code Review | Custom Post Avatar

WordPress plugin Custom Post Avatar scored90%from 54 tests.

About plugin

  • Plugin page: custom-post-avatar
  • Plugin version: 0.9.6
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.5
  • WordPress version: 6.3.1
  • First release: Mar 17, 2019
  • Latest release: Sep 24, 2020
  • Number of updates: 5
  • Update frequency: every 111.4 days
  • Top authors: chrisbergr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /785 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼10.09ms] Passed 4 tests

This is a short check of server-side resources used by Custom Post Avatar
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1044.29 ▼1.03
Dashboard /wp-admin3.38 ▲0.0449.38 ▼19.47
Posts /wp-admin/edit.php3.50 ▲0.1451.17 ▼5.49
Add New Post /wp-admin/post-new.php5.99 ▲0.1095.70 ▼14.35
Media Library /wp-admin/upload.php3.31 ▲0.0837.46 ▲2.91

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Custom Post Avatar
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,784 ▲3814.36 ▼0.011.89 ▲0.1243.28 ▲3.69
Dashboard /wp-admin2,192 ▲245.62 ▲0.0991.77 ▼1.0645.17 ▼0.01
Posts /wp-admin/edit.php2,106 ▲462.56 ▲0.5156.07 ▲17.2936.32 ▲3.30
Add New Post /wp-admin/post-new.php6,232 ▲4,69721.00 ▲2.93875.00 ▲172.9872.96 ▲3.17
Media Library /wp-admin/upload.php1,400 ▲34.16 ▲0.0294.83 ▼6.1042.79 ▼1.41

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
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP Passed 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 SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: replacement, user image, gravatar, local avatar, avatar

custom-post-avatar/custom-post-avatar.php Passed 13 tests

The main file in "Custom Post Avatar" v. 0.9.6 serves as a complement to information provided in readme.txt and as the entry point to the plugin
113 characters long description:
This Plugin gives you the possibility to replace your default avatar by a custom image on each post individually.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected625 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP35734458
JavaScript117685
CSS112182

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity37.00
▷ Minimum class complexity37.00
▷ Maximum class complexity37.00
Average method complexity2.80
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods1785.00%
▷ Protected methods00.00%
▷ Private methods315.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

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
default.png2.52KB2.78KB0.00%