68% wp-dark-mode

Code Review | WP Dark Mode - Best Dark Mode Plugin for WordPress with Social Sharing

WordPress plugin WP Dark Mode - Best Dark Mode Plugin for WordPress with Social Sharing scored68%from 54 tests.

About plugin

  • Plugin page: wp-dark-mode
  • Plugin version: 4.2.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Jul 20, 2020
  • Latest release: Nov 8, 2023
  • Number of updates: 167
  • Update frequency: every 7.3 days
  • Top authors: wppool (43.11%)azizultex (35.93%)iamjafran (12.57%)princeahmed (9.58%)mahfuz01 (1.2%)

Code review

54 tests

User reviews

310 reviews

Install metrics

20,000+ active /662,260 total downloads

Benchmarks

Plugin footprint 65% 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: ▲1.22MB] [CPU: ▲14.30ms] 75% from 4 tests

An overview of server-side resources used by WP Dark Mode - Best Dark Mode Plugin for WordPress with Social Sharing
Please take the time to fix the following items
  • CPU: You should keep total CPU usage under 500.00ms (currently 3,777.34ms on /wp-admin/admin.php?page=wp-dark-mode-recommended-plugins)
PageMemory (MB)CPU Time (ms)
Home /3.94 ▲0.4753.51 ▲12.51
Dashboard /wp-admin4.83 ▲1.4975.16 ▲8.83
Posts /wp-admin/edit.php4.87 ▲1.5170.61 ▲23.91
Add New Post /wp-admin/post-new.php7.33 ▲1.44111.39 ▲15.63
Media Library /wp-admin/upload.php4.69 ▲1.4655.17 ▲20.22
Recommended Plugins /wp-admin/admin.php?page=wp-dark-mode-recommended-plugins5.173,777.34
Tools /wp-admin/admin.php?page=wp-dark-mode-tools4.6855.32
Social Share New /wp-admin/admin.php?page=wp-dark-mode-social-share4.7357.99
Get Started /wp-admin/admin.php?page=wp-dark-mode-get-started4.6853.32
Settings /wp-admin/admin.php?page=wp-dark-mode-settings4.73100.64

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 254 new files
Database: 1 new table, 42 new options
New tables
wp_wpdm_social_shares
New WordPress options
wpdm_social_share_post_types
wpdm_social_share_maximum_click_count
widget_recent-comments
wp_dark_mode_includes_excludes
wp_dark_mode_switch
wpdm_social_share_show_total_share_count
wpdm_social_share_minimum_share_count
wpdm_social_share_share_via_label
wp_dark_mode_version
wpdm_social_share_button_alignment
...

Browser metrics Passed 4 tests

WP Dark Mode - Best Dark Mode Plugin for WordPress with Social Sharing: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,289 ▲52717.71 ▲3.377.97 ▲6.3042.11 ▼3.10
Dashboard /wp-admin2,640 ▲4638.59 ▲2.89192.04 ▲102.37103.99 ▲64.26
Posts /wp-admin/edit.php2,496 ▲3963.67 ▲1.7162.66 ▲27.9082.03 ▲44.19
Add New Post /wp-admin/post-new.php6,407 ▲4,88119.21 ▼3.82902.14 ▲292.9739.75 ▼7.57
Media Library /wp-admin/upload.php1,623 ▲2204.71 ▲0.5193.91 ▼3.9584.57 ▲44.62
Recommended Plugins /wp-admin/admin.php?page=wp-dark-mode-recommended-plugins2,1453.9756.67100.87
Tools /wp-admin/admin.php?page=wp-dark-mode-tools1,2783.6753.3769.62
Upgrade Now /wp-admin/admin.php?page=#280.410.123.30
Social Share New /wp-admin/admin.php?page=wp-dark-mode-social-share5,5286.16140.9172.03
Get Started /wp-admin/admin.php?page=wp-dark-mode-get-started2,66521.22514.99122.11
Settings /wp-admin/admin.php?page=wp-dark-mode-settings5,8576.67172.19141.86

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie tables were found after uninstall: 1 table
    • wp_wpdm_social_shares
  • Zombie WordPress options were found after uninstall: 42 options
    • wp_dark_mode_version
    • wp_dark_mode_video_settings
    • wpdm_social_share_button_position
    • wp_dark_mode_triggers
    • wpdm_social_share_hide_button_on
    • db_upgraded
    • wp_dark_mode_general
    • wpdm_social_share_minimum_share_count
    • wpdm_social_share_button_label
    • wpdm_social_share_button_template
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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
Please fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-dark-mode/templates/social-share.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=#
    • > Network (severe)
    wp-admin/admin.php?page=# - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=wp-dark-mode-get-started
    • > Other (warning) in unknown
    https://www.youtube.com/s/player/2be84af7/www-widgetapi.vflset/www-widgetapi.js 1248 Unrecognized feature: 'web-share'.

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
10 plugin tags: social share, night mode, dark mode toggle, gutenberg block, dark mode plugin...

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

This is the main PHP file of "WP Dark Mode - Best Dark Mode Plugin for WordPress with Social Sharing" version 4.2.6, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 145 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-dark-mode.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin12,339 lines of code in 152 files:
LanguageFilesBlank linesComment linesLines of code
PHP671,9223,3229,358
CSS2225381,371
SVG4600961
Markdown21560471
JavaScript1372981
XML1172572
JSON10025

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity28.61
▷ Minimum class complexity1.00
▷ Maximum class complexity100.00
Average method complexity3.03
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes23
▷ Abstract classes14.35%
▷ Concrete classes2295.65%
▷ Final classes00.00%
Methods304
▷ Static methods289.21%
▷ Public methods25583.88%
▷ Protected methods82.63%
▷ Private methods4113.49%
Functions29
▷ Named functions1862.07%
▷ Anonymous functions1137.93%
Constants8
▷ Global constants787.50%
▷ Class constants112.50%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
46 compressed PNG files occupy 0.53MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/switch-preview.png0.69KB0.71KB0.00%
assets/images/button-presets/12.png0.32KB0.35KB0.00%
assets/images/btn-6/moon.png0.41KB0.42KB0.00%
includes/wppool/campaign.png319.65KB123.97KB▼ 61.22%
assets/images/btn-4/moon-light.png0.41KB0.42KB0.00%