94% html-mode-locker

Code Review | HTML Mode Locker

WordPress plugin HTML Mode Locker scored 94% from 54 tests.

About plugin

  • Plugin page: html-mode-locker
  • Plugin version: 0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.8
  • WordPress version: 5.9.2
  • First release: Aug 30, 2011
  • Latest release: Jan 13, 2014
  • Number of updates: 12
  • Update frequency: every 72.2 days
  • Top authors: maxchirkov (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

500+ active / 6,498 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.89MB] [CPU: ▼314.56ms] Passed 4 tests

Server-side resources used by HTML Mode Locker
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0261.59 ▼1.05
Dashboard /wp-admin3.47 ▲0.0740.58 ▼0.31
Posts /wp-admin/edit.php3.70 ▲0.0643.23 ▲4.63
Add New Post /wp-admin/post-new.php3.28 ▼3.6928.05 ▼1,254.39
Media Library /wp-admin/upload.php3.35 ▲0.0532.96 ▼2.49

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for HTML Mode Locker
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,854 ▲10015.98 ▲0.755.78 ▼1.452.21 ▼0.82
Dashboard /wp-admin2,957 ▲996.26 ▲0.07135.45 ▼7.26184.75 ▼46.18
Posts /wp-admin/edit.php2,739 ▲543.34 ▲0.1075.61 ▲9.33151.65 ▲5.89
Add New Post /wp-admin/post-new.php1,685 ▼516.15 ▼5.11499.65 ▲35.10181.50 ▲1.53
Media Library /wp-admin/upload.php1,767 ▲725.67 ▲0.17167.61 ▼4.88229.19 ▲42.88

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/html-mode-locker/html-mode-locker.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/html-mode-locker/Class_Pointers.php:9

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

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (HTML Mode Locker settings under Settings => Writing.), #2 (HTML Mode Locker meta box in the post editor.)
The official readme.txt is a good inspiration

html-mode-locker/html-mode-locker.php Passed 13 tests

The entry point to "HTML Mode Locker" version 0.5 is a PHP file that has certain tags in its header comment area
90 characters long description:
Adds and option to lock post editor in HTML Mode on selected post types on per-item basis.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin249 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP26032249

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin