10% todays-date-inserter

Code Review | Today's Date Inserter

WordPress plugin Today's Date Inserter scored 10% from 54 tests.

About plugin

  • Plugin page: todays-date-inserter
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9.2
  • WordPress version: 5.8.1
  • First release: Apr 29, 2014
  • Latest release: Aug 19, 2014
  • Number of updates: 4
  • Update frequency: every 28.0 days
  • Top authors: mulscully (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

3,000+ active / 9,347 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/todays-date-inserter/lfo-todays-date-inserter.php+36
    Methods with the same name as their class will not be constructors in a future version of PHP; lfo_todays_date_widget has a deprecated constructor

Server metrics [RAM: ▼1.84MB] [CPU: ▼188.27ms] Passed 4 tests

This is a short check of server-side resources used by Today's Date Inserter
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /1.79 ▼1.054.93 ▼28.95
Dashboard /wp-admin1.81 ▼1.254.50 ▼39.07
Posts /wp-admin/edit.php1.81 ▼1.304.95 ▼39.42
Add New Post /wp-admin/post-new.php1.81 ▼3.635.60 ▼645.63
Media Library /wp-admin/upload.php1.81 ▼1.195.48 ▼25.71
Todays Date /wp-admin/options-general.php?page=lfo_todays_date1.815.39

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 1 new option
New WordPress options
widget_lfo_todays_date_widget

Browser metrics Passed 4 tests

A check of browser resources used by Today's Date Inserter
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,684 ▲8915.89 ▲0.327.62 ▼0.7645.39 ▼2.58
Dashboard /wp-admin2,972 ▲415.92 ▼0.08133.06 ▼10.79117.62 ▲7.08
Posts /wp-admin/edit.php2,741 ▲22.69 ▲0.0262.57 ▼0.5684.85 ▲2.80
Add New Post /wp-admin/post-new.php1,675 ▲17518.76 ▲0.23340.25 ▼10.38105.34 ▼9.73
Media Library /wp-admin/upload.php1,815 ▲55.00 ▼0.02148.46 ▼16.94124.11 ▲6.67
Todays Date /wp-admin/options-general.php?page=lfo_todays_date1,1942.0959.2384.01

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/todays-date-inserter/lfo-todays-date-inserter.php+36
    Methods with the same name as their class will not be constructors in a future version of PHP; lfo_todays_date_widget has a deprecated constructor
  • This plugin does not fully uninstall, leaving 1 option in the database
    • widget_lfo_todays_date_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=lfo_todays_date
    • > Deprecated in wp-content/plugins/todays-date-inserter/lfo-todays-date-inserter.php+36
    Methods with the same name as their class will not be constructors in a future version of PHP; lfo_todays_date_widget has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=lfo_todays_date
    • > Notice in wp-content/plugins/todays-date-inserter/lfo-todays-date-inserter.php+12
    date_default_timezone_set(): Timezone ID '' is invalid
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=lfo_todays_date
    • > Notice in wp-content/plugins/todays-date-inserter/lfo-todays-date-inserter.php+165
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/options-general.php?page=lfo_todays_date
    • > User deprecated in wp-includes/functions.php+5304
    The called constructor method for WP_Widget in lfo_todays_date_widget is deprecated since version 4.3.0! Use __construct() instead.

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: Call to undefined function get_option() in wp-content/plugins/todays-date-inserter/lfo-todays-date-inserter.php:12

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)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Donate link: Please fix this invalid URI: ""
You can take inspiration from this readme.txt

todays-date-inserter/lfo-todays-date-inserter.php 85% from 13 tests

The main PHP file in "Today's Date Inserter" ver. 1.2.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 208 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("todays-date-inserter.php" instead of "lfo-todays-date-inserter.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin126 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP12924126

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.04
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.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%
Functions8
▷ Named functions8100.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 images were found in this plugin