From 05550687c0d005abc1df54189d3ba125d64115c9 Mon Sep 17 00:00:00 2001 From: Michael Lee Date: Fri, 29 Nov 2024 11:36:01 +0100 Subject: [PATCH 1/2] Added package config --- composer.json | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index a0b09553..16afbb3f 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ "php": ">=7.0", "composer/installers": "^1.0 || ^2.0", "dangoodman/composer-for-wordpress": "^2.0", - "wp-media/plugin-family": "^1.0" + "wp-media/plugin-family": "^1.0.3" }, "require-dev": { "php": "^7 || ^8", @@ -95,7 +95,8 @@ "league/container", "wp-media/plugin-family" ] - } + }, + "plugin_domain": "imagify" }, "scripts": { "test-unit":"\"vendor/bin/phpunit\" --testsuite unit --colors=always --configuration Tests/Unit/phpunit.xml.dist", @@ -111,11 +112,13 @@ ], "post-install-cmd": [ "[ $COMPOSER_DEV_MODE -eq 0 ] || \"vendor/bin/mozart\" compose", - "composer dump-autoload" + "composer dump-autoload", + "Imagify\\Dependencies\\WPMedia\\PluginFamily\\PostInstall::apply_text_domain" ], "post-update-cmd": [ "[ $COMPOSER_DEV_MODE -eq 0 ] || \"vendor/bin/mozart\" compose", - "composer dump-autoload" + "composer dump-autoload", + "Imagify\\Dependencies\\WPMedia\\PluginFamily\\PostInstall::apply_text_domain" ], "code-coverage": "\"vendor/bin/phpunit\" --testsuite unit --colors=always --configuration Tests/Unit/phpunit.xml.dist --coverage-clover=tests/report/coverage.clover" } From 697472817bfbd037478771808aa0e7996986d946 Mon Sep 17 00:00:00 2001 From: Michael Lee Date: Fri, 29 Nov 2024 11:36:18 +0100 Subject: [PATCH 2/2] Updated package --- .../PluginFamily/Model/PluginFamily.php | 8 +++--- .../PluginFamily/Model/wp_media_plugins.php | 26 +++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/classes/Dependencies/WPMedia/PluginFamily/Model/PluginFamily.php b/classes/Dependencies/WPMedia/PluginFamily/Model/PluginFamily.php index 2bcbe0c0..2005aec8 100644 --- a/classes/Dependencies/WPMedia/PluginFamily/Model/PluginFamily.php +++ b/classes/Dependencies/WPMedia/PluginFamily/Model/PluginFamily.php @@ -63,7 +63,7 @@ public function filter_plugins_by_activation( array $plugins, string $main_plugi if ( is_plugin_active( $plugin_path ) && $main_plugin . '.php' !== $plugin_path ) { // set cta data of active plugins. $plugins[ $cat ]['plugins'][ $plugin ]['cta'] = [ - 'text' => 'Activated', + 'text' => __( 'Activated', 'imagify' ), 'url' => '#', ]; @@ -106,7 +106,7 @@ public function filter_plugins_by_activation( array $plugins, string $main_plugi // Set Installation link. $plugins[ $cat ]['plugins'][ $plugin ]['cta'] = [ - 'text' => 'Install', + 'text' => __( 'Install', 'imagify' ), 'url' => $install_activate_url, ]; @@ -115,7 +115,7 @@ public function filter_plugins_by_activation( array $plugins, string $main_plugi $url = 'https://wp-rocket.me/?utm_source=' . $wpr_referrer . '-coupon&utm_medium=plugin&utm_campaign=' . $wpr_referrer; $plugins[ $cat ]['plugins'][ $plugin ]['cta'] = [ - 'text' => 'Get it Now', + 'text' => __( 'Get it Now', 'imagify' ), 'url' => $url, ]; @@ -124,7 +124,7 @@ public function filter_plugins_by_activation( array $plugins, string $main_plugi // Set activation text. if ( file_exists( WP_PLUGIN_DIR . '/' . $plugin_path ) ) { - $plugins[ $cat ]['plugins'][ $plugin ]['cta']['text'] = 'Activate'; + $plugins[ $cat ]['plugins'][ $plugin ]['cta']['text'] = __( 'Activate', 'imagify' ); if ( 'wp-rocket/wp-rocket' === $plugin ) { $plugins[ $cat ]['plugins'][ $plugin ]['cta']['url'] = $install_activate_url; diff --git a/classes/Dependencies/WPMedia/PluginFamily/Model/wp_media_plugins.php b/classes/Dependencies/WPMedia/PluginFamily/Model/wp_media_plugins.php index e1a1e296..1bf181b1 100644 --- a/classes/Dependencies/WPMedia/PluginFamily/Model/wp_media_plugins.php +++ b/classes/Dependencies/WPMedia/PluginFamily/Model/wp_media_plugins.php @@ -5,15 +5,15 @@ return [ 'optimize_performance' => [ - 'title' => 'Optimize Performance', + 'title' => __( 'Optimize Performance', 'imagify' ), 'plugins' => [ 'wp-rocket/wp-rocket' => [ 'logo' => [ 'file' => 'logo-wp-rocket.svg', 'width' => '50%', ], - 'title' => 'Speed Up Your Website, Instantly', - 'desc' => 'WP Rocket is the easiest way to make your WordPress website faster and boost your Google PageSpeed score. Get more traffic, better engagement, and higher conversions effortlessly.', + 'title' => __( 'Speed Up Your Website, Instantly', 'imagify' ), + 'desc' => __( 'WP Rocket is the easiest way to make your WordPress website faster and boost your Google PageSpeed score. Get more traffic, better engagement, and higher conversions effortlessly.', 'imagify' ), 'link' => '', ], 'imagify/imagify' => [ @@ -21,36 +21,36 @@ 'file' => 'logo-imagify.svg', 'width' => '50%', ], - 'title' => 'Speed Up Your Website With Lighter Images', - 'desc' => 'Imagify is the easiest WordPress image optimizer. It automatically compresses images, converts them to WebP and AVIF formats, and lets you resize and optimize with just one click!', + 'title' => __( 'Speed Up Your Website With Lighter Images', 'imagify' ), + 'desc' => __( 'Imagify is the easiest WordPress image optimizer. It automatically compresses images, converts them to WebP and AVIF formats, and lets you resize and optimize with just one click!', 'imagify' ), 'link' => 'https://imagify.io/', ], ], ], 'boost_traffic' => [ - 'title' => 'Boost Traffic', + 'title' => __( 'Boost Traffic', 'imagify' ), 'plugins' => [ 'seo-by-rank-math/rank-math' => [ 'logo' => [ 'file' => 'logo-rank-math.svg', 'width' => '60%', ], - 'title' => 'The Swiss Army Knife of SEO Tools', - 'desc' => 'Rank Math SEO is the Best WordPress SEO plugin with the features of many SEO and AI SEO tools in a single package to help multiply your SEO traffic.', + 'title' => __( 'The Swiss Army Knife of SEO Tools', 'imagify' ), + 'desc' => __( 'Rank Math SEO is the Best WordPress SEO plugin with the features of many SEO and AI SEO tools in a single package to help multiply your SEO traffic.', 'imagify' ), 'link' => 'https://rankmath.com/wordpress/plugin/seo-suite/', ], ], ], 'protect_secure' => [ - 'title' => 'Protect & Secure', + 'title' => __( 'Protect & Secure', 'imagify' ), 'plugins' => [ 'backwpup/backwpup' => [ 'logo' => [ 'file' => 'logo-backwpup.svg', 'width' => '60%', ], - 'title' => 'The Easiest Way to Protect Your Website', - 'desc' => 'BackWPup is the most comprehensive and user-friendly backup & restore plugin for WordPress. Easily schedule automatic backups, securely store and restore with just a few clicks!', + 'title' => __( 'The Easiest Way to Protect Your Website', 'imagify' ), + 'desc' => __( 'BackWPup is the most comprehensive and user-friendly backup & restore plugin for WordPress. Easily schedule automatic backups, securely store and restore with just a few clicks!', 'imagify' ), 'link' => 'https://backwpup.com/', ], 'uk-cookie-consent/uk-cookie-consent' => [ @@ -58,8 +58,8 @@ 'file' => 'logo-termly.svg', 'width' => '50%', ], - 'title' => 'GDPR/CCPA Cookie Consent Banner', - 'desc' => 'One of the easiest, most comprehensive, and popular cookie consent plugins available. Google Gold Certified Partner to quickly comply with data privacy laws from around the world.', + 'title' => __( 'GDPR/CCPA Cookie Consent Banner', 'imagify' ), + 'desc' => __( 'One of the easiest, most comprehensive, and popular cookie consent plugins available. Google Gold Certified Partner to quickly comply with data privacy laws from around the world.', 'imagify' ), 'link' => 'https://termly.io/resources/articles/wordpress-cookies-guide/', ], ],