83% author-image

Code Review | WP Custom Author Image

WordPress plugin WP Custom Author Image scored83%from 54 tests.

About plugin

  • Plugin page: author-image
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.2
  • WordPress version: 6.3.1
  • First release: Dec 17, 2018
  • Latest release: Aug 27, 2019
  • Number of updates: 4
  • Update frequency: every 64.0 days
  • Top authors: p4wparamjeet (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /1,914 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▼0.18MB] [CPU: ▼15.57ms] Passed 4 tests

A check of server-side resources used by WP Custom Author Image
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.40 ▼0.0724.99 ▼16.93
Dashboard /wp-admin3.18 ▼0.1230.53 ▼16.36
Posts /wp-admin/edit.php3.26 ▼0.1033.88 ▼15.21
Add New Post /wp-admin/post-new.php5.45 ▼0.4370.66 ▼13.77
Media Library /wp-admin/upload.php3.19 ▼0.0329.60 ▼5.46

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_wp_custom_author_image
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by WP Custom Author Image
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,779 ▲1814.35 ▼0.271.64 ▲0.0437.95 ▼7.84
Dashboard /wp-admin2,195 ▲215.54 ▼0.0481.09 ▼6.7282.44 ▲39.42
Posts /wp-admin/edit.php2,100 ▼01.99 ▲0.0235.03 ▼3.9134.37 ▲1.02
Add New Post /wp-admin/post-new.php1,526 ▼223.39 ▲0.28780.18 ▲88.1964.57 ▲14.19
Media Library /wp-admin/upload.php1,403 ▲34.19 ▲0.0497.34 ▼11.6365.99 ▲18.96

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_wp_custom_author_image
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/author-image/multipart-user/multipart-user.php:40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/author-image/wp-custom-author-image-admin.php:52
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/author-image/wp-custom-author-image.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/author-image/wp-custom-author-image-info.php:2

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% 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
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (After activate this plugin go to plugin settings by click on "Users". You can also find the plugin settings by 'Users > Your Profile' menu in your WordPress backend like as above screen.), #2 (You can use [wp-custom-author-image] to display the uploaded WP Custom Author Image in your page/post content.)
You can take inspiration from this readme.txt

author-image/wp-custom-author-image.php 85% from 13 tests

The principal PHP file in "WP Custom Author Image" v. 1.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("author-image.php" instead of "wp-custom-author-image.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin680 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP4214285680

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity48.50
▷ Minimum class complexity34.00
▷ Maximum class complexity63.00
Average method complexity5.13
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods23
▷ Static methods1043.48%
▷ Public methods23100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png10.89KB6.49KB▼ 40.41%
screenshot-2.png40.95KB16.44KB▼ 59.85%