74% zanto-country-detector

Code Review | Zanto Country Detector

WordPress plugin Zanto Country Detector scored74%from 54 tests.

About plugin

  • Plugin page: zanto-country-det...
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.9.2
  • WordPress version: 6.3.1
  • First release: Sep 15, 2014
  • Latest release: Sep 15, 2014
  • Number of updates: 6
  • Update frequency: every 0.5 days
  • Top authors: brooksX (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,140 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.45MB] [CPU: ▼51.18ms] Passed 4 tests

Analyzing server-side resources used by Zanto Country Detector
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.59 ▼0.9112.44 ▼32.99
Dashboard /wp-admin2.60 ▼0.7814.36 ▼48.81
Posts /wp-admin/edit.php2.60 ▼0.7915.08 ▼33.77
Add New Post /wp-admin/post-new.php2.60 ▼3.3215.10 ▼89.13
Media Library /wp-admin/upload.php2.60 ▼0.6614.33 ▼17.89

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: no files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_zcdp_multilingual_ls
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Zanto Country Detector
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.21 ▼1.064.54 ▲2.6638.20 ▼4.37
Dashboard /wp-admin2,203 ▲185.84 ▼0.0196.85 ▼1.8038.57 ▼6.25
Posts /wp-admin/edit.php2,089 ▼32.01 ▼0.0439.45 ▼0.5134.28 ▼4.27
Add New Post /wp-admin/post-new.php1,514 ▼1417.70 ▼0.38681.80 ▲59.1852.53 ▲2.43
Media Library /wp-admin/upload.php1,391 ▼04.20 ▼0.0496.38 ▼6.2041.16 ▼0.23

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in Country_Detector_Widget is deprecated since version 4.3.0! Use __construct() instead.
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_zcdp_multilingual_ls
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not 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
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/zanto-country-detector/inc/country-redirect.php:61
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/zanto-country-detector/zanto-country-detector.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% 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
8 plugin tags: redirect, i18n, country detector, geo, l10n...

zanto-country-detector/zanto-country-detector.php 85% from 13 tests

This is the main PHP file of "Zanto Country Detector" version 0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 162 characters long)
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected706 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP38867339
Pascal1461,565280
PO File1182056
JavaScript16831

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity14.25
▷ Minimum class complexity3.00
▷ Maximum class complexity29.00
Average method complexity3.41
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods22
▷ Static methods29.09%
▷ Public methods22100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
There are no PNG files in this plugin