68% wp-safepassword

Code Review | Login Protection - Email login and phone login with SafePassword Login Security

WordPress plugin Login Protection - Email login and phone login with SafePassword Login Security scored 68% from 54 tests.

About plugin

  • Plugin page: wp-safepassword
  • Plugin version: 1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2.3
  • WordPress version: 6.3.1
  • First release: Sep 6, 2019
  • Latest release: Sep 16, 2019
  • Number of updates: 41
  • Update frequency: every 0.2 days
  • Top authors: schway (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 637 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.52MB] [CPU: ▼1.51ms] Passed 4 tests

Analyzing server-side resources used by Login Protection - Email login and phone login with SafePassword Login Security
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.15 ▲0.6951.73 ▲10.78
Dashboard /wp-admin3.86 ▲0.5550.72 ▲2.08
Posts /wp-admin/edit.php3.91 ▲0.5552.78 ▲1.18
Add New Post /wp-admin/post-new.php6.37 ▲0.4892.48 ▼16.61
Media Library /wp-admin/upload.php3.72 ▲0.4944.03 ▲7.32

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 45 new files
Database: 1 new table, 7 new options
New tables
wp_spbm_options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
wpsafepassword_activation
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Login Protection - Email login and phone login with SafePassword Login Security
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,982 ▲24714.26 ▼0.129.51 ▲7.8232.69 ▼9.75
Dashboard /wp-admin2,258 ▲735.94 ▲1.0595.91 ▼8.1539.47 ▼3.75
Posts /wp-admin/edit.php2,141 ▲492.47 ▲0.4135.13 ▼6.0433.08 ▼3.25
Add New Post /wp-admin/post-new.php1,538 ▲517.74 ▼5.19620.94 ▼19.0950.97 ▼3.26
Media Library /wp-admin/upload.php1,437 ▲494.45 ▲0.2399.92 ▼15.1543.97 ▼3.73

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie tables were found after uninstall: 1 table
    • wp_spbm_options
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • wpsafepassword_activation
    • widget_recent-posts

Smoke tests 50% 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-safepassword/views/no-access.php
    • > /wp-content/plugins/wp-safepassword/views/header.php
    • > /wp-content/plugins/wp-safepassword/views/footer.php
    • > /wp-content/plugins/wp-safepassword/views/popup.php
  • 26× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Trying to get property 'option' of non-object in wp-content/plugins/wp-safepassword/views/connection/connected.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-safepassword/languages/en.php on line 16
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-safepassword/views/main.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/wp-safepassword/wp-safepassword.php:17
    • > PHP Notice
      Trying to get property 'display' of non-object in wp-content/plugins/wp-safepassword/views/shortcode.php on line 10
    • > PHP Notice
      Trying to get property 'display' of non-object in wp-content/plugins/wp-safepassword/views/main.php on line 11
    • > PHP Notice
      Undefined index: template in wp-content/plugins/wp-safepassword/config/resources.php on line 98
    • > PHP Notice
      Undefined index: template in wp-content/plugins/wp-safepassword/config/resources.php on line 98
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-safepassword/languages/en.php on line 17
    • > PHP Notice
      Trying to get property 'option' of non-object in wp-content/plugins/wp-safepassword/views/connection/disconnected.php on line 7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Screenshots: Add a description for screenshot #4 in wp-safepassword/assets to your readme.txt
  • Tags: Please delete some tags, you are using 35 tag instead of maximum 10
The official readme.txt is a good inspiration

wp-safepassword/wp-safepassword.php 92% from 13 tests

"Login Protection - Email login and phone login with SafePassword Login Security" version 1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 159 characters long)

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
Good job! No executable or dangerous file extensions detected7,460 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
PHP315382852,856
CSS1343922,415
JavaScript73731202,158
Markdown118031

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity26.62
▷ Minimum class complexity2.00
▷ Maximum class complexity101.00
Average method complexity5.01
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods83
▷ Static methods00.00%
▷ Public methods83100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.09MB with 0.07MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
designs/default/images/delete-icon.png1.01KB0.18KB▼ 82.44%
designs/default/images/safepwd-flags.png86.25KB30.60KB▼ 64.52%
designs/default/images/get-code-icon.png1.03KB0.20KB▼ 80.82%