84% the-time-ago

Code Review | The Time Ago

WordPress plugin The Time Ago scored84%from 54 tests.

About plugin

  • Plugin page: the-time-ago
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8.0-4.6
  • WordPress version: 6.3.1
  • First release: Sep 12, 2015
  • Latest release: Aug 21, 2016
  • Number of updates: 11
  • Update frequency: every 31.3 days
  • Top authors: Alobaidi (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

70+ active /3,016 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

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

This is a short check of server-side resources used by The Time Ago
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0542.82 ▼3.31
Dashboard /wp-admin3.32 ▲0.0161.23 ▲11.56
Posts /wp-admin/edit.php3.37 ▲0.0147.99 ▼0.92
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.64 ▼3.43
Media Library /wp-admin/upload.php3.24 ▲0.0137.90 ▲2.42
Time Ago /wp-admin/plugins.php?page=alobaidi_time_ago_settings3.2135.44

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by The Time Ago
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.28 ▲0.001.61 ▼0.2238.94 ▼3.10
Dashboard /wp-admin2,196 ▲165.61 ▲0.0989.65 ▼1.8135.29 ▼5.85
Posts /wp-admin/edit.php2,104 ▲12.02 ▲0.0337.66 ▲1.2032.69 ▼2.61
Add New Post /wp-admin/post-new.php1,529 ▲323.65 ▲0.06696.54 ▲29.3356.39 ▲5.94
Media Library /wp-admin/upload.php1,404 ▲74.19 ▼0.0594.52 ▼8.5838.94 ▼7.01
Time Ago /wp-admin/plugins.php?page=alobaidi_time_ago_settings1,0422.0025.4628.15

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
  • 5× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/the-time-ago/settings.php
    • > /wp-content/plugins/the-time-ago/calculator.php
    • > /wp-content/plugins/the-time-ago/the-time-ago.php
    • > /wp-content/plugins/the-time-ago/uninstall.php
    • > /wp-content/plugins/the-time-ago/if_else.php

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 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 23 tag instead of maximum 10
You can take inspiration from this readme.txt

the-time-ago/the-time-ago.php Passed 13 tests

The main PHP file in "The Time Ago" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
131 characters long description:
One click convert date and time to "time ago" (e.g. 1 hour ago), easy to use, just one click! translation ready (to your language).

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
There were no executable files found in this plugin317 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP68235317

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
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%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin