84% mins-to-read

Code Review | Mins To Read

WordPress plugin Mins To Read scored84%from 54 tests.

About plugin

  • Plugin page: mins-to-read
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.2-4.9.8
  • WordPress version: 6.3.1
  • First release: Sep 24, 2014
  • Latest release: Oct 12, 2018
  • Number of updates: 12
  • Update frequency: every 123.3 days
  • Top authors: think201 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

50+ active /2,536 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

An overview of server-side resources used by Mins To Read
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0242.80 ▼0.73
Dashboard /wp-admin3.32 ▲0.0150.31 ▼1.35
Posts /wp-admin/edit.php3.37 ▲0.0149.25 ▲4.34
Add New Post /wp-admin/post-new.php5.90 ▲0.0188.04 ▼7.29
Media Library /wp-admin/upload.php3.24 ▲0.0140.42 ▲1.92
Mins To Read /wp-admin/options-general.php?page=mins-to-read3.2635.75

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Mins To Read
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲6213.23 ▼1.522.67 ▲0.6942.86 ▼6.94
Dashboard /wp-admin2,228 ▲255.85 ▲0.97100.26 ▼8.7638.39 ▼4.30
Posts /wp-admin/edit.php2,104 ▲42.06 ▲0.0633.85 ▼5.4634.87 ▼4.45
Add New Post /wp-admin/post-new.php1,550 ▲2423.00 ▲5.47628.46 ▼61.6661.89 ▼7.58
Media Library /wp-admin/upload.php1,407 ▲74.28 ▲0.10103.61 ▼3.7045.91 ▼2.65
Mins To Read /wp-admin/options-general.php?page=mins-to-read9392.0223.4829.35

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/mins-to-read/mins-to-read.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/mins-to-read/pages/admin-dashboard.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/mins-to-read/includes/admin-dashboard.php:5

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 is important because it is parsed by WordPress.org for the public listing of your plugin
8 plugin tags: time to read, minutes, blog, calculator, calculation...

mins-to-read/mins-to-read.php Passed 13 tests

"Mins To Read" version 1.2.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
100 characters long description:
Mins To Read is a plugin which calculates the read time of a blog post based on words present in it.

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
No dangerous file extensions were detected1,464 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
CSS4260760
PHP812760495
Sass3330156
JavaScript19035
PO File12418

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity5.60
▷ Minimum class complexity2.00
▷ Maximum class complexity8.00
Average method complexity2.05
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods22
▷ Static methods1254.55%
▷ Public methods22100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.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 are no PNG files in this plugin