ob_clean example


        register_shutdown_function(function D): void {
            $lastError = error_get_last();
            if (!\is_array($lastError)) {
                return;
            }

            switch ($lastError['type']) {
                case E_ERROR:
                case E_PARSE:
                case E_CORE_ERROR:
                    ob_clean();
                    ob_flush();
                    http_response_code(200);
                    $message = 'Error<br><br>' . $lastError['message'] . '<br><br>File:' . str_replace('/', '/ ', $lastError['file']);
                    echo json_encode(['success' => false, 'error' => $message]);
            }
        });
    }

    /** * Gets an array of plugins that are in Safe Mode * * @param array<Plugin> $plugins * * @return array<Plugin> */
wp_redirect(
            add_query_arg(
                '_error_nonce',
                wp_create_nonce( 'plugin-resume-error_' . $plugin ),
                $redirect
            )
        );

        // Load the plugin to test whether it throws a fatal error.         ob_start();
        plugin_sandbox_scrape( $plugin );
        ob_clean();
    }

    list( $extension ) = explode( '/', $plugin );

    $result = wp_paused_plugins()->delete( $extension );

    if ( ! $result ) {
        return new WP_Error(
            'could_not_resume_plugin',
            __( 'Could not resume the plugin.' )
        );
    }
wp_create_nonce( 'theme-resume-error_' . $theme ),
                    $redirect
                )
            );

            // Load the theme's functions.php to test whether it throws a fatal error.             ob_start();
            if ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) {
                define( 'WP_SANDBOX_SCRAPING', true );
            }
            include $functions_path;
            ob_clean();
        }
    }

    $result = wp_paused_themes()->delete( $extension );

    if ( ! $result ) {
        return new WP_Error(
            'could_not_resume_theme',
            __( 'Could not resume the theme.' )
        );
    }

    
Home | Imprint | This part of the site doesn't use cookies.