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

Release for v1.0.1 #5

Merged
merged 39 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3413a8e
Initial commit
jeawhanlee Oct 15, 2024
d8ec457
Added phpcs
jeawhanlee Oct 15, 2024
f92f8d5
Added lint config
jeawhanlee Oct 15, 2024
f402c43
Updated config file
jeawhanlee Oct 15, 2024
7742694
Added gitignore
jeawhanlee Oct 15, 2024
4cbcbc2
Fixed phpcs errors
jeawhanlee Oct 15, 2024
1bd7fcf
Ignore composer.lock
jeawhanlee Oct 15, 2024
1e10a4b
Added tests
jeawhanlee Oct 15, 2024
5553a85
Added patchwork config
jeawhanlee Oct 15, 2024
88ea2d3
Updated composer packages and script
jeawhanlee Oct 15, 2024
d53b905
Updated method
jeawhanlee Oct 15, 2024
a514056
Updated namespace
jeawhanlee Oct 15, 2024
14f6702
Updated namespace and methods
jeawhanlee Oct 15, 2024
a191bd0
Added test workflow
jeawhanlee Oct 15, 2024
e2f0d80
Remove test cache
jeawhanlee Oct 15, 2024
3672163
Ignore test cache
jeawhanlee Oct 15, 2024
d5af0e3
Updated README
jeawhanlee Oct 16, 2024
58cf829
Updated README
jeawhanlee Oct 16, 2024
d0002d4
Updated README
jeawhanlee Oct 16, 2024
4e9ae88
Updated README
jeawhanlee Oct 16, 2024
4b11dda
Updated test
jeawhanlee Oct 16, 2024
4bec6fe
Updated README
jeawhanlee Oct 17, 2024
d12ca1d
Updated namespace
jeawhanlee Oct 17, 2024
a23f4dc
Added phpstan
jeawhanlee Oct 17, 2024
f8454ab
Fixed phpstan errors
jeawhanlee Oct 17, 2024
ecf9f67
Updated composer.json
jeawhanlee Oct 17, 2024
ce0f113
Added phpstan config
jeawhanlee Oct 17, 2024
2c7bb56
Added workflow file for phpstan
jeawhanlee Oct 17, 2024
e25931f
Updated namespace
jeawhanlee Oct 17, 2024
276981e
use defined var
jeawhanlee Oct 17, 2024
a72f32d
Updated README
jeawhanlee Oct 17, 2024
7bf9c44
Updated tests
jeawhanlee Oct 18, 2024
193a534
Make wp rocket referrer dynamic
jeawhanlee Oct 21, 2024
9453a5f
Updated data
jeawhanlee Oct 21, 2024
e198429
Updated tests
jeawhanlee Oct 21, 2024
13ddeee
Added git attribute file
jeawhanlee Oct 21, 2024
d62f483
Fixed phpcs
jeawhanlee Oct 21, 2024
51bbb1f
Merge pull request #4 from wp-media/enhancement/3-update-wp-rocket-ge…
jeawhanlee Oct 21, 2024
05363d6
Fixed Conflicts
jeawhanlee Oct 21, 2024
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
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.github export-ignore
tests export-ignore
.gitattributes export-ignore
.gitignore export-ignore
patchwork.json export-ignore
phpcs.xml export-ignore
phpstan.neon.dist export-ignore
README.md export-ignore

20 changes: 19 additions & 1 deletion src/Model/PluginFamily.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@
* Handles the data to be passed to the frontend.
*/
class PluginFamily {

/**
* An array of referrers for wp rocket.
*
* @var array
*/
protected $wp_rocket_referrer = [
'imagify-plugin' => 'imagify',
'seo-by-rank-math' => '',
'backwpup' => '',
'uk-cookie-consent' => '',
];

/**
* Get filtered plugins.
*
Expand Down Expand Up @@ -40,6 +53,7 @@ public function filter_plugins_by_activation( array $plugins, string $main_plugi
$plugin_path = $plugin . '.php';
$plugin_slug = dirname( $plugin );
$main_plugin_slug = dirname( $main_plugin );
$wpr_referrer = 'wp-rocket' !== $main_plugin_slug ? $this->wp_rocket_referrer[ $main_plugin_slug ] : '';

/**
* Check for activated plugins and pop them out of the array
Expand Down Expand Up @@ -96,10 +110,14 @@ public function filter_plugins_by_activation( array $plugins, string $main_plugi

// Create unique CTA data for WP Rocket.
if ( 'wp-rocket/wp-rocket' === $plugin ) {
$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',
'url' => 'https://wp-rocket.me/?utm_source=imagify-coupon&utm_medium=plugin&utm_campaign=imagify',
'url' => $url,
];

$plugins[ $cat ]['plugins'][ $plugin ]['link'] = $url;
}

// Set activation text.
Expand Down
2 changes: 1 addition & 1 deletion src/Model/wp_media_plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
'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.',
'link' => 'https://wp-rocket.me/?utm_source=imagify-coupon&utm_medium=plugin&utm_campaign=imagify',
'link' => '',
],
'imagify-plugin/imagify' => [
'logo' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
],
'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.',
'link' => 'https://wp-rocket.me/?utm_source=imagify-coupon&utm_medium=plugin&utm_campaign=imagify',
'link' => 'https://wp-rocket.me/?utm_source=-coupon&utm_medium=plugin&utm_campaign=',
'cta' => [
'text' => 'Activate',
'url' => 'http://example.org/wp-admin/admin-post.php?action=plugin_family_install_wp-rocket&_wpnonce=9a68f00b8d&plugin_to_install=wp-rocket%2Fwp-rocket'
Expand Down Expand Up @@ -251,10 +251,10 @@
],
'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.',
'link' => 'https://wp-rocket.me/?utm_source=imagify-coupon&utm_medium=plugin&utm_campaign=imagify',
'link' => 'https://wp-rocket.me/?utm_source=-coupon&utm_medium=plugin&utm_campaign=',
'cta' => [
'text' => 'Get it Now',
'url' => 'https://wp-rocket.me/?utm_source=imagify-coupon&utm_medium=plugin&utm_campaign=imagify'
'url' => 'https://wp-rocket.me/?utm_source=-coupon&utm_medium=plugin&utm_campaign='
],
],
'imagify-plugin/imagify' => [
Expand Down
Loading