{"id":1383,"date":"2016-01-06T18:20:59","date_gmt":"2016-01-06T18:20:59","guid":{"rendered":"https:\/\/2016.miami.wordcamp.org\/?post_type=wcb_session&#038;p=1383"},"modified":"2016-01-17T15:50:08","modified_gmt":"2016-01-17T15:50:08","slug":"my-experience-converting-a-wordpress-plugin-to-a-backbone-app","status":"publish","type":"wcb_session","link":"https:\/\/miami.wordcamp.org\/2016\/session\/my-experience-converting-a-wordpress-plugin-to-a-backbone-app\/","title":{"rendered":"My Experience Converting a WordPress Plugin to a Backbone App"},"content":{"rendered":"<p>It starts out innocently enough; you need to hide a div in your plugin admin screen, so you go to Google and type something like: jQuery hide element. Then, you realize that you also need to change the text of one of your h3 tags when the user selects a specific option. You keep telling yourself that this is the last time, but you\u2019ve already done it. You\u2019ve created a big heaping mess of jQuery spaghetti. Your JS file is now hundreds of lines of code snippets that show and hide elements, change HTML text, swap out input values, and anything else that you need to make your plugin admin \u201cdynamic.\u201d We\u2019ve all been there; there\u2019s no shame in admitting it. In WordPress, often the JS that drives our interfaces is an after thought. I\u2019ve cooked up jQuery spaghetti more times than I care to say. <\/p>\n<p>In this session, I\u2019ll share my experiences in converting a popular WordPress plugin, Ninja Forms, from a PHP\/HTML plugin to a mostly JS application. We\u2019ll talk about the tools and technologies that we\u2019ve used to avoid the dreaded pasta of bad code, along with how we overcame some WordPress-specific challenges. We\u2019ll cover how we to plan and build a data-driven user interaction, rather than a reactive, snippet-driven mess.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It starts out innocently enough; you need to hide a div in your plugin admin screen, so you go to Google and type something like: jQuery hide element. Then, you realize that you also need to change the text of one of your h3 tags when the user selects a specific option. You keep telling [&hellip;]<\/p>\n","protected":false},"author":6659693,"featured_media":0,"template":"","meta":{"_crdt_document":"","jetpack_post_was_ever_published":false,"_wcpt_session_time":1456064100,"_wcpt_session_duration":3000,"_wcpt_session_type":"session","_wcpt_session_slides":"","_wcpt_session_video":"","_wcpt_speaker_id":[1263],"footnotes":""},"session_track":[732335],"session_category":[],"class_list":["post-1383","wcb_session","type-wcb_session","status-publish","hentry","wcb_track-learning-javascript-deeply"],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6NH2Q-mj","session_date_time":{"date":"February 21, 2016","time":"2:15 pm"},"session_speakers":[{"id":"1263","slug":"kevin-stover","name":"Kevin Stover","link":"https:\/\/miami.wordcamp.org\/2016\/speaker\/kevin-stover\/"}],"session_cats_rendered":null,"_links":{"self":[{"href":"https:\/\/miami.wordcamp.org\/2016\/wp-json\/wp\/v2\/sessions\/1383","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/miami.wordcamp.org\/2016\/wp-json\/wp\/v2\/sessions"}],"about":[{"href":"https:\/\/miami.wordcamp.org\/2016\/wp-json\/wp\/v2\/types\/wcb_session"}],"version-history":[{"count":2,"href":"https:\/\/miami.wordcamp.org\/2016\/wp-json\/wp\/v2\/sessions\/1383\/revisions"}],"predecessor-version":[{"id":1761,"href":"https:\/\/miami.wordcamp.org\/2016\/wp-json\/wp\/v2\/sessions\/1383\/revisions\/1761"}],"speakers":[{"embeddable":true,"href":"https:\/\/miami.wordcamp.org\/2016\/wp-json\/wp\/v2\/speakers\/1263"}],"author":[{"embeddable":true,"href":"https:\/\/miami.wordcamp.org\/2016\/wp-json\/wporg\/v1\/users\/kstover"}],"wp:attachment":[{"href":"https:\/\/miami.wordcamp.org\/2016\/wp-json\/wp\/v2\/media?parent=1383"}],"wp:term":[{"taxonomy":"wcb_track","embeddable":true,"href":"https:\/\/miami.wordcamp.org\/2016\/wp-json\/wp\/v2\/session_track?post=1383"},{"taxonomy":"wcb_session_category","embeddable":true,"href":"https:\/\/miami.wordcamp.org\/2016\/wp-json\/wp\/v2\/session_category?post=1383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}