Skip to content

Commit a96c321

Browse files
authored
Fixed PHP warning
Fixes #219
1 parent 1add1a5 commit a96c321

File tree

1 file changed

+37
-34
lines changed

1 file changed

+37
-34
lines changed

includes/admin/class-settings.php

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
*/
2525
class Settings {
2626

27+
2728
/**
2829
* Settings API instance.
2930
*
@@ -696,7 +697,7 @@ public static function settings_list() {
696697
'id' => 'cornerstone_post_ids',
697698
'name' => esc_html__( 'Cornerstone IDs', 'contextual-related-posts' ),
698699
'desc' => sprintf(
699-
/* translators: 1: Opening anchor tag, 2: Closing anchor tag */
700+
/* translators: 1: Opening anchor tag, 2: Closing anchor tag */
700701
esc_html__( 'Comma-separated list of post/page or custom post type IDs to be used as cornerstone posts. Posts with these IDs will be randomly selected and then included in the list of related posts. Roughly 20%% of the related posts will be chosen from this list. Learn more about %1$sCornerstone Posts%2$s.', 'contextual-related-posts' ),
701702
'<a href="https://webberzone.com/support/knowledgebase/cornerstone-posts-in-contextual-related-posts/" target="_blank">',
702703
'</a>'
@@ -1077,7 +1078,7 @@ public static function settings_feed() {
10771078
*/
10781079
public static function settings_performance() {
10791080
$custom_tables_desc = sprintf(
1080-
/* translators: 1: Opening a tag, 2: Closing a tag */
1081+
/* translators: 1: Opening a tag, 2: Closing a tag */
10811082
esc_html__( 'Efficient Content Storage and Indexing (ECSI) creates a dedicated database table optimized for related content queries. This enhances performance, particularly on sites with a large number of posts or high traffic. To create the ECSI tables, visit the %1$sTools tab%2$s.', 'contextual-related-posts' ),
10821083
'<a href="' . esc_url( admin_url( 'tools.php?page=crp_tools_page' ) ) . '" target="_blank">',
10831084
'</a>'
@@ -1173,7 +1174,7 @@ public static function settings_performance() {
11731174
/**
11741175
* Get the various styles.
11751176
*
1176-
* @since 3.5.0
1177+
* @since 3.5.0
11771178
* @return array Associative array of styles.
11781179
*/
11791180
public static function get_styles() {
@@ -1224,7 +1225,7 @@ public static function get_styles() {
12241225
/**
12251226
* Get the various order settings.
12261227
*
1227-
* @since 3.5.0
1228+
* @since 3.5.0
12281229
* @return array Order settings.
12291230
*/
12301231
public static function get_orderings() {
@@ -1250,7 +1251,7 @@ public static function get_orderings() {
12501251
*
12511252
* @since 3.5.0
12521253
*
1253-
* @param array $links Array of links.
1254+
* @param array $links Array of links.
12541255
* @return array
12551256
*/
12561257
public function plugin_actions_links( $links ) {
@@ -1268,8 +1269,8 @@ public function plugin_actions_links( $links ) {
12681269
*
12691270
* @since 3.5.0
12701271
*
1271-
* @param array $links Array of Links.
1272-
* @param string $file Current file.
1272+
* @param array $links Array of Links.
1273+
* @param string $file Current file.
12731274
* @return array
12741275
*/
12751276
public function plugin_row_meta( $links, $file ) {
@@ -1293,14 +1294,14 @@ public function plugin_row_meta( $links, $file ) {
12931294
*/
12941295
public function get_help_sidebar() {
12951296
$help_sidebar =
1296-
/* translators: 1: Plugin support site link. */
1297-
'<p>' . sprintf( __( 'For more information or how to get support visit the <a href="%s" target="_blank">support site</a>.', 'contextual-related-posts' ), esc_url( 'https://webberzone.com/support/' ) ) . '</p>' .
1298-
'<p>' . sprintf(
1299-
/* translators: 1: Github issues link, 2: Github plugin page link. */
1300-
__( '<a href="%1$s" target="_blank">Post an issue</a> on <a href="%2$s" target="_blank">GitHub</a> (bug reports only).', 'contextual-related-posts' ),
1301-
esc_url( 'https://github.com/WebberZone/contextual-related-posts/issues' ),
1302-
esc_url( 'https://github.com/WebberZone/contextual-related-posts' )
1303-
) . '</p>';
1297+
/* translators: 1: Plugin support site link. */
1298+
'<p>' . sprintf( __( 'For more information or how to get support visit the <a href="%s" target="_blank">support site</a>.', 'contextual-related-posts' ), esc_url( 'https://webberzone.com/support/' ) ) . '</p>' .
1299+
'<p>' . sprintf(
1300+
/* translators: 1: Github issues link, 2: Github plugin page link. */
1301+
__( '<a href="%1$s" target="_blank">Post an issue</a> on <a href="%2$s" target="_blank">GitHub</a> (bug reports only).', 'contextual-related-posts' ),
1302+
esc_url( 'https://github.com/WebberZone/contextual-related-posts/issues' ),
1303+
esc_url( 'https://github.com/WebberZone/contextual-related-posts' )
1304+
) . '</p>';
13041305

13051306
/**
13061307
* Filter to modify the help sidebar content.
@@ -1335,12 +1336,12 @@ public function get_help_tabs() {
13351336
'title' => __( 'Tools', 'contextual-related-posts' ),
13361337
'content' =>
13371338
'<p>' . __( 'This screen provides some tools that help maintain certain features of Contextual Related Posts.', 'contextual-related-posts' ) . '</p>' .
1338-
'<p>' . __( 'Clear the cache, recreate the fulltext indices (including code to manually run this in phpMyAdmin), export/import settings and delete the older settings.', 'contextual-related-posts' ) . '</p>' .
1339-
'<p>' . sprintf(
1340-
/* translators: 1: Link to Knowledge Base article. */
1341-
__( 'You can find more information on each of these tools in this <a href="%1$s" target="_blank">knowledgebase article</a>.', 'contextual-related-posts' ),
1342-
esc_url( 'https://webberzone.com/support/knowledgebase/contextual-related-posts-settings-tools/' )
1343-
) . '</p>',
1339+
'<p>' . __( 'Clear the cache, recreate the fulltext indices (including code to manually run this in phpMyAdmin), export/import settings and delete the older settings.', 'contextual-related-posts' ) . '</p>' .
1340+
'<p>' . sprintf(
1341+
/* translators: 1: Link to Knowledge Base article. */
1342+
__( 'You can find more information on each of these tools in this <a href="%1$s" target="_blank">knowledgebase article</a>.', 'contextual-related-posts' ),
1343+
esc_url( 'https://webberzone.com/support/knowledgebase/contextual-related-posts-settings-tools/' )
1344+
) . '</p>',
13441345
),
13451346
);
13461347

@@ -1361,7 +1362,7 @@ public function get_help_tabs() {
13611362
*/
13621363
public static function get_admin_footer_text() {
13631364
return sprintf(
1364-
/* translators: 1: Opening achor tag with Plugin page link, 2: Closing anchor tag, 3: Opening anchor tag with review link. */
1365+
/* translators: 1: Opening achor tag with Plugin page link, 2: Closing anchor tag, 3: Opening anchor tag with review link. */
13651366
__( 'Thank you for using %1$sContextual Related Posts by WebberZone%2$s! Please %3$srate us%2$s on %3$sWordPress.org%2$s', 'contextual-related-posts' ),
13661367
'<a href="https://webberzone.com/plugins/contextual-related-posts/" target="_blank">',
13671368
'</a>',
@@ -1399,13 +1400,13 @@ public function change_settings_on_save( $settings ) {
13991400
$settings['post_thumb_op'] = 'inline';
14001401
}
14011402

1402-
add_settings_error( self::prefix . '-notices', '', 'Note: Display of the author, excerpt and date has been disabled as the Thumbnail style is set to Rounded Thumbnails or Rounded Thumbnails with Grid. You can change the style in the Styles tab.', 'updated' );
1403+
add_settings_error( self::$prefix . '-notices', '', 'Note: Display of the author, excerpt and date has been disabled as the Thumbnail style is set to Rounded Thumbnails or Rounded Thumbnails with Grid. You can change the style in the Styles tab.', 'updated' );
14031404
}
14041405
// Overwrite settings if text_only thumbnail style is selected.
14051406
if ( 'text_only' === $style ) {
14061407
$settings['post_thumb_op'] = 'text_only';
14071408

1408-
add_settings_error( self::prefix . '-notices', '', 'Note: Thumbnail location set to Text Only as the Thumbnail style is set to Text Only. You can change the style in the Styles tab.', 'updated' );
1409+
add_settings_error( self::$prefix . '-notices', '', 'Note: Thumbnail location set to Text Only as the Thumbnail style is set to Text Only. You can change the style in the Styles tab.', 'updated' );
14091410
}
14101411

14111412
// Force thumb_width and thumb_height if either are zero.
@@ -1534,13 +1535,15 @@ public static function tags_search() {
15341535
}
15351536
$s = trim( $s );
15361537

1537-
/** This filter has been defined in /wp-admin/includes/ajax-actions.php */
1538+
/**
1539+
* This filter has been defined in /wp-admin/includes/ajax-actions.php
1540+
*/
15381541
$term_search_min_chars = (int) apply_filters( 'term_search_min_chars', 2, $tax, $s );
15391542

15401543
/*
1541-
* Require $term_search_min_chars chars for matching (default: 2)
1542-
* ensure it's a non-negative, non-zero integer.
1543-
*/
1544+
* Require $term_search_min_chars chars for matching (default: 2)
1545+
* ensure it's a non-negative, non-zero integer.
1546+
*/
15441547
if ( ( 0 === $term_search_min_chars ) || ( strlen( $s ) < $term_search_min_chars ) ) {
15451548
wp_die();
15461549
}
@@ -1572,13 +1575,13 @@ public static function settings_page_header() {
15721575
?>
15731576
<p>
15741577
<a class="crp_button crp_button_green" href="<?php echo esc_url( admin_url( 'tools.php?page=crp_tools_page' ) ); ?>">
1575-
<?php esc_html_e( 'Visit the Tools page', 'contextual-related-posts' ); ?>
1578+
<?php esc_html_e( 'Visit the Tools page', 'contextual-related-posts' ); ?>
15761579
</a>
1577-
<?php if ( ! $crp_freemius->is_paying() ) { ?>
1580+
<?php if ( ! $crp_freemius->is_paying() ) { ?>
15781581
<a class="crp_button crp_button_gold" href="<?php echo esc_url( $crp_freemius->get_upgrade_url() ); ?>">
1579-
<?php esc_html_e( 'Upgrade to Pro', 'contextual-related-posts' ); ?>
1582+
<?php esc_html_e( 'Upgrade to Pro', 'contextual-related-posts' ); ?>
15801583
</a>
1581-
<?php } ?>
1584+
<?php } ?>
15821585
</p>
15831586

15841587
<?php
@@ -1587,8 +1590,8 @@ public static function settings_page_header() {
15871590
/**
15881591
* Updated the settings fields to display a pro version link.
15891592
*
1590-
* @param string $output Settings field HTML.
1591-
* @param array $args Settings field arguments.
1593+
* @param string $output Settings field HTML.
1594+
* @param array $args Settings field arguments.
15921595
* @return string Updated HTML.
15931596
*/
15941597
public static function after_setting_output( $output, $args ) {

0 commit comments

Comments
 (0)