78% language-redirector

Code Review | Language Redirector

WordPress plugin Language Redirector scored78%from 54 tests.

About plugin

  • Plugin page: language-redirector
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.9
  • WordPress version: 6.3.1
  • First release: Aug 6, 2017
  • Latest release: Nov 28, 2017
  • Number of updates: 13
  • Update frequency: every 9.0 days
  • Top authors: ilariotr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /689 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.14MB] [CPU: ▼9.78ms] Passed 4 tests

An overview of server-side resources used by Language Redirector
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.86 ▼0.6017.42 ▼20.92
Dashboard /wp-admin3.33 ▼0.0145.10 ▼13.68
Posts /wp-admin/edit.php3.38 ▲0.0345.03 ▲0.02
Add New Post /wp-admin/post-new.php5.91 ▲0.0388.01 ▼4.54
Media Library /wp-admin/upload.php3.26 ▲0.0338.03 ▲6.79
Language Redirector Country Url /wp-admin/admin.php?page=lre_language_redirector_setup_url3.2030.19
Language Redirector /wp-admin/admin.php?page=language-redirector3.2030.78

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Language Redirector: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲5513.23 ▼1.391.61 ▼0.6538.88 ▼3.28
Dashboard /wp-admin2,232 ▲435.85 ▼0.01107.63 ▼3.3075.28 ▲33.07
Posts /wp-admin/edit.php2,115 ▲262.00 ▼0.0139.65 ▲3.1334.35 ▼2.47
Add New Post /wp-admin/post-new.php1,536 ▲323.09 ▲0.09724.56 ▲85.4555.32 ▼1.72
Media Library /wp-admin/upload.php1,417 ▲264.19 ▼0.0299.06 ▼1.8246.93 ▲2.19
Language Redirector Country Url /wp-admin/admin.php?page=lre_language_redirector_setup_url8532.0223.1427.29
Language Redirector /wp-admin/admin.php?page=language-redirector8232.0222.7525.56

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=language-redirector
    • > Notice in wp-content/plugins/language-redirector/language-redirector.php+94
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/language-redirector/classes/class.lr.php:40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/language-redirector/language-redirector.php:57

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Add an image for screenshot #1 (Language Redirector settings page)
The official readme.txt might help

language-redirector/language-redirector.php Passed 13 tests

The primary PHP file in "Language Redirector" version 1.0.1 is used by WordPress to initiate all plugin functionality
45 characters long description:
Plugin that performs a country-based redirect

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin232 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP21854128
PO File32727104

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions787.50%
▷ Anonymous functions112.50%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
5 PNG files occupy 0.09MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png53.38KB24.66KB▼ 53.80%
images/translation.png0.86KB0.88KB0.00%
images/delete.png0.80KB0.87KB0.00%
images/edit.png0.46KB0.50KB0.00%
screenshot-1.png40.14KB18.62KB▼ 53.61%