84% analog-clock-widget

Code Review | Analog Clock Widget

WordPress plugin Analog Clock Widget scored84%from 54 tests.

About plugin

  • Plugin page: analog-clock-widget
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.9.6
  • WordPress version: 6.3.1
  • First release: Aug 25, 2016
  • Latest release: May 24, 2018
  • Number of updates: 12
  • Update frequency: every 53.2 days
  • Top authors: mcnika (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /5,051 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼8.68ms] Passed 4 tests

Analyzing server-side resources used by Analog Clock Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0837.66 ▼1.75
Dashboard /wp-admin3.38 ▲0.0845.58 ▼4.08
Posts /wp-admin/edit.php3.43 ▲0.0843.76 ▼1.06
Add New Post /wp-admin/post-new.php5.96 ▲0.0883.14 ▼27.83
Media Library /wp-admin/upload.php3.30 ▲0.0835.75 ▲4.90

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_analog_clock_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Analog Clock Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.22 ▼1.431.75 ▼0.2144.26 ▼4.30
Dashboard /wp-admin2,206 ▲215.91 ▲0.01102.73 ▼15.4338.87 ▼2.91
Posts /wp-admin/edit.php2,089 ▼32.03 ▲0.0637.09 ▼2.5132.13 ▼6.00
Add New Post /wp-admin/post-new.php1,528 ▼1423.40 ▲5.04675.71 ▲32.1054.85 ▼8.10
Media Library /wp-admin/upload.php1,391 ▼04.11 ▼0.14103.37 ▲2.6243.77 ▼1.20

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_analog_clock_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however 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 take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/analog-clock-widget/analog-clock-widget.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
You can take inspiration from this readme.txt

analog-clock-widget/analog-clock-widget.php Passed 13 tests

The main file in "Analog Clock Widget" v. 1.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
43 characters long description:
Display a SVG Analog Clock on your sidebar.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin307 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP12716251
JavaScript24856

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity23.00
▷ Minimum class complexity23.00
▷ Maximum class complexity23.00
Average method complexity4.14
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

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