78% author-or-user-image

Code Review | Author or User Image

WordPress plugin Author or User Image scored 78% from 54 tests.

About plugin

  • Plugin page: author-or-user-image
  • Plugin version: 2.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0.2
  • WordPress version: 6.3.1
  • First release: Oct 30, 2013
  • Latest release: Oct 6, 2022
  • Number of updates: 39
  • Update frequency: every 83.9 days
  • Top authors: alimuzzamanalim (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active / 11,520 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼1.54ms] Passed 4 tests

Analyzing server-side resources used by Author or User Image
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1235.13 ▼11.94
Dashboard /wp-admin3.36 ▲0.0642.02 ▼4.01
Posts /wp-admin/edit.php3.53 ▲0.1750.99 ▲3.57
Add New Post /wp-admin/post-new.php6.03 ▲0.1493.47 ▲8.24
Media Library /wp-admin/upload.php3.36 ▲0.1240.39 ▲6.21
Author Image List /wp-admin/users.php?page=Author_Image_List3.3837.49
Author Image /wp-admin/users.php?page=Author_Image3.4032.19
Author Image Settings /wp-admin/users.php?page=Author_Image_Settings3.4030.30
Author Image Black List /wp-admin/users.php?page=Author_Image_Black_List3.4030.51

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Author or User Image
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,851 ▲10513.26 ▼1.114.62 ▲2.7539.02 ▼3.58
Dashboard /wp-admin2,245 ▲574.89 ▼0.99109.47 ▼6.6381.46 ▲41.16
Posts /wp-admin/edit.php2,131 ▲392.00 ▼0.0139.75 ▼1.4337.57 ▲0.93
Add New Post /wp-admin/post-new.php1,558 ▲4418.12 ▲0.44740.29 ▲58.3972.64 ▲11.92
Media Library /wp-admin/upload.php1,424 ▲424.21 ▲0.0396.19 ▼2.9072.52 ▲28.45
Author Image List /wp-admin/users.php?page=Author_Image_List1,0181.6928.0426.82
Author Image /wp-admin/users.php?page=Author_Image9232.2024.8030.27
Author Image Settings /wp-admin/users.php?page=Author_Image_Settings8662.0925.6732.62
Author Image Black List /wp-admin/users.php?page=Author_Image_Black_List1,0101.7124.4126.77

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/users.php?page=Author_Image_List
    • > Warning in wp-content/plugins/author-or-user-image/list.php+154
    scandir(wp-content/uploads/author-image/): failed to open dir: No such file or directory
    • > GET request to /wp-admin/users.php?page=Author_Image_List
    • > Warning in wp-content/plugins/author-or-user-image/list.php+154
    scandir(): (errno 2): No such file or directory
    • > GET request to /wp-admin/users.php?page=Author_Image_List
    • > Warning in wp-content/plugins/author-or-user-image/list.php+161
    count(): Parameter must be an array or an object that implements Countable

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/author-or-user-image/list.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

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 your attention:
  • Donate link: Invalid url: ""
Please take inspiration from this readme.txt

author-or-user-image/author_image.php 85% from 13 tests

The principal PHP file in "Author or User Image" v. 2.0.2 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 196 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("author-or-user-image.php" instead of "author_image.php")

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
No dangerous file extensions were detected918 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP57919695
JavaScript3160191
CSS11032

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity33.33
▷ Minimum class complexity20.00
▷ Maximum class complexity41.00
Average method complexity4.73
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods26
▷ Static methods00.00%
▷ Public methods26100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
default-user-image.png1.46KB1.66KB0.00%