How can I mix in some functionality written in Ruby into a WordPress site?

Here’s the thing. I love Ruby and I’ve been using it for the past couple of years. I love everything about the language and the community.

But I have this soon-to-be-large WordPress site, where I have to implement a lot of additional functinality. The problem is, I really hate customizing WordPress beyond simple theme design.

Read More

Examples of things I need to do:

  • add some additional information to profiles, like karma/points/reputation system
  • offer users to create their own page after they’re allowed to do it
  • pulling data from some external API and displaying it on the user’s profile

I got really used to the whole agile BDD workflow, where I go from Cucumber features to RSpec to implementing the stuff, and the whole WordPress architecture looks to me like ok I’m just gonna have to pray this works.

I’m not sure if it’s even wise to try to write some part of the app in Ruby and try to make it work together with WordPress, or if I should just take WordPress as the only thing I’ve got and make the most of it’s strenghts and weaknesses.

The main issue for me is that everything I’m going to write in PHP will take about 5 times as long than if I do it in Ruby, and it will probably also be more secure and robust, since I don’t have as much experience with complex PHP stuff. I mean I’ve done a lot of PHP in the past, but I always felt like the whole thing is going to fall apart at one point.

I know there is probably no definite answer on how to approach this, but any suggestions are welcome.

Related posts

Leave a Reply

2 comments

  1. We’ve integrated a Rails app into a TYPO3 installation. It worked out pretty well. The key point is to use Rails’ support for adapting models to tables of a legacy app. An important point is to handle authentication which we handle by passing the TYPO3 session key to the Rails app in a hidden way (using PHP as the web-client and passing appropriate headers) and looking it up in the session table (respecting the session timeouts). The Rails app itself is mapped into a sub directory using passenger. Performance is very good, it’s even amazing compared to our previous implementation trying to use Extbase.

    So, in conclusion: If you do it right and the interfaces between the two apps are well planned such an approach can offer great benefits and the best of two worlds. If not done right or you don’t understand some implications of WordPress (like security) you will create a big mess prone to security breaches.

    BTW: We reached feature parity with the Extbase (MVC framework in TYPO3) solution after 4 days of using Rails. The Extbase solution took 6 weeeks and caused a lot of headache and trouble. So your time factor may be even better than 5:1.

  2. Why not learn how to to Behavior Driven Development in PHP for WordPress? In fact, this is one of the great opportunities for developers in 2017. We now how full blown BDD frameworks in WP-Codeception, so that you can even automate Gherkin feature files, just like in Cucumber. Check out WordPress-BDD.com for some usefull info.