84% avatars-meta-box

Code Review | Avatars Meta Box

WordPress plugin Avatars Meta Box scored 84% from 54 tests.

About plugin

  • Plugin page: avatars-meta-box
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.4
  • WordPress version: 6.3.1
  • First release: Oct 27, 2015
  • Latest release: Oct 27, 2015
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: greenshady (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,324 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.94ms] Passed 4 tests

Analyzing server-side resources used by Avatars Meta Box
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0038.36 ▲0.30
Dashboard /wp-admin3.31 ▲0.0142.33 ▼7.51
Posts /wp-admin/edit.php3.36 ▲0.0142.63 ▼1.97
Add New Post /wp-admin/post-new.php5.90 ▲0.0280.57 ▼10.59
Media Library /wp-admin/upload.php3.24 ▲0.0137.01 ▲4.69

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Avatars Meta Box
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.53 ▼0.772.05 ▲0.2944.81 ▼0.47
Dashboard /wp-admin2,209 ▲214.84 ▼1.20116.00 ▲10.1246.51 ▼2.77
Posts /wp-admin/edit.php2,092 ▲32.03 ▼0.0236.22 ▼4.9833.55 ▲2.65
Add New Post /wp-admin/post-new.php6,484 ▲4,94220.65 ▲2.12921.26 ▲259.4758.83 ▲3.54
Media Library /wp-admin/upload.php1,385 ▼64.24 ▲0.00102.95 ▲1.8344.82 ▼0.34

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/avatars-meta-box/admin/class-meta-box-avatars.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/avatars-meta-box/avatars-meta-box.php:93

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Edit post screen with author avatar box in normal position.), #2 (Edit post screeen with author avatar box in side position.), #3 (Author avatar box.)
The official readme.txt is a good inspiration

avatars-meta-box/avatars-meta-box.php Passed 13 tests

Analyzing the main PHP file in "Avatars Meta Box" version 1.0.0
117 characters long description:
Select post author by clicking on their avatar on the edit post screen instead of the default drop-down select field.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin447 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
Markdown4820308
PHP262188110
CSS15029

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity7.00
▷ Minimum class complexity3.00
▷ Maximum class complexity11.00
Average method complexity1.86
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes2100.00%
Methods14
▷ Static methods214.29%
▷ Public methods964.29%
▷ Protected methods17.14%
▷ Private methods428.57%
Functions1
▷ Named functions1100.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
3 PNG files occupy 0.33MB with 0.20MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png37.82KB15.75KB▼ 58.34%
screenshot-2.png142.39KB56.17KB▼ 60.55%
screenshot-1.png158.85KB63.12KB▼ 60.26%