Archive for the 'wordpress' Category

Page 2 of 2

WP Fix: automatic update open_basedir error

In WordPress 2.7 there is a nice feature to automatically update plugins or the core via one simple click on a link. For quite a while I couldn’t get it to work as it was producing errors like:

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/var/tmp//1220989448) is not within the allowed path(s): (/home/usr123/:/tmp:/usr/local/lib/php/) in /usr/home/usr123/../wp-includes/functions.php on line 1960

Warning: touch() [function.touch]: open_basedir restriction in effect. File(/var/tmp/1220989448) is not within the allowed path(s): (/home/usr123/:/tmp:/usr/local/lib/php/) in /usr/home/usr123/../wp-admin/includes/file.php on line 122

Warning: fileowner() [function.fileowner]: open_basedir restriction in effect. File(/var/tmp/1220989448) is not within the allowed path(s): (/home/usr123/:/tmp:/usr/local/lib/php/) in /usr/home/usr123/../wp-admin/includes/file.php on line 487

Warning: unlink() [function.unlink]: open_basedir restriction in effect. File(/var/tmp/1220989448) is not within the allowed path(s): (/home/usr123/:/tmp:/usr/local/lib/php/) in /usr/home/usr123/../wp-admin/includes/file.php on line 489

This morning I finally found THE hint that has lead me to the solution to fix it and to be honest it was amazingly simple!!

WordPress is trying to use the wrong path, duhh, but the correct path is also provided in the error message. In my case I have to point WordPress to the /tmp path instead of the found /var/tmp path!!

When you follow the error messages you finally end up in the get_temp_dir function (/wp-admin/includes/file.php:97) which basically provides the answer straight away after you run a full source code search on WP_TEMP_DIR…

function get_temp_dir() {
 if ( defined('WP_TEMP_DIR') )
 return trailingslashit(WP_TEMP_DIR);

So the solution is to define WP_TEMP_DIR in the wp-config.php file:

define('WP_TEMP_DIR','/tmp');

Happy auto updating!

WP Plugin: Agenda

Today I came across a new events plugin called Agenda. Looks very promising even without a prepacked widget. So after playing around with it for a short while I started to write a plugin for it (source here) and hopefully it will be adopted by the plugin author, DGMike.

While writing the widget I also noticed some bugs and the need for some extra features.

Features:

  1. Ship a widget with it – you can use my Agenda Widget for this, see source.
  2. Show today’s and all day event’s until their end time.
  3. Remove time notification when it’s a all day event.
  4. Change $title_tag into to the $before and $after model for more template flexibility.
  5. Localization by translation domain. Change:
    __('text')

    into:

    __('text', 'agenda')

    Have also used that in the plugin I have created.

  6. Ship a .pot with it for translators. I will translate into Dutch when available.

Bugs:

  1. When repeating on a daily basis the start time changes (looks like the function add (for example) 24 hours to the end time instead of the start time). )
  2. Visual editor isn’t working.
  3. Time droplists are out of sync with the input boxes (further to the right).
  4. When using agenda_compromissos() the <a href> isn’t populated.
  5. Add ‘no events’ message when there are no events to show, I’m now getting an error message.
  6. Styling doesn’t fit in the (smaller) crazyhorse design of 2.7 and perhaps it’s an idea to keep in line with the default WP colors for the background.

Remarks:

  1. The ‘Event’ page should not be registered as a menu item when you use 2.7 as the structure of the menu’s has changed. The Add New link on the Events page will follow the style WP is using on the Posts and Pages pages.

Questions:

  1. How can you get the location and date(s)/time(s) visible in the post?

I will put some effort in this plugin as well as I really like it so I will start cracking the extra features and bugs as well and will make suggestions to DGMike.

WordPress 2.6 released

Great news. Today on the WordPress front as version 2.6 “Tyner” has been released as a stable version. The latest WordPress version comes with a long list of improvements. The following list comes from the official WordPress announcement:

  • Word count! Never guess how many words are in your post anymore.
  • Image captions, so you can add sweet captions like Political Ticker does under your images.
  • Bulk management of plugins.
  • A completely revamped image control to allow for easier inserting, floating, and resizing. It’s now fully integrated with the WYSIWYG.
  • Drag-and-drop reordering of Galleries.
  • Plugin update notification bubble.
  • Customizable default avatars.
  • You can now upload media when in full-screen mode.
  • Remote publishing via XML-RPC and APP is now secure (off) by default, but you can turn it on easily through the options screen.
  • Full SSL support in the core, and the ability to force SSL for security.
  • You can now have many thousands of pages or categories with no interface issues.
  • Ability to move your
    wp-config

    file and

    wp-content

    directories to a custom location, for “clean” SVN checkouts.

  • Select a range of checkboxes with “shift-click.”
  • You can toggle between the Flash uploader and the classic one.
  • A number of proactive security enhancements, including cookies and database interactions.
  • Stronger better faster versions of TinyMCE, jQuery, and jQuery UI.
  • Version 2.6 fixes approximately 194 bugs.

Of all the improvements I really enjoy the new image system and the revision control as that where definitely points which needed improvement in previous versions of WordPress. If you want to see the new features in action, the WordPress guys have made a short video in which they explain the new features:

See wordpress.org/development/2008/07/wordpress-26-tyner/ for more background details on WordPress version 2.6.