83% wp-switch-util

Code Review | WP Switch Util

WordPress plugin WP Switch Util scored83%from 54 tests.

About plugin

  • Plugin page: wp-switch-util
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.5
  • WordPress version: 6.3.1
  • First release: Aug 31, 2015
  • Latest release: Apr 11, 2018
  • Number of updates: 15
  • Update frequency: every 63.9 days
  • Top authors: yutuo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /994 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.06MB] [CPU: ▼2.38ms] Passed 4 tests

Server-side resources used by WP Switch Util
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0635.37 ▼5.40
Dashboard /wp-admin3.36 ▲0.0645.79 ▼2.54
Posts /wp-admin/edit.php3.48 ▲0.1248.66 ▲0.03
Add New Post /wp-admin/post-new.php5.95 ▲0.0692.17 ▼1.60
Media Library /wp-admin/upload.php3.29 ▲0.0639.24 ▲7.27
Wp Switch Util /wp-admin/options-general.php?page=wpSwitchUtil3.3034.97

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
wp_su_options
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Switch Util
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9413.50 ▼1.111.83 ▼0.3640.05 ▲1.49
Dashboard /wp-admin2,210 ▲254.85 ▼0.97107.55 ▲7.0442.74 ▼1.10
Posts /wp-admin/edit.php2,093 ▲42.06 ▼0.0839.62 ▲3.3235.56 ▼0.97
Add New Post /wp-admin/post-new.php1,536 ▲323.37 ▲0.22636.61 ▼29.2354.00 ▼0.24
Media Library /wp-admin/upload.php1,392 ▲14.18 ▲0.0195.92 ▼0.4242.70 ▲0.51
Wp Switch Util /wp-admin/options-general.php?page=wpSwitchUtil9652.0525.5028.05

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/wp-switch-util/wp_switch_util.php:58
    • > PHP Fatal error
      Uncaught Error: Class 'WPSwitchUtilConfig' not found in wp-content/plugins/wp-switch-util/inc/wp_switch_util_setting.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 86% 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:
  • Plugin Name: Please specify the plugin name on the first line ( === wp-switch-util === )
Please take inspiration from this readme.txt

wp-switch-util/wp_switch_util.php 77% from 13 tests

The principal PHP file in "WP Switch Util" v. 1.2.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Domain Path: The domain path folder was not found ("/wp-switch-util")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-switch-util.php" instead of "wp_switch_util.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin571 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP24755414
PO File1323586
Markdown134071

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity22.50
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.95
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods22
▷ Static methods00.00%
▷ Public methods22100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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 files were detected