84% multi-device-switcher

Code Review | Multi Device Switcher

WordPress plugin Multi Device Switcher scored84%from 54 tests.

About plugin

  • Plugin page: multi-device-swit...
  • Plugin version: 1.8.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2.0
  • WordPress version: 6.3.1
  • First release: Jan 31, 2012
  • Latest release: Apr 13, 2023
  • Number of updates: 70
  • Update frequency: every 58.4 days
  • Top authors: thingsym (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

20,000+ active /270,537 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.50ms] Passed 4 tests

A check of server-side resources used by Multi Device Switcher
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.65 ▲3.93
Dashboard /wp-admin3.33 ▲0.0343.91 ▼1.43
Posts /wp-admin/edit.php3.39 ▲0.0346.91 ▼5.63
Add New Post /wp-admin/post-new.php5.91 ▲0.0384.37 ▼4.43
Media Library /wp-admin/upload.php3.26 ▲0.0334.81 ▲1.50
Multi Device Switcher /wp-admin/themes.php?page=multi-device-switcher3.2533.01

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 17 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_pc-switcher

Browser metrics Passed 4 tests

Checking browser requirements for Multi Device Switcher
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.35 ▼1.411.67 ▼0.1041.19 ▼0.62
Dashboard /wp-admin2,210 ▲224.90 ▼1.01109.24 ▲11.2440.45 ▼3.55
Posts /wp-admin/edit.php2,093 ▲12.01 ▼0.0240.00 ▼2.5635.92 ▼6.22
Add New Post /wp-admin/post-new.php1,536 ▼123.22 ▼0.03667.94 ▼12.9763.22 ▲7.52
Media Library /wp-admin/upload.php1,395 ▲74.28 ▲0.06103.54 ▼5.6745.07 ▼3.35
Multi Device Switcher /wp-admin/themes.php?page=multi-device-switcher1,1852.0345.0932.31

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 does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • widget_pc-switcher
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/multi-device-switcher/pc-switcher-widget.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/multi-device-switcher/wp-cli.php:13

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% 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 need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Theme option), #2 (UserAgent option), #3 (PC Switcher option), #4 (PC Switcher button), #5 (Disable Switcher)
Please take inspiration from this readme.txt

multi-device-switcher/multi-device-switcher.php Passed 13 tests

"Multi Device Switcher" version 1.8.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
124 characters long description:
This WordPress plugin allows you to set a separate theme for device (Smart Phone, Tablet PC, Mobile Phone, Game and custom).

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin1,327 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP42437951,157
PO File1395097
CSS20061
JavaScript12012

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity69.00
▷ Minimum class complexity4.00
▷ Maximum class complexity145.00
Average method complexity5.25
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods48
▷ Static methods00.00%
▷ Public methods48100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
5 PNG files occupy 0.23MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png33.69KB10.18KB▼ 69.79%
screenshot-5.png34.25KB10.12KB▼ 70.46%
screenshot-4.png3.14KB1.80KB▼ 42.72%
screenshot-1.png55.87KB17.30KB▼ 69.04%
screenshot-2.png108.39KB29.68KB▼ 72.61%