84% mobile-login-woocommerce

Code Review | OTP Login Woocommerce & Gravity Forms

WordPress plugin OTP Login Woocommerce & Gravity Forms scored84%from 54 tests.

About plugin

  • Plugin page: mobile-login-wooc...
  • Plugin version: 2.3
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3
  • WordPress version: 6.3.1
  • First release: Dec 22, 2019
  • Latest release: Aug 24, 2023
  • Number of updates: 62
  • Update frequency: every 21.6 days
  • Top authors: xootix (100%)

Code review

54 tests

User reviews

29 reviews

Install metrics

2,000+ active /48,121 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.41MB] [CPU: ▼1.21ms] Passed 4 tests

This is a short check of server-side resources used by OTP Login Woocommerce & Gravity Forms
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.82 ▲0.3647.85 ▲11.83
Dashboard /wp-admin3.77 ▲0.4746.18 ▼1.19
Posts /wp-admin/edit.php3.83 ▲0.4747.89 ▼0.27
Add New Post /wp-admin/post-new.php6.29 ▲0.4189.39 ▼14.03
Media Library /wp-admin/upload.php3.64 ▲0.4144.13 ▲10.67

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 38 new files
Database: no new tables, 13 new options
New WordPress options
xoo_ml_otp_users
db_upgraded
xoo_mobile-login-woocommerce_theme_templates_data
xoo_ml_el_refresh_fields
xoo-ml-services-options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
xoo-ml-phone-options
can_compress_scripts
...

Browser metrics Passed 4 tests

A check of browser resources used by OTP Login Woocommerce & Gravity Forms
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,950 ▲18914.30 ▼0.0622.50 ▲20.8640.87 ▲1.13
Dashboard /wp-admin2,211 ▲345.61 ▼0.0481.63 ▼6.5935.62 ▼7.08
Posts /wp-admin/edit.php2,119 ▲192.03 ▲0.0148.91 ▲7.6539.08 ▼0.31
Add New Post /wp-admin/post-new.php1,549 ▲2323.11 ▼0.61641.98 ▼47.8857.29 ▲0.99
Media Library /wp-admin/upload.php1,416 ▲164.22 ▲0.05102.79 ▼1.6144.95 ▲0.81

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options were found after uninstall: 13 options
    • widget_recent-comments
    • xoo-ml-services-options
    • db_upgraded
    • xoo_ml_el_refresh_fields
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • xoo-ml-phone-options
    • xoo_mobile-login-woocommerce_theme_templates_data
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/mobile-login-woocommerce/admin/templates/sidebar.php:74
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/mobile-login-woocommerce/admin/templates/xoo-ml-admin-display.php:27
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/mobile-login-woocommerce/admin/templates/xoo-ml-admin-display.php on line 7
    • > PHP Notice
      Undefined variable: tabs in wp-content/plugins/mobile-login-woocommerce/admin/templates/xoo-ml-admin-display.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'Xoo_Helper' not found in wp-content/plugins/mobile-login-woocommerce/includes/class-xoo-ml-helper.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/mobile-login-woocommerce/admin/templates/xoo-ml-premium-info.php:42
    • > PHP Fatal error
      Uncaught Error: Class 'GF_Field_Phone' not found in wp-content/plugins/mobile-login-woocommerce/includes/class-xoo-ml-gravity-form.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention: You can look at the official readme.txt

mobile-login-woocommerce/xoo-ml-main.php 92% from 13 tests

"OTP Login Woocommerce & Gravity Forms" version 2.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("mobile-login-woocommerce.php" instead of "xoo-ml-main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected3,975 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
PHP279552852,758
JavaScript528665718
CSS3935499

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity24.21
▷ Minimum class complexity2.00
▷ Maximum class complexity99.00
Average method complexity3.62
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods124
▷ Static methods3830.65%
▷ Public methods11995.97%
▷ Protected methods10.81%
▷ Private methods43.23%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.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
There are no PNG files in this plugin