72% distraction-free-writing-mode-themes

Code Review | Distraction Free Writing mode Themes

WordPress plugin Distraction Free Writing mode Themes scored72%from 54 tests.

About plugin

  • Plugin page: distraction-free-...
  • Plugin version: 3.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.8.1
  • WordPress version: 6.3.1
  • First release: Feb 13, 2013
  • Latest release: Jul 27, 2015
  • Number of updates: 22
  • Update frequency: every 40.6 days
  • Top authors: khromov (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

20+ active /4,183 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
Installer ran successfully

Server metrics [RAM: ▼0.08MB] [CPU: ▼9.03ms] Passed 4 tests

An overview of server-side resources used by Distraction Free Writing mode Themes
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.88 ▼0.15
Dashboard /wp-admin3.34 ▲0.0044.23 ▼11.71
Posts /wp-admin/edit.php3.40 ▲0.0445.42 ▲1.80
Add New Post /wp-admin/post-new.php5.47 ▼0.4176.80 ▼25.21
Media Library /wp-admin/upload.php3.27 ▲0.0434.83 ▲0.96
DFWM Themes /wp-admin/options-general.php?page=dfwmdt3.2530.52

Server storage [IO: ▲2.03MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 39 new files
Database: no new tables, 8 new options
New WordPress options
dfwmt_custom_theme_css
dfwmt_selected_theme
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Distraction Free Writing mode Themes
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.60 ▼0.781.73 ▲0.0241.85 ▼2.34
Dashboard /wp-admin2,213 ▲245.88 ▲0.89106.25 ▼3.5343.75 ▼0.13
Posts /wp-admin/edit.php2,093 ▲71.98 ▼0.0239.17 ▲4.8534.14 ▲2.34
Add New Post /wp-admin/post-new.php1,533 ▼023.29 ▲0.17583.40 ▼9.3353.73 ▼4.80
Media Library /wp-admin/upload.php1,395 ▲134.21 ▲0.1194.71 ▼5.7442.09 ▼1.44
DFWM Themes /wp-admin/options-general.php?page=dfwmdt9292.0722.7126.98

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • dfwmt_custom_theme_css
    • dfwmt_selected_theme

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=dfwmdt
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=dfwmdt
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
The following issues need your attention
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/distraction-free-writing-mode-themes/templates/force_dfwm_js.php
    • > /wp-content/plugins/distraction-free-writing-mode-themes/templates/admin/css/default-custom-css.php
    • > /wp-content/plugins/distraction-free-writing-mode-themes/templates/admin/js-popup.php
  • 9× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/distraction-free-writing-mode-themes/templates/admin/fields/custom_theme_css.php:2
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_names() on null in wp-content/plugins/distraction-free-writing-mode-themes/templates/admin/fields/force_roles.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_user_option() in wp-content/plugins/distraction-free-writing-mode-themes/templates/user/fields/user_theme_field.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/distraction-free-writing-mode-themes/templates/admin/fields/selected_theme.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/distraction-free-writing-mode-themes/templates/user/fields/user_force_dfwmt.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/distraction-free-writing-mode-themes/templates/admin/main.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/distraction-free-writing-mode-themes/distraction-free-writing-mode-themes.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/distraction-free-writing-mode-themes/templates/user/user_theme_selection.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/distraction-free-writing-mode-themes/templates/admin/footer.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

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
3 plugin tags: dark theme, themes, editor

distraction-free-writing-mode-themes/distraction-free-writing-mode-themes.php 92% from 13 tests

The entry point to "Distraction Free Writing mode Themes" version 3.1.0 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • 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 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin746 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP1385120369
CSS83716226
PO File26074151

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity11.00
▷ Minimum class complexity1.00
▷ Maximum class complexity25.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods30
▷ Static methods13.33%
▷ Public methods30100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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
10 PNG files occupy 1.70MB with 0.70MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/matrix/preview.png62.72KB43.60KB▼ 30.48%
css/pearl/paper_fibers.png72.36KB75.74KB0.00%
css/paper/preview.png245.95KB133.39KB▼ 45.76%
css/autolycus/preview.png170.12KB61.29KB▼ 63.97%
css/zenhub/preview.png180.91KB61.62KB▼ 65.94%