I added a state = 1 in the SQL query to only show published articles, but other than that did exactly what I needed it to do.
I'm glad it was useful to you.
I totally forgot about that trivial verification. I will include it in the next version, v1.2.
Thanks for pointing out this problem and for your review!