71% sg-security

Code Review | Security Optimizer - The All-In-One WordPress Protection Plugin

WordPress plugin Security Optimizer - The All-In-One WordPress Protection Plugin scored71%from 54 tests.

About plugin

  • Plugin page: sg-security
  • Plugin version: 1.4.8
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4
  • WordPress version: 6.3.1
  • First release: May 31, 2021
  • Latest release: Nov 22, 2023
  • Number of updates: 110
  • Update frequency: every 8.3 days
  • Top authors: elenachavdarova (50.91%)stoyangeorgiev (21.82%)sstoqnov (15.45%)ignatggeorgiev (14.55%)

Code review

54 tests

User reviews

122 reviews

Install metrics

1,000,000+ active /14,423,347 total downloads

Benchmarks

Plugin footprint 82% 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.37MB] [CPU: ▲0.75ms] Passed 4 tests

Server-side resources used by Security Optimizer - The All-In-One WordPress Protection Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.85 ▲0.3945.85 ▲6.26
Dashboard /wp-admin3.68 ▲0.3354.77 ▼10.43
Posts /wp-admin/edit.php3.73 ▲0.3756.31 ▲6.61
Add New Post /wp-admin/post-new.php6.38 ▲0.4999.07 ▲2.34
Media Library /wp-admin/upload.php3.60 ▲0.3740.22 ▲4.81
Dashboard /wp-admin/admin.php?page=sg-security3.5739.75
Login Security /wp-admin/admin.php?page=login-settings3.5738.27
Post-hack Actions /wp-admin/admin.php?page=post-hack-actions3.5742.07
Activity Log /wp-admin/admin.php?page=activity-log3.5737.32
Site Security /wp-admin/admin.php?page=site-security3.5739.78
SG Plugins /wp-admin/options-general.php?page=siteground_settings3.5737.35

Server storage [IO: ▲1.74MB] [DB: ▲0.01MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Please try to fix the following items
  • You have illegally modified 4 files (1.50KB) outside of "wp-content/plugins/sg-security/" and "wp-content/uploads/"
    • (new file) wp-includes/.htaccess
    • (modified) .htaccess
    • (new file) wp-content/sgs_encrypt_key.php
    • (new file) wp-content/.htaccess
Filesystem: 311 new files
Database: 2 new tables, 23 new options
New tables
wp_sgs_log_events
wp_sgs_log_visitors
New WordPress options
siteground_data_token
sg_security_wp_remove_version
widget_recent-posts
sg_security_update_timestamp
sg_security_version
widget_theysaidso_widget
sg_security_disable_xml_rpc
sg_security_login_attempts
sg_security_lock_system_folders
sg_security_login_type
...

Browser metrics Passed 4 tests

Security Optimizer - The All-In-One WordPress Protection Plugin: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲8814.67 ▲0.441.55 ▼0.0738.24 ▼4.19
Dashboard /wp-admin2,230 ▲535.55 ▼0.1195.92 ▼1.7582.37 ▲33.92
Posts /wp-admin/edit.php2,150 ▲502.01 ▲0.0236.18 ▼0.7334.98 ▲0.51
Add New Post /wp-admin/post-new.php1,563 ▲3723.64 ▲0.54596.54 ▼45.81163.69 ▲112.47
Media Library /wp-admin/upload.php1,444 ▲444.17 ▼0.0998.94 ▼6.3376.59 ▲29.96
Dashboard /wp-admin/admin.php?page=sg-security1,2326.40133.43143.31
Login Security /wp-admin/admin.php?page=login-settings9856.10109.5959.09
Post-hack Actions /wp-admin/admin.php?page=post-hack-actions9384.4189.5655.14
Activity Log /wp-admin/admin.php?page=activity-log1,2225.43101.0259.61
Site Security /wp-admin/admin.php?page=site-security1,0055.8390.6554.62
SG Plugins /wp-admin/options-general.php?page=siteground_settings8722.0125.6627.18

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options were found after uninstall: 22 options
    • widget_recent-comments
    • sg_security_lock_system_folders
    • theysaidso_admin_options
    • widget_recent-posts
    • sg_security_disable_xml_rpc
    • db_upgraded
    • sg_security_login_type
    • sg_security_login_attempts
    • sg_security_wp_remove_version
    • sg_security_disable_file_edit
    • ...

Smoke tests 25% 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 fix the following items
  • 10× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/sg-security/templates/weekly_report.php
    • > /wp-content/plugins/sg-security/templates/partials/weekly_report_non_sg.php
    • > /wp-content/plugins/sg-security/templates/partials/weekly-report/intro/default.php
    • > /wp-content/plugins/sg-security/templates/partials/weekly-report/learn-more/it_IT.php
    • > /wp-content/plugins/sg-security/templates/partials/weekly-report/learn-more/de_DE.php
    • > /wp-content/plugins/sg-security/templates/partials/weekly-report/learn-more/default.php
    • > /wp-content/plugins/sg-security/templates/partials/weekly-report/learn-more/es_ES.php
    • > /wp-content/plugins/sg-security/templates/partials/weekly-report/intro/es_ES.php
    • > /wp-content/plugins/sg-security/templates/partials/weekly-report/intro/de_DE.php
    • > /wp-content/plugins/sg-security/templates/partials/weekly-report/intro/it_IT.php
  • 301× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/sg-security/vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/sg-security/templates/partials/new-backup-codes.php:2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/sg-security/templates/partials/weekly-report/intro/default.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/sg-security/vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php:8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/sg-security/templates/partials/weekly-report/intro/it_IT.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/sg-security/vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php:4
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/sg-security/templates/partials/weekly_report_non_sg.php on line 29
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/sg-security/templates/partials/weekly-report/intro/default.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/sg-security/vendor/composer/installers/src/Composer/Installers/ChefInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'SG_Security\\Activity_Log\\Activity_Log_Helper' not found in wp-content/plugins/sg-security/core/Activity_Log/Activity_Log_Posts.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There are user-side issues you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=activity-log
    • > Console-api (warning) in wp-content/plugins/sg-security/assets/js/main.min.js?ver=1.4.8+1:359673
    %c\"column.renderHead\" will be deprecated in favor of \"column.render\" " "color: red; font-size: small
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=activity-log
    • > Console-api (warning) in wp-content/plugins/sg-security/assets/js/main.min.js?ver=1.4.8+1:359673
    %cUsing \"cell.accessor\" as default column header will be deprecated." "color: red; font-size: small
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=site-security
    • > Console-api (warning) in wp-content/plugins/sg-security/assets/js/main.min.js?ver=1.4.8+1:359673
    %c\"checkIcon\" will be deprecated, please use \"icon\" instead" "color: red; font-size: small

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (12 tag instead of maximum 10)
  • Screenshots: Add descriptions for screenshots #1, #2, #3, #4, #5 in sg-security/assets to your readme.txt
The official readme.txt is a good inspiration

sg-security/sg-security.php 85% from 13 tests

The primary PHP file in "Security Optimizer - The All-In-One WordPress Protection Plugin" version 1.4.8 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Description: Keep the plugin description shorter than 140 characters (currently 320 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected14,710 lines of code in 284 files:
LanguageFilesBlank linesComment linesLines of code
PHP2342,8476,68612,634
JSON14401,022
Markdown132510562
PO File115085301
XML42067
CSS10064
YAML47045
JavaScript21214
SVG1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity6.85
▷ Minimum class complexity1.00
▷ Maximum class complexity114.00
Average method complexity2.63
▷ Minimum method complexity1.00
▷ Maximum method complexity53.00
Code structure
Namespaces41
Interfaces1
Traits8
Classes194
▷ Abstract classes42.06%
▷ Concrete classes19097.94%
▷ Final classes00.00%
Methods742
▷ Static methods739.84%
▷ Public methods64386.66%
▷ Protected methods618.22%
▷ Private methods385.12%
Functions18
▷ Named functions211.11%
▷ Anonymous functions1688.89%
Constants14
▷ Global constants428.57%
▷ Class constants1071.43%
▷ Public constants10100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin