Articles • Gary Jones https://garyjones.io/articles Enterprise Engineer at WordPress VIP Wed, 13 May 2020 12:14:06 +0000 en-GB hourly 1 https://wordpress.org/?v=6.2.2 https://garyjones.io/wp-content/uploads/sites/2/2018/03/cropped-gary-jones-2017-32x32.jpg Articles • Gary Jones https://garyjones.io/articles 32 32 152858125 Press This Podcast Transcript https://garyjones.io/press-this-transcript https://garyjones.io/press-this-transcript#respond Sat, 03 Nov 2018 10:47:42 +0000 https://garyjones.io/?p=9920 I was invited by David Vogelpohl to appear as a guest on the PressThis podcast, to talk about the Genesis Framework. Here is the transcript.

The post Press This Podcast Transcript appeared first on Gary Jones.

]]>
I was invited by David Vogelpohl to appear as a guest on the PressThis podcast, to talk about the Genesis Framework:

The rise and rise of the Genesis Framework with Genesis core contributor Gary Jones

The transcript is below.


Introduction Welcome to Press This, the WordPress community podcast featuring exclusive content and interviews with leaders in the WordPress community. Covering everything from development to integrating your digital marketing strategy with WordPress. Join host David Vogelpohl of WP Engine and special guests from across the community as they keep you up to speed on the latest advancements in WordPress. Let’s get started.

David Everyone, welcome to the Press This, WordPress community podcast on webmaster radio. This is your host, David Vogelpohl, and I support the WordPress community through my role at WP Engine, and I love to bring the best of the community to you here every week on Press This. As a reminder, you can always subscribe on iTunes or iHeartRadio or download the latest episodes at WebmasterRADIO.FM. In this episode, I’m really excited for this one, we’re gonna be covering the rise and rise of the Genesis framework. And in order to do that we brought a very special guest to the show, core contributor to Genesis and general community leader, Mr. Gary Jones. Gary, welcome to the show.

Gary Thank you much for the invite. How are you doing, David?

David Doing great. So glad to talk to you here today. I know, you and I spoke shortly after WP Engine acquired StudioPress and the Genesis framework, and I really enjoyed that opportunity to get to know you then. But also enjoying this opportunity today to get to know you a little bit better and share a little bit about the Genesis framework with those that are unfamiliar with it. So basically what we’re gonna be covering today are Gary’s thoughts on the kind of history and evolution of Genesis, the power of the community behind Genesis, which is really quite large and impressive, and then at the end really how brands and agencies use Genesis kind of in their day to day to scale the work they do and frankly to build better experiences. So fun, fun stuff. And if you’re unfamiliar with the Genesis framework, you’re on the right podcast. Gary’s quite an informed person. Gary, you have history, right? It’s not just like you picked up the Genesis framework last week.

Gary No, no. I’ve been using Genesis for about eight years now and contributing to it for all that time as well. So yeah, fairly in depth usage and knowledge of the code base and the community and everything that surrounds Genesis.

David Awesome. Well I know and I actually ran a Genesis agency for five years and was involved with the community. But you know, one of the roles I have at WP Engine was leading the acquisition team behind StudioPress, and your name just kept coming up over and over and over again. So again, super excited to have you here today to talk about these things. But you also have some big news. You just accepted a position. Is that correct, Gary?

Gary Yeah, it’s correct. After 10 years of running my own agency, which was a predominately Genesis-based agency as well, I have accepted an offer to be a VIP Developer at Automattic. I start as of the date of recording, next week. But as I think when this recording goes live, then it will be tomorrow.

David Yeah.

Gary Yep.

David There you go, you’re talking to future Gary now. But congratulations on that. Such a good company to get aligned with and glad you found a home there.

Gary Yeah, thank you very much, yeah.

David Awesome. You told us your Genesis origin story a little bit there, but I’m kind of curious. What is your WordPress origin story? How did you first get connected to the WordPress world?

Gary So I started many moons ago. My first real experience with writing code for the web was when I went to university back in 1998. The IT suites were available all night, and that was my first chance to experience kind of permanently connected web. The IT suites were rocking the latest in the browsers or Netscape Navigator and IE4 at that time. I soon found some online chat rooms. They’re not live now unfortunately, but they were a fairly simple affair. You type some text into a field, you hit submit, and every few seconds a page would reload with the updated chat from yourself and others.

Gary Some of the folks had color text, though, so I was wondering how they did that. And how they had different sized text and depending which browser you were using, the text scrolled across or the text flashed. When I found out how to do that, then it was the HML, and so my first introduction to coding was the font, marquee and blink tags. So it was a promising start. From there, I moved onto Geocities and as every self respecting new developer did in the ’90s. It was just static HTML pages. I later discovered that you had server-side includes and then CSS appeared and so I didn’t have to spend my days updating thirty different files just because I changed the photo for instance.

Gary During the eight years or so I graduated from university, I started teaching in schools and prisons. Moved my sites over to some proper hosting. The design still sucked, I’ve never claimed to be a designer. And it wasn’t yet WordPress but all that time it was just a hobby. Around 2007 I had to go to, went to Malaysia, my wife was sent on work out there. And because I wasn’t allowed to work out there then I started playing and discovered WordPress around then and started playing with it, experimenting and customizing. From that point I was definitely hooked into WordPress. It was right about version 2.3 at that time.

David You touched on a lot of bases there. You got IE4, you got flashing text, you got Geocities, you’re really building your resume up. I see why VIP at Automatic hired you Gary.

Gary Absolutely, I’m kind of top drawer. [crosstalk 00:05:31]

David … Just absolutely stellar resume here.

Gary I’m good. I mean and it’s fun to think of the history that someone like myself has gone through who’s completely self taught. We didn’t have the Zacs and the Weses around at the time to offer the courses on the latest and greatest within web development. If you didn’t go to university and learn it there, I mean my degree was in teaching so I was all self taught, and that for me has been the best way of doing it. I’ve taken the long way around, it’s taken twenty years. Eleven years of WordPress and ten years running an agency but that’s a lot of experiences and cases to come across. And be, not necessarily a better developer but an all-round developer because of that experience.

David Well, I’m with you there, coming up in the nineties having to be self taught. Because there certainly wasn’t, certainly college material but definitely even the courses and things we enjoy today so fun times. Now, shifting gears a little bit, kind of the topic of the podcast, is kind of around Genesis and what it is and why people use it and that kind of stuff. And obviously your role as a open source contributor to Genesis I think for all this time puts you in a unique position to answer these questions. You know this question comes up a lot to me but what benefits does Genesis afford to a business or agency? Why choose a theme framework like Genesis or any other of the theme frameworks out there?

Gary There’s a few different reasons but for me as business it was a chance to grow. Be able to grow my business because it was a tool that I could make use of, but also for my own brand and reputation that I wanted to establish myself. Not just in the WordPress niche of web development, but in the Genesis niche of the WordPress community. So it was my chance to be part of the community, to get involved. And if this was a tool that I was going to be basing my business on then I wanted to see it always be continued to be improved. By contributing to the code base I got exposure and referrals from Brian Gardner. People who were contacting him, somebody who wanted a website, wanted to a Genesis developer, he would pass those on to me.

Gary Also spending time in the forums and helping people in the Genesis … There was originally a Skype group and then there’s a Facebook group. There was a LinkedIn group. On Twitter at the moment obviously you’ve got a Slack workspace. I was getting referrals from other developers for projects that they couldn’t manage and doing code audits for them. Which helped to improve their coding abilities as well as whatever project they were working on. So even before you actually start looking at the code and how that can help speed development then the community is a big factor of why use Genesis.

David Yeah. It’s so funny, I asked you the question like what benefits did it provide and you didn’t talk about, in the beginning, around workflows. You didn’t talk about capabilities, you didn’t talk about features. You talked almost exclusively about the community. And I think, you know I think that’s one of the powers I think of WordPress, but then also certainly the Genesis sub-community. And you know as I’ve engaged with the community more, having been involved with it more, seeing that sub-community and how people help each other, how people help each other to succeed, and the benefits that they extract from participating and contributing, has really been really awe inspiring. And then to hear you have that be your first response was testament to that.

David Then if we switch gears a little bit, if the primary driver benefit for you is the strength of the community and how you were able to both contribute but then also extract value and benefit from participating, what is the more technical reasons? Why do people use Genesis and theme frameworks?

Gary It’s, I mentioned it briefly before, it’s the speed of development. The way Genesis is built and can be customized it’s makes use of the action and filter hooks rather than the template parts. And that benefits me. You don’t have to edit multiple files to make the same change in different contexts. And if you look at the latest Twenty Theme I think the main element appears seven times across various different files and templates. So if you want add an attribute to it it means editing seven files. Whereas Genesis, being a little bit more abstracted, means it’s four lines of code for me to add an attribute in there. The snippets to do any of those customizations or templates but also, you can have text or keyboard shortcuts in your IDE that makes dropping in the logic easier.

Gary For developers you’ve got the same code base to work on, whatever the site looks like. The visual design of what the child theme has to be to meet the requirements for the client is completely decoupled from Genesis itself and how you go about doing those customizations. You get built-in value for the client so you can let them choose the layout per page. Or it’s got the basic SEO field supports. And then there’s a ton of plugins that will allow them to choose what the footer or the hooked in content will contain. So it’s flexible for advanced developers but also for other, perhaps less-knowledgeable people.

David Novice people yeah, [crosstalk 00:10:54] I do want to touch on that, absolutely. I do want to touch on that. It’s interesting, but to just kind of recap, it’s efficiency because you’re working within a framework so you kind of have a bit of a common language. It’s abstracted or in a sense kind of decoupling the notion of your theme settings with your theme itself in some ways. So it enhances things like theme portability. But it was interesting to hear your observations on some of the benefits on the engineering side.

David And you started to talk about the novice side and what I want to do is after this quick break we’re going to come back and I want to kind of dig into a little bit of that kind of dual personality of Genesis. So everybody hang tight and we’ll be right back.

PART 1 OF 3 ENDS [00:12:04]

David Hello everyone, welcome back to The Press This, WordPress community podcast on WebmasterRADIO. This is your host David Vogelpohl and I’m interviewing Gary Jones, one of the core contributors to the Genesis Framework. And right before the break, Gary, you were sharing some of the benefits that Genesis provides to development teams. And you started to kind of get into a little bit about how Genesis can also be beneficial for the novice user, and you know, Genesis is kind of funny and the community is kind of funny because it has this duel personality, right? It helps novice people build better sites, but it also helps advanced teams build sites faster and more performant. So how do you think … you kind of share your thoughts on Genesis’s role for the advanced developer, what are your thoughts for, say, the more novice website user or person building their own site? What are the benefits of leveraging something like Genesis?

Gary The benefits, it comes from the same origin as the fact that Genesis is built on the Hooks API. So the same way that advanced teams can hook their customizations in directly is the same way that you can get tools like Design Palette PRO, or Genesis Extender, Genesis Layout Extras, Genesis Super Customizer. These are all plugins that are either free or premium in the WordPress space, either from StudioPress or from third parties that allow Genesis users, who are not comfortable in the command line or with code to make the changes that they want to do. It’s very easy to see, I mean, there’s so many Genesis specific plugins, it’s easy to see how Genesis acts a bit like a PostCSS or Remarq with all of their kind of respective, separate customization packages. It is the framework, it is the hub and there’s a lot of ways to extend that, that you aren’t just relying on the main Genesis itself. I think the main issue of this duel personality comes down to the marketing, is gonna be the tricky bit of the duel personality. It’s gonna be a fine line to balance.

Gary I mean, have a look at the plugin page on the StudioPress website, it mentions kind of 15 plugins that StudioPress has built and there’s only one from a third party there, yet there’s many free and open source plugins that exist on WordPress.org and GitHub.

David I think there’s 219 at my last count that are specific to Genesis on WordPress.org. And then countless-

Gary And there will be many more. I mean, I know I’ve got some on GitHub that I’ve not put on WordPress.org. But again, down to the marketing issue is that if you look on the main Genesis page it includes some words, ’cause I was looking at it earlier today, of “schema.org” and “microdata” and “turnkey designs”. Now, for some audiences that’s just gonna be jargon. As novice users, they’re not gonna know what that is, necessarily care what that is. And perhaps there’s some sort of level of education there, that they will benefit from this if they understood what it is. But yet, for other perhaps more advanced people, that might be exactly the type of features that they’re looking for. And so marketing, this duel personality kind of package is where the trick is, I think.

David Yeah, it certainly can be challenging speaking to both audiences. For me, I don’t know, if you think about the WordPress context for a minute, it also has this same issue or the same duel personality, where it’s used by novice, non web-developers, non-WordPress developers, extensively and millions of times. And then it’s also used by advanced teams of huge agencies building super complex things. And I don’t know, it’s almost like the flexibility of WordPress, but also in the Genesis context of flexibility of Genesis allows you to use tools that make it easy as a novice, but then also allows, say, your engineering team or your developer, or your agency to build crazy stuff, but build it in a way that makes it easy for you as a novice to then work with and deal with. Have you found that to be true?

Gary Yeah, absolutely. I mean, yeah, there’s definitely stuff that for client work that I’ve been part of, that we’ve gone over and above where anybody ever thought Genesis would be able to do, just because we’ve done some customizations and we’ve moved parts of the page around, and we’ve added in more semantics or moved bits and pieces where it needed. So yeah, it’s very flexible for those who need it, but it’s that same flexibility that allows these extra tools to be used as well.

David Yeah, great, great point. And again, kind of parallel to the power of WordPress itself, which I think is really interesting. So earlier you talked about kind of the role that the community played in your business and the Genesis community in particular. And I know that there’ve been … you know, I’ve talked to half a dozen people that have talked about their journey as a WordPress developer and Genesis, and other framework’s role in that in helping them build complex experiences, build things kind of above their punching weight a little bit. And a lot of that value came from the community as well, help them figure out problems, learn new things. But how do you think of the overall benefit to the community? Explain how it affected you, but when you engage with people in the community, when you see others engage with them, what benefits do you think people are getting from participating?

Gary Predominantly support. For those who want to do customizations, there’s a ton of tutorials out there. And I know that for the kind of upcoming versions of Genesis, where we might be looking to change some bits and pieces, one of the key factors is, well let’s not break things so much that these tutorials no longer work. So that’s very important. You could kind of look at Slack, there’s the community support forums, there’s groups on other platforms, there’s Genesis meetup. There’s lots of ways to find interact with other Genesis users, who you can ask about how to do X or find the best plugin to do Y. One prominent member of the community, a gentleman called Sridar, and he went along the forums, and he was answering just for everyone’s benefit. But instead of just answering the forum question specifically, he was putting it onto his own website and then actually could build up a business from that because he built up all these tutorials, 300-400 tutorials, a link back to them from the support forum, the person who asked the question and from there he was able to turn it into a premium website.

Gary So that community aspect has allowed him to develop kind of a subscription business model. In terms of other support, I mean, we had a Genesis Camp, which was like a virtual conference. A bit like the WordSesh Conference in the wider WordPress environment. And that was 2015 and we had some 36, 38 videos and it was covering development workflows or how to deal with clients, or understanding Genesis hooks, or selling maintenance plans, internationalization. I was part of the UK Genesis kind of set up there, we did a podcast episode. There was Troy Dean doing about recurring revenue, so there’s a lot of things that isn’t just relative to how do you do X with the code in Genesis, but how do you run your business. How do you as a freelancer or a small agency kind of make best use of Genesis to grow your situation.

David I love that you called that out and specifically Sridar, and the work that he did. I got a chance to talk to him the other day and learned more about his backstory. And it was really kind of inspiring to see that he started all that, not starting a business, but helping others and then through that was able to establish a business that provides a good stream of income. And so it’s so interesting to see that, but then even if you go to the Genesis WordPress Facebook group and look at people’s questions in there, and they’re very particular. Like you said, support is a key part of this. And they’ll say, how in this way do I do this thing, or using this feature, how do I accomplish this objective. And there’ll be half a dozen, you know, multiple dozens of responses helping them, thinking about it, offering options and then again, just to see that and see that level of assistance from the community I thought was also really inspiring. And then as you pointed out, all the different businesses that have kind of popped up in that ecosystem, and really kind of the sense of community, or the analogy of stone soup, right? I’ll bring a little something, you bring a little something and we’ll walk away with a good meal.

David But to see that kind of expressed, I thought was really interesting. And of course, we see that in the broader WordPress context, but to live that on the edges and my Genesis agency, and then kind of come more into the center as we’ve worked with the community and worked with the products, I think was even a little bit surprising to me. I don’t know if I’ve participated in a group that’s active with helping people.

Gary Yeah and I know Brian Gardner was very key in … There might be, I come in and say perhaps we need an advanced sample theme, perhaps we need this, perhaps we need that. And he’d say well, look, if we’re not doing it at StudioPress, you go ahead in the community, and you do it because we will support you to do that. And if you come up with a subscription model that does this or some other service, I think there’s so many people doing services from converting from the HTML 5, no sorry, the XHTML Genesis Child Theme into HTML 5 Child Themes. And it was a particular service, particular kind of niche. It wasn’t something that was gonna be automated from StudioPress, so people could do that as a business, and StudioPress and the Genesis community would support that. So yeah, very interesting to see that happen as well.

David Excellent. I certainly feel the yolk of that heritage, as I participate in helping to support the community moving forward. And you know, the kind of principles that Brian set down and operated by, that the community then kind of reacted to and oriented around, to me is a great degree of responsibility, that we feel in necessary to honor and to support and to grow and expand. I think these are fun things to do. And glad also to have Brian Gardner as our partner in still doing that and continuing that legacy. So, I do have some more questions Gary. This is fun, interesting stuff, but we’re going to take a quick break. When we come back we’re going to dig more into Genesis in the community. So, everybody hang tight and we’ll be right back.

PART 2 OF 3 ENDS [00:24:30]

David Everyone, welcome back to Press This, the WordPress Community Podcast on WebMaster Radio. This is your host David Vogelpohl talking about the Genesis framework with Genesis core contributor and Automattician, Mr. Gary Jones.

David Gary, before the break we were talking a little bit about the power of the community and the role that it plays in supporting others and even things like spawning businesses and all of that cool stuff. But, I wanted to wind back the clock a little bit because, at a point in time you had discovered Genesis, you had discovered the community, you wanted to participate and be part of its future and be a contributor. But, what was that moment? What was that moment you decided, for example, and I mentioned earlier I ran a Genesis agency. I never bothered with learning how to contribute or having my staff contribute. I never bothered with really participating in the community, I think, to my detriment. But you did. You did bother with that. You did lean into that. What was that moment for you where you said: Look, this isn’t going to directly drive revenue for me, but I still feel the need to do it. How did you make that transition?

Gary My story starts even further back than that. When I first started getting into WordPress, somebody suggested the Thesis theme, and I used that for a couple of years. That served well for the time, it allowed me to create client projects and client websites. But, where I got frustrated with it was … I mean, two parts. One, it seemed to work against WordPress. It has very opinionated concepts and approaches, whereas Genesis tends to work with WordPress. But the second was that I really wanted to help improve the code base, be through documentation, through a new feature, through better code standards, whatever it might be, and just found that I was being blocked on doing that. There just was no interest in me being part of that.

Gary I then was introduced to Genesis. A lady called Darcy, she was in Thesis community and had moved over to Genesis and she told me about it. I looked at it and then she, very quickly, introduced me to Brian Gardner via email … very standard introduction email. He said, “Ooh well, if there’s any suggestions for Genesis then please let me know.” I sent him a big long email list of items that I think could be improved and he was like: “Wow. Okay. We need to get you onboard here.” It was that willingness to be open and to listen and to request and require … Not require. But to request contributions or allow contributions to be made.

Gary That was the turning point. It was like: Yes. Somebody wants to listen. I don’t know it all, but I probably know some things different, so if they’re wanting to listen, I’ll go ahead. As I said before, if it can help improve my business because that’s what I’m going to base my client work around, let alone my brand and reputation, then that’s what I want to help with.

Gary It was only later that I realized that helping so much on the forums, for instance, well, being part of the forums allowed me to not only answer those questions and build the knowledge base of the code, but also to help individuals improve theirs, while at the same time improving my brand and reputation.

David That’s really great thoughts. So, basically the gist is, that this was an important tool for you and that without having that voice and the ability to help improve it, maybe felt a little powerless. But by having the voice and the ability to contribute and make it better, you ultimately made your own product better. And in the process, benefited from all the ancillary benefits of the community, in terms of your business and so on and so forth. Really, really interesting to think about those things.

David I have a friend, actually, who runs a conference. I remember he was telling me this story. Back in the day he went to someone who ran the industry’s biggest conference at the time, and said, “Hey, we have some ideas and think it would be fun to do this.” And that person flat out rejected those ideas. So he and his partner went out and started their own conference, and now that is the industry-leading conference in that particular industry. But it was that moment where, if that person had just listened. If that person would just have been thoughtful about those suggestions, they could have had allies in helping them in their mission, rather than someone that might be going out elsewhere. Not that you would have done that per se, but to have that outlook with Genesis was helpful for you to make sure that you could rely on the product and have a voice in its future.

Gary Yeah, absolutely, yeah.

David So, last question here and maybe a real quick one. What is one fun story from the history of Genesis? As quick as you can.

Gary Not so much with Genesis. The only one I could think of is that, back in 2013 WordCamp Europe in Leiden. It was lunchtime, I was standing outside. I was chatting to Joost de Valk, obviously head of Yoast. We were just having a conversation, it was the first time I’d met him. I was still very starry-eyed, as one of these WordPress heroes. Somebody came up to interrupt, said: “Oh I’m really sorry to disturb you guys.” Then started talking to me. He said, “Gary, I just want to thank you for the work you’ve done in Genesis. For everything you’ve done, it’s been really helpful. I’ve learned a lot.” And so on and so forth. Really complimentary towards me, then he effectively just walked off.

Gary The fact that he did just interrupted myself and Joost de Valk, and I think: Well, hang on, he’s talking to me and not Joost. Now perhaps he knew Joost already. Perhaps he already spoken, I don’t know. But it was interesting or I found it mindblowing that somebody would, at that point, come and talk to me and thank me for the stuff I’ve done on Genesis, even though the very famous, even back then, Joost de Valk was standing there as well.

David Ah, that is a fun story. Well I definitely thank you Gary for your contributions. I don’t know if you know this or not, but Joost actually used to host this podcast, and then-

Gary I didn’t know that.

David Yeah. And so now I have the helm, but funny story to hear. Gary, I wanted to thank you so much for joining the show today. This has been really enlightening and interesting and I really appreciate your time.

Gary Oh, thank you for inviting me.

David Awesome. Well thanks everyone else for listening to Press This, the WordPress Community Podcast on Webmaster Radio. Just a reminder, you can always subscribe on iTunes, iHeartRadio or download the latest episodes at WebmasterRADIO.FM. Again, this has been your host, David Vogelpohl, and I support the WordPress community through my role at WP Engine, and I love to bring the best of the community to you here every week, on Press This.

PART 3 OF 3 ENDS [00:33:33]

The post Press This Podcast Transcript appeared first on Gary Jones.

]]>
https://garyjones.io/press-this-transcript/feed 0 9920
I’m joining Automattic https://garyjones.io/automattic https://garyjones.io/automattic#comments Mon, 15 Oct 2018 12:26:26 +0000 https://garyjones.io/?p=9885 After 10 years of running my agency, Gamajo, I'm joining Automattic to become a VIP Developer.

The post I’m joining Automattic appeared first on Gary Jones.

]]>
After 10 years of running my agency, Gamajo, I’m becoming a VIP Developer at Automattic.

I’m joining the Developer Squad to debug complex client issues, build tools to make the Support team more efficient, do code reviews before deployments, and generally be a positive disruptive influence to the help the rest of the VIP team be more successful in their roles.

My journey has been a long one. It’s been 20 years since I first started writing code, 11 years since I started playing with WordPress, and 10 years (and 10 days!) since I registered as self-employed and started taking paying clients.

It’s time for a change though.

Gamajo

For the first 6 years, I generally worked alone. I was doing small jobs and sites, no maintenance, and what I took in turnover pretty much was all profit.

I then found what was my ideal client – big budget, technical understanding, interesting challenges, Genesis theme, and far more work than I could ever complete alone.

As such, over the course of a couple of years, I built up a team of five subcontractors who did much of the work for the main client, and a few smaller clients. I was doing more and more project management (which I enjoyed), and code reviews, and less hands-on coding. It was working well, and financially it was sustaining me.

Chart of Gamajo financial figures, showing significant increase in turnover and profit from 2014-15 onwards
Actual figures on the left axis intentionally not shown, but it’s clear how much all of the figures rose when I started sub-contracting the work.
2018-2019 is low, as we’re only part way through the financial year.

There were bits I didn’t like of course. The chore of entering in time sheets from my subcontractors, so I could generate invoices for my clients was by far the most painful. There wasn’t an easy way to automate or streamline this.

The dynamic with the main client changed back in March 2018 though, when some emergency development to change the payment gateway provider with two weeks notice was required. Sal got it done, but it was unexpected in terms of the client’s yearly budget, so we had to ease off of development and plan some “shutdown” months when only absolutely essential maintenance would be done.

At the same time, the client company decided to take on an in-house developer, which Gamajo was happy to support and handover to, but ultimately this would have meant less work being done by Gamajo.

I did get Alex to write up a marketing plan for Gamajo, and I was ready to execute it, if needed.

WordPress VIP @ Automattic

VIP is Automattic’s enterprise business. It provides hosting and support for many top names, particularly in the publishing industry: The Sun, Microsoft, TED, TIME, Facebook, People, New York Post, Spotify, and many others you’ll have heard of but which I don’t know if they are public knowledge or not.

Logos from some of VIPs client.

VIP works with Agency Partners, as well as Technology Partners, to create websites and customisations that meet the needs of the clients. There’s a focus on leading the roll-out of the new block-based editor (Gutenberg). My role is to interact with folks from these groups, and review their code and help debug issues.

The VIP team is relatively young, but growing fast. As I understand it, the team was bolstered when Automattic acquired Code for the People in late 2014, a 6-person UK WordPress agency, led by Simon Dickson and Simon Wheatley.

Simon Dickson is to “blame” for pushing me to look into the VIP Developer role. I spoke to him at WordCamp London in April 2018, where he first mentioned that he thought I’d be a good fit for VIP. We chatted again at WordCamp Europe in June, where he again suggested me being a VIP Developer. While I wasn’t at all interested the first time around, the changing dynamic meant that I did look into it after our second conversation.

The Application Process

I applied on 15th July. I had an initial 1.5-hour interview over Slack, followed by a code test – to improve a plugin, though I ended up rewriting it from scratch – and then a trial where I dealt with real client tickets and code reviews.

Funny aside: The very first ticket that was assigned to me was from Nick Croft, a developer at Reaktiv Studios who was formerly at StudioPress and who I knew from the Genesis Framework community. Small world.

The trial was supposed to last around 4 weeks, but I was on holiday for a week, and then the VIP team all went to Montreal for their Grand Meetup, meaning folks weren’t available to get me started on my next tasks. So be it.

I was told I passed the trial stage after 6 weeks, on September 14th, the day after I had met my trial lead, trial buddy, and team lead at the Big WP London meetup at the News UK offices.

Photo from Big WP London meetup, high up in an office block, looking at a stage, with the sunsetting behind.
In the News UK building, looking out over London. Genuinely amazing view. Photo by Primary Image

I then had a (text) chat with the CEO of VIP, Nick Gernert. It was over Slack, and the clash with the Automattic GM that he was attending meant we had three rounds of chat (1.5-2 hours each) over the course of a week.

Finally, after 3 months since first applying, I was sent an offer, which I accepted, and so I start on 24th October. This gives me enough time to wrap up everything with Gamajo.

I’m excited about the role – I’ve not worked at this level of enterprise before, and there’s a lot to learn for things I know of, but never had to use until now. It’s WordPress, but with some unfamiliar considerations based on the VIP-Go platform architecture. The code reviews and debugging need to take this into account. It may take me 6 months to really settle in. But I can also contribute to other areas in the meantime, particularly on the coding standards tools; I’m a committer on the WordPress Coding Standards team, but VIP has its own coding standards that would benefit from more improvements as well. It’s fascinating to see PHP_CodeSniffer being used in real-world scenarios, more than just individual developers tidying up their own code.

The end of my involvement with Genesis?

One of the potential drawbacks of accepting an offer at Automattic was that I would potentially have to stop contributing to the Genesis Framework. I’ve contributed for about 8 years, both to the codebase and to the community. At one point, about half the code in Genesis was written by me, and if you manipulate the dates correctly, GitHub shows periods where I’ve been the most active developer to the code base than anyone else.

Screenshot of charts showing Gary has contributed most to Genesis between June 29th 2016 and Oct 15th 2018.

But, WP Engine bought StudioPress, and as WP Engine is a competitor is to VIP in the enterprise space at least, I feared that the conflict of interest policy at Automattic would mean that my contributions have to stop.

I was wrong though.

The top people at WP Engine and Automattic had a call, and an additional item in that ended up discussing my desire to keep contributing to Genesis, with the outcome that Matt Mullenweg has personally encouraged me to do exactly that. Result!

Conclusion

As a VIP Developer, I can go back to my developer roots, solving puzzles, and not worrying about how to run a business, with the bonus of having a salary and additional benefits. Since we moved to a bigger house a year ago, and my wife recently decided to pivot her life and give up work, the stability of a regular income will be appreciated.

I may be a little less visible in Slack workspaces focused on being a freelancer, but you’ll still see me around the WordPress community. I’ll still be a General Translation Editor for British English, still contributing to core and writing plugins, still a co-organiser for WordPress London meetup, still attending WordCamps, and still a part of the Genesis community!

Fun Trivia: Because I’m based in the UK, I’m not joining Automattic Inc. directly as an employee, but Ministry of Automattic Limited, which is a subsidiary to the Irish company of Aut O’Mattic A8C Ireland Limited, which is a subsidiary of Automattic Inc.!

The post I’m joining Automattic appeared first on Gary Jones.

]]>
https://garyjones.io/automattic/feed 7 9885
Be Like Bill – How To Start The Engine Like A Genesis Expert https://garyjones.io/dont-start-the-engine https://garyjones.io/dont-start-the-engine#comments Wed, 22 Aug 2018 10:02:16 +0000 https://gamajo.com/?p=5314 There's a line in the Genesis Sample theme, commented with "Start the engine". All of the child themes by StudioPress have it. So do most child themes in the community.

This article looks at the drawbacks of this start the engine approach while exploring some of the advantages an alternative setup function may provide.

The post Be Like Bill – How To Start The Engine Like A Genesis Expert appeared first on Gary Jones.

]]>
There’s a line in the Genesis Sample theme, commented with “Start the engine”. All of the child themes by StudioPress have it. So do most child themes in the community.

However, it’s not needed.

More specifically, it doesn’t have to be needed.

It seems innocuous enough, so what’s the problem?

This article looks at the drawbacks of this start the engine approach while exploring some of the advantages an alternative setup function may provide.

Start The Engine

Let’s start at the beginning.

Child themes for the Genesis Framework by StudioPress, typically have a functions.php file that attempts to Start the engine:

View this code snippet on GitHub.

This line has been present since the very first version of Sample, and as such, it’s in every single StudioPress theme, and by a de facto standard, many child themes in the Genesis community.

Most people who have a passing understanding of PHP within WordPress themes should understand the code snippet above. Line one takes us into PHP mode, line two is a single-line comment, and line three is where the fun starts. It includes, once, a file called init.php within the lib/ sub-directory of the template directory (that’s the parent theme, aka Genesis, to you and me).

What Does init.php Do?

The init.php file within Genesis is the initialisation file. Here’s what it does (in Genesis 2.6 at least):

  • Sets up an autoloader for Genesis class files.
  • Calls a genesis_pre action hook.
  • Defines a genesis_i18n() function for loading Genesis language files, and hooks it into the genesis_init hook.
  • Defines a genesis_theme_support() function for adding theme support for Genesis and WordPress features, and hooks it into the genesis_init() hook.
  • Defines a genesis_post_type_support() function for enabling certain Genesis functionality for Posts and Pages, and hooks it into the genesis_init() hook.
  • Defines a genesis_post_type_support_post_meta() function for enabling Genesis functionality for post meta on public post types that are not Pages, and hooks it into the genesis_init() hook.
  • Defines a genesis_constants() function for defining PHP constants that Genesis uses within itself, and available to plugins and themes, and hooks it into the genesis_init() hook.
  • Defines a genesis_load_framework() function for loading in all the files, and hooks it into the genesis_init() hook.
  • Calls a genesis_init action hook, which therefore triggers calls to each function referenced above.
  • Calls a genesis_setup action hook.

Basically, that start the engine line makes every single bit of Genesis Framework load up straight away.

Advantages of the Start the Engine Approach

Let’s briefly discuss what some might say are the advantages of this method:

  • It’s one line. It’s easy to copy and paste, and even to remember, but you should know that lines of code are not an indicator of the quality of the code.
  • It loads all of Genesis up-front. The rest of the code in the functions.php file can reference Genesis functions, and the theme author doesn’t have to worry whether they are defined or not.

That’s probably about it.

Before going through the disadvantages, I want to introduce an alternative, so that we can make a comparison.

The Alternative: A Setup Function

The alternative is a setup function. Credit where credit is due, I call this the Bill Erickson Approach, as it was Genesis legend Bill Erickson who I first saw suggest this (though he may have got it elsewhere).

Here’s a trimmed example from Utility Pro by Carrie Dils. We’ll go through the reasoning in a moment:

View this code snippet on GitHub.

Now that we’ve seen an example, let’s explain what it is.

What is a Setup Function?

A setup function is one (or more) function(s) that includes much of the theme’s setup code, such as adding or removing theme support, adding or removing post type support, adding image sizes, defining menus for Genesis, registering widget areas, etc.

It’s not just for child themes, either. All of the default Twenty* themes have their own setup function (here’s TwentySeventeen’s), and Justin Tadlock has written about creating a theme setup function for themes in general.

For Genesis, we don’t call the setup function immediately, rather we hook it into the action hook that only fires after Genesis has finished loading, genesis_setup. Since Genesis itself also hooks into genesis_setup, we use a later priority of 15, to make sure the child theme adjustments come last.

While the example shows a single function, it would be equally possible to have multiple functions that organise the code into logical groups of function calls, and hook them all into the same hook and priority.

Advantages of the Setup Function Approach

There are a few advantages with this suggested approach that are worthy of explanation. These are:

  • Not including a file from another code base.
  • Honouring the default WordPress load order.
  • Fewer function calls in the global scope / everything is hooked in.
  • Allows functionality to be hooked in before Genesis loads.

Not including a file from another code base

Our code is inherently coupled to the file name of another code base (Genesis), and this is a bad idea. If it ever gets renamed (and with Genesis 3.x, that is a possibility), your code will throw a fatal error. You could do a file_exists() check, but if doesn’t exist, how will the rest of your code behave? Your code is still coupled to looking for that specific file name.

The solution brings us to our next point.

Honouring the Default WordPress Load Order

The whole point of child themes historically requiring that Genesis file, is so all of Genesis loads up first and we can use the Genesis functions.

But here’s a little secret.

The default behaviour for WordPress is to load the parent theme after the child theme. It will happen automatically. We should honour that behaviour.

The reason for letting this happen is simple. We stick to the expected behaviour for parent and child themes. We let WordPress load the Genesis functions.php file, which in turn loads the file we would have tried to load in our code.

If we don’t call any Genesis functions in the global scope (i.e. outside of a function hooked into a hook), then we don’t need Genesis to load first.

Fewer Function Calls in the Global Scope

PHP has scopes. Here, we’re considering two scopes: function scope and global scope.

Function scope is where we assign a variable, or make a function call, from inside a function.

Global scope is where the same thing might happen, but outside of a function.

View this code snippet on GitHub.

Any function call in the global scope is called when the file is first loaded – that is, required or included by another file. In the case of a child theme functions.php file, that would be when WordPress is loading the (child) theme.

So why is this bad?

As plugin developers, we might want to alter how a theme runs, but if the theme makes a function call before we have a chance to intercept, we can’t make those changes.

However, if the critical function calls are all inside another (setup) function, which is hooked in to be called at a known time later, we can write plugin code to handle that; we can unhook that (setup) function, or have the plugin code run at an earlier or later priority as needed.

With a setup function, the theme itself could also handle specific edge cases that need a different setup i.e. for landing page templates.

It’s worth noting that this setup function approach isn’t for performance optimisation, but it certainly won’t noticeably impact performance either. The increase in executed byte-code is negligible within the request.

Allows Functionality to be Hooked in Before Genesis Loads

Delaying our code until after Genesis loads is all well, but can we use it to our advantage? Yes, we can.

As an example, let’s consider widget areas. By default, WordPress admin shows widget areas in the order they were registered, so all of our custom widget areas would typically appear below Header Right, Primary Sidebar and Secondary Sidebar.

If we create another setup function, but hook that into an earlier hook, or with a different priority, we can set things up before Genesis does. For example, if we display a Utility Bar widget area at the top of the site’s front-end, we could register it to appear in the Widgets admin page before Header Right. This may be more intuitive for users since the widget areas then follow the order they do on the front end.

Utility Bar widget area registered before the Header Right widget area from Genesis.

What Should You Put Into Your Setup Function?

So, should you put all of your global function calls into the setup function?

No, and here’s why.

Action and Filter Additions

Most add_action() and add_filter() can stay outside. There’s nothing special about these functions that has anything to do with Genesis, even if the callback they reference does. Keeping these by the callback function definitions makes code considerably easier to read, rather than having the function in one place and the context (hook) under which that function is called several hundred lines away or in a different file.

Could we move the add_action() call and the function definition into the setup function? This would create nested functions.

Nested Functions

Technically, PHP allows nested user-defined function. That is:

View this code snippet on GitHub.

However, we should generally avoid nested functions, since you can’t call foo() more than once. Calling it a second time would make PHP attempt to define bar() again. Since a function by that name already exists from when foo() was first called, this would cause a fatal error.

In this case, it stops functions from being re-usable and should be avoided.

Action And Filter Removals

Unlike their add counterparts, the global remove_action() and remove_filter() calls may need to be in the setup function. One of the common gotchas is calling a remove_action() in the global scope, before Genesis has had a chance to add_action() in the first place. By including the remove_action() in the setup function, which in turn is not called until we know Genesis has finished setting up, the remove_action() intent will work.

WordPress Functions

WordPress functions like add_image_size(), add_theme_support() and setting the global $content_width don’t need to be in the setup function, but equally, it makes sense to have them there, since they are part of setting up the theme behaviour.

Summary

Since the majority of customisations in Genesis Framework child themes require a hooked-in function, it makes perfect sense to add some of those global calls into one or more functions and hook them in as well.

Next time you’re editing a theme, consider not starting the engine by tying your code to Genesis internal file structure. Instead, take advantage of the WordPress event system and hook in your changes after WordPress automatically loads Genesis.

The post Be Like Bill – How To Start The Engine Like A Genesis Expert appeared first on Gary Jones.

]]>
https://garyjones.io/dont-start-the-engine/feed 1 5314
My experience of giving a talk at WordPress Suffolk https://garyjones.io/wordpress-suffolk-experience https://garyjones.io/wordpress-suffolk-experience#respond Fri, 10 Aug 2018 01:10:09 +0000 https://garyjones.io/?p=9790 Yesterday, I gave a talk at WordPress Suffolk, called "Introduction to Using Coding Standards in your WordPress Project". This is a write-up of my experience.

The post My experience of giving a talk at WordPress Suffolk appeared first on Gary Jones.

]]>
Yesterday, I gave a talk at WordPress Suffolk, called “Introduction to Using Coding Standards in your WordPress Project”. While I’ve spoken in a panel at a WordCamp, and given talks at meetups before, this one felt like the first one that was a classical long-form, full of slides, with a Q&A at the end.

Here are the slides: https://garyjones.io/slideshow/wpcs-wpsuffolk.

WordPress Suffolk is a new monthly meetup group in Ipswich. I’m already a co-organiser for the WordPress London meetup, so I wanted to help support this group. When I asked who was speaking at the next event, Dan jokingly said “Gary Jones”, but I was already considering applying to speak anyway.

WordPress Coding Standards released version 1.0.0 recently, and I knew I wanted to do an introduction talk. I’d seen Juliette Reinders Folmer give an excellent technical talk about PHP_CodeSniffer and WPCS, but I wanted mine aimed at a less technical level.

Turns out, this was perfect for the new Suffolk group, who were generally a bit more technical than a typical WordPress group, but who hadn’t done much regarding code standards before.

The Suffolk group was small – about 10 attendees in total, including the organisers and speakers. While it might have seemed that the hours invested in writing, practicing and otherwise preparing for the talk (including the time and expense of travelling three hours each way, and staying the night at a local hotel) might have seemed excessive, I knew this would be good experience for me, and it be a talk I could deliver again if I wanted.

I felt that the talk went well, though one bit took me by surprise. I tried to engage the audience with some PHP compatibility questions (which version of PHP were namespaces / short array syntax / scalar return types introduced), but either folks were too shy to give answers, or I misjudged what people knew about syntax changes made in different versions of PHP! I’m going to leave the questions in, as it breaks up the talk in a good way, though perhaps I can introduce it better than “We’re going to do some audience participation…”.

I’ve not watched the video back yet, but I was told there were far fewer “ums” and “errs”, making it seemed more polished compared to my previous talks. I’d been through my talk a few times, and knew I could roll off the points without too much scripting. I did have a few extra supporting points in my speakers notes that I forgot for one particular slide, but I can work on that.

I really wanted to have a strong start. I used what someone described as a “left field” approach, with intrigue regarding the Apple goto fail bug, and linked that into coding standards. The most impactful start of a talk I’d ever heard was Chris Lema, who’s story started with a line like “Her name, was Melanie”. Mine was:

“It was one line of code. The bug had existed for a year. The file was open source, and publicly available since before then. The function with the bug was related to verifying server key exchanges, security at the operating system level, that many applications relied on. There was even a rumour that the NSA was making use of the bug for its own needs. And yet all of this could have been avoided had coding standards been followed.”

Pauses were added for dramatic effect. Doing this means that I had a calm start (and didn’t talk too fast), and I could build the enthusiasm as I progressed. Since I’d just been introduced by the host, I didn’t feel it was worth spending those first critical moments explaining who I was and why I was qualified to give the talk; that would be seen through the talk and my name and contact details were on the final slide.

Screenshot of my title slide, containing the presentation title, the event (WordPress Suffolk) and date (August 2018), and my name and Twitter link

I’d also concisouly made some decisions about the slides themselves. I used dark colours for most slides (so the focus would be on me more), with generally a few words or code snippet on each, though one or two had a quote or longer list. I did use a light background for the final slide – a good way to wake everyone back up, and provide some incidental light on the audience for when they were asking questions.

I used the Presenter plugin for WordPress, which is a wrapper for Reveal. Presenter has a few bugs, which I reported, but once I got the hang of it, putting the slides together wasn’t too painful. It means my slides are instantly available on the website for attendees, and I can keep a record of what talks I’ve delivered. It also means that I “own” my content, on my site, instead of having to reference another slides site.

Since the talk seemed to go so well at WordPress Suffolk, I’m now considering doing it for other local-ish meetups and maybe even a WordCamp. I’ve been asked to deliver it at WordPress London, so that will likely happen at some point!

The post My experience of giving a talk at WordPress Suffolk appeared first on Gary Jones.

]]>
https://garyjones.io/wordpress-suffolk-experience/feed 0 9790
The 5 Surprising Marketing Benefits of Answering Support Forums https://garyjones.io/answering-support-forums-marketing https://garyjones.io/answering-support-forums-marketing#respond Sun, 29 Apr 2018 10:57:10 +0000 https://garyjones.io/?p=33 Most themes, plugins, and tools have support forums. Some are run by the product team, and some are community-based. Either way, if you want to raise your profile with the members of that community, taking the time to answer questions can be useful for marketing yourself as a freelancer.

The post The 5 Surprising Marketing Benefits of Answering Support Forums appeared first on Gary Jones.

]]>
Most themes, plugins, and tools have support forums. Some are run by the product team, and some are community-based. Either way, if you want to raise your profile with the members of that community, taking the time to answer questions can be useful for marketing yourself as a freelancer.

I did this successfully for a long while in my earlier days. I don’t do it so much now as my target audience has changed, though occasionally I’ll spend some time doing it just as a way to help others rather than using it as a marketing opportunity.

For me, it was the Thesis forums, and then the Genesis forums (both WordPress themes). For Genesis, I’d head to the StudioPress community support forum posts that have not yet received a reply.

By spending 30-60 minutes a day answering support forum questions, and you’ll get the following benefits.

1. Your knowledge and experience of that product will increase

XKCD comic with a joke about imposter syndromeEven if you’re familiar with a product, chances are you won’t know everything straight away. You may have to go and find or work out the answers to some support forum questions, so that will help you to get better with the product or a coding technique.

Once you understand that even the “experts” do this, then the less you’ll feel of the imposter syndrome you might get about answering someone else’s question.

2. You’ll have answers to very specific questions

Screenshot of Sridhar's tutorial archive indexIn the Genesis community, we had Sridhar who answered each question in full as a tutorial on his own site and then linked that post in his answer. It meant that over a number of months, he had several hundred tutorials, usually with screenshots or videos. He built a reputation and a knowledge base that he then turned into a membership site earning him $10,000+ in monthly recurring revenue. Not bad at all, and a great way to monetize your knowledge.

3.  You’ll have thankful people in the community

Screenshot from my Who I've Helped page, showing 4 comments thanking me.For a while, I asked people (via a forum signature) who found my answer helpful to leave a brief comment on https://garyjones.co.uk/helped – that enabled me to publicly show folks that I was active in the community. Not everyone commented of course, but it was useful to have a permanent record of at least some of the hundreds/thousands of people I’d helped. Thankful people will remember you in the future and recommend you to others. You’ll become known for being an expert on that product.

4. You’ll have lots of eyes on your support forums signature

My StudioPress support forums signature, linking readers back to my site.Most support forums will allow you to add a forum signature – a footer that appears on each post you make. Adding a forum signature link back to a targeted landing page like `example.com/genesis-support` (or whatever theme/plugin forum you’re on) with details of how you can offer paid help with that specific item, will help to cement your reputation as a specialist with that item. Paid work will come from it. It’s not spammy since each forum post you make is there to help someone.

5. You may get spotted on the support forums by the product owners

It depends on the product of course, and how active the product owner is in the support forums, but over time, being seen as a big contributor to the community may get you spotted by the owners. If you’re looking to do contribute to the product itself (which I did with Genesis), or do some paid work for the product company (which I did with StudioPress), then make yourself become an asset to them by helping them with their support forum work.

 

The post The 5 Surprising Marketing Benefits of Answering Support Forums appeared first on Gary Jones.

]]>
https://garyjones.io/answering-support-forums-marketing/feed 0 33
Develop Your Theme With Grunt – Raw Video https://garyjones.io/grunt-video https://garyjones.io/grunt-video#respond Mon, 01 Dec 2014 10:21:55 +0000 https://gamajo.com/?p=9686 This is the raw video I did as a presentation for the Genesis Slack community. It looks at how you can use the Grunt task runner to help develop a theme by automating common and repetitive tasks.

The post Develop Your Theme With Grunt – Raw Video appeared first on Gary Jones.

]]>
This is the raw video I did as a presentation for the Genesis Slack community. It looks at how you can use the Grunt task runner to help develop a theme by automating common and repetitive tasks.

The post Develop Your Theme With Grunt – Raw Video appeared first on Gary Jones.

]]>
https://garyjones.io/grunt-video/feed 0 9686
Changes in Genesis – Birthday Discount https://garyjones.io/changes-genesis-birthday-discount https://garyjones.io/changes-genesis-birthday-discount#comments Wed, 06 Aug 2014 13:30:19 +0000 http://gamajo.com/?p=3220 Brief summary of the first year of the Changes in Genesis series of books, how I wrote them, and a discount code for the Gamajo Store to celebrate.

The post Changes in Genesis – Birthday Discount appeared first on Gary Jones.

]]>
It’s one year tomorrow since I released the first Changes in Genesis book, on the same day as Genesis 2.0 came out. This was my first experience of selling a product. I’ve not made my millions off of it, unfortunately, but I wanted to share some numbers anyway.

Leanpub

I launched the book via Leanpub. This is both an authoring / self-publishing and selling platform. I wrote the book in Markdown as Leanpub supports this and most parts of kramdown too). The files are saved to a Dropbox folder shared with Leanpub, and then I hit a button on the website to have it generate the PDF, EPUB and MOBI for both the main book and sample book. It then emailed me with the results, including any errors. Leanpub takes 10% + $0.50 per sale, so that leaves me with roughly 90% of the sale price. Amazon gives 70% at best and traditional book publishers are much lower.

According to Leanpub:

  • Number of Happy Readers: 183
  • Number of Happy Paid Purchases: 138
  • Number of Free Purchases: 45
  • Number of Refunds: 5 (2.7%)
  • Total Author Royalties: USD $3,729.44 (approximately GBP £2,214.84)

The large amount of free purchases are due to me promising my mailing list that they would get it free. This was a mistake on my part, but a promise is a promise, so I followed through with it.

The refunds are from customers who didn’t understand what the content of the book covered. This was despite there being a free Sample book available that gives a good indication. Some wanted information on specific aspects of Genesis, beginner or advanced, and not a list of changes between one version and the next.

Leanpub allow a variable price to be set. The book was priced at a minimum of $29.99, with a suggested price of $34.99. The highest I got was $50! With the use of discount codes (some for 100% discount) the average royalty (i.e. after Leanpub takes it’s cut) per sale was just over $20. Without the 100% discounts, but including the launch offer and mailing list special offer discounts, the average was just over $27 per sale.

Leanpub gives it’s own summary of numbers too:

Your minimum price is $29.99, which produces a royalty of $26.49. You have 138 happy paying readers. If everyone had paid the minimum price (excluding any coupons), the book would have earned $3,655.76 in royalties. Instead, the book has earned $3,729.44 in royalties. This is $73.68 extra earned because of the Leanpub variable price feature, in which your book has a minimum price, suggested price and sliders. This additional amount is 1.98% extra!

Put another way: the total amount of revenue (subtracting nothing!) your book would have earned if everyone had paid the minimum price would have been $4,138.62. Instead, the total royalties are $3,729.44. Pretty good, if you ask us!

What about Apple and Amazon? Well, the best you can earn there is 70%* royalty, and they don’t have variable pricing. So, if you had earned a 70% royalty on your minimum price, you would have earned **$2,897.03, which is $832.41 less than the royalties which have been earned on Leanpub!

But what about refunds? Well, you’ve had 5 refunds because of our unconditional 45-day refund policy. This is a minimum of $132.46 of royalties given up, at the royalty based on the minimum price. But you’ve earned $73.68 extra because of the Leanpub variable price feature. So, when you think about the Leanpub storefront experience as a whole package, you could have 2 refunds before our 45-day refund policy would start actually “costing” you anything on the next refund, even with the (probably false) assumption that there would have been no chargebacks or other types of refunds on other platforms.)

Gamajo Store

As I launched Changes in Genesis 2.1, I started selling from my own site instead. I’m using Easy Digital Downloads with several premium and free extensions. I tried several different methods of generating the book file formats from Markdown, but eventually settled on Pandoc. That’s a program written in Haskell which is run via the command line. I had some difficulty in getting it setup how I wanted it, but the upshot is that I have more control over the final appearance of each format (Leanpub is relatively limited in the designs of the PDF for instance), and I don’t have to give 10% of each sale away. I could also then use my own affiliate setup (Affiliate WP) and run discount codes on whatever combination of products I wanted. With the plan to be selling more books in the future, I considered this investment in time and structure to be worthwhile.

Naturally I started selling Changes in Genesis 2.0 on my site as well, both as a single product, and as part of a Changes in Genesis Bundle along with the latest book. I wasn’t sure how much the Bundle was going to sell, but with a significant discount compared to the sum of the individual books, I’ve sold a few since I opened the store last month (12 to be exact). None of the individual 2.0 book have sold so far, which makes sense as Genesis 2.1 is now out, so the information is somewhat redundant (though still useful).

Discount Code

To celebrate the first birthday of the Changes in Genesis series of guides, I’m offering a discount of 30% for all three products in the Changes in Genesis series (2.0, 2.1 and the Bundle) that is valid for today and tomorrow only! Use the code CHANGESBIRTHDAY at the checkout to receive the discount.

The post Changes in Genesis – Birthday Discount appeared first on Gary Jones.

]]>
https://garyjones.io/changes-genesis-birthday-discount/feed 1 3220
Better Organise your JavaScript with the Module Pattern https://garyjones.io/javascript-module-pattern-example https://garyjones.io/javascript-module-pattern-example#comments Wed, 23 Jul 2014 19:13:13 +0000 http://gamajo.com/?p=2821 An example of how to change typical JavaScript to use the module pattern, with named functions and a publicly accessible document ready callback.

The post Better Organise your JavaScript with the Module Pattern appeared first on Gary Jones.

]]>
One of my favourite technical authors Tom McFarlin recently published a piece about how to Improve JavaScript in WordPress. In it he introduces the object pattern as a way to namespace code, to avoid clashes just like we do in PHP with actual namespaces, classes or function name prefixes.

It’s certainly better than a whole load of individual functions, or worse, a whole load of anonymous functions directly bound to events. But could we do better?

The Module Pattern

A quick search will provide more tutorials about the Module pattern, each with slightly different examples. To me, it’s a way of encapsulating (hiding) all functionality in a module, and only revealing some of it to the outside world as needed.

I like to go one further, and avoid anonymous functions. Named functions are potentially re-usable, and help to self-document the code through the function names themselves.

Example

Let’s look at a before and after example I recently did for a client. The important bit here isn’t what the code is doing (or not, as there’s a bug in the original code that apparently wasn’t fixed in my rewrite), but how it is structured.

Here’s the original code:


jQuery(document).ready(function($) {
// Responsive menu items:
$('.nav-header .genesis-nav-menu').before('<li class="menu-icon"></li>');
$(".menu-icon").on("click", function(){
$(".nav-header .genesis-nav-menu").slideToggle();
});
// Declare variables for heights:
var topnavHeight, sliderHeight, headerHeight
// Calculate variables and size of displacements:
$(window).on("load resize", function() {
// Menu reset before calculating heights:
$(".nav-header .genesis-nav-menu").hide();
// Assign values to variables:
topnavHeight = $(".nav-secondary").outerHeight() || 0;
sliderHeight = $(".slides li").outerHeight() || 0;
headerHeight = $(".site-header").height();
});
// Determine header position and displacements:
$(window).on("load scroll resize", function() {
var scrollYpos = $(document).scrollTop()
var windowWidth = $(window).width()
// Media query to detect slider onscreen for window size > 960 pixels:
if (windowWidth > 960 && $(".home-slider").length > 0 && scrollYpos < sliderHeight 5) {
// Set displacements in flow:
$(".site-container").css('padding-top',topnavHeight);
$(".home-slider").css('margin-bottom',headerHeight);
// Unstick header and make header full height:
$(".site-header").addClass('unstuck').css('top',sliderHeight + topnavHeight);
$(".site-header .wrap").removeClass('narrow');
return false
} else {
// Set displacements in flow:
$(".site-container").css('padding-top',topnavHeight + headerHeight);
$(".home-slider").css('margin-bottom', 0);
// Make header sticky:
$(".site-header").removeClass('unstuck').css('top',topnavHeight);
// Make header narrow on scroll:
if (windowWidth > 960 && scrollYpos > 5) {
$(".site-header .wrap").addClass('narrow');
} else {
$(".site-header .wrap").removeClass('narrow');
}
}
});
// Fade out store notice soon after page load:
$(".demo_store").delay(4000).slideUp();
});

view raw

main.js

hosted with ❤ by GitHub

We have everything wrapped in a jQuery document ready event (Line 1). A responsive menu icon is added (line 5), and this has an anonymous callback added to the click event (lines 7-9).

There’s a few variables declared (line 13) before doing some callback on the window load and resize events. We don’t know what functionality, until we’ve read the whole function (or the comment above the binding). We’re hiding an element, and then assigning some widths and heights to those variables we declared outside of this function.

Then there’s some more functionality attached (line 31) to three more window events that moves a bunch of things around. Finally (line 71) we wait for something and then slide it up.

That’s probably very typical code found in themes. Nothing even gets defined to the JavaScript engine until the document ready event fires, so it delays what actions need to happen.

Let’s see how it could be improved:


var envy = (function( $ ) {
'use strict';
var topnavHeight, sliderHeight, headerHeight,
/**
* Calculate variables and size of displacements.
*
* @since 1.0.0
*/
calculateSizes = function() {
// Menu reset before calculating heights:
$( '.nav-header .genesis-nav-menu' ).hide();
topnavHeight = $( '.nav-secondary' ).outerHeight() || 0;
sliderHeight = $( '.slides li' ).outerHeight() || 0;
headerHeight = $( '.site-header' ).height();
},
/**
* Determine header position and displacements.
*
* @since 1.0.0
*/
doDisplacements = function() {
var scrollYpos = $( document ).scrollTop();
var windowWidth = $( window ).width();
// Media query to detect slider onscreen for window size > 960 pixels:
if ( windowWidth > 960 && $( '.home-slider' ).length > 0 && scrollYpos < sliderHeight 5 ) {
// Set displacements in flow:
$( '.site-container' ).css( 'padding-top',topnavHeight );
$( '.home-slider' ).css( 'margin-bottom',headerHeight );
// Unstick header and make header full height:
$( '.site-header' ).addClass( 'unstuck' ).css( 'top', sliderHeight + topnavHeight );
$( '.site-header .wrap' ).removeClass( 'narrow' );
return false;
} else {
// Set displacements in flow:
$( '.site-container' ).css( 'padding-top', topnavHeight + headerHeight );
$( '.home-slider' ).css( 'margin-bottom', 0 );
// Make header sticky:
$( '.site-header' ).removeClass( 'unstuck' ).css( 'top', topnavHeight );
// Make header narrow on scroll:
if ( windowWidth > 960 && scrollYpos > 5 ) {
$( '.site-header .wrap' ).addClass( 'narrow' );
} else {
$( '.site-header .wrap' ).removeClass( 'narrow' );
}
}
},
/**
* Add in responsive menu feature.
*
* @since 1.0.0
*/
responsiveMenu = function() {
$( '.nav-header .genesis-nav-menu' ).before( '<li class="menu-icon"></li>' );
$( '.menu-icon' ).on( 'click.envy', function() {
$( '.nav-header .genesis-nav-menu' ).slideToggle();
});
},
/**
* Fade out store notice soon after page load.
*
* @since 1.0.0
*/
fadeOutStoreNotice = function() {
$( '.demo_store' ).delay( 4000 ).slideUp();
},
/**
* Fire events on document ready, and bind other events.
*
* @since 1.0.0
*/
ready = function() {
calculateSizes();
doDisplacements();
responsiveMenu();
fadeOutStoreNotice();
$( window ).on( 'resize.envy', calculateSizes );
$( window ).on( 'scroll.envy resize.envy', doDisplacements );
};
// Only expose the ready function to the world
return {
ready: ready
};
})( jQuery );
jQuery( envy.ready );

view raw

main.js

hosted with ❤ by GitHub

We start off by creating our module, envy, under which everything else is created. We assign to it an immediately invoked function expression (IIFE), that in this case, takes a single argument of $, to which we pass in jQuery, so we can use the typical shortcut for referencing jQuery. From the return at the end (line 95), envy ends up as a simple object that has properties referencing internal methods (more on that below).

We then add in the 'use strict'; statement, to tell browsers that we’re not doing anything silly, and it should use the faster parsing engine that doesn’t have to account for bad practice silliness. It applies to everything inside this function scope.

We then have those variables declared again (line 4), and then we have four named methods – calculateSizes, doDisplacements, responsiveMenu and fadeOutStoreNotice. Even without looking at the contents of these methods, the names make it a little clearer what they are concerned with than anonymous functions.

There’s also a fifth method, called ready (line 84). This is what will be called on the document ready event. This is also where the advantage of named functions comes to light – the calculateSizes() and doDisplacements() functions are called immediately (on document ready), but are also bound to the window resize and resize & scroll events respectively (using namespaced events as well to make unbinding easier), without having to re-define the whole function again.

For the technically astute, the functions aren’t named. They are anonymous functions that are assigned to properties of the envy object, but as can be seen on lines 85-88, the end result is the same.

The final part of this module is to return an object (lines 95-97). This object has properties (only one here, line 96) which has a key, ready that becomes the public name of the method, and a value of the envy property, ready, which has the function assigned to it.

Finally, this public method is used as the callback for the short version of the jQuery document ready event. When the file is first referenced, it can be parsed and have the envy IIFE called to define everything (saving time later), but no calculations or DOM adjustments are done until the document ready event is triggered.

The code is also more adherent to the WordPress JavaScript Coding Standards.

Summary

Everyone will have their own preferences, but this version of the Module pattern makes most sense to me. Others try to avoid it for good reasons too. The choice is yours. You can even mix and match the approaches. For instance, Genesis admin JavaScript uses a named object as in Tom’s example, but with named functions and a ready function callback.

The Module pattern is just one more approach to be aware of, that might be right for your situation.

The post Better Organise your JavaScript with the Module Pattern appeared first on Gary Jones.

]]>
https://garyjones.io/javascript-module-pattern-example/feed 5 2821
Comment Author Link Bug in Genesis 2.1.0 https://garyjones.io/comment-author-link-bug-genesis https://garyjones.io/comment-author-link-bug-genesis#respond Mon, 14 Jul 2014 12:56:46 +0000 http://gamajo.com/?p=2602 There's a bug with the Comment Author Link in Genesis 2.1.0 and 2.1.1. (fixed in Genesis 2.1.2). This explains the problem and how you can fix it yourself to include the missing attributes. Without it, your site will have invalid markup and will be telling search engines that comment author links from your site to elsewhere should be included for ranking purposes.

The post Comment Author Link Bug in Genesis 2.1.0 appeared first on Gary Jones.

]]>
It’s come to my attention about a bug in Genesis 2.1.0. It wasn’t spotted until after Genesis 2.1.1 was released, and since that’s the latest release, it still exists in sites with Genesis 2.1.0 or 2.1.1.

This post explains the problem and how to fix it, so you’re not waiting until Genesis 2.1.2 or 2.2.0 comes out.

If you’re competent, you can skip to the TL;DR Fix.

Update 2014-07-15: This has now been fixed in Genesis 2.1.2, so ensure you’re running at least that version to not be affected.

The Background

In 2.0.*, for a HTML5 child theme, a comment author link would appear something like:

<a href="https://genesischangelog.com" rel="external nofollow" itemprop="url">
    Gary Jones</a>

Simple enough – an anchor link, that links my name to my site, and includes two attributes. The first is the rel attribute, with the important value of nofollow. This value has been recognised by Google et al for nearly 10 years. They introduced it as a way to prevent comment spam. Since search engine take into account which sites link to the one being ranked, the intent was to negate the benefit from someone posting spam comments all over the web, just to apparently have those high-ranking websites link to their little site. Google says:

From now on, when Google sees the attribute (rel=”nofollow”) on hyperlinks, those links won’t get any credit when we rank websites in our search results.

The second attribute is itemprop. This has a value of url here, and is microdata for marking-up a Person. Not having it present is not as critical as the missing rel attribute.

The Comment Author Link Problem

The problem can be clearly seen in the comment author link markup for Genesis 2.1.0 and 2.1.1. It produces markup like:

<a href="https://genesischangelog.com/" comment-author-link="">Gary Jones</a>

The link still points my name to my site, but the attributes have changed. Gone are the important rel and itemprop attributes. There’s an attribute called comment-author-link instead, and this makes the markup for the page invalid.

So what’s going on here?

The comment-author-link is our clue as to where to find the problem. In Genesis 2.1.0, one of the changes was to make more of the comment markup was passed through the Genesis Markup API. This is made up of two functions – genesis_markup() and genesis_attr(). They allow developers to filter markup and attributes as needed. The bug looks to be related to this.

The Fix

At this moment in time, it’s not actually been confirmed as a bug and a bug fix by Copyblogger, but it’s so clearcut I have no problems with recommending that everyone who is able to edit a file go ahead and do the fix below. Obviously, take a backup first and know how to restore it if you’re not confident.

If you open the file at wp-content/themes/genesis/lib/structure/comments.php and look at line 294, then you’ll see this:

$author = sprintf( '<a href="%s" %s>%s</a>', esc_url( $url ), esc_attr( 'comment-author-link' ), $author );

Let me write that another way to make it clearer to reference:

$author = sprintf(
    '<a href="%s" %s>%s</a>',
    esc_url( $url ),
    esc_attr( 'comment-author-link' ),
    $author
);

What we have here is a variable, $author, being assigned a value from a sprintf() call. That call might look odd if you’ve not seen it before. For the simple case here, take the %s in the first argument (second line) as placeholders which are replaced with the corresponding values in the next three lines.

The important bit here is the second %s, that with the current code is replaced with esc_attr(). The esc_attr() is a WordPress function that escapes attribute values (the bit inside the double quotes). The esc_url() function is a special case that handles attribute values which are URLs, so you can see how it replaces the first %s correctly.

However, we don’t want to put an attribute value in that second placeholder – we want a list of all the attributes and their values that have been filtered in!

Remember that genesis_attr() function I mentioned? That takes two arguments, the first of which is a string that provides the context. The second argument is optional and not important here.

What we really wanted then was:

$author = sprintf(
    '<a href="%s" %s>%s</a>',
    esc_url( $url ),
    genesis_attr( 'comment-author-link' ), // This line changed
    $author
);

or in the original format:

$author = sprintf( '<a href="%s" %s>%s</a>', esc_url( $url ), genesis_attr( 'comment-author-link' ), $author );

That will replace the second %s placeholder with a list of all the attributes and their values (already escaped) for the comment-author-link context. Elsewhere in Genesis (lib/functions/markup.php:619 if you’re curious) is a function which uses this context to filter in our rel and itemprop attributes.

Conclusion

If you’re competent in editing code, I’d say go ahead and make this comment author link change to your copy of Genesis. While it’s not usually advised to edit Genesis files, in this case, it’s applying the same change as will likely be in the next version of Genesis anyway, so your change will be overwritten with the correct (and likely same) change anyway.

If you’re using a custom callback for comments (advanced customisation), then you may not be affected by this bug. If your custom callback started off as a copy of genesis_html5_comment_callback(), then you probably are.


TL;DR Fix

At this moment in time, it’s not actually been confirmed as a bug and a bug fix by Copyblogger, but it’s so clearcut I have no problems with recommending that everyone who is able to edit a file go ahead and do the fix below. Obviously, take a backup first and know how to restore it if you’re not confident.

In lib/structure/comments.php, line 294, replace:

$author = sprintf( '<a href="%s" %s>%s</a>', esc_url( $url ), esc_attr( 'comment-author-link' ), $author );

with

$author = sprintf( '<a href="%s" %s>%s</a>', esc_url( $url ), genesis_attr( 'comment-author-link' ), $author );

The post Comment Author Link Bug in Genesis 2.1.0 appeared first on Gary Jones.

]]>
https://garyjones.io/comment-author-link-bug-genesis/feed 0 2602
Changes in Genesis 2.1 Launched https://garyjones.io/changes-in-genesis-2.1-launched https://garyjones.io/changes-in-genesis-2.1-launched#comments Mon, 07 Jul 2014 12:10:40 +0000 http://gamajo.com/?p=2377 Announcing the new Changes in Genesis 2.1 guide, and the launch of the Gamajo Store. Free sample guides are available in the store.

The post Changes in Genesis 2.1 Launched appeared first on Gary Jones.

]]>
Screenshot  of the Gamajo Store at launch
The Gamajo Store at launch

Genesis 2.1 was released a week ago, and Genesis 2.1.1 followed a day later. As I’m in a privileged position to see a list of all the changes in Genesis 2.1, I’ve written them up in a new guide called Changes in Genesis 2.1.

Changes in 2.1 give detailed explanations, screenshots and code snippets for 84 changes in 2.1.0 and a further four critical fixes in 2.1.1. This is the only resource where these changes are detailed.

This is the second in the series, after my previous guide, Changes in Genesis 2.0. This listed a total of 151 changes covering 2.0.0, 2.0.1 and 2.0.2.

The post Changes in Genesis 2.1 Launched appeared first on Gary Jones.

]]>
https://garyjones.io/changes-in-genesis-2.1-launched/feed 2 2377