78% darkmysite

Code Review | DarkMySite - Advanced Dark Mode Plugin for WordPress

WordPress plugin DarkMySite - Advanced Dark Mode Plugin for WordPress scored78%from 54 tests.

About plugin

  • Plugin page: darkmysite
  • Plugin version: 1.2.6
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Nov 16, 2022
  • Latest release: Jun 1, 2023
  • Number of updates: 30
  • Update frequency: every 6.6 days
  • Top authors: darkmysite (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active /104,335 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▼9.57ms] Passed 4 tests

Analyzing server-side resources used by DarkMySite - Advanced Dark Mode Plugin for WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2143.80 ▲1.09
Dashboard /wp-admin3.50 ▲0.1553.48 ▼15.23
Posts /wp-admin/edit.php3.61 ▲0.2547.99 ▼9.95
Add New Post /wp-admin/post-new.php6.10 ▲0.2195.77 ▼14.19
Media Library /wp-admin/upload.php3.42 ▲0.1943.81 ▲7.16

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

Filesystem and database footprint
Please fix the following
  • Illegal file modification detected: 1 file (4.00KB) outside of "wp-content/plugins/darkmysite/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 77 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
darkmysite_activation_date
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
darkmysite_settings
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

DarkMySite - Advanced Dark Mode Plugin for WordPress: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,928 ▲16713.24 ▼1.015.28 ▲3.6443.37 ▲1.62
Dashboard /wp-admin2,273 ▲705.88 ▲0.07110.04 ▲6.0283.10 ▲36.77
Posts /wp-admin/edit.php2,164 ▲642.09 ▲0.0634.71 ▼6.5837.68 ▲0.44
Add New Post /wp-admin/post-new.php1,750 ▲21922.48 ▼0.70641.37 ▲17.4263.07 ▲7.91
Media Library /wp-admin/upload.php1,461 ▲644.29 ▲0.0999.33 ▲3.7377.11 ▲32.04

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 8 options
    • darkmysite_settings
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • darkmysite_activation_date
    • 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
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/darkmysite/backend/templates/views/sidebar.php
  • 15× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/darkmysite/backend/templates/views/media.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/darkmysite/frontend/templates/header_script.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/darkmysite/backend/api/update_settings.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/darkmysite/backend/templates/views/admin.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/darkmysite/backend/templates/views/switch.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/darkmysite/backend/templates/views/advanced.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/darkmysite/frontend/templates/views/switch.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/darkmysite/backend/templates/views/preset.php:6
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/darkmysite/backend/templates/dashboard.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/darkmysite/backend/templates/views/video.php:6

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 is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: dark, dark theme, night mode, dark mode, wordpress dark mode

darkmysite/darkmysite.php 92% from 13 tests

The main file in "DarkMySite - Advanced Dark Mode Plugin for WordPress" v. 1.2.6 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected4,389 lines of code in 59 files:
LanguageFilesBlank linesComment linesLines of code
PHP26446642,224
CSS2110761,547
JavaScript24311386
SVG2900232

PHP code Passed 2 tests

This is a short overview 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.79
Average class complexity17.38
▷ Minimum class complexity1.00
▷ Maximum class complexity83.00
Average method complexity4.12
▷ Minimum method complexity1.00
▷ Maximum method complexity71.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods42
▷ Static methods00.00%
▷ Public methods42100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.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
15 compressed PNG files occupy 0.16MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/preset/orange.png23.88KB24.80KB0.00%
assets/img/switch/switch_durian.png4.40KB4.64KB0.00%
assets/img/preset/black.png22.60KB23.68KB0.00%
assets/img/preset/blue.png24.89KB25.66KB0.00%
assets/img/switch/switch_fazli.png2.50KB2.56KB0.00%