94% cloudguard

Code Review | CloudGuard

WordPress plugin CloudGuard scored 94% from 53 tests.

About plugin

  • Plugin page: cloudguard
  • Plugin version: 1.4.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.8
  • WordPress version: 5.8.1
  • First release: Sep 18, 2015
  • Latest release: Jul 23, 2021
  • Number of updates: 70
  • Update frequency: every 30.5 days
  • Top authors: pipdig (100%)

Code review

53 tests

User reviews

20 reviews

Install metrics

1,000+ active / 18,244 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.10MB] [CPU: ▼257.82ms] Passed 4 tests

Analyzing server-side resources used by CloudGuard
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.92 ▲0.2129.58 ▲8.74
Dashboard /wp-admin3.16 ▲0.1044.11 ▲4.74
Posts /wp-admin/edit.php3.21 ▲0.1046.33 ▼7.28
Add New Post /wp-admin/post-new.php5.52 ▲0.0998.76 ▼1,020.12
Media Library /wp-admin/upload.php3.10 ▲0.0930.07 ▼8.63
CloudGuard /wp-admin/options-general.php?page=cloudguard3.0728.09

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 283 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by CloudGuard
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,760 ▲17816.18 ▲0.697.93 ▲0.4450.15 ▲7.44
Dashboard /wp-admin3,014 ▲1646.11 ▲0.29143.71 ▲5.16111.30 ▲9.08
Posts /wp-admin/edit.php2,711 ▲52.69 ▲0.0268.91 ▲1.30100.81 ▼8.28
Add New Post /wp-admin/post-new.php1,856 ▲319.18 ▲0.13362.73 ▼20.49113.07 ▼1.11
Media Library /wp-admin/upload.php1,792 ▲175.03 ▲0.07151.85 ▼8.76111.67 ▼7.37
CloudGuard /wp-admin/options-general.php?page=cloudguard1,0712.6364.2166.45

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstall script ran successfully

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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function status_header() in wp-content/plugins/cloudguard/uninstall.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
8 plugin tags: admin, restrict, ip, cloudflare, geolocation...

cloudguard/cloudguard.php Passed 13 tests

"CloudGuard" version 1.4.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
64 characters long description:
Restrict access to your login page using Cloudflare Geolocation.

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
No dangerous file extensions were detected3,295 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript4042,373
PHP39131643
SVG323208
CSS113071

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Using a strong compression for your PNG files is a great way to speed-up your plugin
251 compressed PNG files occupy 0.19MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/flags/mz.png0.53KB0.54KB0.00%
assets/flags/id.png0.33KB0.31KB▼ 5.71%
assets/flags/hu.png0.36KB0.31KB▼ 13.55%
assets/flags/gy.png0.67KB0.72KB0.00%
assets/flags/mc.png0.33KB0.31KB▼ 5.71%