10% date-and-time-widget

Code Review | Date and Time Widget

WordPress plugin Date and Time Widget scored10%from 54 tests.

About plugin

  • Plugin page: date-and-time-widget
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.7.2
  • WordPress version: 6.3.1
  • First release: Nov 10, 2013
  • Latest release: Feb 4, 2017
  • Number of updates: 14
  • Update frequency: every 84.4 days
  • Top authors: donnapep (78.57%)dabesa (28.57%)

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active /38,481 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/date-and-time-widget/date-time.php+373
    Function create_function() is deprecated

Server metrics [RAM: ▼1.97MB] [CPU: ▼59.73ms] Passed 4 tests

A check of server-side resources used by Date and Time Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.19 ▼35.79
Dashboard /wp-admin2.05 ▼1.306.10 ▼51.93
Posts /wp-admin/edit.php2.05 ▼1.315.55 ▼49.04
Add New Post /wp-admin/post-new.php2.05 ▼3.845.59 ▼102.16
Media Library /wp-admin/upload.php2.05 ▼1.184.84 ▼30.51

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Date and Time Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,904 ▲15813.99 ▼0.385.21 ▲3.4341.84 ▼0.67
Dashboard /wp-admin2,227 ▲395.09 ▲0.14104.38 ▼12.6642.30 ▼3.36
Posts /wp-admin/edit.php2,091 ▲52.34 ▲0.3236.05 ▼1.5037.77 ▲6.42
Add New Post /wp-admin/post-new.php1,540 ▲623.39 ▲0.17679.06 ▲15.3139.35 ▼13.07
Media Library /wp-admin/upload.php1,413 ▲254.34 ▲0.14115.72 ▲19.7949.34 ▲7.98

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/date-and-time-widget/date-time.php+373
    Function create_function() is deprecated
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_date-time
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/date-and-time-widget/views/widget.php
  • 10× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: text_color in wp-content/plugins/date-and-time-widget/views/widget.php on line 2
    • > PHP Notice
      Undefined variable: font_family in wp-content/plugins/date-and-time-widget/views/widget.php on line 4
    • > PHP Notice
      Undefined variable: time_format in wp-content/plugins/date-and-time-widget/views/widget.php on line 11
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/date-and-time-widget/views/admin.php:3
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/date-and-time-widget/views/widget.php on line 10
    • > PHP Notice
      Undefined variable: background_color in wp-content/plugins/date-and-time-widget/views/widget.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/date-and-time-widget/date-time.php:23
    • > PHP Notice
      Undefined variable: date_format in wp-content/plugins/date-and-time-widget/views/widget.php on line 12
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/date-and-time-widget/views/widget.php on line 10
    • > PHP Notice
      Undefined variable: font_size in wp-content/plugins/date-and-time-widget/views/widget.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Plugin Name: Please specify the plugin name on the first line ( === date-and-time-widget === )
The official readme.txt might help

date-and-time-widget/date-time.php 85% from 13 tests

This is the main PHP file of "Date and Time Widget" version 1.1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("date-and-time-widget.php" instead of "date-time.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected353 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP350137258
JavaScript210585
CSS21010

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity1.65
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.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
No PNG files were detected