84% time-difference

Code Review | Time Difference

WordPress plugin Time Difference scored84%from 54 tests.

About plugin

  • Plugin page: time-difference
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-3.5.1
  • WordPress version: 6.3.1
  • First release: Jul 20, 2013
  • Latest release: Jul 20, 2013
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: mdjekic (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /956 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼11.49ms] Passed 4 tests

Server-side resources used by Time Difference
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.49 ▼4.73
Dashboard /wp-admin3.31 ▼0.0341.78 ▼19.88
Posts /wp-admin/edit.php3.37 ▲0.0144.72 ▼0.91
Add New Post /wp-admin/post-new.php5.90 ▲0.0181.66 ▼20.45
Media Library /wp-admin/upload.php3.24 ▲0.0135.64 ▲2.11

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Time Difference
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.32 ▼0.971.52 ▼0.2638.92 ▼4.54
Dashboard /wp-admin2,203 ▲155.80 ▲0.9198.58 ▼22.8539.82 ▼4.56
Posts /wp-admin/edit.php2,092 ▲32.05 ▲0.0539.31 ▲2.0336.01 ▲1.41
Add New Post /wp-admin/post-new.php1,535 ▼223.13 ▲5.06634.31 ▲24.1164.04 ▲8.24
Media Library /wp-admin/upload.php1,388 ▼34.32 ▲0.0893.90 ▼7.8342.23 ▼0.30

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/time-difference/time-difference.php:136

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: time, date, elapsed, difference

time-difference/time-difference.php Passed 13 tests

"Time Difference" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
93 characters long description:
Display time difference between now and a certain date/time in pages, posts and text widgets.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected51 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1226851

PHP code Passed 2 tests

Analyzing 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.37
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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected