89% hreflang-x-default-tag-for-wpml-inventivo

Code Review | hreflang x-default Tag for WPML | inventivo

WordPress plugin hreflang x-default Tag for WPML | inventivo scored89%from 54 tests.

About plugin

  • Plugin page: hreflang-x-defaul...
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.7.1
  • WordPress version: 6.3.1
  • First release: Aug 15, 2018
  • Latest release: Apr 30, 2021
  • Number of updates: 28
  • Update frequency: every 35.3 days
  • Top authors: inventivode (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,802 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼9.29ms] Passed 4 tests

A check of server-side resources used by hreflang x-default Tag for WPML | inventivo
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.40 ▼0.0625.77 ▼13.31
Dashboard /wp-admin3.32 ▼0.0247.19 ▼11.14
Posts /wp-admin/edit.php3.37 ▲0.0244.08 ▲0.64
Add New Post /wp-admin/post-new.php5.90 ▲0.0281.32 ▼13.34
Media Library /wp-admin/upload.php3.24 ▲0.0234.77 ▲1.13

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for hreflang x-default Tag for WPML | inventivo
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,862 ▲10114.43 ▲0.172.17 ▲0.4545.04 ▲7.54
Dashboard /wp-admin2,246 ▲655.61 ▼0.0385.28 ▼16.7977.37 ▲32.33
Posts /wp-admin/edit.php2,148 ▲482.10 ▲0.0735.91 ▲1.7932.45 ▼5.32
Add New Post /wp-admin/post-new.php1,574 ▲4623.30 ▲0.29687.81 ▲82.4158.18 ▲5.87
Media Library /wp-admin/upload.php1,451 ▲514.10 ▼0.0998.41 ▼5.0977.08 ▲32.46

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

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

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
The SRP test was a success

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

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
1 plugin tags: scroll top

hreflang-x-default-tag-for-wpml-inventivo/inventivo-hreflang-xdefault-tag.php 77% from 13 tests

This is the main PHP file of "hreflang x-default Tag for WPML | inventivo" version 1.0.6, 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:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("hreflang-x-default-tag-for-wpml-inventivo.php" instead of "inventivo-hreflang-xdefault-tag.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Domain Path: The domain path folder does not exist ("/languages")

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
There were no executable files found in this plugin119 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP1112774
Markdown127034
Sass11010
CSS1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.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

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.18MB with 0.10MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/icon-256x256-1.png33.55KB11.45KB▼ 65.87%
screenshot-1.png145.93KB83.78KB▼ 42.59%