WordPress.org

Ready to get started?Download WordPress

Make WordPress Core

Tagged: 30compat Toggle Comment Threads | Keyboard Shortcuts

  • Andrew Nacin 9:48 pm on May 29, 2010 Permalink
    Tags: 30compat,   

    Plugins using date('U') or time() may have been expecting a timezone offset in previous versions of WordPress, and depending on the server setup this was true. This has changed in 3.0. We now tell PHP to not factor in timezones to ensure maximum portability across PHP versions and server setups, thus you’ll end up with UTC time when using those functions.

    Use current_time('timestamp') to get the Unix timestamp with a timezone offset.

    Trac references: #9588 #11672 #11665 r12727

     
  • Ryan Boren 1:02 am on May 28, 2010 Permalink
    Tags: 30compat,   

    Another reminder that escaping rules for options and transients changed a bit in 3.0.

     
    • arena 10:50 pm on May 28, 2010 Permalink | Log in to Reply

      Best should be to clean up code in

      wp-login.php
      $user_login = $user_data->user_login;
      $user_email = $user_data->user_email;

      and in wp-pluggable.php (several times)
      $user_login = stripslashes($user->user_login);
      $user_email = stripslashes($user->user_email);

    • arena 11:22 pm on May 28, 2010 Permalink | Log in to Reply

      btw as i am reviewing mails in pluggable.php and hooks on mails in wp-login.php

      in wp-login.php we have :
      if ( is_multisite() )
      $blogname = $GLOBALS[‘current_site’]->site_name;
      else
      // The blogname option is escaped with esc_html on the way into the database in sanitize_option
      // we want to reverse this for the plain text arena of emails.
      $blogname = wp_specialchars_decode(get_option(‘blogname’), ENT_QUOTES);

      in pluggable.php, we have :

      // The blogname option is escaped with esc_html on the way into the database in sanitize_option
      // we want to reverse this for the plain text arena of emails.
      $blogname = wp_specialchars_decode(get_option(‘blogname’), ENT_QUOTES);

      what is the right sequence of code ?

    • arena 11:26 pm on May 29, 2010 Permalink | Log in to Reply

      done #13618

      not sure this line
      $blogname = $GLOBALS[‘current_site’]->site_name;
      is usefull !?

  • Ryan Boren 12:59 am on May 28, 2010 Permalink
    Tags: 30compat,   

    Check out register_nav_menu(), register_nav_menus(), and the theme_location argument to wp_nav_menu() for a means of associating custom navigation menus with particular “locations” in your theme. The Twenty Ten theme offers an example.

     
  • Ryan Boren 12:47 am on May 28, 2010 Permalink
    Tags: 30compat,   

    During plugin activation, WP 3.0 checks to see if the plugin generates any output. If any output is generated a warning is shown to the user. Generating output during activation is usually a good sign that the plugin has spaces before the opening php tag or that it generates warnings. This extra output can break feeds and cause “headers already sent” warnings. Please test your plugins against 3.0 and make sure your they do not generate unexpected output.

    See tickets 13585 and 12089.

     
    • mike503 4:38 am on June 24, 2010 Permalink | Log in to Reply

      The whitespace issue can usually be alleviated by not ending your script with ?>

      It seems wrong, but Zend Framework, Drupal and many other projects have adopted it as a standard, and nobody actually has a problem with it from a technical angle from the PHP side when I’ve ever asked.

    • gaurab 8:31 am on June 27, 2010 Permalink | Log in to Reply

      I am having the same problem during activation.When i try to activate the plugin i get the message “The plugin generated 560 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.”
      So where can i edit the plugin to get rid of this.It works in all of the lower wp-versions.

    • Jeff Lambert 8:01 pm on October 16, 2010 Permalink | Log in to Reply

      If you are still having an issue, I found a spot in a plugin I was developing, which may be the same issue with this plugin. Check that the “add_option” method does not contain a “description” parameter of, if it does, that it is an empty string or null. “Description” was deprecated with version 2.3 of WordPress. Good luck.

    • manie 6:53 am on October 31, 2011 Permalink | Log in to Reply

      Hey guys I’m having the same issue. However, I’m getting the following message:

      “The plugin generated 3 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.”

      I’m crap at editing code, was this what you was hinting at Jeff Lamberth?
      Please advise.

  • Michael Adams (mdawaffe) 9:18 pm on May 3, 2010 Permalink
    Tags: 30compat, ,   

    In preparation for 3.0, themes should wrap calls to next_post_link() and previous_post_link() in is_singular() conditionals if those functions are being used on index.php/archive views.

    See #10867 .

     
  • Ryan Boren 2:48 pm on April 19, 2010 Permalink
    Tags: 30compat,   

    This is a reminder that as per ticket 12416, 3.0 changes the escaping rules for the option, site option, transient, and site transient functions. Before, they were inconsistent in whether they expected slashed or unslashed data. As of 3.0, they all expect unslashed data. This means $_POST, $_GET, etc. data needs to be stripped before being passed and that data pulled from the DB does not need to be slashed before being passed back to one of these functions. Many (probably most) plugins weren’t properly following the inconsistent rules before so we decided to make it simple and clear and clean up the mess. Note that the slashing is not used for DB security. That is handled by our prepare() function and mysql_real_escape_string(). The slashing rules are back compat holdovers from the bad old days of magic quotes.

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel