class-bsr-plugin-footer.php
2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
/**
* Plugin footer functionality for the plugin
*
* @since 1.4.3
*
* @package Better_Search_Replace
* @subpackage Better_Search_Replace/includes
*/
// Prevent direct access.
if ( ! defined( 'BSR_PATH' ) ) exit;
class BSR_Plugin_Footer {
/**
* Filter admin footer text for BSR pages
*
* @param string $text
* @return string
* @handles admin_footer_text
**/
public function admin_footer_text( $text ) {
if ( ! BSR_Utils::is_bsr_screen() ) {
return $text;
}
$product_link = BSR_Utils::external_link(
BSR_Utils::bsr_url(
'',
[
'utm_source' => 'bsr_free',
'utm_medium' => 'insideplugin',
'utm_campaign' => 'plugin_footer',
'utm_content' => 'footer_colophon'
]
),
BSR_NAME
);
$wpe_link = BSR_Utils::external_link(
BSR_Utils::wpe_url(
'',
[
'utm_source' => 'bsr_plugin',
'utm_content' => 'bsr_free_plugin_footer_text'
]
),
'WP Engine'
);
return sprintf(
/* translators: %1$s is a link to BSR's website, and %2$s is a link to WP Engine's website. */
__( '%1$s is developed and maintained by %2$s.', 'better-search-replace' ),
$product_link,
$wpe_link
);
}
/**
* Filter update footer text for BSR pages
*
* @param string $content
* @return string
* @handles update_footer
**/
public function update_footer( $content ) {
if ( ! BSR_Utils::is_bsr_screen() ) {
return $content;
}
$utm_params = [
'utm_source' => 'bsr_free',
'utm_campaign' => 'plugin_footer',
'utm_content' => 'footer_navigation'
];
$links[] = BSR_Utils::external_link(
BSR_Utils::bsr_url(
'/docs/',
$utm_params
),
__( 'Documentation', 'better-search-replace' )
);
$links[] = '<a href="' . BSR_Utils::plugin_page_url() . '&tab=bsr_help">' . __( 'Support', 'better-search-replace' ) . '</a>';
$links[] = BSR_Utils::external_link(
BSR_Utils::bsr_url(
'/feedback/',
$utm_params
),
__( 'Feedback', 'better-search-replace' )
);
if ( defined( 'BSR_NAME' ) && defined( 'BSR_VERSION' ) ) {
$links[] = BSR_NAME . ' ' . BSR_VERSION;
}
return join( ' ∙ ', $links );
}
}