This isn't really a question but more of a note to other users who suddenly get an error on a page with a Twitter addon on it like this:
error: 0 Cannot use object of type stdClass as array
I've found that the error handling of the Twitter feed may have changed. Starting on line 51 of the addon you will see the following code:
if (isset($tweets->error) && $tweets->error) {
return '<p class="sppb-alert sppb-alert-warning">' . $tweets->error . '</p>';
}
It seems Twitter is returning a differnt error structure like this:
object(stdClass)#1171 (1) {
["errors"]=> array(1) { [0]=> object(stdClass)#1528 (2) { ["code"]=> int(326) ["message"]=> string(157) "To protect our users from spam and other malicious activity, this account is temporarily locked. Please log in to twitter.com to unlock your account." } } }
So the code needs to be updated to the following:
if (isset($tweets->errors) && $tweets->errors[0]->message) {
return '<p class="sppb-alert sppb-alert-warning">' . $tweets->errors[0]->message . '</p>';
}
I've not done extensive testing of the Twitter API but thought I'd share what I've found in case someone else has the same issue.
Cheers,
Steve.