After 70 hours of being wrong

I’ve been working on a custom WordPress plugin for a client, everything went perfect, and it got delivered, I was waiting for an confirmation that it all worked good untill.

The back button. Wasn’t working anymore, and there was no obvious reason it shouldn’t have worked. Initially the plugin created by me, had an single javascript line attached in the child theme, to run a specific event that was created there, if any third parties ( my plugin ) needed to execute.

During my inital debug i’ve noticed that script wasn’t used on the page anymore, I was really happy the theme actually worked without it.

I’ve spent entire hours debugging it and argueing with the client that the theme has been modified and my code has no reason to not work, as it was working perfectly on my development enviorement, which was identical to the server when I started the plugin.

After 3 rewrites of the system, over 100 requests debugged, I couldn’t handle it anymore, I wanted to give him a refund, and get over it, money wasn’t relevant at this point.

As my work was done trough codeable, the CEO didn’t want to offer the refund, and told me it’s not my fault and he will handle it. ( this was the first time after 190 tasks I ever had a strong conflict with a client )

After some discussions I wanted to prove the client, that it’s his fault and it wasn’t my code causing this, but that wouldn’t have made me happy.

Things that won’t work for no reason drive me nuts, and I want to solve them. 

I’ve told myself that I’ll give it one last try, after a glass of whiskey ( in the middle of the afternoon, which is extremelly rare for me to drink ) I started looking at things, from a totally different angle. 

I started being unprofessional, and that was good. I could finally thing about any bad approach that could’ve been used. 

After 2 hours, i’ve finally found it, and in less than 5 minutes the issue was solved.

The biggest issue we’re facing as wordpress developers are standards, our biggest advantages has became our biggest flaw, most unconventional and stupid methods of doing things don’t even come up as a bad idea, they could just come up as a joke, while drinking most likely.

Now, why is that ? The script from the child theme was actually moved and minified in the parent theme, making future updates impossible, and making me thing it wasn’t needed anymore. 

This was done by an “uncontrolled third party”, and this sounded shady, really shady, moving on.

Things that are positive, and good practices became my demise, I didn’t want to duplicate 10 lines of code from the child theme to not make future maintainance harder, and it was my demise as I’ve forgotten it was needed in the first place. 

When things are architected badly and following bad practices, you aren’t just harming yourself, you’re harming everyone who needs to continue your work, so, in case you’re ever planning on learning something new, such as WordPress. Learn the standards.

Have an awesome day,