94% i7avatar

Code Review | i7avatar 头像服务插件

WordPress plugin i7avatar 头像服务插件 scored 94% from 53 tests.

About plugin

  • Plugin page: i7avatar
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5.1-3.9.2
  • WordPress version: 5.8.1
  • First release: Nov 1, 2013
  • Latest release: Aug 15, 2014
  • Number of updates: 6
  • Update frequency: every 47.8 days
  • Top authors: shiqiren (100%)

Code review

53 tests

User reviews

1 review

Install metrics

30+ active / 1,399 total downloads

Benchmarks

Plugin footprint Passed 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.01MB] [CPU: ▼264.20ms] Passed 4 tests

Server-side resources used by i7avatar 头像服务插件
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1328.25 ▲6.92
Dashboard /wp-admin3.07 ▲0.0242.07 ▼3.34
Posts /wp-admin/edit.php3.12 ▲0.0242.79 ▼2.87
Add New Post /wp-admin/post-new.php5.43 ▲0.0090.86 ▼1,046.49
Media Library /wp-admin/upload.php3.01 ▲0.0133.93 ▼4.10

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by i7avatar 头像服务插件
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,673 ▲6715.93 ▲0.349.50 ▲0.8045.71 ▼5.11
Dashboard /wp-admin2,933 ▲835.93 ▲0.08137.97 ▲5.0696.68 ▼8.35
Posts /wp-admin/edit.php2,706 ▼02.69 ▼0.0164.98 ▲3.5791.88 ▲2.58
Add New Post /wp-admin/post-new.php1,481 ▼17218.52 ▼0.28354.26 ▼16.87104.62 ▼8.72
Media Library /wp-admin/upload.php1,772 ▲35.04 ▲0.05147.65 ▼2.00112.06 ▼7.35

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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 fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/i7avatar/i7avatar.php:68

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% 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
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (**i7avatar - 陪伴你的,还有那个你最爱的头像~**) image missing
The official readme.txt is a good inspiration

i7avatar/i7avatar.php 92% from 13 tests

The principal PHP file in "i7avatar 头像服务插件" v. 1.2 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 147 characters long)

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
Everything looks great! No dangerous files found in this plugin28 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1192328

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.40
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin