94% magic-login

Code Review | Magic Login - Passwordless Authentication for WordPress

WordPress plugin Magic Login - Passwordless Authentication for WordPress scored 94% from 54 tests.

About plugin

  • Plugin page: magic-login
  • Plugin version: 1.2.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 5.9.2
  • First release: Jan 19, 2021
  • Latest release: Jan 31, 2022
  • Number of updates: 15
  • Update frequency: every 25.1 days
  • Top authors: handyplugins (86.67%)m_uysl (20%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 1,356 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.25MB] [CPU: ▼326.10ms] Passed 4 tests

An overview of server-side resources used by Magic Login - Passwordless Authentication for WordPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.85 ▲0.3361.87 ▲0.63
Dashboard /wp-admin3.68 ▲0.2737.40 ▼19.27
Posts /wp-admin/edit.php3.91 ▲0.2742.18 ▼13.20
Add New Post /wp-admin/post-new.php7.16 ▲0.18124.11 ▼1,272.57
Media Library /wp-admin/upload.php3.56 ▲0.2631.22 ▲4.45
Magic Login /wp-admin/options-general.php?page=magic-login3.5729.21

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 52 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Magic Login - Passwordless Authentication for WordPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,801 ▲4715.89 ▲0.216.47 ▲0.392.07 ▼0.50
Dashboard /wp-admin2,910 ▲496.15 ▼0.05158.77 ▲7.48178.17 ▲14.61
Posts /wp-admin/edit.php2,693 ▲53.24 ▲0.0065.42 ▼13.90214.76 ▲78.23
Add New Post /wp-admin/post-new.php1,765 ▲10418.48 ▼2.40472.09 ▲18.95166.71 ▲5.32
Media Library /wp-admin/upload.php1,700 ▲55.55 ▲0.05138.39 ▼5.02185.76 ▲3.99
Magic Login /wp-admin/options-general.php?page=magic-login2,7427.62154.27246.46

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function MagicLogin\\plugin_dir_url() in wp-content/plugins/magic-login/plugin.php:24

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: magic-login, passwordless, magic-link, passwordless-login, login

magic-login/plugin.php 92% from 13 tests

This is the main PHP file of "Magic Login - Passwordless Authentication for WordPress" version 1.2.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("magic-login.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin1,829 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
PHP92933531,358
JavaScript81610198
SVG200191
CSS16233882

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
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
Namespaces8
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%
Functions47
▷ Named functions4391.49%
▷ Anonymous functions48.51%
Constants27
▷ Global constants622.22%
▷ Class constants2177.78%
▷ Public constants21100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/select-arrow@2x.png0.53KB0.34KB▼ 36.51%
dist/images/select-arrow.png0.21KB0.21KB0.00%
dist/images/select-arrow@2x.png0.34KB0.34KB0.00%
assets/images/select-arrow.png0.30KB0.21KB▼ 30.19%