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/clone/wp-conte.../plugins/wp-smush.../app
File: class-admin.php
$conflict_check,
[500] Fix | Delete
function( &$item ) {
[501] Fix | Delete
$item = '<strong>' . $item . '</strong>';
[502] Fix | Delete
}
[503] Fix | Delete
);
[504] Fix | Delete
?>
[505] Fix | Delete
<div class="notice notice-info is-dismissible smush-dismissible-notice"
[506] Fix | Delete
id="smush-conflict-notice"
[507] Fix | Delete
data-key="plugin-conflict">
[508] Fix | Delete
[509] Fix | Delete
<p><?php esc_html_e( 'You have multiple WordPress image optimization plugins installed. This may cause unpredictable behavior while optimizing your images, inaccurate reporting, or images to not display. For best results use only one image optimizer plugin at a time. These plugins may cause issues with Smush:', 'wp-smushit' ); ?></p>
[510] Fix | Delete
<p>
[511] Fix | Delete
<?php echo wp_kses_post( join( '<br>', $conflict_check ) ); ?>
[512] Fix | Delete
</p>
[513] Fix | Delete
<p>
[514] Fix | Delete
<a href="<?php echo esc_url( admin_url( 'plugins.php' ) ); ?>" class="button button-primary">
[515] Fix | Delete
<?php esc_html_e( 'Manage Plugins', 'wp-smushit' ); ?>
[516] Fix | Delete
</a>
[517] Fix | Delete
<a href="#"
[518] Fix | Delete
style="margin-left: 15px"
[519] Fix | Delete
id="smush-dismiss-conflict-notice" class="smush-dismiss-notice-button">
[520] Fix | Delete
[521] Fix | Delete
<?php esc_html_e( 'Dismiss', 'wp-smushit' ); ?>
[522] Fix | Delete
</a>
[523] Fix | Delete
</p>
[524] Fix | Delete
</div>
[525] Fix | Delete
<?php
[526] Fix | Delete
}
[527] Fix | Delete
[528] Fix | Delete
/**
[529] Fix | Delete
* Prints the content for pending images for the Bulk Smush section.
[530] Fix | Delete
*
[531] Fix | Delete
* @param int $remaining_count
[532] Fix | Delete
* @param int $reoptimize_count
[533] Fix | Delete
* @param int $optimize_count
[534] Fix | Delete
*
[535] Fix | Delete
* @since 3.7.2
[536] Fix | Delete
*/
[537] Fix | Delete
public function print_pending_bulk_smush_content( $remaining_count, $reoptimize_count, $optimize_count ) {
[538] Fix | Delete
$optimize_message = '';
[539] Fix | Delete
if ( 0 < $optimize_count ) {
[540] Fix | Delete
$optimize_message = sprintf(
[541] Fix | Delete
/* translators: 1. opening strong tag, 2: unsmushed images count,3. closing strong tag. */
[542] Fix | Delete
esc_html( _n( '%1$s%2$d attachment%3$s that needs smushing', '%1$s%2$d attachments%3$s that need smushing', $optimize_count, 'wp-smushit' ) ),
[543] Fix | Delete
'<strong>',
[544] Fix | Delete
absint( $optimize_count ),
[545] Fix | Delete
'</strong>'
[546] Fix | Delete
);
[547] Fix | Delete
}
[548] Fix | Delete
[549] Fix | Delete
$reoptimize_message = '';
[550] Fix | Delete
if ( 0 < $reoptimize_count ) {
[551] Fix | Delete
$reoptimize_message = sprintf(
[552] Fix | Delete
/* translators: 1. opening strong tag, 2: re-smush images count,3. closing strong tag. */
[553] Fix | Delete
esc_html( _n( '%1$s%2$d attachment%3$s that needs re-smushing', '%1$s%2$d attachments%3$s that need re-smushing', $reoptimize_count, 'wp-smushit' ) ),
[554] Fix | Delete
'<strong>',
[555] Fix | Delete
esc_html( $reoptimize_count ),
[556] Fix | Delete
'</strong>'
[557] Fix | Delete
);
[558] Fix | Delete
}
[559] Fix | Delete
[560] Fix | Delete
$bulk_limit_free_message = $this->generate_bulk_limit_message_for_free( $remaining_count );
[561] Fix | Delete
[562] Fix | Delete
$image_count_description = sprintf(
[563] Fix | Delete
/* translators: 1. username, 2. unsmushed images message, 3. 'and' text for when having both unsmushed and re-smush images, 4. re-smush images message. */
[564] Fix | Delete
__( '%1$s, you have %2$s%3$s%4$s! %5$s', 'wp-smushit' ),
[565] Fix | Delete
esc_html( Helper::get_user_name() ),
[566] Fix | Delete
$optimize_message,
[567] Fix | Delete
( $optimize_message && $reoptimize_message ? esc_html__( ' and ', 'wp-smushit' ) : '' ),
[568] Fix | Delete
$reoptimize_message,
[569] Fix | Delete
$bulk_limit_free_message
[570] Fix | Delete
);
[571] Fix | Delete
?>
[572] Fix | Delete
<span id="wp-smush-bulk-image-count"><?php echo esc_html( $remaining_count ); ?></span>
[573] Fix | Delete
<p id="wp-smush-bulk-image-count-description">
[574] Fix | Delete
<?php echo wp_kses_post( $image_count_description ); ?>
[575] Fix | Delete
</p>
[576] Fix | Delete
<?php
[577] Fix | Delete
}
[578] Fix | Delete
[579] Fix | Delete
public function get_global_stats_with_bulk_smush_content() {
[580] Fix | Delete
$core = WP_Smush::get_instance()->core();
[581] Fix | Delete
$stats = $core->get_global_stats();
[582] Fix | Delete
$global_stats = Global_Stats::get();
[583] Fix | Delete
$remaining_count = $global_stats->get_remaining_count();
[584] Fix | Delete
$optimize_count = $global_stats->get_optimize_list()->get_count();
[585] Fix | Delete
$reoptimize_count = $global_stats->get_redo_count();
[586] Fix | Delete
[587] Fix | Delete
$stats['errors'] = Error_Handler::get_last_errors();
[588] Fix | Delete
[589] Fix | Delete
if ( $remaining_count > 0 ) {
[590] Fix | Delete
ob_start();
[591] Fix | Delete
WP_Smush::get_instance()->admin()->print_pending_bulk_smush_content(
[592] Fix | Delete
$remaining_count,
[593] Fix | Delete
$reoptimize_count,
[594] Fix | Delete
$optimize_count
[595] Fix | Delete
);
[596] Fix | Delete
$content = ob_get_clean();
[597] Fix | Delete
$stats['content'] = $content;
[598] Fix | Delete
}
[599] Fix | Delete
[600] Fix | Delete
return $stats;
[601] Fix | Delete
}
[602] Fix | Delete
[603] Fix | Delete
public function get_global_stats_with_bulk_smush_content_and_notice() {
[604] Fix | Delete
$stats = $this->get_global_stats_with_bulk_smush_content();
[605] Fix | Delete
$remaining_count = Global_Stats::get()->get_remaining_count();
[606] Fix | Delete
if ( $remaining_count < 1 ) {
[607] Fix | Delete
$stats['notice'] = esc_html__( 'Yay! All images are optimized as per your current settings.', 'wp-smushit' );
[608] Fix | Delete
$stats['noticeType'] = 'success';
[609] Fix | Delete
} else {
[610] Fix | Delete
$stats['noticeType'] = 'warning';
[611] Fix | Delete
$stats['notice'] = sprintf(
[612] Fix | Delete
/* translators: %1$d - number of images, %2$s - opening a tag, %3$s - closing a tag */
[613] Fix | Delete
esc_html__( 'Image check complete, you have %1$d images that need smushing. %2$sBulk smush now!%3$s', 'wp-smushit' ),
[614] Fix | Delete
$remaining_count,
[615] Fix | Delete
'<a href="#" class="wp-smush-trigger-bulk">',
[616] Fix | Delete
'</a>'
[617] Fix | Delete
);
[618] Fix | Delete
}
[619] Fix | Delete
[620] Fix | Delete
return $stats;
[621] Fix | Delete
}
[622] Fix | Delete
[623] Fix | Delete
private function generate_bulk_limit_message_for_free( $remaining_count ) {
[624] Fix | Delete
$dont_limit = WP_Smush::get_instance()->core()->mod->bg_optimization->can_use_background();
[625] Fix | Delete
if ( $dont_limit || $remaining_count < Core::MAX_FREE_BULK ) {
[626] Fix | Delete
return '';
[627] Fix | Delete
}
[628] Fix | Delete
[629] Fix | Delete
$upgrade_url = add_query_arg(
[630] Fix | Delete
array(
[631] Fix | Delete
'utm_source' => 'smush',
[632] Fix | Delete
'utm_medium' => 'plugin',
[633] Fix | Delete
'utm_campaign' => 'smush_bulk_smush_pre_smush_50_limit',
[634] Fix | Delete
),
[635] Fix | Delete
'https://wpmudev.com/project/wp-smush-pro/'
[636] Fix | Delete
);
[637] Fix | Delete
$batches = ceil( $remaining_count / Core::MAX_FREE_BULK );
[638] Fix | Delete
/* translators: %s: Discount */
[639] Fix | Delete
$discount_text = '<strong>' . sprintf( esc_html__( '%s off welcome discount available.', 'wp-smushit' ), $this->get_plugin_discount() ) . '</strong>';
[640] Fix | Delete
return sprintf(
[641] Fix | Delete
/* translators: 1: max free bulk limit, 2: Total batches to smush, 3: opening a tag, 4: closing a tag. */
[642] Fix | Delete
esc_html__( 'Free users can only Bulk Smush %1$d images at one time. Smush in %2$d batches or %3$sBulk Smush unlimited images with Pro%4$s. %5$s', 'wp-smushit' ),
[643] Fix | Delete
Core::MAX_FREE_BULK,
[644] Fix | Delete
$batches,
[645] Fix | Delete
'<a class="smush-upsell-link" target="_blank" href="' . $upgrade_url . '">',
[646] Fix | Delete
'</a>',
[647] Fix | Delete
$discount_text
[648] Fix | Delete
);
[649] Fix | Delete
}
[650] Fix | Delete
[651] Fix | Delete
/**
[652] Fix | Delete
* Add more pages to builtin wpmudev branding.
[653] Fix | Delete
*
[654] Fix | Delete
* @since 3.0
[655] Fix | Delete
*
[656] Fix | Delete
* @param array $plugin_pages Nextgen pages is not introduced in built in wpmudev branding.
[657] Fix | Delete
*
[658] Fix | Delete
* @return array
[659] Fix | Delete
*/
[660] Fix | Delete
public function builtin_wpmudev_branding( $plugin_pages ) {
[661] Fix | Delete
$plugin_pages['gallery_page_wp-smush-nextgen-bulk'] = array(
[662] Fix | Delete
'wpmudev_whitelabel_sui_plugins_branding',
[663] Fix | Delete
'wpmudev_whitelabel_sui_plugins_footer',
[664] Fix | Delete
'wpmudev_whitelabel_sui_plugins_doc_links',
[665] Fix | Delete
);
[666] Fix | Delete
[667] Fix | Delete
// There's a different page ID since NextGen 3.3.6.
[668] Fix | Delete
$plugin_pages['nextgen-gallery_page_wp-smush-nextgen-bulk'] = array(
[669] Fix | Delete
'wpmudev_whitelabel_sui_plugins_branding',
[670] Fix | Delete
'wpmudev_whitelabel_sui_plugins_footer',
[671] Fix | Delete
'wpmudev_whitelabel_sui_plugins_doc_links',
[672] Fix | Delete
);
[673] Fix | Delete
[674] Fix | Delete
foreach ( $this->pages as $key => $value ) {
[675] Fix | Delete
$plugin_pages[ "smush-pro_page_smush-{$key}" ] = array(
[676] Fix | Delete
'wpmudev_whitelabel_sui_plugins_branding',
[677] Fix | Delete
'wpmudev_whitelabel_sui_plugins_footer',
[678] Fix | Delete
'wpmudev_whitelabel_sui_plugins_doc_links',
[679] Fix | Delete
);
[680] Fix | Delete
}
[681] Fix | Delete
[682] Fix | Delete
return $plugin_pages;
[683] Fix | Delete
}
[684] Fix | Delete
[685] Fix | Delete
public function is_notice_dismissed( $notice ) {
[686] Fix | Delete
$dismissed_notices = get_option( 'wp-smush-dismissed-notices', array() );
[687] Fix | Delete
[688] Fix | Delete
return ! empty( $dismissed_notices[ $notice ] );
[689] Fix | Delete
}
[690] Fix | Delete
[691] Fix | Delete
public function show_parallel_unavailability_notice() {
[692] Fix | Delete
$smush = WP_Smush::get_instance()->core()->mod->smush;
[693] Fix | Delete
$curl_multi_exec_available = $smush->curl_multi_exec_available();
[694] Fix | Delete
$is_current_user_not_admin = ! current_user_can( 'manage_options' );
[695] Fix | Delete
$is_not_bulk_smush_page = false === strpos( get_current_screen()->id, 'page_smush-bulk' );
[696] Fix | Delete
$notice_hidden = $this->is_notice_dismissed( 'curl-multi-unavailable' );
[697] Fix | Delete
[698] Fix | Delete
if (
[699] Fix | Delete
$curl_multi_exec_available ||
[700] Fix | Delete
$is_current_user_not_admin ||
[701] Fix | Delete
$is_not_bulk_smush_page ||
[702] Fix | Delete
$notice_hidden
[703] Fix | Delete
) {
[704] Fix | Delete
return;
[705] Fix | Delete
}
[706] Fix | Delete
[707] Fix | Delete
$notice_text = sprintf(
[708] Fix | Delete
/* translators: %s: <strong>curl_multi_exec()</strong> */
[709] Fix | Delete
esc_html__( 'Smush was unable to activate parallel processing on your site as your web hosting provider has disabled the %s function on your server. We highly recommend contacting your hosting provider to enable that function to optimize images on your site faster.', 'wp-smushit' ),
[710] Fix | Delete
'<strong>curl_multi_exec()</strong>'
[711] Fix | Delete
);
[712] Fix | Delete
[713] Fix | Delete
?>
[714] Fix | Delete
<div class="notice notice-warning is-dismissible smush-dismissible-notice"
[715] Fix | Delete
id="smush-parallel-unavailability-notice"
[716] Fix | Delete
data-key="curl-multi-unavailable">
[717] Fix | Delete
[718] Fix | Delete
<strong style="font-size: 15px;line-height: 30px;margin: 8px 0 0 2px;display: inline-block;">
[719] Fix | Delete
<?php esc_html_e( 'Smush images faster with parallel image optimization', 'wp-smushit' ); ?>
[720] Fix | Delete
</strong>
[721] Fix | Delete
<br/>
[722] Fix | Delete
<p style="margin-bottom: 13px;margin-top: 0;">
[723] Fix | Delete
<?php echo wp_kses_post( $notice_text ); ?><br/>
[724] Fix | Delete
[725] Fix | Delete
<a style="margin-top: 5px;display: inline-block;" href="#" class="smush-dismiss-notice-button">
[726] Fix | Delete
<?php esc_html_e( 'Dismiss', 'wp-smushit' ); ?>
[727] Fix | Delete
</a>
[728] Fix | Delete
</p>
[729] Fix | Delete
</div>
[730] Fix | Delete
<?php
[731] Fix | Delete
}
[732] Fix | Delete
[733] Fix | Delete
public function show_background_unavailability_notice() {
[734] Fix | Delete
$bg_optimization = WP_Smush::get_instance()->core()->mod->bg_optimization;
[735] Fix | Delete
$background_supported = $bg_optimization->is_background_supported();
[736] Fix | Delete
$background_disabled = ! $bg_optimization->is_background_enabled();
[737] Fix | Delete
$is_current_user_not_admin = ! current_user_can( 'manage_options' );
[738] Fix | Delete
$is_not_bulk_smush_page = false === strpos( get_current_screen()->id, 'page_smush-bulk' );
[739] Fix | Delete
$notice_hidden = $this->is_notice_dismissed( 'background-smush-unavailable' );
[740] Fix | Delete
[741] Fix | Delete
if (
[742] Fix | Delete
$background_supported ||
[743] Fix | Delete
$background_disabled ||
[744] Fix | Delete
$is_current_user_not_admin ||
[745] Fix | Delete
$is_not_bulk_smush_page ||
[746] Fix | Delete
$notice_hidden
[747] Fix | Delete
) {
[748] Fix | Delete
return;
[749] Fix | Delete
}
[750] Fix | Delete
[751] Fix | Delete
$notice_text = sprintf(
[752] Fix | Delete
/* translators: 1: Current MYSQL version, 2: Required MYSQL version */
[753] Fix | Delete
esc_html__( 'Smush was unable to activate background processing on your site as your web hosting provider is using an old version of MySQL on your server (version %1$s). We highly recommend contacting your hosting provider to upgrade MySQL to version %2$s or higher to optimize images in the background.', 'wp-smushit' ),
[754] Fix | Delete
$bg_optimization->get_actual_mysql_version(),
[755] Fix | Delete
$bg_optimization->get_required_mysql_version()
[756] Fix | Delete
);
[757] Fix | Delete
?>
[758] Fix | Delete
<div class="notice notice-warning is-dismissible smush-dismissible-notice"
[759] Fix | Delete
id="smush-background-unavailability-notice"
[760] Fix | Delete
data-key="background-smush-unavailable">
[761] Fix | Delete
[762] Fix | Delete
<strong style="font-size: 15px;line-height: 30px;margin: 8px 0 0 2px;display: inline-block;">
[763] Fix | Delete
<?php esc_html_e( 'Smush images in the background', 'wp-smushit' ); ?>
[764] Fix | Delete
</strong>
[765] Fix | Delete
<br/>
[766] Fix | Delete
<p style="margin-bottom: 13px;margin-top: 0;">
[767] Fix | Delete
<?php echo wp_kses_post( $notice_text ); ?><br/>
[768] Fix | Delete
[769] Fix | Delete
<a style="margin-top: 5px;display: inline-block;" href="#" class="smush-dismiss-notice-button">
[770] Fix | Delete
<?php esc_html_e( 'Dismiss', 'wp-smushit' ); ?>
[771] Fix | Delete
</a>
[772] Fix | Delete
</p>
[773] Fix | Delete
</div>
[774] Fix | Delete
<?php
[775] Fix | Delete
}
[776] Fix | Delete
[777] Fix | Delete
public function maybe_show_local_webp_convert_original_images_notice() {
[778] Fix | Delete
$redirected_from_webp = isset( $_GET['smush-action'] ) && 'start-bulk-webp-conversion' === $_GET['smush-action'];
[779] Fix | Delete
$settings = Settings::get_instance();
[780] Fix | Delete
$should_show_notice = $redirected_from_webp &&
[781] Fix | Delete
current_user_can( 'manage_options' ) &&
[782] Fix | Delete
$settings->has_webp_page() &&
[783] Fix | Delete
! $settings->is_optimize_original_images_active();
[784] Fix | Delete
if ( ! $should_show_notice ) {
[785] Fix | Delete
return;
[786] Fix | Delete
}
[787] Fix | Delete
[788] Fix | Delete
$error_message = sprintf(
[789] Fix | Delete
/* translators: 1: Open a link, 2: Close the link */
[790] Fix | Delete
esc_html__( 'If you wish to also convert your original uploaded images to .webp format, please enable the %1$sOptimize original images%2$s setting below.', 'wp-smushit' ),
[791] Fix | Delete
'<a href="#original" class="smush-close-and-dismiss-notice">',
[792] Fix | Delete
'</a>'
[793] Fix | Delete
);
[794] Fix | Delete
$error_message = '<p>' . $error_message . '</p>';
[795] Fix | Delete
?>
[796] Fix | Delete
<div role="alert" id="wp-smush-local-webp-convert-original-notice" class="sui-notice wp-smush-dismissible-header-notice" data-message="<?php echo esc_attr( $error_message ); ?>" aria-live="assertive"></div>
[797] Fix | Delete
<?php
[798] Fix | Delete
}
[799] Fix | Delete
[800] Fix | Delete
public function get_plugin_discount() {
[801] Fix | Delete
return self::PLUGIN_DISCOUNT_PERCENT . '%';
[802] Fix | Delete
}
[803] Fix | Delete
}
[804] Fix | Delete
[805] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function