83% blackwebsite-wp-dark-mode

Code Review | BlackWebsite Wp Dark Mode

WordPress plugin BlackWebsite Wp Dark Mode scored 83% from 54 tests.

About plugin

  • Plugin page: blackwebsite-wp-d...
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.7
  • WordPress version: 6.3.1
  • First release: Apr 28, 2021
  • Latest release: Apr 29, 2021
  • Number of updates: 7
  • Update frequency: every 0.3 days
  • Top authors: raihancse (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 674 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼8.65ms] Passed 4 tests

Analyzing server-side resources used by BlackWebsite Wp Dark Mode
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.39 ▼0.0723.70 ▼19.82
Dashboard /wp-admin3.35 ▲0.0446.37 ▼5.48
Posts /wp-admin/edit.php3.40 ▲0.0447.46 ▲1.47
Add New Post /wp-admin/post-new.php5.93 ▲0.0493.56 ▼10.75
Media Library /wp-admin/upload.php3.27 ▲0.0436.75 ▲1.90

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

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

Browser metrics Passed 4 tests

A check of browser resources used by BlackWebsite Wp Dark Mode
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲10313.18 ▼1.203.47 ▲1.6849.59 ▼2.21
Dashboard /wp-admin2,227 ▲394.89 ▼0.2199.25 ▼2.5540.09 ▼3.67
Posts /wp-admin/edit.php2,107 ▲182.05 ▲0.0440.23 ▲3.3837.32 ▼0.27
Add New Post /wp-admin/post-new.php1,553 ▲3218.33 ▼5.04600.55 ▲6.9661.19 ▲15.15
Media Library /wp-admin/upload.php1,409 ▲184.23 ▲0.0297.06 ▼0.3741.76 ▼5.65

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 43× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/blackwebsite-wp-dark-mode/plugin.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_setting() in wp-content/plugins/blackwebsite-wp-dark-mode/inc/predefine-setting.php:2
    • > PHP Notice
      Undefined variable: blackwebsite_bottom in wp-content/plugins/blackwebsite-wp-dark-mode/inc/button-position/left-button.php on line 4
    • > PHP Notice
      Undefined variable: blackwebsite_match_os in wp-content/plugins/blackwebsite-wp-dark-mode/inc/button-position/left-button.php on line 11
    • > PHP Notice
      Undefined variable: blackwebsite_widget_options in wp-content/plugins/blackwebsite-wp-dark-mode/inc/button-position/right-button.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/blackwebsite-wp-dark-mode/inc/button-position/defult-button.php on line 9
    • > PHP Notice
      Undefined variable: blackwebsite_right in wp-content/plugins/blackwebsite-wp-dark-mode/inc/button-position/defult-button.php on line 19
    • > PHP Notice
      Undefined variable: blackwebsite_bottom in wp-content/plugins/blackwebsite-wp-dark-mode/inc/button-position/left-button.php on line 20
    • > PHP Notice
      Undefined variable: blackwebsite_cookies in wp-content/plugins/blackwebsite-wp-dark-mode/inc/button-position/right-button.php on line 10
    • > PHP Notice
      Undefined variable: blackwebsite_left in wp-content/plugins/blackwebsite-wp-dark-mode/inc/button-position/left-button.php on line 22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% 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
These attributes need your attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === blackwebsite-wp-dark-mode === )
You can look at the official readme.txt

blackwebsite-wp-dark-mode/plugin.php 85% from 13 tests

The main PHP script in "BlackWebsite Wp Dark Mode" version 1.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("blackwebsite-wp-dark-mode.php" instead of "plugin.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin704 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP87730542
JavaScript14296
CSS22066

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity40.00
▷ Minimum class complexity40.00
▷ Maximum class complexity40.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods26
▷ Static methods00.00%
▷ Public methods26100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin