WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 2 months ago

#44374 new defect (bug)

Remove deprecated contact methods

Reported by: butterflymedia Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.9.6
Component: Users Keywords: needs-patch
Focuses: Cc:

Description

AIM is dead (December 15, 2017), Yahoo Messenger will be shut down on July 17, 2018. I'm not sure about Google Talk, I think it's been retired a long time ago. In May 2013, Hangouts replaced Google Talk.

The way people are managing the contact methods nowadays is:

<?php
function cinnamon_extra_contact_info($contactmethods) {
    // Remove default contact methods
    unset($contactmethods['aim']);
    unset($contactmethods['yim']);
    unset($contactmethods['jabber']);

    // Add extra contact methods
    $contactmethods['facebook'] = 'Facebook';
    $contactmethods['twitter'] = 'Twitter';
    $contactmethods['googleplus'] = 'Google+';

    return $contactmethods;
}

add_filter('user_contactmethods', 'cinnamon_extra_contact_info');

All three of them need to be removed.

Change History (7)

#1 follow-up: @birgire
2 years ago

@butterflymedia wasn't this covered in #11541 and e.g. [23588] ?

#2 in reply to: ↑ 1 @butterflymedia
2 years ago

Replying to birgire:

@butterflymedia wasn't this covered in #11541 and e.g. [23588] ?

One of the tickets is 5 years old and the other one had no resolution. All IM networks are still in core in 2018, when none of them is relevant anymore.

#3 follow-up: @butterflymedia
2 years ago

And what is [23588] doing? Why is it checking get_site_option('initial_db_version')? What is that version for?

#4 in reply to: ↑ 3 @birgire
2 years ago

Replying to butterflymedia:

And what is [23588] doing? Why is it checking get_site_option('initial_db_version')? What is that version for?

As I understand it:

$wp_db_version, defined in wp-includes/version.php, is the latest committed revision number from the WordPress Trac, for changes that matters to the database schema.

The initial_db_version option stores the value of $wp_db_version when the WordPress is installed.

So checking get_site_option('initial_db_version') < 23588 is to ensure backward compatibility, that only activates these deprecated user contacts, for installs made before the deprecated change was made when $wp_db_version was 23588.

ps: I hope I'm not misunderstanding the ticket, but I think it would be helpful to refer to the core code that should be removed. Thanks.

#5 follow-up: @Presskopp
2 months ago

As far as I understand this I'd say we could at least empty out the function wp_get_user_contact_methods(), meaning to delete the complete if statement in user.php, Line 2210:

function wp_get_user_contact_methods( $user = null ) {
	$methods = array();
	if ( get_site_option( 'initial_db_version' ) < 23588 ) {
		$methods = array(
			'aim'    => __( 'AIM' ),
			'yim'    => __( 'Yahoo IM' ),
			'jabber' => __( 'Jabber / Google Talk' ),
		);
	}

#6 in reply to: ↑ 5 @butterflymedia
2 months ago

Replying to Presskopp:

As far as I understand this I'd say we could at least empty out the function wp_get_user_contact_methods(), meaning to delete the complete if statement in user.php, Line 2210:

function wp_get_user_contact_methods( $user = null ) {
	$methods = array();
	if ( get_site_option( 'initial_db_version' ) < 23588 ) {
		$methods = array(
			'aim'    => __( 'AIM' ),
			'yim'    => __( 'Yahoo IM' ),
			'jabber' => __( 'Jabber / Google Talk' ),
		);
	}

It's been a while since this ticket has been opened, but the general idea is to completely remove all references to aim, yim and jabber from the codebase.

#7 @Presskopp
2 months ago

That would mean to strip it also from get_the_author_meta(), as seen in author-template.php

(Valid values for the $field parameter)

That's all - nowhere else they are to find.

Note: See TracTickets for help on using tickets.