72% mx-time-zone-clocks

Code Review | MX Time Zone Clocks

WordPress plugin MX Time Zone Clocks scored72%from 54 tests.

About plugin

  • Plugin page: mx-time-zone-clocks
  • Plugin version: 4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.4
  • WordPress version: 6.3.1
  • First release: Jun 5, 2019
  • Latest release: Dec 2, 2023
  • Number of updates: 28
  • Update frequency: every 58.6 days
  • Top authors: markomaksym (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

1,000+ active /19,223 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

Analyzing server-side resources used by MX Time Zone Clocks
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1236.24 ▼3.85
Dashboard /wp-admin3.51 ▲0.2053.54 ▲3.73
Posts /wp-admin/edit.php3.56 ▲0.2061.46 ▲13.65
Add New Post /wp-admin/post-new.php6.02 ▲0.14105.35 ▲11.95
Media Library /wp-admin/upload.php3.35 ▲0.1249.69 ▲16.48
Generate Short code /wp-admin/options-general.php?page=mxmtzc-mx-time-zone-clocks-menu3.4145.69
Link Name /wp-admin/admin.php?page=mx_clocks_additional_plugins3.3446.38
Link Name /wp-admin/admin.php?page=mx_clocks_offer3.3445.35

Server storage [IO: ▲2.07MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 79 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for MX Time Zone Clocks
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,023 ▲1,26126.94 ▲12.2351.15 ▲49.4625.76 ▼18.84
Dashboard /wp-admin3,275 ▲1,09817.41 ▲11.81318.15 ▲227.44114.51 ▲77.19
Posts /wp-admin/edit.php3,058 ▲95512.14 ▲10.19217.05 ▲176.4797.67 ▲58.13
Add New Post /wp-admin/post-new.php7,180 ▲5,65437.95 ▲14.881,197.82 ▲574.6536.28 ▼10.91
Media Library /wp-admin/upload.php2,325 ▲93112.72 ▲8.55259.31 ▲162.1295.77 ▲54.84
Generate Short code /wp-admin/options-general.php?page=mxmtzc-mx-time-zone-clocks-menu2,33713.85274.96133.65
Link Name /wp-admin/admin.php?page=mx_clocks_additional_plugins2,20914.30317.21119.51
Link Name /wp-admin/admin.php?page=mx_clocks_offer1,6789.98249.9497.02

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 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 did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
The following issues need your attention
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/mx-time-zone-clocks/includes/admin/views/components/hire-developer.php
    • > /wp-content/plugins/mx-time-zone-clocks/includes/admin/views/settings-page.php
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/mx-time-zone-clocks/includes/admin/views/additional-plugins.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mxmtzc_include_view() in wp-content/plugins/mx-time-zone-clocks/includes/admin/views/main-page.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/mx-time-zone-clocks/includes/admin/views/offer.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/mx-time-zone-clocks/includes/admin/views/components/olena-theme.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=mxmtzc-mx-time-zone-clocks-menu
    • > Other (warning) in unknown
    /wp-admin/options-general.php?page=mxmtzc-mx-time-zone-clocks-menu 245 Unrecognized feature: 'web-share'.
    • > GET request to /wp-admin/admin.php?page=mx_clocks_additional_plugins
    • > Other (warning) in unknown
    /wp-admin/admin.php?page=mx_clocks_additional_plugins 246 Unrecognized feature: 'web-share'.
    • > GET request to /wp-admin/admin.php?page=mx_clocks_offer
    • > Other (warning) in unknown
    /wp-admin/admin.php?page=mx_clocks_offer 246 Unrecognized feature: 'web-share'.

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: time zone, clock on the website, clock

mx-time-zone-clocks/mx-time-zone-clocks.php Passed 13 tests

The entry point to "MX Time Zone Clocks" version 4.1 is a PHP file that has certain tags in its header comment area
49 characters long description:
Clocks for different time zones for your website.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected5,243 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
CSS410192,766
PHP307103741,160
SVG100685
JavaScript440884599
PO File18833

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity3.25
▷ Minimum class complexity1.00
▷ Maximum class complexity22.00
Average method complexity1.80
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes20
▷ Abstract classes15.00%
▷ Concrete classes1995.00%
▷ Final classes15.26%
Methods58
▷ Static methods1627.59%
▷ Public methods58100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions571.43%
▷ Anonymous functions228.57%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
20 PNG files occupy 0.63MB with 0.49MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/admin/assets/img/clock-face29.png38.36KB9.96KB▼ 74.03%
includes/admin/assets/img/clock-face23.png21.17KB3.29KB▼ 84.47%
includes/admin/assets/img/clock-face6.png32.35KB6.99KB▼ 78.39%
includes/admin/assets/img/clock-face28.png43.08KB10.46KB▼ 75.71%
includes/admin/assets/img/clock-face4.png35.01KB7.72KB▼ 77.96%