Remove WP\Functions::__ and other translate functions

Under the new sniffer rules, those functions produce errors and, when those methods
are used, the sniffer can not properly be applied.

[MAILPOET-4524]
This commit is contained in:
David Remer
2022-08-04 12:54:09 +03:00
committed by Veljko V
parent 0b2b211b08
commit b05e6d414c
156 changed files with 645 additions and 719 deletions

View File

@@ -34,7 +34,7 @@ class Premium extends APIEndpoint {
public function installPlugin() {
$premiumKeyValid = $this->servicesChecker->isPremiumKeyValid(false);
if (!$premiumKeyValid) {
return $this->error($this->wp->__('Premium key is not valid.', 'mailpoet'));
return $this->error(__('Premium key is not valid.', 'mailpoet'));
}
$pluginInfo = $this->wp->pluginsApi('plugin_information', [
@@ -42,13 +42,13 @@ class Premium extends APIEndpoint {
]);
if (!$pluginInfo || $pluginInfo instanceof WP_Error) {
return $this->error($this->wp->__('Error when installing MailPoet Premium plugin.', 'mailpoet'));
return $this->error(__('Error when installing MailPoet Premium plugin.', 'mailpoet'));
}
$pluginInfo = (array)$pluginInfo;
$result = $this->wp->installPlugin($pluginInfo['download_link']);
if ($result !== true) {
return $this->error($this->wp->__('Error when installing MailPoet Premium plugin.', 'mailpoet'));
return $this->error(__('Error when installing MailPoet Premium plugin.', 'mailpoet'));
}
return $this->successResponse();
}
@@ -56,12 +56,12 @@ class Premium extends APIEndpoint {
public function activatePlugin() {
$premiumKeyValid = $this->servicesChecker->isPremiumKeyValid(false);
if (!$premiumKeyValid) {
return $this->error($this->wp->__('Premium key is not valid.', 'mailpoet'));
return $this->error(__('Premium key is not valid.', 'mailpoet'));
}
$result = $this->wp->activatePlugin(self::PREMIUM_PLUGIN_PATH);
if ($result !== null) {
return $this->error($this->wp->__('Error when activating MailPoet Premium plugin.', 'mailpoet'));
return $this->error(__('Error when activating MailPoet Premium plugin.', 'mailpoet'));
}
return $this->successResponse();
}