77% face2-face-recognition-based-two-factor-authentication

Code Review | face2 Two Factor Authentication

WordPress plugin face2 Two Factor Authentication scored77%from 54 tests.

About plugin

  • Plugin page: face2-face-recogn...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.3.1
  • WordPress version: 6.3.1
  • First release: Nov 24, 2015
  • Latest release: Nov 24, 2015
  • Number of updates: 4
  • Update frequency: every 3.8 days
  • Top authors: token2 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /897 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.82ms] Passed 4 tests

An overview of server-side resources used by face2 Two Factor Authentication
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0144.83 ▲0.59
Dashboard /wp-admin3.32 ▲0.0251.21 ▼5.25
Posts /wp-admin/edit.php3.38 ▲0.0252.08 ▼2.40
Add New Post /wp-admin/post-new.php5.90 ▲0.0286.77 ▼12.14
Media Library /wp-admin/upload.php3.25 ▲0.0239.53 ▲0.53
face2 /wp-admin/options-general.php?page=face23.1930.04

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for face2 Two Factor Authentication
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.34 ▼0.001.72 ▲0.1443.68 ▼1.34
Dashboard /wp-admin2,202 ▲255.58 ▼0.1290.46 ▼3.4645.49 ▲3.28
Posts /wp-admin/edit.php2,104 ▲42.02 ▼0.0140.09 ▲0.1935.52 ▼7.06
Add New Post /wp-admin/post-new.php1,529 ▲323.16 ▲0.16599.76 ▼64.9152.59 ▼4.81
Media Library /wp-admin/upload.php1,398 ▼24.19 ▼0.0796.87 ▼14.4243.42 ▼6.15
face2 /wp-admin/options-general.php?page=face29152.1222.8429.53

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
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=face2
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=face2
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/face2-face-recognition-based-two-factor-authentication/face2.php:161

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Form requesting face2 face (second factor) to complete login), #2 (Enabling two-factor authentication on user's profile)
You can look at the official readme.txt

face2-face-recognition-based-two-factor-authentication/face2.php 85% from 13 tests

Analyzing the main PHP file in "face2 Two Factor Authentication" version 1.0.1
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("face2-face-recognition-based-two-factor-authentication.php" instead of "face2.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected20,000 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript814412218,471
PHP35308241,455
CSS20053
Markdown116021

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity86.00
▷ Minimum class complexity11.00
▷ Maximum class complexity161.00
Average method complexity4.09
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods55
▷ Static methods23.64%
▷ Public methods4378.18%
▷ Protected methods814.55%
▷ Private methods47.27%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.90MB with 0.77MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png496.93KB68.47KB▼ 86.22%
faceframe.png28.75KB1.16KB▼ 95.98%
assets/screenshot-1.png333.80KB43.91KB▼ 86.85%
allow.png64.20KB6.59KB▼ 89.73%
assets/images/phone-icon.png1.11KB0.35KB▼ 68.68%