Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/custom-t.../inc
File: CtfAdmin.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Class CtfAdmin
[2] Fix | Delete
*
[3] Fix | Delete
* Uses the Settings API to create easily customizable settings pages and tabs
[4] Fix | Delete
*/
[5] Fix | Delete
use TwitterFeed\CTF_GDPR_Integrations;
[6] Fix | Delete
use TwitterFeed\CTF_Feed_Locator;
[7] Fix | Delete
use TwitterFeed\Admin\CTF_Notifications;
[8] Fix | Delete
[9] Fix | Delete
[10] Fix | Delete
// Don't load directly
[11] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[12] Fix | Delete
die( '-1' );
[13] Fix | Delete
}
[14] Fix | Delete
[15] Fix | Delete
class CtfAdmin
[16] Fix | Delete
{
[17] Fix | Delete
public function __construct()
[18] Fix | Delete
{
[19] Fix | Delete
add_action( 'admin_menu', array( $this, 'add_menu' ) );
[20] Fix | Delete
add_action( 'admin_init', array( $this, 'ctf_current_user_can' ) );
[21] Fix | Delete
}
[22] Fix | Delete
[23] Fix | Delete
public function ctf_current_user_can( $cap ) {
[24] Fix | Delete
return ctf_current_user_can( $cap );
[25] Fix | Delete
}
[26] Fix | Delete
[27] Fix | Delete
public function add_menu()
[28] Fix | Delete
{
[29] Fix | Delete
$cap = ctf_get_manage_options_cap();
[30] Fix | Delete
$data_x_icon = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAzMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMjEuMTE2MSA2LjI3MzQ0SDI0LjIyODlMMTcuNDI4NCAxNC4wNDU5TDI1LjQyODYgMjQuNjIyNUgxOS4xNjQ1TDE0LjI1ODMgMTguMjA3OUw4LjY0NDQgMjQuNjIyNUg1LjUyOTc2TDEyLjgwMzUgMTYuMzA5TDUuMTI4OTEgNi4yNzM0NEgxMS41NTJMMTUuOTg2OCAxMi4xMzY3TDIxLjExNjEgNi4yNzM0NFpNMjAuMDIzNiAyMi43NTk0SDIxLjc0ODRMMTAuNjE0OCA4LjAzODcxSDguNzYzOUwyMC4wMjM2IDIyLjc1OTRaIiBmaWxsPSJibGFjayIvPjwvc3ZnPg==';
[31] Fix | Delete
[32] Fix | Delete
$notice = '';
[33] Fix | Delete
[34] Fix | Delete
$ctf_notifications = new CTF_Notifications();
[35] Fix | Delete
$notifications = $ctf_notifications->get();
[36] Fix | Delete
[37] Fix | Delete
$notice_bubble = '';
[38] Fix | Delete
if ( empty( $notice ) && ! empty( $notifications ) && is_array( $notifications ) ) {
[39] Fix | Delete
$notice_bubble = ' <span class="ctf-notice-alert"><span>'.count( $notifications ).'</span></span>';
[40] Fix | Delete
}
[41] Fix | Delete
[42] Fix | Delete
add_menu_page(
[43] Fix | Delete
__( 'Twitter Feeds', 'custom-twitter-feeds' ),
[44] Fix | Delete
__( 'Twitter Feeds', 'custom-twitter-feeds' ). $notice_bubble . $notice,
[45] Fix | Delete
$cap,
[46] Fix | Delete
'custom-twitter-feeds',
[47] Fix | Delete
'sb_twitter_settings_page',
[48] Fix | Delete
ctf_should_rebrand_to_x() ? $data_x_icon : 'dashicons-twitter'
[49] Fix | Delete
);
[50] Fix | Delete
[51] Fix | Delete
add_submenu_page(
[52] Fix | Delete
'custom-twitter-feeds',
[53] Fix | Delete
__( 'Upgrade to Pro', 'custom-twitter-feeds' ),
[54] Fix | Delete
__( '<span class="ctf_get_pro">Upgrade to Pro</span>', 'custom-twitter-feeds' ),
[55] Fix | Delete
$cap,
[56] Fix | Delete
'https://smashballoon.com/custom-twitter-feeds/demo/?utm_campaign=twitter-free&utm_source=menu-link&utm_medium=upgrade-link',
[57] Fix | Delete
''
[58] Fix | Delete
);
[59] Fix | Delete
[60] Fix | Delete
//Show a Instagram plugin menu item if it isn't already installed
[61] Fix | Delete
if( !is_plugin_active( 'instagram-feed/instagram-feed.php' ) && !is_plugin_active( 'instagram-feed-pro/instagram-feed.php' ) ){
[62] Fix | Delete
add_submenu_page(
[63] Fix | Delete
'custom-twitter-feeds',
[64] Fix | Delete
__( 'Instagram Feed', 'custom-twitter-feeds' ),
[65] Fix | Delete
'<span class="ctf_get_sbi">' . __( 'Instagram Feed', 'custom-twitter-feeds' ) . '</span>',
[66] Fix | Delete
'manage_options',
[67] Fix | Delete
'admin.php?page=custom-twitter-feeds&tab=more',
[68] Fix | Delete
''
[69] Fix | Delete
);
[70] Fix | Delete
}
[71] Fix | Delete
[72] Fix | Delete
//Show a Instagram plugin menu item if it isn't already installed
[73] Fix | Delete
if( !is_plugin_active( 'custom-facebook-feed/custom-facebook-feed.php' ) && !is_plugin_active( 'custom-facebook-feed-pro/custom-facebook-feed.php' ) ){
[74] Fix | Delete
add_submenu_page(
[75] Fix | Delete
'custom-twitter-feeds',
[76] Fix | Delete
__( 'Facebook Feed', 'custom-twitter-feeds' ),
[77] Fix | Delete
'<span class="ctf_get_cff">' . __( 'Facebook Feed', 'custom-twitter-feeds' ) . '</span>',
[78] Fix | Delete
'manage_options',
[79] Fix | Delete
'admin.php?page=custom-twitter-feeds&tab=more',
[80] Fix | Delete
''
[81] Fix | Delete
);
[82] Fix | Delete
}
[83] Fix | Delete
[84] Fix | Delete
//Show a YouTube plugin menu item if it isn't already installed
[85] Fix | Delete
if( !is_plugin_active( 'feeds-for-youtube/youtube-feed.php' ) && !is_plugin_active( 'youtube-feed-pro/youtube-feed.php' ) ){
[86] Fix | Delete
add_submenu_page(
[87] Fix | Delete
'custom-twitter-feeds',
[88] Fix | Delete
__( 'YouTube Feed', 'custom-twitter-feeds' ),
[89] Fix | Delete
'<span class="ctf_get_yt">' . __( 'YouTube Feed', 'custom-twitter-feeds' ) . '</span>',
[90] Fix | Delete
'manage_options',
[91] Fix | Delete
'admin.php?page=custom-twitter-feeds&tab=more',
[92] Fix | Delete
''
[93] Fix | Delete
);
[94] Fix | Delete
}
[95] Fix | Delete
}
[96] Fix | Delete
[97] Fix | Delete
[98] Fix | Delete
public static function get_active_tab( $tab = '' )
[99] Fix | Delete
{
[100] Fix | Delete
return 'configure';
[101] Fix | Delete
}
[102] Fix | Delete
[103] Fix | Delete
public function access_token_button()
[104] Fix | Delete
{
[105] Fix | Delete
$this->the_admin_access_token_configure_html( $_GET );
[106] Fix | Delete
$options = get_option( 'ctf_options' );
[107] Fix | Delete
$option_checked = ( isset( $options['have_own_tokens'] ) ) ? $options['have_own_tokens'] : false;
[108] Fix | Delete
?>
[109] Fix | Delete
<input name="<?php echo 'ctf_options'.'[have_own_tokens]'; ?>" id="ctf_have_own_tokens" type="checkbox" <?php if ( $option_checked ) echo "checked"; ?> />
[110] Fix | Delete
<label for="ctf_have_own_tokens" class="ctf_checkbox"><?php _e( 'Or, manually enter my own Twitter app information' ); ?></label>
[111] Fix | Delete
<span class="ctf-tooltip-wrap">
[112] Fix | Delete
<a class="ctf-tooltip-link" href="JavaScript:void(0);"><i class="fa fa-question-circle" aria-hidden="true"></i></a>
[113] Fix | Delete
<p class="ctf-tooltip ctf-more-info"><?php _e( 'Check this box if you would like to manually enter the information from your own <a href="https://smashballoon.com/custom-twitter-feeds/docs/create-twitter-app/?utm_campaign=twitter-free&utm_source=settings&utm_medium=createownapp" target="_blank">Twitter app</a>', 'custom-twitter-feeds' ); ?>.</p>
[114] Fix | Delete
</span>
[115] Fix | Delete
<?php
[116] Fix | Delete
}
[117] Fix | Delete
[118] Fix | Delete
/**
[119] Fix | Delete
* generates the html for the access token retrieving button
[120] Fix | Delete
*
[121] Fix | Delete
* @param $access_token_data array the $_GET data if it exists
[122] Fix | Delete
*/
[123] Fix | Delete
private function the_admin_access_token_configure_html( $access_token_data ) {
[124] Fix | Delete
?>
[125] Fix | Delete
[126] Fix | Delete
<div id="ctf_config">
[127] Fix | Delete
[128] Fix | Delete
<?php if ( isset( $access_token_data['oauth_token'] ) ) : ?>
[129] Fix | Delete
<a href="<?php echo OAUTH_PROCESSOR_URL . admin_url( 'admin.php?page=custom-twitter-feeds' ); ?>" id="ctf-get-token"><i class="fa fa-twitter"></i><?php _e( 'Log in to Twitter and get my Access Token and Secret' ); ?></a>
[130] Fix | Delete
<a class="ctf-tooltip-link" href="https://smashballoon.com/custom-twitter-feeds/token/?utm_campaign=twitter-free&utm_source=settings&utm_medium=buttonnotworking" target="_blank"><?php _e( "Button not working?", 'custom-twitter-feeds' ); ?></a>
[131] Fix | Delete
[132] Fix | Delete
<input type="hidden" id="ctf-retrieved-access-token" value="<?php echo esc_html( sanitize_text_field( $access_token_data['oauth_token'] ) ); ?>">
[133] Fix | Delete
<input type="hidden" id="ctf-retrieved-access-token-secret" value="<?php echo esc_html( sanitize_text_field( $access_token_data['oauth_token_secret'] ) ); ?>">
[134] Fix | Delete
<input type="hidden" id="ctf-retrieved-default-screen-name" value="<?php echo esc_html( sanitize_text_field( $access_token_data['screen_name'] ) ); ?>">
[135] Fix | Delete
[136] Fix | Delete
<?php elseif ( isset( $access_token_data['error'] ) && ! isset( $access_token_data['oauth_token'] ) ) : ?>
[137] Fix | Delete
[138] Fix | Delete
<p class="ctf_error_notice"><?php _e( 'There was an error with retrieving your access tokens. Please <a href="https://smashballoon.com/custom-twitter-feeds/token/?utm_campaign=twitter-free&utm_source=settings&utm_medium=errorconnecting" target="_blank">use this tool</a> to get your access token and secret.' ); ?></p><br>
[139] Fix | Delete
<a href="<?php echo OAUTH_PROCESSOR_URL . admin_url( 'admin.php?page=custom-twitter-feeds' ); ?>" id="ctf-get-token"><i class="fa fa-twitter"></i><?php _e( 'Log in to Twitter and get my Access Token and Secret' ); ?></a>
[140] Fix | Delete
<a class="ctf-tooltip-link" href="https://smashballoon.com/custom-twitter-feeds/token/?utm_campaign=twitter-free&utm_source=settings&utm_medium=errorconnecting" target="_blank"><?php _e( "Button not working?", 'custom-twitter-feeds' ); ?></a>
[141] Fix | Delete
[142] Fix | Delete
<?php else : ?>
[143] Fix | Delete
[144] Fix | Delete
<a href="<?php echo OAUTH_PROCESSOR_URL . admin_url( 'admin.php?page=custom-twitter-feeds' ); ?>" id="ctf-get-token"><i class="fa fa-twitter"></i><?php _e( 'Log in to Twitter and get my Access Token and Secret' ); ?></a>
[145] Fix | Delete
<a class="ctf-tooltip-link" href="https://smashballoon.com/custom-twitter-feeds/token/?utm_campaign=twitter-free&utm_source=settings&utm_medium=buttonnotworking" target="_blank"><?php _e( "Button not working?", 'custom-twitter-feeds' ); ?></a>
[146] Fix | Delete
[147] Fix | Delete
<?php endif; ?>
[148] Fix | Delete
[149] Fix | Delete
</div>
[150] Fix | Delete
<?php
[151] Fix | Delete
}
[152] Fix | Delete
}
[153] Fix | Delete
[154] Fix | Delete
function sb_twitter_settings_page() {
[155] Fix | Delete
$link = admin_url( 'admin.php?page=ctf-settings' );
[156] Fix | Delete
?>
[157] Fix | Delete
<div id="ctf_admin">
[158] Fix | Delete
<div class="ctf_notice">
[159] Fix | Delete
<strong><?php esc_html_e( 'The Twitter Feed Settings page has moved!', 'custom-twitter-feeds' ); ?></strong>
[160] Fix | Delete
<a href="<?php echo esc_url( $link ); ?>"><?php esc_html_e( 'Click here to go to the new page.', 'custom-twitter-feeds' ); ?></a>
[161] Fix | Delete
</div>
[162] Fix | Delete
</div>
[163] Fix | Delete
<?php
[164] Fix | Delete
}
[165] Fix | Delete
[166] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function