67% reader-mode

Code Review | Reader Mode - Distraction-Free Content Reader

WordPress plugin Reader Mode - Distraction-Free Content Reader scored 67% from 54 tests.

About plugin

  • Plugin page: reader-mode
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Oct 30, 2022
  • Latest release: Oct 30, 2022
  • Number of updates: 3
  • Update frequency: every 10.0 days
  • Top authors: princeahmed (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active / 625 total downloads

Benchmarks

Plugin footprint 65% from 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: ▲4.65MB] [CPU: ▲25.67ms] Passed 4 tests

Analyzing server-side resources used by Reader Mode - Distraction-Free Content Reader
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /8.49 ▲5.0362.30 ▲22.98
Dashboard /wp-admin8.51 ▲5.2173.25 ▲25.65
Posts /wp-admin/edit.php8.51 ▲5.1682.53 ▲33.00
Add New Post /wp-admin/post-new.php9.10 ▲3.22119.79 ▲25.67
Media Library /wp-admin/upload.php8.51 ▲5.2863.94 ▲28.39
Freemius Debug [v.2.4.5] /wp-admin/admin.php?page=freemius8.5158.44

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 283 new files
Database: no new tables, 11 new options
New WordPress options
fs_gdpr
reader_mode_version
can_compress_scripts
fs_debug_mode
widget_theysaidso_widget
widget_recent-comments
fs_active_plugins
theysaidso_admin_options
db_upgraded
fs_accounts
...

Browser metrics Passed 4 tests

Reader Mode - Distraction-Free Content Reader: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,179 ▲44424.39 ▲11.1549.07 ▲44.4628.70 ▼10.09
Dashboard /wp-admin2,329 ▲14111.52 ▲6.46146.82 ▲43.0281.21 ▲35.75
Posts /wp-admin/edit.php2,248 ▲15910.39 ▲8.3580.15 ▲42.0697.60 ▲66.39
Add New Post /wp-admin/post-new.php1,701 ▲16723.16 ▼0.05499.46 ▼194.80149.59 ▲83.86
Media Library /wp-admin/upload.php1,593 ▲20211.51 ▲7.37140.47 ▲35.99146.71 ▲95.30
Freemius Debug [v.2.4.5] /wp-admin/admin.php?page=freemius1,2279.8268.79100.87

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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 plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/reader-mode/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • Zombie WordPress options detected upon uninstall: 11 options
    • widget_recent-comments
    • db_upgraded
    • fs_active_plugins
    • fs_debug_mode
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • fs_gdpr
    • widget_recent-posts
    • fs_accounts
    • can_compress_scripts
    • ...

Smoke tests 50% 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 no errors were found, this is by no means an exhaustive test

SRP 0% 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 items
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/reader-mode/includes/views/getting-started/get-pro.php
    • > /wp-content/plugins/reader-mode/includes/views/getting-started/basic-usage.php
    • > /wp-content/plugins/reader-mode/includes/views/getting-started/what-new.php
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/reader-mode/plugin.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function rm_fs() in wp-content/plugins/reader-mode/includes/views/getting-started/get-pro.php:138
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/reader-mode/includes/views/getting-started/introduction.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/reader-mode/includes/views/getting-started/help.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt is a good inspiration

reader-mode/plugin.php 85% from 13 tests

"Reader Mode - Distraction-Free Content Reader" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Domain Path: Use only dashes and lowercase characters for the domain path ("/languages/*")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("reader-mode.php" instead of "plugin.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin32,949 lines of code in 210 files:
LanguageFilesBlank linesComment linesLines of code
PHP1227,66416,21631,876
SVG6602855
JavaScript73473200
CSS150018

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 2,911)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity81.20
▷ Minimum class complexity1.00
▷ Maximum class complexity2,911.00
Average method complexity4.59
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes51
▷ Abstract classes23.92%
▷ Concrete classes4996.08%
▷ Final classes12.04%
Methods1,170
▷ Static methods18015.38%
▷ Public methods82870.77%
▷ Protected methods151.28%
▷ Private methods32727.95%
Functions110
▷ Named functions10999.09%
▷ Anonymous functions10.91%
Constants131
▷ Global constants10680.92%
▷ Class constants2519.08%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
29 compressed PNG files occupy 0.16MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/getting-started/custom-css.png1.20KB1.27KB0.00%
assets/images/getting-started/customizable.png1.38KB1.45KB0.00%
assets/images/getting-started/multiple-display-positions.png3.55KB3.51KB▼ 1.10%
assets/images/getting-started/fullscreen.png1.14KB1.23KB0.00%
assets/images/getting-started/reading-time.png8.45KB8.99KB0.00%