Skip to content

Commit

Permalink
2.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
yasirrana committed Dec 8, 2023
1 parent 4665c11 commit d549240
Show file tree
Hide file tree
Showing 19 changed files with 503 additions and 349 deletions.
17 changes: 0 additions & 17 deletions .vscode/settings.json

This file was deleted.

4 changes: 3 additions & 1 deletion admin/css/style.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@


body #jobs_help code{
padding: 5px 5px 5px;
margin: 0 1px;
Expand Down Expand Up @@ -1407,6 +1406,9 @@ body #jobs_help code{
margin: 0;
}

.jobs_plugin_ads img{
width:100%;
}

.jobs_plugin_settings .row{
padding: 2px 0;
Expand Down
41 changes: 1 addition & 40 deletions admin/help.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,41 +112,6 @@
<br>



<?php
$metrics_shareable = get_option('jobs_metrics_shareable');
$analytics = 'Enabled';

if ( !$metrics_shareable || $metrics_shareable == 'no' ) {
$analytics = 'Disabled';
}
?>
<h3 id="anonymous_metrics">Jobs for WordPress Analytics (Status: <span class="anonymous_metrics_status"><?php echo $analytics; ?></span>)</h3>

<?php
if ( !$metrics_shareable || $metrics_shareable == 'no' ) {
echo '<a href="#agree" class="jobs-metrics-agree insettings">' . __( 'I agree to share anonymous data', 'job-posting' ) . '</a>';
}else{
echo '<a href="#agree" class="jobs-metrics-cancel insettings">' . __( 'Stop sharing', 'job-posting' ) . '</a>';
}
?>
<p>
<b><?php echo _x('What info we collect with analytics:', 'job-postings') ?></b> <br>
<ul>
<li>Plugin version</li>
<li>Type of web server</li>
<li>PHP Version</li>
<li>WordPress Version</li>
<li>Used theme</li>
<li>Domain name</li>
<li>Language</li>
<li>Multisite enabled or not</li>
<li>Ammount of published job postings</li>
</ul>
</p>
<br>


<h3><?php echo _x('FAQ', 'job-settings', 'job-postings') ?></h3>
<div class="toggle">
<a class="trigger" href="#">
Expand Down Expand Up @@ -282,11 +247,7 @@


<div class="wrap jobs_plugin_ads">
<a href="https://www.blueglass.ee/en/" target="_blank"><img src="<?php echo plugins_url( '../images/blueglass.jpg', __FILE__ ); ?>" alt="Plugin developed by Blueglass"></a>

<a href="https://www.cloudways.com/en/hosting-woocommerce.php?id=151244&amp;a_bid=7c9dd1c5" target="_top"><img src="//www.cloudways.com/affiliate/accounts/default1/banners/7c9dd1c5.jpg" alt="Load WooCommerce Stores in 249ms!" title="Load WooCommerce Stores in 249ms!" width="100%" height="auto" /></a>

<a href="https://www.cloudways.com/en/wordpress-cloud-hosting.php?id=151244&amp;a_bid=19515e01" target="_top"><img src="//www.cloudways.com/affiliate/accounts/default1/banners/19515e01.jpg" alt="Load WordPress Sites in as fast as 37ms!" title="Load WordPress Sites in as fast as 37ms!" width="100%" height="auto" /></a>
<a href="https://www.blueglass.ch/" target="_blank"><img src="<?php echo plugins_url( '../images/blueglass.jpg', __FILE__ ); ?>" alt="Plugin developed by Blueglass"></a>

</div>

Expand Down
66 changes: 42 additions & 24 deletions admin/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
<?php
$option_name = 'jobs_hiring_organization';
$value = get_option( $option_name.'_'.$lang );
$value = sanitize_text_field($value);
$value = htmlspecialchars( sanitize_text_field($value) ); // prevent xss
if(empty($value)) $value = ''; // default
$name = $option_name.'_'.$lang;
echo '<input type="text" name="'.$option_name.'_'.$lang.'" value="'.$value.'" placeholder="'._x('Company name', 'job-settings', 'job-postings').'">';
Expand All @@ -206,7 +206,7 @@
<?php
$option_name = 'jobs_currency_symbol';
$value = get_option( $option_name.'_'.$lang );
$value = sanitize_text_field($value);
$value = htmlspecialchars( sanitize_text_field($value) ); // prevent xss
if(empty($value)) $value = ''; // default
$name = $option_name.'_'.$lang;
echo '<input type="text" name="'.$option_name.'_'.$lang.'" value="'.$value.'">';
Expand All @@ -220,7 +220,7 @@
<?php
$option_name = 'jobs_currency_position';
$value = get_option( $option_name.'_'.$lang );
$value = sanitize_text_field($value);
$value = htmlspecialchars( sanitize_text_field($value) ); // prevent xss
if(empty($value)) $value = ''; // default
$name = $option_name.'_'.$lang;
?>
Expand All @@ -239,7 +239,7 @@
<?php
$option_name = 'jobs_preview_cta';
$value = get_option( $option_name.'_'.$lang );
$value = sanitize_text_field($value);
$value = htmlspecialchars( sanitize_text_field($value) ); // prevent xss
if(empty($value)) $value = ''; // default
$name = $option_name.'_'.$lang;
echo '<input type="text" name="'.$option_name.'_'.$lang.'" value="'.$value.'" placeholder="'._x('View', 'job-postings', 'job-postings').'">';
Expand All @@ -254,7 +254,7 @@
<?php
$option_name = 'jobs_archive_page';
$value = get_option( $option_name.'_'.$lang );
$value = sanitize_text_field($value);
$value = htmlspecialchars( sanitize_text_field($value) ); // prevent xss
if(empty($value)) $value = ''; // default
$name = $option_name.'_'.$lang;
?>
Expand Down Expand Up @@ -291,7 +291,7 @@
<?php
$option_name = 'jobs_custom_slug';
$value = get_option( $option_name.'_'.$lang );
$value = sanitize_text_field($value);
$value = htmlspecialchars( sanitize_text_field($value) ); // prevent xss
if(empty($value)) $value = ''; // default
$name = $option_name.'_'.$lang;
echo '<input type="text" name="'.$option_name.'_'.$lang.'" value="'.$value.'" placeholder="'._x('Default slug: job', 'job-settings', 'job-postings').'">';
Expand All @@ -306,7 +306,7 @@
<?php
$option_name = 'jobs_no_jobs_message';
$value = get_option( $option_name.'_'.$lang );
$value = sanitize_text_field($value);
$value = htmlspecialchars( sanitize_text_field($value) ); // prevent xss
if(empty($value)) $value = ''; // default
$name = $option_name.'_'.$lang;
echo '<input type="text" name="'.$option_name.'_'.$lang.'" value="'.$value.'" placeholder="'._x('Currently no job offers available.', 'job-message', 'job-postings').'">';
Expand All @@ -321,7 +321,7 @@
<?php
$option_name = 'jobs_offer_ended_message_enabled';
$message_enabled = get_option( $option_name.'_'.$lang );
$message_enabled = sanitize_text_field($message_enabled);
$message_enabled = htmlspecialchars( sanitize_text_field($message_enabled) ); // prevent xss
if(empty($message_enabled)) $message_enabled = ''; // default
$name = $option_name.'_'.$lang;

Expand All @@ -336,7 +336,7 @@
<?php
$option_name = 'jobs_offer_ended_message';
$value = get_option( $option_name.'_'.$lang );
$value = sanitize_text_field($value);
$value = htmlspecialchars( sanitize_text_field($value) ); // prevent xss
if(empty($value)) $value = ''; // default
$name = $option_name.'_'.$lang;

Expand All @@ -357,7 +357,7 @@
<?php
$option_name = 'jobs_filesize_validation';
$value = get_option( $option_name.'_'.$lang );
$value = sanitize_text_field($value);
$value = htmlspecialchars( sanitize_text_field($value) ); // prevent xss
if(empty($value)) $value = ''; // default
$name = $option_name.'_'.$lang;

Expand Down Expand Up @@ -488,7 +488,7 @@
foreach ($languages as $lang => $language) {
$val = isset($options['modal'][$key]['placeholder_'.$lang]) ? $options['modal'][$key]['placeholder_'.$lang] : '';
echo '<label for="placeholder-field-'.$lang.'">'.__('Placeholder', 'job-postings') . ' <b>' . strtoupper($lang).'</b></label>';
echo '<input id="placeholder-field-'.$lang.'"type="text" class="hg_label" name="placeholder_'.$lang.'" value="'.$val.'"/>';
echo '<input id="placeholder-field-'.$lang.'"type="text" class="hg_label" name="placeholder_'.$lang.'" value="'.htmlspecialchars($val).'"/>';
}
} ?>
</div>
Expand All @@ -510,12 +510,12 @@

$val = isset($options['modal'][$key]['check_options_'.$lang]) ? $options['modal'][$key]['check_options_'.$lang]:'';
echo '<label for="check-options-field-'.$lang.'">'.__('Options', 'job-postings') . ' <b>'.strtoupper($lang).'</b></label>';
echo '<textarea id="check-options-field-'.$lang.'" class="hg_label" name="check_options_'.$lang.'"placeholder="'.$placehold.'">'.$val.'</textarea>';
echo '<textarea id="check-options-field-'.$lang.'" class="hg_label" name="check_options_'.$lang.'"placeholder="'.$placehold.'">'.htmlspecialchars($val).'</textarea>';

// preselection
$val = isset($options['modal'][$key]['check_preselected_'.$lang]) ? $options['modal'][$key]['check_preselected_'.$lang]:'';
echo '<label for="check-preselected-field-'.$lang.'">'.__('Preselected checkboxes indexes, eg.: 1,3,5', 'job-postings').'</label>';
echo '<input id="check-preselected-field-'.$lang.'"type="text" class="hg_label" name="check_preselected_'.$lang.'" value="'.$val.'"/>';
echo '<input id="check-preselected-field-'.$lang.'"type="text" class="hg_label" name="check_preselected_'.$lang.'" value="'.htmlspecialchars($val).'"/>';

echo '</div>';
}
Expand All @@ -537,12 +537,12 @@

$val = isset($options['modal'][$key]['radio_options_'.$lang]) ? $options['modal'][$key]['radio_options_'.$lang]:'';
echo '<label for="radio-options-field-'.$lang.'">'.__('Options', 'job-postings') . ' <b>'.strtoupper($lang).'</b></label>';
echo '<textarea id="radio-options-field-'.$lang.'" class="hg_label" name="radio_options_'.$lang.'" placeholder="'.$placehold.'">'.$val.'</textarea>';
echo '<textarea id="radio-options-field-'.$lang.'" class="hg_label" name="radio_options_'.$lang.'" placeholder="'.$placehold.'">'.htmlspecialchars($val).'</textarea>';

// preselection
$val = isset($options['modal'][$key]['radio_preselected_'.$lang]) ? $options['modal'][$key]['radio_preselected_'.$lang]:'';
echo '<label for="radio-preselected-field-'.$lang.'">'.__('Preselected radio index, eg.: 3', 'job-postings').'</label>';
echo '<input id="radio-preselected-field-'.$lang.'"type="text" class="hg_label" name="radio_preselected_'.$lang.'" value="'.$val.'"/>';
echo '<input id="radio-preselected-field-'.$lang.'"type="text" class="hg_label" name="radio_preselected_'.$lang.'" value="'.htmlspecialchars($val).'"/>';

echo '</div>';
}
Expand All @@ -564,12 +564,12 @@

$val = isset($options['modal'][$key]['select_options_'.$lang]) ? $options['modal'][$key]['select_options_'.$lang]:'';
echo '<label for="select-options-field-'.$lang.'">'.__('Options', 'job-postings') . ' <b>'.strtoupper($lang).'</b></label>';
echo '<textarea id="select-options-field-'.$lang.'" class="hg_label" name="select_options_'.$lang.'" placeholder="'.$placehold.'">'.$val.'</textarea>';
echo '<textarea id="select-options-field-'.$lang.'" class="hg_label" name="select_options_'.$lang.'" placeholder="'.$placehold.'">'.htmlspecialchars($val).'</textarea>';

// preselection
$val = isset($options['modal'][$key]['select_preselected_'.$lang]) ? $options['modal'][$key]['select_preselected_'.$lang]:'';
echo '<label for="select-preselected-field-'.$lang.'">'.__('Preselected index, eg.: 3', 'job-postings').'</label>';
echo '<input id="select-preselected-field-'.$lang.'"type="text" class="hg_label" name="select_preselected_'.$lang.'" value="'.$val.'"/>';
echo '<input id="select-preselected-field-'.$lang.'"type="text" class="hg_label" name="select_preselected_'.$lang.'" value="'.htmlspecialchars($val).'"/>';

echo '</div>';
}
Expand Down Expand Up @@ -603,7 +603,7 @@
// preselection
$val = isset($options['modal'][$key]['files_accepted']) ? $options['modal'][$key]['files_accepted'] : '';
echo '<label for="files-accepted-field-'.$uniqid.'">'.__('Accepted file extensions. (Example: .jpg, .gif, .png)', 'job-postings').'</label>';
echo '<input id="rfiles-accepted-field-'.$uniqid.'"type="text" class="hg_label" name="files_accepted" value="'.$val.'"/>';
echo '<input id="rfiles-accepted-field-'.$uniqid.'"type="text" class="hg_label" name="files_accepted" value="'.htmlspecialchars($val).'"/>';

echo '</div>';

Expand All @@ -626,7 +626,7 @@
// preselection
$val = isset($options['modal'][$key]['multi_files_accepted_message_'.$lang]) ? $options['modal'][$key]['multi_files_accepted_message_'.$lang] : '';
echo '<label for="files-accepted-message-field-'.$lang.'">' .strtoupper($lang). ' '.__('Message', 'job-postings').'</label>';
echo '<input id="rfiles-accepted-message-field-'.$lang.'"type="text" class="hg_label" name="multi_files_accepted_message_'.$lang.'" value="'.$val.'"/>';
echo '<input id="rfiles-accepted-message-field-'.$lang.'"type="text" class="hg_label" name="multi_files_accepted_message_'.$lang.'" value="'.htmlspecialchars($val).'"/>';

echo '</div>';
}
Expand All @@ -639,7 +639,7 @@
// preselection
$val = isset($options['modal'][$key]['multi_files_accepted']) ? $options['modal'][$key]['multi_files_accepted'] : '';
echo '<label for="files-accepted-field-'.$uniqid.'">'.__('Accepted file extensions. (Example: .jpg, .gif, .png)', 'job-postings').'</label>';
echo '<input id="rfiles-accepted-field-'.$uniqid.'"type="text" class="hg_label" name="multi_files_accepted" value="'.$val.'"/>';
echo '<input id="rfiles-accepted-field-'.$uniqid.'"type="text" class="hg_label" name="multi_files_accepted" value="'.htmlspecialchars($val).'"/>';

echo '</div>';

Expand Down Expand Up @@ -1237,6 +1237,27 @@
</div>
</div>

<div class="row clearfix">
<label><?php echo __("SEO Schema", 'job-postings') ?></label>
<div class="jobs-settings-input">
<?php
$option_name = 'jobs_selected_schema';
$fs = get_option( $option_name );

echo '<select name="'.$option_name.'">';
echo '<option value="default" '.selected($fs, 'default', false).'>'.__('Default', 'job-postings').'</option>';
if( !class_exists('WPSEO_Admin') ){
$disabled = "disabled";
}
echo '<option '.$disabled.' value="yoast_seo" '.selected($fs, 'yoast_seo', false).'>'.__('Yoast SEO', 'job-postings').'</option>';

echo '</select>';

echo '<p class="description jfw_hint">'.__("If your site uses Yoast SEO, the structured SEO Schema will follow Yoast's recommendations. Choose 'Default' if you are not sure.", 'job-postings').'</p>';
?>
</div>
</div>


<br>
<h3><?php echo __("File storage", 'job-postings') ?></h3>
Expand Down Expand Up @@ -1388,11 +1409,8 @@


<div class="wrap jobs_plugin_ads">
<a href="https://www.blueglass.ee/en/" target="_blank"><img src="<?php echo plugins_url( '../images/blueglass.jpg', __FILE__ ); ?>" alt="Plugin developed by Blueglass"></a>

<a href="https://www.cloudways.com/en/wordpress-cloud-hosting.php?id=151244&amp;a_bid=19515e01" target="_top"><img src="//www.cloudways.com/affiliate/accounts/default1/banners/19515e01.jpg" alt="Load WordPress Sites in as fast as 37ms!" title="Load WordPress Sites in as fast as 37ms!" width="100%" height="auto" /></a>
<a href="https://www.blueglass.ch/websites-applikationen" target="_blank"><img src="<?php echo plugins_url( '../images/backend-settings-banner.png', __FILE__ ); ?>" alt="Plugin developed by Blueglass"></a>

<a href="https://www.cloudways.com/en/hosting-woocommerce.php?id=151244&amp;a_bid=7c9dd1c5" target="_top"><img src="//www.cloudways.com/affiliate/accounts/default1/banners/7c9dd1c5.jpg" alt="Load WooCommerce Stores in 249ms!" title="Load WooCommerce Stores in 249ms!" width="100%" height="auto" /></a>
</div>

</div>
33 changes: 30 additions & 3 deletions class-job-postings.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,36 @@ public static function load() {

add_action( 'nav_menu_css_class', array('Job_Postings', 'add_current_nav_class'), 10, 2 );

add_action( 'wp_ajax_jobs_metrics_notice_seen', array('Job_Postings', 'jobs_metrics_notice_seen') );
//add_action( 'wp_ajax_jobs_metrics_notice_seen', array('Job_Postings', 'jobs_metrics_notice_seen') );
add_action( 'wp_ajax_jobs_metrics_attachemnt_notice_seen', array('Job_Postings', 'jobs_metrics_attachemnt_notice_seen') );


$jobs_selected_schema = get_option( 'jobs_selected_schema' );
if( !$jobs_selected_schema || empty($jobs_selected_schema) || $jobs_selected_schema == "default" ){
add_filter( 'wpseo_json_ld_output', array('Job_Postings','jp_disable_yoast_seo_schema'), 10, 1 );
}
else if( $jobs_selected_schema == "yoast_seo" && is_singular( 'jobs' ) ){
add_filter( 'job-postings/disable_json_ld', array('Job_Postings', 'jp_disable_job_postings_schema') );
add_filter( 'wpseo_json_ld_output', array('Job_Postings','jp_disable_yoast_seo_schema'), 10, 1 );
}

add_action('deactivated_plugin', array('Job_Postings', 'set_deafult_on_yoast_deactivation') );

}

public static function jp_disable_yoast_seo_schema($data){
$data = [];
return $data;
}

public static function jp_disable_job_postings_schema(){
return true;
}

public static function set_deafult_on_yoast_deactivation($plugin) {
// Check if Yoast SEO plugin is deactivated
if ($plugin === 'wordpress-seo/wp-seo.php') {
update_option( 'jobs_selected_schema', 'default' );
}
}

public static function init_current_language(){
Expand Down Expand Up @@ -473,7 +500,7 @@ public static function jobs_metrics_notice_seen(){
}

public static function jobs_metrics_attachemnt_notice_seen(){
update_option('jobs_file_location_notice_seen', 'seen');
update_option('jobs_file_location_notice_seen_v2', 'seen');
echo 'ok';
exit();
}
Expand Down
6 changes: 4 additions & 2 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -460,11 +460,13 @@ body.single-jobs .wrap{

}

.jobs-modal-form h3{
.jobs-modal-form .modal-title-small{
margin: 0 0 10px;
font-weight: bold;
}

.jobs-modal-form h4{
.jobs-modal-form .modal-title{
font-size: 20px;
margin: 0 0 30px;
padding: 0;
font-weight: bold;
Expand Down
Binary file added images/backend-settings-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d549240

Please sign in to comment.