I've identified a poor design decision that has led to class.twitch-api.php being used for too many purposes.
The files class is initiated when the file is loaded to listen to GET requests.
The class is extended by TWITCHPRESS_Twitch_API_Calls() which is is a regularly created object.
The class sets required API application and oAuth credentials rather than being passed them.
The issues...
The listener functionality isn't always being used and yet the class is initiated per request.
The class construct is being run every call, that includes creating a new BugNet object.
If API application or oAuth creds change, not all instances of the class will be updated.
I've already begun to make the required changes. The first change is establishing app and oauth creds in the main file. That is being done in 2.0.4 and should also help to clear up a bit of confusion about the values in question.
Next step is to create a listener class and remove the need for TWITCHPRESS_Twitch_API() to listen.
Look at what TWITCHPRESS_Twitch_API_Calls() actually needs from this class. I'm thinking there may be methods that can be moved to a functions file or the plugins main file.
I've identified a poor design decision that has led to class.twitch-api.php being used for too many purposes.
The issues...
I've already begun to make the required changes. The first change is establishing app and oauth creds in the main file. That is being done in 2.0.4 and should also help to clear up a bit of confusion about the values in question.