83% hls-crm-form-shortcode

Code Review | HelloLeads CRM Form Shortcode

WordPress plugin HelloLeads CRM Form Shortcode scored 83% from 54 tests.

About plugin

  • Plugin page: hls-crm-form-shor...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.0.1
  • WordPress version: 6.3.1
  • First release: Oct 18, 2022
  • Latest release: Nov 11, 2022
  • Number of updates: 12
  • Update frequency: every 2.3 days
  • Top authors: helloleads (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 635 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.03MB] [CPU: ▼13.97ms] Passed 4 tests

This is a short check of server-side resources used by HelloLeads CRM Form Shortcode
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0332.76 ▼14.87
Dashboard /wp-admin3.33 ▲0.0343.15 ▼9.92
Posts /wp-admin/edit.php3.38 ▲0.0342.08 ▼0.80
Add New Post /wp-admin/post-new.php5.93 ▲0.0583.63 ▼30.28
Media Library /wp-admin/upload.php3.25 ▲0.0334.37 ▲1.45

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 30 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for HelloLeads CRM Form Shortcode
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,037 ▲26652.10 ▲37.7925.12 ▲23.1738.13 ▼12.08
Dashboard /wp-admin2,058 ▼12424.26 ▲18.36469.98 ▲351.1271.67 ▲22.04
Posts /wp-admin/edit.php2,135 ▲4944.35 ▲42.36346.23 ▲305.8855.78 ▲20.10
Add New Post /wp-admin/post-new.php1,634 ▲12038.50 ▲20.80887.04 ▲220.2926.90 ▼37.82
Media Library /wp-admin/upload.php1,494 ▲10347.25 ▲43.06335.00 ▲233.1285.39 ▲40.81

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

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 no errors were found, this is by no means 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
Please take a closer look at the following
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant HLS_CRMF_US_PLUGIN_DIR - assumed 'HLS_CRMF_US_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/hls-crm-form-shortcode/inc/template/view/hls_list.php on line 2
    • > PHP Notice
      Undefined variable: hls_key in wp-content/plugins/hls-crm-form-shortcode/inc/template/view/hls_crm_shortcode.php on line 2
    • > PHP Warning
      Use of undefined constant HLS_CRMF_US_PLUGIN_DIR - assumed 'HLS_CRMF_US_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/hls-crm-form-shortcode/inc/template/view/config.php on line 2
    • > PHP Warning
      require_once(HLS_CRMF_US_PLUGIN_DIR/inc/template/header.php): failed to open stream: No such file or directory in wp-content/plugins/hls-crm-form-shortcode/inc/template/view/hls_list.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hls-crm-form-shortcode/inc/loader.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/hls-crm-form-shortcode/inc/template/header.php:5
    • > PHP Warning
      require_once(HLS_CRMF_US_PLUGIN_DIR/inc/template/header.php): failed to open stream: No such file or directory in wp-content/plugins/hls-crm-form-shortcode/inc/template/view/config.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/hls-crm-form-shortcode/inc/template/view/hls_crm_shortcode.php:13
    • > PHP Fatal error
      require_once(): Failed opening required 'HLS_CRMF_US_PLUGIN_DIR/inc/template/header.php' (include_path='.:/usr/share/php') in wp-content/plugins/hls-crm-form-shortcode/inc/template/view/hls_list.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'HLS_CRMF_US_PLUGIN_DIR/inc/template/header.php' (include_path='.:/usr/share/php') in wp-content/plugins/hls-crm-form-shortcode/inc/template/view/config.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === hls-crm-form-shortcode === )
  • Requires php: Invalid version format
The official readme.txt might help

hls-crm-form-shortcode/hls_crm_form.php 77% from 13 tests

The main PHP script in "HelloLeads CRM Form Shortcode" version 1.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("hls-crm-form-shortcode.php" instead of "hls_crm_form.php")
  • Requires at least: Required version does not match the one declared in readme.txt ("4.7" instead of "4.4")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected2,491 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript113492731,866
PHP629559385
CSS5525240

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity35.00
▷ Minimum class complexity35.00
▷ Maximum class complexity35.00
Average method complexity3.83
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 PNG files occupy 0.39MB with 0.23MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png128.29KB38.96KB▼ 69.63%
assets/icon-128x128.png12.21KB6.63KB▼ 45.66%
assets/screenshot-1.png125.47KB36.60KB▼ 70.83%
inc/template/img/icon.png1.02KB0.71KB▼ 30.10%
inc/template/img/HLS_Logo.png136.32KB29.58KB▼ 78.30%