Skip to content

Commit 1807f90

Browse files
committed
remove hard-coded plugin names
1 parent fa590cb commit 1807f90

File tree

116 files changed

+464
-509
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+464
-509
lines changed

src/lib/src/ActionRouter/Actions/BlockdownFormSubmit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ protected function exec() {
1717
$form = $this->action_data[ 'form_data' ];
1818
try {
1919
if ( !$con->caps->canSiteBlockdown() ) {
20-
throw new \Exception( __( 'Please upgrade your ShieldPRO plan to make use of this feature.', 'wp-simple-firewall' ) );
20+
throw new \Exception( sprintf( __( 'Please upgrade your %s plan to make use of this feature.', 'wp-simple-firewall' ), self::con()->labels->Name ) );
2121
}
2222

2323
if ( empty( $form ) || !\is_array( $form ) ) {

src/lib/src/ActionRouter/Actions/LicenseClear.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ protected function exec() {
1212
$licHandler->clearLicense();
1313
$this->response()->action_response_data = [
1414
'success' => true,
15-
'message' => __( 'ShieldPRO License Cleared', 'wp-simple-firewall' ),
15+
'message' => sprintf( __( '%s License Cleared', 'wp-simple-firewall' ), self::con()->labels->Name ),
1616
'page_reload' => true,
1717
];
1818
}

src/lib/src/ActionRouter/Actions/MainWP/ServerActions/SiteActionActivate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ class SiteActionActivate extends BaseSiteMwpAction {
99
public const SLUG = 'mwp_server_site_action_activate';
1010

1111
protected function getMainwpActionFailureMessage() :string {
12-
return __( "Shield plugin couldn't be activated", 'wp-simple-firewall' );
12+
return sprintf( __( "%s plugin couldn't be activated", 'wp-simple-firewall' ), self::con()->labels->Name );
1313
}
1414

1515
protected function getMainwpActionSuccessMessage() :string {
16-
return __( 'Shield plugin activated', 'wp-simple-firewall' );
16+
return sprintf( __( '%s plugin activated', 'wp-simple-firewall' ), self::con()->labels->Name );
1717
}
1818

1919
protected function getMainwpActionParams() :array {

src/lib/src/ActionRouter/Actions/MainWP/ServerActions/SiteActionDeactivate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ class SiteActionDeactivate extends BaseSiteMwpAction {
99
public const SLUG = 'mwp_server_site_action_deactivate';
1010

1111
protected function getMainwpActionFailureMessage() :string {
12-
return __( "Shield plugin couldn't be deactivated", 'wp-simple-firewall' );
12+
return sprintf( __( "%s plugin couldn't be deactivated", 'wp-simple-firewall' ), self::con()->labels->Name );
1313
}
1414

1515
protected function getMainwpActionSuccessMessage() :string {
16-
return __( 'Shield plugin deactivated', 'wp-simple-firewall' );
16+
return sprintf( __( '%s plugin deactivated', 'wp-simple-firewall' ), self::con()->labels->Name );
1717
}
1818

1919
protected function getMainwpActionParams() :array {

src/lib/src/ActionRouter/Actions/MainWP/ServerActions/SiteActionInstall.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ class SiteActionInstall extends BaseSiteMwpAction {
99
public const SLUG = 'mwp_server_site_action_install';
1010

1111
protected function getMainwpActionFailureMessage() :string {
12-
return __( "Shield plugin couldn't be installed", 'wp-simple-firewall' );
12+
return sprintf( __( "%s plugin couldn't be installed", 'wp-simple-firewall' ), self::con()->labels->Name );
1313
}
1414

1515
protected function getMainwpActionSuccessMessage() :string {
16-
return __( 'Shield plugin installed', 'wp-simple-firewall' );
16+
return sprintf( __( '%s plugin installed', 'wp-simple-firewall' ), self::con()->labels->Name );
1717
}
1818

1919
protected function checkResponse() :bool {

src/lib/src/ActionRouter/Actions/MainWP/ServerActions/SiteActionUpdate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ class SiteActionUpdate extends BaseSiteMwpAction {
99
public const SLUG = 'mwp_server_site_action_update';
1010

1111
protected function getMainwpActionFailureMessage() :string {
12-
return __( "Shield plugin couldn't be updated", 'wp-simple-firewall' );
12+
return sprintf( __( "%s plugin couldn't be updated", 'wp-simple-firewall' ), self::con()->labels->Name );
1313
}
1414

1515
protected function getMainwpActionSuccessMessage() :string {
16-
return __( 'Shield plugin updated', 'wp-simple-firewall' );
16+
return sprintf( __( '%s plugin updated', 'wp-simple-firewall' ), self::con()->labels->Name );
1717
}
1818

1919
protected function checkResponse() :bool {

src/lib/src/ActionRouter/Actions/MainWP/ServerActions/SiteCustomAction.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ protected function checkResponse() :bool {
3333
$response = $this->clientActionResponse;
3434
$key = self::con()->prefix( 'mwp-action-response' );
3535
if ( empty( $response ) || !\is_array( $response ) || !isset( $response[ $key ] ) ) {
36-
throw new ActionException( __( 'Empty response from Shield client site', 'wp-simple-firewall' ) );
36+
throw new ActionException( sprintf( __( 'Empty response from %s client site', 'wp-simple-firewall' ), self::con()->labels->Name ) );
3737
}
3838

3939
$result = \json_decode( $response[ $key ], true );
4040
if ( empty( $result ) || !\is_array( $result ) ) {
41-
throw new ActionException( __( 'Invalid response from Shield client site', 'wp-simple-firewall' ) );
41+
throw new ActionException( sprintf( __( 'Invalid response from %s client site', 'wp-simple-firewall' ), self::con()->labels->Name ) );
4242
}
4343

4444
return true;
@@ -47,7 +47,7 @@ protected function checkResponse() :bool {
4747
protected function getMainwpActionFailureMessage() :string {
4848
switch ( $this->action_data[ 'sub_action_slug' ] ) {
4949
case LicenseLookup::SLUG:
50-
$msg = __( 'ShieldPRO license check failed.', 'wp-simple-firewall' );
50+
$msg = sprintf( __( '%s license check failed.', 'wp-simple-firewall' ), self::con()->labels->Name );
5151
break;
5252
default:
5353
$msg = parent::getMainwpActionFailureMessage();
@@ -59,7 +59,7 @@ protected function getMainwpActionFailureMessage() :string {
5959
protected function getMainwpActionSuccessMessage() :string {
6060
switch ( $this->action_data[ 'sub_action_slug' ] ) {
6161
case LicenseLookup::SLUG:
62-
$msg = __( 'ShieldPRO license check was successful.', 'wp-simple-firewall' );
62+
$msg = sprintf( __( '%s license check was successful.', 'wp-simple-firewall' ), self::con()->labels->Name );
6363
break;
6464
default:
6565
$msg = parent::getMainwpActionSuccessMessage();

src/lib/src/ActionRouter/Actions/PluginAdmin/PluginAdminPageHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ protected function addSubMenuItems() {
108108
PluginNavs::NAV_REPORTS => __( 'Reports', 'wp-simple-firewall' ),
109109
];
110110
if ( !self::con()->isPremiumActive() ) {
111-
$navs[ PluginNavs::NAV_LICENSE ] = sprintf( '<span class="shield_highlighted_menu">%s</span>', 'ShieldPRO' );
111+
$navs[ PluginNavs::NAV_LICENSE ] = sprintf( '<span class="shield_highlighted_menu">%s</span>', self::con()->labels->Name );
112112
}
113113

114114
$currentNav = $this->action_data[ Constants::NAV_ID ] ?? '';

0 commit comments

Comments
 (0)