84% dark-mode-for-wp

Code Review | Dark Mode For WP [GWE]

WordPress plugin Dark Mode For WP [GWE] scored84%from 54 tests.

About plugin

  • Plugin page: dark-mode-for-wp
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4.1
  • WordPress version: 6.3.1
  • First release: Dec 20, 2022
  • Latest release: Dec 3, 2023
  • Number of updates: 6
  • Update frequency: every 58.0 days
  • Top authors: mukulwp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /345 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼6.36ms] Passed 4 tests

This is a short check of server-side resources used by Dark Mode For WP [GWE]
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0934.69 ▼7.39
Dashboard /wp-admin3.39 ▲0.0944.19 ▼9.88
Posts /wp-admin/edit.php3.45 ▲0.0945.46 ▲1.32
Add New Post /wp-admin/post-new.php5.99 ▲0.1183.97 ▼9.37
Media Library /wp-admin/upload.php3.32 ▲0.0933.90 ▲1.21
Dark Mode For WP /wp-admin/options-general.php?page=dmfw3.2930.68

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 17 new files
Database: no new tables, 16 new options
New WordPress options
dmfw_link_text_hover_color
widget_recent-posts
can_compress_scripts
dmfw_para_text_color
db_upgraded
widget_recent-comments
dmfw_heading_text_color
dmfw_switch
widget_theysaidso_widget
dmfw_body_bg_color
...

Browser metrics Passed 4 tests

A check of browser resources used by Dark Mode For WP [GWE]
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲8114.38 ▲0.122.22 ▲0.5339.92 ▼4.48
Dashboard /wp-admin2,220 ▲435.80 ▲0.1696.45 ▼10.4243.11 ▼1.75
Posts /wp-admin/edit.php2,130 ▲332.25 ▲0.2240.98 ▲2.5735.10 ▲0.28
Add New Post /wp-admin/post-new.php1,545 ▲1923.28 ▼0.07689.99 ▲25.8437.82 ▼20.41
Media Library /wp-admin/upload.php1,425 ▲224.41 ▲0.2397.23 ▼0.9641.23 ▼0.48
Dark Mode For WP /wp-admin/options-general.php?page=dmfw1,7962.6183.2526.99

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 16 options in the database
    • dmfw_link_bg_color
    • dmfw_border_color
    • widget_recent-comments
    • dmfw_para_text_color
    • dmfw_responsive_device
    • theysaidso_admin_options
    • db_upgraded
    • dmfw_body_bg_color
    • dmfw_toggle_btn_position
    • dmfw_link_text_hover_color
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/dark-mode-for-wp/dark-mode-for-wp.php:34

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: dark theme, dark mode, night mode, wp dark mode, wordpress dark mode

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

"Dark Mode For WP [GWE]" version 1.0.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 173 characters long)
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin445 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP14215308
CSS4610102
JavaScript24735

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity8.50
▷ Minimum class complexity1.00
▷ Maximum class complexity16.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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