I changed the constants which the old script was suggesting (DYNAMIC_OUTPUT_BUFFER_TAG, DYNAMIC_OB_TEXT) to something else and everything worked perfectly.
See below:
define( 'DYN_TAG', 'CONST_TAG' ); // Change this to a secret placeholder tag
if ( DYN_TAG != '' ) {
if (!function_exists(dynamic_output_buffer_test)) {
function dynamic_output_buffer_test( $cachedata = 0) {
if ( defined( 'DYN_OB_TEXT' ) )
return str_replace( DYN_TAG, DYN_OB_TEXT, $cachedata );
ob_start();
{do your thing here and you will get dynamic results}
ob_end_clean();
if ( $cachedata === 0 ) {
define( 'DYN_OB_TEXT', $text );
} else {return str_replace( DYN_TAG, $text, $cachedata );}
}
}
add_cacheaction( 'wpsc_cachedata', 'dynamic_output_buffer_test' );
if (!function_exists(dynamic_output_buffer_init)) {
function dynamic_output_buffer_init() {
add_action( 'wp_footer', 'dynamic_output_buffer_test' );
}
}
add_cacheaction( 'add_cacheaction', 'dynamic_output_buffer_init' );
if (!function_exists(dynamic_output_buffer_test_safety)) {
function dynamic_output_buffer_test_safety( $safety ) {
if ( defined( 'DYN_OB_TEXT' ) ) {return 1;} else {return 0;}
}
}
add_cacheaction( 'wpsc_cachedata_safety', 'dynamic_output_buffer_test_safety' );
}