58% face-recognition

Code Review | Face Recognition Login

WordPress plugin Face Recognition Login scored58%from 54 tests.

About plugin

  • Plugin page: face-recognition
  • Plugin version: 1.2.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.5
  • WordPress version: 6.3.1
  • First release: Apr 11, 2019
  • Latest release: Sep 26, 2020
  • Number of updates: 34
  • Update frequency: every 15.8 days
  • Top authors: tymotey (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

20+ active /2,213 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.10MB] [CPU: ▼5.80ms] Passed 4 tests

This is a short check of server-side resources used by Face Recognition Login
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1036.90 ▼1.82
Dashboard /wp-admin3.40 ▲0.1045.85 ▼6.32
Posts /wp-admin/edit.php3.52 ▲0.1647.39 ▲1.01
Add New Post /wp-admin/post-new.php5.98 ▲0.1080.26 ▼16.06
Media Library /wp-admin/upload.php3.33 ▲0.1034.56 ▲4.00

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Face Recognition Login
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6014.47 ▲0.051.71 ▼0.1639.24 ▼7.24
Dashboard /wp-admin2,212 ▲274.88 ▼0.98108.97 ▼8.2038.87 ▼8.51
Posts /wp-admin/edit.php2,095 ▲62.01 ▲0.0239.39 ▼0.1936.42 ▲1.41
Add New Post /wp-admin/post-new.php1,520 ▼017.75 ▼5.33644.38 ▲20.6662.65 ▼7.84
Media Library /wp-admin/upload.php1,388 ▲34.18 ▼0.0196.81 ▼4.5143.49 ▲0.20

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/face-recognition/uninstall.php+17
    Undefined variable: face_recognition
  • The plugin did not uninstall correctly, leaving 29 files (15.51MB) in the plugin directory
    • (new file) assets/facerec_weights/face_landmark_68_tiny_model-weights_manifest.json
    • (new file) assets/facerec_weights/age_gender_model-weights_manifest.json
    • (new file) assets/css/bundle.css
    • (new file) assets/facerec_weights/age_gender_model-shard1
    • (new file) assets/facerec_weights/face_recognition_model-shard1
    • (new file) assets/facerec_weights/face_landmark_68_model-weights_manifest.json
    • (new file) assets/facerec_weights/face_landmark_68_model-shard1
    • (new file) assets/facerec_weights/face_expression_model-shard1
    • (new file) assets/facerec_weights/face_landmark_68_tiny_model-shard1
    • (new file) assets/facerec_weights/face_expression_model-weights_manifest.json
    • ...
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • recovery_mode_email_last_sent

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/face-recognition/face_recognition.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/face-recognition/includes/class-facerecognition-user-meta.php:39

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
2 plugin tags: login, face recognition

face-recognition/face_recognition.php 92% from 13 tests

"Face Recognition Login" version 1.2.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("face-recognition.php" instead of "face_recognition.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin1,011 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP51494371,000
JSON8008
JavaScript2002
CSS1101

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity46.00
▷ Minimum class complexity18.00
▷ Maximum class complexity85.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods45
▷ Static methods24.44%
▷ Public methods3884.44%
▷ Protected methods24.44%
▷ Private methods511.11%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.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
1 compressed PNG file occupies 0.01MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/no_image.png12.05KB12.94KB0.00%