Title: Small bug
Last modified: October 29, 2017

---

# Small bug

 *  Resolved [psn](https://wordpress.org/support/users/psn/)
 * (@psn)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/small-bug-26/)
 * Hi
 * When we debug our site we notice a small bug in your plugin, in file authors.
   php line 66 you have code for users ID and you have put in “id” instead of “ID”
   which gives an error when sorting on ID is used in widget.
 * Per

Viewing 11 replies - 1 through 11 (of 11 total)

 *  Plugin Author [flocsy](https://wordpress.org/support/users/flocsy/)
 * (@flocsy)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/small-bug-26/#post-9634233)
 * can you try to pass ‘id’ instead of ‘ID’ ?
 *  Thread Starter [psn](https://wordpress.org/support/users/psn/)
 * (@psn)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/small-bug-26/#post-9634485)
 * Yes already done and then no error occours 😄
 *  Thread Starter [psn](https://wordpress.org/support/users/psn/)
 * (@psn)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/small-bug-26/#post-9665574)
 * Hi, I assume you will soon deploy a new release with above fix and if you also
   can retest both against latest WP and PHP version would be great!
 * Per
 *  Plugin Author [flocsy](https://wordpress.org/support/users/flocsy/)
 * (@flocsy)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/small-bug-26/#post-9666554)
 * [@psn](https://wordpress.org/support/users/psn/), I don’t think that’s being 
   passed from my code. If I misunderstand or miss something, then please send here
   the patch or describe in words what did you have to change to fix it (which line,
   in which function, from what to what)
 *  Thread Starter [psn](https://wordpress.org/support/users/psn/)
 * (@psn)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/small-bug-26/#post-9666882)
 * I wrote all that in my first post above:
    In authors.php file line 66 change 
   id to ID
 * Per
 *  Plugin Author [flocsy](https://wordpress.org/support/users/flocsy/)
 * (@flocsy)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/small-bug-26/#post-9669818)
 * strange. Can you add this line:
 * echo “ORDERBY: ${orderby};”
 * before line #56? (just before the switch) and let me know what it prints above
   the widget? For me it prints ‘id’, not ‘ID’
 *  Thread Starter [psn](https://wordpress.org/support/users/psn/)
 * (@psn)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/small-bug-26/#post-9671762)
 * Hi
 * Yes we also got “id” when we echo your code above but we don’t get the correct
   order of users “ID” if we chose to order by “ID” and more when we debug code 
   we get this NOTICE when we use “id” and not ID:
 * [10-Nov-2017 22:17:11 Europe/Stockholm] PHP Notice: Use of undefined constant
   widget_authors_sort_by_id – assumed ‘widget_authors_sort_by_id’ in /customers/
   a/d/b/mesas.se/httpd.www/wp-content/plugins/authors/authors.php on line 66
 *  Thread Starter [psn](https://wordpress.org/support/users/psn/)
 * (@psn)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/small-bug-26/#post-9671767)
 * Also if you look at row 25 in authors.php file you have:
 *  `function widget_authors_sort_by_id($a, $b) {
    return 0 + $a->ID – $b->ID; }`
   Dont know if this can confuse the widget and the error we see??
 *  Plugin Author [flocsy](https://wordpress.org/support/users/flocsy/)
 * (@flocsy)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/small-bug-26/#post-9675948)
 * No, actually line 25 should be the reason it should work.
    What php version do
   you have?
 * What you can try is to change line 66 to this (added ‘ before and after the function
   name):
 * `usort($authors, 'widget_authors_sort_by_id');`
 *  Thread Starter [psn](https://wordpress.org/support/users/psn/)
 * (@psn)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/small-bug-26/#post-9676670)
 * Hi
 * We run php version 7.1.10, will try to add mentioned code later this evening.
 *  Thread Starter [psn](https://wordpress.org/support/users/psn/)
 * (@psn)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/small-bug-26/#post-9679189)
 * When checking the order if we use ID as sort function we get actually correct
   order but if we use “id” instead of “ID” we then get the php notice. Not big 
   deal as we don’t use that ORDER in our widget-area. We use number of post and
   that works fine regardless of ID or id.
 * Don’t know if thsi part is connected to which PHP we use!
 * Anyway I think we can close this case by now!
 * Per

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Small bug’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/authors.svg)
 * [Authors Widget](https://wordpress.org/plugins/authors/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/authors/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/authors/)
 * [Active Topics](https://wordpress.org/support/plugin/authors/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/authors/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/authors/reviews/)

 * 11 replies
 * 2 participants
 * Last reply from: [psn](https://wordpress.org/support/users/psn/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/small-bug-26/#post-9679189)
 * Status: resolved