84% rotating-clock-widget

Code Review | Rotating Clock Widget

WordPress plugin Rotating Clock Widget scored 84% from 54 tests.

About plugin

  • Plugin page: rotating-clock-wi...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.0.1
  • WordPress version: 5.8.1
  • First release: Dec 18, 2014
  • Latest release: Dec 19, 2014
  • Number of updates: 23
  • Update frequency: every 0.0 days
  • Top authors: jpferrierjr (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 1,105 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.01MB] [CPU: ▼141.48ms] Passed 4 tests

A check of server-side resources used by Rotating Clock Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1332.53 ▲11.39
Dashboard /wp-admin3.07 ▲0.0142.85 ▼3.75
Posts /wp-admin/edit.php3.12 ▲0.0144.22 ▲0.75
Add New Post /wp-admin/post-new.php5.43 ▼0.0191.31 ▼565.55
Media Library /wp-admin/upload.php3.01 ▲0.0134.78 ▲2.62

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 9 new files
Database: no new tables, 1 new option
New WordPress options
widget_rot_clock

Browser metrics Passed 4 tests

Rotating Clock Widget: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,790 ▲19416.36 ▲0.5112.97 ▲5.0747.03 ▲0.31
Dashboard /wp-admin2,973 ▲426.01 ▲0.09137.90 ▼4.78105.60 ▼0.32
Posts /wp-admin/edit.php2,739 ▼02.68 ▼0.0166.31 ▲1.0186.29 ▼2.43
Add New Post /wp-admin/post-new.php1,672 ▼1118.79 ▲0.02366.85 ▲9.53101.34 ▼15.11
Media Library /wp-admin/upload.php1,807 ▼05.01 ▼0.01142.59 ▼6.13116.30 ▼6.34

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The uninstall procedure has failed, leaving 1 option in the database
    • widget_rot_clock

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
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/rotating-clock-widget/rotatingclock.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/rotating-clock-widget/rotclock.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: rotating, widget, animated, clock, ferritech

rotating-clock-widget/rotatingclock.php 85% from 13 tests

The main file in "Rotating Clock Widget" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("rotating-clock-widget.php" instead of "rotatingclock.php")
  • Description: The description should be shorter than 140 characters (currently 198 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin415 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript23521331
CSS11048
PHP252536

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.00
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods00.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
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
3 PNG files occupy 0.10MB with 0.06MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/bg.png35.73KB9.53KB▼ 73.32%
images/time_top.png19.84KB9.76KB▼ 50.79%
images/bg_box.png43.47KB23.00KB▼ 47.10%