segment-boneyard / analytics-wordpress

[DEPRECATED] The hassle-free way to integrate analytics into any WordPress site.
https://segment.com/docs/platforms/wordpress/
GNU General Public License v2.0
41 stars 34 forks source link

Refactor #24

Closed JustinSainton closed 10 years ago

ianstormtaylor commented 10 years ago

This looks awesome dude. I like the overloading to non-namespaces Analytics only if it doesn't already exist.

The one question I have is how you are testing. It would be nice to get really solid development instructions in the readme here, along with a Makefile that has commands to use. We should add the commands and description of the workflow to the readme.

Have you been using the existing make test or do you have a better workflow we should adopt?

JustinSainton commented 10 years ago

Thanks, @ianstormtaylor!

So yeah, I didn't actually even notice the Makefile, whoops! :)

Generally for building out WordPress plugin, I use the https://github.com/Varying-Vagrant-Vagrants/VVV workflow for local development and testing. It's the best workflow for local dev/testing I've found. It wouldn't really be compatible with the Makefile in its current state, as it doesn't use localhost.

If you're looking for more specifics on testing/QA processes for WordPress plugins, I can definitely help with that, too!

ianstormtaylor commented 10 years ago

Nice, that sounds perfect. Do you think you could add a section to the readme about how to get that setup for development to the next stage of the plugin work? Basically so that myself, and also any other contributors, would have an easy time getting up an running with tests and such.

Do you have practices for automated testing with WordPress? We might want to get that into the next release as well, or one in between or something.

JustinSainton commented 10 years ago

Absolutely, I'll get that added to the readme.

VVV comes with PHPUnit installed, as well as WP-CLI. We could use WP-CLI to scaffold some unit tests for the plugin, and we could create a unit test suite that would be simple enough to execute on the command line, similar to running make test.

ianstormtaylor commented 10 years ago

That sounds amazing. Yeah I think somehow getting it to be easy enough to run from the command-line is key, so that it encourages it being run since it's so easy. And that way if I have to make fixes randomly as the result of a support request or something before you have time to, then I can feel confident while doing that, if that makes sense.

Thanks!

ianstormtaylor commented 10 years ago

With that merged, is that ready for production? Should we push it now, or should we wait for the next one? I should probably set you up with the creds to push to the plugins place?

Make we should even automate that pushing in the Makefile, I think I actually had an #svn branch I was using back in the old days for it.

JustinSainton commented 10 years ago

If you guys are happy to wait, it might be good to wait for the next round of changes. If you're happy to pass on credentials for pushing to wordpress.org, we have a pretty well-defined solution for pushing there straight from Github tagged releases, more than happy to implement that.

JustinSainton commented 10 years ago

And yeah, totally agree on command-line testing.

ianstormtaylor commented 10 years ago

Okay sweet both of those sound good. Let's wait, and will be excited for testing!