• Resolved AndyHenderson

    (@andyhenderson)


    In my error log I see multiple (lots) of each of the following having tried to navigate the new UI:

    [08-Feb-2025 10:11:17 UTC] PHP Warning: Cannot modify header information – headers already sent by (output started at /homepages/1/d937068188/htdocs/clickandbuilds/CycleHayling/wp-content/plugins/backwpup/inc/Utils/BackWPupHelpers.php:73) in /homepages/1/d937068188/htdocs/clickandbuilds/CycleHayling/wp-includes/rest-api/class-wp-rest-server.php on line 1893

    [08-Feb-2025 10:12:06 UTC] PHP Warning: Undefined variable $unique_backups in /homepages/1/d937068188/htdocs/clickandbuilds/CycleHayling/wp-content/plugins/backwpup/inc/class-wp-api.php on line 610
    [08-Feb-2025 10:12:06 UTC] PHP Fatal error: Uncaught TypeError: usort(): Argument #1 ($array) must be of type array, null given in /homepages/1/d937068188/htdocs/clickandbuilds/CycleHayling/wp-content/plugins/backwpup/inc/class-wp-api.php:618
    Stack trace:
    #0 /homepages/1/d937068188/htdocs/clickandbuilds/CycleHayling/wp-content/plugins/backwpup/inc/class-wp-api.php(618): usort()
    #1 /homepages/1/d937068188/htdocs/clickandbuilds/CycleHayling/wp-includes/rest-api/class-wp-rest-server.php(1292): BackWPup_WP_API->get_backups_list()
    #2 /homepages/1/d937068188/htdocs/clickandbuilds/CycleHayling/wp-includes/rest-api/class-wp-rest-server.php(1125): WP_REST_Server->respond_to_request()
    #3 /homepages/1/d937068188/htdocs/clickandbuilds/CycleHayling/wp-includes/rest-api/class-wp-rest-server.php(439): WP_REST_Server->dispatch()
    #4 /homepages/1/d937068188/htdocs/clickandbuilds/CycleHayling/wp-includes/rest-api.php(449): WP_REST_Server->serve_request()
    #5 /homepages/1/d937068188/htdocs/clickandbuilds/CycleHayling/wp-includes/class-wp-hook.php(324): rest_api_loaded()
    #6 /homepages/1/d937068188/htdocs/clickandbuilds/CycleHayling/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #7 /homepages/1/d937068188/htdocs/clickandbuilds/CycleHayling/wp-includes/plugin.php(565): WP_Hook->do_action()
    #8 /homepages/1/d937068188/htdocs/clickandbuilds/CycleHayling/wp-includes/class-wp.php(418): do_action_ref_array()
    #9 /homepages/1/d937068188/htdocs/clickandbuilds/CycleHayling/wp-includes/class-wp.php(813): WP->parse_request()
    #10 /homepages/1/d937068188/htdocs/clickandbuilds/CycleHayling/wp-includes/functions.php(1336): WP->main()
    #11 /homepages/1/d937068188/htdocs/clickandbuilds/CycleHayling/wp-blog-header.php(16): wp()
    #12 /homepages/1/d937068188/htdocs/clickandbuilds/CycleHayling/index.php(17): require(‘/homepages/1/d9…’)
    #13 {main}
    thrown in /homepages/1/d937068188/htdocs/clickandbuilds/CycleHayling/wp-content/plugins/backwpup/inc/class-wp-api.php on line 618

    Let me know if I can provide more diagnostics,

    Andy

Viewing 9 replies - 1 through 9 (of 9 total)
  • jaeger

    (@jaegerschnitzel)

    Same for me but only for users with “Editor” role. Very strange.

    Thread Starter AndyHenderson

    (@andyhenderson)

    Even more bizarre, I found out what text is being echoed at line 73 in backwpup/inc/Utils/BackWPupHelpers.php:

    <div class="flex items-center gap-2 p-4 rounded bg-alert-light text-alert">
    <br/>
    <div class="shrink-0">
    <br/>
    <svg width="32" height="32" viewBox="0 0 30 32" fill="none" xmlns="http://www.w3.org/2000/svg">
    <br/>
    <path d="M24.8438 7.9375C25.6875 8.3125 26.25 9.10938 26.25 10C26.25 22 17.3906 28 14.9531 28C12.6094 28 3.75 22.0938 3.75 10C3.75 9.10938 4.26562 8.3125 5.10938 7.9375L14.1094 4.1875C14.3438 4.09375 14.7188 4 15 4C15.2344 4 15.6094 4.09375 15.8438 4.1875L24.8438 7.9375ZM14.9531 25.75C18.0938 24.4844 24 19.5156 24 10L15 6.29688C14.9531 6.29688 14.9531 6.29688 14.9062 6.29688L6 10.0469C6 18.25 10.6406 23.9688 14.9531 25.75ZM13.875 11.125C13.875 10.5156 14.3438 10 15 10C15.6094 10 16.125 10.5156 16.125 11.125V16.375C16.125 17.0313 15.6094 17.5 15 17.5C14.3438 17.5 13.875 17.0313 13.875 16.375V11.125ZM15 19C15.7969 19 16.5 19.7031 16.5 20.5C16.5 21.3438 15.7969 22 15 22C14.1562 22 13.5 21.3438 13.5 20.5C13.5 19.7031 14.1562 19 15 19Z" fill="currentColor" />
    <br/>
    </svg> </div>
    <br/>
    <div class="flex flex-col gap-1">
    <br/>
    <p class="text-xs font-medium">
    <br/>
    Not authenticated! </p>
    <br/>
    </div>
    <br/>
    </div>
    <br/>

    Apparently, it’s telling me I’m not authenticated to something even though I’m a site admin.

    Thread Starter AndyHenderson

    (@andyhenderson)

    The error in class-wp-api.php is a missing:

    $unique_backups = array();

    before line 603. I guess it happens only if it can’t see any existing backups.

    Plugin Support BackWPUp Support

    (@saranshwpm)

    Hi @andyhenderson,

    The warnings might be related to latest PHP version.

    Can you please let us know the PHP version you are on and maybe also try downgrading to see if it helps?

    Best Regards,

    Thread Starter AndyHenderson

    (@andyhenderson)

    Not a PHP version issue. The above problems were fixed by 5.03. Nothing else changed at my end. 5.03 even implemented the fix I suggested for class-wp-api.php.

    Andy

    Plugin Support BackWPUp Support

    (@saranshwpm)

    Hi,

    Thank you so much for confirming.

    I appreciate it.

    Best Regards,

    Thread Starter AndyHenderson

    (@andyhenderson)

    I’m afraid I was wrong about the 5.03 update. It hasn’t fixed either problem.

    Our PHP version is 8.1.31 and WordPress is 6.7.1.

    The previous version worked fine under that configuration.

    Andy

    The array definition is still missing in 5.0.3 in /inc/class-wp-api.php

    599: }
    600: foreach ( $backups as $item ) {
    601: $key = $item['stored_on'] . '|' . $item['filename'];
    602: if ( ! isset( $seen[ $key ] ) ) {
    603: $seen[ $key ] = true;
    604: $unique_backups[] = $item;
    605: }
    606: }
    607: $backups = $unique_backups;

    Possible fix could be e.g. in line 600:

    599: }
    600: $unique_backups = array();
    601: foreach ( $backups as $item ) {
    602: $key = $item['stored_on'] . '|' . $item['filename'];
    603: if ( ! isset( $seen[ $key ] ) ) {
    604: $seen[ $key ] = true;
    605: $unique_backups[] = $item;
    606: }
    607: }
    608: $backups = $unique_backups;
    Plugin Support BackWPUp Support

    (@saranshwpm)

    Hi,

    Thank you for pointing this out. We’ve taken this as an improvement suggestion and passed it along to the development team for review. It is expected to fixed in the next release.

    We appreciate your feedback and attention to detail. Let us know if there’s anything else we can assist with.

    Best regards.

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.