Determine value in range, inject to HTML to be used in CSS I want to show users what package they are, based on how many items they have in their cart. The code works, but I'm wondering if anything can be improved.

function new_thing (){


//decleare variables
global $x_subs;
$lim01 = get_option(woomps_limit01);
$lim02 = get_option(woomps_limit02);
$lim03 = get_option(woomps_limit03);
$x = $x_subs;
$plugin_url =(plugins_url("/", __FILE__ ));

//set CSS class based on value of $x 
if  ($x &gt;= 1 &amp;&amp; $x &lt; $lim02) {
    $active1 = "fb-sub-active";
    $active2 = "fb-sub-deactive";
    $active3 = "fb-sub-deactive";
} else if ($x &gt;= $lim02 &amp;&amp; $x &lt; $lim03) {
    $active1 = "fb-sub-deactive";
    $active2 = "fb-sub-active";
    $active3 = "fb-sub-deactive";
} else if ($x &gt;= $lim03) {
    $active1 = "fb-sub-deactive";
    $active2 = "fb-sub-deactive";
    $active3 = "fb-sub-active";
} else {
    $active1 = "fb-sub-deactive";
    $active2 = "fb-sub-deactive";
    $active3 = "fb-sub-deactive";
}


//generate the content that will be displayed
$content = &lt;&lt;&lt;EOD

&lt;div class="fb-sub-img-holder"&gt;
&lt;img src="{$plugin_url}/images/subscription_pack_1.png" class="fb-img fb-sub-table1 {$active1}"&gt;&lt;/img&gt;
&lt;img src="{$plugin_url}/images/subscription_pack_2.png" class="fb-img fb-sub-table2 {$active2}"&gt;&lt;/img&gt;
&lt;img src="{$plugin_url}/images/subscription_pack_3.png" class="fb-img fb-sub-table3 {$active3}"&gt;&lt;/img&gt;
&lt;p&gt;{$x_subs}&lt;/p&gt;
&lt;/div&gt;

EOD;

return $content;
}


.fb-sub-img-holder {
    width: 95%;
    margin: 0 auto;
}

.fb-img {
    width: 30%;

.fb-sub-active {
    width: 50%;
}
.fb-sub-deactive {
    width: 20%;
}
Why is $lim01 never used?  Is it always equal to 1?

Only one of the subscription packs applies, if at all.  You should first make it clear which subscription pack applies.

$subscription_pack = (($x &gt;= $lim03) ? 3 :
                     (($x &gt;= $lim02) ? 2 :
                     (($x &gt;= $lim01) ? 1 : NULL)));
# Note: inactive rather than deactive
$active1 = $active2 = $active3 = 'fb-sub-inactive';
if ($subscription_pack == 1) { $active1 = 'fb-sub-active'; }
if ($subscription_pack == 2) { $active2 = 'fb-sub-active'; }
if ($subscription_pack == 3) { $active3 = 'fb-sub-active'; }


I also suggest reworking the CSS so that you can drop the fb-sub-inactive class altogether.