Archive

Posts Tagged ‘wordpress’

WordPress Maintenance Mode Without a Plugin

August 2nd, 2011 No comments

 

 

Source: http://sivel.net/2009/06/wordpress-maintenance-mode-without-a-plugin/

 

Posts in This Series

Every so often someone asks a question in the WordPress IRC channel that sparks my interest, and in this case the core maintenance mode functionality was one of those questions. I’ve known for sometime that WordPress has it’s own maintenance mode functionality since core upgrades were added, however I had never really looked into the functionality. Hooking into this functionality is really quite simple and effective.

Start by creating a file in the root of your WordPress install (on level with wp-settings.php) called .maintenance. Note the preceding dot like a .htaccess file; in Linux this is considered a hidden file. In this file add the following code:

<?php $upgrading = time(); ?>

This code will basically cause the maintenance page to display until you remove the .maintenance file. In wp-settings.php there are 2 checks to see if it should display the maintenance page. First, it makes sure that the .maintenance file exists. Second, it checks that the current time minus the time specified by the $upgrading variable is less than 10 minutes. Using the code above will insure that it is always less than 10 minutes since time() - time() == 0. If you want it to display for a certain period of time you would want to use:

<?php $upgrading = 1234567890; ?>

For your usage you would want to replace 1234567890 with the unix formatted timestamp of the time minus 10 minutes at which you want the maintenance page to stop displaying.

For example if I wanted the maintenance page to stop displaying at November 14, 2013 at 20:13:00, I would really set the $upgrading variable to November 14, 2013 at 20:03:00. Notice the 03 instead of 13. In unix time this would look like 1384459380. And the code needed for the .maintenance file would be:

<?php $upgrading = 1384459380; ?>

Take note that if you use a specific time in the .maintenance file and you do not remove the .maintenance file, your users will see your site and not be affected, however in the admin you will see a notice stating, “An automated WordPress update has failed to complete – please attempt the update again now.” Deleting the .maintenance file will remove this notice.

I’m sure that this functionality could be wrapped in a plugin, or even better an option added to the core code in the admin. However, I am happy with just manually creating the file.

For information on modifying or styling the maintenance page see WordPress Maintenance Mode Without a Plugin Part 2.

Categories: CMS Tags: ,

WordPress 2.9

December 19th, 2009 No comments

 

Source: WordPress Blog

 

I want to make you mine, all the time… oh wait. Hello. I’m here on behalf of the entire WordPress development team and community to announce the immediate availability of WordPress version 2.9 “Carmen” named in honor of magical jazz vocalist Carmen McRae (whom we’ve added to our Last.fm WP release station). You can upgrade easily from your Dashboard by going to Tools > Upgrade, or you can download from WordPress.org. And of course, it wouldn’t be a major release without a short video summarizing some of the cool things about the new version:

 

 

The coolest new stuff from a user point of view is:

  1. Global undo/”trash” feature, which means that if you accidentally delete a post or comment you can bring it back from the grave (i.e., the Trash). This also eliminates those annoying “are you sure” messages we used to have on every delete.
  2. Built-in image editor allows you to crop, edit, rotate, flip, and scale your images to show them who’s boss. This is the first wave of our many planned media-handling improvements.
  3. Batch plugin update and compatibility checking, which means you can update 10 plugins at once, versus having to do multiple clicks for each one, and we’re using the new compatibility data from the plugins directory to give you a better idea of whether your plugins are compatible with new releases of WordPress. This should take the fear and hassle out of upgrading.
  4. Easier video embeds that allow you to just paste a URL on its own line and have it magically turn it into the proper embed code, with Oembed support for YouTube, Daily Motion, Blip.tv, Flickr, Hulu, Viddler, Qik, Revision3, Scribd, Google Video, Photobucket, PollDaddy, and WordPress.tv (and more in the next release).

2.9 provides the smoothest ride yet because of a number of improvements under the hood and more subtle improvements you’ll begin to appreciate once you’ve been around the block a few times. Here’s just a sampling:

  • We now have rel=canonical support for better SEO.
  • There is automatic database optimization support, which you can enable in your wp-config.php file by adding define('WP_ALLOW_REPAIR', true);.
  • Themes can register “post thumbnails” which allow them to attach an image to the post, especially useful for magazine-style themes.
  • A new commentmeta table that allows arbitrary key/value pairs to be attached to comments, just like posts, so you can now expand greatly what you can do in the comment framework.
  • Custom post types have been upgraded with better API support so you can juggle more types than just post, page, and attachment. (More of this planned for 3.0.)
  • You can set custom theme directories, so a plugin can register a theme to be bundled with it or you can have multiple shared theme directories on your server.
  • We’ve upgraded TinyMCE WYSIWYG editing and Simplepie.
  • Sidebars can now have descriptions so it’s more obvious what and where they do what they do.
  • Specify category templates not just by ID, like before, but by slug, which will make it easier for theme developers to do custom things with categories — like post types!
  • Registration and profiles are now extensible to allow you to collect things more easily, like a user’s Twitter account or any other fields you can imagine.
  • The XML-RPC API has been extended to allow changing the user registration option. We fixed some Atom API attachment issues.
  • Create custom galleries with the new include and exclude attributes that allow you to pull attachments from any post, not just the current one.
  • When you’re editing files in the theme and plugin editors it remembers your location and takes you back to that line after you save. (Thank goodness!!!)
  • The Press This bookmarklet has been improved and is faster than ever; give it a try for on-the-fly blogging from wherever you are on the internet.
  • Custom taxonomies are now included in the WXR export file and imported correctly.
  • Better hooks and filters for excerpts, smilies, HTTP requests, user profiles, author links, taxonomies, SSL support, tag clouds, query_posts and WP_Query

All of this and more is reflected in the over 500 tickets, bugs, and enhancements that WP developers in this release cycle.

This release included code from over 140 contributors, here’s everyone we were able to identify: aaroncampbell (Aaron Campbell), abackstrom (Adam Backstrom), aldenta (John Ford), alexkingorg (Alex King), [amilanov], antonylesuisse (Antony Lesuisse), apeatling (Andy Peatling), apokalyptik (Demitrious Kelly), arena (André Renaut), batmoo (Mohammad Jangda), Ben Dunkle, BenBE1987, Benjamin Flesch, bookchiq (Sarah Lewis), brianwhite, c0nstruct, caesarsgrunt (Caesar Schinas), CalebKniffen (Caleb Kniffen), chrisbliss18, chrisscott (Chris Scott), christoph179, coffee2code (Scott Reilly), [cross country flight], Curioso, davecpage (Dave Page), dcole07 (Dan Cole), dd32 (Dion Hulse), demetris (???????? ???????), Denis-de-Bernardy, dj-wp, dwright, eddieringle (Eddie Ringle), error (Michael Hampton), ewestp, fabifott, filosofo (Austin Matzko), greenshady (Justin Tadlock), gsnedders/link92 (Geoffrey Sneddon), hailin (Hailin Wu), hakre, hanilovesme, Harald Nesland, harrym, holizz (Tom Adams), ikonst, jacobsantos (Jacob Santos), janeforshort (Jane Wells), jamescollins (James Collins), jdub (Jeff Waugh), jeff_ (Jean-François “Jeff” VIAL), jeremyclarke (Jeremy Clarke), JeremyVisser (Jeremy Visser), jikamens, jmulley, Joern_W, johanee (Johan Eenfeldt), johnbillion (John Blackbourn), johnjamesjacoby (John James Jacoby), johnjosephbachir (John Joseph Bachir), JonathanRogers, joostdevalk (Joost de Valk), Jose Carlos Norte, josephscott (Joseph Scott), junsuijin, kevinB (Kevin Behrens), kometbomb, lilyfan (IKEDA Yuriko), [lostinlafayette], madhyde, MattyRob, mdawaffe (Michael Adams), Mittineague, miqrogroove, morfiusx, mrmist (David McFarlane), mtdewvirus (Nick Momrik), mysz, nacin (Andrew Nacin), nanochrome, nao (Naoko McCracken), nathanrice (Nathan Rice), nbachiyski (??????? ????????), niallkennedy (Niall Kennedy), nickohrn (Nick Ohrn), ninjaWR (Ryan Murphy), noel (Noël Jackson), Otto42 (Samuel Wood), pairg, peaceablewhale (Franklin Tse), prettyboymp (Michael Pretty), ProDevStudio, ramiy, redsweater (Daniel Jalkut), ruslany, sambauers (Sam Bauers), scribu, Sewar, Simek, simonwheatley (Simon Wheatley), sirzooro (Daniel Fru?y?ski), sivel (Matt Martz), skeltoac (Andy Skelton), snakefoot, stephanreiter (Stephan Reiter), strider72 (Stephen Rider), taco1991, takayukister (Takayuki Miyoshi), tellyworth, tenpura, usermrpapa, utkarsh, Viper007Bond, vladimir_kolesnikov (Vladimir Kolesnikov), VoxPelli (Pelle Wessman), [voyou1], wahgnube, waltervos, westonruter (Weston Ruter), wnorris (Will Norris), xenlab (Eric Marden), yoavf (Yoav Farhi). Wowza!

2.9 has been an exciting development cycle, and I must say it has whetted our appetite for 3.0, which is coming next (probably this spring) and will include at the very least the merge of MU with the WordPress core, and a new default theme. We can’t wait to start working on it.

Categories: CMS Tags:

WordPress 2.8

June 11th, 2009 No comments

 

Source: Wprdpress Blog

 

The latest and greatest version of WordPress, version 2.8 “Baker,” is immediately available for download. 2.8 represents a nice fit and finish release for WordPress with improvements to themes, widgets, taxonomies, and overall speed. We also fixed over 790 bugs. This release is named in honor of noted trumpeter and vocalist Chet Baker. Here’s a quick video overview of everything in the new release:

 

 

The first thing you’ll notice is that visually 2.8 feels a lot like 2.7, just with some minor tweaks here and there. However once you’ll dig in you’ll begin to appreciate the changes.

Major New Improvements

First and foremost, 2.8 is way faster to use. We’ve changed the way WordPress does style and scripting.

The core and plugin updaters in previous versions of WordPress have been such a success we decided to bring the same to themes. You can now browse the entire theme directory and install a theme with one click from the comfort of your WordPress dashboard.

If you make edits or tweaks to themes or plugins from your dashboard, you’ll appreciate the new CodePress editor which gives syntax highlighting to the previously-plain editor. Also there is now contextual documentation for the functions in the file you’re editing linked right below the editor.

If you were ever frustrated with widgets before, this release should be your savior. We’ve completely redesigned the widgets interface (which we didn’t have time to in 2.7) to allow you to do things like edit widgets on the fly, have multiple copies of the same widget, drag and drop widgets between sidebars, and save inactive widgets so you don’t lose all their settings. Developers now have access to a much cleaner and robust API for creating widgets as well.

Finally you should explore the new Screen Options on every page. It’s the tab in the top right. Now, for example, if you have a wide monitor you could set up your dashboard to have four columns of widgets instead of the two it has by default. On other pages you can change how many items show per page.

And Even More

You can read the full list of over 180 new features, changes, upgrades, and improvements on the Codex. The list is exhausting!

The Future

We’re already thinking hard about the next versions, 2.9 and 3.0. Keep an eye out for improved media handling, better dependency checking, versioning of templates and themes, and of course the fabled merging of WordPress and MU announced at WordCamp San Francisco two weeks ago.

Categories: CMS Tags: