WordPress: Adopting a plugin

It’s a while since I’m using Simple Graph WordPress plugin. First I thank Pasi J. Matilainen, that did the development. After being in touch with the original developer I decided I wanted to help, I have a few ideas and at the same time I would like to fix a couple of small problems. So, here I’am, Pasi wrote me that he is quiet busy, so he cannot manage to put more time on it (plugin page is http://www.pasi.fi/simple-graph-wordpress-plugin/#comments).

Let’s start, the first two main problems I would like to fix are:

- Label on the axis are without decimal, making the graph a kind of wrong. See my weight graph on top of the page. The central axis displays 78, but some of the last values, 78.4, are under that mark.
- There is a problem (not noticed by Pasi, but for sure in this blog), if you add a value for today, the graph does not cover it, so to see it included in the graph curve, I have to add it twice, relative to today and tomorrow as well, so then is displayed.

Other problems are commented in the plug-in page.

I have some ideas about improving the plug-in, but first I want to get used to the code and see it, after fixing the mentioned problems I’ll about:

- In case of a large amount of data, having the possibility to have a larger image in a smaller box, with a couple of buttons to scroll the image left-and-right
- Visualize the value of a specific point. The used can click on the image, and a label (or any other way) appers with the specific value in that point
- Adding more than one graph in the same image, using different colors

  • Trackback are closed
  • Comments (12)
  1. Hi!
    Great that someone continues to develope this plugin !!
    I have used it for some time now, but for some reason it stoped working after I updated the Worpress installation to 2.2.1 :(

    Is there any way I can get an update via email or similar when you releases a new version?

    I would be glad to help you test any new versions, as long as I can get it back up and running :-D

    Good luck with the updates!

    BR Tilly

  2. Hi,
    sure I will send to the original developer every update, and will publish it here as well.
    Up to now I just fixed a couple of small problems, like the labels, now they are with decimals (see my graph above).
    Anyway as soon as I get more into the code, I would let you know if I find why the plugin can crash with WordPress 2.2.2!
    At the same time I’ll email you in case I need someone to test changes.

  3. Hey,
    I cannot customize the graph (using widgets), every setting i change doesnt happen, so i can only use the default settings of the plugin.
    Do you have the same problem? I see you have changed the dimensions of the image (wide), so it looks like you have succeeded in customizing. What did i do wrong?

  4. cool. I am installing this plugin as i write this.

  5. Hi Dirk,
    I noticed the same issue as I upgraded my WP from I don’t remember how old version. You can correct the issue manually by changing in pjm_graph.php file this line number 245 (or so, I might have the line number slightly wrong) as follows.

    This is the offending line:
    register_sidebar_widget($name, $i

  6. Aww crap. Too used to wysiwyg editor. Should have one in the comment box as well. :)

    I’ll now proceed to repeat myself.

    This is the offending line:
    register_sidebar_widget($name, $i <= $number ? ‘widget_pjm_graph_widget’ : /* unregister */ ”, ”, $i);

    Just remove the second pair of hyphens and the following comma. This is what you’ll get:
    register_sidebar_widget($name, $i

  7. I have a problem when using this. The following URL displays the graph:

    graph.php?n=1&uid=1&tid=1

    This is the URL that my browser renders:

    graph.php?n=1&uid=1&tid=1

    When this url is used, I get this error:


    WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND table_id=' at line 1]
    SELECT MAX(stamp) AS highdate, MIN(stamp) AS lowdate, MAX(value) AS highvalue, MIN(value) AS lowvalue FROM wp_simple_graph WHERE user_id= AND table_id=

    So, when the URL is formed correctly (second example above), the uid and the tid aren’t passed to the function correctly.

    Does anybody have any ideas why?

    Thanks!

  8. Oops, first example above should have the ampersands (&) spelled out in HTML

  9. Never mind, I fixed it…

    I copied this section:

    //To fix variable problem
    $uid = FALSE; $tid = FALSE;
    $number = 1;
    if (isset($_GET['uid'])) $uid = $_GET['uid'];
    if (isset($_GET['tid'])) $tid = $_GET['tid'];
    if (isset($_GET['n'])) $number = $_GET['n'];

    and pasted it right above this section:

    // parse data
    list($highvalue,$lowvalue,$highdate,$lowdate) = parseData();

  10. Thankiossi
    It’s great

  11. Thankiosst
    Great!

  12. to be truly surprised and pleased:) Do not be believed, that even this happens:)