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: notices.php
<?php
[0] Fix | Delete
function ctf_get_current_time() {
[1] Fix | Delete
$current_time = time();
[2] Fix | Delete
[3] Fix | Delete
// where to do tests
[4] Fix | Delete
//$current_time = strtotime( 'November 25, 2020' ) + 1;
[5] Fix | Delete
[6] Fix | Delete
return $current_time;
[7] Fix | Delete
}
[8] Fix | Delete
[9] Fix | Delete
// generates the html for the admin notices
[10] Fix | Delete
function ctf_notices_html() {
[11] Fix | Delete
//delete_option( 'ctf_rating_notice');
[12] Fix | Delete
//delete_transient( 'instagram_feed_rating_notice_waiting' );
[13] Fix | Delete
}
[14] Fix | Delete
//add_action( 'admin_notices', 'ctf_notices_html', 12 ); // priority 8 for Instagram, priority 10 for Facebook
[15] Fix | Delete
[16] Fix | Delete
function ctf_get_future_date( $month, $year, $week, $day, $direction ) {
[17] Fix | Delete
if ( $direction > 0 ) {
[18] Fix | Delete
$startday = 1;
[19] Fix | Delete
} else {
[20] Fix | Delete
$startday = date( 't', mktime(0, 0, 0, $month, 1, $year ) );
[21] Fix | Delete
}
[22] Fix | Delete
[23] Fix | Delete
$start = mktime( 0, 0, 0, $month, $startday, $year );
[24] Fix | Delete
$weekday = date( 'N', $start );
[25] Fix | Delete
[26] Fix | Delete
$offset = 0;
[27] Fix | Delete
if ( $direction * $day >= $direction * $weekday ) {
[28] Fix | Delete
$offset = -$direction * 7;
[29] Fix | Delete
}
[30] Fix | Delete
[31] Fix | Delete
$offset += $direction * ($week * 7) + ($day - $weekday);
[32] Fix | Delete
return mktime( 0, 0, 0, $month, $startday + $offset, $year );
[33] Fix | Delete
}
[34] Fix | Delete
[35] Fix | Delete
[36] Fix | Delete
function ctf_admin_database_warning() {
[37] Fix | Delete
if ( isset( $_GET['page'] ) && in_array( $_GET['page'], array( 'custom-twitter-feeds', '' ) ) ) {
[38] Fix | Delete
[39] Fix | Delete
[40] Fix | Delete
if ( ! current_user_can( 'manage_options' ) ) {
[41] Fix | Delete
return;
[42] Fix | Delete
}
[43] Fix | Delete
[44] Fix | Delete
global $wpdb;
[45] Fix | Delete
$table_name = $wpdb->prefix . "options";
[46] Fix | Delete
$result = $wpdb->get_var("
[47] Fix | Delete
SELECT COUNT(*)
[48] Fix | Delete
FROM $table_name
[49] Fix | Delete
WHERE option_name LIKE '%ctf_!%'
[50] Fix | Delete
");
[51] Fix | Delete
[52] Fix | Delete
if ( (int) $result < 500 ) {
[53] Fix | Delete
return;
[54] Fix | Delete
}
[55] Fix | Delete
?>
[56] Fix | Delete
<div class="notice notice-warning is-dismissible ctf-admin-notice">
[57] Fix | Delete
<p>
[58] Fix | Delete
<?php echo esc_html__( 'Heads up! It looks like you have over 500 Twitter feeds stored in your WordPress database. This is typically caused by a large number of hashtag feeds on your site, as the plugin permanently stores older Tweets to work around Twitter\'s 7 day hashtag feed limit. This many caches may lead to performance issues.', 'custom-twitter-feeds' ); ?>
[59] Fix | Delete
</p>
[60] Fix | Delete
<p>
[61] Fix | Delete
<?php echo sprintf( __( 'For a solution, please follow the directions %shere%s.', 'custom-twitter-feeds' ), '<a href="https://smashballoon.com/why-does-my-database-have-a-lot-of-twitter-feed-caches/" target="_blank" rel="noopener noreferrer">', '</a>' ); ?>
[62] Fix | Delete
</p>
[63] Fix | Delete
</div>
[64] Fix | Delete
<?php
[65] Fix | Delete
}
[66] Fix | Delete
}
[67] Fix | Delete
add_action( 'admin_notices', 'ctf_admin_database_warning' );
[68] Fix | Delete
[69] Fix | Delete
/* Usage */
[70] Fix | Delete
add_action( 'admin_notices', 'ctf_usage_opt_in' );
[71] Fix | Delete
function ctf_usage_opt_in() {
[72] Fix | Delete
[73] Fix | Delete
if ( isset( $_GET['trackingdismiss'] ) ) {
[74] Fix | Delete
$usage_tracking = get_option( 'ctf_usage_tracking', array( 'last_send' => 0, 'enabled' => false ) );
[75] Fix | Delete
[76] Fix | Delete
$usage_tracking['enabled'] = false;
[77] Fix | Delete
[78] Fix | Delete
update_option( 'ctf_usage_tracking', $usage_tracking, false );
[79] Fix | Delete
[80] Fix | Delete
return;
[81] Fix | Delete
}
[82] Fix | Delete
[83] Fix | Delete
$cap = ctf_get_manage_options_cap();
[84] Fix | Delete
[85] Fix | Delete
if ( ! current_user_can( $cap ) ) {
[86] Fix | Delete
return;
[87] Fix | Delete
}
[88] Fix | Delete
$usage_tracking = get_option( 'ctf_usage_tracking', false );
[89] Fix | Delete
if ( $usage_tracking ) {
[90] Fix | Delete
return;
[91] Fix | Delete
}
[92] Fix | Delete
?>
[93] Fix | Delete
<div class="notice notice-warning is-dismissible ctf-admin-notice">
[94] Fix | Delete
[95] Fix | Delete
<p>
[96] Fix | Delete
<strong><?php echo __( 'Help us improve the Custom Twitter Feed plugin', 'custom-twitter-feeds' ); ?></strong><br>
[97] Fix | Delete
<?php echo __( 'Understanding how you are using the plugin allows us to further improve it. Opt-in below to agree to send a weekly report of plugin usage data.', 'custom-twitter-feeds' ); ?>
[98] Fix | Delete
<a target="_blank" rel="noopener noreferrer" href="https://smashballoon.com/custom-twitter-feeds/docs/usage-tracking/"><?php echo __( 'More information', 'custom-twitter-feeds' ); ?></a>
[99] Fix | Delete
</p>
[100] Fix | Delete
<p>
[101] Fix | Delete
<a href="<?php echo admin_url('admin.php?page=custom-twitter-feeds&trackingdismiss=1') ?>" type="submit" class="button button-primary ctf-opt-in"><?php echo __( 'Yes, I\'d like to help', 'custom-twitter-feeds' ); ?></a>
[102] Fix | Delete
<a href="<?php echo admin_url('admin.php?page=custom-twitter-feeds&trackingdismiss=1') ?>" type="submit" class="ctf-no-usage-opt-out ctf-space-left button button-secondary"><?php echo __( 'No, thanks', 'custom-twitter-feeds' ); ?></a>
[103] Fix | Delete
</p>
[104] Fix | Delete
[105] Fix | Delete
</div>
[106] Fix | Delete
[107] Fix | Delete
<?php
[108] Fix | Delete
}
[109] Fix | Delete
[110] Fix | Delete
function ctf_usage_opt_in_or_out() {
[111] Fix | Delete
$cap = ctf_get_manage_options_cap();
[112] Fix | Delete
[113] Fix | Delete
if ( ! current_user_can( $cap ) ) {
[114] Fix | Delete
wp_send_json_error();
[115] Fix | Delete
}
[116] Fix | Delete
if ( ! isset( $_POST['opted_in'] ) ) {
[117] Fix | Delete
die ( 'You did not do this the right way!' );
[118] Fix | Delete
}
[119] Fix | Delete
[120] Fix | Delete
$usage_tracking = get_option( 'ctf_usage_tracking', array( 'last_send' => 0, 'enabled' => false ) );
[121] Fix | Delete
[122] Fix | Delete
$usage_tracking['enabled'] = isset( $_POST['opted_in'] ) ? $_POST['opted_in'] === 'true' : false;
[123] Fix | Delete
[124] Fix | Delete
update_option( 'ctf_usage_tracking', $usage_tracking, false );
[125] Fix | Delete
[126] Fix | Delete
die();
[127] Fix | Delete
}
[128] Fix | Delete
add_action( 'wp_ajax_ctf_usage_opt_in_or_out', 'ctf_usage_opt_in_or_out' );
[129] Fix | Delete
[130] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function