78% dt-world-clock

Code Review | DT World Clock

WordPress plugin DT World Clock scored78%from 54 tests.

About plugin

  • Plugin page: dt-world-clock
  • Plugin version: 2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.6
  • WordPress version: 6.3.1
  • First release: Jun 8, 2015
  • Latest release: Feb 10, 2021
  • Number of updates: 104
  • Update frequency: every 20.0 days
  • Top authors: deligence (100%)

Code review

54 tests

User reviews

18 reviews

Install metrics

1,000+ active /21,771 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.10MB] [CPU: ▼5.74ms] Passed 4 tests

A check of server-side resources used by DT World Clock
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0840.42 ▲1.25
Dashboard /wp-admin3.41 ▲0.1047.78 ▼9.48
Posts /wp-admin/edit.php3.46 ▲0.1047.07 ▼2.79
Add New Post /wp-admin/post-new.php6.01 ▲0.1283.22 ▼11.61
Media Library /wp-admin/upload.php3.33 ▲0.1034.27 ▲0.93

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 16 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_dtw_clock_widget
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by DT World Clock
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6914.68 ▲0.081.79 ▲0.1143.50 ▲4.20
Dashboard /wp-admin2,209 ▲214.90 ▼0.99111.42 ▲7.9977.83 ▲27.82
Posts /wp-admin/edit.php2,101 ▲121.98 ▼0.0233.94 ▼8.1234.26 ▼4.41
Add New Post /wp-admin/post-new.php1,538 ▲1921.21 ▼1.90691.43 ▲8.4847.81 ▼5.17
Media Library /wp-admin/upload.php1,403 ▲154.24 ▲0.1096.15 ▼24.0976.01 ▲27.57

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_dtw_clock_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% 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
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/dt-world-clock/settings.php
    • > /wp-content/plugins/dt-world-clock/dt-world-clock.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/dt-world-clock/lib/functions.php:268
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/dt-world-clock/lib/widget.php:3

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (screenshot-1.png (Clock on front)), #2 (screenshot-2.png (General settings for clock)), #3 (screenshot-3.png (Advanced settings for clock)), #4 (screenshot-4.png (Place it on any widget of your theme)), #5 (screenshot-5.png (Clock on front, apperance will depends on theme style))
The official readme.txt is a good inspiration

dt-world-clock/dt-world-clock.php Passed 13 tests

The main file in "DT World Clock" v. 2.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
33 characters long description:
its a plugin to show world clocks

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin18,199 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript31,21557317,315
PHP410455825
CSS111159

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity33.00
▷ Minimum class complexity33.00
▷ Maximum class complexity33.00
Average method complexity9.00
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
6 PNG files occupy 0.21MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png48.77KB23.49KB▼ 51.84%
screenshot-4.png70.29KB32.62KB▼ 53.59%
screenshot-5.png40.69KB9.36KB▼ 76.99%
screenshot-3.png45.72KB24.73KB▼ 45.90%
dtw_clock.png0.94KB0.86KB▼ 7.92%