78% any-mobile-theme-switcher

Code Review | Any Mobile Theme Switcher

WordPress plugin Any Mobile Theme Switcher scored78%from 54 tests.

About plugin

  • Plugin page: any-mobile-theme-...
  • Plugin version: 3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Mar 21, 2012
  • Latest release: Nov 20, 2023
  • Number of updates: 52
  • Update frequency: every 82.0 days
  • Top authors: dnesscarkey (100%)

Code review

54 tests

User reviews

244 reviews

Install metrics

20,000+ active /421,975 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▼3.57ms] Passed 4 tests

Server-side resources used by Any Mobile Theme Switcher
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0938.23 ▼2.68
Dashboard /wp-admin3.40 ▲0.0549.98 ▼12.64
Posts /wp-admin/edit.php3.45 ▲0.0950.29 ▲2.69
Add New Post /wp-admin/post-new.php5.98 ▲0.0997.60 ▼1.63
Media Library /wp-admin/upload.php3.32 ▲0.0937.08 ▲3.13
Any Mobile Theme /wp-admin/options-general.php?page=any-mobile-theme-switcher/plugin_interface.php3.3342.00

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 10 new options
New WordPress options
theysaidso_admin_options
mobile_view_theme_link_text
forced_layout_expire_time
show_switch_link_for_desktop
desktop_view_theme_link_text
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Any Mobile Theme Switcher: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,842 ▲8014.34 ▼0.002.04 ▲0.3236.80 ▼6.53
Dashboard /wp-admin2,219 ▲425.50 ▼0.0892.98 ▼9.1843.56 ▼0.19
Posts /wp-admin/edit.php2,127 ▲272.00 ▲0.0539.05 ▲0.6938.64 ▲3.14
Add New Post /wp-admin/post-new.php1,557 ▲2823.43 ▲0.41615.84 ▼42.9248.86 ▼4.75
Media Library /wp-admin/upload.php1,430 ▲304.18 ▲0.0099.50 ▼0.6543.69 ▲2.87
Any Mobile Theme /wp-admin/options-general.php?page=any-mobile-theme-switcher/plugin_interface.php1,5321.7824.9943.10

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 10 options in the database
    • forced_layout_expire_time
    • show_switch_link_for_desktop
    • widget_recent-posts
    • desktop_view_theme_link_text
    • db_upgraded
    • mobile_view_theme_link_text
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 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)
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/any-mobile-theme-switcher/includes/amts-footer.php
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/any-mobile-theme-switcher/includes/amts-theme-select.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/any-mobile-theme-switcher/includes/amts-header.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/any-mobile-theme-switcher/includes/amts-force-switch.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/any-mobile-theme-switcher/any-mobile-theme-switcher.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bloginfo() in wp-content/plugins/any-mobile-theme-switcher/includes/amts-readme.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/any-mobile-theme-switcher/plugin_interface.php:2

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Please add an image for screenshot #1 (Admin Setting For Mobile Theme selection repective to their platform.)
The official readme.txt is a good inspiration

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

"Any Mobile Theme Switcher" version 3.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 199 characters long)

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 detected558 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP77914558

PHP code Passed 2 tests

A short 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.42
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions1076.92%
▷ Anonymous functions323.08%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/amtsp.png11.39KB6.29KB▼ 44.77%
screenshot-1.png32.79KB15.06KB▼ 54.08%