88% clear-html-tags

Code Review | HTML代码优化工具

WordPress plugin HTML代码优化工具 scored 88% from 54 tests.

About plugin

  • Plugin page: clear-html-tags
  • Plugin version: 1.1.1
  • PHP compatiblity: 5.3.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-5.8
  • WordPress version: 5.8.1
  • First release: Jul 4, 2019
  • Latest release: Aug 19, 2021
  • Number of updates: 6
  • Update frequency: every 129.7 days
  • Top authors: wbolt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active / 2,181 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼147.19ms] Passed 4 tests

An overview of server-side resources used by HTML代码优化工具
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.0441.60 ▲2.35
Dashboard /wp-admin3.11 ▲0.0650.64 ▲0.96
Posts /wp-admin/edit.php3.16 ▲0.0652.75 ▲2.32
Add New Post /wp-admin/post-new.php5.49 ▲0.06101.14 ▼593.81
Media Library /wp-admin/upload.php3.06 ▲0.0541.97 ▲1.76
HTML代码优化工具 /wp-admin/options-general.php?page=cht_pack3.0641.30

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

HTML代码优化工具: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲13615.73 ▲0.389.24 ▼0.6754.35 ▼2.41
Dashboard /wp-admin2,975 ▲445.92 ▼0.01147.65 ▼9.46116.55 ▼8.97
Posts /wp-admin/edit.php2,744 ▲52.69 ▼0.0174.58 ▼1.24113.52 ▲13.26
Add New Post /wp-admin/post-new.php1,609 ▼7415.32 ▼2.99413.42 ▼14.04117.51 ▼2.19
Media Library /wp-admin/upload.php1,815 ▲675.01 ▼0.00163.12 ▼6.97134.39 ▲5.60
HTML代码优化工具 /wp-admin/options-general.php?page=cht_pack2,5693.83105.11217.45

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Please take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/clear-html-tags/settings.php
    • > /wp-content/plugins/clear-html-tags/tpl/action_dialog.php
  • 12× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/clear-html-tags/tpl/action_dialog.php on line 53
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/clear-html-tags/tpl/action_dialog.php on line 53
    • > PHP Notice
      Undefined variable: setting_url in wp-content/plugins/clear-html-tags/tpl/action_dialog.php on line 85
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/clear-html-tags/index.php:14
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/clear-html-tags/tpl/action_dialog.php on line 75
    • > PHP Warning
      Use of undefined constant CLEAR_HTML_TAGS_VERSION - assumed 'CLEAR_HTML_TAGS_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/clear-html-tags/settings.php on line 14
    • > PHP Notice
      Undefined variable: cht_cnf in wp-content/plugins/clear-html-tags/tpl/action_dialog.php on line 25
    • > PHP Notice
      Undefined variable: cht_cnf in wp-content/plugins/clear-html-tags/tpl/action_dialog.php on line 53
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/clear-html-tags/tpl/action_dialog.php on line 25
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/clear-html-tags/tpl/action_dialog.php on line 25

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
1 plugin tags: html

clear-html-tags/index.php 85% from 13 tests

"HTML代码优化工具" version 1.1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 225 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("clear-html-tags.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin441 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP48440435
JavaScript4004
CSS20122

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity23.00
▷ Minimum class complexity23.00
▷ Maximum class complexity23.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods1184.62%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected