Skip to content

Commit

Permalink
Merge pull request #7 from wp-media/fix/imagify-plugin-path
Browse files Browse the repository at this point in the history
Fix #6 Imagify plugin path not correct
  • Loading branch information
jeawhanlee authored Oct 25, 2024
2 parents 05363d6 + 8f58f0d commit e664dde
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class View {
}

public function display_page() {
$plugin_family = $this->plugin_family->get_filtered_plugins( 'imagify-plugin/imagify' );
$plugin_family = $this->plugin_family->get_filtered_plugins( 'imagify/imagify' );

$data = [
'plugin_family' => $plugin_family['uncategorized'],
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/PluginFamily.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static function get_post_install_event(): array {
$allowed_plugin = [
'uk-cookie-consent',
'backwpup',
'imagify-plugin',
'imagify',
'seo-by-rank-math',
'wp-rocket',
];
Expand Down
4 changes: 2 additions & 2 deletions src/Model/PluginFamily.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class PluginFamily {
* @var array
*/
protected $wp_rocket_referrer = [
'imagify-plugin' => 'imagify',
'imagify' => 'imagify',
'seo-by-rank-math' => '',
'backwpup' => '',
'uk-cookie-consent' => '',
Expand Down Expand Up @@ -92,7 +92,7 @@ public function filter_plugins_by_activation( array $plugins, string $main_plugi
'plugin_to_install' => rawurlencode( $plugin ),
];

if ( 'imagify-plugin' === $plugin_slug ) {
if ( 'imagify' === $plugin_slug ) {
$args = [
'action' => 'install_imagify_from_partner_' . $main_plugin_slug,
'_wpnonce' => wp_create_nonce( 'install_imagify_from_partner' ),
Expand Down
4 changes: 2 additions & 2 deletions src/Model/wp_media_plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
'optimize_performance' => [
'title' => 'Optimize Performance',
'plugins' => [
'wp-rocket/wp-rocket' => [
'wp-rocket/wp-rocket' => [
'logo' => [
'file' => 'logo-wp-rocket.svg',
'width' => '50%',
Expand All @@ -16,7 +16,7 @@
'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.',
'link' => '',
],
'imagify-plugin/imagify' => [
'imagify/imagify' => [
'logo' => [
'file' => 'logo-imagify.svg',
'width' => '50%',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
'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.',
'link' => 'https://wp-rocket.me/?utm_source=imagify-coupon&utm_medium=plugin&utm_campaign=imagify',
],
'imagify-plugin/imagify' => [
'imagify/imagify' => [
'logo' => [
'file' => 'logo-imagify.svg',
'width' => '50%',
Expand Down Expand Up @@ -116,7 +116,7 @@
'optimize_performance' => [
'title' => 'Optimize Performance',
'plugins' => [
'imagify-plugin/imagify' => [
'imagify/imagify' => [
'logo' => [
'file' => 'logo-imagify.svg',
'width' => '50%',
Expand Down Expand Up @@ -202,7 +202,7 @@
'url' => 'http://example.org/wp-admin/admin-post.php?action=plugin_family_install_wp-rocket&_wpnonce=9a68f00b8d&plugin_to_install=wp-rocket%2Fwp-rocket'
],
],
'imagify-plugin/imagify' => [
'imagify/imagify' => [
'logo' => [
'file' => 'logo-imagify.svg',
'width' => '50%',
Expand Down Expand Up @@ -257,7 +257,7 @@
'url' => 'https://wp-rocket.me/?utm_source=-coupon&utm_medium=plugin&utm_campaign='
],
],
'imagify-plugin/imagify' => [
'imagify/imagify' => [
'logo' => [
'file' => 'logo-imagify.svg',
'width' => '50%',
Expand Down Expand Up @@ -312,14 +312,14 @@
'plugins' => $plugins,
'main_plugin' => 'wp-rocket/wp-rocket',
'order' => 'categorized',
'active_plugin' => 'imagify-plugin/imagify.php',
'active_plugin' => 'imagify/imagify.php',
],
'expected' => $expectedActivePluginAsTheLastElement,
],
'testShouldReturnCategoryWithActivePluginAsTheLastElement' => [
'config' => [
'plugins' => $plugins,
'main_plugin' => 'imagify-plugin/imagify',
'main_plugin' => 'imagify/imagify',
'order' => 'uncategorized',
'active_plugin' => 'seo-by-rank-math/rank-math.php',
],
Expand Down

0 comments on commit e664dde

Please sign in to comment.