89% wp-dark-mode-block

Code Review | WP Dark Mode Block

WordPress plugin WP Dark Mode Block scored 89% from 54 tests.

About plugin

  • Plugin page: wp-dark-mode-block
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.5
  • WordPress version: 6.3.1
  • First release: Aug 21, 2020
  • Latest release: Aug 21, 2020
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: wppool (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 1,623 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
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.62ms] Passed 4 tests

Analyzing server-side resources used by WP Dark Mode Block
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.00 ▼5.22
Dashboard /wp-admin3.32 ▲0.0245.37 ▼3.17
Posts /wp-admin/edit.php3.37 ▲0.0147.78 ▲1.67
Add New Post /wp-admin/post-new.php5.90 ▲0.0190.07 ▼11.77
Media Library /wp-admin/upload.php3.24 ▲0.0136.74 ▲3.60

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 38 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

WP Dark Mode Block: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲14813.99 ▼0.365.25 ▲3.4240.55 ▼10.18
Dashboard /wp-admin2,206 ▲185.85 ▲0.7996.35 ▼22.6638.66 ▼4.71
Posts /wp-admin/edit.php2,086 ▼32.11 ▲0.0939.82 ▲6.2835.12 ▼0.31
Add New Post /wp-admin/post-new.php6,589 ▲5,05629.45 ▲6.30862.68 ▲262.3135.50 ▼18.13
Media Library /wp-admin/upload.php1,388 ▼04.17 ▼0.0796.88 ▼9.8743.48 ▼4.28

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests Passed 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)
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Congratulations! This plugin passed the SRP test

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 issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Please describe screenshot #5 in wp-dark-mode-block/assets to your readme.txt
  • Screenshots: Screenshot #1 (Dark Mode Switch Block) image not found
The official readme.txt is a good inspiration

wp-dark-mode-block/plugin.php 85% from 13 tests

"WP Dark Mode Block" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Domain Path: The domain path points to an invalid folder, "/languages/" does not exist
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-dark-mode-block.php" instead of "plugin.php")

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 plugin659 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
CSS2699337
JavaScript6664254
PHP2102428
SVG10020
HTML13011
JSON1009

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
23 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/button-presets/btn-6/moon.png0.76KB0.45KB▼ 40.54%
src/button-presets/btn-6/sun.png0.90KB0.52KB▼ 42.75%
src/button-presets/btn-3/moon-light.png0.76KB0.45KB▼ 40.54%
src/button-presets/btn-2-moon.png1.89KB1.22KB▼ 35.18%
src/button-presets/btn-3/moon-dark.png1.94KB0.86KB▼ 55.96%