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/SmashTwi.../Services
File: ErrorReporterService.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Class ErrorReporterService
[2] Fix | Delete
*
[3] Fix | Delete
* Tracks errors and creates messages.
[4] Fix | Delete
*
[5] Fix | Delete
* @since 2.2.2
[6] Fix | Delete
*/
[7] Fix | Delete
namespace TwitterFeed\SmashTwitter\Services;
[8] Fix | Delete
[9] Fix | Delete
class ErrorReporterService {
[10] Fix | Delete
[11] Fix | Delete
public function init_hooks() {
[12] Fix | Delete
add_action( 'ctf_before_feed_start', array( $this, 'maybe_add_error_html' ), 10, 1 );
[13] Fix | Delete
add_action( 'ctf_before_feed_start', array( $this, 'maybe_show_visitor_notice' ), 10, 1 );
[14] Fix | Delete
[15] Fix | Delete
}
[16] Fix | Delete
[17] Fix | Delete
public function maybe_add_error_html( $ctf_feed ) {
[18] Fix | Delete
if ( ! ctf_current_user_can( 'manage_twitter_feed_options' ) ) {
[19] Fix | Delete
return;
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
if ( empty( $ctf_feed->error_report ) ) {
[23] Fix | Delete
return;
[24] Fix | Delete
}
[25] Fix | Delete
[26] Fix | Delete
$maybe_critical = $ctf_feed->error_report->get_critical_error();
[27] Fix | Delete
if ( empty( $maybe_critical ) ) {
[28] Fix | Delete
return;
[29] Fix | Delete
}
[30] Fix | Delete
?>
[31] Fix | Delete
<div class="ctf-error ctf_smash_error">
[32] Fix | Delete
<div class="ctf-error-user">
[33] Fix | Delete
<div class="ctf-error-admin">
[34] Fix | Delete
<strong>This message is only visible to admins:</strong>
[35] Fix | Delete
<p>
[36] Fix | Delete
<?php echo wp_kses_post( $maybe_critical['message'] ) ?>
[37] Fix | Delete
</p>
[38] Fix | Delete
<p>
[39] Fix | Delete
<?php echo wp_kses_post( $maybe_critical['directions'] ) ?>
[40] Fix | Delete
</p>
[41] Fix | Delete
</div>
[42] Fix | Delete
</div>
[43] Fix | Delete
</div>
[44] Fix | Delete
<?php
[45] Fix | Delete
[46] Fix | Delete
}
[47] Fix | Delete
[48] Fix | Delete
function maybe_show_visitor_notice( $ctf_feed ) {
[49] Fix | Delete
if ( ! empty( $ctf_feed->tweet_set ) ) {
[50] Fix | Delete
if ( is_array( $ctf_feed->tweet_set ) && is_array( $ctf_feed->tweet_set[0] ) ) {
[51] Fix | Delete
return;
[52] Fix | Delete
}
[53] Fix | Delete
}
[54] Fix | Delete
if ( ctf_current_user_can( 'manage_twitter_feed_options' ) ) {
[55] Fix | Delete
return;
[56] Fix | Delete
}
[57] Fix | Delete
?>
[58] Fix | Delete
<div id="ctf" class="ctf">
[59] Fix | Delete
<div class="ctf-error">
[60] Fix | Delete
<div class="ctf-error-user">
[61] Fix | Delete
<?php esc_html_e( 'Twitter feed is not available at the moment.', 'custom-twitter-feeds' ) ?>
[62] Fix | Delete
</div>
[63] Fix | Delete
</div>
[64] Fix | Delete
</div>
[65] Fix | Delete
<?php
[66] Fix | Delete
}
[67] Fix | Delete
}
[68] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function