83% nutsforpress-login-watchdog

Code Review | NutsForPress Login Watchdog

WordPress plugin NutsForPress Login Watchdog scored83%from 54 tests.

About plugin

  • Plugin page: nutsforpress-logi...
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.3
  • WordPress version: 6.3.1
  • First release: Feb 4, 2021
  • Latest release: Aug 9, 2023
  • Number of updates: 34
  • Update frequency: every 27.0 days
  • Top authors: Christian Gatti (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /1,808 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.68ms] Passed 4 tests

An overview of server-side resources used by NutsForPress Login Watchdog
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.17 ▲0.43
Dashboard /wp-admin3.33 ▲0.0349.94 ▼5.19
Posts /wp-admin/edit.php3.38 ▲0.0351.20 ▲2.83
Add New Post /wp-admin/post-new.php5.93 ▲0.0586.57 ▼4.66
Media Library /wp-admin/upload.php3.26 ▲0.0335.48 ▼1.30
NutsForPress /wp-admin/admin.php?page=nfproot-settings3.2238.73
Login Watchdog /wp-admin/admin.php?page=nfplwd-settings3.6437.38

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 34 new files
Database: 2 new tables, 6 new options
New tables
wp_nfplwd_failed_login_history
wp_nfplwd_failed_login_attempts
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for NutsForPress Login Watchdog
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,851 ▲9014.43 ▼0.011.78 ▲0.1340.06 ▼3.62
Dashboard /wp-admin2,254 ▲545.83 ▲0.82105.59 ▼11.3740.58 ▼3.65
Posts /wp-admin/edit.php2,139 ▲392.06 ▲0.0842.32 ▲7.6934.65 ▼1.00
Add New Post /wp-admin/post-new.php1,563 ▲3723.42 ▲5.90619.88 ▲7.9553.44 ▲3.74
Media Library /wp-admin/upload.php1,433 ▲394.29 ▲0.06101.62 ▼0.1241.92 ▼0.64
NutsForPress /wp-admin/admin.php?page=nfproot-settings8242.0824.3527.89
Login Watchdog /wp-admin/admin.php?page=nfplwd-settings1,8932.0925.8031.79

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

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
  • 27× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/nutsforpress-login-watchdog/root/nfproot-settings.php
    • > /wp-content/plugins/nutsforpress-login-watchdog/admin/includes/nfplwd-disable-xmlrpc.php
    • > /wp-content/plugins/nutsforpress-login-watchdog/public/includes/ajax/nfplwd-core-difference-notification.php
    • > /wp-content/plugins/nutsforpress-login-watchdog/admin/includes/nfplwd-user-login-notification.php
    • > /wp-content/plugins/nutsforpress-login-watchdog/admin/nfplwd-settings-content.php
    • > /wp-content/plugins/nutsforpress-login-watchdog/root/nfproot-styles-and-scripts.php
    • > /wp-content/plugins/nutsforpress-login-watchdog/public/includes/nfplwd-check-two-factors-authentication.php
    • > /wp-content/plugins/nutsforpress-login-watchdog/public/includes/nfplwd-hide-usernames-api.php
    • > /wp-content/plugins/nutsforpress-login-watchdog/root/nfproot-settings-structure.php
    • > /wp-content/plugins/nutsforpress-login-watchdog/includes/nfplwd-load-languages.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

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 to be fixed:
  • Requires php: Version format is invalid
  • Tags: You are using too many tags: 15 tag instead of maximum 10
The official readme.txt is a good inspiration

nutsforpress-login-watchdog/nuts-for-press-login-watchdog.php 85% from 13 tests

The primary PHP file in "NutsForPress Login Watchdog" version 2.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("nutsforpress-login-watchdog.php" instead of "nuts-for-press-login-watchdog.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 158 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin3,130 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP271,6503832,453
PO File1344740409
JavaScript311052156
CSS1291112

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.55
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions51
▷ Named functions51100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin