78% notakey-two-factor-extension

Code Review | Notakey Provider for Two-Factor

WordPress plugin Notakey Provider for Two-Factor scored78%from 54 tests.

About plugin

  • Plugin page: notakey-two-facto...
  • Plugin version: 1.0.17
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-6.0
  • WordPress version: 6.3.1
  • First release: May 31, 2022
  • Latest release: Jul 20, 2022
  • Number of updates: 11
  • Update frequency: every 5.0 days
  • Top authors: notakey (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,816 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
Install script ran successfully

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

This is a short check of server-side resources used by Notakey Provider for Two-Factor
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0935.25 ▼2.16
Dashboard /wp-admin3.42 ▲0.0743.08 ▼15.23
Posts /wp-admin/edit.php3.53 ▲0.1749.43 ▲3.16
Add New Post /wp-admin/post-new.php6.00 ▲0.1180.47 ▼12.95
Media Library /wp-admin/upload.php3.34 ▲0.1137.44 ▲4.92
Notakey MFA /wp-admin/options-general.php?page=two-factor-notakey-settings3.3130.46

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 59 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
db_upgraded
two-factor-notakey
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Notakey Provider for Two-Factor
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲5514.72 ▲0.481.70 ▲0.0736.34 ▼4.44
Dashboard /wp-admin2,207 ▲275.53 ▼0.1582.28 ▼5.8641.65 ▲2.52
Posts /wp-admin/edit.php2,116 ▲162.01 ▲0.0440.52 ▲4.8538.03 ▲3.88
Add New Post /wp-admin/post-new.php1,541 ▲1523.16 ▲0.16661.27 ▼24.9752.36 ▼4.31
Media Library /wp-admin/upload.php1,412 ▲124.14 ▼0.0894.32 ▼7.9741.77 ▼3.78
Notakey MFA /wp-admin/options-general.php?page=two-factor-notakey-settings1,0481.7924.8429.49

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • two-factor-notakey
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/notakey-two-factor-extension/vendor/nategood/httpful/examples/github.php
    • > /wp-content/plugins/notakey-two-factor-extension/vendor/nategood/httpful/tests/bootstrap-server.php
    • > /wp-content/plugins/notakey-two-factor-extension/vendor/nategood/httpful/examples/showclix.php
  • 24× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/notakey-two-factor-extension/vendor/nategood/httpful/examples/showclix.php on line 24
    • > PHP Warning
      Use of undefined constant WEB_SERVER_PORT - assumed 'WEB_SERVER_PORT' (this will throw an Error in a future version of PHP) in wp-content/plugins/notakey-two-factor-extension/vendor/nategood/httpful/tests/bootstrap-server.php on line 15
    • > PHP Notice
      Trying to get property 'event_start' of non-object in wp-content/plugins/notakey-two-factor-extension/vendor/nategood/httpful/examples/showclix.php on line 14
    • > PHP Fatal error
      Uncaught Error: Class 'Httpful\\Handlers\\MimeHandlerAdapter' not found in wp-content/plugins/notakey-two-factor-extension/vendor/nategood/httpful/src/Httpful/Handlers/FormHandler.php:9
    • > PHP Warning
      Use of undefined constant WEB_SERVER_PORT - assumed 'WEB_SERVER_PORT' (this will throw an Error in a future version of PHP) in wp-content/plugins/notakey-two-factor-extension/vendor/nategood/httpful/tests/bootstrap-server.php on line 34
    • > PHP Notice
      Trying to get property 'name' of non-object in wp-content/plugins/notakey-two-factor-extension/vendor/nategood/httpful/examples/github.php on line 9
    • > PHP Warning
      Use of undefined constant WEB_SERVER_HOST - assumed 'WEB_SERVER_HOST' (this will throw an Error in a future version of PHP) in wp-content/plugins/notakey-two-factor-extension/vendor/nategood/httpful/tests/bootstrap-server.php on line 15
    • > PHP Warning
      Use of undefined constant WEB_SERVER_HOST - assumed 'WEB_SERVER_HOST' (this will throw an Error in a future version of PHP) in wp-content/plugins/notakey-two-factor-extension/vendor/nategood/httpful/tests/Httpful/HttpfulTest.php on line 22
    • > PHP Fatal error
      Uncaught Exception: Unable to parse response as JSON in wp-content/plugins/notakey-two-factor-extension/vendor/nategood/httpful/src/Httpful/Handlers/JsonHandler.php:30
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/notakey-two-factor-extension/vendor/nategood/httpful/examples/showclix.php on line 24

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: two factor, login, totp, two step, notakey...

notakey-two-factor-extension/two-factor-notakey.php 85% from 13 tests

The principal PHP file in "Notakey Provider for Two-Factor" v. 1.0.17 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("notakey-two-factor-extension.php" instead of "two-factor-notakey.php")

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
Everything looks great! No dangerous files found in this plugin3,828 lines of code in 45 files:
LanguageFilesBlank linesComment linesLines of code
PHP377621,4313,480
Markdown2910181
JSON30091
JavaScript110547
XML11015
YAML13014

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity14.00
▷ Minimum class complexity1.00
▷ Maximum class complexity76.00
Average method complexity2.28
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes29
▷ Abstract classes00.00%
▷ Concrete classes29100.00%
▷ Final classes13.45%
Methods297
▷ Static methods7826.26%
▷ Public methods25385.19%
▷ Protected methods20.67%
▷ Private methods4214.14%
Functions7
▷ Named functions114.29%
▷ Anonymous functions685.71%
Constants55
▷ Global constants47.27%
▷ Class constants5192.73%
▷ Public constants4078.43%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 PNG files occupy 1.69MB with 1.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png408.42KB72.74KB▼ 82.19%
assets/banner-772x250.png40.37KB15.32KB▼ 62.06%
assets/icon-128x128.png8.28KB2.80KB▼ 66.18%
assets/screenshot-1.png557.08KB109.22KB▼ 80.39%
assets/banner-1544x500.png88.91KB33.62KB▼ 62.19%