63% php-mobile-redirect

Code Review | PHP Mobile Redirect

WordPress plugin PHP Mobile Redirect scored63%from 54 tests.

About plugin

  • Plugin page: php-mobile-redirect
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-3.5.1
  • WordPress version: 6.3.1
  • First release: Mar 10, 2013
  • Latest release: Jun 5, 2013
  • Number of updates: 38
  • Update frequency: every 2.3 days
  • Top authors: Code96 (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

70+ active /9,783 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.14MB] [CPU: ▼43.50ms] Passed 4 tests

A check of server-side resources used by PHP Mobile Redirect
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.83 ▼0.6317.97 ▼24.05
Dashboard /wp-admin2.87 ▼0.4417.73 ▼34.13
Posts /wp-admin/edit.php2.87 ▼0.4919.02 ▼36.07
Add New Post /wp-admin/post-new.php2.87 ▼3.0218.47 ▼79.73
Media Library /wp-admin/upload.php2.87 ▼0.3616.80 ▼20.59
PHP Redirect /wp-admin/options-general.php?page=pmr-settings2.8716.63

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

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

Browser metrics Passed 4 tests

PHP Mobile Redirect: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.35 ▼1.104.00 ▲2.3741.60 ▼4.05
Dashboard /wp-admin2,210 ▲255.86 ▼0.02105.23 ▼9.5940.50 ▲0.86
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0240.97 ▼0.4835.03 ▼2.21
Add New Post /wp-admin/post-new.php1,538 ▲2423.31 ▼0.32664.17 ▲33.6052.66 ▲2.03
Media Library /wp-admin/upload.php1,395 ▲74.20 ▲0.03106.71 ▲0.2346.12 ▼0.53
PHP Redirect /wp-admin/options-general.php?page=pmr-settings8612.0328.9526.10

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
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/php-mobile-redirect/includes/functions.php+9
    Trying to access array offset on value of type bool
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pmr-settings
    • > Notice in wp-content/plugins/php-mobile-redirect/includes/pmr_admin_form.php+38
    Trying to access array offset on value of type bool

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
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/php-mobile-redirect/includes/pmr_admin_form.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/php-mobile-redirect/includes/functions.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/php-mobile-redirect/php-mobile-redirect.php:17

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/options-general.php?page=pmr-settings
    • > Network (severe)
    http://www.code96wd.com/wp-content/uploads/2013/03/Code-96-WordPress-Design.png - Failed to load resource: net::ERR_NAME_NOT_RESOLVED

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: mobile detection, mobile detect, mobile redirect

php-mobile-redirect/php-mobile-redirect.php Passed 13 tests

Analyzing the main PHP file in "PHP Mobile Redirect" version 1.4
64 characters long description:
Easily redirect mobile users to the mobile version of your site.

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
There were no executable files found in this plugin471 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP4176292471

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code1.02
Average class complexity108.00
▷ Minimum class complexity108.00
▷ Maximum class complexity108.00
Average method complexity5.28
▷ 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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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
No PNG images were found in this plugin