84% wp-night-mode

Code Review | WP Night Mode

WordPress plugin WP Night Mode scored84%from 54 tests.

About plugin

  • Plugin page: wp-night-mode
  • Plugin version: 1.0.6
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.5.3
  • WordPress version: 6.3.1
  • First release: Jun 18, 2018
  • Latest release: Nov 9, 2020
  • Number of updates: 13
  • Update frequency: every 67.6 days
  • Top authors: markoarula (100%)

Code review

54 tests

User reviews

23 reviews

Install metrics

1,000+ active /40,042 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.09MB] [CPU: ▼6.26ms] Passed 4 tests

A check of server-side resources used by WP Night Mode
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1143.07 ▼1.37
Dashboard /wp-admin3.39 ▲0.0551.26 ▼12.26
Posts /wp-admin/edit.php3.51 ▲0.1547.10 ▼2.34
Add New Post /wp-admin/post-new.php5.99 ▲0.1190.67 ▼9.08
Media Library /wp-admin/upload.php3.31 ▲0.0936.12 ▲0.12

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Night Mode
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,907 ▲13613.47 ▼0.8111.62 ▲9.5642.07 ▼3.23
Dashboard /wp-admin2,199 ▲225.62 ▼0.0598.95 ▲6.2944.14 ▼0.68
Posts /wp-admin/edit.php2,104 ▲42.03 ▲0.0832.46 ▼2.2934.43 ▼3.33
Add New Post /wp-admin/post-new.php1,541 ▲1323.16 ▲0.06650.64 ▼20.1576.92 ▲28.44
Media Library /wp-admin/upload.php1,398 ▲14.18 ▲0.0897.94 ▼22.2341.59 ▼8.07

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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 fix the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-night-mode/public/partials/wp-night-mode-public-display.php
    • > /wp-content/plugins/wp-night-mode/admin/partials/wp-night-mode-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
You can take inspiration from this readme.txt

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

The main PHP script in "WP Night Mode" version 1.0.6 is automatically included on every request by WordPress
126 characters long description:
Allow users to change the website style while reading at night, enabling them to easily read and spend more time on your site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected1,386 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
CSS32038849
PHP12185682425
JavaScript2174179
Markdown120033

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity3.43
▷ Minimum class complexity1.00
▷ Maximum class complexity9.00
Average method complexity1.61
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods28
▷ Static methods27.14%
▷ Public methods2382.14%
▷ Protected methods00.00%
▷ Private methods517.86%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin