78% wp-safe-mode

Code Review | WP Safe Mode

WordPress plugin WP Safe Mode scored78%from 54 tests.

About plugin

  • Plugin page: wp-safe-mode
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.1
  • WordPress version: 6.3.1
  • First release: Sep 25, 2018
  • Latest release: Nov 1, 2022
  • Number of updates: 22
  • Update frequency: every 68.3 days
  • Top authors: netweblogic (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

2,000+ active /14,584 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.26MB] [CPU: ▼2.90ms] Passed 4 tests

Analyzing server-side resources used by WP Safe Mode
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1542.61 ▼3.03
Dashboard /wp-admin3.60 ▲0.2950.99 ▼7.26
Posts /wp-admin/edit.php3.72 ▲0.3653.28 ▲1.33
Add New Post /wp-admin/post-new.php6.18 ▲0.2991.70 ▼2.63
Media Library /wp-admin/upload.php3.53 ▲0.2943.12 ▲7.51

Server storage [IO: ▲0.60MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Just a few items left to fix
  • There were 2 files (4.83KB) illegally modified outside of "wp-content/plugins/wp-safe-mode/" and "wp-content/uploads/"
    • (modified) wp-config.php
    • (new file) wp-content/wp-safe-mode/wp-safe-mode-bootstrap.php
Filesystem: 68 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by WP Safe Mode
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,876 ▲11514.69 ▲0.431.89 ▼0.4845.15 ▼0.03
Dashboard /wp-admin2,234 ▲605.62 ▲0.1089.67 ▼6.0042.76 ▼1.13
Posts /wp-admin/edit.php2,142 ▲422.00 ▲0.0038.80 ▲1.1336.11 ▼0.57
Add New Post /wp-admin/post-new.php1,556 ▲2823.09 ▼0.08689.59 ▲12.0064.96 ▲8.24
Media Library /wp-admin/upload.php1,442 ▲424.17 ▼0.08102.28 ▼6.4742.91 ▼3.01

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-safe-mode/wp-safe-mode-test.php
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-safe-mode/wp-safe-mode-admin.php on line 14
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-safe-mode/wp-safe-mode-admin.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_multisite() in wp-content/plugins/wp-safe-mode/wp-safe-mode-loader.php:175
    • > PHP Warning
      Use of undefined constant NONCE_SALT - assumed 'NONCE_SALT' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-safe-mode/wp-safe-mode-loader.php on line 161
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-safe-mode/wp-safe-mode-admin.php on line 16
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-safe-mode/wp-safe-mode-admin.php on line 16
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-safe-mode/bootstrap/wp-safe-mode-bootstrap.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/wp-safe-mode/wp-safe-mode.php:35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-safe-mode/wp-safe-mode-admin.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
6 plugin tags: debug, debugging, recovery, troubleshooting, safe mode...

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

"WP Safe Mode" version 1.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
90 characters long description:
Safe mode for debugging WordPress issues, without destroying your site for other visitors.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected11,210 lines of code in 67 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript592,4646959,414
PHP5843791,331
CSS3580465

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.69
Average class complexity186.50
▷ Minimum class complexity171.00
▷ Maximum class complexity202.00
Average method complexity9.63
▷ Minimum method complexity1.00
▷ Maximum method complexity66.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods43
▷ Static methods43100.00%
▷ Public methods4195.35%
▷ Protected methods00.00%
▷ Private methods24.65%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin