84% injection-guard

Code Review | Injection Guard

WordPress plugin Injection Guard scored84%from 54 tests.

About plugin

  • Plugin page: injection-guard
  • Plugin version: 1.2.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2
  • WordPress version: 6.3.1
  • First release: Feb 21, 2014
  • Latest release: May 11, 2023
  • Number of updates: 51
  • Update frequency: every 66.0 days
  • Top authors: fahadmahmood (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

2,000+ active /22,174 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼5.89ms] Passed 4 tests

An overview of server-side resources used by Injection Guard
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2842.62 ▲4.44
Dashboard /wp-admin3.38 ▲0.0743.27 ▼3.41
Posts /wp-admin/edit.php3.49 ▲0.1344.92 ▼3.68
Add New Post /wp-admin/post-new.php5.96 ▲0.0780.34 ▼16.35
Media Library /wp-admin/upload.php3.30 ▲0.0735.05 ▼0.11
IG Settings /wp-admin/options-general.php?page=ig_settings3.3332.03

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 39 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
ig_requests_log
widget_recent-posts

Browser metrics Passed 4 tests

Injection Guard: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.55 ▼0.831.90 ▲0.1447.14 ▲8.49
Dashboard /wp-admin2,210 ▲284.86 ▼0.9994.61 ▼6.6338.26 ▼6.02
Posts /wp-admin/edit.php2,093 ▲41.99 ▼0.0035.96 ▼1.6332.59 ▼4.27
Add New Post /wp-admin/post-new.php1,537 ▲2323.09 ▲5.53652.88 ▲14.6657.70 ▲5.47
Media Library /wp-admin/upload.php1,392 ▲104.19 ▼0.0697.13 ▼0.2842.04 ▼2.84
IG Settings /wp-admin/options-general.php?page=ig_settings1,2482.0730.3252.02

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • ig_requests_log
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function count_users() in wp-content/plugins/injection-guard/templates/dashboard.php:3

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: tool, blacklist, security, anti-hacking

injection-guard/index.php 85% from 13 tests

The principal PHP file in "Injection Guard" v. 1.2.3 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 182 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("injection-guard.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin10,991 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
SVG30129,445
PHP538775697
JavaScript3132109496
CSS53019191
PO File35757162

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity6.33
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods1794.44%
▷ Protected methods00.00%
▷ Private methods15.56%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.13MB with 0.03MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/glyphicons-halflings-white.png8.57KB9.20KB0.00%
img/glyphicons-halflings.png12.50KB10.35KB▼ 17.19%
img/kindness.png3.80KB2.98KB▼ 21.60%
img/glyphicons.png108.59KB52.69KB▼ 51.48%