73% go-night-pro

Code Review | Go Night Pro | Wordpress Dark Mode Plugin

WordPress plugin Go Night Pro | Wordpress Dark Mode Plugin scored73%from 54 tests.

About plugin

  • Plugin page: go-night-pro
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.6
  • WordPress version: 6.3.1
  • First release: Mar 8, 2021
  • Latest release: Mar 30, 2021
  • Number of updates: 4
  • Update frequency: every 6.5 days
  • Top authors: hrs2015 (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /3,004 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼0.40MB] [CPU: ▼36.57ms] Passed 4 tests

Server-side resources used by Go Night Pro | Wordpress Dark Mode Plugin
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2332.40 ▼11.03
Dashboard /wp-admin3.59 ▲0.2439.21 ▼25.57
Posts /wp-admin/edit.php3.59 ▲0.2330.82 ▼22.76
Add New Post /wp-admin/post-new.php3.59 ▼2.3026.24 ▼82.65
Media Library /wp-admin/upload.php3.59 ▲0.3625.55 ▼15.28

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 93 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Go Night Pro | Wordpress Dark Mode Plugin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,868 ▲10714.39 ▲0.193.08 ▲1.3643.51 ▼1.94
Dashboard /wp-admin2,244 ▲705.65 ▼0.0286.32 ▼2.8638.38 ▼6.63
Posts /wp-admin/edit.php2,145 ▲421.98 ▲0.0336.76 ▼4.3135.41 ▼4.43
Add New Post /wp-admin/post-new.php1,539 ▲1323.30 ▲0.27626.74 ▼50.8265.52 ▲13.66
Media Library /wp-admin/upload.php1,448 ▲454.20 ▼0.0198.08 ▼5.8843.66 ▼1.26

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/go-night-pro/admin/class-go-night-admin.php+248
    include_once(partials/sections/go-night-admin-typography.php): failed to open stream: No such file or directory
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

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 no errors were found, this is by no means an exhaustive test

SRP 50% 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
Please take a closer look at the following
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_setting() in wp-content/plugins/go-night-pro/admin/partials/sections/go-night-admin-advanced.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_setting() in wp-content/plugins/go-night-pro/admin/partials/sections/go-night-admin-customcss.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/go-night-pro/go-night-pro.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_setting() in wp-content/plugins/go-night-pro/admin/partials/sections/go-night-admin-colors.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_setting() in wp-content/plugins/go-night-pro/admin/partials/sections/go-night-admin-general.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_setting() in wp-content/plugins/go-night-pro/admin/partials/sections/go-night-admin-button.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_setting() in wp-content/plugins/go-night-pro/admin/partials/sections/go-night-admin-images.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/go-night-pro/admin/partials/go-night-admin-header.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Too many tags (15 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Contributors: The plugin contributors field is missing
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3, #4, #5, #6, #7, #8 in go-night-pro/assets to your readme.txt
You can look at the official readme.txt

go-night-pro/go-night-pro.php 92% from 13 tests

The primary PHP file in "Go Night Pro | Wordpress Dark Mode Plugin" version 1.1.0 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin27,325 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
SVG441718,197
CSS653672,647
LESS14102,305
PHP185784362,227
Sass211201,227
JavaScript7188109582
PO File16071140

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity18.43
▷ Minimum class complexity1.00
▷ Maximum class complexity110.00
Average method complexity2.97
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods37
▷ Static methods25.41%
▷ Public methods3183.78%
▷ Protected methods00.00%
▷ Private methods616.22%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
12 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/color-palette/color-palette-6.png1.10KB0.22KB▼ 79.82%
admin/img/color-palette/color-palette-5.png1.11KB0.22KB▼ 79.95%
admin/img/color-palette/color-palette-12.png1.10KB0.22KB▼ 79.91%
admin/img/color-palette/color-palette-3.png1.10KB0.22KB▼ 79.91%
admin/img/color-palette/color-palette-11.png1.10KB0.22KB▼ 79.88%