Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
anantajitjg committed Aug 31, 2018
0 parents commit 434336c
Show file tree
Hide file tree
Showing 120 changed files with 39,794 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.gitattributes export-ignore
.gitignore export-ignore
package.json export-ignore
package-lock.json export-ignore
config.js export-ignore
gulpfile.js export-ignore
README.md export-ignore
CHANGELOG.md export-ignore
assets/fonts/icomoon.json export-ignore
.prettierrc export-ignore
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.DS_Store
Thumbs.db
node_modules
build
*.code-workspace
*.zip
*.log
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"printWidth": 80,
"useTabs": true,
"tabWidth": 2,
"semi": true,
"singleQuote": false,
"trailingComma": "none",
"bracketSpacing": false,
"arrowParens": "avoid"
}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## Changelog

### V 1.0 - 2018-08-12
* Initial Release
88 changes: 88 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
[![WP Job Openings](https://ps.w.org/wp-job-openings/assets/banner-772x250.png)](https://wordpress.org/plugins/wp-job-openings/)
# WP Job Openings
**Contributors:** awsmin
**Tags:** jobs, job listing, job openings, job board, careers page, jobs page, wp job opening, jobs plugin
**Requires at least:** 4.0
**Tested up to:** 4.9.8
**Stable tag:** 1.0
**License:** GPLv2 or later
**License URI:** https://www.gnu.org/licenses/gpl-2.0.html

## Summary

Super simple Job Listing plugin to manage Job Openings and Applicants on your WordPress site.

## Description

Are you looking for setting up a job listing page for a website? WP Job Openings plugin is the most simple yet powerful plugin for you.

The plugin is designed after carefully analysing hundreds of job listing layouts and methods. We just picked the best features out of the all and built a plugin that’s super simple to use and extendible to a high performing recruitment tool.

The first version of the plugin comes with two layouts - Grid and List which are designed carefully according to the modern design and User Experience principles. Highlight of the plugin is its totally flexible filter options. You will not realise its power until you start using it.


[View Demo](https://demo.awsm.in/wp-job-openings/)


## Key Features

* Super Simple and Easy to Set Up and See
* Two Different Modern Layouts
* Clean and User Friendly Designs
* Unlimited Job Specifications
* Unlimited Filtering Options
* AJAX Powered Job Listing and Filtering
* Comes with Default Form to Sumit Applications
* HR Role for setting up HR user
* Options to Customise Email Notifications
* Application Listings in Plugin
* Job Expiry Options
* Detailed documentation

## Installation

1. Upload the plugin folder to the `/wp-content/plugins/` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the `Plugins` screen in WordPress

## Screenshots

* **Job listing - Grid View**

[![Grid View](https://ps.w.org/wp-job-openings/trunk/screenshot-1.jpg)](https://wordpress.org/plugins/wp-job-openings/)

* **Job listing - List View**

[![List View](https://ps.w.org/wp-job-openings/trunk/screenshot-2.jpg)](https://wordpress.org/plugins/wp-job-openings/)

* **General Settings**

[![General Settings](https://ps.w.org/wp-job-openings/trunk/screenshot-3.png)](https://wordpress.org/plugins/wp-job-openings/)

* **Job Listing Page Appearance Settings**

[![Listing Appearance Settings](https://ps.w.org/wp-job-openings/trunk/screenshot-4.png)](https://wordpress.org/plugins/wp-job-openings/)

* **Job Details Page Appearance Settings**

[![Job Details Appearance Settings](https://ps.w.org/wp-job-openings/trunk/screenshot-5.png)](https://wordpress.org/plugins/wp-job-openings/)

* **Job Specifications Manager**

[![Specifications Manager](https://ps.w.org/wp-job-openings/trunk/screenshot-6.png)](https://wordpress.org/plugins/wp-job-openings/)

* **Application Form Settings**

[![Form Settings](https://ps.w.org/wp-job-openings/trunk/screenshot-7.png)](https://wordpress.org/plugins/wp-job-openings/)

* **Email Notification Settings**

[![Notification Setting](https://ps.w.org/wp-job-openings/trunk/screenshot-8.png)](https://wordpress.org/plugins/wp-job-openings/)

* **Application View**

[![Application View](https://ps.w.org/wp-job-openings/trunk/screenshot-9.png)](https://wordpress.org/plugins/wp-job-openings/)

## Changelog

**V 1.0 - 2018-08-12**
* Initial Release
114 changes: 114 additions & 0 deletions admin/class-awsm-job-openings-info.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<?php

if( ! defined( 'ABSPATH' ) ) {
exit;
}

class AWSM_Job_Openings_Info {
private static $_instance = null;

public function __construct() {
$this->cpath = untrailingslashit( plugin_dir_path( __FILE__ ) );
add_action( 'admin_init', array( $this, 'welcome_page_redirect' ) );
add_action( 'admin_head', array( $this, 'remove_menu' ) );
add_action( 'admin_menu', array( $this, 'custom_admin_menu' ) );
}

public static function init() {
if( is_null( self::$_instance ) ) {
self::$_instance = new self();
}
return self::$_instance;
}

public function welcome_page_redirect() {
if( ! get_transient( '_awsm_activation_redirect' ) ) {
return;
}
delete_transient( '_awsm_activation_redirect' );
if( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
return;
}
wp_safe_redirect( add_query_arg( array( 'page' => 'awsm-jobs-welcome-page' ), admin_url( 'edit.php?post_type=awsm_job_openings' ) ) );
exit;
}

public function custom_admin_menu() {
add_submenu_page( 'edit.php?post_type=awsm_job_openings', esc_html__( 'Welcome to Job Openings Plugin by Awsm.in', 'wp-job-openings' ), esc_html__( 'Getting started', 'wp-job-openings' ), 'manage_awsm_jobs', 'awsm-jobs-welcome-page', array( $this, 'welcome_page' ) );
add_submenu_page( 'edit.php?post_type=awsm_job_openings', esc_html__( 'Help', 'wp-job-openings' ), esc_html__( 'Help', 'wp-job-openings' ), 'manage_awsm_jobs', 'awsm-jobs-help-page', array( $this, 'help_page' ) );
add_submenu_page( 'edit.php?post_type=awsm_job_openings', esc_html__( 'Add-ons', 'wp-job-openings' ), esc_html__( 'Add-ons', 'wp-job-openings' ), 'manage_awsm_jobs', 'awsm-jobs-add-ons', array( $this, 'add_ons_page' ) );
}

public function remove_menu() {
remove_submenu_page( 'edit.php?post_type=awsm_job_openings', 'awsm-jobs-welcome-page' );
remove_submenu_page( 'edit.php?post_type=awsm_job_openings', 'awsm-jobs-help-page' );
}

public function get_info_header( $page ) { ?>
<div class="awsm-job-welcome">
<div class="awsm-job-welcome-main">
<img src="<?php echo esc_url( AWSM_JOBS_PLUGIN_URL . '/assets/img/job.png' ); ?>" alt="WP Job Openings">
<div class="awsm-job-welcome-inner">
<h1><?php esc_html_e( 'Welcome to Job Openings Plugin by Awsm.in', 'wp-job-openings' ); ?></h1>
<p class="awsm-job-welcome-message"><?php esc_html_e( 'Thank you for trying WP Job Openings Plugin by AWSM Innovations. The plugin will help you setup the jobs page for in a few minutes. We encourage you to check out the plugin documentation and getting started guide below.', 'wp-job-openings' ); ?></p>
</div><!-- .awsm-job-welcome-inner -->
</div><!-- .awsm-job-welcome-main -->
<h2 class="nav-tab-wrapper"><!-- nav-tab-active -->
<a href="<?php echo esc_url( add_query_arg( array( 'page' => 'awsm-jobs-welcome-page' ), admin_url( 'edit.php?post_type=awsm_job_openings' ) ) ); ?>" class="nav-tab<?php echo ( $page == 'welcome' ) ? ' nav-tab-active' : ''; ?>"><?php esc_html_e( 'Getting started', 'wp-job-openings' ); ?></a>
<a href="<?php echo esc_url( add_query_arg( array( 'page' => 'awsm-jobs-help-page' ), admin_url( 'edit.php?post_type=awsm_job_openings' ) ) ); ?>" class="nav-tab<?php echo ( $page == 'help' ) ? ' nav-tab-active' : ''; ?>"><?php esc_html_e( 'Help', 'wp-job-openings' ); ?></a>
<a href="<?php echo esc_url( add_query_arg( array( 'page' => 'awsm-jobs-add-ons' ), admin_url( 'edit.php?post_type=awsm_job_openings' ) ) ); ?>" class="nav-tab<?php echo ( $page == 'add-ons' ) ? ' nav-tab-active' : ''; ?>"><?php esc_html_e( 'Add-ons', 'wp-job-openings' ); ?></a>
</h2>
<?php
}

public function get_info_footer() { ?>
</div><!-- .awsm-job-welcome -->
<?php
}

public function welcome_page() {
$this->get_info_header( 'welcome' );
include_once $this->cpath . '/templates/info/welcome.php';
$this->get_info_footer();
}

public function help_page() {
$this->get_info_header( 'help' );
include_once $this->cpath . '/templates/info/help.php';
$this->get_info_footer();
}

public function add_ons_page() {
$this->get_info_header( 'add-ons' );
include_once $this->cpath . '/templates/info/add-ons.php';
$this->get_info_footer();
}

public function get_add_on_btn_content( $plugin ) {
$content = $btn_action = $action_url = $btn_class = $btn_attrs = '';
$plugin_arr = explode( '/', esc_html( $plugin ) );
$plugin_slug = $plugin_arr[0];
$installed_plugin = get_plugins( '/' . $plugin_slug );
if ( empty( $installed_plugin ) ) {
if ( get_filesystem_method( array(), WP_PLUGIN_DIR ) === 'direct' ) {
$btn_action = esc_html__( 'Get it now', 'wp-job-openings' );
$action_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $plugin_slug ), 'install-plugin_' . $plugin_slug );
$btn_class = ' install-now';
}
} else {
if( is_plugin_active( $plugin ) ) {
$btn_action = esc_html__( 'Activated', 'wp-job-openings' );
$action_url = '#';
$btn_attrs = ' disabled';
} else {
$btn_action = esc_html__( 'Activate', 'wp-job-openings' );
$action_url = wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=' . $plugin ), 'activate-plugin_' . $plugin );
$btn_class = ' activate-now';
}
}
if( ! empty( $btn_action ) ) {
$content = sprintf( '<a href="%2$s" class="button button-large%3$s"%4$s>%1$s</a>', $btn_action, esc_url( $action_url ), esc_attr( $btn_class ), $btn_attrs );
}
return $content;
}
}
152 changes: 152 additions & 0 deletions admin/class-awsm-job-openings-meta.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
<?php
if( ! defined( 'ABSPATH' ) ) {
exit;
}

class AWSM_Job_Openings_Meta {
private static $_instance = null;

public function __construct() {
add_action( 'add_meta_boxes', array( $this, 'awsm_register_meta_boxes' ) );
add_action( 'admin_menu', array( $this, 'remove_meta_boxes' ) );
if( isset( $_GET['awsm_action'] ) && $_GET['awsm_action'] === 'download_resume' ) {
add_action( 'plugins_loaded', array( $this, 'download_resume_handle' ) );
}
}

public static function init() {
if( is_null( self::$_instance ) ) {
self::$_instance = new self();
}
return self::$_instance;
}

public function awsm_register_meta_boxes() {
global $action;
if( $action == 'edit' ) {
add_meta_box( 'awsm-status-meta', esc_html__( 'Job Status', 'wp-job-openings'), array( $this, 'awsm_job_status'), 'awsm_job_openings', "side", "low" );
}
$awsm_filters = get_option( 'awsm_jobs_filter' );
if( ! empty( $awsm_filters ) ) {
add_meta_box( 'awsm-job-meta', esc_html__('Job Specifications', 'wp-job-openings'), array( $this, 'awsm_job_handle'), 'awsm_job_openings', "normal", "high" );
}
add_meta_box( 'awsm-expiry-meta', esc_html__( 'Job Expiry', 'wp-job-openings'), array( $this,'awsm_job_expiration'), 'awsm_job_openings', "side", "low" );
add_meta_box( 'awsm-job-details-meta', esc_html__('Applicant Details', 'wp-job-openings'), array( $this, 'awsm_job_application_handle' ), 'awsm_job_application', "normal", "high" );
}

public function awsm_job_status() {
include_once plugin_dir_path( __FILE__ ) . 'templates/meta/job-status.php';
}

public function awsm_job_handle( $post ) {
include_once plugin_dir_path( __FILE__ ) . 'templates/meta/job-specifications.php';
}

public function awsm_job_expiration( $post ) {
include plugin_dir_path( __FILE__ ) . 'templates/meta/job-expiry.php';
}

public function awsm_job_application_handle( $post ) {
include plugin_dir_path( __FILE__ ) . 'templates/meta/applicant-single.php';
}

public function remove_meta_boxes() {
remove_meta_box( 'slugdiv', 'awsm_job_application', 'normal' );
remove_meta_box( 'submitdiv', 'awsm_job_application', 'side' );
}

public function get_applicant_meta_details_list( $post_id, $preset_values = array() ) {
$list = '';
$applicant_meta = apply_filters( 'awsm_jobs_applicant_meta', array(
'awsm_applicant_name' => array(
'label' => __( 'Name', 'wp-job-openings' )
),
'awsm_applicant_phone' => array(
'label' => __( 'Phone', 'wp-job-openings' )
),
'awsm_applicant_email' => array(
'label' => __( 'Email', 'wp-job-openings' )
),
'awsm_applicant_letter' => array(
'label' => __( 'Cover Letter', 'wp-job-openings' ),
'multi-line' => true
)
), $post_id );
if( ! empty( $applicant_meta ) && is_array( $applicant_meta ) ) {
foreach( $applicant_meta as $meta_key => $meta_options ) {
$visible = ( isset( $meta_options['visible'] ) ) ? $meta_options['visible'] : true;
$multi_line = ( isset( $meta_options['multi-line'] ) ) ? $meta_options['multi-line'] : false;
if( $visible ) {
$label = ( isset( $meta_options['label'] ) ) ? $meta_options['label'] : '';
$value = '';
if( ! empty( $preset_values ) && isset( $preset_values[$meta_key] ) ) {
$value = $preset_values[$meta_key];
} elseif( ! empty( $meta_options ) && isset( $meta_options['value'] ) ) {
$value = $meta_options['value'];
} else {
$value = get_post_meta( $post_id , $meta_key, true );
}
$meta_content = ( empty( $multi_line ) ) ? esc_html( $value ) : wp_kses( wpautop( $value ), array( 'p' => array(), 'br' => array() ) );
$list .= sprintf( '<li><label>%1$s</label><span>%2$s</span></li>', esc_html( $label ), $meta_content );
}
}
}
return $list;
}

public function get_resume_details( $attachment_id ) {
$details = array();
$attachment_file = get_attached_file( $attachment_id );
if( ! empty( $attachment_file ) ) {
$file_type = wp_check_filetype( $attachment_file );
$file_size = filesize( $attachment_file );
$display_size = size_format( $file_size, 2 );
$details = array(
'file_name' => $attachment_file,
'file_type' => $file_type,
'file_size' => array(
'size' => $file_size,
'display' => $display_size
)
);
}
return $details;
}

public function get_resume_download_url( $attachment_id ) {
$download_url = add_query_arg( array(
'awsm_id' => $attachment_id,
'awsm_nonce' => wp_create_nonce( 'awsm_resume_download' ),
'awsm_action' => 'download_resume'
), get_edit_post_link() );
return esc_url( $download_url );
}

public function download_resume_handle() {
if( current_user_can( 'edit_others_applications' ) && isset( $_GET['awsm_id'] ) && isset( $_GET['awsm_nonce'] ) ) {
if( ! wp_verify_nonce( $_GET['awsm_nonce'], 'awsm_resume_download' ) ) {
wp_die( esc_html__( 'Error occurred!', 'wp-job-openings' ) );
}
$attachment_id = intval( $_GET['awsm_id'] );
if( ! $attachment_id ) {
wp_die( esc_html__( 'Invalid id.', 'wp-job-openings' ) );
}
$resume_details = $this->get_resume_details( $attachment_id );
if( ! empty( $resume_details ) ) {
$resume_name = sanitize_title( get_the_title( $attachment_id ) . '_' . __( 'resume', 'wp-job-openings' ) );
header( 'Content-Description: File Transfer' );
header( 'Content-Type: ' . $resume_details['file_type']['type'] );
header( 'Content-Disposition: attachment; filename="' . $resume_name . '.' . $resume_details['file_type']['ext'] . '"' );
header( 'Expires: 0' );
header( 'Pragma: no-cache' );
if( ! empty( $resume_details['file_size']['size'] ) ) {
header( 'Content-Length: ' . $resume_details['file_size']['size'] );
}
readfile( $resume_details['file_name'] );
exit;
} else {
wp_die( esc_html__( 'File not found!', 'wp-job-openings' ) );
}
}
}
}
Loading

0 comments on commit 434336c

Please sign in to comment.