84% country-redirect

Code Review | country-redirect

WordPress plugin country-redirect scored84%from 54 tests.

About plugin

  • Plugin page: country-redirect
  • Plugin version: 1.3.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.8.2
  • WordPress version: 6.3.1
  • First release: Oct 30, 2019
  • Latest release: Dec 25, 2021
  • Number of updates: 19
  • Update frequency: every 41.4 days
  • Top authors: web8moon (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

900+ active /10,843 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.69MB] [CPU: ▼4.66ms] Passed 4 tests

Server-side resources used by country-redirect
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1136.68 ▼5.43
Dashboard /wp-admin4.19 ▲0.8847.83 ▼5.50
Posts /wp-admin/edit.php4.30 ▲0.9449.86 ▼0.09
Add New Post /wp-admin/post-new.php6.77 ▲0.8894.95 ▼7.63
Media Library /wp-admin/upload.php4.11 ▲0.8836.56 ▲4.22
Country Redirect /wp-admin/options-general.php?page=country-redirect-options4.0833.18

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 101 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for country-redirect
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲8813.24 ▼1.061.65 ▼0.0139.84 ▼6.74
Dashboard /wp-admin2,213 ▲256.06 ▲0.2597.64 ▼2.8842.05 ▼2.49
Posts /wp-admin/edit.php2,093 ▲42.05 ▼0.1240.30 ▼1.6835.39 ▼0.18
Add New Post /wp-admin/post-new.php1,536 ▲323.05 ▼0.14611.05 ▲4.3654.33 ▲2.18
Media Library /wp-admin/upload.php1,395 ▲104.20 ▼0.1197.63 ▼3.9041.53 ▼2.39
Country Redirect /wp-admin/options-general.php?page=country-redirect-options8352.0222.1628.36

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
Please take a closer look at the following
  • 35× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Model\\City' not found in wp-content/plugins/country-redirect/vendor/geoip2/geoip2/src/Model/Enterprise.php:45
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Record\\AbstractRecord' not found in wp-content/plugins/country-redirect/vendor/geoip2/geoip2/src/Record/Traits.php:91
    • > PHP Fatal error
      Uncaught Error: Class 'MaxMind\\Exception\\InvalidRequestException' not found in wp-content/plugins/country-redirect/vendor/maxmind/web-service-common/src/Exception/InsufficientFundsException.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Record\\AbstractRecord' not found in wp-content/plugins/country-redirect/vendor/geoip2/geoip2/src/Record/Postal.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Model\\City' not found in wp-content/plugins/country-redirect/vendor/geoip2/geoip2/src/Model/Insights.php:45
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Record\\AbstractRecord' not found in wp-content/plugins/country-redirect/vendor/geoip2/geoip2/src/Record/MaxMind.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Record\\Country' not found in wp-content/plugins/country-redirect/vendor/geoip2/geoip2/src/Record/RepresentedCountry.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Exception\\GeoIp2Exception' not found in wp-content/plugins/country-redirect/vendor/geoip2/geoip2/src/Exception/AuthenticationException.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Model\\AbstractModel' not found in wp-content/plugins/country-redirect/vendor/geoip2/geoip2/src/Model/ConnectionType.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Record\\AbstractRecord' not found in wp-content/plugins/country-redirect/vendor/geoip2/geoip2/src/Record/AbstractPlaceRecord.php:5

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

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: redirect by ip, ip, geo, redirect, redirect by country...

country-redirect/country-redirect.php 92% from 13 tests

The main file in "country-redirect" v. 1.3.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin5,185 lines of code in 84 files:
LanguageFilesBlank linesComment linesLines of code
PHP666191,6873,234
Markdown73600830
C19718582
JSON600376
PO File1234383
Bourne Shell120040
m418032
C/C++ Header14128

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity7.15
▷ Minimum class complexity1.00
▷ Maximum class complexity78.00
Average method complexity3.06
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces14
Interfaces2
Traits0
Classes50
▷ Abstract classes36.00%
▷ Concrete classes4794.00%
▷ Final classes00.00%
Methods152
▷ Static methods117.24%
▷ Public methods10166.45%
▷ Protected methods63.95%
▷ Private methods4529.61%
Functions31
▷ Named functions2270.97%
▷ Anonymous functions929.03%
Constants22
▷ Global constants418.18%
▷ Class constants1881.82%
▷ Public constants18100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin