Dev4Press» Various Archives, page 1 of 1 – Dev4Press http://www.dev4press.com Premium Plugins and Themes for WordPress Fri, 17 May 2013 19:06:55 +0000 en-US hourly 1 Migrate from WPMU 2.9.2 to WP 3.0 MultiSite http://www.dev4press.com/2010/tutorials/wordpress/various/migrate-from-wpmu-2-9-2-to-wp-3-0-multisite/ http://www.dev4press.com/2010/tutorials/wordpress/various/migrate-from-wpmu-2-9-2-to-wp-3-0-multisite/#comments Thu, 27 May 2010 21:58:59 +0000 MillaN http://www.dev4press.com/?p=2247 WordPress 3.0 will be released very soon, and there are many websites that run WPMU versions of WordPress, that need to be migrated to new WP 3.0. I have no idea if the development of WPMU will continue in any form, but most likely it’s over and migration is a must. So, here is the step by step info on how to upgrade your WPMU to WP 3.0. Tutorial will assume that you use default installation of WPMU with default folder names, database prefixes and everything else.

Upgrade Procedure

Backup your current WPMU website installation and the database before you proceed with the upgrade.

  • Start with ‘wp-config.php’. You need to add 2 new lines into it:
    define('WP_ALLOW_MULTISITE', true);
    define('NONCE_SALT', 'unique_string_for_salt_use');

    Nonce salt is not part of WPMU 2.9.2, and you need to add that one. You can use salt that WPMU generated and stored in database (can be there, but also it might not be). It is the ‘nonce_salt’ key in the ‘wp_1_options’ table. You can copy value from that record to the the define. You can also use this from WP 3.0 installation you maybe have. Adding salt can be skipped and added at the end per recommendation of WP upgrade network process. There is one more define that is not needed, but….

    define('MULTISITE', true);

    MULTISITE line is not needed, but in some cases it’s added with the fresh install of WP 3.0 Multisite. At least that was with Beta versions. I will investigate if it’s needed really or not.

  • Next is ‘.htaccess’ file. Main part needed for WP is very similar, and the main difference is line 6 used for files. You can safely change only that line in your old ‘wp-config.php’. This is how the rewrite portion of the htaccess should look like now.
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
  • Now you need to replace all WordPress files. To get the latest WP 3.0 go to the official WP website, but since it’s not released yet, you can get it from SVN. Delete folders ‘wp-admin’ and ‘wp-includes’, and delete files ‘wpmu-settings.php’ from root folder, and ‘blogs.php’ from ‘wp-content’ folder. Now you can copy over all the WP 3.0 files and folders, and replace the remaining files.
  • Make sure that there is ‘blogs.dir’ in ‘wp-content’ folder. If you changed that using ‘wp-config’ check to see if those are still in the file and set properly.

That’s all the upgrading you need to do. After this, your website should be working. When you login for the first time, you will get a message that you need to upgrade network (that’s new name for site used in WPMU, and term site is replaced blog). Once you do that, everything should be fine. If something else needs to be done, WP will inform you during this network upgrade process.

Troubleshooting

If you use latest nightly build from SVN, things should be OK. There are reports that upgrade didn’t go smoothly for everyone with older builds and there were problems with prefixes used for tables in the database. In WPMU default blog was ID 1 and prefix wp_1_, and in WP 3.0 it’s still ID 1 but prefix is only wp_. With latest builds WP 3.0 sorts this out just fine, but if you have troubles with this check out the resources listed at the end of this tutorial. If you have any additional questions, ask in the comments.

Resources

Edit

  • 2010.05.29: added MULTISITE define for wp-config.php.
]]>
http://www.dev4press.com/2010/tutorials/wordpress/various/migrate-from-wpmu-2-9-2-to-wp-3-0-multisite/feed/ 5
Use Firebug to track AJAX requests and responses http://www.dev4press.com/2010/tutorials/wordpress/various/use-firebug-to-track-ajax-requests-and-responses/ http://www.dev4press.com/2010/tutorials/wordpress/various/use-firebug-to-track-ajax-requests-and-responses/#comments Mon, 24 May 2010 14:09:10 +0000 MillaN http://www.dev4press.com/?p=2222 Whenever you use JavaScript powered application, data is usually transported using AJAX from the server to the client side. During that process, errors can occur on the server side to cause application to fail. Firebug is extension for Firefox that can help us track these problems.

]]>
http://www.dev4press.com/2010/tutorials/wordpress/various/use-firebug-to-track-ajax-requests-and-responses/feed/ 1
Translating plugins or themes using POEdit http://www.dev4press.com/2010/tutorials/wordpress/various/translating-plugins-or-themes-using-poedit/ http://www.dev4press.com/2010/tutorials/wordpress/various/translating-plugins-or-themes-using-poedit/#comments Thu, 06 May 2010 13:51:32 +0000 MillaN http://www.dev4press.com/?p=2090 All our plugins and theme have multi-language support. To create new translation, best program available is POEdit, a free program that will help you create valid translation files. This program will help you create translation, and later update it when the new version is released.

Step 1: Installing the POEdit

You need to download latest version of the program from: http://www.poedit.net/. Installation is simple much like any other program. There are versions for Windows, Linux and Mac OS so you can work on any platform with it.

Step 2: Creating new translation project

In File menu you have option ‘Create catalog from POT file’. Dialog will appear and you need to give it POT file you want to translate. Program will ask you for the project info, and here you can add info about project, translation language and yourself. After that you need to save catalog. You can use default name for now, we can rename file later. And, now if POT file is valid, you will see the list of translation strings. If the POT file is not valid you will get information about errors.

GD Star Rating always includes latest POT file with all the strings in the current plugin version, and will use this plugin as an example. This file is: gd-star-rating.pot and is in the main plugin folder.

Step 3: Translating

This is pretty obvious, you need to translate all strings. Below the list, you will see two two fields, one with original string, and the other for your translated string. Right click on any string in the list, will show you comments for that string, and usually that is location of the string in the original files, in our case plugin or theme. You can also copy value of original string into translated string.

Important: Don’t translate %s you found embedded in the strings for translation, just leave them. They represent some other value added by the plugin or theme code, usually numbers or something else.

Step 4: Proper naming of translation files

Once you complete translation, you need to save it. Program will generate two files. One with extension MO and other PO. Both files should have the same name, only different extension. Name of the file also need to have a language code. So, here is the example of proper named files for Serbian translation:

  • gd-star-rating-sr_RS.mo
  • gd-star-rating-sr_RS.po

As you can see, main part is the same as the name of POT file, than you add minus sign and after that language code. Full list of these codes can be found here: http://codex.wordpress.org/WordPress_in_Your_Language. All our plugins and themes use this naming convention.

Plural settings

Plural settings

Step 5: Setting for plural forms

This is a step dependent on the language you translate into. For most languages, there is a singular and plural words (2 plural forms). Some, like Russian have 3. Before you start translating, you need to set this first. When you create empty translation, or you want to change existing to support plurals, open Catalog menu, and in that menu open Settings. You need to fill plural form part. For most languages this is:

nplurals=2; plural=n != 1;

To get more info on the subject, check out this post: Translating Plural Forms with Poedit.

Plural translate

Plural translate

Once you set plural form, when you get to translate plural word, main POEdit form will look a bit different, as shown on the image on the left, with singular and plural boxes and two form elements to translate them.

Step 6: Updating the translation

When the plugin POT files is updated, you need to update your translation files. Once you receive new POT file, you need to open PO file of your translation (‘gd-star-rating-sr_RS.po’) in POEdit and use ‘Update from POT file’ option in ‘Catalog’ menu. Point to POT file, and program will show you what is new and will add this new strings for you to translate. Also, will show you what is became obsolete, and will remove old and no more needed strings from your translation. Program will try to recognize the changes and offer you the ‘fuzzy’ translation.

]]>
http://www.dev4press.com/2010/tutorials/wordpress/various/translating-plugins-or-themes-using-poedit/feed/ 47