84% getastra

Code Review | Astra Security Suite – Firewall & Malware Scan

WordPress plugin Astra Security Suite – Firewall & Malware Scan scored84%from 54 tests.

About plugin

  • Plugin page: getastra
  • Plugin version: 0.2
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-6.1.1
  • WordPress version: 6.3.1
  • First release: Sep 20, 2019
  • Latest release: Dec 13, 2022
  • Number of updates: 21
  • Update frequency: every 56.2 days
  • Top authors: astrasecuritysuite (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

1,000+ active /18,098 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
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼6.01ms] Passed 4 tests

A check of server-side resources used by Astra Security Suite – Firewall & Malware Scan
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.78 ▲0.0542.15 ▼2.35
Dashboard /wp-admin3.62 ▲0.0555.15 ▼1.45
Posts /wp-admin/edit.php3.73 ▲0.0549.53 ▼2.55
Add New Post /wp-admin/post-new.php6.20 ▲0.0591.17 ▼17.67
Media Library /wp-admin/upload.php3.54 ▲0.0540.72 ▲4.19

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Astra Security Suite – Firewall & Malware Scan
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲4414.41 ▲0.021.65 ▼0.2143.75 ▼3.14
Dashboard /wp-admin2,214 ▲345.65 ▼0.0098.51 ▲7.2943.09 ▼4.20
Posts /wp-admin/edit.php2,119 ▲191.99 ▼0.0534.84 ▼0.9132.38 ▼2.80
Add New Post /wp-admin/post-new.php1,539 ▲717.61 ▼5.70683.45 ▼2.7056.62 ▲4.88
Media Library /wp-admin/upload.php1,413 ▲164.16 ▼0.14113.37 ▼0.3348.57 ▼2.27

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/getastra/astra-admin.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/getastra/astra-security.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: malware cleanup, security, security audit, firewall, hack removal...

getastra/astra-security.php 92% from 13 tests

The main PHP file in "Astra Security Suite – Firewall & Malware Scan" ver. 0.2 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("getastra.php" instead of "astra-security.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin977 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP4147217762
CSS3476214
JavaScript1051

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity16.33
▷ Minimum class complexity3.00
▷ Maximum class complexity39.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods23
▷ Static methods00.00%
▷ Public methods2295.65%
▷ Protected methods14.35%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
3 PNG files occupy 0.31MB with 0.10MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/Astra-dashboard1.png119.77KB28.74KB▼ 76.00%
img/Ingrid_bw.png197.67KB201.64KB0.00%
img/astra-s-white-logo.png3.23KB2.63KB▼ 18.60%