94% dark-mode-for-twenty-nineteen

Code Review | Dark Mode for Twenty Nineteen

WordPress plugin Dark Mode for Twenty Nineteen scored 94% from 53 tests.

About plugin

  • Plugin page: dark-mode-for-twe...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.2.3
  • WordPress version: 5.8.1
  • First release: Sep 28, 2019
  • Latest release: Jan 14, 2021
  • Number of updates: 8
  • Update frequency: every 59.3 days
  • Top authors: MarcDK (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 807 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼276.75ms] Passed 4 tests

A check of server-side resources used by Dark Mode for Twenty Nineteen
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1229.15 ▲7.26
Dashboard /wp-admin3.06 ▲0.0142.31 ▲1.70
Posts /wp-admin/edit.php3.11 ▲0.0141.67 ▲1.67
Add New Post /wp-admin/post-new.php5.42 ▼0.0193.40 ▼1,104.63
Media Library /wp-admin/upload.php3.00 ▼0.0032.38 ▼5.75

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 3 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Dark Mode for Twenty Nineteen
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,676 ▲9415.85 ▲0.257.89 ▼1.9946.07 ▼3.35
Dashboard /wp-admin2,928 ▲765.88 ▲0.01135.69 ▼3.28105.20 ▼6.24
Posts /wp-admin/edit.php2,706 ▼02.69 ▼0.0167.35 ▲1.8489.07 ▲0.44
Add New Post /wp-admin/post-new.php1,653 ▲218.65 ▲1.23359.89 ▼8.66109.15 ▼0.15
Media Library /wp-admin/upload.php1,772 ▼05.02 ▲0.00137.72 ▼8.95118.71 ▲0.53

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dark-mode-for-twenty-nineteen/dark-mode-twenty-nineteen.php:13

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

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: dark mode, darkmode, twentynineteen

dark-mode-for-twenty-nineteen/dark-mode-twenty-nineteen.php 92% from 13 tests

The primary PHP file in "Dark Mode for Twenty Nineteen" version 1.2 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("dark-mode-for-twenty-nineteen.php" instead of "dark-mode-twenty-nineteen.php")

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 detected130 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
CSS1182124
PHP1396

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.00
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin