74% relais-2fa

Code Review | Relais 2FA

WordPress plugin Relais 2FA scored 74% from 54 tests.

About plugin

  • Plugin page: relais-2fa
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5.3-5.5.3
  • WordPress version: 6.3.1
  • First release: Dec 8, 2020
  • Latest release: Dec 15, 2020
  • Number of updates: 3
  • Update frequency: every 3.7 days
  • Top authors: mobisoft974 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 322 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼4.25ms] Passed 4 tests

An overview of server-side resources used by Relais 2FA
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1343.82 ▲2.67
Dashboard /wp-admin3.44 ▲0.1347.38 ▼4.25
Posts /wp-admin/edit.php3.55 ▲0.1948.55 ▲0.47
Add New Post /wp-admin/post-new.php6.02 ▲0.1386.84 ▼15.89
Media Library /wp-admin/upload.php3.36 ▲0.1333.66 ▲2.88
Pair / Unpair device /wp-admin/admin.php?page=relais_2fa_add_device4.1147.06
Manage users /wp-admin/admin.php?page=relais_2fa_manage_users3.3436.97
Relais 2FA /wp-admin/admin.php?page=relais_2fa3.3230.59

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 441 new files
Database: 2 new tables, 6 new options
New tables
rl_codes
rl_nonces
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Relais 2FA
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,945 ▲18813.27 ▼1.111.73 ▼0.3738.89 ▼11.53
Dashboard /wp-admin2,233 ▲455.86 ▼0.02107.70 ▼6.1881.06 ▲36.17
Posts /wp-admin/edit.php2,122 ▲332.00 ▲0.0038.45 ▲4.2534.62 ▼0.39
Add New Post /wp-admin/post-new.php1,692 ▲16322.34 ▲3.94671.48 ▼63.1042.76 ▼6.87
Media Library /wp-admin/upload.php1,421 ▲334.22 ▲0.05105.07 ▲6.7544.98 ▲0.32
Pair / Unpair device /wp-admin/admin.php?page=relais_2fa_add_device7942.0225.1622.12
Manage users /wp-admin/admin.php?page=relais_2fa_manage_users8202.0225.5034.54
Relais 2FA /wp-admin/admin.php?page=relais_2fa8192.0123.7225.47

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/relais-2fa/include/add_device_page.php
    • > /wp-content/plugins/relais-2fa/include/manage_page.php
    • > /wp-content/plugins/relais-2fa/include/admin_page.php
    • > /wp-content/plugins/relais-2fa/relais.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === relais-2fa === )
The official readme.txt is a good inspiration

relais-2fa/relais.php 92% from 13 tests

The entry point to "Relais 2FA" version 1.0 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("relais-2fa.php" instead of "relais.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Please fix the following items
  • For security reasons, never distribute binary or executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/relais-2fa/lib/phpqrcode/tools/merge.bat
7,319 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP231,8612,0517,098
CSS2170153
JavaScript1242464
Bourne Shell1002
DOS Batch1002

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity32.30
▷ Minimum class complexity1.00
▷ Maximum class complexity292.00
Average method complexity3.82
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes33
▷ Abstract classes00.00%
▷ Concrete classes33100.00%
▷ Final classes00.00%
Methods366
▷ Static methods12233.33%
▷ Public methods26672.68%
▷ Protected methods9626.23%
▷ Private methods41.09%
Functions37
▷ Named functions37100.00%
▷ Anonymous functions00.00%
Constants98
▷ Global constants98100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
42 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/phpqrcode/cache/frame_36.png0.27KB0.25KB▼ 7.72%
lib/phpqrcode/cache/frame_18.png0.22KB0.21KB▼ 5.26%
lib/phpqrcode/cache/frame_25.png0.24KB0.23KB▼ 4.55%
lib/phpqrcode/cache/frame_9.png0.19KB0.19KB▼ 2.01%
lib/phpqrcode/cache/frame_37.png0.27KB0.25KB▼ 7.89%