Skip to content

Commit

Permalink
- WPCS;
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitasinelnikov committed Sep 12, 2024
1 parent c18da3e commit f3072ac
Show file tree
Hide file tree
Showing 12 changed files with 10 additions and 28 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
"object-calisthenics/phpcs-calisthenics-rules": "*",
"phpcompatibility/phpcompatibility-wp": "*",
"wp-coding-standards/wpcs": "2.3.0",
"wp-coding-standards/wpcs": "3.1.0",
"squizlabs/php_codesniffer": "3.*",
"phpdocumentor/phpdocumentor": "3.1.*"
}
Expand Down
2 changes: 0 additions & 2 deletions includes/admin/class-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public function column_title( $post ) {
$title = _draft_or_post_title();

if ( $can_edit_post && 'trash' !== $post->post_status ) {
/** @noinspection HtmlUnknownTarget */
printf(
'(#%1$s)&nbsp;<a class="row-title" href="%2$s" aria-label="%3$s">%4$s</a>',
esc_html( $post->ID ),
Expand All @@ -79,7 +78,6 @@ public function column_title( $post ) {
$company_website = get_post_meta( $post->ID, 'jb-company-website', true );

if ( ! empty( $company_website ) ) {
/** @noinspection HtmlUnknownTarget */
printf(
'<div class="company"><span title="%1$s"><a href="%2$s">%3$s</a></span></div>' . "\n",
esc_attr( $company_tagline ),
Expand Down
11 changes: 3 additions & 8 deletions includes/admin/class-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function __construct() {
//custom content for override templates tab
add_action( 'plugins_loaded', array( $this, 'jb_check_template_version' ), 10 );
add_filter( 'jb_settings_custom_tabs', array( $this, 'add_custom_content_tab' ), 10 );
add_filter( 'jb_settings_section_override_templates__content', array( $this, 'override_templates_list_table' ), 10, 1 );
add_filter( 'jb_settings_section_override_templates__content', array( $this, 'override_templates_list_table' ) );
}

public function add_custom_content_tab( $custom_array ) {
Expand Down Expand Up @@ -1049,7 +1049,6 @@ public function tabs_menu() {

$active = ( $current_tab === $slug ) ? 'nav-tab-active' : '';

/** @noinspection HtmlUnknownTarget */
$tabs .= sprintf(
'<a href="%s" class="nav-tab %s">%s</a>',
esc_attr( $tab_link ),
Expand Down Expand Up @@ -1115,7 +1114,6 @@ public function subtabs_menu( $tab = '' ) {

$active = ( $current_subtab === $slug ) ? 'current' : '';

/** @noinspection HtmlUnknownTarget */
$subtabs .= sprintf(
'<a href="%s" class="%s">%s</a> | ',
esc_attr( $tab_link ),
Expand Down Expand Up @@ -1375,7 +1373,7 @@ function( $item ) use ( $template_path, $blog_id ) {
return $settings;
}

public function override_templates_list_table( $section_content ) {
public function override_templates_list_table() {
$jb_check_version = get_transient( 'jb_check_template_versions' );
ob_start();
?>
Expand All @@ -1395,16 +1393,13 @@ public function override_templates_list_table( $section_content ) {
</p>
<p class="description" style="margin: 20px 0 0 0;">
<?php
/** @noinspection HtmlUnknownTarget */
// translators: %s: Link to the docs article.
echo wp_kses( sprintf( __( 'You may get more details about overriding templates <a href="%s" target="_blank">here</a>.', 'jobboardwp' ), 'https://docs.jobboardwp.com/article/1570-templates-structure' ), JB()->get_allowed_html( 'admin_notice' ) );
?>
</p>
<?php
include_once JB_PATH . 'includes/admin/templates/settings/version-template-list-table.php';

$section_content = ob_get_clean();
return $section_content;
return ob_get_clean();
}

/**
Expand Down
1 change: 0 additions & 1 deletion includes/admin/templates/job/data.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@
admin_url( 'admin.php' )
);

/** @noinspection HtmlUnknownTarget */
// translators: %s: link to the settings section
$expiry_description = sprintf( __( 'If empty, then job will have an expiration date based on the <a href="%s#jb_options_job-duration">Job Duration</a> setting.', 'jobboardwp' ), $settings_link );
}
Expand Down
1 change: 0 additions & 1 deletion includes/common/class-job.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,6 @@ public function get_company( $job_id ) {
}

if ( ! empty( $company_website ) ) {
/** @noinspection HtmlUnknownTarget */
$company = sprintf( '<span title="%s"><a href="%s">%s</a></span>', $company_tagline, $company_website, $company_name );
} else {
$company = sprintf( '<span title="%s">%s</span>', $company_tagline, $company_name );
Expand Down
5 changes: 0 additions & 5 deletions includes/frontend/class-shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ public function job_post( $atts = array() ) {
if ( ! empty( $_GET['msg'] ) ) {
switch ( sanitize_key( $_GET['msg'] ) ) {
case 'draft':
/** @noinspection HtmlUnknownTarget */
$posting_form->add_notice(
// translators: %s: jobs dashboard page link
sprintf( __( 'Job\'s draft was saved. You could resumed it from the <a href="%s" title="Job Dashboard">job dashboard</a>', 'jobboardwp' ), $jobs_dashboard_link ),
Expand All @@ -107,7 +106,6 @@ public function job_post( $atts = array() ) {
case 'published':
if ( ! empty( $_GET['published-id'] ) ) {
$job_permalink = get_permalink( absint( $_GET['published-id'] ) );
/** @noinspection HtmlUnknownTarget */
$posting_form->add_notice(
// translators: %s: link to the published job
sprintf( __( 'Job is posted successfully. To view your job <a href="%s">click here</a>', 'jobboardwp' ), $job_permalink ),
Expand Down Expand Up @@ -156,7 +154,6 @@ public function job_post( $atts = array() ) {

<p>
<?php
/** @noinspection HtmlUnknownTarget */
// translators: %s: login link
echo wp_kses( sprintf( __( '<a href="%s">Sign in</a> to post a job.', 'jobboardwp' ), esc_attr( wp_login_url( get_permalink() ) ) ), JB()->get_allowed_html( 'templates' ) );
?>
Expand Down Expand Up @@ -369,7 +366,6 @@ public function render_section( $html, $section_data, $form_data ) {

<p>
<?php
/** @noinspection HtmlUnknownTarget */
// translators: %s: login link
echo wp_kses( sprintf( __( '<a href="%s">Sign in</a> to post a job.', 'jobboardwp' ), esc_attr( wp_login_url( get_permalink() ) ) ), JB()->get_allowed_html( 'templates' ) );
?>
Expand All @@ -381,7 +377,6 @@ public function render_section( $html, $section_data, $form_data ) {

<p>
<?php
/** @noinspection HtmlUnknownTarget */
// translators: %s: login link
echo wp_kses( sprintf( __( '<a href="%s">Sign in</a> to post a job or to do that as a guest.', 'jobboardwp' ), esc_attr( wp_login_url( get_permalink() ) ) ), JB()->get_allowed_html( 'templates' ) );
?>
Expand Down
1 change: 0 additions & 1 deletion templates/dashboard/jobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

<p>
<?php
/** @noinspection HtmlUnknownTarget */
// translators: %s: login link
echo wp_kses( sprintf( __( '<a href="%s">Sign in</a> to view your job listings.', 'jobboardwp' ), wp_login_url( get_permalink() ) ), JB()->get_allowed_html( 'templates' ) );
?>
Expand Down
2 changes: 0 additions & 2 deletions templates/job/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@

<p>
<?php
/** @noinspection HtmlUnknownTarget */
// translators: %1$s: mailto URL, %2$s: contact email
$applying_text = sprintf( __( 'To apply for this job <strong>email your details to</strong> <a href="%1$s">%2$s</a>.', 'jobboardwp' ), esc_attr( $contact_mailto ), $contact );
/**
Expand All @@ -65,7 +64,6 @@
<?php } else { ?>
<p>
<?php
/** @noinspection HtmlUnknownTarget */
// translators: %1$s: application's website URL, %2$s: application's website URL text
$applying_text = sprintf( __( 'To apply for this job please visit <a href="%1$s">%2$s</a>.', 'jobboardwp' ), esc_attr( $contact ), $contact );
/** This filter is documented in templates/job/footer.php */
Expand Down
2 changes: 1 addition & 1 deletion templates/js/job-categories-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div class="jb-job-category-list-row" style="padding-left: {{{category.level * <?php /** @noinspection CssInvalidPropertyValueInspection */ ?>10}}}px;">
<div class="jb-row-left-side">
<div class="jb-job-category-title <# if ( category.class ) { #>subcat<# } #>">
<a href="{{{category.permalink}}}<?php /** @noinspection HtmlUnknownTarget */ ?>">{{{category.name}}}</a>
<a href="{{{category.permalink}}}">{{{category.name}}}</a>
</div>
<# if ( category.description ) { #>
<div class="jb-job-category-description">
Expand Down
5 changes: 2 additions & 3 deletions templates/js/jobs-dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<div class="job_title">
<# if ( job.is_published ) { #>
<a href="<?php /** @noinspection HtmlUnknownTarget */ ?>{{{job.permalink}}}">{{{job.title}}}</a>
<a href="{{{job.permalink}}}">{{{job.title}}}</a>
<# } else { #>
{{{job.title}}}
<# } #>
Expand Down Expand Up @@ -80,7 +80,7 @@
<ul>
<# _.each( job.actions, function( action, act_key, act_list ) { #>
<li>
<a href="<?php /** @noinspection HtmlUnknownTarget */ ?><# if ( action.href ) { #>{{{action.href}}}<# } else { #>javascript:void(0);<# } #>" <# if ( ! action.href ) { #>data-job-id="{{{job.id}}}"<# } #> class="jb-jobs-action-{{{act_key}}}">
<a href="<# if ( action.href ) { #>{{{action.href}}}<# } else { #>javascript:void(0);<# } #>" <# if ( ! action.href ) { #>data-job-id="{{{job.id}}}"<# } #> class="jb-jobs-action-{{{act_key}}}">
{{{action.title}}}
</a>
</li>
Expand All @@ -95,7 +95,6 @@
<# } else { #>
<div class="jb-job-dashboard-empty-row">
<?php
/** @noinspection HtmlUnknownTarget */
// translators: %s: Post a job URL
echo wp_kses( sprintf( __( 'No created jobs yet. <a href="%s">Create</a> new one.', 'jobboardwp' ), JB()->common()->permalinks()->get_predefined_page_link( 'job-post' ) ), JB()->get_allowed_html() );
?>
Expand Down
4 changes: 2 additions & 2 deletions templates/js/jobs-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<# } #>
<div class="jb-row-data">
<div class="jb-job-title">
<span class="jb-job-title-link-line"><a href="<?php /** @noinspection HtmlUnknownTarget */ ?>{{{job.permalink}}}" class="jb-job-title-link">{{{job.title}}}</a></span>
<span class="jb-job-title-link-line"><a href="{{{job.permalink}}}" class="jb-job-title-link">{{{job.title}}}</a></span>
<div class="jb-job-title-end jb-responsive jb-ui-m jb-ui-l jb-ui-xl">
<# if ( job.featured ) { #>
<div class="jb-job-featured"><?php esc_html_e( 'Featured', 'jobboardwp' ); ?></div>
Expand Down Expand Up @@ -132,7 +132,7 @@
<# if ( action.html ) { #>
{{{action.html}}}
<# } else { #>
<a href="<?php /** @noinspection HtmlUnknownTarget */ ?>{{{action.url}}}" class="{{{action.class}}}">
<a href="{{{action.url}}}" class="{{{action.class}}}">
<i class="{{{action.img}}}"></i>
</a>
<# } #>
Expand Down
2 changes: 1 addition & 1 deletion templates/widgets/recent-jobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<div class="jb-row-data">
<div class="jb-job-title">
<span class="jb-job-title-link-line">
<a href="<?php /** @noinspection HtmlUnknownTarget */ ?><?php echo esc_url( $job_data['permalink'] ); ?>" class="jb-job-title-link"><?php echo esc_html( $job_data['title'] ); ?></a>
<a href="<?php echo esc_url( $job_data['permalink'] ); ?>" class="jb-job-title-link"><?php echo esc_html( $job_data['title'] ); ?></a>
</span>
<?php if ( ! $jb_widgets_recent_jobs['args']['no_job_types'] ) { ?>
<?php if ( ! empty( $job_data['types'] ) ) { ?>
Expand Down

0 comments on commit f3072ac

Please sign in to comment.