-2

I enable the debugs, and i have these that describe below. In the wp-config.php write :

define('WP_DEBUG', true);
define('WP_DEBUG', false);

1)

Notice: Undefined index: type in C:\xampp\htdocs\mywebsite\wp-content\plugins\oqey-gallery\gallcore.php on line 252

on line 252 :

//media_upload_header();
    if($_GET['type'] == "oqeygallery"){ include ("insert_in_post.php"); }

2) Notice: add_custom_background is deprecated since version 3.4! Use add_theme_support( 'custom-background', $args ) instead. in C:\xampp\htdocs\mywebsite\wp-includes\functions.php on line 2638

3) Notice: attribute_escape is deprecated since version 2.8! Use esc_attr() instead. in C:\xampp\htdocs\mywebsite\wp-includes\functions.php on line 2638

4)Notice: Trying to get property of non-object in C:\xampp\htdocs\mywebsite\wp-content\themes\mywebsite\includes\for_articles\get_excerpt.php on line 12

function get_excerpt()
    {
        $excerpt = get_the_content();
        $excerpt = preg_replace(" (\[.*?\])",'',$excerpt);
        $excerpt = strip_shortcodes($excerpt);
        $excerpt = strip_tags($excerpt);
        $excerpt = substr($excerpt, 0, 440);
        $excerpt = substr($excerpt, 0, strripos($excerpt, " "));
        $excerpt = trim(preg_replace( '/\s+/', ' ', $excerpt));
        $excerpt = $excerpt.'<a class="read-more" <a href="'. get_permalink($post->ID) . '">Read more &raquo;&raquo;</a>';
        return $excerpt;
    }
?>

Edit:

Notice: attribute_escape is deprecated since version 2.8! Use esc_attr() instead. in /home/www/server/mywebsite/www/wp-includes/functions.php on line 2638

function _deprecated_function( $function, $version, $replacement = null ) {

    do_action( 'deprecated_function_run', $function, $replacement, $version );

    // Allow plugin to filter the output error trigger
    if ( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true ) ) {
            if ( ! is_null($replacement) )
**2638**                trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) );
            else
                trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ) );

        }
    }

Update : Only when activate the plugin oQey Gallery, display some errors like:

Notice: Undefined index: type in C:\xampp\htdocs\website\wp-content\plugins\oqey-gallery\gallcore.php on line 252
Notice: Undefined index: page in C:\xampp\htdocs\website\wp-content\plugins\oqey-gallery\oqeygallery.php on line 346
Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in C:\xampp\htdocs\website\wp-includes\functions.php on line 2723
3
  • I don't see anything that should make Apache crash. I'd suggest you debug your server itself.
    – s_ha_dum
    Feb 3, 2013 at 19:00
  • @ s_ha_dum. Sorry, but need somewhere to start to get in trouble. First, i want to learn if i can solve these, and finally if I fail to solve these, if there is a problem. I edit the title and the content. Now, it is right?
    – user24259
    Feb 3, 2013 at 19:20
  • These are four unrelated PHP notices. In the future, please use a separate question for each separate issue. Feb 3, 2013 at 19:42

1 Answer 1

3

Number 1 is not wordPress, but PHP. $_GET['type'] is undefined. Use an isset( $_GET['type'] ) conditional.

Number 2 the error message tells you exactly what to do. Instead of calling:

add_custom_background();

...call:

add_theme_support( 'custom-background' );

Number 3 the error message tells you exactly what to do. Instead of calling:

attribute_escape();

...call:

esc_attr();

Number 4 is telling you that you're trying to get the property of an object that isn't set. In this yes, that object is $post, which needs to be globalized before you use it. Instead of this:

$excerpt = $excerpt.'<a class="read-more" <a href="'. get_permalink($post->ID) . '">Read more &raquo;&raquo;</a>';

...do this:

global $post;
$excerpt = $excerpt.'<a class="read-more" <a href="'. get_permalink($post->ID) . '">Read more &raquo;&raquo;</a>';
9
  • thanks for the help. In which line i call the esc_attr(); // Allow plugin to filter the output error trigger if ( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true ) ) { if ( ! is_null($replacement) ) trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) ); else trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ) ); } } Thanks
    – user24259
    Feb 3, 2013 at 21:19
  • 1
    You call esc_attr() on whatever line you currently call attribute_escape(). You replace attribute_escape( $foobar ) with esc_attr( $foobar ), where $foobar is the string being escaped. Feb 4, 2013 at 12:58
  • Bennet. In the first error, If I replace that you suggest me, makes wrong/error again.
    – user24259
    Feb 20, 2013 at 15:41
  • 1
    Can you update your original question with the new code you used, and the error message you observed? Feb 20, 2013 at 15:53
  • 1
    In your update, I don't see anything about add_theme_support( 'custom-background' )? Feb 20, 2013 at 18:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.