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

Add PHPCS check for text domain, fix existing incorrect text domains #110

Closed
wants to merge 2 commits into from
Closed
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 includes/HealthChecks/PersistentObjectCacheHealthCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function __construct() {
'<a href="%1$s" target="_blank" rel="noopener">%2$s</a><span class="screen-reader-text"> (%3$s)</span><span aria-hidden="true" class="dashicons dashicons-external"></span>',
'https://www.bluehost.com/help/article/object-caching',
esc_html__( 'Learn more about object caching', 'wp-module-performance' ),
__( 'opens in a new tab', 'newfold-module-performance' )
__( 'opens in a new tab', 'wp-module-performance' )
);
}

Expand Down
12 changes: 6 additions & 6 deletions includes/Performance.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,14 @@ public function adminBarMenu( \WP_Admin_Bar $wp_admin_bar ) {
$wp_admin_bar->add_node(
array(
'id' => 'nfd_purge_menu',
'title' => __( 'Caching', 'newfold-module-performance' ),
'title' => __( 'Caching', 'wp-module-performance' ),
)
);

$wp_admin_bar->add_node(
array(
'id' => 'nfd_purge_menu-purge_all',
'title' => __( 'Purge All', 'newfold-module-performance' ),
'title' => __( 'Purge All', 'wp-module-performance' ),
'parent' => 'nfd_purge_menu',
'href' => add_query_arg( array( self::PURGE_ALL => true ) ),
)
Expand All @@ -273,7 +273,7 @@ public function adminBarMenu( \WP_Admin_Bar $wp_admin_bar ) {
$wp_admin_bar->add_node(
array(
'id' => 'nfd_purge_menu-purge_single',
'title' => __( 'Purge This Page', 'newfold-module-performance' ),
'title' => __( 'Purge This Page', 'wp-module-performance' ),
'parent' => 'nfd_purge_menu',
'href' => add_query_arg( array( self::PURGE_URL => true ) ),
)
Expand All @@ -284,7 +284,7 @@ public function adminBarMenu( \WP_Admin_Bar $wp_admin_bar ) {
$wp_admin_bar->add_node(
array(
'id' => 'nfd_purge_menu-cache_settings',
'title' => __( 'Cache Settings', 'newfold-module-performance' ),
'title' => __( 'Cache Settings', 'wp-module-performance' ),
'parent' => 'nfd_purge_menu',
'href' => admin_url( "admin.php?page=$brand#/performance" ),
)
Expand All @@ -297,8 +297,8 @@ public function adminBarMenu( \WP_Admin_Bar $wp_admin_bar ) {
public function add_sub_menu_page() {
$brand = $this->container->get( 'plugin' )['id'];
add_management_page(
__( 'Performance', 'newfold-performance-module' ),
__( 'Performance', 'newfold-performance-module' ),
__( 'Performance', 'wp-module-performance' ),
__( 'Performance', 'wp-module-performance' ),
'manage_options',
admin_url( "admin.php?page=$brand#/performance" ),
null,
Expand Down
8 changes: 4 additions & 4 deletions includes/RestApi/JetpackController.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function set_options( $request ) {
return new \WP_REST_Response(
array(
'success' => false,
'error' => __( "The parameter 'field' is missing or invalid.", 'newfold-performance-module' ),
'error' => __( "The parameter 'field' is missing or invalid.", 'wp-module-performance' ),
),
400
);
Expand All @@ -76,7 +76,7 @@ public function set_options( $request ) {
return new \WP_REST_Response(
array(
'success' => false,
'error' => __( "The fields 'id' and 'value' are required.", 'newfold-performance-module' ),
'error' => __( "The fields 'id' and 'value' are required.", 'wp-module-performance' ),
),
400
);
Expand All @@ -100,7 +100,7 @@ public function set_options( $request ) {
return new \WP_REST_Response(
array(
'success' => false,
'error' => __( 'An error occurred while updating the option.', 'newfold-performance-module' ),
'error' => __( 'An error occurred while updating the option.', 'wp-module-performance' ),
),
500
);
Expand All @@ -120,7 +120,7 @@ public function set_options( $request ) {
return new \WP_REST_Response(
array(
'success' => false,
'error' => __( 'An error occurred while updating the option.', 'newfold-performance-module' ) . $e->getMessage(),
'error' => __( 'An error occurred while updating the option.', 'wp-module-performance' ) . $e->getMessage(),
),
500
);
Expand Down
8 changes: 4 additions & 4 deletions includes/RestApi/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function set_options( $request ) {
return new \WP_REST_Response(
array(
'success' => false,
'error' => __( "The parameter 'field' is missing or invalid.", 'newfold-performance-module' ),
'error' => __( "The parameter 'field' is missing or invalid.", 'wp-module-performance' ),
),
400
);
Expand All @@ -71,7 +71,7 @@ public function set_options( $request ) {
return new \WP_REST_Response(
array(
'success' => false,
'error' => __( "The fields 'id' and 'value' are required.", 'newfold-performance-module' ),
'error' => __( "The fields 'id' and 'value' are required.", 'wp-module-performance' ),
),
400
);
Expand All @@ -90,7 +90,7 @@ public function set_options( $request ) {
return new \WP_REST_Response(
array(
'success' => false,
'error' => __( 'An error occurred while updating the option.', 'newfold-performance-module' ),
'error' => __( 'An error occurred while updating the option.', 'wp-module-performance' ),
),
500
);
Expand All @@ -110,7 +110,7 @@ public function set_options( $request ) {
return new \WP_REST_Response(
array(
'success' => false,
'error' => __( 'An error occurred while updating the option.', 'newfold-performance-module' ) . $e->getMessage(),
'error' => __( 'An error occurred while updating the option.', 'wp-module-performance' ) . $e->getMessage(),
),
500
);
Expand Down
4 changes: 2 additions & 2 deletions includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function getCacheLevelDropdown() { // phpcs:ignore WordPress.NamingConventions.V
$currentCacheLevel = getCacheLevel();

$name = CacheManager::OPTION_CACHE_LEVEL;
$label = __( 'Cache Level', 'newfold-performance-module' );
$label = __( 'Cache Level', 'wp-module-performance' );
?>
<select name="<?php echo esc_attr( $name ); ?>" aria-label="<?php echo esc_attr( $label ); ?>">
<?php foreach ( $cacheLevels as $cacheLevel => $optionLabel ) : ?>
Expand All @@ -72,7 +72,7 @@ function getSkip404Option() { // phpcs:ignore WordPress.NamingConventions.ValidF
function getSkip404InputField() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
$name = Skip404::OPTION_SKIP_404;
$value = getSkip404Option();
$label = __( 'Skip WordPress 404 Handling for Static Files', 'newfold-performance-module' );
$label = __( 'Skip WordPress 404 Handling for Static Files', 'wp-module-performance' );
?>
<input
type="checkbox"
Expand Down
5 changes: 5 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
</rule>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array" value="wp-module-performance" />
</properties>
</rule>
</ruleset>
Loading