WordPress Rating-Widget shows blank reporting graph when using SSL

By default, the free version of the WordPress Rating-Widget does not officially “support” SSL/https setups. In reality, there are no problems using it on SSL setups except when it comes to the reporting graph which is loaded via a http connection set in the configuration, thus causing CORS to kick and prohibit non-safe external requests: Rating-Widget empty reporting graph When looking at the failing request using the developer toolbar you can see the CORS warning: Rating-Widget CORS error So, at this point feel free to either buy the pro version or change one line in the configuration to enable SSL/HTTPS support for the free version too (which I find should be supported in the free version too).

Enabling SSL support for reporting graph

Having a quick look at how the widget assembles to reporting graph URL for the iframe reveals that only one constant needs to be changed: WP_RW__ADDRESS. In lib/config.common.php change the following line

define( 'WP_RW__ADDRESS', 'http://' . WP_RW__DOMAIN );

to

define( 'WP_RW__ADDRESS', WP_RW__PROTOCOL . '://' . WP_RW__DOMAIN );

to automatically set the correct protocol based on your current setup. Voila, the graph works with https too: rating-widget-graph-screen

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *