74% wpml-country-detector

Code Review | WPML Country Detector

WordPress plugin WPML Country Detector scored74%from 54 tests.

About plugin

  • Plugin page: wpml-country-dete...
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.0
  • WordPress version: 6.3.1
  • First release: Sep 1, 2014
  • Latest release: Sep 8, 2014
  • Number of updates: 16
  • Update frequency: every 0.4 days
  • Top authors: brooksX (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /5,827 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.44MB] [CPU: ▼43.86ms] Passed 4 tests

A check of server-side resources used by WPML Country Detector
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.55 ▼0.929.91 ▼30.11
Dashboard /wp-admin2.56 ▼0.7413.87 ▼33.53
Posts /wp-admin/edit.php2.56 ▼0.7913.77 ▼33.20
Add New Post /wp-admin/post-new.php2.56 ▼3.3313.61 ▼78.60
Media Library /wp-admin/upload.php2.56 ▼0.6713.62 ▼21.97

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for WPML Country Detector
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲5614.81 ▲0.411.69 ▼0.4839.24 ▼3.86
Dashboard /wp-admin2,208 ▲205.86 ▲0.01109.41 ▲7.1240.01 ▼3.48
Posts /wp-admin/edit.php2,091 ▲22.07 ▲0.0641.76 ▲0.6735.92 ▼1.80
Add New Post /wp-admin/post-new.php1,539 ▲2018.25 ▼5.01605.96 ▼34.0058.10 ▼1.41
Media Library /wp-admin/upload.php1,390 ▲24.26 ▲0.0996.86 ▲0.7241.08 ▼0.62

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in Language_Switcher_Widget is deprecated since version 4.3.0! Use __construct() instead.
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_wcdp_multilingual_ls
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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 items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wpml-country-detector/wpml-country-detector.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpml-country-detector/inc/country-redirect.php:59

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
8 plugin tags: redirect, l10n, translation, maxmind, i18n...

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

This is the main PHP file of "WPML Country Detector" version 0.2, 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: Keep the plugin description shorter than 140 characters (currently 162 characters long)
  • 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 review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin818 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP311379431
Pascal1461,565280
PO File1182056
JavaScript2131051

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity20.50
▷ Minimum class complexity2.00
▷ Maximum class complexity51.00
Average method complexity4.25
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods24
▷ Static methods28.33%
▷ Public methods24100.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
No PNG images were found in this plugin