Open bearded-avenger opened 9 years ago
I'm not sure what the best approach is to this. I'd like to avoid having to maintain two different sets of largely the same code. 95% of me is pretty sure these activation hooks have to stay, as it's considered best practice for a publicly distributed plugin. i.e, it's not something we can remove.
This does present quite the predicament. Could we utilize some if/else statements to differentiate activation within VIP ~ wpcom_vip_load_plugin()
and .org?
could possibly use wpcom_is_vip
could work.
I'm probably missing something with the activation, but from what I can tell, the activate function doesn't do anything, and the deactivation only deletes an option. If this is correct, then this should be safe as VIP will merely ignore these functions since they'll never be fired.
Not the cleanest solution, but is that at least a logical place to approach this from?
Also, I don't think you can use wpcom_is_vip as that's a helper function that most blogs won't have available. Though I suppose you could wrap it in a check for that function existing first...
Yeah it'd be wrapped in a function check, and is a possible solution to not having to maintain two different codebases. I'm still looking for the right documentation to see if that's even the right function to call to check if the plugin is on VIP or not.
When the plugin is activated, it basically loads the public and admin classes off activation hooks. So, what I've done is just created another branch for VIP.
I think the implementation Nick has could do it, albeit there are two separate codebases.
hah, removed all teh backwards compatibility and I get rewarded? That's not right! ;)
there we go.
@harvitronix I think this gets us pretty close
@bearded-avenger I did a quick scan the other day to find unescaped output and found some. They're fixed (but not QA'd) in #231.
I will try to do a QA round tomorrow, unless you guys have regression tests that you can use to QA it more quickly.
That'd be great if you could.
Before we send this for approval there are a few things we need to take care of:
Plugin registration hooks are prohibited. This alone will now require a completely different codeset for VIP. We need to utilize these hooks for the general user.
https://github.com/bearded-avenger/aesop-core/blob/master/aesop-core.php#L48 https://vip.wordpress.com/documentation/code-review-what-we-look-for/#plugin-registration-hooks