Benchmarks
Plugin footprint Passed 16 tests
Installer Passed 1 test
🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully
Server metrics [RAM: ▲7.61MB] [CPU: ▼121.35ms] 75% from 4 tests
Analyzing server-side resources used by 2FAS Classic - Two Factor Authentication
Please have a look at the following items
- Extra RAM: Extra memory usage must be kept under 5MB (currently 7.61MB on /wp-admin/admin.php?page=twofas-submenu-dashboard)
Page | Memory (MB) | CPU Time (ms) |
---|---|---|
Home / | 9.45 ▲6.61 | 62.25 ▲35.40 |
Dashboard /wp-admin | 11.05 ▲7.98 | 91.02 ▲47.72 |
Posts /wp-admin/edit.php | 11.10 ▲7.99 | 78.89 ▲41.13 |
Add New Post /wp-admin/post-new.php | 13.36 ▲7.92 | 117.70 ▼600.76 |
Media Library /wp-admin/upload.php | 10.93 ▲7.92 | 70.09 ▲38.82 |
Personal settings /wp-admin/admin.php?page=twofas-submenu-channel | 9.28 | 50.61 |
Admin settings /wp-admin/admin.php?page=twofas-submenu-settings | 9.24 | 51.66 |
Dashboard /wp-admin/admin.php?page=twofas-submenu-dashboard | 9.25 | 48.74 |
Server storage [IO: ▲16.02MB] [DB: ▲0.01MB] Passed 3 tests
Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 1,519 new files
Database: 5 new tables, 4 new options
New tables |
---|
wp_twofas_sessions |
wp_twofas_migrations |
wp_twofas_trusted_devices |
wp_twofas_session_variables |
wp_twofas_authentications |
New WordPress options |
---|
twofas_user_migration_allowed |
twofas_plugin_version |
twofas_privacy_policy_accepted |
twofas_trusted_devices_enabled |
Browser metrics Passed 4 tests
This is an overview of browser requirements for 2FAS Classic - Two Factor Authentication
This plugin renders optimally with no browser resource issues detected
Page | Nodes | Memory (MB) | Script (ms) | Layout (ms) |
---|---|---|---|---|
Home / | 3,870 ▲269 | 18.54 ▲2.58 | 4.93 ▼3.31 | 86.48 ▲12.25 |
Dashboard /wp-admin | 3,093 ▲198 | 7.54 ▲1.29 | 164.96 ▲32.62 | 171.36 ▼3.92 |
Posts /wp-admin/edit.php | 2,903 ▲197 | 4.69 ▲1.33 | 109.46 ▲42.70 | 155.83 ▲18.55 |
Add New Post /wp-admin/post-new.php | 1,599 ▼2,214 | 22.07 ▲3.42 | 441.20 ▼36.18 | 191.40 ▲28.63 |
Media Library /wp-admin/upload.php | 1,913 ▲161 | 6.40 ▲0.90 | 165.66 ▲20.76 | 177.67 ▼2.92 |
Personal settings /wp-admin/admin.php?page=twofas-submenu-channel | 1,357 | 5.00 | 117.82 | 149.71 |
Admin settings /wp-admin/admin.php?page=twofas-submenu-settings | 1,357 | 4.99 | 121.70 | 135.53 |
Dashboard /wp-admin/admin.php?page=twofas-submenu-dashboard | 1,357 | 4.99 | 100.19 | 152.93 |
Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests
🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled completely, with no zombie files or tables
Smoke tests 50% from 4 tests
Server-side errors 0% from 1 test
🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
- 3 occurences, only the last one shown
- > GET request to /wp-admin/admin.php?page=twofas-submenu-dashboard
- > Notice in wp-content/plugins/2fas/src/Helpers/Config.php+56
Undefined index: pusher_key
SRP 50% 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
- 440× PHP files trigger server errors when accessed directly (only 10 are shown):
- > PHP Fatal error
Uncaught Error: Interface 'Invoker\\ParameterResolver\\ParameterResolver' not found in wp-content/plugins/2fas/vendor/php-di/invoker/src/ParameterResolver/ResolverChain.php:14
- > PHP Fatal error
Uncaught Error: Class 'Twig\ode\\Expression\\AbstractExpression' not found in wp-content/plugins/2fas/vendor/twig/twig/src/Node/Expression/Binary/AbstractBinary.php:18
- > PHP Fatal error
Uncaught Error: Class 'Twig\\TokenParser\\AbstractTokenParser' not found in wp-content/plugins/2fas/vendor/twig/twig/src/TokenParser/SandboxTokenParser.php:31
- > PHP Fatal error
Uncaught Error: Class 'TwoFAS\\TwoFAS\\Authentication\\Middleware\\Middleware' not found in wp-content/plugins/2fas/src/Authentication/Middleware/Trusted_Device_Login.php:17
- > PHP Fatal error
Uncaught Error: Interface 'TwoFAS\\Core\\Hooks\\Hook_Interface' not found in wp-content/plugins/2fas/src/Hooks/Action_Links_Filter.php:8
- > PHP Fatal error
Uncaught Error: Class 'Twig\ode\\Expression\\Binary\\AbstractBinary' not found in wp-content/plugins/2fas/vendor/twig/twig/src/Node/Expression/Binary/BitwiseXorBinary.php:17
- > PHP Fatal error
Uncaught Error: Interface 'Twig\\RuntimeLoader\\RuntimeLoaderInterface' not found in wp-content/plugins/2fas/vendor/twig/twig/src/RuntimeLoader/ContainerRuntimeLoader.php:24
- > PHP Fatal error
Uncaught Error: Interface 'Twig\\TokenParser\\TokenParserInterface' not found in wp-content/plugins/2fas/vendor/twig/twig/src/TokenParser/AbstractTokenParser.php:21
- > PHP Fatal error
Uncaught Error: Class 'WhichBrowser\\Model\\Primitive\\Base' not found in wp-content/plugins/2fas/vendor/whichbrowser/parser/src/Model/Version.php:7
- > PHP Fatal error
Uncaught Error: Interface 'Twig\odeVisitor\odeVisitorInterface' not found in wp-content/plugins/2fas/vendor/twig/twig/src/NodeVisitor/AbstractNodeVisitor.php:24
- > PHP Fatal error
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 93% from 29 tests
readme.txt 94% from 16 tests
It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
- Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
2fas/twofas.php 92% from 13 tests
This is the main PHP file of "2FAS Classic - Two Factor Authentication" version 3.2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
- Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("2fas.php" instead of "twofas.php")
Code Analysis 97% from 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
Success! There were no dangerous files found in this plugin132,045 lines of code in 1,180 files:
Language | Files | Blank lines | Comment lines | Lines of code |
---|---|---|---|---|
PHP | 928 | 12,524 | 16,941 | 86,443 |
JavaScript | 42 | 6,196 | 13,066 | 22,000 |
CSS | 9 | 951 | 29 | 8,220 |
Sass | 36 | 780 | 40 | 3,969 |
reStructuredText | 85 | 2,455 | 2,183 | 3,361 |
PO File | 3 | 906 | 1,186 | 2,525 |
Twig | 47 | 195 | 0 | 2,043 |
Markdown | 15 | 587 | 0 | 1,333 |
JSON | 2 | 0 | 0 | 925 |
C | 1 | 171 | 186 | 860 |
YAML | 9 | 28 | 0 | 302 |
Bourne Shell | 1 | 6 | 0 | 44 |
C/C++ Header | 1 | 7 | 13 | 15 |
m4 | 1 | 2 | 1 | 5 |
PHP code 50% from 2 tests
This plugin's cyclomatic complexity and code structure detailed below
These items need your attention
- Please reduce cyclomatic complexity of methods to less than 100 (currently 107)
Cyclomatic complexity | |
---|---|
Average complexity per logical line of code | 0.40 |
Average class complexity | 7.12 |
▷ Minimum class complexity | 1.00 |
▷ Maximum class complexity | 484.00 |
Average method complexity | 2.90 |
▷ Minimum method complexity | 1.00 |
▷ Maximum method complexity | 107.00 |
Code structure | ||
---|---|---|
Namespaces | 121 | |
Interfaces | 75 | |
Traits | 25 | |
Classes | 757 | |
▷ Abstract classes | 31 | 4.10% |
▷ Concrete classes | 726 | 95.90% |
▷ Final classes | 34 | 4.68% |
Methods | 2,869 | |
▷ Static methods | 126 | 4.39% |
▷ Public methods | 2,209 | 77.00% |
▷ Protected methods | 193 | 6.73% |
▷ Private methods | 467 | 16.28% |
Functions | 145 | |
▷ Named functions | 83 | 57.24% |
▷ Anonymous functions | 62 | 42.76% |
Constants | 430 | |
▷ Global constants | 10 | 2.33% |
▷ Class constants | 420 | 97.67% |
▷ Public constants | 420 | 100.00% |
Plugin size Passed 2 tests
Image compression Passed 2 tests
It is recommended to compress PNG files in your plugin to minimize bandwidth usage
80 PNG files occupy 0.43MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant | |||
---|---|---|---|
File | Size - original | Size - compressed | Savings |
assets/sprites/backup-codes.png | 0.20KB | 0.28KB | 0.00% |
assets/images/admin_panel.png | 2.02KB | 2.06KB | 0.00% |
vendor/endroid/qr-code/assets/image/b.png | 0.83KB | 0.08KB | ▼ 90.25% |
assets/sprites/remove.png | 0.14KB | 0.17KB | 0.00% |
assets/sprites/offline-codes.png | 0.41KB | 0.44KB | 0.00% |