Problem with using shortcode in elementor progress bar dynamic input

Hi guys,

I am using php snippet for creating shortcode and a shortcode is created for taking some data from my database and show as a number in my front end. so, when I used that shortcode in elementor it works fine, when I used it in progress-bar, it shows fine, but after updating the page, it shows critical error.

This is in editing mode. You can see both shortcode and progressbar working fine:

[editing mode](https://preview.redd.it/25zomod7121a1.png?width=810&format=png&auto=webp&s=582b1f3dc0919635f0c74454d9c919389f71a326)

This is in view mode showing error:

​

[error message](https://preview.redd.it/wqx2xxkg121a1.png?width=1243&format=png&auto=webp&s=0fe57a707d13d95e0b4a4f154e86bf3756fd53e6)

And at last it is normal mode using normal number in elementor progressbar.

Here is my code for shortcode:

`<?php`

`function get_some_data(){`

`global $current_user;`

`if (is_user_logged_in()) {`

`# code…`

`$getID = get_current_user_id();`

`//$str = “step_completed”`

`global $wpdb;`

`$results = $wpdb->get_results(“SELECT step_completed FROM {$wpdb->prefix}fluentform_draft_submissions WHERE user_id=”.$getID.`

`” ORDER BY id DESC”);`

`if($results){`

`$number = $results[0]->step_completed ;`

`$total = 13;`

`$percentage = floor(($number/$total ) * 100);`

`return $percentage;`

`}`

`return 0;`

&#x200B;

`}`

`}`

`//get_some_data()`

`print_r(get_some_data());`

&#x200B;

`?>`

AND ALSO, CAN ANYONE PLEASE TELL ANY WAY TO USE CIRCULAR PROGRESS BAR WITH THE DYNAMIC PERCENTAGE OPTION LIKE ELEMENTOR DEFAULT PROGRESS BAR?

THANKS IN ADVANCE…

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer