• Resolved rex75

    (@rex75)


    Unable to fetch a list of attachment IDs to process from the WordPress REST API. You can check your browser’s console for details.

    Console:

    JQMIGRATE: Migrate is installed, version 1.4.1
    build.js?ver=3.0.0:1 Regenerate Thumbnails: Error getting the total attachment count. Object parsererror SyntaxError: Unexpected token < in JSON at position 0
        at JSON.parse (<anonymous>)
        at n.parseJSON (load-scripts.php:4)
        at a.parseJSON (load-scripts.php:9)
        at Xb (load-scripts.php:4)
        at y (load-scripts.php:4)
        at XMLHttpRequest.c (load-scripts.php:4)
    build.js?ver=3.0.0:1 Regenerate Thumbnails: Error getting the total featured images count. Object parsererror SyntaxError: Unexpected token < in JSON at position 0
        at JSON.parse (<anonymous>)
        at n.parseJSON (load-scripts.php:4)
        at a.parseJSON (load-scripts.php:9)
        at Xb (load-scripts.php:4)
        at y (load-scripts.php:4)
        at XMLHttpRequest.c (load-scripts.php:4)
    build.js?ver=3.0.0:1 Regenerate Thumbnails: Error getting a chunk of thumbnail IDs to process. Object parsererror SyntaxError: Unexpected token < in JSON at position 0
        at JSON.parse (<anonymous>)
        at n.parseJSON (load-scripts.php:4)
        at a.parseJSON (load-scripts.php:9)
        at Xb (load-scripts.php:4)
        at y (load-scripts.php:4)
        at XMLHttpRequest.c (load-scripts.php:4)
    build.js?ver=3.0.0:1 Regenerate Thumbnails: Error getting a chunk of thumbnail IDs to process. Object parsererror SyntaxError: Unexpected token < in JSON at position 0
        at JSON.parse (<anonymous>)
        at n.parseJSON (load-scripts.php:4)
        at a.parseJSON (load-scripts.php:9)
        at Xb (load-scripts.php:4)
        at y (load-scripts.php:4)
        at XMLHttpRequest.c (load-scripts.php:4)
    build.js?ver=3.0.0:1 Regenerate Thumbnails: Error getting a chunk of thumbnail IDs to process. Object parsererror SyntaxError: Unexpected token < in JSON at position 0
        at JSON.parse (<anonymous>)
        at n.parseJSON (load-scripts.php:4)
        at a.parseJSON (load-scripts.php:9)
        at Xb (load-scripts.php:4)
        at y (load-scripts.php:4)
        at XMLHttpRequest.c (load-scripts.php:4)
Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter rex75

    (@rex75)

    Version 3.0.0

    I am seeing this as well. When I go to the Media section of the Dashboard and regenerate an image one by one, it appears to work.

    Plugin Contributor Alex Mills

    (@viper007bond)

    Looks like you might be getting a PHP error.

    What happens when you visit this URL?

    yoursite.com/wp-json/wp/v2/media?page=1&per_page=25&_fields=id&is_regeneratable=1&exclude_site_icons=1&orderby=id&order=asc

    Hope it will be usefull.
    My function.php contains next lines

    remove_action( 'init',          'rest_api_init' ) // remove this line;
    remove_action( 'rest_api_init', 'rest_api_default_filters', 10, 1 );
    remove_action( 'parse_request', 'rest_api_loaded' ) // remove this line;

    After i commented the 1st and 3rd lines the error “Unable to fetch a list…” was solved

    Plugin Contributor Alex Mills

    (@viper007bond)

    Yeah, my plugin as well as WordPress itself uses the REST API. You should not completely disable it.

    If you wish to restrict access to the REST API, then use the rest_authentication_errors filter to restrict it to logged in users:

    https://maddisondesigns.com/2016/12/what-you-may-not-know-about-the-wp-rest-api/

    Thread Starter rex75

    (@rex75)

    Sorry for the late reply.

    I updated to 3.0.1, same error.

    I tried your link mentioned aboved and got a error from my self written theme and plugin.

    Changed

    if(is_plugin_active("blabla"))

    to

    if(function_exists("is_plugin_active") && is_plugin_active("blabla"))

    Now your plugin works. It was not your fault, it was mine. 🙁

    Your link again presents a correct result.

    Thread Starter rex75

    (@rex75)

    I did the changes in my self written plugin and theme of course.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Unable to fetch a list of attachment IDs to process from the WordPress REST API.’ is closed to new replies.