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

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-admin/includes
File: class-wp-automatic-updater.php
);
[1000] Fix | Delete
[1001] Fix | Delete
$body .= "\n\n";
[1002] Fix | Delete
[1003] Fix | Delete
/*
[1004] Fix | Delete
* Don't show this message if there is a newer version available.
[1005] Fix | Delete
* Potential for confusion, and also not useful for them to know at this point.
[1006] Fix | Delete
*/
[1007] Fix | Delete
if ( 'fail' === $type && ! $newer_version_available ) {
[1008] Fix | Delete
$body .= __( 'An attempt was made, but your site could not be updated automatically.' ) . ' ';
[1009] Fix | Delete
}
[1010] Fix | Delete
[1011] Fix | Delete
$body .= __( 'Updating is easy and only takes a few moments:' );
[1012] Fix | Delete
$body .= "\n" . network_admin_url( 'update-core.php' );
[1013] Fix | Delete
break;
[1014] Fix | Delete
[1015] Fix | Delete
case 'critical':
[1016] Fix | Delete
if ( $newer_version_available ) {
[1017] Fix | Delete
$body .= sprintf(
[1018] Fix | Delete
/* translators: 1: Home URL, 2: WordPress version. */
[1019] Fix | Delete
__( 'Your site at %1$s experienced a critical failure while trying to update WordPress to version %2$s.' ),
[1020] Fix | Delete
home_url(),
[1021] Fix | Delete
$core_update->current
[1022] Fix | Delete
);
[1023] Fix | Delete
} else {
[1024] Fix | Delete
$body .= sprintf(
[1025] Fix | Delete
/* translators: 1: Home URL, 2: WordPress latest version. */
[1026] Fix | Delete
__( 'Your site at %1$s experienced a critical failure while trying to update to the latest version of WordPress, %2$s.' ),
[1027] Fix | Delete
home_url(),
[1028] Fix | Delete
$core_update->current
[1029] Fix | Delete
);
[1030] Fix | Delete
}
[1031] Fix | Delete
[1032] Fix | Delete
$body .= "\n\n" . __( "This means your site may be offline or broken. Don't panic; this can be fixed." );
[1033] Fix | Delete
[1034] Fix | Delete
$body .= "\n\n" . __( "Please check out your site now. It's possible that everything is working. If it says you need to update, you should do so:" );
[1035] Fix | Delete
$body .= "\n" . network_admin_url( 'update-core.php' );
[1036] Fix | Delete
break;
[1037] Fix | Delete
}
[1038] Fix | Delete
[1039] Fix | Delete
$critical_support = 'critical' === $type && ! empty( $core_update->support_email );
[1040] Fix | Delete
if ( $critical_support ) {
[1041] Fix | Delete
// Support offer if available.
[1042] Fix | Delete
$body .= "\n\n" . sprintf(
[1043] Fix | Delete
/* translators: %s: Support email address. */
[1044] Fix | Delete
__( 'The WordPress team is willing to help you. Forward this email to %s and the team will work with you to make sure your site is working.' ),
[1045] Fix | Delete
$core_update->support_email
[1046] Fix | Delete
);
[1047] Fix | Delete
} else {
[1048] Fix | Delete
// Add a note about the support forums.
[1049] Fix | Delete
$body .= "\n\n" . __( 'If you experience any issues or need support, the volunteers in the WordPress.org support forums may be able to help.' );
[1050] Fix | Delete
$body .= "\n" . __( 'https://wordpress.org/support/forums/' );
[1051] Fix | Delete
}
[1052] Fix | Delete
[1053] Fix | Delete
// Updates are important!
[1054] Fix | Delete
if ( 'success' !== $type || $newer_version_available ) {
[1055] Fix | Delete
$body .= "\n\n" . __( 'Keeping your site updated is important for security. It also makes the internet a safer place for you and your readers.' );
[1056] Fix | Delete
}
[1057] Fix | Delete
[1058] Fix | Delete
if ( $critical_support ) {
[1059] Fix | Delete
$body .= ' ' . __( "Reach out to WordPress Core developers to ensure you'll never have this problem again." );
[1060] Fix | Delete
}
[1061] Fix | Delete
[1062] Fix | Delete
// If things are successful and we're now on the latest, mention plugins and themes if any are out of date.
[1063] Fix | Delete
if ( 'success' === $type && ! $newer_version_available && ( get_plugin_updates() || get_theme_updates() ) ) {
[1064] Fix | Delete
$body .= "\n\n" . __( 'You also have some plugins or themes with updates available. Update them now:' );
[1065] Fix | Delete
$body .= "\n" . network_admin_url();
[1066] Fix | Delete
}
[1067] Fix | Delete
[1068] Fix | Delete
$body .= "\n\n" . __( 'The WordPress Team' ) . "\n";
[1069] Fix | Delete
[1070] Fix | Delete
if ( 'critical' === $type && is_wp_error( $result ) ) {
[1071] Fix | Delete
$body .= "\n***\n\n";
[1072] Fix | Delete
/* translators: %s: WordPress version. */
[1073] Fix | Delete
$body .= sprintf( __( 'Your site was running version %s.' ), get_bloginfo( 'version' ) );
[1074] Fix | Delete
$body .= ' ' . __( 'Some data that describes the error your site encountered has been put together.' );
[1075] Fix | Delete
$body .= ' ' . __( 'Your hosting company, support forum volunteers, or a friendly developer may be able to use this information to help you:' );
[1076] Fix | Delete
[1077] Fix | Delete
/*
[1078] Fix | Delete
* If we had a rollback and we're still critical, then the rollback failed too.
[1079] Fix | Delete
* Loop through all errors (the main WP_Error, the update result, the rollback result) for code, data, etc.
[1080] Fix | Delete
*/
[1081] Fix | Delete
if ( 'rollback_was_required' === $result->get_error_code() ) {
[1082] Fix | Delete
$errors = array( $result, $result->get_error_data()->update, $result->get_error_data()->rollback );
[1083] Fix | Delete
} else {
[1084] Fix | Delete
$errors = array( $result );
[1085] Fix | Delete
}
[1086] Fix | Delete
[1087] Fix | Delete
foreach ( $errors as $error ) {
[1088] Fix | Delete
if ( ! is_wp_error( $error ) ) {
[1089] Fix | Delete
continue;
[1090] Fix | Delete
}
[1091] Fix | Delete
[1092] Fix | Delete
$error_code = $error->get_error_code();
[1093] Fix | Delete
/* translators: %s: Error code. */
[1094] Fix | Delete
$body .= "\n\n" . sprintf( __( 'Error code: %s' ), $error_code );
[1095] Fix | Delete
[1096] Fix | Delete
if ( 'rollback_was_required' === $error_code ) {
[1097] Fix | Delete
continue;
[1098] Fix | Delete
}
[1099] Fix | Delete
[1100] Fix | Delete
if ( $error->get_error_message() ) {
[1101] Fix | Delete
$body .= "\n" . $error->get_error_message();
[1102] Fix | Delete
}
[1103] Fix | Delete
[1104] Fix | Delete
$error_data = $error->get_error_data();
[1105] Fix | Delete
if ( $error_data ) {
[1106] Fix | Delete
$body .= "\n" . implode( ', ', (array) $error_data );
[1107] Fix | Delete
}
[1108] Fix | Delete
}
[1109] Fix | Delete
[1110] Fix | Delete
$body .= "\n";
[1111] Fix | Delete
}
[1112] Fix | Delete
[1113] Fix | Delete
$to = get_site_option( 'admin_email' );
[1114] Fix | Delete
$headers = '';
[1115] Fix | Delete
[1116] Fix | Delete
$email = compact( 'to', 'subject', 'body', 'headers' );
[1117] Fix | Delete
[1118] Fix | Delete
/**
[1119] Fix | Delete
* Filters the email sent following an automatic background core update.
[1120] Fix | Delete
*
[1121] Fix | Delete
* @since 3.7.0
[1122] Fix | Delete
*
[1123] Fix | Delete
* @param array $email {
[1124] Fix | Delete
* Array of email arguments that will be passed to wp_mail().
[1125] Fix | Delete
*
[1126] Fix | Delete
* @type string $to The email recipient. An array of emails
[1127] Fix | Delete
* can be returned, as handled by wp_mail().
[1128] Fix | Delete
* @type string $subject The email's subject.
[1129] Fix | Delete
* @type string $body The email message body.
[1130] Fix | Delete
* @type string $headers Any email headers, defaults to no headers.
[1131] Fix | Delete
* }
[1132] Fix | Delete
* @param string $type The type of email being sent. Can be one of
[1133] Fix | Delete
* 'success', 'fail', 'manual', 'critical'.
[1134] Fix | Delete
* @param object $core_update The update offer that was attempted.
[1135] Fix | Delete
* @param mixed $result The result for the core update. Can be WP_Error.
[1136] Fix | Delete
*/
[1137] Fix | Delete
$email = apply_filters( 'auto_core_update_email', $email, $type, $core_update, $result );
[1138] Fix | Delete
[1139] Fix | Delete
wp_mail( $email['to'], wp_specialchars_decode( $email['subject'] ), $email['body'], $email['headers'] );
[1140] Fix | Delete
}
[1141] Fix | Delete
[1142] Fix | Delete
[1143] Fix | Delete
/**
[1144] Fix | Delete
* Checks whether an email should be sent after attempting plugin or theme updates.
[1145] Fix | Delete
*
[1146] Fix | Delete
* @since 5.5.0
[1147] Fix | Delete
*
[1148] Fix | Delete
* @param array $update_results The results of update tasks.
[1149] Fix | Delete
*/
[1150] Fix | Delete
protected function after_plugin_theme_update( $update_results ) {
[1151] Fix | Delete
$successful_updates = array();
[1152] Fix | Delete
$failed_updates = array();
[1153] Fix | Delete
[1154] Fix | Delete
if ( ! empty( $update_results['plugin'] ) ) {
[1155] Fix | Delete
/**
[1156] Fix | Delete
* Filters whether to send an email following an automatic background plugin update.
[1157] Fix | Delete
*
[1158] Fix | Delete
* @since 5.5.0
[1159] Fix | Delete
* @since 5.5.1 Added the `$update_results` parameter.
[1160] Fix | Delete
*
[1161] Fix | Delete
* @param bool $enabled True if plugin update notifications are enabled, false otherwise.
[1162] Fix | Delete
* @param array $update_results The results of plugins update tasks.
[1163] Fix | Delete
*/
[1164] Fix | Delete
$notifications_enabled = apply_filters( 'auto_plugin_update_send_email', true, $update_results['plugin'] );
[1165] Fix | Delete
[1166] Fix | Delete
if ( $notifications_enabled ) {
[1167] Fix | Delete
foreach ( $update_results['plugin'] as $update_result ) {
[1168] Fix | Delete
if ( true === $update_result->result ) {
[1169] Fix | Delete
$successful_updates['plugin'][] = $update_result;
[1170] Fix | Delete
} else {
[1171] Fix | Delete
$failed_updates['plugin'][] = $update_result;
[1172] Fix | Delete
}
[1173] Fix | Delete
}
[1174] Fix | Delete
}
[1175] Fix | Delete
}
[1176] Fix | Delete
[1177] Fix | Delete
if ( ! empty( $update_results['theme'] ) ) {
[1178] Fix | Delete
/**
[1179] Fix | Delete
* Filters whether to send an email following an automatic background theme update.
[1180] Fix | Delete
*
[1181] Fix | Delete
* @since 5.5.0
[1182] Fix | Delete
* @since 5.5.1 Added the `$update_results` parameter.
[1183] Fix | Delete
*
[1184] Fix | Delete
* @param bool $enabled True if theme update notifications are enabled, false otherwise.
[1185] Fix | Delete
* @param array $update_results The results of theme update tasks.
[1186] Fix | Delete
*/
[1187] Fix | Delete
$notifications_enabled = apply_filters( 'auto_theme_update_send_email', true, $update_results['theme'] );
[1188] Fix | Delete
[1189] Fix | Delete
if ( $notifications_enabled ) {
[1190] Fix | Delete
foreach ( $update_results['theme'] as $update_result ) {
[1191] Fix | Delete
if ( true === $update_result->result ) {
[1192] Fix | Delete
$successful_updates['theme'][] = $update_result;
[1193] Fix | Delete
} else {
[1194] Fix | Delete
$failed_updates['theme'][] = $update_result;
[1195] Fix | Delete
}
[1196] Fix | Delete
}
[1197] Fix | Delete
}
[1198] Fix | Delete
}
[1199] Fix | Delete
[1200] Fix | Delete
if ( empty( $successful_updates ) && empty( $failed_updates ) ) {
[1201] Fix | Delete
return;
[1202] Fix | Delete
}
[1203] Fix | Delete
[1204] Fix | Delete
if ( empty( $failed_updates ) ) {
[1205] Fix | Delete
$this->send_plugin_theme_email( 'success', $successful_updates, $failed_updates );
[1206] Fix | Delete
} elseif ( empty( $successful_updates ) ) {
[1207] Fix | Delete
$this->send_plugin_theme_email( 'fail', $successful_updates, $failed_updates );
[1208] Fix | Delete
} else {
[1209] Fix | Delete
$this->send_plugin_theme_email( 'mixed', $successful_updates, $failed_updates );
[1210] Fix | Delete
}
[1211] Fix | Delete
}
[1212] Fix | Delete
[1213] Fix | Delete
/**
[1214] Fix | Delete
* Sends an email upon the completion or failure of a plugin or theme background update.
[1215] Fix | Delete
*
[1216] Fix | Delete
* @since 5.5.0
[1217] Fix | Delete
*
[1218] Fix | Delete
* @param string $type The type of email to send. Can be one of 'success', 'fail', 'mixed'.
[1219] Fix | Delete
* @param array $successful_updates A list of updates that succeeded.
[1220] Fix | Delete
* @param array $failed_updates A list of updates that failed.
[1221] Fix | Delete
*/
[1222] Fix | Delete
protected function send_plugin_theme_email( $type, $successful_updates, $failed_updates ) {
[1223] Fix | Delete
// No updates were attempted.
[1224] Fix | Delete
if ( empty( $successful_updates ) && empty( $failed_updates ) ) {
[1225] Fix | Delete
return;
[1226] Fix | Delete
}
[1227] Fix | Delete
[1228] Fix | Delete
$unique_failures = false;
[1229] Fix | Delete
$past_failure_emails = get_option( 'auto_plugin_theme_update_emails', array() );
[1230] Fix | Delete
[1231] Fix | Delete
/*
[1232] Fix | Delete
* When only failures have occurred, an email should only be sent if there are unique failures.
[1233] Fix | Delete
* A failure is considered unique if an email has not been sent for an update attempt failure
[1234] Fix | Delete
* to a plugin or theme with the same new_version.
[1235] Fix | Delete
*/
[1236] Fix | Delete
if ( 'fail' === $type ) {
[1237] Fix | Delete
foreach ( $failed_updates as $update_type => $failures ) {
[1238] Fix | Delete
foreach ( $failures as $failed_update ) {
[1239] Fix | Delete
if ( ! isset( $past_failure_emails[ $failed_update->item->{$update_type} ] ) ) {
[1240] Fix | Delete
$unique_failures = true;
[1241] Fix | Delete
continue;
[1242] Fix | Delete
}
[1243] Fix | Delete
[1244] Fix | Delete
// Check that the failure represents a new failure based on the new_version.
[1245] Fix | Delete
if ( version_compare( $past_failure_emails[ $failed_update->item->{$update_type} ], $failed_update->item->new_version, '<' ) ) {
[1246] Fix | Delete
$unique_failures = true;
[1247] Fix | Delete
}
[1248] Fix | Delete
}
[1249] Fix | Delete
}
[1250] Fix | Delete
[1251] Fix | Delete
if ( ! $unique_failures ) {
[1252] Fix | Delete
return;
[1253] Fix | Delete
}
[1254] Fix | Delete
}
[1255] Fix | Delete
[1256] Fix | Delete
$body = array();
[1257] Fix | Delete
$successful_plugins = ( ! empty( $successful_updates['plugin'] ) );
[1258] Fix | Delete
$successful_themes = ( ! empty( $successful_updates['theme'] ) );
[1259] Fix | Delete
$failed_plugins = ( ! empty( $failed_updates['plugin'] ) );
[1260] Fix | Delete
$failed_themes = ( ! empty( $failed_updates['theme'] ) );
[1261] Fix | Delete
[1262] Fix | Delete
switch ( $type ) {
[1263] Fix | Delete
case 'success':
[1264] Fix | Delete
if ( $successful_plugins && $successful_themes ) {
[1265] Fix | Delete
/* translators: %s: Site title. */
[1266] Fix | Delete
$subject = __( '[%s] Some plugins and themes have automatically updated' );
[1267] Fix | Delete
$body[] = sprintf(
[1268] Fix | Delete
/* translators: %s: Home URL. */
[1269] Fix | Delete
__( 'Howdy! Some plugins and themes have automatically updated to their latest versions on your site at %s. No further action is needed on your part.' ),
[1270] Fix | Delete
home_url()
[1271] Fix | Delete
);
[1272] Fix | Delete
} elseif ( $successful_plugins ) {
[1273] Fix | Delete
/* translators: %s: Site title. */
[1274] Fix | Delete
$subject = __( '[%s] Some plugins were automatically updated' );
[1275] Fix | Delete
$body[] = sprintf(
[1276] Fix | Delete
/* translators: %s: Home URL. */
[1277] Fix | Delete
__( 'Howdy! Some plugins have automatically updated to their latest versions on your site at %s. No further action is needed on your part.' ),
[1278] Fix | Delete
home_url()
[1279] Fix | Delete
);
[1280] Fix | Delete
} else {
[1281] Fix | Delete
/* translators: %s: Site title. */
[1282] Fix | Delete
$subject = __( '[%s] Some themes were automatically updated' );
[1283] Fix | Delete
$body[] = sprintf(
[1284] Fix | Delete
/* translators: %s: Home URL. */
[1285] Fix | Delete
__( 'Howdy! Some themes have automatically updated to their latest versions on your site at %s. No further action is needed on your part.' ),
[1286] Fix | Delete
home_url()
[1287] Fix | Delete
);
[1288] Fix | Delete
}
[1289] Fix | Delete
[1290] Fix | Delete
break;
[1291] Fix | Delete
case 'fail':
[1292] Fix | Delete
case 'mixed':
[1293] Fix | Delete
if ( $failed_plugins && $failed_themes ) {
[1294] Fix | Delete
/* translators: %s: Site title. */
[1295] Fix | Delete
$subject = __( '[%s] Some plugins and themes have failed to update' );
[1296] Fix | Delete
$body[] = sprintf(
[1297] Fix | Delete
/* translators: %s: Home URL. */
[1298] Fix | Delete
__( 'Howdy! Plugins and themes failed to update on your site at %s.' ),
[1299] Fix | Delete
home_url()
[1300] Fix | Delete
);
[1301] Fix | Delete
} elseif ( $failed_plugins ) {
[1302] Fix | Delete
/* translators: %s: Site title. */
[1303] Fix | Delete
$subject = __( '[%s] Some plugins have failed to update' );
[1304] Fix | Delete
$body[] = sprintf(
[1305] Fix | Delete
/* translators: %s: Home URL. */
[1306] Fix | Delete
__( 'Howdy! Plugins failed to update on your site at %s.' ),
[1307] Fix | Delete
home_url()
[1308] Fix | Delete
);
[1309] Fix | Delete
} else {
[1310] Fix | Delete
/* translators: %s: Site title. */
[1311] Fix | Delete
$subject = __( '[%s] Some themes have failed to update' );
[1312] Fix | Delete
$body[] = sprintf(
[1313] Fix | Delete
/* translators: %s: Home URL. */
[1314] Fix | Delete
__( 'Howdy! Themes failed to update on your site at %s.' ),
[1315] Fix | Delete
home_url()
[1316] Fix | Delete
);
[1317] Fix | Delete
}
[1318] Fix | Delete
[1319] Fix | Delete
break;
[1320] Fix | Delete
}
[1321] Fix | Delete
[1322] Fix | Delete
if ( in_array( $type, array( 'fail', 'mixed' ), true ) ) {
[1323] Fix | Delete
$body[] = "\n";
[1324] Fix | Delete
$body[] = __( 'Please check your site now. It’s possible that everything is working. If there are updates available, you should update.' );
[1325] Fix | Delete
$body[] = "\n";
[1326] Fix | Delete
[1327] Fix | Delete
// List failed plugin updates.
[1328] Fix | Delete
if ( ! empty( $failed_updates['plugin'] ) ) {
[1329] Fix | Delete
$body[] = __( 'The following plugins failed to update. If there was a fatal error in the update, the previously installed version has been restored.' );
[1330] Fix | Delete
[1331] Fix | Delete
foreach ( $failed_updates['plugin'] as $item ) {
[1332] Fix | Delete
$body_message = '';
[1333] Fix | Delete
$item_url = '';
[1334] Fix | Delete
[1335] Fix | Delete
if ( ! empty( $item->item->url ) ) {
[1336] Fix | Delete
$item_url = ' : ' . esc_url( $item->item->url );
[1337] Fix | Delete
}
[1338] Fix | Delete
[1339] Fix | Delete
if ( $item->item->current_version ) {
[1340] Fix | Delete
$body_message .= sprintf(
[1341] Fix | Delete
/* translators: 1: Plugin name, 2: Current version number, 3: New version number, 4: Plugin URL. */
[1342] Fix | Delete
__( '- %1$s (from version %2$s to %3$s)%4$s' ),
[1343] Fix | Delete
html_entity_decode( $item->name ),
[1344] Fix | Delete
$item->item->current_version,
[1345] Fix | Delete
$item->item->new_version,
[1346] Fix | Delete
$item_url
[1347] Fix | Delete
);
[1348] Fix | Delete
} else {
[1349] Fix | Delete
$body_message .= sprintf(
[1350] Fix | Delete
/* translators: 1: Plugin name, 2: Version number, 3: Plugin URL. */
[1351] Fix | Delete
__( '- %1$s version %2$s%3$s' ),
[1352] Fix | Delete
html_entity_decode( $item->name ),
[1353] Fix | Delete
$item->item->new_version,
[1354] Fix | Delete
$item_url
[1355] Fix | Delete
);
[1356] Fix | Delete
}
[1357] Fix | Delete
[1358] Fix | Delete
$body[] = $body_message;
[1359] Fix | Delete
[1360] Fix | Delete
$past_failure_emails[ $item->item->plugin ] = $item->item->new_version;
[1361] Fix | Delete
}
[1362] Fix | Delete
[1363] Fix | Delete
$body[] = "\n";
[1364] Fix | Delete
}
[1365] Fix | Delete
[1366] Fix | Delete
// List failed theme updates.
[1367] Fix | Delete
if ( ! empty( $failed_updates['theme'] ) ) {
[1368] Fix | Delete
$body[] = __( 'These themes failed to update:' );
[1369] Fix | Delete
[1370] Fix | Delete
foreach ( $failed_updates['theme'] as $item ) {
[1371] Fix | Delete
if ( $item->item->current_version ) {
[1372] Fix | Delete
$body[] = sprintf(
[1373] Fix | Delete
/* translators: 1: Theme name, 2: Current version number, 3: New version number. */
[1374] Fix | Delete
__( '- %1$s (from version %2$s to %3$s)' ),
[1375] Fix | Delete
html_entity_decode( $item->name ),
[1376] Fix | Delete
$item->item->current_version,
[1377] Fix | Delete
$item->item->new_version
[1378] Fix | Delete
);
[1379] Fix | Delete
} else {
[1380] Fix | Delete
$body[] = sprintf(
[1381] Fix | Delete
/* translators: 1: Theme name, 2: Version number. */
[1382] Fix | Delete
__( '- %1$s version %2$s' ),
[1383] Fix | Delete
html_entity_decode( $item->name ),
[1384] Fix | Delete
$item->item->new_version
[1385] Fix | Delete
);
[1386] Fix | Delete
}
[1387] Fix | Delete
[1388] Fix | Delete
$past_failure_emails[ $item->item->theme ] = $item->item->new_version;
[1389] Fix | Delete
}
[1390] Fix | Delete
[1391] Fix | Delete
$body[] = "\n";
[1392] Fix | Delete
}
[1393] Fix | Delete
}
[1394] Fix | Delete
[1395] Fix | Delete
// List successful updates.
[1396] Fix | Delete
if ( in_array( $type, array( 'success', 'mixed' ), true ) ) {
[1397] Fix | Delete
$body[] = "\n";
[1398] Fix | Delete
[1399] Fix | Delete
// List successful plugin updates.
[1400] Fix | Delete
if ( ! empty( $successful_updates['plugin'] ) ) {
[1401] Fix | Delete
$body[] = __( 'These plugins are now up to date:' );
[1402] Fix | Delete
[1403] Fix | Delete
foreach ( $successful_updates['plugin'] as $item ) {
[1404] Fix | Delete
$body_message = '';
[1405] Fix | Delete
$item_url = '';
[1406] Fix | Delete
[1407] Fix | Delete
if ( ! empty( $item->item->url ) ) {
[1408] Fix | Delete
$item_url = ' : ' . esc_url( $item->item->url );
[1409] Fix | Delete
}
[1410] Fix | Delete
[1411] Fix | Delete
if ( $item->item->current_version ) {
[1412] Fix | Delete
$body_message .= sprintf(
[1413] Fix | Delete
/* translators: 1: Plugin name, 2: Current version number, 3: New version number, 4: Plugin URL. */
[1414] Fix | Delete
__( '- %1$s (from version %2$s to %3$s)%4$s' ),
[1415] Fix | Delete
html_entity_decode( $item->name ),
[1416] Fix | Delete
$item->item->current_version,
[1417] Fix | Delete
$item->item->new_version,
[1418] Fix | Delete
$item_url
[1419] Fix | Delete
);
[1420] Fix | Delete
} else {
[1421] Fix | Delete
$body_message .= sprintf(
[1422] Fix | Delete
/* translators: 1: Plugin name, 2: Version number, 3: Plugin URL. */
[1423] Fix | Delete
__( '- %1$s version %2$s%3$s' ),
[1424] Fix | Delete
html_entity_decode( $item->name ),
[1425] Fix | Delete
$item->item->new_version,
[1426] Fix | Delete
$item_url
[1427] Fix | Delete
);
[1428] Fix | Delete
}
[1429] Fix | Delete
$body[] = $body_message;
[1430] Fix | Delete
[1431] Fix | Delete
unset( $past_failure_emails[ $item->item->plugin ] );
[1432] Fix | Delete
}
[1433] Fix | Delete
[1434] Fix | Delete
$body[] = "\n";
[1435] Fix | Delete
}
[1436] Fix | Delete
[1437] Fix | Delete
// List successful theme updates.
[1438] Fix | Delete
if ( ! empty( $successful_updates['theme'] ) ) {
[1439] Fix | Delete
$body[] = __( 'These themes are now up to date:' );
[1440] Fix | Delete
[1441] Fix | Delete
foreach ( $successful_updates['theme'] as $item ) {
[1442] Fix | Delete
if ( $item->item->current_version ) {
[1443] Fix | Delete
$body[] = sprintf(
[1444] Fix | Delete
/* translators: 1: Theme name, 2: Current version number, 3: New version number. */
[1445] Fix | Delete
__( '- %1$s (from version %2$s to %3$s)' ),
[1446] Fix | Delete
html_entity_decode( $item->name ),
[1447] Fix | Delete
$item->item->current_version,
[1448] Fix | Delete
$item->item->new_version
[1449] Fix | Delete
);
[1450] Fix | Delete
} else {
[1451] Fix | Delete
$body[] = sprintf(
[1452] Fix | Delete
/* translators: 1: Theme name, 2: Version number. */
[1453] Fix | Delete
__( '- %1$s version %2$s' ),
[1454] Fix | Delete
html_entity_decode( $item->name ),
[1455] Fix | Delete
$item->item->new_version
[1456] Fix | Delete
);
[1457] Fix | Delete
}
[1458] Fix | Delete
[1459] Fix | Delete
unset( $past_failure_emails[ $item->item->theme ] );
[1460] Fix | Delete
}
[1461] Fix | Delete
[1462] Fix | Delete
$body[] = "\n";
[1463] Fix | Delete
}
[1464] Fix | Delete
}
[1465] Fix | Delete
[1466] Fix | Delete
if ( $failed_plugins ) {
[1467] Fix | Delete
$body[] = sprintf(
[1468] Fix | Delete
/* translators: %s: Plugins screen URL. */
[1469] Fix | Delete
__( 'To manage plugins on your site, visit the Plugins page: %s' ),
[1470] Fix | Delete
admin_url( 'plugins.php' )
[1471] Fix | Delete
);
[1472] Fix | Delete
$body[] = "\n";
[1473] Fix | Delete
}
[1474] Fix | Delete
[1475] Fix | Delete
if ( $failed_themes ) {
[1476] Fix | Delete
$body[] = sprintf(
[1477] Fix | Delete
/* translators: %s: Themes screen URL. */
[1478] Fix | Delete
__( 'To manage themes on your site, visit the Themes page: %s' ),
[1479] Fix | Delete
admin_url( 'themes.php' )
[1480] Fix | Delete
);
[1481] Fix | Delete
$body[] = "\n";
[1482] Fix | Delete
}
[1483] Fix | Delete
[1484] Fix | Delete
// Add a note about the support forums.
[1485] Fix | Delete
$body[] = __( 'If you experience any issues or need support, the volunteers in the WordPress.org support forums may be able to help.' );
[1486] Fix | Delete
$body[] = __( 'https://wordpress.org/support/forums/' );
[1487] Fix | Delete
$body[] = "\n" . __( 'The WordPress Team' );
[1488] Fix | Delete
[1489] Fix | Delete
if ( '' !== get_option( 'blogname' ) ) {
[1490] Fix | Delete
$site_title = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
[1491] Fix | Delete
} else {
[1492] Fix | Delete
$site_title = parse_url( home_url(), PHP_URL_HOST );
[1493] Fix | Delete
}
[1494] Fix | Delete
[1495] Fix | Delete
$body = implode( "\n", $body );
[1496] Fix | Delete
$to = get_site_option( 'admin_email' );
[1497] Fix | Delete
$subject = sprintf( $subject, $site_title );
[1498] Fix | Delete
$headers = '';
[1499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function