84% wp-killswitch

Code Review | WP Killswitch

WordPress plugin WP Killswitch scored84%from 54 tests.

About plugin

  • Plugin page: wp-killswitch
  • Plugin version: 0.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.7.2
  • WordPress version: 6.3.1
  • First release: Jan 10, 2015
  • Latest release: Jun 4, 2021
  • Number of updates: 9
  • Update frequency: every 261.1 days
  • Top authors: graphicscove (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active /1,488 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.68MB] [CPU: ▼128.10ms] Passed 4 tests

An overview of server-side resources used by WP Killswitch
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0244.68 ▼9.18
Dashboard /wp-admin3.33 ▼0.0653.07 ▼433.53
Posts /wp-admin/edit.php3.38 ▲0.0254.01 ▼5.04
Add New Post /wp-admin/post-new.php3.20 ▼2.6938.64 ▼64.66
Media Library /wp-admin/upload.php3.25 ▲0.0240.48 ▼0.72

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by WP Killswitch
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,750 ▼2114.24 ▼0.401.90 ▼0.230.09 ▼40.94
Dashboard /wp-admin2,198 ▲335.65 ▼0.0193.27 ▲2.2242.68 ▲4.43
Posts /wp-admin/edit.php2,107 ▲181.98 ▼0.0240.05 ▲1.1637.65 ▲2.17
Add New Post /wp-admin/post-new.php1,532 ▲623.05 ▼0.54673.95 ▼12.4661.48 ▲5.99
Media Library /wp-admin/upload.php1,409 ▲124.21 ▲0.0197.18 ▼27.7248.32 ▼4.05

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-killswitch/inc/frontend.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-killswitch/inc/admin-notice.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-killswitch/api/remote.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-killswitch/inc/hide-plugin.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-killswitch/wp-killswitch.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-killswitch/inc/local-killswitch.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% 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 require attention:
  • Screenshots: Please add images for these screenshots: #1 (What the user sees on the front end), #2 (The warning message displayed in the admin)
The official readme.txt might help

wp-killswitch/wp-killswitch.php Passed 13 tests

The main PHP file in "WP Killswitch" ver. 0.1.1 adds more information about the plugin and also serves as the entry point for this plugin
71 characters long description:
WP Killswitch lets you non-destructively white out a Wordpress website.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected97 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP791597

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions685.71%
▷ Anonymous functions114.29%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.13MB with 0.07MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png41.80KB18.95KB▼ 54.67%
screenshot-2.png91.53KB37.58KB▼ 58.94%