84% set-html-lang-attribute-per-post

Code Review | Set HTML lang attribute per post

WordPress plugin Set HTML lang attribute per post scored84%from 54 tests.

About plugin

  • Plugin page: set-html-lang-att...
  • Plugin version: 0.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.1
  • WordPress version: 6.3.1
  • First release: Jan 7, 2015
  • Latest release: Jan 11, 2015
  • Number of updates: 8
  • Update frequency: every 0.8 days
  • Top authors: nilsnh (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /1,381 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

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

A check of server-side resources used by Set HTML lang attribute per post
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.58 ▼2.03
Dashboard /wp-admin3.31 ▼0.0346.31 ▼19.72
Posts /wp-admin/edit.php3.36 ▲0.0146.29 ▼4.52
Add New Post /wp-admin/post-new.php5.89 ▲0.0196.82 ▼4.24
Media Library /wp-admin/upload.php3.23 ▲0.0137.65 ▲3.40

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Set HTML lang attribute per post
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.37 ▲0.021.75 ▲0.1242.39 ▼0.41
Dashboard /wp-admin2,195 ▲155.62 ▲0.0884.75 ▼10.7742.42 ▼0.75
Posts /wp-admin/edit.php2,100 ▼01.97 ▼0.0539.20 ▼2.0937.72 ▲0.50
Add New Post /wp-admin/post-new.php6,585 ▲5,05426.09 ▲3.09939.75 ▲323.2460.30 ▲2.54
Media Library /wp-admin/upload.php1,400 ▼04.24 ▲0.0297.13 ▼5.7144.47 ▲3.06

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/set-html-lang-attribute-per-post/set-html-lang-attribute-per-post.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 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
3 plugin tags: html, language, lang

set-html-lang-attribute-per-post/set-html-lang-attribute-per-post.php Passed 13 tests

The primary PHP file in "Set HTML lang attribute per post" version 0.0.1 is used by WordPress to initiate all plugin functionality
99 characters long description:
This plugin allows you to specify a html lang attribute per post to override the site-wide default.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin233 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP12011152
PO File281259
Markdown114022

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity2.10
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods110.00%
▷ Public methods770.00%
▷ Protected methods330.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

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