90% country-detection-polylang

Code Review | Polylang - Country Detection

WordPress plugin Polylang - Country Detection scored90%from 54 tests.

About plugin

  • Plugin page: country-detection...
  • Plugin version: 1.3.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.0.2
  • WordPress version: 6.3.1
  • First release: Jul 20, 2020
  • Latest release: Sep 30, 2022
  • Number of updates: 19
  • Update frequency: every 42.2 days
  • Top authors: markusfroehlich (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active /10,675 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by Polylang - Country Detection
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0348.51 ▲5.76
Dashboard /wp-admin3.33 ▲0.0354.53 ▲2.13
Posts /wp-admin/edit.php3.39 ▲0.0355.08 ▼0.54
Add New Post /wp-admin/post-new.php5.92 ▲0.0388.45 ▼10.74
Media Library /wp-admin/upload.php3.26 ▲0.0337.53 ▲0.27

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Polylang - Country Detection: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.33 ▲0.071.90 ▼0.3942.49 ▼1.26
Dashboard /wp-admin2,198 ▲245.59 ▲0.0090.48 ▼2.0639.95 ▼2.26
Posts /wp-admin/edit.php2,100 ▼02.03 ▲0.0638.85 ▼2.4435.75 ▲0.43
Add New Post /wp-admin/post-new.php1,530 ▲423.02 ▼0.12661.66 ▲1.5449.47 ▼10.36
Media Library /wp-admin/upload.php1,400 ▼04.20 ▲0.1099.39 ▼18.9743.09 ▼4.92

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
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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
Looking good! No server-side errors or output on direct access of PHP files

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

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: Please specify the plugin name on the first line ( === country-detection-polylang === )
The official readme.txt is a good inspiration

country-detection-polylang/country-detection-polylang.php Passed 13 tests

The entry point to "Polylang - Country Detection" version 1.3.1 is a PHP file that has certain tags in its header comment area
55 characters long description:
Detects the preferred language according on the country

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
Everything looks great! No dangerous files found in this plugin143 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP243104143

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.64
Average class complexity31.00
▷ Minimum class complexity31.00
▷ Maximum class complexity31.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods550.00%
▷ Protected methods00.00%
▷ Private methods550.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin