: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
$value = $key === 'time' ? date( 'Y-m-d H:i:s', $value ) : $value;
$output .= $key . ': ' . $value . "</br>";
$output .= '## UPDATE NOTES: ## </br>';
$ctf_statuses_option = get_option( 'ctf_statuses', array() );
if ( ! empty( $ctf_statuses_option['first_cron_update'] ) ) {
$output .= 'First Cron Update: '. date( 'Y-m-d H:i:s', $ctf_statuses_option['first_cron_update'] ) .' ' . ($ctf_statuses_option['first_cron_update'] - time()) / HOUR_IN_SECONDS . ' hours';
if ( ! empty($ctf_statuses_option['smash_twitter_cron']['last_update_process_time']) ) {
$output .= 'Last Update: '. date( 'Y-m-d H:i:s', $ctf_statuses_option['smash_twitter_cron']['last_update_process_time'] ) . '';
public static function get_cron_report() {
$output = '## Cron Cache Report: ## </br>';
$cron_report = get_option( 'ctf_cron_report', array() );
if ( ! empty( $cron_report ) ) {
$output .= 'Time Ran: ' . esc_html( $cron_report['notes']['time_ran'] );
$output .= 'Found Feeds: ' . esc_html( $cron_report['notes']['num_found_transients'] );
foreach ( $cron_report as $key => $value ) {
if ( $key !== 'notes' ) {
$output .= esc_html( $key ) . ':';
if ( ! empty( $value['last_retrieve'] ) ) {
$output .= 'Last Retrieve: ' . esc_html( $value['last_retrieve'] );
if ( ! empty( $value['did_update'] ) ) {
$output .= 'Did Update: ' . esc_html( $value['did_update'] );
$output .= 'No Cron Report </br></br>';
$cron = _get_cron_array();
foreach ( $cron as $key => $data ) {
foreach ( $data as $key2 => $val ) {
if ( strpos( $key2, 'ctf' ) !== false || strpos( $key2, 'twitter' ) !== false ) {
$output .= esc_html( $key2 );
$output .= esc_html( date( 'Y-m-d H:i:s', $key ) );
$output .= esc_html( 'Next Scheduled: ' . round( ( (int) $key - time() ) / 60 ) . ' minutes' );
* Get Image Resizing Info
public static function get_image_resizing_info() {
public static function get_posts_table_info() {
$output = "## POSTS: ## </br>";
$table_name = esc_sql( $wpdb->prefix . CTF_POSTS_TABLE );
$feeds_posts_table_name = esc_sql( $wpdb->prefix . CTF_FEEDS_POSTS_TABLE );
if ( $wpdb->get_var( "show tables like '$feeds_posts_table_name'" ) != $feeds_posts_table_name ) {
$output .= 'no feeds posts table' . "</br>";
$last_result = $wpdb->get_results( "SELECT * FROM $feeds_posts_table_name ORDER BY id DESC LIMIT 1;" );
if ( is_array( $last_result ) && isset( $last_result[0] ) ) {
$output .= '## FEEDS POSTS TABLE ##' . "</br>";
foreach ( $last_result as $column ) {
foreach ( $column as $key => $value ) {
$output .= $key . ': ' . esc_html( $value ) . "</br>";;
$output .= 'feeds posts has no rows';
if ( $wpdb->get_var( "show tables like '$table_name'" ) != $table_name ) {
$output .= 'no posts table' . "</br>";
$last_result = $wpdb->get_results( "SELECT * FROM $table_name ORDER BY id DESC LIMIT 1;" );
if ( is_array( $last_result ) && isset( $last_result[0] ) ) {
$output .= '## POSTS TABLE ##';
foreach ( $last_result as $column ) {
foreach ( $column as $key => $value ) {
$output .= $key . ': ' . esc_html( $value ) . "</br>";;
$output .= 'posts has no rows' . "</br>";
public static function get_errors_info() {
$errors = get_option( 'ctf_errors', array() );
$output = "## ERRORS: ##" . "</br>";
if ( ! CTF_DOING_SMASH_TWITTER ) {
if ( ! empty( $errors ) ) {
foreach ( $errors as $error ) {
$output .= esc_html( $error ) . "</br>";
$output .= "No Error Information Stored</br>";
$ctf_statuses_option = get_option( 'ctf_statuses', array() );
if ( ! empty( $ctf_statuses_option['smash_twitter']['error_log'] ) ) {
$reversed = array_reverse( $ctf_statuses_option['smash_twitter']['error_log'] );
foreach ( $reversed as $error ) :
$output .= $error . "</br>";
public static function get_action_logs_info() {
$output = "## ACTION LOG ##" . "</br>";
global $sb_instagram_posts_manager;
$actions = $sb_instagram_posts_manager->get_action_log();
if ( ! empty( $actions ) ) :
foreach ( $actions as $action ) :
$output .= strip_tags($action) . "</br>";
public function get_support_url() {
$url = 'https://smashballoon.com/custom-twitter-feeds/support/';
$license_type = ctf_is_pro_version() ? 'pro' : 'free';
$license_key = ctf_encrypt_decrypt( 'encrypt', $license_key );
$args['license'] = $license_key;
$args['license_type'] = $license_type;
$args['version'] = CTF_VERSION;
$url = add_query_arg( $args, $url );
* SBI Export Feed Settings JSON
public function ctf_export_settings_json() {
\TwitterFeed\Builder\CTF_Feed_Builder::check_privilege();
if ( ! isset( $_GET['feed_id'] ) ) {
$feed_id = filter_var( $_GET['feed_id'], FILTER_SANITIZE_NUMBER_INT );
$feed = CTF_Feed_Saver_Manager::get_export_json( $feed_id );
$feed_info = CTF_Db::feeds_query( array('id' => $feed_id) );
$feed_name = strtolower( $feed_info[0]['feed_name'] );
$filename = 'ctf-feed-' . $feed_name . '.json';
// Creates a new csv file and store it in tmp directory
$file = fopen( '/tmp/' . $filename, 'w' );
// output headers so that the file is downloaded rather than displayed
header( "Content-type: application/json" );
header( "Content-disposition: attachment; filename = " . $filename );
readfile( "/tmp/" . $filename );
public static function get_whitespace( $times ) {
return str_repeat(' ', $times );
* Extensions Manager Page View Template
public function support_page(){
return CTF_View::render( 'support.index' );