74% hanzi-of-the-day

Code Review | Hanzi of the Day

WordPress plugin Hanzi of the Day scored 74% from 54 tests.

About plugin

  • Plugin page: hanzi-of-the-day
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.6
  • WordPress version: 5.8.1
  • First release: Sep 13, 2013
  • Latest release: Sep 13, 2013
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: Megafeihong (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 481 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

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

This is a short check of server-side resources used by Hanzi of the Day
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1435.16 ▲10.33
Dashboard /wp-admin3.09 ▲0.0341.08 ▼10.42
Posts /wp-admin/edit.php3.14 ▲0.0342.02 ▼4.87
Add New Post /wp-admin/post-new.php5.44 ▲0.0194.31 ▼559.53
Media Library /wp-admin/upload.php3.03 ▲0.0233.86 ▼0.32

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 4 new files
Database: 1 new table, 1 new option
New tables
wp_hanzi_of_the_day_ordinals
New WordPress options
widget_hanzi_of_the_day

Browser metrics Passed 4 tests

An overview of browser requirements for Hanzi of the Day
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10715.75 ▲0.079.82 ▲0.1250.07 ▲1.20
Dashboard /wp-admin2,970 ▲365.89 ▼0.04170.08 ▲27.68109.69 ▲4.70
Posts /wp-admin/edit.php2,739 ▼02.71 ▼0.0170.45 ▲4.0397.54 ▲8.33
Add New Post /wp-admin/post-new.php1,502 ▼17018.55 ▼0.20373.07 ▲11.69114.37 ▲5.99
Media Library /wp-admin/upload.php1,822 ▲155.09 ▲0.05138.21 ▼5.54120.43 ▼1.01

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5663
    wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • widget_hanzi_of_the_day

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/hanzi-of-the-day/hanzi-of-the-day.php:31

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 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Screenshots: Screenshot #1 (The widget) image required
The official readme.txt is a good inspiration

hanzi-of-the-day/hanzi-of-the-day.php Passed 13 tests

The main PHP script in "Hanzi of the Day" version 1.0 is automatically included on every request by WordPress
63 characters long description:
A widget that displays a different Chinese character every day.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin133 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP23639133

PHP code Passed 2 tests

Analyzing 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.19
Average class complexity4.00
▷ Minimum class complexity3.00
▷ Maximum class complexity5.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.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

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