83% pwd-theme-switcher

Code Review | PWD Theme Switcher

WordPress plugin PWD Theme Switcher scored83%from 54 tests.

About plugin

  • Plugin page: pwd-theme-switcher
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-6.3
  • WordPress version: 6.3.1
  • First release: May 28, 2015
  • Latest release: Aug 24, 2023
  • Number of updates: 13
  • Update frequency: every 233.1 days
  • Top authors: NicolasKulka (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

90+ active /3,339 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.04MB] [CPU: ▼6.98ms] Passed 4 tests

This is a short check of server-side resources used by PWD Theme Switcher
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0738.47 ▼6.86
Dashboard /wp-admin3.35 ▲0.0545.51 ▼5.18
Posts /wp-admin/edit.php3.40 ▲0.0447.86 ▼0.05
Add New Post /wp-admin/post-new.php5.93 ▲0.0479.60 ▼15.82
Media Library /wp-admin/upload.php3.27 ▲0.0445.03 ▲10.33

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

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

Browser metrics Passed 4 tests

A check of browser resources used by PWD Theme Switcher
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,849 ▲11413.64 ▼0.721.68 ▼0.1943.74 ▲1.21
Dashboard /wp-admin2,235 ▲445.87 ▲1.00101.42 ▼2.9239.89 ▼6.88
Posts /wp-admin/edit.php2,115 ▲232.00 ▼0.0539.32 ▲4.3037.38 ▲1.29
Add New Post /wp-admin/post-new.php1,543 ▲2623.36 ▲5.81672.46 ▼9.7953.26 ▲1.68
Media Library /wp-admin/upload.php1,408 ▲234.19 ▼0.0199.71 ▲3.0641.67 ▲0.07

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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 take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/pwd-theme-switcher/pwd-theme-switcher.php

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

pwd-theme-switcher/pwd-theme-switcher.php 85% from 13 tests

The entry point to "PWD Theme Switcher" version 1.2.2 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Domain Path: You should use only dashes and lowercase characters for the domain path ("languages")
  • Domain Path: Prefix the domain path with a forward slash character ("/languages")

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
Success! There were no dangerous files found in this plugin210 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP2256192
PO File2121268
Markdown122050

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity3.50
▷ Minimum method complexity2.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods583.33%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin