10% switch-theme

Code Review | Switch Theme

WordPress plugin Switch Theme scored 10% from 54 tests.

About plugin

  • Plugin page: switch-theme
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.3
  • WordPress version: 6.3.1
  • First release: May 3, 2011
  • Latest release: Aug 20, 2015
  • Number of updates: 9
  • Update frequency: every 174.4 days
  • Top authors: unknowndomain (66.67%)ctsttom (44.44%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 4,977 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • This plugin did not install gracefully
    • > Parse error in wp-content/plugins/switch-theme/switch-theme.php+139
    syntax error, unexpected end of file

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.54ms] Passed 4 tests

This is a short check of server-side resources used by Switch Theme
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0043.34 ▲1.12
Dashboard /wp-admin3.31 ▲0.0043.36 ▼5.13
Posts /wp-admin/edit.php3.36 ▲0.0045.38 ▼2.49
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.29 ▼15.64
Media Library /wp-admin/upload.php3.23 ▲0.0039.22 ▲6.15

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Switch Theme: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.34 ▼1.051.73 ▼0.0539.90 ▼1.03
Dashboard /wp-admin2,203 ▲185.76 ▼0.1097.33 ▼0.9337.07 ▼9.73
Posts /wp-admin/edit.php2,089 ▼32.00 ▼0.0539.94 ▼3.3435.17 ▼2.94
Add New Post /wp-admin/post-new.php1,542 ▲818.23 ▼4.98589.90 ▼9.7858.24 ▲3.78
Media Library /wp-admin/upload.php1,388 ▲64.20 ▼0.0393.97 ▼10.1941.18 ▼2.58

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Parse error
      syntax error, unexpected end of file in wp-content/plugins/switch-theme/switch-theme.php on line 139

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (From this panel you can choose from a list of themes and switch your entire network to that theme.), #2 (You will find the `Switch Theme` panel under the `Themes` menu in the WordPress Network Admin.)
  • Plugin Name: You should set the name of your plugin on the first line ( === switch-theme === )
You can look at the official readme.txt

switch-theme/switch-theme.php 92% from 13 tests

Analyzing the main PHP file in "Switch Theme" version 1.0
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 145 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin91 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1272191

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png27.37KB8.36KB▼ 69.45%
screenshot-2.png11.00KB2.75KB▼ 74.97%