58% dracula-dark-mode

Code Review | Dracula Dark Mode - AI-Powered Automatic Dark Mode for WordPress

WordPress plugin Dracula Dark Mode - AI-Powered Automatic Dark Mode for WordPress scored58%from 54 tests.

About plugin

  • Plugin page: dracula-dark-mode
  • Plugin version: 1.0.6
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Jan 23, 2023
  • Latest release: Dec 3, 2023
  • Number of updates: 14
  • Update frequency: every 23.4 days
  • Top authors: princeahmed (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

600+ active /5,359 total downloads

Benchmarks

Plugin footprint 47% 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: ▲5.49MB] [CPU: ▲29.16ms] 75% from 4 tests

This is a short check of server-side resources used by Dracula Dark Mode - AI-Powered Automatic Dark Mode for WordPress
The following require your attention
  • Extra RAM: Extra memory usage must be kept under 5MB (currently 5.49MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.25 ▲5.7864.24 ▲23.18
Dashboard /wp-admin9.27 ▲5.9683.85 ▲34.11
Posts /wp-admin/edit.php9.28 ▲5.9185.50 ▲35.83
Add New Post /wp-admin/post-new.php10.20 ▲4.30118.28 ▲23.52
Media Library /wp-admin/upload.php9.27 ▲6.0478.33 ▲42.61
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius9.2772.95

Server storage [IO: ▲6.75MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 373 new files
Database: 3 new tables, 11 new options
New tables
wp_dracula_toggles
wp_dracula_analytics
wp_dracula_feedbacks
New WordPress options
fs_active_plugins
dracula_version
theysaidso_admin_options
dracula_install_time
fs_debug_mode
db_upgraded
widget_theysaidso_widget
fs_accounts
widget_recent-comments
can_compress_scripts
...

Browser metrics Passed 4 tests

Checking browser requirements for Dracula Dark Mode - AI-Powered Automatic Dark Mode for WordPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,327 ▲56523.50 ▲8.8614.22 ▲12.6127.18 ▼20.30
Dashboard /wp-admin2,481 ▲30412.20 ▲6.55346.05 ▲246.94151.67 ▲110.00
Posts /wp-admin/edit.php2,426 ▲32611.05 ▲9.0598.13 ▲57.14126.21 ▲89.48
Add New Post /wp-admin/post-new.php2,264 ▲72919.23 ▼5.85852.85 ▲245.11105.36 ▲44.54
Media Library /wp-admin/upload.php1,776 ▲37913.58 ▲9.38178.62 ▲77.58155.20 ▲110.83
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,37010.7292.1591.20

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/dracula-dark-mode/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • Zombie tables were found after uninstall: 3 tables
    • wp_dracula_feedbacks
    • wp_dracula_analytics
    • wp_dracula_toggles
  • This plugin did not uninstall successfully, leaving 11 options in the database
    • fs_active_plugins
    • can_compress_scripts
    • dracula_version
    • widget_recent-posts
    • fs_accounts
    • theysaidso_admin_options
    • fs_debug_mode
    • widget_recent-comments
    • dracula_install_time
    • widget_theysaidso_widget
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 8× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/dracula-dark-mode/includes/base.php
    • > /wp-content/plugins/dracula-dark-mode/elementor/class-elementor-settings.php
    • > /wp-content/plugins/dracula-dark-mode/includes/class-hooks.php
    • > /wp-content/plugins/dracula-dark-mode/includes/class-shortcode.php
    • > /wp-content/plugins/dracula-dark-mode/plugin.php
    • > /wp-content/plugins/dracula-dark-mode/includes/views/getting-started/basic-usage.php
    • > /wp-content/plugins/dracula-dark-mode/includes/functions.php
    • > /wp-content/plugins/dracula-dark-mode/includes/class-enqueue.php
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/dracula-dark-mode/includes/views/getting-started/introduction.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/dracula-dark-mode/includes/views/getting-started/help.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/dracula-dark-mode/includes/views/getting-started/get-pro.php:5

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
6 plugin tags: night mode, wp dark mode, dark mode, accessibility, dark...

dracula-dark-mode/plugin.php 92% from 13 tests

The entry point to "Dracula Dark Mode - AI-Powered Automatic Dark Mode for WordPress" version 1.0.6 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("dracula-dark-mode.php" instead of "plugin.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected39,072 lines of code in 299 files:
LanguageFilesBlank linesComment linesLines of code
PHP1438,84117,54637,160
SVG121011,658
JavaScript123465203
JSON10029
CSS220022

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
The following items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity70.27
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.41
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes66
▷ Abstract classes23.03%
▷ Concrete classes6496.97%
▷ Final classes11.56%
Methods1,391
▷ Static methods21715.60%
▷ Public methods99071.17%
▷ Protected methods171.22%
▷ Private methods38427.61%
Functions121
▷ Named functions12099.17%
▷ Anonymous functions10.83%
Constants151
▷ Global constants10468.87%
▷ Class constants4731.13%
▷ Public constants47100.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
29 compressed PNG files occupy 0.52MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/getting-started/facebook-banner.png6.55KB6.70KB0.00%
assets/images/toggles/toggle8/light-bg.png17.94KB19.07KB0.00%
assets/images/getting-started/bg-shapes.png65.15KB72.80KB0.00%
assets/images/getting-started/editor-compatibility.png20.31KB21.88KB0.00%
assets/images/toggles/toggle10/light-bg.png5.26KB5.62KB0.00%