84% magic-login-mail

Code Review | Magic Login Mail

WordPress plugin Magic Login Mail scored84%from 54 tests.

About plugin

  • Plugin page: magic-login-mail
  • Plugin version: 1.05
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4
  • WordPress version: 6.3.1
  • First release: Dec 28, 2021
  • Latest release: Oct 29, 2023
  • Number of updates: 24
  • Update frequency: every 27.9 days
  • Top authors: Katsushi Kawamori (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /2,167 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
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼2.11ms] Passed 4 tests

Server-side resources used by Magic Login Mail
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0537.98 ▲0.04
Dashboard /wp-admin3.36 ▲0.0548.03 ▼5.73
Posts /wp-admin/edit.php3.41 ▲0.0544.39 ▼1.30
Add New Post /wp-admin/post-new.php5.94 ▲0.0588.20 ▼1.46
Media Library /wp-admin/upload.php3.28 ▲0.0532.68 ▲1.49

Server storage [IO: ▲0.02MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Magic Login Mail: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.17 ▼0.101.75 ▲0.1343.03 ▲3.41
Dashboard /wp-admin2,192 ▲155.62 ▼0.0595.54 ▲5.5042.29 ▲2.75
Posts /wp-admin/edit.php2,100 ▼01.99 ▲0.0135.72 ▲1.2135.78 ▲0.74
Add New Post /wp-admin/post-new.php1,528 ▼123.10 ▼0.18604.43 ▼53.4552.45 ▼2.62
Media Library /wp-admin/upload.php1,403 ▲64.20 ▲0.0195.57 ▼3.8840.32 ▼1.25

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means 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
Please take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/magic-login-mail/lib/class-magicloginmail.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/magic-login-mail/lib/class-magicloginmail.php:36

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

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: users, email, login, passwordless

magic-login-mail/magicloginmail.php 92% from 13 tests

"Magic Login Mail" version 1.05's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("magic-login-mail.php" instead of "magicloginmail.php")

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 detected240 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP357113240

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity35.00
▷ Minimum class complexity35.00
▷ Maximum class complexity35.00
Average method complexity4.71
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods450.00%
▷ Protected methods00.00%
▷ Private methods450.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
PNG images were not found in this plugin