84% coolclock

Code Review | CoolClock - a Javascript Analog Clock

WordPress plugin CoolClock - a Javascript Analog Clock scored84%from 54 tests.

About plugin

  • Plugin page: coolclock
  • Plugin version: 4.3.7
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8.1-6.3
  • WordPress version: 6.3.1
  • First release: Dec 9, 2012
  • Latest release: Oct 4, 2023
  • Number of updates: 116
  • Update frequency: every 34.1 days
  • Top authors: RavanH (92.24%)deployer (8.62%)

Code review

54 tests

User reviews

14 reviews

Install metrics

3,000+ active /81,611 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.14MB] [CPU: ▼12.29ms] Passed 4 tests

An overview of server-side resources used by CoolClock - a Javascript Analog Clock
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1650.40 ▲4.35
Dashboard /wp-admin3.46 ▲0.1151.82 ▼19.17
Posts /wp-admin/edit.php3.57 ▲0.2149.91 ▼3.88
Add New Post /wp-admin/post-new.php6.04 ▲0.1587.30 ▼30.25
Media Library /wp-admin/upload.php3.38 ▲0.1541.69 ▲4.14

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 30 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_coolclock-widget

Browser metrics Passed 4 tests

CoolClock - a Javascript Analog Clock: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.23 ▼0.361.84 ▼0.1942.53 ▼0.31
Dashboard /wp-admin2,198 ▲215.63 ▼0.0294.01 ▼0.1639.91 ▼8.40
Posts /wp-admin/edit.php2,103 ▲32.00 ▼0.0937.47 ▲0.8136.23 ▼2.46
Add New Post /wp-admin/post-new.php1,526 ▼123.96 ▲0.91703.63 ▲7.8653.00 ▲5.09
Media Library /wp-admin/upload.php1,400 ▼34.20 ▼0.02102.96 ▼2.6744.14 ▼1.21

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_coolclock-widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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 take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/coolclock/includes/class-coolclock-widget.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: widget, analog clock, clock, shortcode, logarithmic clock...

coolclock/coolclock.php 85% from 13 tests

This is the main PHP file of "CoolClock - a Javascript Analog Clock" version 4.3.7, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Domain Path: Use only dashes and lowercase characters for the domain path ("languages")
  • Domain Path: The domain path must begin with a forward slash character ("/languages")

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
No dangerous file extensions were detected4,616 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP71852432,461
JavaScript72112681,111
PO File64404511,028
CSS22016

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity36.67
▷ Minimum class complexity27.00
▷ Maximum class complexity43.00
Average method complexity6.63
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods19
▷ Static methods1473.68%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin