84% post-time-estimator

Code Review | Post Reading Time

WordPress plugin Post Reading Time scored 84% from 54 tests.

About plugin

  • Plugin page: post-time-estimator
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7.2
  • WordPress version: 5.8.1
  • First release: Feb 20, 2017
  • Latest release: Feb 22, 2017
  • Number of updates: 7
  • Update frequency: every 8.7 days
  • Top authors: inanielhoussain (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 464 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.32MB] [CPU: ▼150.57ms] Passed 4 tests

Server-side resources used by Post Reading Time
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.0348.08 ▲7.62
Dashboard /wp-admin3.09 ▲0.0348.66 ▼1.33
Posts /wp-admin/edit.php3.14 ▲0.0351.05 ▲3.55
Add New Post /wp-admin/post-new.php4.07 ▼1.3652.66 ▼600.48
Media Library /wp-admin/upload.php3.03 ▲0.0332.14 ▼4.02

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: no new tables, 1 new option
New WordPress options
widget_my_custom_timer_post

Browser metrics Passed 4 tests

A check of browser resources used by Post Reading Time
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲13115.94 ▲0.3812.01 ▼0.3344.10 ▼7.92
Dashboard /wp-admin2,970 ▲395.91 ▼0.05138.29 ▼16.50111.17 ▲6.61
Posts /wp-admin/edit.php2,739 ▼02.70 ▼0.0069.26 ▼4.7183.83 ▼4.17
Add New Post /wp-admin/post-new.php1,719 ▲10418.36 ▼3.09382.89 ▲65.82116.32 ▲9.78
Media Library /wp-admin/upload.php1,807 ▼05.03 ▼0.05156.04 ▼12.80117.96 ▼1.57

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options were found after uninstall: 1 option
    • widget_my_custom_timer_post

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_ID() in wp-content/plugins/post-time-estimator/views/checkbox.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/post-time-estimator/INANI_ButtonCreator.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/post-time-estimator/INANI_TimerPost.php:3

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Configure the widget), #2 (Select the post)
The official readme.txt might help

post-time-estimator/custom-widget.php 92% from 13 tests

The primary PHP file in "Post Reading Time" version 1.0.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("post-time-estimator.php" instead of "custom-widget.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
Good job! No executable or dangerous file extensions detected147 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP42770147

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity7.00
▷ Minimum class complexity6.00
▷ Maximum class complexity8.00
Average method complexity2.09
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods981.82%
▷ Protected methods00.00%
▷ Private methods218.18%
Functions2
▷ Named functions2100.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
4 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot2.png4.82KB3.95KB▼ 17.99%
screenshot-2.png4.82KB3.95KB▼ 17.99%
screenshot-1.png8.30KB5.94KB▼ 28.36%
screenshot1.png8.30KB5.94KB▼ 28.36%