83% geo-traffic-control-and-redirect

Code Review | GEO Traffic Control and Redirect

WordPress plugin GEO Traffic Control and Redirect scored83%from 54 tests.

About plugin

  • Plugin page: geo-traffic-contr...
  • Plugin version: 2.9.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.9.2
  • WordPress version: 6.3.1
  • First release: Apr 20, 2022
  • Latest release: Apr 20, 2022
  • Number of updates: 3
  • Update frequency: every 12.0 days
  • Top authors: devander (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /320 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.39MB] [CPU: ▼0.40ms] 75% from 4 tests

An overview of server-side resources used by GEO Traffic Control and Redirect
The following require your attention
  • CPU: You should keep total CPU usage under 500.00ms (currently 1,002.57ms on /wp-admin/admin.php?page=plgsggeo_extensions_page)
PageMemory (MB)CPU Time (ms)
Home /3.84 ▲0.3841.10 ▼1.21
Dashboard /wp-admin3.70 ▲0.4074.18 ▲27.78
Posts /wp-admin/edit.php3.82 ▲0.4656.97 ▲10.55
Add New Post /wp-admin/post-new.php6.28 ▲0.4088.71 ▼16.19
Media Library /wp-admin/upload.php3.63 ▲0.4039.94 ▲5.23
Settings & Support /wp-admin/admin.php?page=plgsggeo_protection&tab=43.9365.40
Get Full Version /wp-admin/admin.php?page=register_plgsggeo_upgrade_redirect3.8135.23
Backend protection /wp-admin/admin.php?page=plgsggeo_protection&tab=13.8548.83
GEO Redirect /wp-admin/admin.php?page=plgsggeo_protection&tab=53.8251.35
Logs /wp-admin/admin.php?page=plgsggeo_protection&tab=23.8250.83
Security Extensions /wp-admin/admin.php?page=plgsggeo_extensions_page4.051,002.57
Front-end protection /wp-admin/admin.php?page=plgsggeo_protection3.8552.35
Customize & Style /wp-admin/admin.php?page=plgsggeo_protection&tab=33.8248.47

Server storage [IO: ▲11.02MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
These are issues you should consider
  • Illegal file modification detected: 2 files (5.70KB) outside of "wp-content/plugins/geo-traffic-control-and-redirect/" and "wp-content/uploads/"
    • (modified) wp-config.php
    • (modified) .htaccess
Filesystem: 64 new files
Database: 3 new tables, 6 new options
New tables
wp_plgsggeo_stats
wp_plgsggeo_ip
wp_plgsggeo_config
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for GEO Traffic Control and Redirect
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲8214.55 ▼0.041.58 ▼0.4439.19 ▼5.67
Dashboard /wp-admin2,237 ▲604.99 ▼0.7097.47 ▲1.3070.54 ▲33.54
Posts /wp-admin/edit.php2,151 ▲512.35 ▲0.2934.98 ▼9.4636.85 ▼2.27
Add New Post /wp-admin/post-new.php1,723 ▲17822.88 ▼0.36672.56 ▲65.8931.23 ▼19.18
Media Library /wp-admin/upload.php1,445 ▲454.55 ▲0.34103.01 ▼4.7081.91 ▲35.96
Settings & Support /wp-admin/admin.php?page=plgsggeo_protection&tab=41,3442.3637.42141.39
Get Full Version /wp-admin/admin.php?page=register_plgsggeo_upgrade_redirect2,5994.7076.5175.17
Backend protection /wp-admin/admin.php?page=plgsggeo_protection&tab=12,5292.2334.4274.88
GEO Redirect /wp-admin/admin.php?page=plgsggeo_protection&tab=58,3812.3142.76183.45
Logs /wp-admin/admin.php?page=plgsggeo_protection&tab=21,3452.9268.6171.28
Security Extensions /wp-admin/admin.php?page=plgsggeo_extensions_page1,6401.9527.2673.75
Front-end protection /wp-admin/admin.php?page=plgsggeo_protection2,5602.2834.8971.19
Customize & Style /wp-admin/admin.php?page=plgsggeo_protection&tab=31,3732.3336.9865.49

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
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=plgsggeo_protection&tab=4
    • > Notice in wp-content/plugins/geo-traffic-control-and-redirect/geo-traffic-control-and-redirect.php+2602
    Constant DIRSEP already defined

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 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
Attributes that require attention: You can take inspiration from this readme.txt

geo-traffic-control-and-redirect/geo-traffic-control-and-redirect.php Passed 13 tests

"GEO Traffic Control and Redirect" version 2.9.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
138 characters long description:
Adds more security for your WordPress website. Blocks unwanted traffic, protects backend page. Blocks specific countries and IP addresses.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin11,839 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
SVG93166,729
PHP47751014,291
CSS130372439
JavaScript2215375
HTML1004
JSON1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity68.20
▷ Minimum class complexity8.00
▷ Maximum class complexity120.00
Average method complexity5.25
▷ Minimum method complexity1.00
▷ Maximum method complexity73.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods79
▷ Static methods4556.96%
▷ Public methods5772.15%
▷ Protected methods00.00%
▷ Private methods2227.85%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.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
11 PNG files occupy 0.27MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/livechat.png14.97KB6.22KB▼ 58.43%
images/b10.png45.38KB12.07KB▼ 73.40%
images/b13.png34.81KB8.06KB▼ 76.86%
images/rek2.png18.78KB8.07KB▼ 57.02%
images/geo-protection-logo.png1.24KB0.65KB▼ 47.88%