10% mobile-theme-switcher-2

Code Review | MTS 2 - Mobile Theme Switcher 2

WordPress plugin MTS 2 - Mobile Theme Switcher 2 scored 10% from 54 tests.

About plugin

  • Plugin page: mobile-theme-swit...
  • Plugin version: 0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-3.5
  • WordPress version: 6.3.1
  • First release: Jan 21, 2013
  • Latest release: Jan 25, 2013
  • Number of updates: 11
  • Update frequency: every 0.5 days
  • Top authors: 1manfactory (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,603 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > User deprecated in wp-includes/functions.php+5453
    Function get_themes is deprecated since version 3.4.0! Use wp_get_themes() instead.

Server metrics [RAM: ▼1.82MB] [CPU: ▼57.65ms] Passed 4 tests

Server-side resources used by MTS 2 - Mobile Theme Switcher 2
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.16 ▼1.305.08 ▼37.65
Dashboard /wp-admin2.18 ▼1.127.07 ▼43.63
Posts /wp-admin/edit.php2.18 ▼1.176.93 ▼41.12
Add New Post /wp-admin/post-new.php2.18 ▼3.707.70 ▼108.18
Media Library /wp-admin/upload.php2.18 ▼1.057.63 ▼28.22
Mobile Theme Switcher /wp-admin/themes.php?page=mobile-theme-switcher-22.336.64

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
mts2_basics
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for MTS 2 - Mobile Theme Switcher 2
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.34 ▼0.911.71 ▼0.0836.37 ▼9.88
Dashboard /wp-admin2,210 ▲194.88 ▼0.00112.10 ▲8.5941.99 ▲1.57
Posts /wp-admin/edit.php2,093 ▲42.06 ▲0.0439.67 ▲5.9235.78 ▲4.09
Add New Post /wp-admin/post-new.php1,535 ▲2123.45 ▲5.97592.03 ▼91.9652.33 ▼16.66
Media Library /wp-admin/upload.php1,395 ▲74.20 ▼0.0195.55 ▼13.6441.64 ▼6.60
Mobile Theme Switcher /wp-admin/themes.php?page=mobile-theme-switcher-21,1422.0036.5229.32

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5453
    Function get_themes is deprecated since version 3.4.0! Use wp_get_themes() instead.
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • mts2_basics
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/themes.php?page=mobile-theme-switcher-2
    • > User deprecated in wp-includes/functions.php+5453
    Function get_themes is deprecated since version 3.4.0! Use wp_get_themes() instead.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/themes.php?page=mobile-theme-switcher-2
    • > Notice in wp-content/plugins/mobile-theme-switcher-2/mobile-theme-switcher.php+203
    Undefined index: mobile
    • > GET request to /wp-admin/themes.php?page=mobile-theme-switcher-2
    • > Notice in wp-content/plugins/mobile-theme-switcher-2/mobile-theme-switcher.php+221
    Undefined variable: usermobileoff
    • > GET request to /wp-admin/themes.php?page=mobile-theme-switcher-2
    • > Notice in wp-content/plugins/mobile-theme-switcher-2/mobile-theme-switcher.php+221
    Undefined index:
    • > GET request to /wp-admin/themes.php?page=mobile-theme-switcher-2
    • > Warning in wp-content/plugins/mobile-theme-switcher-2/mobile-theme-switcher.php+223
    Invalid argument supplied for foreach()

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_locale() in wp-content/plugins/mobile-theme-switcher-2/mobile-theme-switcher.php:360
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mts2_set_lang_file() in wp-content/plugins/mobile-theme-switcher-2/mobile-theme-switcher-admin.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
The official readme.txt is a good inspiration

mobile-theme-switcher-2/mobile-theme-switcher.php 92% from 13 tests

The entry point to "MTS 2 - Mobile Theme Switcher 2" version 0.3 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("mobile-theme-switcher-2.php" instead of "mobile-theme-switcher.php")

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
No dangerous file extensions were detected262 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP374110221
PO File1254741

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity27.00
▷ Minimum class complexity27.00
▷ Maximum class complexity27.00
Average method complexity2.37
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods19
▷ Static methods15.26%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.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
PNG images were not found in this plugin