78% today-yesterday-dates

Code Review | Today-Yesterday Dates

WordPress plugin Today-Yesterday Dates scored78%from 54 tests.

About plugin

  • Plugin page: today-yesterday-d...
  • Plugin version: 1.01
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.1
  • WordPress version: 6.3.1
  • First release: Aug 2, 2017
  • Latest release: Oct 30, 2022
  • Number of updates: 22
  • Update frequency: every 87.1 days
  • Top authors: Flector (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /1,822 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼8.36ms] Passed 4 tests

An overview of server-side resources used by Today-Yesterday Dates
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.01 ▼4.96
Dashboard /wp-admin3.32 ▼0.0244.03 ▼19.16
Posts /wp-admin/edit.php3.37 ▲0.0249.08 ▲0.50
Add New Post /wp-admin/post-new.php5.90 ▲0.0181.56 ▼9.82
Media Library /wp-admin/upload.php3.24 ▲0.0137.38 ▲4.33

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
tyd_options

Browser metrics Passed 4 tests

A check of browser resources used by Today-Yesterday Dates
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.48 ▲0.111.67 ▼0.2741.41 ▼1.95
Dashboard /wp-admin2,213 ▲224.86 ▲0.0096.84 ▼13.1137.26 ▼6.28
Posts /wp-admin/edit.php2,096 ▲72.01 ▼0.0039.51 ▲3.2434.78 ▼3.79
Add New Post /wp-admin/post-new.php1,522 ▲823.37 ▲5.81676.54 ▲6.7453.89 ▲0.20
Media Library /wp-admin/upload.php1,392 ▲14.25 ▲0.0598.60 ▼1.0743.82 ▲0.29
Today-Yesterday Dates /wp-admin/today-yesterday-dates.php260.440.0613.80

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% 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 no errors were found, 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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/today-yesterday-dates/today-yesterday-dates.php:20

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
These are user-side errors you should fix
    • > GET request to /wp-admin/today-yesterday-dates.php
    • > Network (severe)
    wp-admin/today-yesterday-dates.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: relative, today, date, dates, yesterday

today-yesterday-dates/today-yesterday-dates.php 92% from 13 tests

The primary PHP file in "Today-Yesterday Dates" version 1.01 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 217 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected707 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript37127363
PHP15543309
CSS22735

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 compressed PNG file occupies 0.01MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/icon_coffee.png5.14KB5.32KB0.00%