68% unreal-themes-switching

Code Review | Unreal Themes switching

WordPress plugin Unreal Themes switching scored68%from 54 tests.

About plugin

  • Plugin page: unreal-themes-swi...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.0-5.3.2
  • WordPress version: 6.3.1
  • First release: May 10, 2018
  • Latest release: Jan 1, 2020
  • Number of updates: 3
  • Update frequency: every 200.4 days
  • Top authors: romchyk16 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /692 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▼1.48MB] [CPU: ▼54.03ms] Passed 4 tests

Server-side resources used by Unreal Themes switching
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.50 ▼0.9614.92 ▼29.62
Dashboard /wp-admin2.52 ▼0.789.42 ▼45.44
Posts /wp-admin/edit.php2.52 ▼0.839.07 ▼45.26
Add New Post /wp-admin/post-new.php2.52 ▼3.368.91 ▼94.81
Media Library /wp-admin/upload.php2.52 ▼0.718.06 ▼30.61
Themes Switching /wp-admin/options-general.php?page=themes_switching2.528.33

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Unreal Themes switching
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲714.72 ▲0.061.79 ▼0.4344.37 ▼0.25
Dashboard /wp-admin2,199 ▲225.75 ▲0.1684.78 ▼12.8437.18 ▼3.55
Posts /wp-admin/edit.php2,104 ▲12.12 ▲0.0936.85 ▲2.9431.35 ▼7.90
Add New Post /wp-admin/post-new.php1,540 ▲1218.36 ▼4.65619.84 ▼64.1381.19 ▲22.40
Media Library /wp-admin/upload.php1,401 ▲44.15 ▼0.0399.21 ▼2.7946.97 ▲5.72
Themes Switching /wp-admin/options-general.php?page=themes_switching8782.0025.0827.97

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
Please fix the following items
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/unreal-themes-switching/functions.php+19
    Trying to access array offset on value of type bool
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

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 server-side errors were triggered
  • 166 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=themes_switching
    • > Notice in wp-content/plugins/unreal-themes-switching/functions.php+20
    Trying to access array offset on value of type bool

SRP 50% from 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
Please fix the following
  • 3× 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/unreal-themes-switching/settings.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/unreal-themes-switching/settings.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/unreal-themes-switching/functions.php:6

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

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: There are too many tags (19 tag instead of maximum 10)
You can take inspiration from this readme.txt

unreal-themes-switching/unreal-themes-switching.php 92% from 13 tests

The entry point to "Unreal Themes switching" version 1.2 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 352 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected790 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP554686790

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.75
Average class complexity134.00
▷ Minimum class complexity134.00
▷ Maximum class complexity134.00
Average method complexity4.69
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods36
▷ Static methods925.00%
▷ Public methods3391.67%
▷ Protected methods25.56%
▷ Private methods12.78%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants00.00%
▷ Class constants9100.00%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin