Title: error in activate hook
Last modified: August 21, 2016

---

# error in activate hook

 *  Resolved [Andy Bailey](https://wordpress.org/support/users/commentluv/)
 * (@commentluv)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/error-in-activate-hook/)
 * you have an error in your code for the activation hook, you’re using $this outside
   a class on line 29
 * [http://wordpress.org/plugins/genesis-optimized-social-share/](http://wordpress.org/plugins/genesis-optimized-social-share/)

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

 *  Plugin Author [ScorpionGod](https://wordpress.org/support/users/scorpiongod/)
 * (@scorpiongod)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/error-in-activate-hook/#post-4520928)
 * Hi Andy,
    It’s a great happy to see a popular person like you here. 🙂 🙂
 * Now, I tried installing and activating the plugin on WordPress 3.8 and 3.7.1.
   Plugin activated without any errors. Plugin is available only for Genesis themes.
   Did you try this for Genesis site or non-genesis site?
 * Thank you,
    Shyam Chathuranga.
 *  Thread Starter [Andy Bailey](https://wordpress.org/support/users/commentluv/)
 * (@commentluv)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/error-in-activate-hook/#post-4520929)
 * whether genesis or not, it shouldn’t have $this outside a class because $this
   does not exist, or at least it isn’t pointing to the right thing
 * the actual code should be
 * `register_activation_hook( __FILE__, 'activation_hook' );`
 * this way, it will actually call the correct function to check that they are using
   genesis theme.
 * error location
    [http://cdn.comluv.com/wp-content/uploads/2014/01/plugins.svn_.wordpress.org-genesis-optimized-social-share-tags-1.1-genesis-optimized-social-share.php_.png](http://cdn.comluv.com/wp-content/uploads/2014/01/plugins.svn_.wordpress.org-genesis-optimized-social-share-tags-1.1-genesis-optimized-social-share.php_.png)
 *  Plugin Author [ScorpionGod](https://wordpress.org/support/users/scorpiongod/)
 * (@scorpiongod)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/error-in-activate-hook/#post-4520967)
 * Oh! Thanks for pointing this. I fixed it few minutes ago. Thanks again for concentrating
   on a little plugin like this.
 *  Thread Starter [Andy Bailey](https://wordpress.org/support/users/commentluv/)
 * (@commentluv)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/error-in-activate-hook/#post-4520968)
 * glad you fixed it, nice idea. I’m using it on comluv.com after I removed jetpack
   for being a fatty and using too many resources!

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

The topic ‘error in activate hook’ is closed to new replies.

 * ![](https://ps.w.org/genesis-optimized-social-share/assets/icon-256x256.jpg?rev
   =981052)
 * [Genesis Optimized Social Share](https://wordpress.org/plugins/genesis-optimized-social-share/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/genesis-optimized-social-share/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/genesis-optimized-social-share/)
 * [Active Topics](https://wordpress.org/support/plugin/genesis-optimized-social-share/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/genesis-optimized-social-share/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/genesis-optimized-social-share/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Andy Bailey](https://wordpress.org/support/users/commentluv/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/error-in-activate-hook/#post-4520968)
 * Status: resolved