84% hreflang-for-polylang

Code Review | Hreflang for polylang

WordPress plugin Hreflang for polylang scored84%from 54 tests.

About plugin

  • Plugin page: hreflang-for-poly...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.7.2
  • WordPress version: 6.3.1
  • First release: May 3, 2017
  • Latest release: May 15, 2017
  • Number of updates: 10
  • Update frequency: every 8.0 days
  • Top authors: gianemi2 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /5,120 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
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼1.29ms] Passed 4 tests

This is a short check of server-side resources used by Hreflang for polylang
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0045.70 ▲5.82
Dashboard /wp-admin3.31 ▲0.0144.63 ▼5.53
Posts /wp-admin/edit.php3.36 ▲0.0048.84 ▲2.84
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.14 ▼7.26
Media Library /wp-admin/upload.php3.24 ▲0.0036.81 ▲4.78

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Hreflang for polylang
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.22 ▼1.161.72 ▲0.0041.41 ▼1.08
Dashboard /wp-admin2,206 ▲185.91 ▲0.02108.44 ▼6.4641.98 ▼1.84
Posts /wp-admin/edit.php2,086 ▼32.02 ▼0.0440.06 ▼1.5134.30 ▼2.83
Add New Post /wp-admin/post-new.php1,514 ▼2317.81 ▼0.27653.52 ▲30.1253.20 ▼1.53
Media Library /wp-admin/upload.php1,385 ▼04.11 ▼0.05111.52 ▲12.7247.48 ▲3.66

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/hreflang-for-polylang/hreflang_for_polylang.php

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: alternate, polylang, link alternate, multilanguage, hreflang

hreflang-for-polylang/hreflang_for_polylang.php 92% from 13 tests

The principal PHP file in "Hreflang for polylang" v. 1.2 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("hreflang-for-polylang.php" instead of "hreflang_for_polylang.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected20 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1181020

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.40
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%
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

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin