84% georouter

Code Review | GeoRouter

WordPress plugin GeoRouter scored84%from 54 tests.

About plugin

  • Plugin page: georouter
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Apr 28, 2021
  • Latest release: Apr 28, 2021
  • Number of updates: 12
  • Update frequency: every 0.1 days
  • Top authors: webdoodle (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /443 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼6.80ms] Passed 4 tests

An overview of server-side resources used by GeoRouter
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0334.05 ▼7.17
Dashboard /wp-admin3.36 ▲0.0148.41 ▼15.41
Posts /wp-admin/edit.php3.48 ▲0.1148.40 ▼1.79
Add New Post /wp-admin/post-new.php5.94 ▲0.0590.04 ▼1.65
Media Library /wp-admin/upload.php3.28 ▲0.0537.10 ▼2.83
GeoRouter /wp-admin/options-general.php?page=georouter3.2332.85

Server storage [IO: ▲0.32MB] [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: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for GeoRouter
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.05 ▼0.301.82 ▲0.2343.87 ▼2.24
Dashboard /wp-admin2,196 ▲165.54 ▼0.0681.96 ▼12.5540.26 ▲0.63
Posts /wp-admin/edit.php2,104 ▲12.03 ▲0.0439.72 ▼0.0436.07 ▲0.23
Add New Post /wp-admin/post-new.php1,534 ▲623.32 ▲0.33637.68 ▼27.1856.99 ▲2.65
Media Library /wp-admin/upload.php1,404 ▲44.18 ▼0.09102.98 ▼4.8442.37 ▼7.38
GeoRouter /wp-admin/options-general.php?page=georouter8871.9721.6028.14

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=georouter
    • > Warning in wp-content/plugins/georouter/includes/class-georouter-config.php+171
    array_key_exists() expects parameter 2 to be array, bool given
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=georouter
    • > Notice in wp-content/plugins/georouter/includes/class-georouter-config.php+166
    Trying to access array offset on value of type bool

SRP Passed 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
The SRP test was a success

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 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Screenshots: Add descriptions for screenshots #1, #2, #3 in georouter/assets to your readme.txt
The official readme.txt might help

georouter/georouter.php Passed 13 tests

Analyzing the main PHP file in "GeoRouter" version 1.0.1
123 characters long description:
Auto-redirect website visitors using IP geolocation technology. Configure your routing by continent, country, state & city.

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
Good job! No executable or dangerous file extensions detected291 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP33452291

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.26
Average class complexity7.33
▷ Minimum class complexity3.00
▷ Maximum class complexity15.00
Average method complexity1.70
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods27
▷ Static methods622.22%
▷ Public methods27100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 compressed PNG files occupy 0.21MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png18.95KB18.87KB0.39%
assets/screenshot-1.png176.02KB179.77KB0.00%
assets/icon-256x256.png15.45KB12.71KB▼ 17.76%
assets/screenshot-3.png8.52KB8.04KB▼ 5.62%