83% magiclabs

Code Review | Login by Magic

WordPress plugin Login by Magic scored83%from 54 tests.

About plugin

  • Plugin page: magiclabs
  • Plugin version: 1.0.4
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5.1-5.8
  • WordPress version: 6.3.1
  • First release: Aug 12, 2021
  • Latest release: Aug 30, 2022
  • Number of updates: 16
  • Update frequency: every 23.9 days
  • Top authors: magiclabs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /1,464 total downloads

Benchmarks

Plugin footprint 83% from 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.17MB] [CPU: ▼3.47ms] Passed 4 tests

This is a short check of server-side resources used by Login by Magic
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1435.35 ▼6.64
Dashboard /wp-admin3.52 ▲0.2254.14 ▲4.58
Posts /wp-admin/edit.php3.57 ▲0.2253.83 ▼2.07
Add New Post /wp-admin/post-new.php6.04 ▲0.1698.03 ▼5.02
Media Library /wp-admin/upload.php3.38 ▲0.1635.80 ▼0.16
Login by Magic /wp-admin/options-general.php?page=magiclabs3.3531.55

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Login by Magic
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲3313.20 ▼1.171.62 ▼0.2142.53 ▲0.52
Dashboard /wp-admin2,210 ▲224.86 ▼0.01118.46 ▲13.8241.76 ▼1.16
Posts /wp-admin/edit.php2,093 ▲41.97 ▼0.0841.25 ▲3.4635.23 ▼0.90
Add New Post /wp-admin/post-new.php1,536 ▼623.11 ▲4.70649.71 ▲13.2655.49 ▲0.18
Media Library /wp-admin/upload.php1,386 ▼54.22 ▲0.0396.28 ▼0.1839.89 ▼0.50
Login by Magic /wp-admin/options-general.php?page=magiclabs8732.0523.8927.11

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

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

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
  • 58× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Elliptic\\Curve\\PresetCurve' not found in wp-content/plugins/magiclabs/vendor/simplito/elliptic-php/lib/Curves.php:23
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/magiclabs/vendor/simplito/elliptic-php/tests/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/magiclabs/vendor/simplito/elliptic-php/tests/ED25519Test.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/magiclabs/vendor/magiclabs/magic-admin-php/tests/Util/HttpTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/magiclabs/vendor/magiclabs/magic-admin-php/tests/Exception/DidTokenExceptionTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Elliptic\\Curve\\BaseCurve' not found in wp-content/plugins/magiclabs/vendor/simplito/elliptic-php/lib/Curve/ShortCurve.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/magiclabs/vendor/magiclabs/magic-admin-php/tests/MagicResponseTest.php:9
    • > PHP Fatal error
      Uncaught Exception: Extension gmp not loaded in wp-content/plugins/magiclabs/vendor/simplito/bigint-wrapper-php/lib/BigInteger.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'BI\\BigInteger' not found in wp-content/plugins/magiclabs/vendor/simplito/bigint-wrapper-php/test/test.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/magiclabs/vendor/magiclabs/magic-admin-php/tests/Exception/ForbiddenExceptionTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Elliptic\\Curve\\BaseCurve\\Point' not found in wp-content/plugins/magiclabs/vendor/simplito/elliptic-php/lib/Curve/ShortCurve/JPoint.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: authentication, login, security, passwordless, magiclink

magiclabs/wp-magic.php 77% from 13 tests

This is the main PHP file of "Login by Magic" version 1.0.4, 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:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("magiclabs.php" instead of "wp-magic.php")
  • Git Repository: There should be no Git repositories present in your plugin

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
There were no executable files found in this plugin14,116 lines of code in 126 files:
LanguageFilesBlank linesComment linesLines of code
PHP941,8511,13412,198
JSON900877
Markdown143180746
JavaScript284129
YAML313061
XML24050
CSS16045
make13010

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity13.34
▷ Minimum class complexity1.00
▷ Maximum class complexity162.00
Average method complexity2.38
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces18
Interfaces0
Traits0
Classes79
▷ Abstract classes22.53%
▷ Concrete classes7797.47%
▷ Final classes2228.57%
Methods677
▷ Static methods10715.81%
▷ Public methods62692.47%
▷ Protected methods233.40%
▷ Private methods284.14%
Functions67
▷ Named functions5176.12%
▷ Anonymous functions1623.88%
Constants26
▷ Global constants1765.38%
▷ Class constants934.62%
▷ Public constants333.33%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin