89% night-eye

Code Review | Night Eye - Dark Mode Plugin

WordPress plugin Night Eye - Dark Mode Plugin scored89%from 54 tests.

About plugin

  • Plugin page: night-eye
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9
  • WordPress version: 6.3.1
  • First release: Feb 8, 2021
  • Latest release: Apr 14, 2022
  • Number of updates: 10
  • Update frequency: every 43.4 days
  • Top authors: nighteye (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

100+ active /5,164 total downloads

Benchmarks

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

Analyzing server-side resources used by Night Eye - Dark Mode Plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1142.23 ▲1.16
Dashboard /wp-admin3.42 ▲0.0748.39 ▼12.75
Posts /wp-admin/edit.php3.53 ▲0.1850.79 ▼1.38
Add New Post /wp-admin/post-new.php3.29 ▼2.5936.23 ▼58.78
Media Library /wp-admin/upload.php3.34 ▲0.1137.37 ▼0.00

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Night Eye - Dark Mode Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,875 ▲12914.03 ▼0.3238.44 ▲36.8743.82 ▲5.03
Dashboard /wp-admin2,235 ▲555.58 ▼0.0884.40 ▼3.7536.92 ▼3.95
Posts /wp-admin/edit.php2,143 ▲432.03 ▲0.0438.42 ▼1.7536.67 ▲0.11
Add New Post /wp-admin/post-new.php1,544 ▲1623.11 ▼0.24675.17 ▼34.8152.34 ▼7.16
Media Library /wp-admin/upload.php1,443 ▲434.24 ▲0.07103.26 ▼0.7445.76 ▼1.30

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests Passed 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 Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Contributors: Contributors not specified
  • Tags: There are too many tags (11 tag instead of maximum 10)
You can take inspiration from this readme.txt

night-eye/night-eye.php 92% from 13 tests

The main PHP file in "Night Eye - Dark Mode Plugin" ver. 1.0.2 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 150 characters long)

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
Success! There were no dangerous files found in this plugin46,957 lines of code in 67 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2711,0564,56645,220
PHP303462591,005
CSS61409704
JSON30017
Markdown15011

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity5.00
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.19
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces16
Interfaces0
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes00.00%
Methods78
▷ Static methods4557.69%
▷ Public methods7798.72%
▷ Protected methods00.00%
▷ Private methods11.28%
Functions6
▷ Named functions116.67%
▷ Anonymous functions583.33%
Constants24
▷ Global constants14.17%
▷ Class constants2395.83%
▷ Public constants1982.61%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected