Google Calendar Events, 0.3.1

A couple of annoying bugs have hopefully been squashed in this release. They’ve been bothering me for a while now, but I finally found some time to fix them today.

MU / Multi-site Issues

Several people had reported that clicking on the ‘Add Feed’ button in the plugin was redirecting them back to the login screen. The common denominator between these people seemed to be that they were using MU or multi-site.

It turns out that it was a pretty simple fix. My code was attempting to redirect to the main account, not to the individual site. I fixed it by replacing this:

echo esc_url($_SERVER['PHP_SELF'] . '?page=' . GCE_PLUGIN_NAME . '.php&action=add');

with this:

echo admin_url('options-general.php?page=' . GCE_PLUGIN_NAME . '.php&action=add');

Much nicer all round, and avoids using $_SERVER['PHP_SELF'], which is bad.

Internationalization / Localization

I knew there were still some rough edges with my l10n and i18n code. Hopefully, with this release, it is a bit more robust and complete in this regard.

Specific issues were as follows:

  • Certain sections not working at all (month name title and day letters on grids)
  • i18n / l10n not maintained after an AJAX request

It took me a while to get my head around these problems, but I think I’ve finally cracked it. The AJAX issue was solved largely due to this excellent post by Gary Cao. Directing my AJAX calls to admin-ajax.php, along with use of wp_localize_script() seems to have done the trick.

The problem with certain sections not being internationalized / localized at all turned out to be fairly simple. A few strategic date_i18n()s seems to have sorted things out.

I’m sure there will still be some i18n and l10n issues to solve yet, but I’m getting there!

If you’re looking to take advantage of the i18n and l10n the plugin offers, and aren’t sure where to start, try the Codex page: WordPress in your language.

 

You can download the plugin from the plugin directory. As always, please leave bug reports and things of that nature in the comments on the plugin homepage, or contact me.

4 Responses

  1. i downloaded it from the link and it works fine!! -i saved my css first!-
    thanks, this calendar is the best i have seen -which has connection with google- :)
    ps. i like the night version of your website!
    regards, iphi.