Skip to content

Commit

Permalink
Merge pull request #4 in WP/impress-agents from release/WP-186-create…
Browse files Browse the repository at this point in the history
…-readme.txt-for-impress-agents to master

* commit '8c042df988dbb638c4153c7dd90b7eff2d56db7b':
  t stash mirror
  Updated readme.txt TODO: * add screenshots * convert to markdown
  * prevent direct file access * remove dns prefetch for font awesome * sanitize detail keys and values
  • Loading branch information
Dave Bonds committed Jan 25, 2016
2 parents d9b3ea9 + 8c042df commit 78ea32a
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 36 deletions.
11 changes: 10 additions & 1 deletion includes/class-agents.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
/**
* This file contains the IMPress_Agents class.
*/
Expand Down Expand Up @@ -40,7 +41,7 @@ function __construct() {
),
'col2' => array(
__( 'Email:', 'impress_agents' ) => '_employee_email',
__( 'Website (NO http://):', 'impress_agents' ) => '_employee_website',
__( 'Website:', 'impress_agents' ) => '_employee_website',
__( 'Address:', 'impress_agents' ) => '_employee_address',
__( 'City:', 'impress_agents' ) => '_employee_city',
__( 'State:', 'impress_agents' ) => '_employee_state',
Expand Down Expand Up @@ -182,6 +183,14 @@ function metabox_save( $post_id, $post ) {
/** Store the employee details custom fields */
foreach ( (array) $employee_details as $key => $value ) {

$key = sanitize_key($key);

if($key == '_employee_email') {
$value = sanitize_email($value);
} else {
$value = sanitize_text_field($value);
}

/** Save/Update/Delete */
if ( $value ) {
update_post_meta($post->ID, $key, $value);
Expand Down
1 change: 1 addition & 0 deletions includes/class-employee-widget.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
/**
* This widget displays a featured employee.
*
Expand Down
1 change: 1 addition & 0 deletions includes/class-taxonomies.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
/**
* This file contains the IMPress_Agents_Taxonomies class.
*/
Expand Down
5 changes: 4 additions & 1 deletion includes/functions.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
/**
* Holds miscellaneous functions for use in the IMPress Agents plugin
*
Expand Down Expand Up @@ -95,7 +96,9 @@ function impa_employee_details() {
$output .= sprintf('<p><a class="email" itemprop="email" href="mailto:%s">%s</a></p>', antispambot($email), antispambot($email) );

if (get_post_meta($post->ID, '_employee_website', true) != '')
$output .= sprintf('<p><a class="website" itemprop="url" href="http://%s">%s</a></p>', get_post_meta($post->ID, '_employee_website', true), get_post_meta($post->ID, '_employee_website', true) );
$website = esc_url(get_post_meta($post->ID, '_employee_website', true));
$website_no_http = preg_replace('#^https?://#', '', rtrim($website,'/'));
$output .= sprintf('<p><a class="website" itemprop="url" href="%s">%s</a></p>', $website, $website_no_http );

if (get_post_meta($post->ID, '_employee_city', true) != '' || get_post_meta($post->ID, '_employee_address', true) != '' || get_post_meta($post->ID, '_employee_state', true) != '' || get_post_meta($post->ID, '_employee_zip', true) != '' ) {

Expand Down
2 changes: 1 addition & 1 deletion includes/helpers.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

if ( ! defined( 'ABSPATH' ) ) exit;
/**
* Lists all the terms of a given taxonomy
*
Expand Down
1 change: 1 addition & 0 deletions includes/shortcodes.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
/**
* Adds shortcode to display agent profiles
*/
Expand Down
2 changes: 0 additions & 2 deletions includes/views/agentevo-metabox.php

This file was deleted.

6 changes: 0 additions & 6 deletions includes/views/archive-employee.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ function enqueue_single_employee_scripts() {
wp_enqueue_style( 'font-awesome' );
}

/** Set DNS Prefetch to improve performance on single listings templates */
add_filter('wp_head','impress_agents_dnsprefetch', 0);
function impress_agents_dnsprefetch() {
echo "\n<link rel='dns-prefetch' href='//maxcdn.bootstrapcdn.com' />\n"; // Loads FontAwesome
}

function archive_employee_loop() {
echo '<div class="employee-archive">';

Expand Down
4 changes: 3 additions & 1 deletion includes/views/create-tax.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php screen_icon( 'themes' ); ?>
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
screen_icon( 'themes' ); ?>
<h2><?php _e( 'Employee Taxonomies', 'impress_agents' ); ?></h2>

<div id="col-container">
Expand Down
1 change: 1 addition & 0 deletions includes/views/employee-details-metabox.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
wp_nonce_field( 'impress_agents_metabox_save', 'impress_agents_metabox_nonce' );

global $post;
Expand Down
2 changes: 0 additions & 2 deletions includes/views/idx-metabox.php

This file was deleted.

1 change: 1 addition & 0 deletions includes/views/impress-agents-settings.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
if( isset($_GET['settings-updated']) ) { ?>
<div id="message" class="updated">
<p><strong><?php _e('Settings saved.','impress_agents'); ?></strong></p>
Expand Down
6 changes: 0 additions & 6 deletions includes/views/single-employee.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ function enqueue_single_employee_scripts() {
wp_enqueue_style( 'font-awesome' );
}

/** Set DNS Prefetch to improve performance on single listings templates */
add_filter('wp_head','impress_agents_dnsprefetch', 0);
function impress_agents_dnsprefetch() {
echo "\n<link rel='dns-prefetch' href='//maxcdn.bootstrapcdn.com' />\n"; // Loads FontAwesome
}

function single_employee_post_content() {
global $post;
?>
Expand Down
9 changes: 2 additions & 7 deletions plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
License URI: http://www.opensource.org/licenses/gpl-license.php
*/

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

register_activation_hook( __FILE__, 'impress_agents_activation' );
/**
* This function runs on plugin activation. It flushes the rewrite rules to prevent 404's
Expand Down Expand Up @@ -99,13 +101,6 @@ function add_impress_agents_main_styles() {
function impress_agents_admin_scripts_styles() {
wp_enqueue_style( 'impress_agents_admin_css', IMPRESS_AGENTS_URL . 'includes/css/impress-agents-admin.css' );

/** Enqueue Font Awesome in the Admin if IDX Broker is not installed */
// if (!class_exists( 'Idx_Broker_Plugin' )) {
// wp_register_style('font-awesome-admin', '//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', '', null, 'all');
// wp_enqueue_style('font-awesome-admin');
// wp_enqueue_style('upgrade-icon', IMPRESS_AGENTS_URL . 'includes/css/impress-agents-upgrade.css');
// }

wp_enqueue_script( 'impress-agents-admin', IMPRESS_AGENTS_URL . 'includes/js/admin.js', 'media-views' );

$localize_script = array(
Expand Down
38 changes: 29 additions & 9 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,27 @@
Author: Agent Evolution
Author URL: http://www.agentevolution.com/
Contributors: agentevolution, davebonds, chadajohnson, idxco
Tags:
Requires at least: 3.7
Tags: agents, employees, employee directory, agent directory, agents, idx broker, idx, impress
Requires at least: 4.3.0
Tested up to: 4.4.1
Stable tag: 2.0.0
Stable tag: 1.0.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Employee Directory for WordPress tailored for Real Estate Offices.
Employee Directory tailored for Real Estate Offices.

== Description ==

This plugin adds a custom post type for Employees with custom meta fields for employee contact info. It uses included templates to display the contact info for single and archive pages, or these can be overridden in the theme.
IMPress Agents provides you with a full employee directory, however it is ideal for Real Estate offices.

Adds taxonomies for Offices and Job Types to show employees by location and job title.
This plugin adds a custom post type for Employees with post meta fields for employee contact info. It uses included templates to display the contact info for single and archive pages, or these can be overridden in your theme.

Coming soon: Import agent details from the IDX API!
Adds taxonomies for Offices and Job Types to show employees by location and/or job title. Or add custom taxonmies to categorize to your needs. If using WP 4.4+, you can add images to taxonomy terms and display an image for an office, job title, or an custom taxonomy term.

If using the [IMPress Listings](https://wordpress.org/plugins/wp-listings/) plugin, you can connect Employees to Listings. *Requires the [Posts 2 Posts](https://wordpress.org/plugins/posts-to-posts/) plugin*

*Coming soon: Import agent details from the IDX API. Add more details and have them connected to imported listings from your [IDX Broker](http://www.idxbroker.com/) account!*
*Coming soon: Add your favorite vendors!*

== Installation ==

Expand All @@ -27,11 +32,26 @@ Coming soon: Import agent details from the IDX API!

== Frequently Asked Questions ==

= I have a support issue, where do I go? =
Just post to the support forum here (https://wordpress.org/support/plugin/impress-agents/)

== Screenshots ==
= Can I use this without an IDX account =
Certainly! It functions as an employee directory, with or without an IDX account.

= How can I suggest improvements? =
Just post to the support forum here on [wordpress.org](https://wordpress.org/support/plugin/impress-agents/) or developers can post to the [IMPress Agents Github repo](https://github.com/agentevolution/impress-agents).

== Screenshots ==
1. WP Admin > Add New
2. WP Admin > Employees
3. WP Admin > Employee Taxonomies
4. Front End > Single Employee
5. Front End > Employee Archive
6. Front End > Employee Widget
7. Front End > Connected Listings
7. Front End > Connected Agents

== Changelog ==

= 0.9 =
= 1.0.0 =
* Initial public release

0 comments on commit 78ea32a

Please sign in to comment.