Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change deprecated function #743

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/activation.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ public function upgrade()
return;
}

Admin_Display::succeed(__('Upgraded successfully.', 'litespeed-cache'));
Admin_Display::success(__('Upgraded successfully.', 'litespeed-cache'));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/admin-settings.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public function save($raw_data)
$this->cls('Conf')->update_confs($the_matrix);

$msg = __('Options saved.', 'litespeed-cache');
Admin_Display::succeed($msg);
Admin_Display::success($msg);
}

/**
Expand Down Expand Up @@ -296,7 +296,7 @@ public function network_save($raw_data)
Activation::cls()->update_files();

$msg = __('Options saved.', 'litespeed-cache');
Admin_Display::succeed($msg);
Admin_Display::success($msg);
}

/**
Expand Down
10 changes: 5 additions & 5 deletions src/cdn-setup.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private function _process_cdn_status($result)
$this->cls('Cloud')->set_linked();
$nameservers = esc_html($result['nameservers']);
$this->cls('Conf')->update_confs(array(self::O_QC_NAMESERVERS => $nameservers, self::O_CDN_QUIC => true));
Admin_Display::succeed(
Admin_Display::success(
'🎊 ' . __('Congratulations, QUIC.cloud successfully set this domain up for the CDN. Please update your nameservers to:', 'litespeed-cache') . $nameservers
);
} elseif (isset($result['cname'])) {
Expand All @@ -139,7 +139,7 @@ private function _process_cdn_status($result)
$this->cls('Cloud')->set_linked();
$cname = esc_html($result['cname']);
$this->cls('Conf')->update_confs(array(self::O_QC_CNAME => $cname, self::O_CDN_QUIC => true));
Admin_Display::succeed('🎊 ' . __('Congratulations, QUIC.cloud successfully set this domain up for the CDN. Please update your cname to:', 'litespeed-cache') . $cname);
Admin_Display::success('🎊 ' . __('Congratulations, QUIC.cloud successfully set this domain up for the CDN. Please update your cname to:', 'litespeed-cache') . $cname);
} elseif (isset($result['done'])) {
if (isset($this->_summary['cdn_setup_err'])) {
unset($this->_summary['cdn_setup_err']);
Expand All @@ -157,9 +157,9 @@ private function _process_cdn_status($result)
$this->_summary['cdn_verify_msg'] = $notice;
$notice = array('cdn_verify_msg' => $notice);
}
Admin_Display::succeed($notice);
Admin_Display::success($notice);
} else {
Admin_Display::succeed(__('CDN Setup is running.', 'litespeed-cache'));
Admin_Display::success(__('CDN Setup is running.', 'litespeed-cache'));
}
self::save_summary();
}
Expand Down Expand Up @@ -235,7 +235,7 @@ private function _qc_reset($delete)
'litespeed-cache'
);
}
Admin_Display::succeed($msg);
Admin_Display::success($msg);
return self::ok();
}

Expand Down
6 changes: 3 additions & 3 deletions src/cdn/cloudflare.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ private function _set_devmode($type)

if ($res) {
$msg = sprintf(__('Notified Cloudflare to set development mode to %s successfully.', 'litespeed-cache'), strtoupper($new_val));
Admin_Display::succeed($msg);
Admin_Display::success($msg);
}
}

Expand Down Expand Up @@ -145,7 +145,7 @@ private function _purge_all()

if ($res) {
$msg = __('Notified Cloudflare to purge all successfully.', 'litespeed-cache');
Admin_Display::succeed($msg);
Admin_Display::success($msg);
}
}

Expand Down Expand Up @@ -265,7 +265,7 @@ private function _cloudflare_call($url, $method = 'GET', $data = false, $show_ms
Debug2::debug('[Cloudflare] _cloudflare_call called successfully');
if ($show_msg) {
$msg = __('Communicated with Cloudflare successfully.', 'litespeed-cache');
Admin_Display::succeed($msg);
Admin_Display::success($msg);
}

return $json['result'];
Expand Down
2 changes: 1 addition & 1 deletion src/conf.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ private function _set_conf()
$this->update_confs($the_matrix);

$msg = __('Changed setting successfully.', 'litespeed-cache');
Admin_Display::succeed($msg);
Admin_Display::success($msg);

// Redirect if changed frontend URL
if (!empty($_GET['redirect'])) {
Expand Down
4 changes: 2 additions & 2 deletions src/crawler-map.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public function empty_map()
Data::cls()->tb_del('crawler');

$msg = __('Sitemap cleaned successfully', 'litespeed-cache');
Admin_Display::succeed($msg);
Admin_Display::success($msg);
}

/**
Expand Down Expand Up @@ -376,7 +376,7 @@ public function gen($manual = false)

if (!defined('DOING_CRON') && $manual) {
$msg = sprintf(__('Sitemap created successfully: %d items', 'litespeed-cache'), $count);
Admin_Display::succeed($msg);
Admin_Display::success($msg);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/db-optm.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ private function _conv_innodb()
Debug2::debug("[DB] Converted $tb to InnoDB");

$msg = __('Converted to InnoDB successfully.', 'litespeed-cache');
Admin_Display::succeed($msg);
Admin_Display::success($msg);
}

/**
Expand Down Expand Up @@ -341,7 +341,7 @@ public function handler()
} else {
$msg = $this->_db_clean($type);
}
Admin_Display::succeed($msg);
Admin_Display::success($msg);
break;

case self::TYPE_CONV_TB:
Expand Down
26 changes: 13 additions & 13 deletions src/img-optm.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ public function new_req()
$placeholder1 = Admin_Display::print_plural($accepted_imgs[0], 'image');
$placeholder2 = Admin_Display::print_plural($accepted_imgs[1], 'image');
$msg = sprintf(__('Pushed %1$s to Cloud server, accepted %2$s.', 'litespeed-cache'), $placeholder1, $placeholder2);
Admin_Display::succeed($msg);
Admin_Display::success($msg);
}

/**
Expand Down Expand Up @@ -586,7 +586,7 @@ private function _filter_invalid_src()

$count = count($img_in_queue_invalid);
$msg = sprintf(__('Cleared %1$s invalid images.', 'litespeed-cache'), $count);
Admin_Display::succeed($msg);
Admin_Display::success($msg);

self::debug('Found invalid src [total] ' . $count);
}
Expand Down Expand Up @@ -1194,7 +1194,7 @@ public function pull($manual = false)
}

// $msg = sprintf(__('Pulled %d image(s)', 'litespeed-cache'), $total_pulled_ori + $total_pulled_webp);
// Admin_Display::succeed($msg);
// Admin_Display::success($msg);

// Check if there is still task in queue
$q = "SELECT * FROM `$this->_table_img_optming` WHERE optm_status = %d LIMIT 1";
Expand Down Expand Up @@ -1284,7 +1284,7 @@ public function clean()
}

$msg = __('Cleaned up unfinished data successfully.', 'litespeed-cache');
Admin_Display::succeed($msg);
Admin_Display::success($msg);
}

/**
Expand Down Expand Up @@ -1368,7 +1368,7 @@ private function _destroy()
self::delete_option(self::DB_NEED_PULL);

$msg = __('Destroy all optimization data successfully.', 'litespeed-cache');
Admin_Display::succeed($msg);
Admin_Display::success($msg);
}

/**
Expand Down Expand Up @@ -1431,7 +1431,7 @@ private function _rescan()

if (!$list) {
$msg = __('Rescanned successfully.', 'litespeed-cache');
Admin_Display::succeed($msg);
Admin_Display::success($msg);

self::debug('rescan bypass: no gathered image found');
return;
Expand Down Expand Up @@ -1493,7 +1493,7 @@ private function _rescan()
}

$msg = $count ? sprintf(__('Rescanned %d images successfully.', 'litespeed-cache'), $count) : __('Rescanned successfully.', 'litespeed-cache');
Admin_Display::succeed($msg);
Admin_Display::success($msg);
}

/**
Expand Down Expand Up @@ -1560,7 +1560,7 @@ private function _calc_bkup()
}

$msg = __('Calculated backups successfully.', 'litespeed-cache');
Admin_Display::succeed($msg);
Admin_Display::success($msg);
}

/**
Expand Down Expand Up @@ -1654,7 +1654,7 @@ public function rm_bkup()
}

$msg = __('Removed backups successfully.', 'litespeed-cache');
Admin_Display::succeed($msg);
Admin_Display::success($msg);
}

/**
Expand Down Expand Up @@ -1806,7 +1806,7 @@ public function batch_switch($type)
}

$msg = __('Switched images successfully.', 'litespeed-cache');
Admin_Display::succeed($msg);
Admin_Display::success($msg);
}

/**
Expand Down Expand Up @@ -1905,7 +1905,7 @@ private function _switch_bk_file($meta_value, $is_ori_file = false)
*/
private function _switch_optm_file($type)
{
Admin_Display::succeed(__('Switched to optimized file successfully.', 'litespeed-cache'));
Admin_Display::success(__('Switched to optimized file successfully.', 'litespeed-cache'));
return;
global $wpdb;

Expand Down Expand Up @@ -1956,7 +1956,7 @@ private function _switch_optm_file($type)
}
}

Admin_Display::succeed($msg);
Admin_Display::success($msg);
}

/**
Expand Down Expand Up @@ -2003,7 +2003,7 @@ public function reset_row($post_id)
delete_post_meta($post_id, self::DB_SET);

$msg = __('Reset the optimized data successfully.', 'litespeed-cache');
Admin_Display::succeed($msg);
Admin_Display::success($msg);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/import.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function import($file = false)
Debug2::debug('Import: Imported ' . $_FILES['ls_file']['name']);

$msg = sprintf(__('Imported setting file %s successfully.', 'litespeed-cache'), $_FILES['ls_file']['name']);
Admin_Display::succeed($msg);
Admin_Display::success($msg);
} else {
Debug2::debug('Import: Imported ' . $file);
}
Expand All @@ -155,7 +155,7 @@ public function reset()
Debug2::debug('[Import] Reset successfully.');

$msg = __('Reset successfully.', 'litespeed-cache');
Admin_Display::succeed($msg);
Admin_Display::success($msg);
}

/**
Expand Down
Loading
Loading