84% what-time-is-it

Code Review | What Time Is It?

WordPress plugin What Time Is It? scored 84% from 54 tests.

About plugin

  • Plugin page: what-time-is-it
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.3.1
  • WordPress version: 5.8.1
  • First release: Aug 26, 2015
  • Latest release: Oct 29, 2015
  • Number of updates: 14
  • Update frequency: every 4.6 days
  • Top authors: nguyentam2211 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

400+ active / 5,485 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼140.45ms] Passed 4 tests

This is a short check of server-side resources used by What Time Is It?
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1336.30 ▲10.86
Dashboard /wp-admin3.07 ▲0.0142.75 ▲3.41
Posts /wp-admin/edit.php3.12 ▲0.0035.86 ▼15.62
Add New Post /wp-admin/post-new.php5.43 ▼0.0190.18 ▼551.59
Media Library /wp-admin/upload.php3.01 ▲0.0131.35 ▲2.02

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 1 new option
New WordPress options
widget_what_time_is_it

Browser metrics Passed 4 tests

Checking browser requirements for What Time Is It?
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,683 ▲4615.92 ▲0.419.69 ▲0.3452.02 ▲1.77
Dashboard /wp-admin2,973 ▲396.02 ▲0.07137.33 ▼4.14109.00 ▼6.42
Posts /wp-admin/edit.php2,739 ▲32.72 ▲0.0062.41 ▼0.0289.82 ▼5.22
Add New Post /wp-admin/post-new.php1,683 ▼37418.76 ▼0.65369.02 ▼12.2598.17 ▼10.59
Media Library /wp-admin/upload.php1,807 ▲35.05 ▲0.03138.16 ▼2.61117.85 ▼2.62

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options were found after uninstall: 1 option
    • widget_what_time_is_it

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/what-time-is-it/what-time-is-it.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
9 plugin tags: clock, world clock, analog clock, widget, digital clock...

what-time-is-it/what-time-is-it.php Passed 13 tests

The primary PHP file in "What Time Is It?" version 1.3 is used by WordPress to initiate all plugin functionality
70 characters long description:
Create a beautiful Wordpress Widget to show your custom date and time.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin342 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP22767227
CSS13783
JavaScript231132

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity22.00
▷ Minimum class complexity22.00
▷ Maximum class complexity22.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods457.14%
▷ Protected methods00.00%
▷ Private methods342.86%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin