Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Jezze

    (@jezze)

    I was able to implement the feature in your plugin. I changed the function wpuxss_eml_post_mime_types() in mime-types.php to this.

    function wpuxss_eml_post_mime_types( $post_mime_types )
    {
      $wpuxss_eml_mimes = get_option('wpuxss_eml_mimes');
    
      if ( !empty($wpuxss_eml_mimes) )
      {
        $mineGroups = array();
        foreach ( $wpuxss_eml_mimes as $type => $mime )
        {
          if ( $mime['filter'] == 1 )
          {
            $key = $mime['singular'];
            if ( !isset($mineGroups[$key]) )
            {
              $mineGroups[$key] = array(
                  'singular' => $mime['singular'],
                  'plural' => $mime['plural'],
                  'mime' => $mime['mime'],
              );
            }
            else
            {
              $mineGroups[$key]['mime'] .= ',' . $mime['mime'];
            }
          }
        }
    
        if ( !empty($mineGroups) )
        {
          foreach ( $mineGroups as $type => $mineGroup )
          {
            $post_mime_types[$mineGroup['mime']] = array(
              __($mineGroup['singular']),
              __('Manage ' . $mineGroup['singular']),
              _n_noop($mineGroup['singular'] . ' <span class="count">(%s)</span>', $mineGroup['plural'] . ' <span class="count">(%s)</span>')
            );
          }
        }
      }
    
      return $post_mime_types;
    }

    Basically it creates comma separated MIME-type keys in $post_mime_types, which should work according to this blog http://ageekandhisblog.com/wordpress-how-to-add-more-upload-categories-filter/

    But unfortunately, there seems to be a bug (?) in /wp-admin/includes/class-wp-media-list-table.php in function get_views() and I had to change a few lines, which would be a quite bad requirement for the plugin. Anyway, I changed the following lines.

    $matches = wp_match_mime_types(array_keys($post_mime_types), array_keys($_num_posts));

    to

    $post_mime_types_piped = array_keys($post_mime_types);
    foreach ($post_mime_types_piped as $key => $value)
      $post_mime_types_piped[$key] = str_replace(",", "|", $value);
    
    $matches = wp_match_mime_types($post_mime_types_piped, array_keys($_num_posts));

    and

    if ( !empty( $num_posts[$mime_type] ) )
      $type_links[$mime_type] = "<a href='upload.php?post_mime_type=$mime_type'$class>" . sprintf( translate_nooped_plural( $label[2], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '</a>';

    to

    $mime_type_piped = str_replace(',', '|', $mime_type);
    
    if ( !empty( $num_posts[$mime_type_piped] ) )
      $type_links[$mime_type] = "<a href='upload.php?post_mime_type=$mime_type'$class>" . sprintf( translate_nooped_plural( $label[2], $num_posts[$mime_type_piped] ), number_format_i18n( $num_posts[$mime_type_piped] )) . '</a>';

    I hope this will help you.

    Thread Starter Jezze

    (@jezze)

    Mostly I use the visual editor, but this time I also checked if some mark-up was placed around the URL in the text view.

    Anyway, I found the problem. It has nothing to do with WordPress itself. The problem was myself… I served my blog over HTTPS and Firefox as most browsers do not allow embedded plain HTTP content within pages served over HTTPS.

    Maybe WordPress should check if the blog is served over HTTPS and adjust the URL of embedded content if possible.

    Thanks for trying to help and sorry for my dump mistake.

    I have the same problem and no other plugin is causing it. WordPress just creates an iframe with src=”http://…&#8221;, but it should be https.

    Thread Starter Jezze

    (@jezze)

    I could trace the problem back to .\inc\core\data.php line 2092.

    ‘values’ => Su_Tools::get_users()

    The stacktrace is the following:

    do_action(‘init’), Shortcodes_Ultimate::register(), Su_Data::shortcodes(), Su_Tools::get_users(), get_users(), WP_User_Query->__construct(), WP_User_Query->query(), WP_User->__construct(), WP_User->init(), WP_User->for_blog(), WP_User->_init_caps(), get_user_meta(), get_metadata(), update_meta_cache()

    Thread Starter Jezze

    (@jezze)

    Some additional info.

    My blog/bbpress has nearly than 3000 users and for each of them the following query will be executed every time the website is loaded.

    SELECT user_id, meta_key, meta_value
    FROM wp_usermeta
    WHERE user_id IN (<user_id>)

    Thread Starter Jezze

    (@jezze)

    Thanks for your quick response. I submitted an enhancement request.

Viewing 6 replies - 1 through 6 (of 6 total)