84% wp-distraction-free-view

Code Review | WP Distraction Free View

WordPress plugin WP Distraction Free View scored84%from 54 tests.

About plugin

  • Plugin page: wp-distraction-fr...
  • Plugin version: 1.6.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.7
  • WordPress version: 6.3.1
  • First release: Mar 16, 2016
  • Latest release: May 15, 2021
  • Number of updates: 37
  • Update frequency: every 51.0 days
  • Top authors: mehul0810 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,367 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.21MB] [CPU: ▼4.42ms] Passed 4 tests

This is a short check of server-side resources used by WP Distraction Free View
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2043.52 ▲5.06
Dashboard /wp-admin3.56 ▲0.2649.09 ▲0.36
Posts /wp-admin/edit.php3.61 ▲0.2546.07 ▼4.34
Add New Post /wp-admin/post-new.php6.10 ▲0.2186.84 ▼17.99
Media Library /wp-admin/upload.php3.42 ▲0.1939.94 ▲4.28
Distraction Free Mode /wp-admin/options-general.php?page=wpdfv_settings3.3933.17

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 37 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for WP Distraction Free View
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,959 ▲22413.73 ▼0.686.31 ▲4.3843.13 ▼0.28
Dashboard /wp-admin2,234 ▲465.08 ▼0.82106.31 ▼6.0840.34 ▼3.70
Posts /wp-admin/edit.php2,119 ▲302.32 ▲0.2036.15 ▼0.8934.18 ▼0.61
Add New Post /wp-admin/post-new.php1,534 ▲122.91 ▼0.43672.63 ▲5.3339.59 ▼20.18
Media Library /wp-admin/upload.php1,416 ▲314.50 ▲0.31113.79 ▲15.8446.48 ▲3.05
Distraction Free Mode /wp-admin/options-general.php?page=wpdfv_settings8821.9726.6127.90

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WPDFV\\Admin\\wp_die() in wp-content/plugins/wp-distraction-free-view/src/Admin/Upgrades.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WPDFV\\Admin\\wp_die() in wp-content/plugins/wp-distraction-free-view/src/Admin/SettingsApi.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: distraction free reading, zen view, fullscreen, fullscreen mode, distraction free...

wp-distraction-free-view/wp-distraction-free-view.php 92% from 13 tests

The main PHP file in "WP Distraction Free View" ver. 1.6.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
Good job! No executable or dangerous file extensions detected1,362 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP223386521,195
JSON100157
CSS4004
SVG4004
JavaScript2002

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity9.43
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.59
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes17.14%
Methods75
▷ Static methods2229.33%
▷ Public methods7397.33%
▷ Protected methods00.00%
▷ Private methods22.67%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin