WordPress.org

Support

Support » Plugins and Hacks » [Plugin: W3 Total Cache] WordPress 3.0 Media Import

[Plugin: W3 Total Cache] WordPress 3.0 Media Import

  • Hi. I’ve been playing with the plugin on a WordPress 3.0 install, and ran into a problem with the media import. I believe I traced it back to the update in WordPress to jQuery 1.4, which has stricter checking in place for JSON returns. The problem is that there are currently unquoted strings being returned by the import handler. I’m not listing this as a bug, because 3.0 isn’t released yet, nor does the plugin claim support for that version. However, for those living on the bleeding edge, here’s a diff to get things working again (applied to /lib/W3/Plugin/Cdn.php)

    @@ -2035,11 +2035,11 @@
    
             @$w3_plugin_cdn->import_library($limit, $offset, $count, $total, $results);
    
    -        echo sprintf("{limit: %d, offset: %d, count: %d, total: %s, results: [\r\n", $limit, $offset, $count, $total);
    +        echo sprintf("{\"limit\": %d, \"offset\": %d, \"count\": %d, \"total\": %s, \"results\": [\r\n", $limit, $offset, $count, $total);
    
             $results_count = count($results);
             foreach ($results as $index => $result) {
    -            echo sprintf("\t{src: '%s', dst: '%s', result: %d, error: '%s'}", addslashes($result['src']), addslashes($result['dst']), addslashes($result['result']), addslashes($result['error']));
    +            echo sprintf("\t{\"src\": \"%s\", \"dst\": \"%s\", \"result\": %d, \"error\": \"%s\"}", addslashes($result['src']), addslashes($result['dst']), addslashes($result['result']), addslashes($result['error']));
                 if ($index < $results_count - 1) {
                     echo ',';
                 }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: W3 Total Cache] WordPress 3.0 Media Import’ is closed to new replies.
Skip to toolbar