WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just updated a plugin that needed to be updated. The issue is they added support for OAuth, the problem this plugin and another are using the same OAuth classes. Is there a easy way to fix this? I've never messed with OAuth or classes in PHP, I'm not a programmer.


PHP Fatal error:  Cannot redeclare class OAuthSignatureMethod_HMAC_SHA1
share|improve this question
up vote 5 down vote accepted

Your code probably looks like this:

class OAuthSignatureMethod_HMAC_SHA1 {



It should look like this:

if( ! class_exists( 'OAuthSignatureMethod_HMAC_SHA1' ) ) :
class OAuthSignatureMethod_HMAC_SHA1 {



This is more a PHP issue than a WordPress issue, but if multiple plug-ins include or require files that declare the same class with the same name, you'll get a collision. You only need to define the class once, then you can instantiate it as many times as you need in your multiple systems.

share|improve this answer
Amd let's hope that the two classes are identical, not that one of them has a newer version or worse - two different implementations that use the same classnames! – Jan Fabry Feb 22 '11 at 23:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.