79% this-day-in-history

Code Review | This Day In History

WordPress plugin This Day In History scored 79% from 54 tests.

About plugin

  • Plugin page: this-day-in-history
  • Plugin version: 3.8.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.9
  • WordPress version: 5.9.2
  • First release: Jan 10, 2012
  • Latest release: Jan 23, 2022
  • Number of updates: 85
  • Update frequency: every 43.1 days
  • Top authors: BrokenCrust (100%)

Code review

54 tests

User reviews

23 reviews

Install metrics

1,000+ active / 30,561 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.33MB] [CPU: ▼289.65ms] Passed 4 tests

This is a short check of server-side resources used by This Day In History
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.93 ▲0.4156.58 ▲4.27
Dashboard /wp-admin3.77 ▲0.3635.31 ▲3.24
Posts /wp-admin/edit.php4.00 ▲0.3539.08 ▲2.79
Add New Post /wp-admin/post-new.php7.24 ▲0.2795.46 ▼1,168.90
Media Library /wp-admin/upload.php3.66 ▲0.3632.13 ▲6.33
All Events /wp-admin/admin.php?page=this-day-in-history3.6526.10
Add New /wp-admin/admin.php?page=?page=this-day-in-history&action=new3.4520.72
This Day In History /wp-admin/options-general.php?page=tdih-settings3.6322.55
Event Types /wp-admin/edit-tags.php?taxonomy=event_type3.6526.15

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, 3 new options
New WordPress options
tdih_db_version
widget_this_day_in_history_widget
tdih_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for This Day In History
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,827 ▲7315.85 ▲0.085.63 ▼1.012.34 ▼0.19
Dashboard /wp-admin2,953 ▲956.04 ▼0.13121.17 ▼18.14155.15 ▼5.05
Posts /wp-admin/edit.php2,737 ▲803.23 ▼0.0272.33 ▲10.02135.69 ▼9.67
Add New Post /wp-admin/post-new.php1,749 ▲2617.19 ▼4.53403.81 ▼55.03155.83 ▼2.35
Media Library /wp-admin/upload.php1,747 ▲495.52 ▼0.02144.99 ▲2.27183.16 ▼3.34
All Events /wp-admin/admin.php?page=this-day-in-history1,7332.7053.8099.05
Add New /wp-admin/admin.php?page=?page=this-day-in-history&action=new280.940.0316.50
This Day In History /wp-admin/options-general.php?page=tdih-settings1,1472.3753.87135.02
Event Types /wp-admin/edit-tags.php?taxonomy=event_type1,6222.7656.73115.45

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 1 option
    • widget_this_day_in_history_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/this-day-in-history/tdih-list-table.class.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function status_header() in wp-content/plugins/this-day-in-history/uninstall.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/this-day-in-history/tdih-widget.php:3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/this-day-in-history/tdih-list-table.class.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/this-day-in-history/tdih-shortcodes.php:106
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/this-day-in-history/this-day-in-history.php:38
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/this-day-in-history/tdih-list-table.class.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/this-day-in-history/default-single-tdih_event.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=?page=this-day-in-history&action=new
    • > Network (severe)
    wp-admin/admin.php?page=?page=this-day-in-history&action=new - Failed to load resource: the server responded with a status of 403 (Forbidden)

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
9 plugin tags: events, history, of the day, birthday, word...

this-day-in-history/this-day-in-history.php Passed 13 tests

"This Day In History" version 3.8.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
128 characters long description:
This "On This Day" plugin allows you to enter historic or future events and display them via the included widget and shortcodes.

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
Everything looks great! No dangerous files found in this plugin1,135 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP7644631,129
CSS1846

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity39.33
▷ Minimum class complexity4.00
▷ Maximum class complexity65.00
Average method complexity4.48
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods33
▷ Static methods412.12%
▷ Public methods1854.55%
▷ Protected methods00.00%
▷ Private methods1545.45%
Functions31
▷ Named functions3096.77%
▷ Anonymous functions13.23%
Constants1
▷ Global constants1100.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
There were not PNG files found in your plugin