Show a plugin in a wordpress install and check if it is installed

    name
        Wordpress plugin name

    path
        path to wordpress install location

    user
        user to run the command as

    CLI Example:

    .. code-block:: bash

        salt '*' wordpress.show_plugin HyperDB /var/www/html apache

def show_plugin(name, path, user):
    '''
    Show a plugin in a wordpress install and check if it is installed

    name
        Wordpress plugin name

    path
        path to wordpress install location

    user
        user to run the command as

    CLI Example:

    .. code-block:: bash

        salt '*' wordpress.show_plugin HyperDB /var/www/html apache
    '''
    ret = {'name': name}
    resp = __salt__['cmd.shell']((
        'wp --path={0} plugin status {1}'
    ).format(path, name), runas=user).split('\n')
    for line in resp:
        if 'Status' in line:
            ret['status'] = line.split(' ')[-1].lower()
        elif 'Version' in line:
            ret['version'] = line.split(' ')[-1].lower()
    return ret