89% device-theme-switcher

Code Review | Plugin Name: Device Theme Switcher

WordPress plugin Plugin Name: Device Theme Switcherscored89%from 54 tests.

About plugin

  • Plugin page: device-theme-swit...
  • Plugin version: 3.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.7.1
  • WordPress version: 6.3.1
  • First release: Dec 23, 2011
  • Latest release: Jan 24, 2017
  • Number of updates: 64
  • Update frequency: every 29.1 days
  • Top authors: jamesmehorter (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

1,000+ active /64,698 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▼2.70ms] Passed 4 tests

Analyzing server-side resources used by Plugin Name: Device Theme Switcher
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.87 ▲0.4149.42 ▼0.01
Dashboard /wp-admin3.49 ▲0.1847.09 ▼0.09
Posts /wp-admin/edit.php3.60 ▲0.2451.47 ▲5.36
Add New Post /wp-admin/post-new.php6.07 ▲0.1886.80 ▼16.05
Media Library /wp-admin/upload.php3.41 ▲0.1838.67 ▲6.21
Device Themes /wp-admin/themes.php?page=device-themes3.4037.28

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 16 new files
Database: no new tables, 11 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_dts_return_to_mobile_website
widget_dts_view_full_website
can_compress_scripts
dts_cookie_name
theysaidso_admin_options
dts_version
widget_recent-comments
...

Browser metrics Passed 4 tests

Plugin Name: Device Theme Switcher: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲8713.32 ▼1.331.84 ▼0.0238.92 ▲0.19
Dashboard /wp-admin2,217 ▲294.85 ▼0.03101.66 ▼10.1040.07 ▲0.80
Posts /wp-admin/edit.php2,094 ▲52.01 ▲0.0434.09 ▼1.4833.45 ▼0.43
Add New Post /wp-admin/post-new.php1,521 ▲723.42 ▲5.69652.88 ▼7.7950.50 ▼14.85
Media Library /wp-admin/upload.php1,399 ▲144.24 ▲0.0099.04 ▼3.3543.14 ▲0.13
Device Themes /wp-admin/themes.php?page=device-themes1,1512.0626.8632.80

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

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)
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
Congratulations! This plugin passed the SRP test

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

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === Plugin Name: Device Theme Switcher=== )
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

device-theme-switcher/dts_controller.php 92% from 13 tests

The main file in "Plugin Name: Device Theme Switcher" v. 3.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("device-theme-switcher.php" instead of "dts_controller.php")

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 plugin1,708 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP125851,1961,706
CSS1001
JavaScript1031

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity40.12
▷ Minimum class complexity1.00
▷ Maximum class complexity223.00
Average method complexity3.75
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods114
▷ Static methods1815.79%
▷ Public methods114100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
No PNG images were found in this plugin