10% style-switcher

Code Review | Style Switcher

WordPress plugin Style Switcher scored10%from 54 tests.

About plugin

  • Plugin page: style-switcher
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.5-4.9.5
  • WordPress version: 6.3.1
  • First release: Apr 19, 2018
  • Latest release: May 18, 2018
  • Number of updates: 4
  • Update frequency: every 7.3 days
  • Top authors: nextiteration (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /718 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/style-switcher/core/StyleSwitcher.class.php+22
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.87MB] [CPU: ▼52.69ms] Passed 4 tests

An overview of server-side resources used by Style Switcher
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.11 ▼1.356.79 ▼33.51
Dashboard /wp-admin2.13 ▼1.177.77 ▼45.91
Posts /wp-admin/edit.php2.13 ▼1.228.87 ▼37.34
Add New Post /wp-admin/post-new.php2.13 ▼3.757.90 ▼93.98
Media Library /wp-admin/upload.php2.13 ▼1.096.11 ▼30.84
Style Switcher Options /wp-admin/options-general.php?page=style-switcher-options2.148.26

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Style Switcher
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,887 ▲14113.58 ▼1.169.41 ▲7.4743.06 ▼2.51
Dashboard /wp-admin2,213 ▲255.02 ▼0.85101.91 ▼20.2040.48 ▼7.28
Posts /wp-admin/edit.php2,090 ▲11.99 ▼0.0638.60 ▲1.7434.96 ▼0.30
Add New Post /wp-admin/post-new.php1,414 ▼10717.90 ▼5.42595.19 ▼70.1846.85 ▼16.20
Media Library /wp-admin/upload.php1,395 ▲74.22 ▲0.0998.82 ▼10.3747.22 ▲0.50
Style Switcher Options /wp-admin/options-general.php?page=style-switcher-options7912.0824.9227.31

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/style-switcher/core/StyleSwitcher.class.php+22
    Trying to access array offset on value of type bool
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=style-switcher-options
    • > Notice in wp-content/plugins/style-switcher/core/StyleSwitcherSettings.class.php+93
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/options-general.php?page=style-switcher-options
    • > Warning in wp-content/plugins/style-switcher/core/StyleSwitcherSettings.class.php+93
    sizeof(): Parameter must be an array or an object that implements Countable

SRP 0% 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 fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/style-switcher/style-switcher.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'StyleSwitcher\\StyleSwitcherConstants' not found in wp-content/plugins/style-switcher/core/StyleSwitcherSettings.class.php:279

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

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
4 plugin tags: developers, themes, styles, testing

style-switcher/style-switcher.php Passed 13 tests

"Style Switcher" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
52 characters long description:
Plugin to provide interfaces for client theme tweaks

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected533 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP512817391
JavaScript215190
CSS218052

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity10.75
▷ Minimum class complexity1.00
▷ Maximum class complexity28.00
Average method complexity2.56
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods2392.00%
▷ Protected methods00.00%
▷ Private methods28.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants250.00%
▷ Class constants250.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected