Archive for the ‘Wordpress’ Category
Tuesday, December 9th, 2014
While optimizing picture performance with console tools optipng, jpegoptin, jpegtran, pngcrush (could save you a lot of server space and make pictures downloads faster (and hence increase your website responsiveness and SEO – check out), still for Blogs and WebSites based on WordPress its not worthy to loose time with console acrobatics but simply use EWWW Image Optimizer to Optimize all old or new uploaded Images.
To work EWWW Image Optimizer needs jpegtran, optipng, pngout and gifsicle to be installed on the Linux / BSD server. EWWW Image Optimizer can load the command line tools also from a Cloud, if a cloud service is running on the server. Once installed the plugin does scan all the imported WordPress Media files and can be run to optimize picture files on present blog psot / pages.
EWWW Image Opitimizer plugin does a good job in reducing file size on NextGEN, GRAND FlAGallery galleries.
Here is how EWWW Image Optimizer works taken from plugin's website:
How are JPGs optimized?
Lossless optimization is done with the command jpegtran -copy all -optimize -progressive -outfile optimized-file original-file. Optionally, the -copy switch gets the 'none' parameter if you choose to strip metadata from your JPGs on the options page. Lossy optimization is done using the outstanding JPEGmini utility.
It is better if the server has not the jpegtran, pngout, gifsicle utilities installed as the plugin provides an uptodate static compiled Linux binaries.
How are PNGs optimized?
There are three parts (and all are optional). First, using the command pngquant original-file, then using the commands pngout-static -s2 original-file and optipng -o2 original-file. You can adjust the optimization levels for both tools on the settings page. Optipng is an automated derivative of pngcrush, which is another widely used png optimization utility.
How are GIFs optimized?
Using the command gifsicle -b -O3 –careful original file. This is particularly useful for animated GIFs, and can also streamline your color palette. That said, if your GIF is not animated, you should strongly consider converting it to a PNG. PNG files are almost always smaller, they just don't do animations. The following command would do this for you on a Linux system with imagemagick: convert somefile.gif somefile.png
Some othe plugins that could strenghten your WordPress Search Engine Optimization ranking worthy to check are:
Most importantly plugin solves "Render-blocking JavaScript and CSS" warning shown during site audit with Google Developers PageSpeed Insight. By the way Google PageSpeed Insight is a precious tool so I recommend you check if you already haven't, Google's suggestions could often double or triple daily site visitors
What Async JS and CSS does is:
Converts render-blocking CSS and JS files into NON-render-blocking, improving performance of web page
The plugin makes ALL scripts loaded by other plugins to be loaded in asynchronous. All CSS files will be inserted inline into the document code or moved from the document beginning to the end, just before closing BODY tag (or just where you placed wp_foot() function). There are various methods to do that via plugin configuration page.
- Autoptimize
Autoptimize speeds up your website and helps you save bandwidth by aggregating and minimizing JS, CSS and HTML.
What does the plugin do to help speed up site?
It concatenates all scripts and styles, minifies and compresses them, adds expires headers, caches them, and moves styles to the page head, and scripts to the footer. It also minifies the HTML code itself, making your page really lightweight. Autoptimize is very much like WP Mnify (CSS / JS) minifaction WP plugin. The only difference and reason why you might want to use WP Mnify is it does HTML minification – something that WP Minify does not. Both plugins play nice together the only thing to be careful is not to configure CSS / JS minification in both Autoptimize and WP Minifyas this might slower instead of fasten the WP site.
A great bunch of other useful WP plugins to make a WordPress Blog friendly to Search Engines is here.
Tags: async js css, autoptimize wordpress, command line tools, CSS, css js and images optimization, HTML, images, make smaller pictures wp, optimization, optimize css and javascript wp, performance, pictures reduce, plugin, png, running, SEO, server, website, Wordpress, wp, WP JS, www image optimizer
Posted in Everyday Life, System Administration, Various, Web and CMS, Wordpress | 1 Comment »
Tuesday, September 18th, 2012 Almost evertime whether install a new Debian Linux server to host some websites, use the popular small and mid-sized hosting solution combination:
- Apache webserver
- PHP module to interpret the PHP programming code
- MySQL to store the DB Backend
Installing the basis for on Debian is easy:
# apt-get install --yes apache2 apache2-mpm-prefork libapache2-mod-php \
mysql-server php5 php5-mysql mysql-client mysql-common phpmyadmin
....
This of course is in case, if necessery to run websites which are written to usephp code which is not thread safety (Use Apache child prefork technology to manage processes); For websites writen to be thread safety (not use some forking php functions like: php – exec(); fork(); etc. – I install apache2-mpm-prefork for better Webserver performance and speed.
This minimum collection of packages is good only for basic, websites and most Joomla, WordPress, Drupal or whatever custom PHP websites has to be hosted usually require much more PHP functions which are not part of this basic bundle. Hence as I said prior on almost all new Linux debian / ubuntu deb package based servers need to install following list of extra PHP deb packages:
# apt-get install --yes php-apc php-auth-ssl php-mail \
php-http php-net-smtp php-net-socket php-pear php5-cli php5-curl \
php5-gd php5-imagick php5-mapscript php5-mcrypt php5-odbc php5-sybase \
php5-xsl
...,
After installing this standard bundle of modules PHP is extended to support somenice functionalities like Image editting / convertion / resizing … various graphic editting functions as supported by infamous ImageMagick and GDlib, PEAR support (PHP Extension and Application Repository) bundle providing number of useful PHP classes.
php5-xInstalling Usual PHP Apache needed modules for new Debian GNU / Linux serverssl is usually necessery for websites which pass data in XSL format (a specific formatted XML data). php5-xsl is usually necessery for websites containing flash animations – Presentation, videos, games etc.
That is mostly it, hope this helps some sys admin like me who need configure new Debian based hosting server 🙂
Tags: apache webserver, combination, debian linux, hosting server, necessery, need, php, sys admin, thread, Use Apache
Posted in Joomla, Various, Web and CMS, Wordpress | No Comments »
Friday, January 24th, 2014 I bough a new Mobile Phone changing my old Nokia Communicator 9300i (powered by Symbian) with ZTE Blade 3 with Android. I'm not a big fan of big mobility myself. However as I already have it decided to test my blog with Mobile phone default browser and my blog theme looked really crappy. Knowing that the amount of Mobile devices on the Internet is increasing dramatically these days raises the chance my blog is found by Mobile user thus its nice my blog to be Mobile ready well …
To solve that I did a quick search in google and found WPTouch – a mobile plugin for WordPress that automatically enables a simple and elegant mobile theme for mobile visitors of your WordPress website
To install it downloaded the plugin in usual /var/www/blog/wp-content/plugins , enabled it and refreshed in Android Mobile Browser and my blog appeared great in a theme specially designed for mobile browsers as you can see in below screenshot:
If you still haven't tried WPTouch give it a try.
Tags: Android Mobile Browser, article, blog, crappy, haven, Internet, Mobile, Nokia Communicator, plugin, simple, theme, top
Posted in Various, Web and CMS, Wordpress | No Comments »
Tuesday, April 5th, 2011 Since I’m using wordpress as a blogging platform for about two years now and I’m constantly experimenting with valueable wordpress plugins.
I’ve decided to publish a compilation of wordpress plugins that empowers my blog
The plugins included in the compilation are quite various, some of the plugins aims at easy post sharing via the general social networks and main websites used by users today, others significantly helps in increasing the blog ranking in major search engines, there are some that adds like button to the blog.
These plugins also strenghthen the easy blog RSS file sharing, some post straight to twitter all your blog posts, generate tags automatically, puts a better features to the default wordpress commenting mechanism, prevent from spam comments, add features for easily adding Google adsense to the wordpress installation to help you advertise on your blog.
There are also plugins which delete duplicate posts (if you have such), puts better wordpress blog search bar, generates a sitemap to the blog, add an option to include php codes straight into your posts, adds wordpress an option to easily put mod rewrite rules straight from the wordpress interface, boost wordpress speed by adding static html generation cache, boost performance etc. etc.
Here is the complete list of wordpress plugins which I have currently installed on my wordpress blog:
ad-squares-widget
add-to-any-subscribe
advertising-manager
ajax-comments
akismet
all-in-one-adsense-and-ypn
all-in-one-seo-pack
askapache-google-404
auto-tag
bm-custom-login
commentluv
comments-statistics
cyr2lat-slugs
delete-duplicate-posts
easy-adsenser
extended-search-plugin
facebook-share-new
favourite-bible-verse
feedburner-plugin
feedburner-widget
feedburner_feedsmith_plugin_2.3
feedlist
force-publish-schedule
google-analytics-for-wordpress
google-sitemap-generator
headspace2
my-link-order
php-code-widget
platinum-seo-pack
post-plugin-library
post-to-twitter
profile-pic
profile-pics
redirection
rss-atom-avatar
seo-automatic-links
seo-slugs
share-on-facebook
share-this
similar-posts
simple-tags
subscribe-to-comments-reloaded
subscribe-to-comments
subscribe2
text-control
tidy-up
tinymce-advanced
what-would-seth-godin-do
wordbook
wordpress-23-related-posts-plugin
wordpress-mobile-edition
wordpress-thread-comment
wp-codebox
wp-keiths-easy-rss
wp-likes
wp-o-matic
wp-postviews
wp-super-cache
wp-syntax
yourls-wordpress-to-twitter
I do have enabled most of the plugins, though some are disabled but still might be helpful somewhere in the close-future thus I still keep them installed.
I would skip the time to describe one by one what each of the above list of plugins will do for your wordpress, since the list is quite long.
However I defnitely think this is a list of plugins you might want to have installed in a newly established wordpress blog for sure.
Note that the versions of the plugins which are included in this must have wordpress plugins collection might not be the latest as the included ones are the ones I do have installed at the time of writting of this article.
Also be aware that some of the plugins might create some issues with newer versions of wordpress (your blog might beak up!), however most of the plugins should work out of the box by just enabling each one of them from the wordpress interface via the menus:
Settings -> Plugins -> Inactive
To straight install my bundled package of plugins you have to issue the commands:
linux:~# cd /var/www/blog/wp-content/plugins
linux:/var/www/blog/wp-content/plugins# wget https://www.pc-freak.net/files/a_must_have_wordpress_plugins_collection.tar.gz
linux:/var/www/blog/wp-content/plugins# tar -zxvf a_must_have_wordpress_plugins_collection.tar.gz
...
linux:/var/www/blog/wp-content/plugins# unzip *.zip
Now as they should be installed under the plugins directory go and enable the plugins.
Further on many of the plugins will require configuration from the menus:
Settings
or in the menu
Tools
After being setup up your new wordpress installation will look significantly better, you will notice a tons of useful features which you might have previously missing and desperately needed 😉
Most of the bundled package of wordpress plugins works fine with wordpress version 3.1, if you’re trying to install enable and configure the plugins on some other versions of wordpress, there might be problems!
If you experience problems by trying out my bunch of wordpress plugins please drop me a comment.
I hope you enjoyed this improvised article, if these bunch of plugins are useful to you please give me a thanks 🙂
Thanks!
Tags: adsense, advertising manager, aims, ajax, analytics, auto tag, bible, bible verse, blog, boost, Button, collection, commentluv, compilation, complete list, configure, custom login, cyr, drop, extended search, generation, google, google sitemap generator, html generation, Inactive, installation, interface, major search engines, mechanism, mod, option, package, php, platform, plugin, post, Search, search bar, search plugin, SEO, Settingsor, Slugs, social networks, squares, time, twitter, wget, widget, wordbook, Wordpress, wordpress blog, wordpress plugins, ypn
Posted in SEO, Web and CMS, Wordpress | 8 Comments »
Wednesday, July 31st, 2013 I've been happily using Tweet-Old-Post to auto tweet my old blog posts in Twitter to drive some extra traffic to increase a bit Traffic to this blog and henceforth it used to be working well just until recently. Suddenly it stopped mysteriously working! Until this very day I didn't have the time to investigate what is happening and why Tweet Old Post fails to Auto post in Twitter? with below miserable error:
OOPS!!! there seems to be some problem while tweeting. Please try again.
Today I have some free time at work and was wondering what to do, so decided to try some close examination. I red plenty of posts online from people complaining to have the same problems on both current latest WordPress 3.5.1 and older Releases of WordPress. Some claimed this errors are because of WordPress version incompitability others said it is due to fact that some other plugins like (FD FeedBurner) are creating conflicts with Tweet-Old-Post. I use FD Feedburner Plugin myself so I tried disabling it for a while and see if this fix it with no luck.
Some other suggested solutions was to check whether
Settings -> General -> (Blog hostname)
is properly configured.
Some even suggested "hacking" manually into plugin code changing stuff in top-admin.php claiming the reason for issues is rooted in some looping mod_rewrite redirect rules.
As a logical step to solve it I moreover tried the good old Windows Philosophy (Restart it and it will magically work again).
Thus from WordPress main menu
Tweet Old Post -> (clicked on) Reset Settings
to nullify any custom settings that might have been messing it.
Though reset worked fine trying to do a test Tweet with Tweet Now (button) failed once again with the shitty error msg:
OOPS!!! there seems to be some problem while tweeting. Please try again.
As a next logical step I tried to enable Tweet-Old-Post logging by ticking on
Enable Log (Saves log in log folder)
In log log.txt (located in my case in /var/www/blog/wp-content/plugins/tweet-old-post/log.txt) I've noticed following error msg:
1375196010 ..CURLOPT_FOLLOWLOCATION is ON
1375196010 ..CURL returned a status code of 200
1375196011 do get request returned status code of 400 for url – http://api.twitter.com/1.1/users/show.json?id=126915073
Obviously something was wrong with curl PHP use, however as I was lazy and not a great PHP Programmer I decided not to took the time to further debug PHP curl function but instead. Try to use some kind of Alternative Post-To-Twitter plugin.
It turned out there are at least two more WP plugins that are auto posting to twitter:
- tweetily-tweet-wordpress-posts-automatically
- evergreen-post-tweeter
I tried to manually download and install both of them with wget in wp-content/plugins set proper readable for apache permissions i.e. (chown -R www-data:www-data /var/www/blog/wp-content/plugins/tweetily-tweet-wordpress-posts-automatically; chown -R www-data:www-data /var/www/blog/wp-cotent/plugins/evergreen-post-tweeter).
Further on tried to enable them one by one and then tried using Authorizing Auto Tweeting to Tweeter App, both failed to Authorize Auto Post to Twitter just like in Tweet-Old-Post 4.0.7. As using another plugin was not a solution, then I tried going another direction and followed some ppl suggestion to downgrade Tweet-Old-Post and try with older version again. I used following link to try with old Tweet-Old-Post versions
Old version didn't worked as well, so finally I felt totally stucked .. unable to fix it for a while and then the lamp bulbed, had the brilliant idea to check curl settings in php.ini (/etc/php5/apache2/php.ini). I looked in config for anything related to curl, until I got what is causing it!!!! A security setting disabling curl use from PHP.INI
Below is paste from php.ini with line making the whole OOPS!!! there seems to be some problem while tweeting. Please try again
disable_functions =exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source,eval
I've included above disable functions to strengthen security and prevent crackers to download scripts if a security breach happens.
Henceforth to solve I simply removed from disable_functions
curl_exec and curl_multi_exec, so after changes machine PHP disabled functions for security reasons looked like so
disable_functions =exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source,eval
To make new php.ini settings load finally did the usual Apache restart:
pcfreak:~# /etc/init.d/apache2 restart
...
Well that's all now the error is solved. I hope my little article will shed up some light on problem and will help thousands of users to get back the joy of working Tweet-Old-Posts 😉
Tags: auto post, conflicts, custom settings, error msg, free time, hostname, logical step, old windows, philosophy, suggested solutions, traffic, tweet, twitter
Posted in Various, Web and CMS, Wordpress | No Comments »
Thursday, May 2nd, 2013 A very common error for wordpress based blog / site whenever you modified
something inside pluginsis to receive empty page screen on user visit.
This error often is because of any installed WordPress caching plugins like
WP SUPER CACHE
One way to solve it is to delete from
wp-config/plugins/ Folder whatever plugin is
causing the troubles.
If this doesn't fix the error and you need to Debug what is causing the odd
Empty pages.
Open wp-config.php and somewhere near beginning of file include:
error_reporting(E_ALL); ini_set('display_errors', 1);
define( 'WP_DEBUG', true); After saving wp-config.php and refreshing WP size in Browser
(after cleaning browser cache)
if you get an error like:
Fatal error: Allowed memory size of 8388608 bytes exhausted
(tried to allocate 252212 bytes) in
/var/www/blog/wp-includes/cache.php on line 4
This is due to set maximum System Wide memory Limit of PHP Scripts to 8MB.
To solve that raise the PHP Limit to lets say 64M from wp-config.php by adding
in it line: define
('WP_MEMORY_LIMIT', '64M');
That's all WordPress should be working normal again. Enjoy 🙂
Tags: config, memory limit, memory size, page error, php scripts
Posted in Everyday Life, Various, Web and CMS, Wordpress | No Comments »
Tuesday, April 12th, 2011 The more my blog is growing the slower it becomes, this is a tendency I’ve noticed since a couple of weeks.
Very fortunately while reading some random articles online I’ve came across a super valuable wordpress plugin called WP-OPTIMIZE
I think it’s best if I present instead of taking the time to explain what the WP-optimize does for a wordpress powered blog:
WP-Optimize is a WordPress 2.9++ database cleanup and optimization tool. It doesn’t require PhpMyAdmin to optimize your database tables. It allows you to remove post revisions, comments in the spam queue, un-approved comments within few clicks.
Additionally you can rename any username to another username too.
For example: If you want to rename default ‘admin’ username to ‘someothername’; just put ‘admin’ (without quotes) to the Old username field and the new username to the New username field, then click “PROCESS”)
Now in short to rephrase above text, during MySQL database requests a lot of database starts needing the so called MySQL optimization , this operation becomes necessery especially for databases which are very actively used and is related to the basic design of the mysql server.
Very often many tables starts having a lot of garbage (repetitive) data and therefore read and writes from the SQL server gets slower and slower day by day.
Thus the MySQL server has it’s famous OPTIMIZE TABLE command which does wipe out all the garbage unnecessery data stored in a tables/s and hence seriously impacts the later read/write table operations.
Now to go back to wordpress the same optimization issues, very often are a cause for a performance bottleneck and some smart guy has came with the great idea to create a specific wordpress plugin to fix such an optimize table issues
The WP-Optimize plugin has 5 major options which somehow could have a positive impact on blog’s performance, these are:
- Remove all Post revisions
- Remove all auto draft posts
- Clean marked Spam comments
- lean Unapproved comments
-
Optimize database tables
Apart from the nice performance boost applicaiton the wp-optimize plugin has one super valuable function, it could change the default wordpress blog administrator user admin to some other desired username, for example rename the default blog administrator username “admin” user to “john”.
From a security perspective this is another must have feature in every wordpress blog as it can kill many of the possible brute force attacks with some web brute force softwares like Hydra
Installing and using wp-optimize is a real piece of cake, here is a very quick few command lines to install it:
host:~# cd /var/www/blog/wp-content/plugins/
host:/var/www/blog/wp-content/plugins:# wget https://www.pc-freak.net/files/wp-optimize.0.9.2.zip
host:/var/www/blog/wp-content/plugins:# unzip wp-optimize.0.9.2.zip
...
To launch WP-OPTIMIZE and fix many speed bottlenecks caused by unoptimized tables, or just hanging around in database old spam comments, go and login with your adminsitrator to wordpress.
In the left pane menu starting up with Dashboard somewhere near the end of the vertical menu you will notice a button reading WP-Optimize .
Click over the Wp-Optimize button and a screen like the one in below’s screenshot will appear in your browser screen:
I have personally decided to use just 2 of all the 5 available primary plugin options, I decided to select only:
- Clean marked Spam comments
- Optimize database tables
Scrolling below the PROCEED button I could also notice a number of tables which were missing optimization and hence required an optimize table to be executed on each one of them.
Further on I pressed the PROCESS button and after a couple of minutes (2, 3 minutes) of waiting the wp-optimize plugin was done it’s selected tasks:
In the screenshot below, you see all my blog tables which were optimized by the plugin:
It’s interesting to say few words about the Remove All Posts revisions plugin option, as many might be wondering what this plugin option really means.
When writting posts, wordpress has an option to restore to a certain point of the write out and makes a sort of different versions in time of each of it’s written posts.
Therefore later restoration if something gots deleted by mistake is facilitated, this is actually the all meaning of Remove All Posts revisions
With time and the increase wp posts the amount of Posts Revisions is growing on and on and just taking space and possibly making the access to the database entries slower, thus it might be a good idea to also remove them as, it’s absolutely rare to use the wp post restoration function.
However I’ve personally decided to not wipe out the old posts revisions as someday i might need it and I’m a bit scared that it might cause me some database issues.
I’ll be glad if somebody has tried the Posts Revisions wp-Optimize funciton and is happy with the results.
Tags: Button, cleanup, database cleanup, database tables, databases, doesn, function, garbage, many tables, mysql data, mysql server, nbsp, necessery, Old, operation, optimization issues, optimization tool, option, performance bottleneck, plugin, queue, quot, random articles, repetitive data, rephrase, Revisions, screen, smart guy, spam, SQL, sql server, TABLE, taking the time, tendency, text, time, tool, username, username field, Wordpress, wp, WP-OPTIMIZEI
Posted in MySQL, Web and CMS, Wordpress | No Comments »
Sunday, July 24th, 2011 My sister has forgotten the administrator account for her wordpress blog as she did not blogged for a while.
I decided to help her and reset the WORDPRESS blog password to another one.
The easiest way of course in normal circumstances is to use wordpress's Lost your password password reset via email.
However with this blog it seems I used an email address which I forgot so I couldn't really use this as a mean to reset the blog password.
Therefore as I'm addicted to command line 😉 I decided to do it straight via connecting to mysql server with mysql cli and change the encrypted password value directly there. Here is how I did it:
1. First I logged in to the mysql server with my root user/pass
pcfreak# mysql -u root -p
Enter password: Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 39263
Server version: 5.0.83-log FreeBSD port: mysql-server-5.0.83
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
2. Then I checked current set user and password for the wp-admin admin user
mysql> use wordpress1;
mysql> select * from wp_users where user_login like '%admin%';
+----+------------+--------------+---------------------+-------------+--------------+
| ID | user_login | user_pass | user_nicename | user_email | user_url | user_registered | user_activation_key | user_status | display_name |
+----+------------+------------------------------------+---------------+----------------+----------+---------------------+----
| 1 | admin | $P$BG9eMoysG8ztywLp25AOpJSkWlRZMu. | admin | invoke@emailaddress.com | | 2011-03-10 13:44:26 |
| 0 | admin | +----+------------+------------------------------------+---------------+----------------+----------+---------------------+---
1 row in set (0.25 sec)
3. Used a query to reset the current encrypted password you see below shown under the user_pass column
mysql> UPDATE wp_users SET user_pass= MD5('my_new_wordpress_password_to_reset') where ID = '1';
4. I've changed the email set for user_email to which mail is sent, in case of forgotten password again
I've done this to prevent my sister to bother me again, if she forgets her password once again 😉
mysql> UPDATE wp_users SET user_email='invoke_@abv.bg' where ID = '1';
One important note here is that in step 3
I've used the MD5(); mysql embedded function to generate the MD5 crypted password which is inserted in above's sql query, however the MD5 function is only available in MySQL servers version 5.x, therefore in older releases of MySQL e.g. ver 4.x, one will have to first generate the md5 password with let's say md5sum linux command or bsd's md5 cmd like so:
a. On Linux
hipo@noah:~$ echo 'my_new_wordpress_password_to_reset' | md5sum
f0ed1489e6d9e7eae8b363b1b5e4a864 -
b. On FreeBSD
pcfreak# echo 'my_new_wordpress_password_to_reset' | md5
f0ed1489e6d9e7eae8b363b1b5e4a864
Afterwards the SQL query that can be used with the above generated string to issue on the MySQL 4.x server or earlier versions would be:
mysql> UPDATE wp_users SET user_pass='f0ed1489e6d9e7eae8b363b1b5e4a864' where ID = '1';
That's all now the password is set to the newly generated my_new_wordpress_password_to_reset pass string.
Cheers 😉
Tags: administrator account, circumstances, cli, com, Commands, connection, connection id, course, Display, eae, email address, encrypted password, function, help, input statement, login, monitor, mysql connection, password, pcfreak, reset, root, root user, row, server version, status, update, url, value, wordpress blog, wp, ztywLp
Posted in FreeBSD, Linux, MySQL, System Administration, Wordpress | 7 Comments »
Friday, July 20th, 2012 I'm running a two servers for a couple of home hosted websites. One of the servers is serving as Apache host1 and has configured MySQL running on it and the second is used just for database host2 – (has another MySQL configured on it).
The MySQL servers are not configured to run as a MySQL MASTER and MySQL SLAVE (no mysql replication), however periodically (daily), I have a tiny shell script that is actualizing the data from the active SQL host2 server to host1.
Sometimes due to electricity problems or CPU overheats the active MySQL host at host2 gets stoned and stops working causing the 2 WordPress based websites and One joomla site inaccessible.
Until I manually get to the machine and restart host2 the 3 sites are down from the net and as you can imagine this has a very negative impact on the existing website indexing (PageRank) in Google.
When I'm at home, this is not a problem as I have physical access to the servers and if somethings gets messy I fix it quickly. The problem comes, whether I'm travelling or in another city far from home and there is no-one at home to give the hanged host hard reboot ….
Lately the problems with hang-ups of host2 happaned 3 times or so for 2 weeks, as a result the websites were inaccessible for hours and since there is nobody to reboot the server for hours; the websites keep hanging until the DB host is restarted ;;;;
To work-around this I came with the idea to write a tiny shell script to check if host2 is ping-able in order to assure the Database host is not down and then if script determines host2 (mysql) host is down it changes wp-config.php (set to use host2) to a wp-config.php (which I have beforehand configured to use) host1.
Using the script is a temporary solution, since I have to actually find the real hang-up causing troubles, but at least it saves me long downtimes. Here is a download link to the script I called change_blog_db.sh .
I've configured the script to be run on the Apache node (host1) via a crontab calling the script every 10 minutes, here is the crontab:
*/10 * * * * /usr/sbin/change_blog_db.sh > /dev/null 2>&1
The script is written in a way so if it determins host2 is reachable a copy of wp-config.php and Joomla's configuration.php tuned to use host2 is copied over the file config originals. In order to use the script one has to configured the head variables script section, e.g.:
host_to_ping='192.168.0.2';
blog_dir='/var/www/blog';
blog_dir2='/var/www/blog1';blog_dir3='/var/www/joomla';
notify_mail='hipo@www.pc-freak.net';
wp_config_orig='wp-config.php';
wp_config_localhost='wp-config-localhost.php';
wp_config_other_host='wp-config-192.168.0.2.php';
joomla_config_orig='configuration.php';
joomla_config_other_host='configuration-192.168.0.2.php';
You will have to manually prepare;;;
wp-config-localhost.php, wp-config-192.168.0.2.php ,configuration-192.168.0.2.php, wp-config-localhost.php to be existing files configured to with proper host1 and host2 IP addresses.
Hope the script will be useful to others, experiencing database downtimes with WordPress or Joomla installs.
Tags: apache, change, city, config, copy, cpu overheats, database host, download, electricity, electricity problems, file, google, hang ups, HEAD, host1, impact, indexing, Master, mysql replication, mysql server, mysql servers, negative impact, nobody, one at home, orig, pagerank, php, ping, replication, second, Shell, shell script, SQL, temporary solution, tiny shell, ups, website indexing, Wordpress
Posted in Joomla, MySQL, Various, Web and CMS, Wordpress | 1 Comment »
Thursday, December 20th, 2012
Earlier I've blogged how to fix NULL error appearing in comments box, when someone tries to comment in WordPress (Comments) section. As you can read from my previous post the whole issue, was caused by wordpress-threaded-comments plugin which as of time of writing this post is incompatible with modern WordPress versions.
Recently one of my blog readers Jem, reported the same NULL comments issue happens again in my WordPress (thanks for that Jem).
Over the last 2-3 months I didn't added or removed plugins from my wp blog, so I excluded the possibility that the error, might be due to Enabling new plugins.
Since I only blogged in those 2-3 months it was completely, incomprehensible for me why this NULL comments err happens again?
I've remembered, that few months ago along with the last changes I made to my blog, was enabling FCKEditor, for comments to aid Comments with possibility to change easily, font size, add color or make bold and italic their comments, ie. – for those who didn't tried yet FCKEditor yet I warmly recommend you this plugin, below is a screenshot of FCKEditor from 1 of my comments:
As I supposed, the problem might be caused by FCKEditor (advanced comment editor) wp plugin. I tried disabling the plugin, to see if this will solve the issue. Contrary to my expectations, the same NULL error kept hanging in the comment. However as the html form for default WordPress Comments is simplistic instead of displaying the NULL in comments box, Comments form was blank, with no ability for the user to type in anything. Here is the screenshot of it:
I pushed forward, to look for what is causing, the strange occurance since it is not directly caused by some conflict with my installed FCKEditor (latest stable version). Checked if I can find something on the internet, but for my amazement the first result I found in Google was actually, my own previous article on Fixing NULL Comments box error 🙂 The rest of the threads, I've saw were not so helpful. So finally I've got the idea to check in the Source Code (CTRL + U) of the returned page with the empty form box. Guess what I found there, a reference to TinyMCE Advanced WordPress editor. I've remembered some, very long time ago. When I started experimenting with WordPress plugins and still was new to wordpress, I've used TinyMCE instead of FCKEDitor which later started using as a substitute for TinyMCE, cause finding it to be more advanced and hence more useful.
Back in the time when I was still using TinyMCE, I found a little TinyMCE addon plugin called TinyMCEComments, the function of TinyMCEComments, was to add the TinyMCEComments originally available inside snf only to wordpress logged in Administrator user to the non-registered subscribed users (e.g. beautify user comments box with allowing them to easily make comments text bold and Italic etc.).
It seems, even though I switched on to FCKEditor at some point in time and hence switched off TinyMCE plugin from Administrator's
Dashboard -> Plugins -> TinyMCE Editor
Forgot to disable the little extension plugin TinyMCEComments addon to TinyMCE editor!!
Therefore, the NULL box problem occurs cause of conflict between TimeMCEComments Javascript with WordPress default comment engine.
Henceforth, the NULL fix is to Deactivate MCEComments.
Tags: blog, blogged, consequence, contrary, FCKEditor, incomprehensible, screenshot
Posted in Various, Wordpress | No Comments »
A must have collection of WordPress plugins that enpowers your blog and improves SEO
Tuesday, April 5th, 2011Since I’m using wordpress as a blogging platform for about two years now and I’m constantly experimenting with valueable wordpress plugins.
I’ve decided to publish a compilation of wordpress plugins that empowers my blog
The plugins included in the compilation are quite various, some of the plugins aims at easy post sharing via the general social networks and main websites used by users today, others significantly helps in increasing the blog ranking in major search engines, there are some that adds like button to the blog.
These plugins also strenghthen the easy blog RSS file sharing, some post straight to twitter all your blog posts, generate tags automatically, puts a better features to the default wordpress commenting mechanism, prevent from spam comments, add features for easily adding Google adsense to the wordpress installation to help you advertise on your blog.
There are also plugins which delete duplicate posts (if you have such), puts better wordpress blog search bar, generates a sitemap to the blog, add an option to include php codes straight into your posts, adds wordpress an option to easily put mod rewrite rules straight from the wordpress interface, boost wordpress speed by adding static html generation cache, boost performance etc. etc.
Here is the complete list of wordpress plugins which I have currently installed on my wordpress blog:
ad-squares-widget
add-to-any-subscribe
advertising-manager
ajax-comments
akismet
all-in-one-adsense-and-ypn
all-in-one-seo-pack
askapache-google-404
auto-tag
bm-custom-login
commentluv
comments-statistics
cyr2lat-slugs
delete-duplicate-posts
easy-adsenser
extended-search-plugin
facebook-share-new
favourite-bible-verse
feedburner-plugin
feedburner-widget
feedburner_feedsmith_plugin_2.3
feedlist
force-publish-schedule
google-analytics-for-wordpress
google-sitemap-generator
headspace2
my-link-order
php-code-widget
platinum-seo-pack
post-plugin-library
post-to-twitter
profile-pic
profile-pics
redirection
rss-atom-avatar
seo-automatic-links
seo-slugs
share-on-facebook
share-this
similar-posts
simple-tags
subscribe-to-comments-reloaded
subscribe-to-comments
subscribe2
text-control
tidy-up
tinymce-advanced
what-would-seth-godin-do
wordbook
wordpress-23-related-posts-plugin
wordpress-mobile-edition
wordpress-thread-comment
wp-codebox
wp-keiths-easy-rss
wp-likes
wp-o-matic
wp-postviews
wp-super-cache
wp-syntax
yourls-wordpress-to-twitter
I do have enabled most of the plugins, though some are disabled but still might be helpful somewhere in the close-future thus I still keep them installed.
I would skip the time to describe one by one what each of the above list of plugins will do for your wordpress, since the list is quite long.
However I defnitely think this is a list of plugins you might want to have installed in a newly established wordpress blog for sure.
Note that the versions of the plugins which are included in this must have wordpress plugins collection might not be the latest as the included ones are the ones I do have installed at the time of writting of this article.
Also be aware that some of the plugins might create some issues with newer versions of wordpress (your blog might beak up!), however most of the plugins should work out of the box by just enabling each one of them from the wordpress interface via the menus:
Settings -> Plugins -> Inactive
To straight install my bundled package of plugins you have to issue the commands:
linux:~# cd /var/www/blog/wp-content/plugins
linux:/var/www/blog/wp-content/plugins# wget https://www.pc-freak.net/files/a_must_have_wordpress_plugins_collection.tar.gz
linux:/var/www/blog/wp-content/plugins# tar -zxvf a_must_have_wordpress_plugins_collection.tar.gz
...
linux:/var/www/blog/wp-content/plugins# unzip *.zip
Now as they should be installed under the plugins directory go and enable the plugins.
Further on many of the plugins will require configuration from the menus:
Settings
or in the menu
Tools
After being setup up your new wordpress installation will look significantly better, you will notice a tons of useful features which you might have previously missing and desperately needed 😉
Most of the bundled package of wordpress plugins works fine with wordpress version 3.1, if you’re trying to install enable and configure the plugins on some other versions of wordpress, there might be problems!
If you experience problems by trying out my bunch of wordpress plugins please drop me a comment.
I hope you enjoyed this improvised article, if these bunch of plugins are useful to you please give me a thanks 🙂
Thanks!
Tags: adsense, advertising manager, aims, ajax, analytics, auto tag, bible, bible verse, blog, boost, Button, collection, commentluv, compilation, complete list, configure, custom login, cyr, drop, extended search, generation, google, google sitemap generator, html generation, Inactive, installation, interface, major search engines, mechanism, mod, option, package, php, platform, plugin, post, Search, search bar, search plugin, SEO, Settingsor, Slugs, social networks, squares, time, twitter, wget, widget, wordbook, Wordpress, wordpress blog, wordpress plugins, ypn
Posted in SEO, Web and CMS, Wordpress | 8 Comments »