84% equivalent-mobile-redirect

Code Review | Equivalent Mobile Redirect

WordPress plugin Equivalent Mobile Redirect scored84%from 54 tests.

About plugin

  • Plugin page: equivalent-mobile...
  • Plugin version: 4.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.6
  • WordPress version: 6.3.1
  • First release: Jul 18, 2013
  • Latest release: Jan 2, 2021
  • Number of updates: 68
  • Update frequency: every 40.1 days
  • Top authors: uniquelylost (100%)

Code review

54 tests

User reviews

33 reviews

Install metrics

4,000+ active /83,379 total downloads

Benchmarks

Plugin footprint 83% 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.09MB] [CPU: ▲0.72ms] Passed 4 tests

Analyzing server-side resources used by Equivalent Mobile Redirect
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2544.34 ▲5.30
Dashboard /wp-admin3.40 ▲0.0951.74 ▲1.34
Posts /wp-admin/edit.php3.45 ▲0.0951.89 ▲6.11
Add New Post /wp-admin/post-new.php5.98 ▲0.0982.35 ▼9.64
Media Library /wp-admin/upload.php3.32 ▲0.0940.05 ▲5.87
EMR Settings /wp-admin/options-general.php?page=emr_plugin_page3.2930.03

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Equivalent Mobile Redirect
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6914.41 ▲0.001.66 ▲0.0340.71 ▼1.56
Dashboard /wp-admin2,210 ▲225.08 ▲0.14114.36 ▲6.3644.02 ▲0.75
Posts /wp-admin/edit.php2,096 ▲72.02 ▲0.0438.30 ▲0.4334.21 ▲4.41
Add New Post /wp-admin/post-new.php6,236 ▲4,71626.18 ▲2.81853.36 ▲142.6552.05 ▼1.12
Media Library /wp-admin/upload.php1,392 ▲44.23 ▼0.0099.30 ▼6.9841.20 ▼3.75
EMR Settings /wp-admin/options-general.php?page=emr_plugin_page9452.0224.4928.59

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • ndg_spr_version
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/equivalent-mobile-redirect/includes/class-emr.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/equivalent-mobile-redirect/includes/emr-options.php:3

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: mobile, mobile detect, redirection, mobile redirect, equivalent

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

The main PHP file in "Equivalent Mobile Redirect" ver. 4.5 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin1,088 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP42368011,059
XML151417
JSON20012

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.77
Average class complexity105.50
▷ Minimum class complexity77.00
▷ Maximum class complexity134.00
Average method complexity5.45
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods47
▷ Static methods919.15%
▷ Public methods4493.62%
▷ Protected methods24.26%
▷ Private methods12.13%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants00.00%
▷ Class constants10100.00%
▷ Public constants10100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin