84% dark-mode-button

Code Review | Dark mode Button

WordPress plugin Dark mode Button scored84%from 54 tests.

About plugin

  • Plugin page: dark-mode-button
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.1
  • WordPress version: 6.3.1
  • First release: Apr 30, 2022
  • Latest release: Feb 25, 2023
  • Number of updates: 6
  • Update frequency: every 50.2 days
  • Top authors: haghs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /420 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.01MB] [CPU: ▼12.22ms] Passed 4 tests

Server-side resources used by Dark mode Button
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.92 ▼7.17
Dashboard /wp-admin3.31 ▼0.0445.63 ▼11.35
Posts /wp-admin/edit.php3.36 ▲0.0045.37 ▼3.22
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.13 ▼27.12
Media Library /wp-admin/upload.php3.23 ▲0.0034.53 ▼0.25

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Dark mode Button
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.73 ▼0.541.70 ▼0.5341.78 ▼12.53
Dashboard /wp-admin2,203 ▲155.85 ▼0.02100.36 ▼0.4041.01 ▲0.18
Posts /wp-admin/edit.php2,089 ▼02.17 ▲0.1639.87 ▼3.1632.52 ▼4.93
Add New Post /wp-admin/post-new.php1,549 ▲718.63 ▼4.50641.42 ▼58.7372.22 ▲22.06
Media Library /wp-admin/upload.php1,385 ▼34.25 ▲0.0496.89 ▼3.7742.65 ▼2.35

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/dark-mode-button/DarkModeButton.php:56

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
1 plugin tags: darkmode

dark-mode-button/DarkModeButton.php 92% from 13 tests

"Dark mode Button" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("dark-mode-button.php" instead of "DarkModeButton.php")

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
Success! There were no dangerous files found in this plugin32 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1151032

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.00
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin