Jessica Wicksnin

Web and Tech Enthusiast in Seattle



Santa Claus is Coming to Town

Category : Blog, Fun, JavaScript, MySQL / Database, PHP, Web Development · No Comments · by Jan 3rd, 2014

Christmas is over. So why haven’t I taken down my extraordinary (pink) Christmas tree?  If the preceeding question doesn’t answer itself, then we have nothing left to talk about.

But I wanted to explain (read: brag about) my awesome side projects (Christmas presents) that were done in addition to completing a quarter at school and setting up an entirely new website at the internship (to go live sometime this month!).

First challenge: A “Worry Wart” website for Mom/every woman in the world to store worries for them. This needed a database, tables interacting with each other, a somewhat secure way to access, read, and write to the database, login, log out, create a new user, store session variables, count worries that came true vs worries that never happened, add and delete worries.  Whew! I think that might be about it.

If you’re interested, check out worrywart.jessicawicksnin.com.  If you’re really interested, check out my code on git hub (jwicksnin).

Second challenge:  A “Benjamin Speaks” app for Dad/every retirement-savvy person to aid them in financial decision making.  This took CSS to create a neat shadowed “quote bubble” and awesome jQuery to take a submitted question, find a suitable (random) answer in a text file, and output the random answer.  Nothing too fancy, but the image of a $100 bill that I gleaned from Google addressing my dad directly is really cute.

Third challenge: A “Facebook for Two” for my boyfriend/every couple who too busy actually having a relationship “IRL” to document every stage of their relationship on actual Facebook.  This took some serious JavaScript because a text file wasn’t good enough – I was determined to use the word AJAX as much as possible.  I ended up using a quick PHP file to write from JavaScript to the existing XML file on the server.  So now I feel very comfortable reading and writing XML files based on user input via AJAX requests.  It’s basically a poorly-styled Facebook, which made me question the value of Facebook at $100,000(?) a share if I can build the same thing in a couple weeks with nothing but Google and Web Programming Step by Step (thank you CSE at UW) for help.

Four on the Floor

If you want a real thrill, try making changes to a live WordPress site after a recent deployment and numerous unknown changes by a third party half an hour before marketing needs the updated site for a client meeting…

Yes, this is what has happened to me, not once, but twice in the past two weeks!  We find ourselves bereft of a relevant testing environment, in the midst of trying to create local testing environments and a subdomain environment in addition to github.  However, before all of those dev environments got set up correctly, we had to debug a few items from the recent re-deployment/migration.

Step One: Change the featured image for a page so Facebook gets it right, and break the site!  Okay, the whole site didn’t break, but we suddenly lost the very page we were trying to fix.  Lost as in it didn’t display AND we couldn’t find the file on the FTP.  Upon trying to move the local version of the file, we found we suddenly didn’t have permissions to change that directory. Enter “Sam”, in charge of recent re-deployment, who enlightened us to the fact that after the deployment, “Owner” of most files and directories had changed to “Apache” from “Our Organization”.  After changing the ownership back, we were able to get the file back on the website, the page worked again, AND I figured out how to get Facebook to display the correct thumbnail for the specific page using their “developer” documentation.  Actually, some of the better documentation I’ve seen (including you, WordPress).

Step Two: Unable to upload images through the wp-admin screen.  Attempted to deactivate and reactivate a few plugins, as recommended in the aforementioned WordPress documentation, and lo and behold half of the styling for the site was lost!  Oh my!  At this point I literally had to sit down because I had no clue what the problem was or how to fix it.  Before restoring a backup of the whole site (I know, I know, stop panicking, Jessica), I fished around the office for some help from other developers not working on this specific site.

After some handy “inspection of element”, we discovered the essential css had been lost.  Part of the problem was that we were used to using the Appearance –> Edit CSS part of the Jetpack plugin to easily add and override CSS.  Probably not the cleanest or most efficient, but since the site has dozens of style.css files, this seemed like the intuitive choice.  Some mysterious element called “Custom CSS” had disappeared from the site quite a while ago, as we saw from a recent download of the site to my computer.  So we went back to the now defunct test site, went into Edit CSS, copied the whole file, pasted into the theme’s style.css with a few “!important”s thrown in for good measure, and lo and behold the style came back and two hours later I was exactly where I’d started.  I was beginning to feel like the only thing I could accomplish was not making the site worse, and if it was the same at the end of the day as at the beginning of the day, then I was doing well.  Sheesh.

Needless to say, these are not the best nor permanent fixes.  I would love to be able to test the site back into normal health, but ironically that is proving more difficult than it seems since every attempt as creating a new testing site under a subdomain manages to somehow, you guessed it, break part of the live site.

Things I have learned:

  • WordPress is not simple.  It is complicated and often unpredictable.  Especially plugins.
  • Don’t feel brave.  Instead, make a backup, then try the very smallest change possible.
  • Sites break every day.  Today just happens to be your day.  Tomorrow will be someone else’s.
  • An efficient, intuitive testing system must be setup when the site is created.  Unless you want a site that never changes ever again.
  • The database(s) in WordPress are essential.  Even though they may appear “black box” like, take them into consideration when creating backups, development sites, and local versions.  Learn to work with and love them, not ignore and delegate them.