[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!

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!

Making money online, avoiding the scams

Making money online…

Making money online is one of the most researched topics for many of web developpers, bloggers and website owners. It takes a lot of efforts to produce quality content and get enough traffic, to be able to rank better in search results and improve your different ranking factors. After a while of being online, website owners will get advertising offers from different companies, which might be interesting at first.

Well, this is a good sign, as it means that your site is getting some interest and attention; but it’s also an alert, warning you to be cautious.


There are lots of scams out there, which try to fool you by offering great business opportunities and make you run some ads or malicious scripts on your website. They (the scammers) will try to get detailed information about you, your website, personal details and even your bank account(s). scam


You Should be carefull…

You would get an email, from an unknown party, who shows interest in your website and usually represents himself as an advertising company who wants to buy some ad space, or publish some content on your website (or blog) for one of his clients.

First thing to do is : DO NOT reply with your personal information and  DO NOT show that you’re very interested!

Second, start to gather some information about the company who sent you the email. See its WHOIS record (you can use InterNIC WHOIS ) to find out more about the website owner, registrar, their address, and phone numbers if any.

Use your favorite search engine to find out more about the company, visit their website, check their “About us” page, check their portfolio, recent clients, latest works…

Look for user reviews on the company, search to find out if ” {the company name} + scam ” returns anything in your search engine? Search and investigate a little bit to keep your website (blog) safe from advertisement scams.

Use SiteAdvisor form McAffee to check if the website is a safe website or not.

If you come across any types of scams, just DO NOT reply to their emails and ignore them. You would help other website owners and bloggers if you write a post on how to identify scams and spams and how to avoid scams.

You can share this post and link back to it from your website (given that you mention the source).


Recently I’ve came across a scam from Production-Time.com . They’ve sent me an email in French, in which they shown interest in Gibni.com and asked me to reply if I wanted some more information.

I’ve done a WHOIS research and some investigation and found out that the email, even if it was well personalised, has been sent to thousands of people and some website owners have already announced Promotion-Time.com as a scam. I’ve found a detailed article about this scam in EPN.dk, which I translated to English to be able to understand it.

Here’s the a part of the email they’ve sent me:


Bonjour,
J’aimerais vous faire part d’une proposition commerciale à propos de votre site Web, qui pourrait très fort vous intéresser.
En effet, ma société Promotion-Time, souhaiterait vous rémunérer pour la publication d’une petite publication textuelle sur votre site pour un de nos clients.
Il s’agit d’une annonce francophone ciblée qui convient à certaines pages de votre site.
N’hésitez pas à me contacter si vous avez besoin de plus amples informations.

Sincèrement,
Francq Petit
francqp@promotion-time.com

Si vous ne souhaitez plus recevoir d’emails de Promotion-Time, répondez à cet email avec comme sujet : STOP.
It is possible to continue this correspondence in English, if you prefer to do so.


Here in this post, you can help the community by letting other know about the scams you faced and also know about scams already running on the internet. Type in the information you have in the comments section (Be carefull not to spam the comments section) .


Making money online, avoiding the scams, aims to help you avoid scams, help spread the word and show your support.

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!

WordPress 2.7 (still in beta!)

WordPress is one of the best blogging platforms available today. Gibni as well as a lot of other big blogs are based on WordPress.

Most of you should already have heard of WordPress, and for some of you who didn’t yet, go to www.Wordpress.org to find out what it is!

Developers are currently testing and improving the latest version of WordPress, that is the 2.7.

It was supposed to be release the last month (in November) but some some reasons, nothing happened back in November! But fortunately, beta versions of 2.7 got out and today, Gibni is running on an Optimized version of WordPress 2.7 RC2. The optimization mainly consists of adding a new feature to the “big query” of wordpress, adding the ability to sort and output posts based on their ‘post views’, this is done by Amir from Gibni.

I’m still waiting for the stable release of WordPress 2.7, so that issues like “TinyMCE not working properly when switching from visual to html”, get solved and I can some peace of mind.

To test beta versions of WordPress, just surf to www.Wordpress.org and look in the download section.

Maybe in the near future (I hope), when a stable version of WordPress 2.7 will be available, I will release to the public my Optimized version of WordPress so it will become easy for every one to create dynamic “Featured Articles” lists of posts (based on their post views).

By the way, the present theme running on Gibni, which is “Prince Blog Theme version 3.0 Advanced” designed and developed by Amir, is close to get out of beta. So make that easier and faster, please provide feedback on the current theme.

WordPress is one of the best blogging platforms available today. Gibni as well as a lot of other big blogs are based on WordPress.

Most of you should already have heard of WordPress, and for some of you who didn’t yet, go to www.Wordpress.org to find out what it is!

Developers are currently testing and improving the latest version of WordPress, that is the 2.7.

It was supposed to be release the last month (in November) but some some reasons, nothing happened back in November! But fortunately, beta versions of 2.7 got out and today, Gibni is running on an Optimized version of WordPress 2.7 RC2. The optimization mainly consists of adding a new feature to the “big query” of wordpress, adding the ability to sort and output posts based on their ‘post views’, this is done by Amir from Gibni.

I’m still waiting for the stable release of WordPress 2.7, so that issues like “TinyMCE not working properly when switching from visual to html”, get solved and I can some peace of mind.

To test beta versions of WordPress, just surf to www.Wordpress.org and look in the download section.

Maybe in the near future (I hope), when a stable version of WordPress 2.7 will be available, I will release to the public my Optimized version of WordPress so it will become easy for every one to create dynamic “Featured Articles” lists of posts (based on their post views).

By the way, the present theme running on Gibni, which is “Prince Blog Theme version 3.0 Advanced” designed and developed by Amir, is close to get out of beta. So make that easier and faster, please provide feedback on the current theme.

WordPress is one of the best blogging platforms available today. Gibni as well as a lot of other big blogs are based on WordPress.

Most of you should already have heard of WordPress, and for some of you who didn’t yet, go to www.Wordpress.org to find out what it is!

Developers are currently testing and improving the latest version of WordPress, that is the 2.7.

It was supposed to be release the last month (in November) but some some reasons, nothing happened back in November! But fortunately, beta versions of 2.7 got out and today, Gibni is running on an Optimized version of WordPress 2.7 RC2. The optimization mainly consists of adding a new feature to the “big query” of wordpress, adding the ability to sort and output posts based on their ‘post views’, this is done by Amir from Gibni.

I’m still waiting for the stable release of WordPress 2.7, so that issues like “TinyMCE not working properly when switching from visual to html”, get solved and I can some peace of mind.

To test beta versions of WordPress, just surf to www.Wordpress.org and look in the download section.

Maybe in the near future (I hope), when a stable version of WordPress 2.7 will be available, I will release to the public my Optimized version of WordPress so it will become easy for every one to create dynamic “Featured Articles” lists of posts (based on their post views).

By the way, the present theme running on Gibni, which is “Prince Blog Theme version 3.0 Advanced” designed and developed by Amir, is close to get out of beta. So make that easier and faster, please provide feedback on the current theme.

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!!

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.