83% ht-service

Code Review | HT Service - Roofing Service WordPress Plugin

WordPress plugin HT Service - Roofing Service WordPress Plugin scored83%from 54 tests.

About plugin

  • Plugin page: ht-service
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Oct 25, 2018
  • Latest release: Aug 3, 2023
  • Number of updates: 29
  • Update frequency: every 60.1 days
  • Top authors: devitemsllc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /2,470 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.40MB] [CPU: ▼2.62ms] 75% from 4 tests

Server-side resources used by HT Service - Roofing Service WordPress Plugin
It is recommended to improve the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 1,343.45ms on /wp-admin/admin.php?page=htservice-recommendations)
PageMemory (MB)CPU Time (ms)
Home /3.83 ▲0.3743.20 ▲2.02
Dashboard /wp-admin3.77 ▲0.4755.70 ▲2.87
Posts /wp-admin/edit.php3.82 ▲0.4764.24 ▲13.52
Add New Post /wp-admin/post-new.php6.29 ▲0.4089.99 ▼16.95
Media Library /wp-admin/upload.php3.61 ▲0.3840.05 ▲1.57
Services /wp-admin/edit.php?post_type=htservice3.7444.10
Settings /wp-admin/admin.php?page=htservice_options3.6138.06
Recommendations /wp-admin/admin.php?page=htservice-recommendations7.971,343.45

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 54 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
pro_themes
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded
settings
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by HT Service - Roofing Service WordPress Plugin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,100 ▲35415.46 ▲0.919.79 ▲7.9343.08 ▼4.16
Dashboard /wp-admin2,410 ▲2226.58 ▲1.72138.57 ▲22.9443.18 ▼6.08
Posts /wp-admin/edit.php2,318 ▲2293.53 ▲1.5250.80 ▲12.0540.05 ▲2.73
Add New Post /wp-admin/post-new.php1,419 ▼11420.74 ▼2.55552.92 ▼115.5538.35 ▼16.47
Media Library /wp-admin/upload.php1,460 ▲724.40 ▲0.1888.04 ▼14.4346.28 ▲0.68
Services /wp-admin/edit.php?post_type=htservice1,3083.4753.9137.56
Settings /wp-admin/admin.php?page=htservice_options1,2073.6275.0631.71
Recommendations /wp-admin/admin.php?page=htservice-recommendations3,1053.46110.1336.38

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
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • settings
    • can_compress_scripts
    • pro_themes

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ht-service/admin/admin-init.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/ht-service/admin/htservice_custom-metabox.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ht-service/admin/htservice_custom-post-type.php:79
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/ht-service/includes/archive-htservice.php:10
    • > PHP Fatal error
      require_once(): Failed opening required 'HTSERVICE_ADDONS_PL_PATHadmin/admin-init.php' (include_path='.:/usr/share/php') in wp-content/plugins/ht-service/admin/init.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/ht-service/admin/htservice_shortcode.php:85
    • > PHP Warning
      Use of undefined constant HTSERVICE_ADDONS_PL_PATH - assumed 'HTSERVICE_ADDONS_PL_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ht-service/admin/init.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'HTService_Settings_API' not found in wp-content/plugins/ht-service/admin/plugin-options.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/ht-service/includes/single-htservice.php:10
    • > PHP Warning
      require_once(HTSERVICE_ADDONS_PL_PATHadmin/admin-init.php): failed to open stream: No such file or directory in wp-content/plugins/ht-service/admin/init.php on line 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 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: service plugin, service box, roofing service, service, service list

ht-service/htservice.php 85% from 13 tests

The main PHP script in "HT Service - Roofing Service WordPress Plugin" version 1.1.3 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ht-service.php" instead of "htservice.php")

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
Everything looks great! No dangerous files found in this plugin6,167 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP153903422,887
SVG1002,671
CSS57927456
JavaScript63548153

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity33.60
▷ Minimum class complexity3.00
▷ Maximum class complexity69.00
Average method complexity3.63
▷ Minimum method complexity1.00
▷ Maximum method complexity47.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods55
▷ Static methods11.82%
▷ Public methods5396.36%
▷ Protected methods23.64%
▷ Private methods00.00%
Functions21
▷ Named functions2095.24%
▷ Anonymous functions14.76%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
16 PNG files occupy 0.10MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) admin/images/extensions/ht-google-place-review.png2.64KB0.00KB▼ 100.00%
admin/images/extensions/htmega-pro.png4.60KB4.78KB0.00%
(invalid) admin/images/extensions/ht-menu.png2.85KB0.00KB▼ 100.00%
admin/images/extensions/multicurrencypro.png19.01KB9.36KB▼ 50.77%
admin/images/extensions/swatchly-pro.png13.99KB5.41KB▼ 61.37%