You are currently browsing the php tag archives.

To Share (This) or Not to Share (This)

Posted 2009.08.07 14.00 in Computers/Internet/Technology by Stephanie

So I’ve been waffling on this “Share This” thing. I’m not really up on this stuff myself, I’ve never used it, but my friend Lezley told me it was good and important so I put it on my site. The thing is, it runs entirely on the Share This server, so every time someone is viewing one of my pages, they’re also partially redirected to download stuff from the Share This site. And not just two words and a little logo either – it’s a lot of stuff.  Scripts, style sheets, a bunch of logos, who knows what else. Honestly, I don’t really like it – it seems strange and mysterious and opaque to me.

Most WordPress plugins are pretty open and upfront. I mean, if you can read PHP (which isn’t that hard if you just take your time and don’t let it scare you), you can look at the plugin and get at least a bit of an idea what it does. You can do that with the Share This plugin, but what the Share This plugin does is basically just tell your guests to load a bunch of stuff from elsewhere – and you can’t change that stuff. It’s some digging just to get to see that stuff, what with all the javascript voodoo and all that.

Aside from the opacity of its function and my lack of understanding of its purpose, there is the bottom line fact that it slows things down. I’m on a fast connection – but when I can see a noticable change in speed between Share This and don’t Share This, that gives me misgivings. In fact, if there is a problem and for whatever reason the Share This stuff isn’t working, it makes it look like my site is having problems.

So I’ve turned it off, turned it back on, off and on again. I don’t know what’s best. So I’ve made a poll, and I’m asking you. And, please feel free to comment as well.


The poll has been closed, with the votes in at 8 votes against Share This and 1 vote for it.

PHP, Plugins

Posted 2009.03.30 18.47 in Computers/Internet/Technology by Stephanie

So I’ve been working more on the dropdown menus and I’m about 98% satisfied with them. I ran into some areas where either “I wuz doin it wrong” or the plugin didn’t work as I thought it would/should. Basically there were three things that I had to fix/change. First, the menu sorting was not ideal; I wanted it to have two levels of sorting and it only did one. Second, it was supposed to highlight the page title you were on, and this didn’t work for pages in the 3rd level. And finally, if you were on a 1st or 2nd level page, it sometimes highlighted all the child-page titles as well, seemingly at random.

Now, my level of PHP experience is about here: I bought a book and have learned how to make minor changes to wordpress themes. Still, I’m not shy about diving in headfirst, and always keep a backup incase I royally screw things up. I’ve got a pretty successful track record of debugging / fixing / modifying software written in languages that I know nothing about. Anyway, it was not too terribly difficult to edit the php file and make it behave the way I wanted it to. Except for one crazy thing.

After messing around with it for an hour, testing, tinkering, testing, things appeared to be working. Then I tried to go into the admin area, and started getting all these error messages. Problems with headers and stuff. I assumed that at some point in my tinkering I had broken things, and although the site seemed to work, I’d busted the admin side. So more tinkering, some googling, and suchforth.

Eventually what I learned was that PHP is incredibly picky when it comes to whitespace at the top or bottom of the files. I normally leave some blank lines at the end for no particular reason when I’m editing in vi and it’s not a problem in html, css, or anything else. So I never would have guessed that a blank line at the end of a PHP file would cause so much devestation. Still, at least it was easy enough to fix, and considering that was the worst mistake I made, all in all it was a pretty successful expedition into PHP and plugins.

And – I got the functionality I wanted out of the dropdown thingy. So, yay me! 🙂