77% login-alert-by-e-mail

Code Review | Login alert by e-mail

WordPress plugin Login alert by e-mail scored77%from 54 tests.

About plugin

  • Plugin page: login-alert-by-e-...
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 16, 2023
  • Latest release: Feb 16, 2023
  • Number of updates: 8
  • Update frequency: every 0.1 days
  • Top authors: ruicruzpt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /231 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.30ms] Passed 4 tests

An overview of server-side resources used by Login alert by e-mail
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.28 ▼1.56
Dashboard /wp-admin3.32 ▲0.0149.65 ▼3.63
Posts /wp-admin/edit.php3.37 ▲0.0147.87 ▲0.59
Add New Post /wp-admin/post-new.php5.92 ▲0.0390.42 ▼13.00
Media Library /wp-admin/upload.php3.24 ▲0.0132.07 ▼3.01

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Login alert by e-mail
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,912 ▲16613.59 ▼0.975.57 ▲3.8942.65 ▲4.82
Dashboard /wp-admin2,207 ▲195.76 ▲0.8998.01 ▼20.1538.99 ▼7.35
Posts /wp-admin/edit.php2,093 ▲42.17 ▲0.1739.39 ▲2.5038.07 ▲3.57
Add New Post /wp-admin/post-new.php1,518 ▼1523.28 ▼0.16588.68 ▼2.7647.20 ▼5.85
Media Library /wp-admin/upload.php1,389 ▲14.29 ▲0.1194.97 ▼5.4841.13 ▼2.11

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/login-alert-by-e-mail/admin/partials/ruicruz-login-alert-admin-display.php
    • > /wp-content/plugins/login-alert-by-e-mail/public/partials/ruicruz-login-alert-public-display.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/login-alert-by-e-mail/includes/class-ruicruz-login-alert.php:269

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Login with success for image loginok.png.), #2 (Login withbout success for image loginfailed.png)
You can look at the official readme.txt

login-alert-by-e-mail/ruicruz-login-alert.php 85% from 13 tests

The principal PHP file in "Login alert by e-mail" v. 1.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("login-alert-by-e-mail.php" instead of "ruicruz-login-alert.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin218 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12123535212
JavaScript24546
CSS2080

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.07
Average class complexity1.43
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.13
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods23
▷ Static methods28.70%
▷ Public methods1878.26%
▷ Protected methods00.00%
▷ Private methods521.74%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 1.18MB with 0.70MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/loginfailed.png43.06KB17.61KB▼ 59.10%
assets/banner.png926.64KB355.97KB▼ 61.59%
assets/loginok.png41.75KB16.75KB▼ 59.87%
assets/banner-772x250.png201.63KB88.59KB▼ 56.06%