More Menu Changes

There has been a lot of discussion on the wp-hackers mailing list about the upcomming 2.7 release of WordPress and the change to the Admin Menus.  I decided to load it up and see how it affected this plugin.  For the most part everything works the way it is supposed to.  I ran into a few oddities which were errors that weren’t obvious until I ran it with 2.7 but everthing worked as it is supposed to.

The big change is the location (left side bar) of the new admin menus and the change in terminology.  The change in terminology takes some getting used to.  We’ll see if it stays as it currently is in the development build or if it changes.  From the Admin perspective, the presentation is different but not markedly so.  From the user perspective, the Swim Team menu doesn’t show up and I am not sure why yet.

I committed a whole bunch of changes I had to make as a result of debugging the 2.7 presentation issues.  So far, all of the changes work as they should on 2.5.1, 2.6 and 2.6.1 as well.  Switching releases (2.6.1 and 2.7) and platforms (Windows and Linux) during development is proving to be a useful thing as it flushes out stuff earlier in the process.

WordPress 2.7 Thoughts

If you haven’t seen it yet, WordPress 2.7 changes the Admin interface again.  While it seems many people don’t care for it, I like it a lot better than the existing interface.  I don’t care for the terminology they used for the main headers on the side bar though.

I was on the road this week so spent some airplane time working on my wp-SwimTeam plugin and decided to see how it would work under WordPress 2.7.  I have actually started moving my development around a bit and I think it will turn out to be a good thing.  Yesterday and today I was running 2.7 under Linux with PHP 4.4.9.  Last week I was running under Windows with PHP 5.2.6.

2.7 exposed a few things in my plugin which I have fixed but like I said, I am not happy with the new terminology being used.  I had changed my implementation recently so the end user chose the Swim Team menu off the Users menu in the Dashboard and the Admin would choose Swim Team from the Manage menu.  In 2.7, the Users menu doesn’t exist so there isn’t a logical place to put the functionality exposed to the end users.  I’ll figure something out, in the meantime, there is plenty of work to do on the plugin itself.

wp-SwimTeam demo up and running

I have spent quite a bit of my free time lately re-working my wp-SwimTeam WordPress plugin in a quest to get a demo site up and running.  In the process I changed quite a bit, some because I had no choice, some because I was knee deep in the code and decided it was time to fix some things I wasn’t real happy with.

A lot of the work involved working with Google Maps API.  The Google APIs are really pretty cool, if you need to do some work with AJAX or Javascript, they are worth looking into.  I ended up using the new Google AJAX API (which can load the Maps API) and the new syntax.  There seems to almost no performance degradation from loading Google’s JS libraries as compared to loading them directly from the host site.

A bunch of the work was neccessary because GoDaddy, the provider hosting the demo site, doesn’t support PEAR which I was using to access the database.  I needed to migrate to the WordPress database abstraction layer.  As opposed to just hacking up the plugin to do this, I decided to do it right and enhance phpHtmlLib with a new database abstraction layer specifically for WordPress.  I also made the changes to phpHtmlLib to make it into a WordPress plugin.

All in all, a lot of work behind the scenes which isn’t visible to the end user but in the long will make using wp-SwimTeam by other people much easier.  There are quite a few posts on my wp-SwimTeam development blog if you are interested in all of the nitty-gritty details along with my frustrations with GoDaddy Support.

Hanging Rock State Park

Last weekend we took the family up to Hanging Rock State Park in north central North Carolina.  We had planned to camp for two nights in the park but when we arrived about 4:30 the camp ground was already full.  Uh-oh.  Now what?

We had passed the Sertoma 4H camp on our way in the Camp Host told us there was a small campground as part of the 4H property which we should try.  So we headed back down the hill and found Camp Sertoma.  It doesn’t look like much when you pull in but considering we didn’t have many options, it met our needs.  It turns out, it is actually a pretty nice campground as long as you don’t mind fairly primitive camping (we don’t).

A small storm moved in just as we arrived and we ended up setting our tent up in the rain on a site near the stream.  This turned out to be a great site as the kids played in the stream constantly for two days whenever we were back at camp.    We picked up some firewood from a local resident down the road a mile or so and were ready to make dinner.

On Saturday we hiked three trails – Hanging Rock, Upper Cascades, and Hidden Falls/Windows Falls.  Of the three, the kids liked the Hidden Falls/Windows Falls the best as there was lots of rocks to climb and they liked following the stream back up the hill.  The Hanging Rock trail is a nice hike, it is fairly long and some of the steps up are tough for smaller kids but our four (ages 6-13) all made it without any problem.  The view from the top is impressive.  After about 6 hours of hiking, we went back to camp for a while to get something to eat and drink and veg out.  We then went back to the park to check out the swim lake.

On Sunday we hiked the Lower Cascades and the Tory’s Den / Tory Falls trails.  The Lower Cascades is well worth doing, the falls are the nicest we saw in the park and there are some smaller, less traveled paths up and down the falls area that are worth exploring.  The Tory’s Den/Falls trail was disappointing as there was very little water flowing and what there was, was hard to see.

All in all, a great weekend, it was nice to get away before every weekend is consumed with soccer games for the next 3 months!

UI Change for wp-SwimTeam

As the Swim Team Dashboard menu has grown I have been thinking of changing how I present the various choices to both the Admin as well as a Subscriber.  While I have thought about it from time to time, I haven’t done anything about it.  I was recently looking for something in the WordPress plugin directory and found something called Lighter Menus.

Lighter Menus changes the Dashboard menus into a set of drop down menus.  It is very similar to Andy Staines’ Admin Dropdown Menus.  Unfortunately, Admin Dropdown Menus really changed with the WP 2.5 release and the author has subsequently stated he will no longer support it.  Lighter Menus looked like it might be a suitable replacement so I decided to give it a try.

I really liked the way Lighter Menus works except for one thing:  The custom Swim Team menu didn’t work right.  The URLs weren’t constructed correctly.  Bummer.  But I really liked the way it looked.  Was this the compelling event to fix the growing Swim Team menu?  The Swim Team menu was really unwieldy when using the standard Dashboard as well.

As I worked on phpHtmlLib I tested all of the examples and I kept coming back to the TabControlWidget thinking it might be a good solution for wp-SwimTeam.  The TabControlWidget is a CSS based solution which presents different content based on which tab is selected.

Earlier this week, I decided to try it and see if it would work.  The implementation turned out to be really simple and I was able to use all of individual page code almost verbatim.  I like this implementation much better and I think it is much, much easier to use.  This decision also let me clean up some of the code which had been duplicated between the Admin and User side and resulted in the elimination of a half a dozen PHP file.

Google Maps problem is fixed!

Last night I fixed the Google Maps problem by re-coding the way I was getting the data from Google.  I had been using a class called Phoogle but have eliminated it in favor of a direct AJAX solution using Google’s AJAX API.

Instead of embedding this new solution in the wp-SwimTeam plugin, I implemented as a widget in phpHtmlLib.  It works pretty well too!

Another goofy e-mail from GoDaddy

I had another go-round with GoDaddy yesterday which resulted in another goofy e-mail.  I posted the fsockopen() example they had asked me to which timed out and GoDaddy responded with this:

Dear Mike,

I sincerely apologize for any confusion or frustration. You will need to specify the proxy in your coding. Applications that need to make outbound connections (port 443) will need to be made “proxy aware”. This will require additional coding to varying degrees, depending on the application. You will need to know the ip address and port of the proxy server in order to correctly modify your code. The ip of the proxy server is 64.202.165.130 and connections will be made on port 3128.

You will need to use this when coding with PHP:
curl_setopt ($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);
curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_setopt ($ch, CURLOPT_PROXY, http://64.202.165.130:3128);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);

I hope this information helps.

Please let us know if we can assist you in any other way.

Sincerely,
Lindsay C.
Online Support Representative

Right back to the cURL requirements which really don’t make any sense for fsockopen().  It really doesn’t matter as I chnaged the code which manages the Google Maps so it no longer needs it.

GoDaddy’s PHP support is questionable

Over the past few days I have had a back and forth e-mail dialog with GoDaddy Support regarding their PHP support (or lack there of).  Some of their responses are just silly.  Since they don’t support allow_url_fopen, I wanted to use cURL.  Well, apparently cURL isn’t supported with their Windows hosting service and even with that, requires a proxy configuration.  So then I decided to use fsockopen() since GoDaddy states it is supported for all PHP hosting plans.

Well fsockopen() times out when I try using it.  I got the following from GoDaddy support:

Dear Mike,

We apologize for the confusion.  While fsockopen() is supported you would need to be on an account that fully supports PHP.  You would need to switch to a Linux Hosting account.  If you do not wish to switch to a Linux Server, you would need to use custom coding.  Unfortunately, we do not provide coding or scripting support through this forum. I recommend performing a search on a search engine. I apologize for any inconvenience this may cause.

Please let us know if we can assist you in any other way.

Sincerely,
 
John B.
Online Support
Technician 

What kind of nonsense is this?  No where is it stated that it isn’t supported.  So respond to them and ask for a list of what is and isn’t supported with respect to running PHP under Windows.  This is what I got back in response – it is just nonsense – it points to me to a Linux configuration, how helpful is that?  Not only does it point to the wrong platform, but what it reports would indicate that what I want to do is supported!

Dear Mike,

As our Windows IIS 7 plans support PHP 5.2.5, please refer to the following link for a full list of supported PHP options:

•  http://gilahacker.com/info.php5

Please let us know if you have any further questions, comments, or concerns. Our service departments and telephone lines are open 24 hours a day, 365 days a year to accommodate your needs anytime.

You can reach us by phone to the following numbers:
(480) 505-8877 Technical Support, Sales and Service
(480) 505-8855 Billing

Or, you can send an email for speedy electronic service to the following address:
support@supportwebsite.com – Technical Support, Sales and Service

We look forward to serving you in the future.

Please let us know if we can help in any other way.

Regards,
Stacey P.
Online Support

It makes one wonder if their support people actualy read what is sent to them. So I responde back to them pointing out that their response was not very helpful and ask my question again as well as another request for what is and isn’t supported with PHP running under Windows.

My most recent response was a request for a code sample to see what isn’t working, hopefully this will resolve the issue once and for all, stay tuned!  The response also included a statement that they, GoDaddy, don’t have a document which articulates the differences between PHP support running under Windows and PHP support under Linux.

Dear Mike,

We apologize for any inconvenience this may have caused you. Currently fsockopen() is supported on your hosting account. Please send us the full URL of a page we can duplicate the error you are having so that we can troubleshoot this error. Unfortunately, we do not provide technical support with third-party scripting issues. However if the issue is being caused by a misconfiguration on our server we would be happy to resolve this for you.

Unfortunately we do not have any documentation available that will show you the difference in the php configuration between out Linux and Windows accounts. We apologize for any inconvenience this may have caused you.

Please let us know if we can help you in any other way.

Sincerely,
Jeremy T
Online Support Technician

More on Phoogle & Google Maps

The members of the WordPress Hackers mailing list are really helpful and usually a very clever bunch.  I posted my dilema last night and received a couple suggestions, one of which was to abandon cURL and use Snoopy because it is embedded with WordPress and therefore would always be avaialble.

Sounds like a good idea so I check it out.  While I don’t care for the way the class is implemented (direct access to class variables), it if works, I don’t really care.  So I set it up and sure enough, it works in my development area.  Off the production server and nope, it doesn’t work either.  Snoopy depends on fsockopen which GoDaddy says is supported on all PHP hosting plans but it times out so I am guess what they have stated in their help system isn’t true.

Now I am not sure what to do other than to pursue a Javascript solution.  GoDaddy is quickly going on my “less than happy with” list.  I wonder if a Linux server would be any easier?