78% clear-html-tags

Code Review | HTML代码优化工具

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

About plugin

  • Plugin page: clear-html-tags
  • Plugin version: 1.1.2
  • PHP compatiblity: 5.3.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.0
  • WordPress version: 6.3.1
  • First release: Jul 4, 2019
  • Latest release: Jun 1, 2022
  • Number of updates: 7
  • Update frequency: every 152.0 days
  • Top authors: wbolt (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

700+ active /5,401 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.10MB] [CPU: ▼15.51ms] 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 /3.47 ▲0.0033.95 ▼10.87
Dashboard /wp-admin3.32 ▼0.0344.73 ▼17.58
Posts /wp-admin/edit.php3.37 ▲0.0145.87 ▼1.33
Add New Post /wp-admin/post-new.php5.50 ▼0.3868.42 ▼32.25
Media Library /wp-admin/upload.php3.24 ▲0.0134.12 ▲3.68
HTML代码优化工具 /wp-admin/options-general.php?page=cht_pack3.2733.40

Server storage [IO: ▲0.18MB] [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, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

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 /2,793 ▲3214.36 ▲0.001.63 ▲0.1742.85 ▲1.44
Dashboard /wp-admin2,199 ▲195.50 ▼0.1579.35 ▼5.6541.57 ▲1.97
Posts /wp-admin/edit.php2,104 ▲42.01 ▲0.0234.29 ▼4.2838.40 ▲0.30
Add New Post /wp-admin/post-new.php1,538 ▲1023.16 ▲0.11674.23 ▲13.8354.79 ▲7.95
Media Library /wp-admin/upload.php1,404 ▲74.18 ▼0.0392.03 ▼9.7845.86 ▲1.22
HTML代码优化工具 /wp-admin/options-general.php?page=cht_pack3,0073.3777.96218.38

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

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/tpl/action_dialog.php
    • > /wp-content/plugins/clear-html-tags/settings.php
  • 15× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: cht_opt in wp-content/plugins/clear-html-tags/tpl/action_dialog.php on line 87
    • > 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 54
    • > 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 Warning
      Invalid argument supplied for foreach() in wp-content/plugins/clear-html-tags/tpl/action_dialog.php on line 76
    • > 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 26
    • > PHP Notice
      Undefined variable: cht_cnf in wp-content/plugins/clear-html-tags/tpl/action_dialog.php on line 76
    • > PHP Notice
      Undefined variable: setting_url in wp-content/plugins/clear-html-tags/tpl/action_dialog.php on line 94
    • > 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 54
    • > 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 76

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.2'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 plugin483 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP49350477
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.32
Average class complexity25.00
▷ Minimum class complexity25.00
▷ Maximum class complexity25.00
Average method complexity2.85
▷ Minimum method complexity1.00
▷ Maximum method complexity8.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