WordPress.org

Ready to get started?Download WordPress

Forums

Google Analytics Dashboard
Add HTTPS support to the dashboard widget (9 posts)

  1. DaveE
    Member
    Posted 1 year ago #

    Hi,

    Thanks for a great plugin. Unfortunately, many of the sites I admin use SSL/HTTPS for their WordPress admin area and the URL for the Google Chart displayed by this plugin doesn't account for that. This oversight leads to partially secure browser messages when viewing the WP Dashboard.

    I've tweaked the function create_google_chart_url() starting on line 183 in gad-data-model.php to accommodate secure WordPress installs. Here's a pastebin with the updated code for that function: http://pastebin.com/hWCmQSKc

    Maybe you could incorporate this change into the plugin's source? Otherwise, at least this will help me and anyone else looking to tweak the plugin with witha good bookmark.

    Thanks!

    http://wordpress.org/extend/plugins/google-analytics-dashboard/

  2. Carson McDonald
    Member
    Plugin Contributor

    Posted 1 year ago #

    Thanks for the patch. I will integrate it in the next update I make. I wish I would have seen this before I released the 2.0.4 version.

  3. Mindshare Studios, Inc.
    Member
    Posted 1 year ago #

    Any plans to update this soon?

  4. gravitylover
    Member
    Posted 1 year ago #

    The correct URL for SSL on google is:
    https://chart.googleapis.com/ (this causes no errors)

    Other key areas to update:

    gad-admin-pages-posts-ui.php

    <img width="90" height="30" src="https://chart.googleapis.com/chart?chs=90x30&cht=ls&chf=bg,s,FFFFFF00&chco=0077CC&chd=t:<?php echo $cvals; ?>&chds=<?php echo $minvalue; ?>,<?php echo $maxvalue; ?>"/>

    gad-widget-data.pjp

    return '<img width="90" height="30" src="https://chart.googleapis.com/chart?chs=90x30&cht=ls&chf=bg,s,FFFFFF00&chco=0077CC&chd=t:' . $cvals . '&chds=' . $minvalue . ',' . $maxvalue . '"/>';
  5. DaveE
    Member
    Posted 1 year ago #

    @gavitylover,

    If you had viewed my pastebin link above, you'll see that the URL you reference is the one that I had implemented. I'm not sure what your point is regarding the correct URL for SSL.

    Thanks for the tip regarding other locations. However, if the wp-admin area isn't SSL secured, then there is no reason to use the SSL URL's in the Charts API code. Hence, the HTTPS check in the pastebin (above).

    Cheers!

  6. Mindshare Studios, Inc.
    Member
    Posted 1 year ago #

    When is this fix going to be released? It would be worth the simple push to SVN even if this is the only thing getting fixed...

  7. gravitylover
    Member
    Posted 1 year ago #

    @DaveE

    I was correcting the incorrect code in the plugin, good job!

  8. SymmetricS
    Member
    Posted 1 year ago #

    Hello there,

    I have the 2.0.4 version and this problem has not been fixed.
    I have replaced the create_google_chart_url() functions as specified above and it worked. YAY!
    My only problem is that is working only in the post area, in the Dashboad - Home is still not working.

    Could you please provide the code for fixing this also?

  9. DaveE
    Member
    Posted 1 year ago #

    Hi @ SymmetricS,

    The code provided in the Paste Bin example will correct all non-secure instances in the plugin. I'm using it right now on several sites without issue.

    You may have another plugin/theme/link that is pulling insecure content or maybe its just a caching/browser issue. You'll have to double-check the HTML source for your Dashboard page to see what is causing the insecure warning.

    Cheers,

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic