Skip to content

Commit

Permalink
FBC Release V: 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Sehrish Iftikhar committed Jan 21, 2020
0 parents commit 9398081
Show file tree
Hide file tree
Showing 50 changed files with 9,904 additions and 0 deletions.
339 changes: 339 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

93 changes: 93 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
=== Flexy Breadcrumb ===
Contributors: PressTigers
Donate link: https://www.presstigers.com
Tags: breadcrumb, breadcrumbs, navigation, menu, link, page link, navigate
Requires at least: 4.6
Tested up to: 5.3.2
Requires PHP: 7.2
Stable tag: 1.1.1
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Flexy Breadcrumb is a super light weight plugin that is easy to navigate through current page hierarchy.

== Description ==

Flexy Breadcrumb by <a href="https://www.presstigers.com">PressTigers</a> is one of the simple and robust breadcrumb menu system available for the WordPress site. By using this plugin, you can display breadcrumb navigation anywhere in your website via [flexy_breadcrumb] shortcode.
With the help of this plugin you can style and format the text, links and separators of breadcrumbs according to your own taste.

= Plugin Features =

* SEO Friendly(added schema structure).
* Use via [flexy_breadcrumb] shortcode.
* Allow users to change breadcrumb separator.
* Set Home text and End text.
* Set Word/Character limit for navigation menu.
* Font Awesome icon picker for Home.
* Color options for text, link, separator and background through global settings.
* Set font size of breadcrumb trail.

= Shortcode =
` [flexy_breadcrumb] `

== Installation ==

1. Upload flexy-breadcrumb.zip to the /wp-content/plugins/ directory to your web server.
1. Activate the plugin through the 'Plugins' menu in WordPress.
1. Add [flexy_breadcrumb] shortcode in the editor or appropriate file(header.php) to display the breadcrumb on front-end.

== Frequently Asked Questions ==

= How to use Flexy Breadcrumb Shortcode? =
There are several methods but in general, you need to add the following line of code to your theme. This goes somewhere near the bottom of your theme's header.php template. However, you can add it anywhere you want in your theme, and it'll work.

`<?php echo do_shortcode( '[flexy_breadcrumb]'); ?>`

= Submitting Patches =
If you’ve identified a bug and have a fix, we’d welcome it at our [GitHub page for Flexy Breadcrumb](https://github.com/presstigers/flexy-breadcrumb/). Simply submit a pull request so we can review and merge into the codebase if appropriate from there. For more information, check out the readme at our GitHub page. Happy coding!

== Screenshots ==

1. **Basic Theme** - Front-end view of breadcrumb trail.
2. **General Settings** - Allow user to manage general settings.
3. **Typography Settings** - Allow user to change color options for breadcrumb trail.

== Credits ==

1. Google Fonts(https://fonts.google.com)
1. jQuery UI(https://jqueryui.com)
1. WP Color Picker Alpha(https://github.com/23r9i0/wp-color-picker-alpha)
1. Font Awesome Icon Picker(https://github.com/itsjavi/fontawesome-iconpicker)

== Changelog ==

= 1.1.1 =
* Fix - Added slash at the end of the URL - Google Recommendation
* Fix - Wrapping the admin style to avoid from any style conflict.
* Tweak - Update the schema links to https.

= 1.1.0 =
* Feature - Added breadcrumb trail for default posts page.
* Feature - Display category in post detail page having highest count.
* Fix - Fixed Google Structured Schema for Breadcrumbs.
* Fix - Remove archive link for custom post type if archive parameter is false.
* Tweak - Display only highest category count in post detail page.

= 1.0.3 =
WP 4.9 Compatibility – Resolved the color picker issue in settings’s typography tab.
* Fix - Resolved the space issue between the <a> attributes.

= 1.0.2 =
* Fix - Resolved the structured data issue for active list element.

= 1.0.1 =
* Fix - Resolved the floating issues in breadcrumb template.
* Fix - Fixed the styling glitches of settings tab's layout.
* Fix - Resolved the 404 error in case of home page.

= 1.0.0 =
* Initial release

== Upgrade Notice ==
= 1.1.1 =
1.1.1 is a minor release with Google Schema & Admin Style fixes.
114 changes: 114 additions & 0 deletions admin/class-flexy-breadcrumb-admin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<?php
/**
* Flexy_Breadcrumb_Admin Class
*
* Defines the plugin name, version, and two examples hooks for how to
* enqueue the admin-specific stylesheet and JavaScript.
*
* @link http://presstigers.com
* @since 1.0.0
*
* @package Flexy_Breadcrumb
* @subpackage Flexy_Breadcrumb/admin
* @author PressTigers <support@presstigers.com>
*/
class Flexy_Breadcrumb_Admin {

/**
* The ID of this plugin.
*
* @since 1.0.0
* @access private
* @var string $flexy_breadcrumb The ID of this plugin.
*/
private $flexy_breadcrumb;

/**
* The version of this plugin.
*
* @since 1.0.0
* @access private
* @var string $version The current version of this plugin.
*/
private $version;

/**
* Initialize the class and set its properties.
*
* @since 1.0.0
* @param string $flexy_breadcrumb The name of this plugin.
* @param string $version The version of this plugin.
*/
public function __construct($flexy_breadcrumb, $version) {

$this->flexy_breadcrumb = $flexy_breadcrumb;
$this->version = $version;

/**
* The class responsible for defining all the plugin settings that occur in the front end area.
*/
require_once plugin_dir_path(dirname(__FILE__)) . 'admin/class-flexy-breadcrumb-settings-init.php';

// Filter -> Footer Branding - with PressTigers Logo
add_filter( 'admin_footer_text', array( $this, 'admin_powered_by' ) );
}

/**
* Register the stylesheets for the admin area.
*
* @since 1.0.0
*/
public function enqueue_styles() {

// Enqueue Flexy Breadcrumb Google Fonts
wp_enqueue_style( $this->flexy_breadcrumb . "-open-sans", 'https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i', array(), 'all' );

// Enqueue Fontawesome CSS File
wp_enqueue_style( $this->flexy_breadcrumb . "-fontawesome", plugin_dir_url(__FILE__) . 'css/font-awesome.min.css', array(), '4.7.0', 'all' );

// Enqueue Flexy Breadcrumb Admin Core CSS File
wp_enqueue_style( $this->flexy_breadcrumb . "-admin", plugin_dir_url(__FILE__) . 'css/flexy-breadcrumb-admin.css', array('wp-color-picker'), $this->version, 'all' );

// Enqueue Fontawesome Icon Picker CSS File
wp_enqueue_style( $this->flexy_breadcrumb . "-fontawesome-icon-picker", plugin_dir_url(__FILE__) . 'css/fontawesome-iconpicker.min.css', array(), '1.2.2', 'all' );
}

/**
* Register the JavaScript for the admin area.
*
* @since 1.0.0
*/
public function enqueue_scripts() {

if (is_admin()) {

// Register Fontawesome JS File
wp_register_script( $this->flexy_breadcrumb. '-fontawesome-icon-picker', plugin_dir_url(__FILE__) . 'js/fontawesome-iconpicker.min.js', '', '1.2.2', TRUE);

// Register Core Admin JS File
wp_register_script($this->flexy_breadcrumb. '-admin-scripts', plugin_dir_url(__FILE__) . 'js/flexy-breadcrumb-admin.js', array('jquery'), $this->version, TRUE);

// Register Alpha Color Picker Script
wp_register_script( $this->flexy_breadcrumb. '-wp-color-picker-alpha', plugin_dir_url(__FILE__) . 'js/wp-color-picker-alpha.min.js', array( 'wp-color-picker' ), '1.2.2', TRUE);
}
}

/**
* PressTigers Branding.
*
* @since 1.0.0
*/
public function admin_powered_by($text) {
$screen = get_current_screen();

// FBC Admin Page Id
$fbc_pages = array(
'toplevel_page_flexy-breadcrumb-settings',
);

if ( is_admin() && ( in_array( $screen->id, apply_filters('fbc_pages', $fbc_pages) ) ) ) {
$text = '<a href=' . esc_url( "https://www.presstigers.com/") . ' target="_blank"><img src="' . plugin_dir_url(__FILE__) . '/images/powerByIcon.png" alt="Powered by PressTigers"></a>';
}
return $text;
}
}
186 changes: 186 additions & 0 deletions admin/class-flexy-breadcrumb-settings-init.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
<?php
/**
* Flexy_Breadcrumb_Admin_Settings_Init Class
*
* Flexy Breadcrumb Settings:
*
* - General Options
* - Typography Options
*
* @link https://presstigers.com
* @since 1.0.0
*
* @package Flexy_Breadcrumb
* @subpackage Flexy_Breadcrumb/admin
* @author PressTigers <support@presstigers.com>
*/
class Flexy_Breadcrumb_Admin_Settings_Init {

/**
* Initialize the class and set its properties.
*
* @since 1.0.0
*/
public function __construct() {
/**
* The class responsible for defining all the plugin settings that occur in the front end area.
*/
require_once plugin_dir_path(dirname(__FILE__)) . 'admin/settings/class-flexy-breadcrumb-settings-general.php';

/**
* The class responsible for defining all the plugin settings that occur in the front end area.
*/
require_once plugin_dir_path(dirname(__FILE__)) . 'admin/settings/class-flexy-breadcrumb-settings-typography.php';

/**
* Action - Add Settings Menu
*/
add_action('admin_menu', array($this, 'fbc_admin_menu'), 13);

/**
* Action - Add Options Group
*/
add_action('admin_init', array($this, 'register_settings_fields'));
}

/**
* Create Admin Menu Page
*
* @since 1.0.0
*/
public function fbc_admin_menu() {
add_menu_page(__('Flexy Breadcrumb', 'flexy-breadcrumb'), __('Flexy Breadcrumb', 'breadcrumb'), 'manage_options', 'flexy-breadcrumb-settings', array($this, 'settings_tab_menu'), plugins_url('images/admin-menu-icon.png', __FILE__) );
}

/**
* Registers Settings
*
* @since 1.0.0
*/
public function register_settings_fields() {
register_setting("fbc_breadcrumb_section", "fbc_settings_options");
}

/**
* Display Settings
*
* @since 1.0.0
*/
public function settings_tab_menu() {
$fbc_settings_options = get_option('fbc_settings_options');
$fbcObj = new Flexy_Breadcrumb();

// Enqueue Admin Scripts Script
wp_enqueue_script( $fbcObj->get_plugin_name() . '-admin-scripts' );
?>

<!-- Flexy Breadcrumb Settings -->
<div class="fbc-wrap">

<!-- Flexy Breadcrumb Settings Form -->
<form id="fbc-options-form" method="POST" action="options.php">

<?php
/**
* Create Settings Section with followings:
*
* - Nonce Fileds
* - Actions
* - Options Page Fields
*
* @since 1.0.0
*/
settings_fields('fbc_breadcrumb_section');
?>

<!-- Settings Loader -->
<div class="loading-div">
<div class="loading"><i class="fa fa-spin fa-spinner"></i></div>
</div>

<div class="fbc-container-fluid pt-wrapper-bg">

<!-- Settings Tabs -->
<div class="fbc-col-lg-2 fbc-col-md-3 fbc-col-sm-4 fbc-col-xs-1" style="padding:0;">

<!-- Settings Saved Notification -->
<div class="success-msg"><?php esc_html_e('Setting have been saved.', 'flexy-breadcrumb'); ?></div>

<!-- Error Notification -->
<div class="error-msg"><?php esc_html_e('There is an error. Please try again later', 'flexy-breadcrumb'); ?></div>

<!-- Settings Tabs -->
<div class="fbc-sidebar">
<div class="branding">
<strong><?php echo esc_html__('Flexy Breadcrumb', 'flexy-breadcrumb'); ?></strong><br/>
<?php echo esc_attr( $fbcObj->get_version() ); ?>
</div>
<div class="main-nav">
<ul class="sub-menu categoryitems" style="display:block">
<?php
/**
* Filter the Settings Tab Menus.
*
* @since 1.1.0
*
* @param array (){
* @type array Tab Id => Settings Tab Name
* }
*/
$settings_tabs = apply_filters('fbc_settings_tab_menus', array());
$count = 1;

foreach ($settings_tabs as $key => $tab_name ) {
$active_tab = ( 1 === $count ) ? 'active' : '';
?>
<li class="<?php echo $active_tab ?>">
<a href="#<?php echo sanitize_key( $key ); ?>-settings" onClick="toggleDiv(this.hash); return false;">
<?php if ( 'General' == $tab_name ) { ?>
<i class="fa fa-cogs"></i><span><?php echo esc_attr( $tab_name ); ?></span>

<?php } elseif ( 'Typography' == $tab_name) { ?>
<i class="fa fa-text-height" aria-hidden="true"></i><span><?php echo esc_attr( $tab_name ); ?></span>

<?php } ?>
</a>
</li>
<?php
$count++;
}
?>
</ul>
</div>
</div>
</div>

<!-- Settings Sections -->
<div class="fbc-col-lg-10 fbc-col-md-9 fbc-col-sm-8 fbc-col-xs-11" style="padding: 0;">
<div class="save-options">
<input type="submit" id="submit-btn" name="submit-btn" class="topbtn" value="<?php esc_html_e('Save Changes', 'flexy-breadcrumb'); ?>" />
</div>
<div class="main-content">

<!-- General Sections-->
<div id="general-settings">
<?php do_action('fbc_general_settings'); ?>
</div>

<!-- Typography Sections-->
<div id="typography-settings" style="display:none;">
<?php do_action('fbc_typography_settings'); ?>
</div>
</div>

<!-- Save Settings -->
<div class="save-options">
<input type="submit" id="submit-btn" name="submit-btn" class="topbtn" value="<?php esc_html_e('Save Changes', 'flexy-breadcrumb'); ?>" />
</div>
<div class="clear"></div>
</div>
</div>
</form>
</div>
<?php
}
}
new Flexy_Breadcrumb_Admin_Settings_Init();
Loading

0 comments on commit 9398081

Please sign in to comment.