83% ht-portfolio

Code Review | HT Portfolio - WordPress Portfolio Plugin for Elementor

WordPress plugin HT Portfolio - WordPress Portfolio Plugin for Elementor scored83%from 54 tests.

About plugin

  • Plugin page: ht-portfolio
  • Plugin version: 1.1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4.1-6.3
  • WordPress version: 6.3.1
  • First release: Mar 27, 2019
  • Latest release: Aug 1, 2023
  • Number of updates: 31
  • Update frequency: every 51.3 days
  • Top authors: htplugins (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

300+ active /8,521 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲1.08MB] [CPU: ▲6.11ms] 75% from 4 tests

Analyzing server-side resources used by HT Portfolio - WordPress Portfolio Plugin for Elementor
It is recommended to improve the following
  • CPU: Try to keep total CPU usage under 500.00ms (currently 1,385.72ms on /wp-admin/admin.php?page=htportfolio-recommendations)
PageMemory (MB)CPU Time (ms)
Home /4.48 ▲1.0248.56 ▲4.97
Dashboard /wp-admin4.48 ▲1.1858.59 ▲10.71
Posts /wp-admin/edit.php4.49 ▲1.1357.18 ▲14.00
Add New Post /wp-admin/post-new.php6.99 ▲1.1096.88 ▲1.42
Media Library /wp-admin/upload.php4.30 ▲1.0841.34 ▲7.33
Settings /wp-admin/admin.php?page=htportfolio_options4.3046.67
Portfolio /wp-admin/edit.php?post_type=ht_portfolios4.4145.89
Gallery /wp-admin/edit.php?post_type=htportfolio_gallery4.4144.99
Recommendations /wp-admin/admin.php?page=htportfolio-recommendations8.561,385.72

Server storage [IO: ▲4.49MB] [DB: ▲0.67MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 412 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
htportfolio_settings
htportfolio_pro_themes
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for HT Portfolio - WordPress Portfolio Plugin for Elementor
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,186 ▲45115.78 ▲1.0313.95 ▲12.1744.60 ▲2.55
Dashboard /wp-admin2,426 ▲2376.74 ▲1.84134.75 ▲14.1642.04 ▼5.12
Posts /wp-admin/edit.php2,337 ▲2513.61 ▲1.5555.71 ▲21.2939.25 ▲3.97
Add New Post /wp-admin/post-new.php1,572 ▲4116.41 ▼6.72550.97 ▼63.2740.96 ▼10.07
Media Library /wp-admin/upload.php1,476 ▲884.42 ▲0.1984.12 ▼12.6239.52 ▼2.69
Settings /wp-admin/admin.php?page=htportfolio_options1,2593.6880.4233.07
Portfolio /wp-admin/edit.php?post_type=ht_portfolios1,3153.6349.3534.02
Gallery /wp-admin/edit.php?post_type=htportfolio_gallery1,3153.6449.8633.89
Recommendations /wp-admin/admin.php?page=htportfolio-recommendations3,1303.53108.7135.04

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • htportfolio_pro_themes
    • htportfolio_settings
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means 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
Please fix the following items
  • 46× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/ht-portfolio/admin/cmb2/includes/types/CMB2_Type_Taxonomy_Select.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/ht-portfolio/admin/cmb2/includes/types/CMB2_Type_Textarea_Code.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ht-portfolio/admin/cmb2/includes/helper-functions.php:131
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cmb2_dir() in wp-content/plugins/ht-portfolio/admin/cmb2/includes/rest-api/CMB2_REST_Controller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/ht-portfolio/admin/cmb2/includes/types/CMB2_Type_File_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/ht-portfolio/admin/cmb2/includes/types/CMB2_Type_Colorpicker.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/ht-portfolio/admin/cmb2/includes/types/CMB2_Type_File_List.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/ht-portfolio/admin/cmb2/includes/CMB2.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/ht-portfolio/admin/cmb2/includes/types/CMB2_Type_Oembed.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text_Date' not found in wp-content/plugins/ht-portfolio/admin/cmb2/includes/types/CMB2_Type_Text_Time.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 86% 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
Attributes that require attention:
  • Screenshots: Add descriptions for screenshots #1, #10, #11, #12, #13, #14, #15, #16, #17, #2, #3, #4, #5, #6, #7, #8, #9 in ht-portfolio/assets to your readme.txt
You can take inspiration from this readme.txt

ht-portfolio/htportfolio.php 77% from 13 tests

Analyzing the main PHP file in "HT Portfolio - WordPress Portfolio Plugin for Elementor" version 1.1.6
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 188 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ht-portfolio.php" instead of "htportfolio.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin57,539 lines of code in 245 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP692,5556,41510,846
CSS209221,2528,689
SVG1002,671
JavaScript173936641,585
Sass17306291,410
YAML10015

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity20.34
▷ Minimum class complexity1.00
▷ Maximum class complexity186.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity64.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes74
▷ Abstract classes912.16%
▷ Concrete classes6587.84%
▷ Final classes00.00%
Methods597
▷ Static methods8914.91%
▷ Public methods50183.92%
▷ Protected methods9315.58%
▷ Private methods30.50%
Functions42
▷ Named functions4197.62%
▷ Anonymous functions12.38%
Constants13
▷ Global constants753.85%
▷ Class constants646.15%
▷ Public constants6100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
30 PNG files occupy 0.13MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/cmb2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
assets/images/extensions/ht-script-pro.png6.03KB2.71KB▼ 55.09%
(invalid) assets/images/extensions/ht-google-place-review.png2.64KB0.00KB▼ 100.00%
admin/cmb2/images/ico-delete.png0.70KB0.72KB0.00%
(invalid) assets/images/extensions/cf7-extensions-pro.png8.57KB0.00KB▼ 100.00%