93% reading-progress-bar

Code Review | Reading progressbar

WordPress plugin Reading progressbar scored 93% from 54 tests.

About plugin

  • Plugin page: reading-progress-bar
  • Plugin version: 1.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.8
  • WordPress version: 5.8.1
  • First release: Dec 26, 2016
  • Latest release: Jul 1, 2021
  • Number of updates: 28
  • Update frequency: every 58.8 days
  • Top authors: audrasjb (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

8,000+ active / 43,692 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.07MB] [CPU: ▼152.47ms] Passed 4 tests

A check of server-side resources used by Reading progressbar
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1341.44 ▲16.55
Dashboard /wp-admin3.13 ▲0.0752.79 ▼9.52
Posts /wp-admin/edit.php3.21 ▲0.1053.07 ▼5.49
Add New Post /wp-admin/post-new.php5.48 ▲0.0597.19 ▼587.03
Media Library /wp-admin/upload.php3.07 ▲0.0637.08 ▼7.85
Reading progressbar /wp-admin/options-general.php?page=reading-progressbar3.0433.29

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 23 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Reading progressbar
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,725 ▲11916.20 ▲0.6614.17 ▲1.9752.94 ▼10.00
Dashboard /wp-admin2,989 ▲616.53 ▲0.49144.89 ▼47.06118.81 ▼7.79
Posts /wp-admin/edit.php2,761 ▲222.79 ▲0.0870.16 ▼8.3396.81 ▼10.22
Add New Post /wp-admin/post-new.php1,643 ▼4022.18 ▲6.49294.68 ▼124.17139.25 ▲21.57
Media Library /wp-admin/upload.php1,833 ▲265.35 ▲0.33132.44 ▼52.49123.72 ▼19.92
Reading progressbar /wp-admin/options-general.php?page=reading-progressbar1,6112.9386.6984.23

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/reading-progress-bar/public/rp-public.php:51
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/reading-progress-bar/admin/rp-admin.php:21

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, but this is not an exhaustive test

Optimizations

Plugin configuration 93% 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
Please fix the following attributes:
  • Tags: There are too many tags (12 tag instead of maximum 10)
You can look at the official readme.txt

reading-progress-bar/reading-progressbar.php 92% from 13 tests

"Reading progressbar" version 1.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("reading-progress-bar.php" instead of "reading-progressbar.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected511 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP44987288
PO File25153160
JavaScript211650
CSS10313

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues 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%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.51MB with 0.34MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png135.10KB36.91KB▼ 72.68%
assets/icon-128x128.png5.41KB1.91KB▼ 64.70%
assets/banner-772x250.png21.09KB8.28KB▼ 60.73%
assets/icon-256x256.png7.96KB2.83KB▼ 64.41%
assets/screenshot-2.png318.16KB87.64KB▼ 72.45%