62% authentication-via-otp-using-firebase

Code Review | Firebase OTP Authentication

WordPress plugin Firebase OTP Authentication scored62%from 54 tests.

About plugin

  • Plugin page: authentication-vi...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.9
  • WordPress version: 6.3.1
  • First release: Jan 4, 2022
  • Latest release: Mar 1, 2022
  • Number of updates: 6
  • Update frequency: every 9.3 days
  • Top authors: appgenixinfortech (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

50+ active /2,354 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.23MB] [CPU: ▼16.59ms] Passed 4 tests

An overview of server-side resources used by Firebase OTP Authentication
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.84 ▼0.6315.72 ▼27.57
Dashboard /wp-admin3.37 ▲0.0246.30 ▼23.40
Posts /wp-admin/edit.php3.44 ▲0.0850.14 ▼1.51
Add New Post /wp-admin/post-new.php5.52 ▼0.3783.62 ▼13.88
Media Library /wp-admin/upload.php3.28 ▲0.0535.00 ▲0.73
Firebase authentication /wp-admin/admin.php?page=firebase-auth3.4234.62
Users /wp-admin/admin.php?page=firebase-auth-users3.2738.05

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 32 new files
Database: no new tables, 7 new options
New WordPress options
fa_style_config
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Firebase OTP Authentication
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,979 ▲21814.82 ▲0.4610.40 ▲8.5140.05 ▼2.86
Dashboard /wp-admin2,236 ▲615.50 ▼0.1794.42 ▼12.1990.38 ▲49.79
Posts /wp-admin/edit.php2,147 ▲442.64 ▲0.6844.59 ▲8.4836.20 ▼1.28
Add New Post /wp-admin/post-new.php1,563 ▲2823.83 ▲5.30658.84 ▲1.03148.92 ▲79.23
Media Library /wp-admin/upload.php1,441 ▲415.13 ▲0.93105.30 ▼0.8770.76 ▲30.55
Firebase authentication /wp-admin/admin.php?page=firebase-auth9882.5432.4346.50
Users /wp-admin/admin.php?page=firebase-auth-users8892.7130.6028.08

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/authentication-via-otp-using-firebase/admin/query.php+8
    Undefined index: formtype
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • fa_style_config
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=firebase-auth
    • > Notice in wp-content/plugins/authentication-via-otp-using-firebase/template/admin.php+20
    Undefined index: tab
  • 24 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=firebase-auth-users
    • > Notice in wp-content/plugins/authentication-via-otp-using-firebase/inc/enqueue.php+93
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 9× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/authentication-via-otp-using-firebase/inc/token.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/authentication-via-otp-using-firebase/template/admin_users.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/authentication-via-otp-using-firebase/inc/ajax.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/authentication-via-otp-using-firebase/template/phone.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/authentication-via-otp-using-firebase/template/admin.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/authentication-via-otp-using-firebase/inc/activation.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/authentication-via-otp-using-firebase/inc/hooks.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/authentication-via-otp-using-firebase/admin/admin.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/authentication-via-otp-using-firebase/inc/enqueue.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=firebase-auth
    • > Console-api (severe) in wp-content/plugins/authentication-via-otp-using-firebase/assets/js/firebase-database.js?ver=1.0+0:11620
    [2023-10-19T20:46:36.288Z] @firebase/database:" "FIREBASE FATAL ERROR: Cannot parse Firebase url. Please use https://\u003CYOUR FIREBASE>.firebaseio.com
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=firebase-auth-users
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught Error: FIREBASE FATAL ERROR: Cannot parse Firebase url. Please use https://.firebaseio.com
    • > GET request to /wp-admin/admin.php?page=firebase-auth-users
    • > Console-api (severe) in wp-content/plugins/authentication-via-otp-using-firebase/assets/js/firebase-database.js?ver=1.0+0:11620
    [2023-10-19T20:46:38.011Z] @firebase/database:" "FIREBASE FATAL ERROR: Cannot parse Firebase url. Please use https://\u003CYOUR FIREBASE>.firebaseio.com

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed: The official readme.txt is a good inspiration

authentication-via-otp-using-firebase/authentication-via-otp-using-Firebase.php 77% from 13 tests

The principal PHP file in "Firebase OTP Authentication" v. 1.0.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("authentication-via-otp-using-firebase.php" instead of "authentication-via-otp-using-Firebase.php")
  • Requires PHP: The required version number must match the one declared in readme.txt ("5.4" instead of "5.6.20")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected2,276 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript8283201,002
PHP116466853
CSS57016421

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.80
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions1593.75%
▷ Anonymous functions16.25%
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
5 PNG files occupy 0.18MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/firebase.png1.39KB0.85KB▼ 39.15%
assets/screenshot-3.png27.76KB14.12KB▼ 49.15%
assets/screenshot-1.png29.08KB12.85KB▼ 55.81%
assets/screenshot-2.png53.44KB22.16KB▼ 58.54%
assets/css/img/flags.png67.65KB23.60KB▼ 65.12%