84% wpavatar

Code Review | WPAvatar

WordPress plugin WPAvatar scored84%from 54 tests.

About plugin

  • Plugin page: wpavatar
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.2
  • WordPress version: 6.3.1
  • First release: May 17, 2023
  • Latest release: May 17, 2023
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: wpfanyi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /1,020 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.18ms] Passed 4 tests

A check of server-side resources used by WPAvatar
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.52 ▲1.64
Dashboard /wp-admin3.32 ▲0.0245.11 ▼11.81
Posts /wp-admin/edit.php3.37 ▲0.0250.06 ▲3.61
Add New Post /wp-admin/post-new.php5.90 ▲0.0284.85 ▼9.31
Media Library /wp-admin/upload.php3.25 ▲0.0235.44 ▼1.24
Avatar /wp-admin/options-general.php?page=wpavatar-settings3.2127.97

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 8 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
wpavatar_enable_cravatar
db_upgraded
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

WPAvatar: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.34 ▼0.021.91 ▲0.3345.40 ▲5.83
Dashboard /wp-admin2,199 ▲225.49 ▼0.1179.13 ▼8.6238.53 ▼3.84
Posts /wp-admin/edit.php2,104 ▲42.03 ▲0.0133.40 ▼1.9835.51 ▲1.89
Add New Post /wp-admin/post-new.php1,529 ▼623.24 ▲4.90673.79 ▲33.8561.67 ▼7.35
Media Library /wp-admin/upload.php1,404 ▲44.20 ▼0.01109.33 ▼10.8448.08 ▼0.23
Avatar /wp-admin/options-general.php?page=wpavatar-settings8312.1626.9527.76

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • wpavatar_enable_cravatar
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wpavatar/includes/cravatar.php:31

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 Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: cravatar, wpavatar, avatar, gravatar, wp avatar

wpavatar/wpavatar.php Passed 13 tests

The entry point to "WPAvatar" version 1.0 is a PHP file that has certain tags in its header comment area
75 characters long description:
Replace Gravatar with Cravatar, a perfect replacement of Gravatar in China.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin212 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PO File23030116
PHP2234096

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin