78% wp-user-stylesheet-switcher

Code Review | WP User Stylesheet Switcher

WordPress plugin WP User Stylesheet Switcher scored78%from 54 tests.

About plugin

  • Plugin page: wp-user-styleshee...
  • Plugin version: v2.2.0...
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.6.1
  • WordPress version: 6.3.1
  • First release: Oct 22, 2013
  • Latest release: Oct 16, 2016
  • Number of updates: 55
  • Update frequency: every 19.8 days
  • Top authors: vgstef (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

300+ active /9,053 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.17MB] [CPU: ▼8.71ms] Passed 4 tests

A check of server-side resources used by WP User Stylesheet Switcher
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1844.96 ▼2.79
Dashboard /wp-admin3.47 ▲0.1352.99 ▼12.66
Posts /wp-admin/edit.php3.59 ▲0.2349.23 ▼4.64
Add New Post /wp-admin/post-new.php6.07 ▲0.1989.40 ▼14.76
Media Library /wp-admin/upload.php3.40 ▲0.1737.47 ▼0.00
WP User Stylesheet Switcher /wp-admin/options-general.php?page=wp_user_stylesheet_switcher3.3432.97

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 16 new files
Database: no new tables, 8 new options
New WordPress options
widget_wp_user_stylesheet_switcher_widgets
wp_user_stylesheet_switcher_settings
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for WP User Stylesheet Switcher
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,880 ▲9413.72 ▼1.059.74 ▲7.7941.59 ▲0.41
Dashboard /wp-admin2,198 ▲185.59 ▼0.0784.43 ▼18.1036.57 ▼6.79
Posts /wp-admin/edit.php2,106 ▲62.02 ▲0.0138.41 ▲1.3133.13 ▼1.77
Add New Post /wp-admin/post-new.php1,531 ▼917.66 ▼0.52662.68 ▲10.4161.79 ▲10.12
Media Library /wp-admin/upload.php1,409 ▲94.29 ▲0.0797.68 ▼9.7244.87 ▼1.01
WP User Stylesheet Switcher /wp-admin/options-general.php?page=wp_user_stylesheet_switcher1,1202.0523.6432.36

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=wp_user_stylesheet_switcher
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=wp_user_stylesheet_switcher
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
Please take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-user-stylesheet-switcher/wp_user_stylesheet_switcher.php:776

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 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: stylesheet, css, accessibility, multisite, customize

wp-user-stylesheet-switcher/wp_user_stylesheet_switcher.php 85% from 13 tests

The main file in "WP User Stylesheet Switcher" v. v2.2.0... serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Version: Use periods and digits only for your plugin's version number (ex. "1.0.3" instead of "v2.2.0...")
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-user-stylesheet-switcher.php" instead of "wp_user_stylesheet_switcher.php")

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 plugin1,264 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP2136113682
PO File3135137398
JavaScript53619184

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity82.50
▷ Minimum class complexity20.00
▷ Maximum class complexity145.00
Average method complexity9.15
▷ Minimum method complexity1.00
▷ Maximum method complexity54.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
PNG images were not found in this plugin