68% hk-button-contact

Code Review | HK Button Contact

WordPress plugin HK Button Contact scored68%from 54 tests.

About plugin

  • Plugin page: hk-button-contact
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.7.2
  • WordPress version: 6.3.1
  • First release: Oct 27, 2020
  • Latest release: Jun 20, 2021
  • Number of updates: 5
  • Update frequency: every 47.2 days
  • Top authors: huykiradotnet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /699 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.95MB] [CPU: ▼57.56ms] Passed 4 tests

Server-side resources used by HK Button Contact
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.05 ▼1.429.76 ▼34.44
Dashboard /wp-admin2.07 ▼1.285.71 ▼57.03
Posts /wp-admin/edit.php2.07 ▼1.295.83 ▼43.44
Add New Post /wp-admin/post-new.php2.07 ▼3.825.61 ▼95.34
Media Library /wp-admin/upload.php2.07 ▼1.165.23 ▼30.23

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

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

Browser metrics Passed 4 tests

Checking browser requirements for HK Button Contact
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,842 ▲8114.23 ▼0.121.94 ▼0.3143.47 ▼5.45
Dashboard /wp-admin2,210 ▲335.52 ▼0.0988.68 ▼6.6037.84 ▼5.37
Posts /wp-admin/edit.php2,115 ▲122.02 ▼0.0135.86 ▼0.1532.49 ▼3.85
Add New Post /wp-admin/post-new.php1,541 ▲1523.55 ▲0.48692.66 ▼1.4857.54 ▲2.81
Media Library /wp-admin/upload.php1,421 ▲274.17 ▼0.0299.12 ▼12.3041.91 ▼2.01

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the button-contact handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% 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
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/hk-button-contact/hk-button-contact.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/hk-button-contact/include/class.hk-contact-button-option.php:121
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hk-button-contact/include/class.button.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: button phone, button contact, button messages, button zalo

hk-button-contact/hk-button-contact.php Passed 13 tests

The main PHP script in "HK Button Contact" version 1.1 is automatically included on every request by WordPress
19 characters long description:
Show Button Contact

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin297 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP499147
Sass120147
SVG2002
CSS1011

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/messenger.png6.21KB4.35KB▼ 30.04%