79% foxlis-geo

Code Review | Foxlis Geo

WordPress plugin Foxlis Geo scored79%from 54 tests.

About plugin

  • Plugin page: foxlis-geo
  • Plugin version: 2.8.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-5.7
  • WordPress version: 6.3.1
  • First release: Jan 21, 2021
  • Latest release: May 7, 2021
  • Number of updates: 72
  • Update frequency: every 1.5 days
  • Top authors: foxlis (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,376 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▼6.96ms] Passed 4 tests

This is a short check of server-side resources used by Foxlis Geo
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2242.80 ▼0.88
Dashboard /wp-admin3.49 ▲0.1549.82 ▼16.66
Posts /wp-admin/edit.php3.60 ▲0.2549.09 ▲0.19
Add New Post /wp-admin/post-new.php6.10 ▲0.2192.69 ▼10.47
Media Library /wp-admin/upload.php3.41 ▲0.1844.76 ▲6.69
Filter /wp-admin/admin.php?page=foxlis_geo_options_filter3.3832.75
Development /wp-admin/admin.php?page=foxlis_geo_options_development3.3836.40
About /wp-admin/admin.php?page=foxlis_geo3.42237.78
Options /wp-admin/admin.php?page=foxlis_geo_options3.3830.26
Account /wp-admin/admin.php?page=foxlis_geo_options_account3.4332.78
Redirect /wp-admin/admin.php?page=foxlis_geo_options_redirect3.3835.23

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 37 new files
Database: no new tables, 9 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
foxlis_geo_options
foxlis_geo_options_development
widget_theysaidso_widget
can_compress_scripts
foxlis_geo_options_filter

Browser metrics Passed 4 tests

Foxlis Geo: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲6214.35 ▼0.371.60 ▼0.6941.82 ▼0.98
Dashboard /wp-admin2,227 ▲505.56 ▼0.0189.72 ▼13.3075.86 ▲32.77
Posts /wp-admin/edit.php2,147 ▲471.97 ▼0.0637.46 ▼0.6832.69 ▼4.90
Add New Post /wp-admin/post-new.php1,715 ▲18922.13 ▼0.76688.63 ▼17.9465.50 ▲11.56
Media Library /wp-admin/upload.php1,444 ▲474.16 ▼0.06104.25 ▼2.6676.05 ▲27.72
Filter /wp-admin/admin.php?page=foxlis_geo_options_filter8741.9925.2730.04
Development /wp-admin/admin.php?page=foxlis_geo_options_development8772.0124.2529.22
About /wp-admin/admin.php?page=foxlis_geo1,0262.0023.2341.78
Options /wp-admin/admin.php?page=foxlis_geo_options1,0502.0123.0123.98
Account /wp-admin/admin.php?page=foxlis_geo_options_account8431.9824.5030.42
Redirect /wp-admin/admin.php?page=foxlis_geo_options_redirect1,0782.0024.2229.22

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 9 options
    • widget_recent-comments
    • can_compress_scripts
    • foxlis_geo_options_development
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • foxlis_geo_options_filter
    • foxlis_geo_options
    • db_upgraded

Smoke tests 50% 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
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=foxlis_geo
    • > Warning in wp-content/plugins/foxlis-geo/src/Foxlis/Geo/Services/FoxlisGeoService.php+170
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=foxlis_geo
    • > Warning in wp-content/plugins/foxlis-geo/src/Foxlis/Geo/Services/FoxlisGeoService.php+170
    file_get_contents(http://geo.foxlis.com/get-geo-by-ip/127.0.0.1): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known

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
Please fix the following
  • 15× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Foxlis\\Geo\\Entities\\FoxlisGeoAbstractEntity' not found in wp-content/plugins/foxlis-geo/src/Foxlis/Geo/Entities/FoxlisGeoAbstractEntityLanguages.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/foxlis-geo/foxlis-geo-api.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Foxlis\\Geo\\Entities\\FoxlisGeoAbstractEntityLanguagesLocation' not found in wp-content/plugins/foxlis-geo/src/Foxlis/Geo/Entities/FoxlisGeoCountry.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Foxlis\\Geo\\Entities\\FoxlisGeoAbstractEntityLanguagesLocation' not found in wp-content/plugins/foxlis-geo/src/Foxlis/Geo/Entities/FoxlisGeoContinent.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/foxlis-geo/foxlis-geo-redirect.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/foxlis-geo/foxlis-geo.php:72
    • > PHP Fatal error
      Uncaught Error: Class 'Foxlis\\Geo\\Entities\\FoxlisGeoAbstractEntityLanguages' not found in wp-content/plugins/foxlis-geo/src/Foxlis/Geo/Entities/FoxlisGeoAbstractEntityLanguagesLocation.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Foxlis\\Geo\\Entities\\FoxlisGeoAbstractEntityLanguagesLocation' not found in wp-content/plugins/foxlis-geo/src/Foxlis/Geo/Entities/FoxlisGeoCity.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/foxlis-geo/foxlis-geo-filter.php:47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/foxlis-geo/foxlis-geo-options.php:122

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

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
9 plugin tags: redirect, developing, country, ip-location, location...

foxlis-geo/foxlis-geo.php Passed 13 tests

"Foxlis Geo" version 2.8.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
40 characters long description:
Find geo location website visitor by ip.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected2,231 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP323731652,062
JavaScript1120140
CSS14029

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity6.91
▷ Minimum class complexity1.00
▷ Maximum class complexity51.00
Average method complexity2.72
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces10
Interfaces1
Traits0
Classes22
▷ Abstract classes313.64%
▷ Concrete classes1986.36%
▷ Final classes00.00%
Methods81
▷ Static methods89.88%
▷ Public methods6377.78%
▷ Protected methods00.00%
▷ Private methods1822.22%
Functions42
▷ Named functions3788.10%
▷ Anonymous functions511.90%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/foxlis-icon-mini.png0.72KB0.57KB▼ 21.38%