Skip to content

Commit 4636900

Browse files
committed
PHPCS fixes.
1 parent 3548a71 commit 4636900

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

inc/dashboard/class-dashboard.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,14 +242,14 @@ public function add_admin_footer_internal_scripts() {
242242
#adminmenu .toplevel_page_botiga-dashboard .wp-submenu a[href="admin.php?page=botiga-dashboard"] {
243243
display: none;
244244
}
245-
#adminmenu .toplevel_page_botiga-dashboard .wp-submenu a[href="<?php echo botiga_upgrade_link( 'theme_submenu_page' ); ?>"] {
245+
#adminmenu .toplevel_page_botiga-dashboard .wp-submenu a[href="<?php echo esc_url( botiga_upgrade_link( 'theme_submenu_page' ) ); ?>"] {
246246
background-color: green;
247247
color: #FFF;
248248
}
249249
</style>
250250
<script type="text/javascript">
251251
document.addEventListener("DOMContentLoaded", function() {
252-
const botigaUpsellMenuItem = document.querySelector( '#adminmenu .toplevel_page_botiga-dashboard .wp-submenu a[href="<?php echo botiga_upgrade_link( 'theme_submenu_page' ); ?>"]' );
252+
const botigaUpsellMenuItem = document.querySelector( '#adminmenu .toplevel_page_botiga-dashboard .wp-submenu a[href="<?php echo esc_url( botiga_upgrade_link( 'theme_submenu_page' ) ); ?>"]' );
253253

254254
if ( ! botigaUpsellMenuItem ) {
255255
return;

inc/helpers.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,14 @@ function botiga_get_first_theme_version() {
186186
function botiga_utm_link( $link, $medium, $content = '', $term = '', $hashtag = '' ) {
187187
$mounted_link = add_query_arg(
188188
array_filter(
189-
[
189+
array(
190190
'utm_campaign' => defined( 'BOTIGA_PRO_VERSION' ) ? 'botiga-pro' : 'botiga-free',
191191
'utm_source' => strpos( $link, 'https://athemes.com' ) === 0 ? 'WordPress' : 'botiga',
192192
'utm_medium' => rawurlencode( $medium ),
193193
'utm_content' => rawurlencode( $content ),
194194
'utm_term' => rawurlencode( $term ),
195195
'utm_locale' => sanitize_key( get_locale() ),
196-
]
196+
)
197197
),
198198
$link
199199
);
@@ -210,7 +210,7 @@ function botiga_utm_link( $link, $medium, $content = '', $term = '', $hashtag =
210210
*
211211
* @return string
212212
*/
213-
function botiga_upgrade_link( $medium = 'link', $content = '', $hashtag = '' ) {
213+
function botiga_upgrade_link( $medium = 'link', $content = '', $hashtag = '' ) {
214214
$url = 'https://athemes.com/botiga-upgrade/';
215215

216216
if ( defined( 'BOTIGA_PRO_VERSION' ) ) {
@@ -223,11 +223,21 @@ function botiga_upgrade_link( $medium = 'link', $content = '', $hashtag = '' ) {
223223
);
224224
}
225225

226+
/**
227+
* Filter the upgrade link medium.
228+
*
229+
* @since 2.3.1
230+
*
231+
* @param string $medium Upgrade link medium.
232+
* @return string
233+
*/
226234
$upgrade = botiga_utm_link( $url, apply_filters( 'botiga_upgrade_link_medium', $medium ), $content, '', $hashtag );
227235

228236
/**
229237
* Filter the upgrade link.
230238
*
239+
* @since 2.3.1
240+
*
231241
* @param string $upgrade Upgrade links.
232242
*/
233243
return apply_filters( 'botiga_upgrade_link', $upgrade );

0 commit comments

Comments
 (0)