84% cloudguard

Code Review | CloudGuard

WordPress plugin CloudGuard scored84%from 54 tests.

About plugin

  • Plugin page: cloudguard
  • Plugin version: 1.4.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.4
  • WordPress version: 6.3.1
  • First release: Sep 18, 2015
  • Latest release: Oct 9, 2023
  • Number of updates: 76
  • Update frequency: every 38.7 days
  • Top authors: pipdig (100%)

Code review

54 tests

User reviews

26 reviews

Install metrics

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

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

Server-side resources used by CloudGuard
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0937.30 ▼1.76
Dashboard /wp-admin3.41 ▲0.1047.34 ▲1.36
Posts /wp-admin/edit.php3.46 ▲0.1044.83 ▲1.18
Add New Post /wp-admin/post-new.php5.99 ▲0.1084.21 ▼23.12
Media Library /wp-admin/upload.php3.33 ▲0.1033.35 ▲1.45
CloudGuard /wp-admin/options-general.php?page=cloudguard3.3032.26

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 285 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by CloudGuard
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲7014.36 ▼0.011.71 ▲0.0143.68 ▲3.98
Dashboard /wp-admin2,237 ▲575.65 ▲0.0899.09 ▲9.1643.68 ▲0.75
Posts /wp-admin/edit.php2,104 ▲12.00 ▲0.0234.14 ▼1.9231.78 ▼4.29
Add New Post /wp-admin/post-new.php1,529 ▼023.58 ▲0.25678.56 ▲68.9963.27 ▲4.25
Media Library /wp-admin/upload.php1,404 ▲14.19 ▼0.0295.01 ▼8.9143.04 ▲0.50
CloudGuard /wp-admin/options-general.php?page=cloudguard8512.1430.0529.28

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
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 status_header() in wp-content/plugins/cloudguard/uninstall.php:5

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)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: login, restrict, geolocation, country, ip...

cloudguard/cloudguard.php Passed 13 tests

"CloudGuard" version 1.4.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
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 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected3,300 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript4042,373
PHP39731648
SVG323208
CSS113071

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.54
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 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
253 PNG files occupy 0.19MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/flags/mh.png0.68KB0.70KB0.00%
assets/flags/sh.png3.92KB0.58KB▼ 85.16%
assets/flags/tv.png0.59KB0.53KB▼ 9.82%
assets/flags/ck.png0.62KB0.58KB▼ 5.24%
assets/flags/et.png0.55KB0.54KB▼ 1.94%