77% darklup-lite-wp-dark-mode

Code Review | Darklup - Enhanced WordPress Dark Mode, Dark Theme, Night Mode Plugin

WordPress plugin Darklup - Enhanced WordPress Dark Mode, Dark Theme, Night Mode Plugin scored77%from 54 tests.

About plugin

  • Plugin page: darklup-lite-wp-d...
  • Plugin version: 3.2.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.4.1
  • WordPress version: 6.3.1
  • First release: Jan 7, 2021
  • Latest release: Nov 16, 2023
  • Number of updates: 80
  • Update frequency: every 13.1 days
  • Top authors: darklup (100%)

Code review

54 tests

User reviews

33 reviews

Install metrics

1,000+ active /32,951 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.09MB] [CPU: ▼1.68ms] 75% from 4 tests

A check of server-side resources used by Darklup - Enhanced WordPress Dark Mode, Dark Theme, Night Mode Plugin
Please have a look at the following items
  • CPU: The total CPU usage must kept under 500.00ms (currently 899.61ms on /wp-admin/admin.php?page=darklup-lite-useful-plugins)
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0942.16 ▲0.83
Dashboard /wp-admin3.39 ▲0.0851.00 ▲1.76
Posts /wp-admin/edit.php3.50 ▲0.1446.15 ▼0.97
Add New Post /wp-admin/post-new.php5.99 ▲0.1094.13 ▼6.91
Media Library /wp-admin/upload.php3.31 ▲0.0833.60 ▲0.35
Settings /wp-admin/admin.php?page=darkluplite-setting-admin3.5448.00
Get Pro /wp-admin/admin.php?page=darkluplite-get-pro3.3443.47
Useful Plugins /wp-admin/admin.php?page=darklup-lite-useful-plugins3.61899.61

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 234 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
darkluplite_settings
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_darkluplite_darkmode_switch_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Darklup - Enhanced WordPress Dark Mode, Dark Theme, Night Mode Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,149 ▲38717.76 ▲3.4123.70 ▲21.9139.13 ▼13.82
Dashboard /wp-admin2,459 ▲2857.35 ▲1.76165.20 ▲71.71100.25 ▲50.52
Posts /wp-admin/edit.php2,283 ▲1833.87 ▲1.9150.69 ▲11.4658.74 ▲22.38
Add New Post /wp-admin/post-new.php6,507 ▲4,98120.09 ▼3.05924.70 ▲249.5936.00 ▼17.19
Media Library /wp-admin/upload.php1,611 ▲2116.24 ▲2.02111.33 ▲12.3882.49 ▲41.55
Settings /wp-admin/admin.php?page=darkluplite-setting-admin12,4785.76332.38124.18
Get Pro /wp-admin/admin.php?page=darkluplite-get-pro15,3019.97310.48111.19
Useful Plugins /wp-admin/admin.php?page=darklup-lite-useful-plugins1,1353.5763.24111.09

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • widget_darkluplite_darkmode_switch_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

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 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 11× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/darklup-lite-wp-dark-mode/inc/class-helper.php
    • > /wp-content/plugins/darklup-lite-wp-dark-mode/inc/custom-controls/elemenor-control/image-select.php
    • > /wp-content/plugins/darklup-lite-wp-dark-mode/page-builder/wpbakery/darkluplite-vc-init.php
    • > /wp-content/plugins/darklup-lite-wp-dark-mode/inc/class-hooks.php
    • > /wp-content/plugins/darklup-lite-wp-dark-mode/inc/class-enqueue.php
    • > /wp-content/plugins/darklup-lite-wp-dark-mode/admin/admin.php
    • > /wp-content/plugins/darklup-lite-wp-dark-mode/page-builder/wpbakery/vc-darkmode-switch.php
    • > /wp-content/plugins/darklup-lite-wp-dark-mode/inc/custom-controls/elemenor-control/custom-control.php
    • > /wp-content/plugins/darklup-lite-wp-dark-mode/page-builder/wpbakery/image-switch-param.php
    • > /wp-content/plugins/darklup-lite-wp-dark-mode/page-builder/wpbakery/vc-darkmode-switch-markup.php
  • 33× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Use of undefined constant DARKLUPLITE_ALERT_MSG - assumed 'DARKLUPLITE_ALERT_MSG' (this will throw an Error in a future version of PHP) in wp-content/plugins/darklup-lite-wp-dark-mode/page-builder/wpbakery/darkluplite-vc-init.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'DarklupLite\\Admin\\Settings_Fields_Base' not found in wp-content/plugins/darklup-lite-wp-dark-mode/admin/admin-templates/template-woocommerce-settings.php:12
    • > PHP Warning
      Use of undefined constant DARKLUPLITE_ALERT_MSG - assumed 'DARKLUPLITE_ALERT_MSG' (this will throw an Error in a future version of PHP) in wp-content/plugins/darklup-lite-wp-dark-mode/page-builder/wpbakery/vc-darkmode-switch.php on line 11
    • > PHP Fatal error
      Trait 'DarklupLite\\Admin\\Field\\CSS_Editor' not found in wp-content/plugins/darklup-lite-wp-dark-mode/admin/setting-fields/class-settings-fields-base.php on line 13
    • > PHP Warning
      Use of undefined constant DARKLUPLITE_ALERT_MSG - assumed 'DARKLUPLITE_ALERT_MSG' (this will throw an Error in a future version of PHP) in wp-content/plugins/darklup-lite-wp-dark-mode/inc/custom-controls/elemenor-control/image-select.php on line 12
    • > PHP Fatal error
      Uncaught Error: Class 'DarklupLite\\Admin\\Settings_Fields_Base' not found in wp-content/plugins/darklup-lite-wp-dark-mode/admin/admin-templates/template-admin-settings.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'DarklupLite\\Admin\\Settings_Fields_Base' not found in wp-content/plugins/darklup-lite-wp-dark-mode/admin/admin-templates/template-home-settings.php:13
    • > PHP Warning
      Use of undefined constant DARKLUPLITE_ALERT_MSG - assumed 'DARKLUPLITE_ALERT_MSG' (this will throw an Error in a future version of PHP) in wp-content/plugins/darklup-lite-wp-dark-mode/inc/class-enqueue.php on line 15
    • > PHP Warning
      Use of undefined constant DARKLUPLITE_DIR_ADMIN - assumed 'DARKLUPLITE_DIR_ADMIN' (this will throw an Error in a future version of PHP) in wp-content/plugins/darklup-lite-wp-dark-mode/admin/setting-fields/class-settings-fields.php on line 19
    • > PHP Warning
      Use of undefined constant DARKLUPLITE_ALERT_MSG - assumed 'DARKLUPLITE_ALERT_MSG' (this will throw an Error in a future version of PHP) in wp-content/plugins/darklup-lite-wp-dark-mode/inc/class-helper.php on line 12

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 90% from 29 tests

readme.txt 94% 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
These attributes need your attention: Please take inspiration from this readme.txt

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

"Darklup - Enhanced WordPress Dark Mode, Dark Theme, Night Mode Plugin" version 3.2.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: The principal plugin file should be the same as the plugin slug ("darklup-lite-wp-dark-mode.php" instead of "darklup-lite.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin14,270 lines of code in 180 files:
LanguageFilesBlank linesComment linesLines of code
PHP571,5401,8786,953
CSS233361294,567
JavaScript381621651,077
SVG5600957
Sass2130284
Markdown1820255
XML161195
JSON211082

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity10.12
▷ Minimum class complexity1.00
▷ Maximum class complexity86.00
Average method complexity2.72
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces6
Interfaces0
Traits16
Classes34
▷ Abstract classes12.94%
▷ Concrete classes3397.06%
▷ Final classes26.06%
Methods265
▷ Static methods7427.92%
▷ Public methods22886.04%
▷ Protected methods93.40%
▷ Private methods2810.57%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.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
31 PNG files occupy 0.20MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/img/3.png2.62KB0.15KB▼ 94.12%
page-builder/gutenberg-block/darkluplite-switch-block/img/2.png1.21KB0.63KB▼ 47.98%
assets/img/switch-5.png17.65KB1.63KB▼ 90.74%
admin/assets/img/5.png46.14KB13.96KB▼ 69.75%
admin/assets/img/2.png0.20KB0.18KB▼ 8.87%