79% lh-html-cleaner

Code Review | LH HTML Cleaner

WordPress plugin LH HTML Cleaner scored79%from 54 tests.

About plugin

  • Plugin page: lh-html-cleaner
  • Plugin version: 1.33
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.7.4
  • WordPress version: 6.3.1
  • First release: Jul 17, 2015
  • Latest release: May 2, 2017
  • Number of updates: 8
  • Update frequency: every 82.0 days
  • Top authors: shawfactor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,506 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.69MB] [CPU: ▼28.07ms] Passed 4 tests

A check of server-side resources used by LH HTML Cleaner
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.76 ▼4.94
Dashboard /wp-admin3.34 ▼0.0152.17 ▼18.20
Posts /wp-admin/edit.php3.39 ▲0.0353.79 ▲1.41
Add New Post /wp-admin/post-new.php3.07 ▼2.8228.21 ▼90.53
Media Library /wp-admin/upload.php3.26 ▲0.0344.53 ▲3.83
HTML Cleaner /wp-admin/options-general.php?page=lh-html-cleaner/lh-html-cleaner.php3.2231.91

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for LH HTML Cleaner
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.09 ▼0.202.01 ▲0.1239.87 ▼0.46
Dashboard /wp-admin2,202 ▲225.65 ▼0.1197.67 ▲1.9141.62 ▼2.17
Posts /wp-admin/edit.php2,104 ▲12.01 ▼0.0240.04 ▼2.4435.28 ▼3.62
Add New Post /wp-admin/post-new.php1,531 ▲522.95 ▲0.02691.15 ▲7.3462.27 ▲0.05
Media Library /wp-admin/upload.php1,404 ▲44.23 ▲0.11110.87 ▼3.7248.42 ▲1.47
HTML Cleaner /wp-admin/options-general.php?page=lh-html-cleaner/lh-html-cleaner.php7922.0225.2525.47

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=lh-html-cleaner/lh-html-cleaner.php
    • > Notice in wp-content/plugins/lh-html-cleaner/partials/option-settings.php+10
    Trying to access array offset on value of type bool
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=lh-html-cleaner/lh-html-cleaner.php
    • > Warning in wp-content/plugins/lh-html-cleaner/partials/option-settings.php+10
    implode(): Invalid arguments passed

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/lh-html-cleaner/partials/option-settings.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_site_option() in wp-content/plugins/lh-html-cleaner/lh-html-cleaner.php:194

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: styles, inline styles, delete, html, multisite...

lh-html-cleaner/lh-html-cleaner.php Passed 13 tests

The primary PHP file in "LH HTML Cleaner" version 1.33 is used by WordPress to initiate all plugin functionality
98 characters long description:
Removes blacklisted tags and attributes from the content of posts/pages/custom post types on save.

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
No dangerous file extensions were detected119 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP29918119

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity2.60
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods660.00%
▷ Protected methods00.00%
▷ Private methods440.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

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin