What a tiny thing – Tinypass for WordPress, but it seems working only for standard setups. There are questions to this plugin yet to be answered.
How to add php mcrypt support on CentOS
The default php53 packages set on CentOS repo does not contain mcrypt support. To get this library working for your web server you can take one of two ways. Either build php53 mcrypt.so extension yourself, there is a short guide for that. Or go the lazy way:
1) Add EPEL repo to your repositories list.
2) Install the mcrypt module:
|
1 |
yum install php53-mcrypt.x86_64 |
3) Edit your php.ini, and add extension support
|
1 |
extension=mcrypt.so |
4) Restart web server.
Mcrypt support is needed if you want to implement micro payments on your WordPress blog. Tinypass micro payments system is born to power micro stocks and self-hosted publishers.
Downgrading Lion back to Snow Leopard :-(
Status
Since the office can’t longer bear Ready NAS NV+ hangs and network outages invoked by accidental Lion OS X “casts of death”, I am forced to downgrade Lion. And it is indeed painful.
I urge everyone not to use a machine “updated” to Lion together with ReadyNAS NV+ in one network. Even with 4.1.8 software it has severe problems. For now there is no 100% cure.
How to force Spotlight search to index PHP files
Besides many other problems in Lion OS X, this one bugged me especially hard. After upgrading the main workstation to Lion I made a very unpleasant discovery. Spotlight was not able to search within source code. A relevant mdi plugin, that was shipped with the previous version of Xcode mysteriously vanished. Yes, it became unavailable.
But fortunately, you still have RichText.mdimporter and you can modify its info.plist to do the job of indexing contents of your source code files on Lion OS X. How to do that.
1) Locate /System/Library/Spotlight and the RichText.mdimporter file.
2) The easiest way – Terminal
|
1 |
sudo nano /System/Library/Spotlight/RichText.mdimporter/Contents/Info.plist |
3) Add strings for text file types you want to index in Apple UTI notation into dict array, like:
For PHP source files:
|
1 |
<string>public.php-script</string> |
For JS source files:
|
1 |
<string>com.netscape.javascript-source</string> |
And so on in the fashion of Apple Uniform Type Identifyers (UTI).
Here is a small list of UTI you may need.
And here is what Apple has to say about UTIs.
Save what you have edited.
3) Reindex your hard drive and enjoy your Spotlight search back again.
WP 3.3.1 Custom Post Types does not work?
After upgrade to 3.3.1 certain users may experience problems with their custom post type posts. If you experience 404 on every request to your old CPTs, go to General/Settings/Permalinks once. If your .htaccess file is writeable by server – that’ll be enough. WP will flush your permalinks and CPTs will be back again. If not – check whether .htaccess file in your WP root directory is writeable.
Also if you face problem like errors with reference to get_data(), it is quite possible that your theme is using RSS parsing somewhere. Remove the theme temporarily, allow WP 3.3.1 to upgrade database, return theme back, it should work now.
Consequences of using SEO software
If you are going to decide about using some SEO software for your projects, keep in mind that this “solution” has its dark sides. One of the most annoying drawbacks of using SEO software is that you shall almost immediately start to receive SEO spam to your clients mailboxes.
So think twice before going into any SEO “automation”. What this automation is designed for is to generate business for SEO software companies, not for you. And if you think deeper, you will find all that “solutions” useless.
If you are about doing SEO, do it by providing good content organised in a logical and consistent way, keeping a formidable structure of your links. Search engines will love you.
Also consider reading Yoast.
mDNSResponder problems and solution on Lion
If you have ReadyNAS NV+ in your network with 4.1.8 software installed, you may have server outages if you use OS X Lion machine. The outage is caused by poor new design of the mDNSResponder (Apple fault thinks different as always). Multicasts from Lion machine force avahi daemon on ReadyNAS NV+ to close services. Disabling Bonjour on ReadyNAS will not help. To fix the issue you have to disable multicast edit /etc/hosts on a Lion machine.
/I am leaving this as advice for those who wants to debug their network with Lion machines in it/
Be careful, since breaking mDNSResponder configuration can lock you out from OSX Lion.
Step 1. Make a backup of the mDNSResponder.plist file as a necessary precaution.
Step 2. Open the mDNSResponder.plist file in Terminal using your preferred text editor. Here is a command:
sudo nano /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
Step 3. Add “
The bad thing is that you will loose ability to discover network printers from Lion, if they are advertised via Bonjour service. Workaround – set printers by IP manually.
UPDATE: it “works as designed”. What Apple forgot to say is well put in this article by Justin Carmony. I reenabled multicasts and Bonjour after adding reverse resolution in /etc/hosts for local machines running Lion. So far so good, ReadyNAS NV+ feels good for the first 30 mins
Enable WordPress Update from SSH
There are few good tuts that works for CentOS 5.6 with php53.
Jacob from dynamichosting.biz wrote a good guide to install ssh2 extension for php53 that worked for me.
Than follow these directions provided by Johnathan Dingman.
After you succeed with install, have a look at this Codex Page and make amendments to your wp-config.file to perform further updates with a single click.
All credit goes to these fine gentlemen mentioned above. I will only remind you not to be afraid of a bunch of warnings when you install php-pear. Force install and may the Force be with you.
qTranslate integration with WP3.x Nav Menu
The whole topic is year old, and there are few good solutions posted on this thread at Qian Qin’s Support forum.
I posted this one, which is altered Woo Themes workaround for the same problem with Home link, modified using qTranslate getLanguage() function.
This is a template. Make a page called anyhow on this custom template basis, than link to it in WP menu. Use URL you need in template, it will redirect language accordingly.
Now you can link to your Home page from WP Menu and it will be correctly translated.
Debug WordPress latency after database import or upgrade
I was really stuck recently, when client websites started to show unbearable 5-11s latency after importing to their new home WordPress installations. It took time to debug and it let me learn a trick or two on mysql performance optimisation. This is something I’d like to share.
Firstly, do not run into mysqld variables shuffle and editing. Check the source of the latency. It may arise for quite different reasons. And definitely – do not alter ‘localhost’ in your wp-config.php to your hosting IP address, that won’t work anymore. What I recommend – make some changes in wp-config.php and the footer of your theme to enable MySQL query debugging.
Add
|
1 |
define('SAVEQUERIES', true); |
instruction to wp-config.php to enable debugging mysql queries. To output them, add
|
1 2 3 4 5 6 7 8 |
<?php if (current_user_can('administrator')){ global $wpdb; echo "<pre>"; print_r($wpdb->queries); echo "</pre>"; } ?> |
to your theme’s footer. It will make output visible while you are logged in as administrator. Now you can sum up all the time from your queries and check if too many or too long queries are the reason of your website latency. Now you have strategy. Either cache bad long queries, make database optimisation, reindex what is needed, or increase memory allowance to PHP or WordPress itself.
If you are running MultiSite, it is always good to explicitly define the memory limit available for WordPress by adding
|
1 |
define('WP_MEMORY_LIMIT', '64M'); |
to your wp-config.php.
Such problem can arise when you have large image galleries to show, when you run MultiSite with new sites imported from older installations, or when you have caching disabled in MySQL.
Suggested reading for further enlightenment:
How to optimise MySQL performance
If your site generates way too many queries to database, i.e. more than 1000 per GET, you should check your wp-options table and .htaccess rules. The root of all evils (up to WP version 3.2.1 is to keep permalinks structure like /%category%/%postname%/. Start it with /%year%/ and your website latency may become immediately cured.