84% was-it-you

Code Review | Was it you? Account login notifications

WordPress plugin Was it you? Account login notifications scored84%from 54 tests.

About plugin

  • Plugin page: was-it-you
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.4.1
  • WordPress version: 6.3.1
  • First release: May 12, 2020
  • Latest release: May 14, 2020
  • Number of updates: 7
  • Update frequency: every 0.3 days
  • Top authors: bogdand (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /448 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.05MB] [CPU: ▼1.91ms] Passed 4 tests

An overview of server-side resources used by Was it you? Account login notifications
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0637.72 ▼0.62
Dashboard /wp-admin3.36 ▲0.0545.79 ▼1.34
Posts /wp-admin/edit.php3.47 ▲0.1151.57 ▲2.36
Add New Post /wp-admin/post-new.php5.94 ▲0.0589.85 ▼7.82
Media Library /wp-admin/upload.php3.28 ▲0.0534.01 ▲2.15
Was it you? /wp-admin/options-general.php?page=was-it-you3.2431.04

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Was it you? Account login notifications
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.26 ▼1.491.57 ▼0.1245.97 ▲1.80
Dashboard /wp-admin2,213 ▲254.80 ▼0.27108.29 ▲8.4141.64 ▼1.46
Posts /wp-admin/edit.php2,093 ▲42.18 ▲0.1539.46 ▲2.5035.20 ▼0.72
Add New Post /wp-admin/post-new.php1,537 ▼523.16 ▲0.08643.16 ▼56.2961.99 ▼2.09
Media Library /wp-admin/upload.php1,392 ▲44.21 ▼0.0092.44 ▼11.1241.68 ▼2.47
Was it you? /wp-admin/options-general.php?page=was-it-you7972.0526.0824.77

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: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'E11_WAS_IT_YOU_PLUGIN_DIR/inc/settings.php' (include_path='.:/usr/share/php') in wp-content/plugins/was-it-you/inc/wasityou.php on line 52
    • > PHP Fatal error
      Uncaught Error: Call to undefined function E11_WasitYou\\add_action() in wp-content/plugins/was-it-you/inc/admin.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/was-it-you/was-it-you.php:58
    • > PHP Warning
      require_once(E11_WAS_IT_YOU_PLUGIN_DIR/inc/settings.php): failed to open stream: No such file or directory in wp-content/plugins/was-it-you/inc/wasityou.php on line 52
    • > PHP Warning
      Use of undefined constant E11_WAS_IT_YOU_PLUGIN_DIR - assumed 'E11_WAS_IT_YOU_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/was-it-you/inc/wasityou.php on line 52
    • > PHP Fatal error
      Uncaught Error: Call to undefined function E11_WasitYou\\add_action() in wp-content/plugins/was-it-you/inc/login.php:35

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
You can look at the official readme.txt

was-it-you/was-it-you.php Passed 13 tests

This is the main PHP file of "Was it you? Account login notifications" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
79 characters long description:
Was it you? is a plugin that sends you an email if you logged in from a new IP.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin221 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP696241221

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.25
Average class complexity4.17
▷ Minimum class complexity3.00
▷ Maximum class complexity5.00
Average method complexity1.70
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes116.67%
Methods27
▷ Static methods27.41%
▷ Public methods2488.89%
▷ Protected methods13.70%
▷ Private methods27.41%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin