How to add profile completeness progress bar in php and wordpress?

how to show the profile completeness progress bar in php wordpress?, after registration i am displaying the whole values in a user profile page. depending up on the data filled in the edit profile page, i want to show the progress bar in the profile page.is there any way of doing this?

if($firstname!=""){
// add some points and show status bar is 2%
}

Like this, any way? please help me

Related posts

Leave a Reply

2 comments

  1. $maximumPoints  = 100;
            if ( is_user_logged_in() ) {                 
                 if($twitterHandle!=""){
                    $hasCompletedTwitterHandle = 10;
    
                 }
                 if($linkedinHandle!=""){
                    $hasCompletedLinkedinHandle = 10;
    
                 }
                 if($googleplusHandle!=""){
                    $hasCompletedGoogleplusHandle = 10;
    
                 }
                 if($website_url!=""){
                    $hasCompletedWebsite_url = 10;
    
                 }
    
                 $percentage = ($hasCompletedTwitterHandle+$hasCompletedLinkedinHandle+$hasCompletedGoogleplusHandle+$hasCompletedWebsite_url)*$maximumPoints/100;
                 echo "Your percentage of profile completenes is".$percentage."%";
                 echo "<div style='width:100px; background-color:white; height:30px; border:1px solid #000;'>
                 <div style='width:".$percentage."px; background-color:red; height:30px;'></div></div>";
            } 
    

    i have did this code now the progress bar is coming. i have an issue with this code, if a user is logged in he can see the other users profile progress bar. i do not need this, how can i restrict that, if a user is logged in that user want to see his progress bar only

  2. i think css could do the trick….

       <div style="background:red;border:1px solid;">
            <div style="width:<?=$completePercentage?>%;background:green;">
                <?=$completePercentage?>    
            </div>
       </div>
    

    you can calculate value for “$completePercentage” var based on your profile completeness criteria !!