77% darklooks-dark-mode-switcher

Code Review | DarkLooks - Dark Mode Switcher For WordPress

WordPress plugin DarkLooks - Dark Mode Switcher For WordPress scored77%from 54 tests.

About plugin

  • Plugin page: darklooks-dark-mo...
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Dec 15, 2021
  • Latest release: Aug 14, 2023
  • Number of updates: 19
  • Update frequency: every 32.6 days
  • Top authors: themelooks (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

1,000+ active /10,771 total downloads


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.12MB] [CPU: ▼3.08ms] 75% from 4 tests

Analyzing server-side resources used by DarkLooks - Dark Mode Switcher For WordPress
The following require your attention
  • CPU: The total CPU usage must kept under 500.00ms (currently 687.22ms on /wp-admin/admin.php?page=darklooks-recommended-plugin)
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2843.72 ▼1.14
Dashboard /wp-admin3.42 ▲0.0857.42 ▼5.85
Posts /wp-admin/edit.php3.54 ▲0.1855.55 ▲4.90
Add New Post /wp-admin/post-new.php6.00 ▲0.1288.62 ▼7.47
Media Library /wp-admin/upload.php3.34 ▲0.1241.15 ▲2.16
Recommended Plugins /wp-admin/admin.php?page=darklooks-recommended-plugin3.49687.22
Settings /wp-admin/admin.php?page=darklooks-setting-admin3.7043.79

Server storage [IO: ▲0.24MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
It is recommended to fix the following issues
  • There were 1 file (4.00KB) illegally modified outside of "wp-content/plugins/darklooks-dark-mode-switcher/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 97 new files
Database: no new tables, 7 new options
New WordPress options

Browser metrics Passed 4 tests

DarkLooks - Dark Mode Switcher For WordPress: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,982 ▲19613.63 ▼0.985.97 ▲3.8742.03 ▼1.42
Dashboard /wp-admin2,246 ▲405.91 ▲1.03102.84 ▼6.2578.23 ▲37.71
Posts /wp-admin/edit.php2,125 ▲252.01 ▼0.0239.27 ▲0.8634.45 ▼0.42
Add New Post /wp-admin/post-new.php1,545 ▼023.13 ▲0.08770.03 ▲100.9452.48 ▼7.87
Media Library /wp-admin/upload.php1,422 ▲224.17 ▼0.04116.37 ▲1.1250.00 ▼1.49
Recommended Plugins /wp-admin/admin.php?page=darklooks-recommended-plugin1,2022.0425.6728.14
Settings /wp-admin/admin.php?page=darklooks-setting-admin2,9225.70115.37120.59

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=darklooks-recommended-plugin
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

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
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/darklooks-dark-mode-switcher/darklooks.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Darklooks\\Admin\\Inc\\Controller_Base' not found in wp-content/plugins/darklooks-dark-mode-switcher/admin/tab-templates/Custom_CSS.php:14
    • > PHP Fatal error
      Trait 'Darklooks\\Admin\\Controllers\\Color_Picker' not found in wp-content/plugins/darklooks-dark-mode-switcher/admin/inc/Controller_Base.php on line 14
    • > PHP Fatal error
      Uncaught Error: Class 'Darklooks\\Admin\\Inc\\Controller_Base' not found in wp-content/plugins/darklooks-dark-mode-switcher/admin/tab-templates/Time_Based.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Darklooks\\Admin\\Inc\\Controller_Base' not found in wp-content/plugins/darklooks-dark-mode-switcher/admin/tab-templates/Advance_Setting.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Darklooks\\Admin\\Inc\\Controller_Base' not found in wp-content/plugins/darklooks-dark-mode-switcher/admin/tab-templates/Image_Settings.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Darklooks\\Admin\\Inc\\Controller_Base' not found in wp-content/plugins/darklooks-dark-mode-switcher/admin/tab-templates/Color_Preset.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Darklooks\\Admin\\Inc\\Controller_Base' not found in wp-content/plugins/darklooks-dark-mode-switcher/admin/tab-templates/Switch_Setting.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Darklooks\\Admin\\Inc\\Controller_Base' not found in wp-content/plugins/darklooks-dark-mode-switcher/admin/tab-templates/General_Setting.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found


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: These screenshots lack descriptions #1, #2, #3, #4, #5, #6, #7, #8 in darklooks-dark-mode-switcher/assets to your readme.txt
  • Requires php: Invalid plugin version format
Please take inspiration from this readme.txt

darklooks-dark-mode-switcher/darklooks.php 85% from 13 tests

The principal PHP file in "DarkLooks - Dark Mode Switcher For WordPress" v. 1.0.6 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("darklooks-dark-mode-switcher.php" instead of "darklooks.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
Everything looks great! No dangerous files found in this plugin3,550 lines of code in 70 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity6.69
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.28
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
▷ Abstract classes14.55%
▷ Concrete classes2195.45%
▷ Final classes14.76%
▷ Static methods8856.05%
▷ Public methods13384.71%
▷ Protected methods31.91%
▷ Private methods2113.38%
▷ Named functions150.00%
▷ Anonymous functions150.00%
▷ Global constants787.50%
▷ Class constants112.50%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
24 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/img/icons/switcher11.png1.05KB0.71KB▼ 32.31%
admin/assets/img/icons/color3.png0.90KB0.67KB▼ 25.27%
admin/assets/img/icons/select-arrow.png0.32KB0.24KB▼ 25.08%
admin/assets/img/logo-icon.png0.48KB0.31KB▼ 36.18%
admin/assets/img/full.png2.38KB1.20KB▼ 49.80%