88% mobile-site-redirect

Code Review | Mobile Site Redirect

WordPress plugin Mobile Site Redirect scored 88% from 54 tests.

About plugin

  • Plugin page: mobile-site-redirect
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9.1
  • WordPress version: 5.8.1
  • First release: Jul 3, 2014
  • Latest release: Jul 9, 2014
  • Number of updates: 13
  • Update frequency: every 0.5 days
  • Top authors: webdevabq (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

70+ active / 5,342 total downloads

Benchmarks

Plugin footprint Passed 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.05MB] [CPU: ▼148.28ms] Passed 4 tests

Server-side resources used by Mobile Site Redirect
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.70 ▼0.0226.01 ▼2.48
Dashboard /wp-admin3.21 ▲0.1557.90 ▲11.52
Posts /wp-admin/edit.php3.06 ▼0.0524.70 ▼23.91
Add New Post /wp-admin/post-new.php5.57 ▲0.1397.44 ▼558.38
Media Library /wp-admin/upload.php3.15 ▲0.1536.03 ▼8.36
Mobile Site Redirect /wp-admin/options-general.php?page=mobired_settings3.1231.17

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Mobile Site Redirect
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,684 ▲8815.85 ▲0.305.14 ▼3.0753.15 ▲0.85
Dashboard /wp-admin2,978 ▲475.95 ▼0.20142.37 ▲2.73120.14 ▲6.41
Posts /wp-admin/edit.php2,744 ▲52.82 ▲0.1370.84 ▲7.59101.74 ▲16.42
Add New Post /wp-admin/post-new.php1,686 ▲10518.83 ▲2.43385.09 ▼63.05118.79 ▲3.07
Media Library /wp-admin/upload.php1,815 ▲85.01 ▼0.03152.31 ▼37.08128.96 ▼17.15
Mobile Site Redirect /wp-admin/options-general.php?page=mobired_settings1,0442.0857.1668.56

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=mobired_settings
    • > Notice in wp-content/plugins/mobile-site-redirect/mobired_admin.php+2
    Undefined index: mobired_hidden

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
Almost there! Just fix the following items
  • 3× 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/mobile-site-redirect/mobile-site-redirect.php:78
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/mobile-site-redirect/mobired_admin.php:16
    • > PHP Notice
      Undefined index: mobired_hidden in wp-content/plugins/mobile-site-redirect/mobired_admin.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === mobile-site-redirect === )
The official readme.txt might help

mobile-site-redirect/mobile-site-redirect.php 92% from 13 tests

The primary PHP file in "Mobile Site Redirect" version 1.2.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 319 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin648 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP3154564646
JavaScript1202

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.83
Average class complexity113.00
▷ Minimum class complexity113.00
▷ Maximum class complexity113.00
Average method complexity4.61
▷ Minimum method complexity1.00
▷ Maximum method complexity69.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods31
▷ Static methods929.03%
▷ Public methods2993.55%
▷ Protected methods26.45%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants00.00%
▷ Class constants9100.00%
▷ Public constants9100.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