Support » Plugin: WP Biographia » [Plugin: WP Biographia] Always get error messages: Undefined index: contactmethod

  • Resolved tukangpolesweb


    Please help me sir. I really like your plugin and I really need it. I’ve tried it on different versions of wordpress but always got the following messages:

    Notice: Undefined index: contactmethod in/Applications/xampp/xamppfiles/htdocs/localhost/wp-content/plugins/wp-biographia/wp-biographia.php on line 253
    Warning: Cannot modify header information - headers already sent by (output started at /Applications/xampp/xamppfiles/htdocs/localhost/wp-content/plugins/wp-biographia/wp-biographia.php:253) in /Applications/xampp/xamppfiles/htdocs/localhost/wp-includes/pluggable.php on line 866

    I’ve tried it at 3.2.1 version, 3.3 and 3.4.1. I’m using Mac OS X 10.5.8, MAMP Pro, PHP 5.3.5 and MySQL 5.5.9. And this is all my new install without any other plugin.

    And this is the plugin’s current configuration:

        [wp_biographia_installed] => on
        [wp_biographia_version] => 310
        [wp_biographia_style_bg] => #FFEAA8
        [wp_biographia_style_border] => top
        [wp_biographia_display_front] =>
        [wp_biographia_display_archives] =>
        [wp_biographia_display_posts] => on
        [wp_biographia_display_pages] =>
        [wp_biographia_display_feed] =>
        [wp_biographia_display_location] => bottom
        [wp_biographia_content_prefix] => About
        [wp_biographia_content_name] => first-last-name
        [wp_biographia_content_authorpage] => on
        [wp_biographia_content_image] => on
        [wp_biographia_content_image_size] => 64
        [wp_biographia_content_bio] => on
        [wp_biographia_content_icons] =>
        [wp_biographia_content_alt_icons] =>
        [wp_biographia_content_icon_url] =>
        [wp_biographia_content_email] => on
        [wp_biographia_content_web] => on
        [wp_biographia_content_twitter] => on
        [wp_biographia_content_facebook] => on
        [wp_biographia_content_linkedin] => on
        [wp_biographia_content_googleplus] => on
        [wp_biographia_content_delicious] =>
        [wp_biographia_content_flickr] =>
        [wp_biographia_content_picasa] =>
        [wp_biographia_content_vimeo] =>
        [wp_biographia_content_youtube] =>
        [wp_biographia_content_reddit] =>
        [wp_biographia_content_posts] => extended
        [wp_biographia_content_link_target] => _self
        [wp_biographia_content_link_nofollow] => on
        [wp_biographia_admin_new_users] =>
        [wp_biographia_admin_hide_profiles] =>
        [wp_biographia_category_exclusions] =>
        [wp_biographia_post_exclusions] =>
        [wp_biographia_global_post_exclusions] =>
        [wp_biographia_page_exclusions] =>
        [wp_biographia_admin_content_priority] => 10
        [wp_biographia_admin_excerpt_priority] => 10

    Thank you sir. Hopefully I do not really bother you.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author vicchi


    There’s something not quite right here. But firstly what you’re seeing are not error messages, they’re PHP notice and warning messages which you’d potentially expect to see in a development environment but not in a live production environment.

    What’s happening is this …

    The plugin’s code is looking for an array index, contactmethod which doesn’t always exist at line 253 of the plugin. The code looks like this …

    function user_contactmethods ($contactmethods) {
    	foreach ($this->defaults () as $key => $data) {
    		if ($data['contactmethod']) {
    			$contactmethods[$key] = $data['contactmethod'];
    	}	// end-foreach (...)
    <p>	return $contactmethods;

    The code at line 253 could use some tightening up to check if the contactmethod index actually exists before getting its’ value, along the lines of …

    function user_contactmethods ($contactmethods) {
    	foreach ($this->defaults () as $key => $data) {
    		if (isset ($data['contactmethod']) && !empty ($data['contactmethod'])) {
    			$contactmethods[$key] = $data['contactmethod'];
    	}	// end-foreach (...)
    <p>	return $contactmethods;

    … and this will be in the next version of the plugin.

    So PHP is emitting a Notice message when it detects the index is undefined. This message is sent after Apache has emitted the document headers, so PHP then emits another Warning message to tell you this. If the Notice message isn’t emitted, you won’t get the subsequent Warning message.

    These types of messages are either configured in your php.ini or by setting WP_Debug to true in your wp-config.php file.

    Like you, I’m running my development environment on a Mac running MAMP v2.0.5, MySQL v5.5.9, PHP v5.3.6 and Apache 2.2.21 under OS X 10.7.4 (Lion).

    MAMP’s stock php.ini at /Applications/MAMP/bin/php/php5.3.6/conf/php.ini has all errors, except Notices enabled, see error_reporting = E_ALL at line 271 of this file. The stock WordPress wp-config.php has WP_Debug set to false.

    I keep WP_Debug enabled on my development environment and I’ve just tested this with error_reporting = E_ALL & E_NOTICE and I can’t replicate this.

    Moreover, I think you have an inconsistent environment. You’ve said that you’re running MAMP Pro under OS X 10.5.8 (Leopard) but the Notice and Warning messages you’ve mentioned show that you’ve also got XAMPP installed and that your WordPress install is hosted under XAMPP not under MAMP. MAMP’s document root is located at /Applications/MAMP/htdocs/, but your messages show you’re using a document root located under /Applications/xampp/xamppfiles/htdocs/.

    I’d recommend taking a look at the configuration of your local development environment, as something doesn’t add up here, based on what you’ve mentioned in your post.


    Thanks for the great answers and speed of your response sir. But I got these messages as well as on live server environment. My server runs on Debian GNU/Linux. And the root document folder located at /home/sloki/user/sites/mysites/www/.

    These messages appear when I turn on WP-Debug and edit my user profile, though only one user in WordPress. These messages have no effect on the output of this plugin on website but it is very disturbing.

    By the way I put my document root in XAMPP folder because previously I was using XAMPP. And because of the flexibility of MAMP then I think it’s not a significant problem.

    Once again thank you sir. I really appreciate your answer. And I can not move to another heart, I will still use the plugin you made​​.

    And excuse my language.

    I forgot, sir. I can’t wait for the next release of your plugin. And I wish only the best for you.

    Plugin Author vicchi


    These messages appear when I turn on WP-Debug and edit my user profile, though only one user in WordPress. These messages have no effect on the output of this plugin on website but it is very disturbing.

    So you really shouldn’t be running with WP_Debug set to true in your live environment, it’s not considered “best practice” though I know of some people who do.

    If you want to fix it right now, then you can make the code change I suggested in the plugin’s code; it’ll be overwritten when the next version comes out, which may be as early as the end of this week.


    Hooray! Now the problem is solved sir.

    This is my first time using WordPress, I was using Joomla and Drupal. Therefore, I set in php.ini error_reporting = E_ALL and WP-Debug set to true either in a production environment and in the development environment just to make sure all is fine. Especially since my website was still under construction or beta stage.

    This problem makes me not sleep last night. I studied every line of your plugin’s code. You’ve got a magic solution. Simply replace the eight lines of code and the problem is now resolved.

    Thank you sir. Just tell me what can I do to repay you. I’m ready .. 🙂

    Plugin Author vicchi


    WP Biographia is free. Free as in speech and free as in beer. This is why … … you’re happy, so I’m happy.


    You are too kind sir. If only there anything I can help. Just call me if one day you go to Bali or Yogyakarta Indonesia. I live in Yogyakarta/Jogja.

    And one more question, sir, why do I still getting php notices like this in Exclusions Settings tab? I’ve been using version 3.1.

    Notice: Undefined index: wp_biographia_portfolio_exclusions
    Notice: Undefined index: wp_biographia_portfolio-item_exclusions
    Notice: Undefined index: wp_biographia_global_portfolio-item_exclusions
    Notice: Undefined index: wp_biographia_gallery_exclusions
    Notice: Undefined index: wp_biographia_global_gallery_exclusions

    I know there are people who have previously been reported about this but maybe you have a better solution and fast. And sorry because it was out of our initial conversation.

    Plugin Author vicchi


    This is because you have custom post types defined (for portfolio, portfolio-items and gallery) and the plugin is checking for configuration values for these, but as these are specific to your site, and as there’s no way of checking when a custom post type is created or deleted in WordPress (they just appear) then there’s no way I can automatically add defaults for these to the back-end database.

    Having said that, this is a sign that I’m checking for an array value that may not exist (which is quite valid) without checking whether whether the index exists or not (in the same way as for the contactmethods index). So I’ll go back and check this again and make sure it’s fixed in the new release.


    Okay sir, I also thought like that. And that’s all I need to know.

    Once again thank you.

    Plugin Author vicchi


    Fixed and ready for the new release – see for the specific details, if you’re interested.


    I’m interested sir! Very interested..

    I’ve even tried it on WordPress versions 3.3 and 3.4.1. And all went smoothly. Notice is not there anymore.

    I see in the next release will be much more fascinating. I highly recommend this plugin. Keep up your good work sir. And of course thank you from my deepest heart.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Plugin: WP Biographia] Always get error messages: Undefined index: contactmethod’ is closed to new replies.