74% mobiswitch

Code Review | MobiSwitch

WordPress plugin MobiSwitch scored74%from 54 tests.

About plugin

  • Plugin page: mobiswitch
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-3.5.1
  • WordPress version: 6.3.1
  • First release: Apr 9, 2013
  • Latest release: Jun 28, 2013
  • Number of updates: 11
  • Update frequency: every 7.4 days
  • Top authors: joeybdesign (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,460 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.85MB] [CPU: ▼32.97ms] Passed 4 tests

A check of server-side resources used by MobiSwitch
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1039.40 ▲2.48
Dashboard /wp-admin3.10 ▼0.2124.80 ▼24.73
Posts /wp-admin/edit.php3.10 ▼0.2622.00 ▼21.86
Add New Post /wp-admin/post-new.php3.10 ▼2.7923.19 ▼71.99
Media Library /wp-admin/upload.php3.10 ▼0.1423.87 ▼13.28

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

MobiSwitch: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲8414.37 ▲0.011.88 ▲0.0643.70 ▼0.42
Dashboard /wp-admin2,211 ▲315.59 ▼0.2894.01 ▲5.5142.88 ▲4.89
Posts /wp-admin/edit.php2,116 ▲132.01 ▲0.0435.27 ▲1.8230.77 ▼4.28
Add New Post /wp-admin/post-new.php1,538 ▲822.96 ▼0.18648.64 ▼3.8468.88 ▲12.92
Media Library /wp-admin/upload.php1,416 ▲134.19 ▲0.0195.49 ▼2.3141.90 ▼0.12

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The plugin did not uninstall gracefully
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mobiswitch/mobiswitch.php:35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function status_header() in wp-content/plugins/mobiswitch/uninstall.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/mobiswitch/mobiswitch_settings.php:23
    • > PHP Notice
      Undefined index: mobiswitch_hidden in wp-content/plugins/mobiswitch/mobiswitch_settings.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: mobile theme switcher, mobiswitch, theme switcher, mobile

mobiswitch/mobiswitch.php 92% from 13 tests

"MobiSwitch" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 181 characters long)

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 plugin505 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP4172304505

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.95
Average class complexity105.00
▷ Minimum class complexity105.00
▷ Maximum class complexity105.00
Average method complexity5.16
▷ Minimum method complexity1.00
▷ Maximum method complexity58.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods2392.00%
▷ Protected methods00.00%
▷ Private methods28.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected