78% night-mode

Code Review | Night Mode

WordPress plugin Night Mode scored78%from 54 tests.

About plugin

  • Plugin page: night-mode
  • Plugin version: 1.5.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1.1
  • WordPress version: 6.3.1
  • First release: Nov 6, 2018
  • Latest release: Jan 18, 2023
  • Number of updates: 25
  • Update frequency: every 61.4 days
  • Top authors: kabeers011 (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

90+ active /4,093 total downloads

Benchmarks

Plugin footprint 83% 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.01MB] [CPU: ▼8.41ms] Passed 4 tests

This is a short check of server-side resources used by Night Mode
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0042.25 ▼0.46
Dashboard /wp-admin3.31 ▲0.0149.40 ▼8.09
Posts /wp-admin/edit.php3.36 ▲0.0150.94 ▼0.87
Add New Post /wp-admin/post-new.php5.91 ▲0.0288.02 ▼24.20
Media Library /wp-admin/upload.php3.23 ▲0.0039.98 ▲0.87
Night Mode /wp-admin/options-general.php?page=admin-custom-color3.1835.78

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Night Mode
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲3014.36 ▼0.281.63 ▼0.6442.33 ▼4.16
Dashboard /wp-admin2,180 ▼05.60 ▼0.0789.01 ▼10.1042.51 ▼9.27
Posts /wp-admin/edit.php2,100 ▼02.03 ▲0.0038.24 ▲4.6036.23 ▼3.88
Add New Post /wp-admin/post-new.php1,535 ▲923.70 ▲0.79681.67 ▼55.6158.98 ▲3.05
Media Library /wp-admin/upload.php1,388 ▼124.18 ▲0.0595.22 ▼21.9043.92 ▼10.05
Night Mode /wp-admin/options-general.php?page=admin-custom-color8491.8427.5123.85

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=admin-custom-color
    • > Notice in wp-content/plugins/night-mode/change_color.php+41
    Trying to access array offset on value of type bool

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 take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/night-mode/night-mode.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
These attributes need your attention:
  • Screenshots: Please add descriptions for these screenshots #3, #4 in night-mode/assets to your readme.txt
You can take inspiration from this readme.txt

night-mode/night-mode.php Passed 13 tests

The main PHP file in "Night Mode" ver. 1.5.0 adds more information about the plugin and also serves as the entry point for this plugin
49 characters long description:
This is for change the admin end color with text.

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 detected2,341 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript25881742,258
PHP3171383

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity3.67
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
There are no PNG files in this plugin