This morning I saw a critical update to WordPress
... and wondered what had actually changed.
When you need to compare the installed version of Wordpress (or any
program, really) with a different version in the official repository,
Subversion can help, although it is not exactly obvious. Here is the
incantation:
svn diff --old=. --new=http://core.svn.wordpress.org/tags/3.0.4
With subversion 1.5 or later, you can use the shortcut:
svn diff --old=. --new=^/tags/3.0.4
Or to compare the current version to the new main 'trunk' --
$ svn diff --old=. --new=^/trunk
Subversion has been an excellent tool for version control, but
certainly with its own frustrations.
One of these has been knowing where you are (or, rather, your working
copy is) in relation to what is what's on the server's repository.
Version 1.5, approximately, introduced a few changes which make this
much simpler. At least with v1.6 you can do this, assuming you are in a
subdirectory under one in svn control:
$ <strong>svn ls ^/tags</strong>
1.5/
[...]
3.0/
3.0.1/
3.0.2/
3.0.3/
$
Huzzah! Subversion replaces the caret with "the root URL of the
repository for this checkout" -- I sure wish I had known this a lot
earlier. Now I can see what other tagged versions are available.
Some of you may have guessed my working copy was of Wordpress. Here's
how we can see exactly what's going on in a particular tagged version,
without actually checking it out:
$ <strong>svn ls ^/tags/3.0.3/wp-includes/ -v</strong>
16803 westi Dec 08 10:50 ./
13211 nacin Feb 18 2010 Text/
8149 westi 10928 Jun 20 2008 atomlib.php
15148 nacin 11549 Jun 05 2010 author-template.php
12525 ryan 9624 Dec 23 2009 bookmark-template.php
[...]
Ah, you say, but I have the tagged version I want... I just want to
know what will happen if I type svn update
...? Well try this:
$ <strong>svn diff -r HEAD</strong>
That will show you the differences between your current working copy
and the latest edition (head) of the currently checked out version...
which is the differences that will be applied if you did an update.
OK, now I'm ready to switch my version... this used to be a bit of a
pain, having to copy the URL... but now we can just do:
$ <strong>svn sw ^/tags/3/0.3</strong>
<em>or maybe</em>
$ <strong>svn sw ^/trunk</strong>
Firebug 1.6, the plugin for Firefox, is newly released;
for debugging or developing web apps, like Wordpress, it is simply
indispensable.
A few of my favorite features:
Scrollable breadcrumbs,
solves the one biggest thing that always drove me nuts, in dealing
with Real World css.
Copy CSS from the inspection window by right-clicking on the
declaration:
After reading Justin Tadlock's excellent writeup of Wordpress 3.0
navigation menus
(nav-menus), I am seriously disappointed and annoyed at this new
feature.
A nightmare to maintain, spaghetti bowl of desynchronization, is what
these new menus are. They statically replicate what we already had
dynamic widgets for. In database lingo, they violate third normal form.
Post and page descriptions are computed from the page content AT ADD
TIME; if you update a post or page, its description is not updated, so
you have to remember to manually edit each menu entry each time you
edit something. Adding pages, or changing a page’s Order, or changing a
page’s Parent, does not change the menu, you have to manually go
replicate all your changes in two places.
Nor can I find any way to write a widget that creates menu items, like
my http://wordpress.org/extend/plugins/hierarchical-pages/
, which would solve the above problems by creating menus on the fly,
based on your current page location, the N latest posts, or other
inputs.
In short, the new menus should have been a widget, that could be
inserted anywhere, instead of a whole new structure. What a mess.
This applies to version 3.7.5.3
If activating the plugin causes your browser to freeze, hang, and
timeout -- Make sure you have created the wp-contents/uploads
directory, and that Apache has write permissions to it (I recommend
setting that directory to group ownership with 'apache' or whatever
your server runs as, with g+ws permissions.)
Order of items in category is reversed. Code has ascending,
descending backwards. Simple correction (patch file in
wp-content/wp-e-commerce/wpsc-includes) follows. (reference on
Wordpress.org forums)
*** wpsc_query.php~ 2009-12-21 20:25:02.000000000 -0700
--- wpsc_query.php 2010-03-11 12:30:55.000000000 -0700
***************
*** 1346,1352 ****
// Invert this for alphabetical ordering.
if (get_option('wpsc_sort_by')=='name') {
! if( $order == 'ASC'){
$order = 'DESC';
}else{
$order = 'ASC';
--- 1346,1352 ----
// Invert this for alphabetical ordering.
if (get_option('wpsc_sort_by')=='name') {
! if( $order != 'ASC'){
$order = 'DESC';
}else{
$order = 'ASC';
This patch allows use of SKUs in the shortcode that inserts the
product-buying form: [wpsc_products product_id=MYSKU]
In
theme.functions.php at about line 379, add the bold text:
function wpsc_display_products_page($query) {
global $wpdb, $wpsc_query, $wpsc_theme_path;
/// added by xiligroup.dev to be compatible with touchshop
$cur_wpsc_theme_folder = apply_filters('wpsc_theme_folder',$wpsc_theme_path.WPSC_THEME_DIR);
/// end of added by xiligroup.dev to be compatible with touchshop
<strong> if (!is_numeric($query['product_id']) && (strlen($query['product_id']) != 0)) {
$product = $wpdb->get_row("SELECT * FROM ".WPSC_TABLE_PRODUCTMETA." WHERE meta_key='sku' and meta_value='".
$query['product_id']."' LIMIT 1", ARRAY_A);
$query['product_id'] =$product['product_id'];
}</strong>
$temp_wpsc_query = new WPSC_query($query);
list($wpsc_query, $temp_wpsc_query) = array($temp_wpsc_query, $wpsc_query); // swap the wpsc_query objects
This patch allows use of SKUs in the add_to_cart shortcode: [add_to_cart=MYPRODUCT]
Find, in display.functions.php approx line 296
function wpsc_add_to_cart_button($product_id, $replaced_shortcode = false) {
global $wpdb;
if ($product_id > 0){
if(function_exists('wpsc_theme_html')) {
$product = $wpdb->get_row("SELECT * FROM ".WPSC_TABLE_PRODUCT_LIST." WHERE id = ".$product_id." LIMIT 1", ARRAY_A);
Insert, between the 'global' and 'if' lines, this:
<strong> if (!is_numeric($product_id) && (strlen($product_id) != 0)) {
$product = $wpdb->get_row("SELECT * FROM ".WPSC_TABLE_PRODUCTMETA.
" WHERE meta_key='sku' and meta_value='$product_id' LIMIT 1", ARRAY_A);
$product_id = $product['product_id'];
}</strong>
in theme.functions.php at about line 662, change the regular
expression in function:
function add_to_cart_shortcode($content = '') {
//exit($content);
if(preg_match_all("/[add_to_cart=([<strong>d</strong>]+)]/",$content, $matches)) {
to:
function add_to_cart_shortcode($content = '') {
//exit($content);
if(preg_match_all("/[add_to_cart=([<strong>w</strong>]+)]/",$content, $matches)) {