90% theme-switcha

Code Review | Theme Switcha – Easily Switch Themes for Development and Testing

WordPress plugin Theme Switcha – Easily Switch Themes for Development and Testing scored90%from 54 tests.

About plugin

  • Plugin page: theme-switcha
  • Plugin version: 3.3.2
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Sep 23, 2016
  • Latest release: Oct 26, 2023
  • Number of updates: 34
  • Update frequency: every 76.2 days
  • Top authors: specialk (100%)

Code review

54 tests

User reviews

56 reviews

Install metrics

5,000+ active /143,902 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.23MB] [CPU: ▼4.25ms] Passed 4 tests

Analyzing server-side resources used by Theme Switcha – Easily Switch Themes for Development and Testing
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2337.58 ▲1.90
Dashboard /wp-admin3.55 ▲0.2045.34 ▼12.20
Posts /wp-admin/edit.php3.66 ▲0.3050.68 ▲5.66
Add New Post /wp-admin/post-new.php6.13 ▲0.2486.79 ▼3.54
Media Library /wp-admin/upload.php3.47 ▲0.2434.14 ▼3.17
Theme Switcha /wp-admin/options-general.php?page=theme_switcha_settings3.4431.86

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Theme Switcha – Easily Switch Themes for Development and Testing
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.33 ▼0.231.68 ▼0.0242.47 ▲2.21
Dashboard /wp-admin2,196 ▲195.51 ▼0.1091.16 ▲4.3440.30 ▲1.14
Posts /wp-admin/edit.php2,104 ▲41.98 ▲0.0139.12 ▼2.2235.14 ▼5.18
Add New Post /wp-admin/post-new.php1,537 ▲918.23 ▼4.92616.69 ▼76.7770.29 ▲10.12
Media Library /wp-admin/upload.php1,404 ▲14.16 ▼0.0292.92 ▼7.4540.83 ▼1.93
Theme Switcha /wp-admin/options-general.php?page=theme_switcha_settings9552.0135.2441.83

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
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
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:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
The official readme.txt is a good inspiration

theme-switcha/theme-switcha.php Passed 13 tests

The primary PHP file in "Theme Switcha – Easily Switch Themes for Development and Testing" version 3.3.2 is used by WordPress to initiate all plugin functionality
27 characters long description:
Theme switching done right.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin1,572 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP758646773
SVG100685
CSS221686
JavaScript14128

PHP code Passed 2 tests

Analyzing 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 complexity23.00
▷ Minimum class complexity23.00
▷ Maximum class complexity23.00
Average method complexity2.83
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods12
▷ Static methods216.67%
▷ Public methods1083.33%
▷ Protected methods00.00%
▷ Private methods216.67%
Functions51
▷ Named functions51100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/screenshot.png11.31KB5.25KB▼ 53.56%