67% mobile-redirect-plus-lite

Code Review | WP Mobile Redirect

WordPress plugin WP Mobile Redirect scored67%from 54 tests.

About plugin

  • Plugin page: mobile-redirect-p...
  • Plugin version: 2.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.0.3
  • WordPress version: 6.3.1
  • First release: Sep 7, 2014
  • Latest release: Feb 18, 2019
  • Number of updates: 17
  • Update frequency: every 95.9 days
  • Top authors: iqbalbary (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

600+ active /17,514 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.86MB] [CPU: ▼41.57ms] Passed 4 tests

Server-side resources used by WP Mobile Redirect
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.11 ▼0.3514.25 ▼23.99
Dashboard /wp-admin3.15 ▼0.1517.88 ▼28.43
Posts /wp-admin/edit.php3.15 ▼0.2016.63 ▼32.93
Add New Post /wp-admin/post-new.php3.15 ▼2.7319.41 ▼80.92
Media Library /wp-admin/upload.php3.15 ▼0.0816.69 ▼13.36
WP Mobile Redirect /wp-admin/options-general.php?page=mobile-redirect-plus-lite3.1517.05

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for WP Mobile Redirect
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.43 ▼1.211.61 ▼0.1239.03 ▼6.20
Dashboard /wp-admin2,213 ▲224.86 ▼1.0499.31 ▼0.1940.07 ▼0.46
Posts /wp-admin/edit.php2,093 ▲11.99 ▼0.0136.11 ▼5.0031.36 ▼4.59
Add New Post /wp-admin/post-new.php1,536 ▲323.10 ▼0.21640.35 ▼36.6648.59 ▼10.07
Media Library /wp-admin/upload.php1,386 ▲44.18 ▼0.0796.38 ▼1.4943.09 ▼1.13
WP Mobile Redirect /wp-admin/options-general.php?page=mobile-redirect-plus-lite8602.0324.1231.73

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
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/mobile-redirect-plus-lite/mobi.php+36
    Undefined index: specific_page
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

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
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mobile-redirect-plus-lite
    • > Notice in wp-content/plugins/mobile-redirect-plus-lite/includes/settings.php+72
    Undefined index: specific_page
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mobile-redirect-plus-lite
    • > Notice in wp-content/plugins/mobile-redirect-plus-lite/includes/settings.php+71
    Undefined index: redirect_page
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mobile-redirect-plus-lite
    • > Notice in wp-content/plugins/mobile-redirect-plus-lite/includes/settings.php+42
    Undefined index: redirect
    • > GET request to /wp-admin/options-general.php?page=mobile-redirect-plus-lite
    • > Notice in wp-content/plugins/mobile-redirect-plus-lite/includes/settings.php+47
    Undefined index: link
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mobile-redirect-plus-lite
    • > Warning in wp-content/plugins/mobile-redirect-plus-lite/includes/settings.php+57
    _() expects exactly 1 parameter, 2 given
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mobile-redirect-plus-lite
    • > Notice in wp-content/plugins/mobile-redirect-plus-lite/includes/settings.php+55
    Undefined index: redirect_tab

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
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 add_action() in wp-content/plugins/mobile-redirect-plus-lite/includes/settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mobile-redirect-plus-lite/includes/settings.php: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 87% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Screenshots: Screenshot #1 (Mobile Redirect Plus Lite Options) image not found
  • Plugin Name: Please specify the plugin name on the first line ( === mobile-redirect-plus-lite === )
The official readme.txt is a good inspiration

mobile-redirect-plus-lite/mobi.php 85% from 13 tests

The main file in "WP Mobile Redirect" v. 2.6 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("mobile-redirect-plus-lite.php" instead of "mobi.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 243 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
Everything looks great! No dangerous files found in this plugin836 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP3173666797
CSS10032
JavaScript1007

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.70
Average class complexity134.00
▷ Minimum class complexity134.00
▷ Maximum class complexity134.00
Average method complexity4.69
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods36
▷ Static methods925.00%
▷ Public methods3391.67%
▷ Protected methods25.56%
▷ Private methods12.78%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants00.00%
▷ Class constants9100.00%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png18.49KB12.60KB▼ 31.84%
pro.png51.25KB24.20KB▼ 52.79%