Support » Plugin: Charity-thermometer » Nice Concept, but Too Complex

  • I do like the plugin, but the one issue I have is that it is unnecessarily complex.

    The thermometer’s behavior is controlled with JavaScript and a <canvas> tag, so why does this plugin create a custom post type? A shortcode which passes attributes, in place of a custom post-type, would suffice.

    [wpch_thermometer header="2013 Fundraiser" footer="Help us reach our goal!" goal="5000" current="250"]

    Aside from making the code more difficult to understand, the custom post-type also adversely affects performance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Also, the values for the thermometer’s goal and current value are stored in a hidden <input> tag. This is also unnecessary. Hidden input fields are only required in form submissions, and that isn’t what’s happening here. The values ought to have been stored as a data attribute.

    <p id="wpch_target_value" data-target="5000">$5,000</p>
    <p id="wpch_cti_img" data-current="250">$250</p>

    or better, as properties of a JavaScript object printed directly into the source. Using this approach reduces complexity because you won’t have to extract the value from a data attribute using jQuery.

    <script type="text/javascript">
        wpchVals = {"target": 5000, "current": 250};

    Apologies for being so critical.

    Plugin Author crea8xion



    nice point out.. this is the very first submission I have and really don’t have time to revised the code.

    Anyway thanks for pointing out. I’m planning to upgrade this plugin or replaced this one, looking for a free time.


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Nice Concept, but Too Complex’ is closed to new replies.