84% emlg-tfa

Code Review | EMLG TFA

WordPress plugin EMLG TFA scored84%from 54 tests.

About plugin

  • Plugin page: emlg-tfa
  • Plugin version: 1.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Jun 1, 2022
  • Latest release: Feb 24, 2023
  • Number of updates: 6
  • Update frequency: every 44.7 days
  • Top authors: wprj (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /282 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼11.80ms] Passed 4 tests

A check of server-side resources used by EMLG TFA
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0942.39 ▲5.92
Dashboard /wp-admin3.40 ▲0.0646.25 ▼13.10
Posts /wp-admin/edit.php3.51 ▲0.1642.55 ▼12.54
Add New Post /wp-admin/post-new.php5.98 ▲0.0979.92 ▼23.75
Media Library /wp-admin/upload.php3.32 ▲0.0934.91 ▲2.20

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for EMLG TFA
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲6614.77 ▲0.401.86 ▲0.2245.82 ▲3.68
Dashboard /wp-admin2,218 ▲334.84 ▼1.04112.78 ▲14.5243.22 ▼0.83
Posts /wp-admin/edit.php2,101 ▲92.03 ▲0.0133.82 ▼9.2335.90 ▼1.59
Add New Post /wp-admin/post-new.php1,557 ▲4323.00 ▲5.25663.57 ▲56.5764.85 ▲12.15
Media Library /wp-admin/upload.php1,394 ▲64.20 ▼0.2096.18 ▼1.8445.01 ▲1.82

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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 take a closer look at the following
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'Emlg_Login' not found in wp-content/plugins/emlg-tfa/views/submit-code.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/emlg-tfa/views/admin-page.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/emlg-tfa/emlg-tfa.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/emlg-tfa/includes/class-emlg-login.php:33

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
8 plugin tags: email login, email two-factor authentication, 2fa, 2 factor, 2-factor authentication...

emlg-tfa/emlg-tfa.php Passed 13 tests

"EMLG TFA" version 1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
47 characters long description:
Two-Factor Authentication via out of band email

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin919 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP9138330645
JavaScript12225159
CSS2260115

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity13.60
▷ Minimum class complexity2.00
▷ Maximum class complexity26.00
Average method complexity2.97
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods34
▷ Static methods1029.41%
▷ Public methods2779.41%
▷ Protected methods00.00%
▷ Private methods720.59%
Functions4
▷ Named functions250.00%
▷ Anonymous functions250.00%
Constants6
▷ Global constants350.00%
▷ Class constants350.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

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