73% time-zone-converter

Code Review | Time Zone Converter

WordPress plugin Time Zone Converter scored73%from 54 tests.

About plugin

  • Plugin page: time-zone-converter
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0.2
  • WordPress version: 6.3.1
  • First release: Oct 13, 2022
  • Latest release: Oct 13, 2022
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: vikas4travel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /276 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.09MB] [CPU: ▼6.19ms] Passed 4 tests

This is a short check of server-side resources used by Time Zone Converter
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0943.69 ▲3.54
Dashboard /wp-admin3.41 ▲0.0646.52 ▼13.46
Posts /wp-admin/edit.php3.52 ▲0.1649.29 ▲2.41
Add New Post /wp-admin/post-new.php5.99 ▲0.1090.75 ▼13.84
Media Library /wp-admin/upload.php3.33 ▲0.1036.83 ▲0.12
View All Converters /wp-admin/edit.php?post_type=time-zone-converter3.3841.02
Add New Converter /wp-admin/post-new.php?post_type=time-zone-converter3.9762.34

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

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

Browser metrics Passed 4 tests

Time Zone Converter: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲7814.75 ▲0.481.76 ▲0.1543.46 ▲0.47
Dashboard /wp-admin2,224 ▲365.79 ▲0.70106.16 ▲4.6840.88 ▼2.73
Posts /wp-admin/edit.php2,116 ▲272.04 ▲0.0339.82 ▲1.5834.76 ▼1.22
Add New Post /wp-admin/post-new.php1,539 ▲2523.17 ▲5.58648.42 ▼34.0753.55 ▼1.78
Media Library /wp-admin/upload.php1,415 ▲304.20 ▼0.0495.07 ▼11.8742.37 ▼4.71
View All Converters /wp-admin/edit.php?post_type=time-zone-converter1,1262.3935.2527.86
Add New Converter /wp-admin/post-new.php?post_type=time-zone-converter7,9494.56114.1742.48

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • tzc_welcome
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/time-zone-converter/classes/class-timezone-functions.php
    • > /wp-content/plugins/time-zone-converter/time-zone-converter.php
    • > /wp-content/plugins/time-zone-converter/classes/class-timezone-converter.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/time-zone-converter/templates/admin-panel.php:45

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/edit.php?post_type=time-zone-converter
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: tzc_plugin_url is not defined" "ReferenceError: tzc_plugin_url is not defined\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/time-zone-converter/assets/js/scripts.js?ver=6.3.1:5:17)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/edit.php?post_type=time-zone-converter
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught ReferenceError: tzc_plugin_url is not defined

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
3 plugin tags: timezone converter, time zone converter, time difference calculator

time-zone-converter/time-zone-converter.php Passed 13 tests

"Time Zone Converter" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
85 characters long description:
Time Zone Converter allows users to convert and compare time in different time zones.

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 plugin1,423 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP7176100811
CSS4685350
JavaScript24627232
Markdown114030

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity37.00
▷ Minimum class complexity21.00
▷ Maximum class complexity53.00
Average method complexity5.00
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods18
▷ Static methods422.22%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/calendar_icon.png0.84KB0.76KB▼ 9.99%
assets/css/images/ui-icons_444444_256x240.png6.92KB4.18KB▼ 39.61%