Wordpress Statistics widget for the Dashing dashboard
Tracks all time total stats and views per post
Sample HTML to put in your .erb file:
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
<div data-id="wordpress_total_views" data-view="Number" data-unordered="true" data-title="Wordpress views" style="background-color: #21759b"></div>
<i class="fa fa-wordpress icon-background"></i>
</li>
<li data-row="1" data-col="1" data-sizex="3" data-sizey="1">
<div data-id="wordpress_posts_views" data-view="List" data-unordered="true" data-title="Popular blog posts" style="background-color: #21759b"></div>
<i class="fa fa-wordpress icon-background"></i>
</li>
Deploying to Cloud Foundry
If you are deploying to Cloud Foundry, you will need to create what's called a "user-provided" service. This is because of how environment variables are handled when involving special characters like $.
Create the user-provided service like this:
cf cups wordpress_api -p '{"wordpress_api":"YOUR_TOKEN_HERE"}'
You will then get nice environment variables like these:
cf env appname
System-Provided:
{
"VCAP_SERVICES": {
"user-provided": [
{
"credentials": {
"wordpress_api": "YOUR_TOKEN_HERE"
},
"label": "user-provided",
"name": "wordpress_api",
"syslog_drain_url": "",
"tags": []
}
]
}
}
This way we can now get the correct API token without any issues.