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

Remove 'native-gettext' in favor of 'performant-translations' #40

Merged
merged 12 commits into from
Feb 22, 2024
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Thoose are completely managed by code and lack of their typical UI.
* [Cache-Control](https://github.com/carstingaxion/wordpress-cache-control)
* [Cache Enabler](https://wordpress.org/plugins/cache-enabler/#developers)
* [Fast404](https://wordpress.org/plugins/fast404/#developers)
* [Native Gettext](https://wordpress.org/plugins/native-gettext/#developers)
* [Performant Translations](https://wordpress.org/plugins/performant-translations/#developers)
* [PWA](https://wordpress.org/plugins/pwa/#developers)
* [Quicklink for WordPress](https://wordpress.org/plugins/quicklink/#developers)
* [SQLite Object Cache](https://wordpress.org/plugins/sqlite-object-cache/#developers)
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"figuren-theater/ft-theming": "*",
"wpackagist-plugin/cache-enabler": "1.8.13",
"wpackagist-plugin/fast404": "1.2",
"wpackagist-plugin/native-gettext": "1.1.2",
"wpackagist-plugin/performant-translations": "^1.1",
"wpackagist-plugin/pwa": "0.7.1",
"wpackagist-plugin/quicklink": "0.10.0",
"wpackagist-plugin/sqlite-object-cache": "1.3.7"
Expand Down Expand Up @@ -68,7 +68,7 @@
"inc/cache-control/namespace.php",
"inc/cache-enabler/namespace.php",
"inc/fast404/namespace.php",
"inc/native-gettext/namespace.php",
"inc/performant-translations/namespace.php",
"inc/pwa/namespace.php",
"inc/quicklink/namespace.php",
"inc/sqlite-object-cache/namespace.php",
Expand All @@ -92,7 +92,7 @@
"carstingaxion/wp-super-preload",
"wpackagist-plugin/cache-enabler",
"wpackagist-plugin/fast404",
"wpackagist-plugin/native-gettext",
"wpackagist-plugin/performant-translations",
"wpackagist-plugin/pwa",
"wpackagist-plugin/quicklink"
]
Expand Down
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions inc/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ function register(): void {

'cache-control' => $use_cache,
'cache-enabler' => $use_cache,
'native-gettext' => true,
'pwa' => false,
'quicklink' => $use_cache,
'sqlite-object-cache' => $use_cache, // This file will be installed from this plugin, no chance to check against $use_mem_cache from here.
Expand Down Expand Up @@ -54,7 +53,7 @@ function bootstrap(): void {
Cache_Control\bootstrap();
Cache_Enabler\bootstrap();
Fast404\bootstrap();
Native_Gettext\bootstrap();
Performant_Translations\bootstrap();
PWA\bootstrap();
Quicklink\bootstrap();
Sqlite_Object_Cache\bootstrap();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
<?php
/**
* Figuren_Theater Performance Native_Gettext.
* Figuren_Theater Performance Performant_Translations.
*
* @package figuren-theater/ft-performance
*/

namespace Figuren_Theater\Performance\Native_Gettext;

use Figuren_Theater;
namespace Figuren_Theater\Performance\Performant_Translations;

use FT_VENDOR_DIR;
use function add_action;

const BASENAME = 'native-gettext/native-gettext.php';
const BASENAME = 'performant-translations/performant-translations.php';
const PLUGINPATH = '/wpackagist-plugin/' . BASENAME;

/**
Expand All @@ -22,7 +20,7 @@
*/
function bootstrap(): void {

add_action( 'plugins_loaded', __NAMESPACE__ . '\\load_plugin', 0 );
add_action( 'plugins_loaded', __NAMESPACE__ . '\\load_plugin' );
}

/**
Expand All @@ -32,10 +30,5 @@ function bootstrap(): void {
*/
function load_plugin(): void {

$config = Figuren_Theater\get_config()['modules']['performance'];
if ( ! $config['native-gettext'] ) {
return;
}

require_once FT_VENDOR_DIR . PLUGINPATH; // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingCustomConstant
}