78% hunk-companion

Code Review | Hunk Companion

WordPress plugin Hunk Companion scored78%from 54 tests.

About plugin

  • Plugin page: hunk-companion
  • Plugin version: 1.7.5
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Feb 21, 2019
  • Latest release: Dec 24, 2022
  • Number of updates: 103
  • Update frequency: every 13.6 days
  • Top authors: themehunk (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10,000+ active /252,239 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.44ms] Passed 4 tests

Analyzing server-side resources used by Hunk Companion
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.44 ▼6.49
Dashboard /wp-admin3.31 ▲0.0146.53 ▼2.14
Posts /wp-admin/edit.php3.36 ▲0.0049.81 ▲4.89
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.98 ▼7.56
Media Library /wp-admin/upload.php3.23 ▲0.0037.19 ▲2.42

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 369 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Hunk Companion
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,857 ▲12213.30 ▼1.085.23 ▲3.1638.03 ▼10.35
Dashboard /wp-admin2,266 ▲785.80 ▲0.93103.24 ▼10.3582.58 ▲42.59
Posts /wp-admin/edit.php2,148 ▲592.02 ▲0.0438.08 ▲0.5839.92 ▲4.32
Add New Post /wp-admin/post-new.php1,567 ▲3320.97 ▼2.36603.63 ▼80.1145.05 ▼9.06
Media Library /wp-admin/upload.php1,442 ▲574.24 ▲0.05103.55 ▼4.9687.45 ▲40.67

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • 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 everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/hunk-companion/open-shop/customizer/repeater/icon-picker/icons.php
    • > /wp-content/plugins/hunk-companion/notify/notify-html.php
    • > /wp-content/plugins/hunk-companion/top-store/customizer/repeater/icon-picker/icons.php
    • > /wp-content/plugins/hunk-companion/open-mart/customizer/repeater/icon-picker/icons.php
  • 129× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_theme_mod() in wp-content/plugins/hunk-companion/open-shop/open-shop-front-page/front-ribbon.php:2
    • > PHP Fatal error
      Uncaught Error: Call to a member function add_setting() on null in wp-content/plugins/hunk-companion/open-mart/customizer/frontpage/top-slider.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/hunk-companion/th-shop-mania/product-simple-addon/product-simple-addon.php:7
    • > PHP Notice
      Undefined variable: wp_customize in wp-content/plugins/hunk-companion/open-shop/customizer/frontpage/banner.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hunk-companion/portfoliolite/widgets/testimonial-widget.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_theme_mod() in wp-content/plugins/hunk-companion/top-store/top-store-front-page/front-productlist.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hunk-companion/th-shop-mania/product-simple-addon/ajx.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_theme_mod() in wp-content/plugins/hunk-companion/open-shop/open-shop-front-page/front-banner.php:2
    • > PHP Notice
      Undefined variable: wp_customize in wp-content/plugins/hunk-companion/open-mart/customizer/frontpage/category-tab.php on line 16
    • > PHP Notice
      Undefined variable: wp_customize in wp-content/plugins/hunk-companion/open-shop/customizer/frontpage/category-slider.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (screenshot-1.png), #2 (screenshot-2.png)
The official readme.txt might help

hunk-companion/hunk-companion.php 92% from 13 tests

The main PHP script in "Hunk Companion" version 1.7.5 is automatically included on every request by WordPress
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 152 characters long)

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
There were no executable files found in this plugin79,569 lines of code in 289 files:
LanguageFilesBlank linesComment linesLines of code
PHP1972,8273,54625,539
XML2265219,781
JavaScript573,3924,38619,586
CSS2386422511,161
SVG7112,848
Sass36030654

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity23.40
▷ Minimum class complexity1.00
▷ Maximum class complexity262.00
Average method complexity4.40
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes53
▷ Abstract classes00.00%
▷ Concrete classes53100.00%
▷ Final classes00.00%
Methods349
▷ Static methods5114.61%
▷ Public methods24770.77%
▷ Protected methods5616.05%
▷ Private methods4613.18%
Functions186
▷ Named functions186100.00%
▷ Anonymous functions00.00%
Constants29
▷ Global constants2793.10%
▷ Class constants26.90%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
32 PNG files occupy 0.56MB with 0.18MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
import/assets/logo/pixline.png1.97KB1.83KB▼ 7.09%
import/assets/image/pagelayer.png2.08KB1.27KB▼ 39.13%
almaira-shop/demo/images/almaira-boxed.png26.98KB28.47KB0.00%
gogolite/images/logo-4.png6.73KB3.52KB▼ 47.77%
gogolite/images/about.png278.36KB87.89KB▼ 68.42%