83% hreflang-manager-lite

Code Review | Hreflang Manager

WordPress plugin Hreflang Manager scored83%from 54 tests.

About plugin

  • Plugin page: hreflang-manager-...
  • Plugin version: 1.07
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Mar 17, 2021
  • Latest release: Oct 25, 2023
  • Number of updates: 8
  • Update frequency: every 119.1 days
  • Top authors: daext (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

3,000+ active /12,436 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.43MB] [CPU: ▼2.53ms] Passed 4 tests

An overview of server-side resources used by Hreflang Manager
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1652.67 ▲15.50
Dashboard /wp-admin3.87 ▲0.5346.71 ▼11.74
Posts /wp-admin/edit.php3.92 ▲0.5748.54 ▲5.97
Add New Post /wp-admin/post-new.php6.39 ▲0.5082.26 ▼3.76
Media Library /wp-admin/upload.php3.73 ▲0.5136.29 ▼0.59
Pro Version /wp-admin/admin.php?page=daexthrmal_pro_version3.7130.01
Connections /wp-admin/admin.php?page=daexthrmal_connections3.9769.93
Help /wp-admin/admin.php?page=daexthrmal_help3.7032.90
Options /wp-admin/admin.php?page=daexthrmal_options3.7135.51
Export to Pro /wp-admin/admin.php?page=daexthrmal_export_to_pro3.7032.89

Server storage [IO: ▲0.36MB] [DB: ▲0.03MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 43 new files
Database: 1 new table, 46 new options
New tables
wp_daexthrmal_connection
New WordPress options
daexthrmal_default_language_8
widget_recent-comments
daexthrmal_default_script_8
daexthrmal_locale
daexthrmal_auto_delete
daexthrmal_default_locale_2
daexthrmal_default_locale_4
daexthrmal_default_language_2
daexthrmal_https
daexthrmal_language
...

Browser metrics 75% from 4 tests

Hreflang Manager: an overview of browser usage
Please improve the following
  • Nodes: For the best user experience, please reduce the number of DOM nodes under 25,000 (currently 28,313 on /wp-admin/admin.php?page=daexthrmal_connections)
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,847 ▲6114.05 ▼0.312.40 ▲0.6154.79 ▲14.03
Dashboard /wp-admin2,228 ▲515.59 ▲0.0281.27 ▼5.4733.24 ▼10.21
Posts /wp-admin/edit.php2,133 ▲332.03 ▲0.0536.38 ▲0.2829.52 ▼4.99
Add New Post /wp-admin/post-new.php1,551 ▲2323.24 ▲2.15664.65 ▼24.0263.93 ▼8.04
Media Library /wp-admin/upload.php1,433 ▲334.21 ▲0.0594.37 ▼2.3838.86 ▼4.40
Pro Version /wp-admin/admin.php?page=daexthrmal_pro_version9251.9921.4329.56
Connections /wp-admin/admin.php?page=daexthrmal_connections28,3133.48139.7051.29
Help /wp-admin/admin.php?page=daexthrmal_help8502.0222.6524.79
Options /wp-admin/admin.php?page=daexthrmal_options1,1032.2541.0330.51
Export to Pro /wp-admin/admin.php?page=daexthrmal_export_to_pro8342.0025.4926.20

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

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
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 fix the following
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/hreflang-manager-lite/admin/view/options.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/hreflang-manager-lite/admin/view/export-to-pro.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/hreflang-manager-lite/admin/view/help.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/hreflang-manager-lite/admin/view/connections.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/hreflang-manager-lite/admin/view/pro-version.php:8

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 93% 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:
  • Tags: There are too many tags (12 tag instead of maximum 10)
The official readme.txt is a good inspiration

hreflang-manager-lite/init.php 92% from 13 tests

"Hreflang Manager" version 1.07's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("hreflang-manager-lite.php" instead of "init.php")

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
Success! There were no dangerous files found in this plugin6,250 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP116175342,666
CSS13460872,373
JavaScript5125121,192
Markdown14019

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity30.75
▷ Minimum class complexity10.00
▷ Maximum class complexity69.00
Average method complexity2.03
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods116
▷ Static methods65.17%
▷ Public methods10993.97%
▷ Protected methods00.00%
▷ Private methods76.03%
Functions1
▷ Named functions1100.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
12 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/inc/chosen/chosen-sprite@2x.png0.72KB0.83KB0.00%
admin/assets/img/edit.png1.28KB0.33KB▼ 74.12%
admin/assets/img/clone-hover.png15.09KB0.12KB▼ 99.18%
admin/assets/img/edit-hover.png1.30KB0.33KB▼ 74.47%
admin/assets/img/trash-hover.png1.13KB0.19KB▼ 83.13%