89% freesoul-switch-theme

Code Review | Freesoul Switch Theme: load a different theme on specific pages

WordPress plugin Freesoul Switch Theme: load a different theme on specific pages scored89%from 54 tests.

About plugin

  • Plugin page: freesoul-switch-t...
  • Plugin version: 1.0.7
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Jul 1, 2018
  • Latest release: Aug 9, 2023
  • Number of updates: 52
  • Update frequency: every 35.9 days
  • Top authors: giuse (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /3,155 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼3.14ms] Passed 4 tests

Analyzing server-side resources used by Freesoul Switch Theme: load a different theme on specific pages
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.71 ▼5.00
Dashboard /wp-admin3.36 ▲0.0649.05 ▼6.38
Posts /wp-admin/edit.php3.41 ▲0.0551.97 ▼2.69
Add New Post /wp-admin/post-new.php5.96 ▲0.08106.45 ▲14.39
Media Library /wp-admin/upload.php3.28 ▲0.0538.55 ▲1.53

Server storage [IO: ▲0.02MB] [DB: ▲0.01MB] 67% from 3 tests

Filesystem and database footprint
Please fix the following
  • The plugin illegally modified 1 file (2.84KB) outside of "wp-content/plugins/freesoul-switch-theme/" and "wp-content/uploads/"
    • (new file) wp-content/mu-plugins/eos-switch-theme.php
Filesystem: 13 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
eos_themes
widget_recent-posts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Freesoul Switch Theme: load a different theme on specific pages
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▲0.001.89 ▼0.0244.43 ▲1.54
Dashboard /wp-admin2,195 ▲185.65 ▼0.0294.23 ▼0.3140.42 ▼1.82
Posts /wp-admin/edit.php2,103 ▲32.00 ▲0.0039.51 ▼2.9934.58 ▼3.70
Add New Post /wp-admin/post-new.php6,269 ▲4,74325.92 ▲2.81846.22 ▲234.4154.93 ▲4.23
Media Library /wp-admin/upload.php1,397 ▼34.16 ▼0.07106.00 ▲0.7445.86 ▲0.71

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
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Donate link: Invalid url: ""
You can look at the official readme.txt

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

The primary PHP file in "Freesoul Switch Theme: load a different theme on specific pages" version 1.0.7 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Success! There were no dangerous files found in this plugin337 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP71166258
PO File1101253
CSS10019
JavaScript1007

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions1487.50%
▷ Anonymous functions212.50%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.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 images were found in this plugin