Plugin Directory

Changeset 3195911


Ignore:
Timestamp:
11/24/2024 03:47:26 PM (17 months ago)
Author:
recruitly
Message:

Implement WordPress guidelines

Location:
recruitly/trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • recruitly/trunk/admin/dataloader.php

    r3194746 r3195911  
    66 * after making configuration changes.
    77 */
     8 
     9if ( ! defined( 'ABSPATH' ) ) {
     10  exit; // Exit if accessed directly
     11}
    812function recruitly_wordpress_truncate_post_type()
    913{
  • recruitly/trunk/admin/includes/commons.php

    r1857410 r3195911  
    11<?php
     2if ( ! defined( 'ABSPATH' ) ) {
     3    exit; // Exit if accessed directly
     4 }
    25function recruitly_get_custom_post_value($key){
    36
  • recruitly/trunk/admin/includes/customposttypes.php

    r3194746 r3195911  
    11<?php
     2if ( ! defined( 'ABSPATH' ) ) {
     3    exit; // Exit if accessed directly
     4 }
    25add_action( 'init', 'recruitly_wordpress_setup_post_type', 0 );
    36
  • recruitly/trunk/admin/includes/filters.php

    r2784965 r3195911  
    11<?php
     2if ( ! defined( 'ABSPATH' ) ) {
     3  exit; // Exit if accessed directly
     4}
    25add_filter('the_content', 'recruitly_wordpress_job_application_form');
    36
  • recruitly/trunk/admin/includes/menus.php

    r3194746 r3195911  
    11<?php
     2if ( ! defined( 'ABSPATH' ) ) {
     3  exit; // Exit if accessed directly
     4}
    25add_action('admin_menu', 'recruitly_wordpress_setup_menu');
    36
  • recruitly/trunk/admin/includes/shortcodes.php

    r3194746 r3195911  
    11<?php
     2if ( ! defined( 'ABSPATH' ) ) {
     3  exit; // Exit if accessed directly
     4}
    25add_shortcode('recruitly_jobs', 'recruitly_wordpress_job_listing_shortcode');
    36add_shortcode('recruitly_job_search', 'recruitly_wordpress_job_search_shortcode');
  • recruitly/trunk/admin/includes/taxonomies.php

    r3194746 r3195911  
    11<?php
     2if ( ! defined( 'ABSPATH' ) ) {
     3  exit; // Exit if accessed directly
     4}
    25add_action('init', 'recruitly_wordpress_setup_taxonomies');
    36
  • recruitly/trunk/admin/settings.php

    r3194746 r3195911  
    44 * Users can enter their company name and API Key using settings page.
    55 */
     6 
     7if ( ! defined( 'ABSPATH' ) ) {
     8    exit; // Exit if accessed directly
     9}
    610function recruitly_wordpress_settings()
    711{
  • recruitly/trunk/recruitly-wp-templates.php

    r1858056 r3195911  
    1717 * @return void
    1818 */
    19 
     19if ( ! defined( 'ABSPATH' ) ) {
     20    exit; // Exit if accessed directly
     21}
    2022function get_recruitly_template( $template_name, $args = array(), $template_path = 'recruitly', $default_path = '' ) {
    2123
  • recruitly/trunk/recruitly-wp.php

    r3194746 r3195911  
    99License: GPLv2 or later
    1010*/
     11
     12if ( ! defined( 'ABSPATH' ) ) {
     13    exit; // Exit if accessed directly
     14}
    1115define('RECRUITLY_PLUGIN_VERSION', '2.0.16');
    1216
  • recruitly/trunk/templates/job-listing.php

    r3194746 r3195911  
    99 * @category    Template
    1010 */
     11 
     12 if ( ! defined( 'ABSPATH' ) ) {
     13    exit; // Exit if accessed directly
     14 }
    1115?>
    1216<div class="recruitly_jobs">
  • recruitly/trunk/templates/job-recent-jobs-widget.php

    r3194746 r3195911  
    99 * @category    Template
    1010 */
     11 
     12 if ( ! defined( 'ABSPATH' ) ) {
     13    exit; // Exit if accessed directly
     14 }
    1115?>
    1216<div class="recruitly-recent-jobs">
  • recruitly/trunk/templates/job-search-form.php

    r3194746 r3195911  
    99 * @category    Template
    1010 */
     11 
     12 if ( ! defined( 'ABSPATH' ) ) {
     13    exit; // Exit if accessed directly
     14 }
     15?>
     16<?php
     17// Verify nonce during form processing
     18if ( isset( $_GET['recruitly_jobsearch_nonce'] ) ) {
     19    // Remove slashes and sanitize the nonce
     20    $nonce = sanitize_text_field( wp_unslash( $_GET['recruitly_jobsearch_nonce'] ) );
     21
     22    // Verify the nonce
     23    if ( wp_verify_nonce( $nonce, 'recruitly_jobsearch_action' ) ) {
     24        // Process sanitized form inputs
     25        $job_search = isset( $_GET['job_search'] ) ? sanitize_text_field( wp_unslash( $_GET['job_search'] ) ) : '';
     26        $job_sector = isset( $_GET['job_sector'] ) ? sanitize_text_field( wp_unslash( $_GET['job_sector'] ) ) : '';
     27        $job_type = isset( $_GET['job_type'] ) ? sanitize_text_field( wp_unslash( $_GET['job_type'] ) ) : '';
     28        $job_city = isset( $_GET['job_city'] ) ? sanitize_text_field( wp_unslash( $_GET['job_city'] ) ) : '';
     29    }
     30}else{
     31    $job_search = '';
     32    $job_sector = '';
     33    $job_type = '';
     34    $job_city = '';
     35}
    1136?>
    1237<div class="recruitly_jobsearch <?php echo esc_attr( $cssclass ); ?>">
    1338    <form method="GET" role="search" class="cool-job-form form form-horizontal"
    1439          action="<?php echo esc_attr( $target ); ?>">
    15           <?php wp_nonce_field('job_search_form_action', 'recruitly_nonce'); ?>
     40          <?php wp_nonce_field( 'recruitly_jobsearch_action', 'recruitly_jobsearch_nonce' ); ?>
    1641        <div class="row form-group">
    1742            <div class="cool-keyword-field col-md-12">
     
    1944                       name="job_search"
    2045                       class="form-control"
    21                        value="<?php ( isset( $_GET['job_search'] ) ? htmlspecialchars( sanitize_text_field(wp_unslash($_GET['job_search'])) ) : '' ) ?>"
     46                       value="<?php echo esc_attr( isset( $job_search ) ? $job_search : '' ); ?>"
    2247                       placeholder="Keywords"/>
    2348            </div>
     
    2752                <select title="Job Sector" name="job_sector" class="form-control">
    2853                    <option value="">Sector</option>
    29                     <?php $types = get_terms( array( 'taxonomy' => 'jobsector', 'hide_empty' => true ) ); ?>
    30                     <?php if ( $types ): ?>
    31                         <?php foreach ( $types as $type ): ?>
    32                             <?php if (isset($_POST['recruitly_nonce']) && check_admin_referer('job_search_form_action', 'recruitly_nonce') && isset( $_GET['job_sector'] ) && $type->slug == $_GET['job_sector']):?>
    33                                 <option value="<?php echo esc_html($type->slug) ?>"
    34                                         selected><?php echo esc_html(htmlspecialchars( $type->name )); ?></option>
    35                             <?php else: ?>
    36                                 <option value="<?php echo esc_html($type->slug) ?>"><?php echo esc_html(htmlspecialchars( $type->name )); ?></option>
    37                             <?php endif; ?>
    38                         <?php endforeach; ?>
    39                     <?php endif; ?>
     54                    <?php $types = get_terms( array( 'taxonomy' => 'jobsector', 'hide_empty' => true ) ); ?>
     55                    <?php if ( $types ): ?>
     56                        <?php foreach ( $types as $type ): ?>
     57                            <?php $selected = ( isset( $job_sector ) && $type->slug === $job_sector) ? 'selected' : ''; ?>
     58                            <option value="<?php echo esc_attr( $type->slug ); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html( $type->name ); ?></option>
     59                        <?php endforeach; ?>
     60                    <?php endif; ?>
    4061                </select>
    4162            </div>
     
    4364                <select title="Job Type" name="job_type" class="form-control">
    4465                    <option value="">Job Type</option>
    45                     <?php $types = get_terms( array( 'taxonomy' => 'jobtype', 'hide_empty' => true ) ); ?>
    46                     <?php if ( $types ): ?>
    47                         <?php foreach ( $types as $type ): ?>
    48                             <?php if ( isset($_POST['recruitly_nonce']) && check_admin_referer('job_search_form_action', 'recruitly_nonce') && isset( $_GET['job_type'] ) && $type->slug == $_GET['job_type'] ): ?>
    49                                 <option value="<?php echo esc_html($type->slug) ?>"
    50                                         selected><?php echo esc_html(htmlspecialchars( $type->name )); ?></option>
    51                             <?php else: ?>
    52                                 <option value="<?php echo esc_html($type->slug) ?>"><?php echo esc_html(htmlspecialchars( $type->name )); ?></option>
    53                             <?php endif; ?>
    54                         <?php endforeach; ?>
    55                     <?php endif; ?>
     66                    <?php $types = get_terms( array( 'taxonomy' => 'jobtype', 'hide_empty' => true ) ); ?>
     67                    <?php if ( $types ): ?>
     68                        <?php foreach ( $types as $type ): ?>
     69                            <?php $selected = ( isset( $job_type ) && $type->slug === $job_type ) ? 'selected' : ''; ?>
     70                            <option value="<?php echo esc_attr( $type->slug ); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html( $type->name ); ?></option>
     71                        <?php endforeach; ?>
     72                    <?php endif; ?>
    5673                </select>
    5774            </div>
     
    5976                <select title="City" name="job_city" class="form-control">
    6077                    <option value="">Location</option>
    61                     <?php $types = get_terms( array( 'taxonomy' => 'jobcity', 'hide_empty' => true ) ); ?>
    62                     <?php if ( $types ): ?>
    63                         <?php foreach ( $types as $type ): ?>
    64                             <?php if ( isset($_POST['recruitly_nonce']) && check_admin_referer('job_search_form_action', 'recruitly_nonce') && isset( $_GET['job_city'] ) && $type->slug == $_GET['job_city'] ): ?>
    65                                 <option value="<?php echo esc_html($type->slug) ?>"
    66                                         selected><?php echo esc_html(htmlspecialchars( $type->name )); ?></option>
    67                             <?php else: ?>
    68                                 <option value="<?php echo esc_html($type->slug) ?>"><?php echo esc_html(htmlspecialchars( $type->name )); ?></option>
    69                             <?php endif; ?>
    70                         <?php endforeach; ?>
    71                     <?php endif; ?>
     78                    <?php $types = get_terms( array( 'taxonomy' => 'jobcity', 'hide_empty' => true ) ); ?>
     79                    <?php if ( $types ): ?>
     80                        <?php foreach ( $types as $type ): ?>
     81                            <?php $selected = ( isset( $job_city ) && $type->slug === $job_city ) ? 'selected' : ''; ?>
     82                            <option value="<?php echo esc_attr( $type->slug ); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html( $type->name ); ?></option>
     83                        <?php endforeach; ?>
     84                    <?php endif; ?>
    7285                </select>
    7386            </div>
    7487            <div class="cool-search-footer col-md-3">
    75                 <button type="submit" value=" Search" class="form-control btn btn-primary" id="submit"><i
    76                             class="fa fa-magnifier"></i> Submit
    77                 </button>
     88                <button type="submit" value="Search" class="form-control btn btn-primary" id="submit"><i class="fa fa-magnifier"></i> Submit</button>
    7889            </div>
    7990        </div>
  • recruitly/trunk/templates/job-sector-widget.php

    r3194746 r3195911  
    99 * @category    Template
    1010 */
     11 
     12 if ( ! defined( 'ABSPATH' ) ) {
     13    exit; // Exit if accessed directly
     14 }
    1115?>
    1216<div class="recruitly_sector_jobs">
  • recruitly/trunk/templates/job-tag-widget.php

    r3194746 r3195911  
    99 * @category    Template
    1010 */
     11 
     12 if ( ! defined( 'ABSPATH' ) ) {
     13    exit; // Exit if accessed directly
     14 }
    1115?>
    1216<div class="recruitly_sector_jobs">
Note: See TracChangeset for help on using the changeset viewer.