84% logintc-authentication

Code Review | LoginTC Two Factor Authentication

WordPress plugin LoginTC Two Factor Authentication scored84%from 54 tests.

About plugin

  • Plugin page: logintc-authentic...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.8
  • WordPress version: 6.3.1
  • First release: Feb 20, 2014
  • Latest release: Feb 21, 2014
  • Number of updates: 10
  • Update frequency: every 1.0 days
  • Top authors: logintc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /735 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▼7.51ms] Passed 4 tests

Server-side resources used by LoginTC Two Factor Authentication
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.1943.73 ▲2.93
Dashboard /wp-admin3.53 ▲0.1849.50 ▼15.06
Posts /wp-admin/edit.php3.58 ▲0.2249.05 ▲1.20
Add New Post /wp-admin/post-new.php6.05 ▲0.1686.01 ▼19.09
Media Library /wp-admin/upload.php3.39 ▲0.1637.83 ▲3.32
LoginTC Two-Factor /wp-admin/options-general.php?page=logintc_wordpress3.3635.05

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

LoginTC Two Factor Authentication: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲714.33 ▼0.031.75 ▼0.3440.91 ▲1.66
Dashboard /wp-admin2,199 ▲225.61 ▲0.0488.28 ▼7.9140.98 ▼1.04
Posts /wp-admin/edit.php2,104 ▲41.95 ▼0.0439.48 ▼3.0634.91 ▼9.92
Add New Post /wp-admin/post-new.php1,537 ▲1118.03 ▼4.97605.51 ▼12.4566.45 ▲11.66
Media Library /wp-admin/upload.php1,404 ▲74.19 ▲0.02100.28 ▼4.4645.23 ▲0.57
LoginTC Two-Factor /wp-admin/options-general.php?page=logintc_wordpress8932.0325.2428.59

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not 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
Almost there! Just 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 is_multisite() in wp-content/plugins/logintc-authentication/logintc-authentication.php:99

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 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === logintc-authentication === )
Please take inspiration from this readme.txt

logintc-authentication/logintc-authentication.php Passed 13 tests

The main PHP script in "LoginTC Two Factor Authentication" version 1.0.0 is automatically included on every request by WordPress
51 characters long description:
Two-factor authentication for WordPress by LoginTC.

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 detected827 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP7246246794
Markdown212019
CSS13014

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity4.62
▷ Minimum class complexity1.00
▷ Maximum class complexity21.00
Average method complexity1.92
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods51
▷ Static methods47.84%
▷ Public methods4792.16%
▷ Protected methods23.92%
▷ Private methods23.92%
Functions28
▷ Named functions28100.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants00.00%
▷ Class constants14100.00%
▷ Public constants14100.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
There are no PNG files in this plugin