84% reading-position-indicator

Code Review | Reading Position Indicator

WordPress plugin Reading Position Indicator scored84%from 54 tests.

About plugin

  • Plugin page: reading-position-...
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: Apr 14, 2015
  • Latest release: Sep 18, 2023
  • Number of updates: 45
  • Update frequency: every 68.4 days
  • Top authors: iworks (100%)

Code review

54 tests

User reviews

64 reviews

Install metrics

1,000+ active /18,028 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.39MB] [CPU: ▼0.86ms] Passed 4 tests

An overview of server-side resources used by Reading Position Indicator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.87 ▲0.4144.58 ▼2.60
Dashboard /wp-admin3.73 ▲0.4352.43 ▼3.50
Posts /wp-admin/edit.php3.78 ▲0.4255.02 ▲2.52
Add New Post /wp-admin/post-new.php6.25 ▲0.3697.58 ▲0.16
Media Library /wp-admin/upload.php3.59 ▲0.3639.61 ▲3.31
Progress /wp-admin/themes.php?page=irpi_index3.5941.40

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 43 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Reading Position Indicator
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.23 ▼1.332.00 ▲0.1238.83 ▼5.99
Dashboard /wp-admin2,210 ▲224.84 ▲0.00107.69 ▼10.7040.41 ▼19.55
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0040.00 ▲1.5635.69 ▼0.55
Add New Post /wp-admin/post-new.php1,546 ▲1818.47 ▲0.13620.78 ▼43.4570.21 ▲20.41
Media Library /wp-admin/upload.php1,392 ▲44.18 ▼0.1195.76 ▼14.4440.33 ▼4.32
Progress /wp-admin/themes.php?page=irpi_index1,6353.2283.8962.11

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
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

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)
Good news, no errors were detected

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 fix the following
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/reading-position-indicator/includes/iworks/rate/templates/widgets/support.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_parse_args() in wp-content/plugins/reading-position-indicator/includes/iworks/rate/rate.php:69
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/reading-position-indicator/includes/iworks/rate/templates/widgets/donate.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/reading-position-indicator/includes/iworks/rate/templates/thanks.php:7

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)
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention: The official readme.txt might help

reading-position-indicator/reading-position-indicator.php Passed 13 tests

Analyzing the main PHP file in "Reading Position Indicator" version 1.0.6
43 characters long description:
Add reading position indicator on page top.

Code Analysis 97% from 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
There were no executable files found in this plugin3,227 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP81385842,270
JavaScript65494397
CSS112116196
Sass3150181
Markdown2630121
SVG22162

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 189)
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity151.00
▷ Minimum class complexity33.00
▷ Maximum class complexity385.00
Average method complexity5.89
▷ Minimum method complexity1.00
▷ Maximum method complexity189.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods92
▷ Static methods11.09%
▷ Public methods5964.13%
▷ Protected methods33.26%
▷ Private methods3032.61%
Functions8
▷ Named functions8100.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
6 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/iworks/options/assets/styles/images/ui-icons_777620_256x240.png4.51KB4.18KB▼ 7.28%
includes/iworks/options/assets/styles/images/ui-icons_ffffff_256x240.png6.33KB4.18KB▼ 33.99%
includes/iworks/options/assets/styles/images/ui-icons_cc0000_256x240.png4.51KB4.18KB▼ 7.28%
includes/iworks/options/assets/styles/images/ui-icons_777777_256x240.png6.94KB4.18KB▼ 39.78%
includes/iworks/options/assets/styles/images/ui-icons_444444_256x240.png6.92KB4.18KB▼ 39.61%