84% real-protection-otp

Code Review | Real Protection & Safegaurd OTP

WordPress plugin Real Protection & Safegaurd OTP scored84%from 54 tests.

About plugin

  • Plugin page: real-protection-otp
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.4.1
  • WordPress version: 6.3.1
  • First release: Jun 6, 2020
  • Latest release: Jun 11, 2020
  • Number of updates: 3
  • Update frequency: every 2.3 days
  • Top authors: prabalsslw (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /641 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
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by Real Protection & Safegaurd OTP
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0143.20 ▼2.95
Dashboard /wp-admin3.35 ▲0.0447.32 ▼5.64
Posts /wp-admin/edit.php3.40 ▲0.0447.13 ▼8.92
Add New Post /wp-admin/post-new.php5.93 ▲0.0486.17 ▼8.76
Media Library /wp-admin/upload.php3.27 ▲0.0435.83 ▼0.26
OTP Settings /wp-admin/admin.php?page=safeguard-otp-settings3.2434.37
Safeguard Login /wp-admin/admin.php?page=safeguard-login3.2736.01
Alert SMS Record /wp-admin/admin.php?page=safeguard-woo-alert3.2733.26

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 26 new files
Database: 2 new tables, 8 new options
New tables
wp_safeguard_wooalert
wp_safeguard_otp
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
safeg_setting
safeg_db_version
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Real Protection & Safegaurd OTP: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲3614.31 ▼0.041.83 ▼0.5346.14 ▲1.50
Dashboard /wp-admin2,222 ▲515.49 ▼0.1189.75 ▲3.0239.13 ▼6.29
Posts /wp-admin/edit.php2,133 ▲302.00 ▼0.0035.09 ▼6.2333.06 ▼12.02
Add New Post /wp-admin/post-new.php1,553 ▲1823.11 ▲4.74691.44 ▲66.3652.15 ▼24.55
Media Library /wp-admin/upload.php1,433 ▲334.18 ▲0.0197.65 ▲1.7145.49 ▲0.57
OTP Settings /wp-admin/admin.php?page=safeguard-otp-settings1,0732.1323.7630.93
Safeguard Login /wp-admin/admin.php?page=safeguard-login8692.0027.5324.33
Alert SMS Record /wp-admin/admin.php?page=safeguard-woo-alert8612.0223.7125.74

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
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

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 items
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      require_once(SAFEG_PATHlib/safeguard-sms-api.php): failed to open stream: No such file or directory in wp-content/plugins/real-protection-otp/lib/safeguard-woo-alert.php on line 8
    • > PHP Fatal error
      require_once(): Failed opening required 'SAFEG_PATHlib/safeguard-sms-api.php' (include_path='.:/usr/share/php') in wp-content/plugins/real-protection-otp/lib/safeguard-resend-otp.php on line 5
    • > PHP Warning
      Use of undefined constant SAFEG_PATH - assumed 'SAFEG_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/real-protection-otp/lib/safeguard-resend-otp.php on line 5
    • > PHP Warning
      Use of undefined constant SAFEG_PATH - assumed 'SAFEG_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/real-protection-otp/lib/safeguard-woo-alert.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/real-protection-otp/include/safeguard-otp-report.php:9
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/real-protection-otp/include/safeguard-woo-report.php:9
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/real-protection-otp/include/safeguard-otp-report.php on line 8
    • > PHP Warning
      require_once(SAFEG_PATHlib/safeguard-sms-api.php): failed to open stream: No such file or directory in wp-content/plugins/real-protection-otp/lib/safeguard-resend-otp.php on line 5
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/real-protection-otp/include/safeguard-woo-report.php on line 8
    • > PHP Fatal error
      require_once(): Failed opening required 'SAFEG_PATHlib/safeguard-sms-api.php' (include_path='.:/usr/share/php') in wp-content/plugins/real-protection-otp/lib/safeguard-woo-alert.php on line 8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% 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:
  • Tags: Please reduce the number of tags, currently 18 tag instead of maximum 10
The official readme.txt might help

real-protection-otp/safeguard-otp.php 92% from 13 tests

"Real Protection & Safegaurd OTP" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("real-protection-otp.php" instead of "safeguard-otp.php")

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 plugin2,090 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP15473982,062
CSS13028

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity41.40
▷ Minimum class complexity5.00
▷ Maximum class complexity101.00
Average method complexity4.81
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods53
▷ Static methods59.43%
▷ Public methods53100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions1593.75%
▷ Anonymous functions16.25%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.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
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
image/safeguard-logo.png18.94KB13.19KB▼ 30.37%