[Resolved] WordPress : Custom Fields not working and not getting updated issue

Time solves your problems

I’ve had a problem with WordPress last 3 months, and at last, I found the solution. Here is the story:


WordPress Custom Fields

WordPress posts have meta data (Custom Fields) where additional information on the post are stored. For example the featured image, number of views, comments count, keywords, SEO description and so on…

When posting new posts, the Custom fields where not getting stored on WordPress, so basically nothing was “tracked” and optimized. I looked everywhere on forums and internet resources for a solution to this issue, no luck!

Today I was rechecking Gibni’s data base and in the “post_meta” table, I found that “meta_id” was not set to “auto_increment”. You can see this in the “extras” column in phpMyAdmin while you see the “post_meta” table’s structure. Once setting this parameter to the “auto_increment” value, everything got back in order.

Problem Solved!

Now all the “custom fields” get stored and updated as they should. If you have the same issue, check your database!

SEO Super Comments – Update

Improve your SEO and increase Pageviews

There’s a great plugin for the WordPress platform, called SEO Super Comments, which creates a single “virtual” page for each comment on your site. It increases the number of pages you have on the site, and improves your SEO a lot. Read more on SEO Super Comments on the authors page: SEO Super Comments by Vladimir Prelovac .

“The concept relies around optimizing the target page using title and H1 tag using the context of the comment. So basically we will take the excerpt of the comment and use it to create the page title and H1 tag and in the body we will hold the content of the comment…” says Vladimir.

 

 

 

Download modded Google XML Sitemap Generator 3.2.3

I created a modded version of XML Sitemap Generator 3.2.3 to work with SEO Super Comments which puts all your comments pages in the sitemap, and once submitted to Google, you should see a huge raise in your traffic.

Installation

To install, you should replace the downloaded sitemap-ui.php and sitemap-core.php in your Google XML Sitemap Generator Plugin’s directory and overwrite the original files. I would recommend you back up your original files.

Once installed, Go to your administration panel, and to the XML Sitemap Generator settings, and check the ‘Include Comment Pages’ option, click ‘Update Options’ at the bottom, and “Rebuild Your Sitemap”

I personnaly recommend this plugin and would thank the developper for it.

Please send your comments and queries here if you have any issues regarding my modded version of Google XML Sitemap Generator for WordPress.

Donate

Please go to the Donations Page  and contribute to the developpment of more updated plugins if this modded version helped you increasing your traffic.

Emergency code

Who to call in case of website emergency?

Due to some yet unknown issue, WordPress version 2.8.2 might be causing server errors.

Lunarpages, my “current” and might become “ex” webhosting company, shut down Gibni.com yesterday without any prior notice, saying they’ve taken an emergency action, as the “index.php” script in my wordpress root was using huge server resources, and could cause a server crash.

First problem is, not only they changed the “index.php” permissions to “000”  (no read permissions) but they took ownership of the file, so neither I could make any changes to the file, nor analyze it for troubleshooting.


Secondly, they made the domain return an “internal server error” to all visitors.


Third, they did not manage to put an “under maintenance” page at the root untill the issue is solved.


Anyway, thanks to my linux skills, I managed to put an “under maintenance” page for Gibni, and get the site back online very soon.


Until I figure out what caused wordpress to eat server resources, and was it really wordpress or Lunarpages’s poor servers and administration, was it the running theme which ran without any issue for months or even the plugins installed on wordpress a year ago; I’ve decided to switch back to wordpress default theme and upgrade to wordpress 2.8.4.

After all, I believe that you should now:


  • Enjoy Gibni, Ad free!
  • Always have a maintenance page and an emergency code, just in case!
  • Be careful choosing your webhosting company!

Posts and comments in “any” language in WordPress!

Have you ever thought of writing your blog posts in a language other than English? or even let your visitors leave comments in another language!?


Well, some may answer with “Yes! in French!” (or Portuguese, or Italian…), but, what I mean is in other languages like Arabic, Farsi (Persian), Urdu, Chinese…, languages which have characters other than the basic “A,B,C…”

Basically, when you write a blog post on your blog, it is stored in a database, and what characters that database supports, defines the characters you can use for writting your post.


Well discuss about the two general types of WordPress, the WordPress.com blogs and self-hosted WordPress installations.


WordPress.com blogs:


Typing other languages such as Farsi or Russian or Arabic should be supported by default and you should be able to write in almost any language without problem.

But if it’s not enabled on your account, according to Fatih Syuhud [1], you should:

– Login to your administration area on WordPress.com

– Go to “Settings” > “Reading”

– and set the encoding for “Pages and Feeds” to “UTF-8”

This procedure gives you the possibility of writing all kind of characters on your pages and posts and feeds.

Encoding for other specific character:

  • Latin/Hebrew: ISO-8859-8
  • Hebrew: windows-1255
  • Latin/Arabic: ISO-8859-6
  • Arabic: windows-1256


Self-hosted WordPress installations:

Remember that you take full responsability for the modifications and actions you do on your blogs/sites! Proceed at your own risk.


The contents of posts are stored in a table called wp_post (by default) inside your WordPress main database.

What defines the type of characters supported by a table, are the charset and collation of the table.

By default, all installations of WordPress (prior to 2.3.1), use the latin1_general_ci (or latin1_swedish_ci) encoding for their rows and tables.


To post articles in Arabic or Farsi (Persian) (or Urdu, Chinese, Russian…), you should change the encodings of specific tables and respective rows to utf8_general_ci.


Step One: Backup


You should first of all, backup your files and database! use Lester ‘GaMerZ’ Chan’s WP-DBManager plugin, or do it manually by following the procedure from this article: WordPress Backups.



Step Two: Convert


First Solution proposed by Fatih and Mukhlas Rowi [3] ( 70% success rate , maybe some data loss)  is:

– Open your WordPress database in phpMyAdmin (in cPanel),

– Click on the “wp_post” table and then click on “Operations”,

– Change the collation to “utf8_general_ci”,

– Save.

– Now, browse to the “wp_post” table, and check all rows with a collation attribute,

– Click on “Edit” bellow the list of selected rows,

– Change all collations to “utf8_general_ci”,

– Save.

That’ it.


Second solution: Use a plugin to do the conversion! I’ve tested the bbwp2UTF8 plugin and it works great (at least with WordPress 2.7.1), you can download it from my Downloads Page or from WordPress.org home page: bbwp2UTF8 Home page. ( 30% success rate, big data loss)


– Install the bbwp2UTF8 plugin by extracting its content in your plugins directory (usually /wp-content/plugins ),

– Go to the plugin’s page (link is below the “Plugins” section on the left side of the page in WordPress 2.7) .

– Check the desired tables to convert ( I recomment you convert all tables),

– Proceed with the steps to complete the conversion procedure.


That’s all! Your database and tables have been converted in the right manner, and you should not face any loss of data.


(In case you don’t like the plugin suggested above, or it doesn’t work for you, you may try: UTF-8 Database Converter by g30rg3_x ( I haven’t tried this out!) )


Geeks’ solution: Follow the guide at WordPress.org : Converting Database Character Sets



Now you can type UTF8 characters in WordPress and let your visitors type in UTF8 characters in the comments section.



Read More here:

http://codex.wordpress.org/Converting_Database_Character_Sets

http://www.haidongji.com/2008/11/11/convert-character-set-to-utf8-in-mysql/

http://www.prelovac.com/vladimir/ultimate-solution-to-weird-utf-character-encoding-problem

http://codex.wordpress.org/Editing_wp-config.php#Database_character_set

http://www.haidongji.com/2009/02/16/perl-script-to-convert-mysql-character-set-to-utf8/

http://wordpress.org/extend/plugins/utf-8-database-converter/installation/

Ref:

[1]- http://fatihsyuhud.com/2009/01/16/how-to-enable-arabic-letters-in-wordpress/

[2]- http://codex.wordpress.org/Converting_Database_Character_Sets

[3]- http://www.mukhlas-rowi.web.id/2008/11/11/mengatasi-problem-penulisan-huruf-arab-di-blog/

Make money online with your mobile website

I wish you a happy new year 2009!
This year’s first post is about the mobile version of your website/blog. As some of you might know already, Gibni.com has a mobile version which shows up when you access the site (http://www.gibni.com) from a mobile device like your phone.
Gibni detects and recognizes automatically the device you’re using, and serves appropiate content for your screen and device or browser capabilities.

Gibni currently runs on WordPress 2.7, and the mobile version of the site is provided by Mobile Press.

Thanks to this wonderful plugin, Gibni is running very well on mobile devices, and from an admin point of view, there’s no conflict with caching plugins.Gibni Mobile Screenshot

Previously I used to have other plugins on Gibni to provide mobile versions of the pages but there were always issues with caching capabilities.

I never thought that Gibni would get mobile visitors, but I was really impressed when I saw the analytics reports for Decembre 2008! The mobile version got around 2500 visitors! And that made me think of developing more features in the mobile sections, and post more articles on mobile subjects and subjects that will be useful to mobile users.

And thankfully, this year starts very well, in just 7 days, the mobile version of Gibni recieved around 600 happy visitors, and growing.

The advantage of  Mobile Press, is that you can easily edit the template files and create your own theme or modify the beautiful existing themes. By editing a theme, I added advertisements to the mobile version of Gibni, and let me tell you, it makes a lot more than what I expected it to do!!

I currently run two advertisements on top of the page, one from Google Adsense (adsense for mobile content) and the other one is from Admob.

Google Mobile Adsense is making a lot more money than Admob, and get also a high CTR.

I recommend you start a mobile version of your website or blog (if you haven’t already) and optimize it to rank well by providing unique and useful content and then monetize your mobile pages, you WILL MAKE MONEY!

Other good new is that Gibni continues to grow and makes more and more money online each month. Google Adsense is a good start up program!

MyBlogLog Widget is SLOW!

I’ve been using MyBlogLog widget from Yahoo, from the beginning, and I was really happy with it at first. I used to find out who visited my site and if they’ve had a blog or website, it helped me to find and visit it easily.

Now that Gibni is expanding and I get more and more visitors per day, I am worried about the speed and loading times, so I am trying to make pages load faster and faster.

I’ve been using caching techniques, CSS sprites and other optimization techniques some developed by myself and some mostly inspired from AskApache ; and managed to get the best possible loading speed.

Today, I feel it’s going to be the last day for MyBlogLog widget on Gibni. And within the next 12 hours, it will be removed. The main issue with this widget is that it makes many requests to Yahoo servers and this keeps client’s browser connections busy, so it slows the page and the user has to wait for this widget to be ready to have all the site’s functionalities.

If you are using this widget on your site, it might be slowing it down too. Visitors usually don’t like to wait more than few seconds for a website to appear and be fully functional. This will affect your site’s impressions.

This widget has a quite heavy javascript file, and uses a lot of separate image files.

On the other hand , it”s a good tool to build a “website/blog community”. At last, all depends on what matters the most to you?

Global Translator 1.0.9.1, Optimized Version 0.2.2 released! (Updated)

UPDATE: Translation bar not appearing in pages or sub directories; FIXED.

One of my goals is to attain maximum speed and shorter loading times.
So of you might already be familiar to my Optimized version of Global Translator which is initially made by www.Nothing2Hide.net, which provides translated version of your blog to visitors. Latest version till now is 1.0.9.1, which is a stable and improved version.

As I said it in my previous post on this topic, this plugin basically consumes a of bandwidth and keeps pages in a loading state for a long period of time, as it keeps many connections busy between the client and the server to download all independent flag pictures to the client’s computer. This slows down the website as there’s a limited number of simultaneous connections allowed between the client and the server and on the other side, this increases the ‘account hits’ on shared hosting plans.

For more and detailed information on what I thought of and did to optimize this plugin, please refer to my previous post about this topic: http://www.gibni.com/global-translator-plugin-for-wordpress-optimized

After the 1.0.9.1 update, I’ve created a new version of my optimized Global Translator version. This includes the latest Global Translator core (1.0.9.1) and my optimized code version (0.2.2).

My plugin saved a lot of time for a lot of people! and it improved my websites appearance and performance.

You can download it from the Downloads Page.

Installation: Upload the plugin directory to your wordpress installation’s plugins directory.

Activate the plugin and USE DIVs for creating the translation bar in the OPTIONS page of the Plugin!!

Optimizing Global Translator Plugin for WordPress

UPDATE: Version 0.2 released

In the new theme designed for Gibni.com, one of the main goals is to attain maximum speed and shorter page loading times. This post is for people who have the basics of website optimizations. In this post, I’ll discuss a very popular WordPress Plugin, Global Translator, made by www.Nothing2Hide.net, which is used to provide translated version of your blog to visitors. This plugin improved a lot over time, and it gives better and better results after each upgrade. Latest version till date is 1.0.7.1, which is a stable version.

In the process of optimizing my website, I found out that this plugin consumes a large amount of loading time and keeps pages in a loading state for a long period of time, and it makes many connections busy between the client and the server to download all the flag pictures to the client’s computer. This slows down the page as there’s a limited number of simultaneous connections allowed between the client and the server. On the other side, this increases the ‘account hits’ on shared hosting plans.

To make the plugin and the page load and respond faster, I’ve thought of a solution, which is: instead of the plugin sending multiple small image files, it should send a merged image file containing all the required flag images and generate an image map to build the links.

First of all, I’ll stick to a specific model, which is a single line bar. The functions are easy to understand an you can build any shape you want.

Now I’ve to edit Global Translator’s core to give flag images to the merging script. and then create an image map for the translator bar.

After a lot of tests, I finally figured it out! You can find the code for ‘translator.php’ in the Page.

My modified PHP, will generate a fresh PNG file upon user request and store it in the root directory and then creates an image map to create the links for the translator. The good news is everything remains dynamic and if you change the combination of translations available, the PNG and Image Map will change automatically too!

There are still improvements to be done, for example, forcing the code to create the PNG file in the plugins directory and not the site root! So, if you have any ideas, just let me know!

3D Tag Cloud For WordPress

I’ve recently installed a new Tag Cloud on Gibni.com, If you look well, you should already have noticed it.

It’s a 3D Sphere tag cloud! it’s based on a flash file but the real knowledge behind makes it completely search engine friendly.  This is basically a plugin called WP-CUMULUS made by Roy Tanck. The Plugin is hosted now on WordPress.org -> Plugin’s page.

I found this very exciting and as it does not interfere with search engine friendliness factors, I decided to add it to my new theme. I would recommend it as a good plugin as you can really customize it.

The theme that Roy has got on his blog is really well designed and is easy to navigate too! Good job Roy, Keep up the good work!

[WP-CUMULUS]

It’s good to know that CUMULUS is being ported to Typepad and Blogger too! So it’s good news for everyone!

Install this on your blog and to support the good work, spread the word!

Dropcap First Letter, Universal Version

As you can see on Gibni.com, articles’ title have got a drop capped first letter.

I’m making this technique available to the public so that you can “Drop cap” any text you wish.

You can drop cap in WordPress or on any other platform where you can run PHP functions.

I’ll explain on how to Drop cap in WordPress without installing any plugin.

I’ll keep it simple; just open the “functions.php” file in your theme directory, and add this function to it:

—Code—Functions.php—

function dropcap_first($content) {
$pos = strpos($content, ‘<a>’);
/* stripos is only available in new PHP versions we’ll  */
/* live with using the case sensitive version so it won’t match <A> */
/*     $pos = stripos($content, ‘<a>’); */
if (($pos !== 0) || ($pos === false)) {
echo ‘<p class=”dropcap-first”><a href=”‘.get_permalink().'” rel=”bookmark” title=”Permanent Link to ‘.the_title_attribute(‘echo=0’).'”‘. $content .'</a></p>’;
} else {
echo ‘<p class=”dropcap-first”><a href=”‘.get_permalink().'” rel=”bookmark” title=”Permanent Link to ‘.the_title_attribute(‘echo=0’).'”‘ . stristr($content, ‘>’).'</p>’;
}
}

—END—Code—

Now that you have added the function, you should supply the text you want to drop cap to this function

Here’s a briefing about internal items of the function:

_____

int strpos ( string $haystack , mixed $needle [, int $offset ] )

Returns the numeric position of the first occurrence of needle in the haystack string. Unlike the strrpos()

before PHP 5, this function can take a full string as the needle parameter and the entire string will be used.

_____

int stripos ( string $haystack , string $needle [, int $offset ] )

Returns the numeric position of the first occurrence of needle in the haystack string.

Unlike strpos(), stripos() is case-insensitive.

_____

string stristr ( string $haystack , mixed $needle [, bool $before_needle ] )

Returns all of haystack from the first occurrence of needle to the end.

_____

Now proceed to formatting the drop cap letter by CSS. Here I’ve defined a new class, named “dropcap-first” and here’s the CSS I’ve written for it:

—Code—Style.css—

.dropcap-first:first-letter {
color:#900;
float: left;
font-size:50px;
padding-right:2px;
font-family:Arial, Helvetica, sans-serif;
}
.dropcap-first {
font-size:26px;
font-family:Arial, Helvetica, sans-serif;
color:#036;
font-weight:bold;
text-decoration:none;
margin:20px 0 0px 0;
}

—END—Code—

After having added the CSS to your main style sheet, you should provide the text you want to Drop cap to the function, for example, here’s what I did for the articles’ titles:

—Code—Index.php—

<div class=”post_title_wrap”><?php $get_title_todropcap=the_title(‘<a>’,'</a>’,FALSE);
dropcap_first($get_title_todropcap); ?>
<small><?php the_time(‘j,M, y’) ?>
<span class=”comments”> | <?php comments_popup_link(‘Be the first to comment’, ‘1 Comment’, ‘% Comments’ , ‘Comments Disabled’); ?></span>
<span> | written by: <?php the_author() ?></span>
</small>
</div>

—END—Code—

Once you apply the above procedure, you can get the first letter of the supplied text, dropcapped.

If you have trouble understanding the function, do leave a comment and I’ll explain you what is going on in the function.