Skip to content

Commit 70fafd4

Browse files
committed
Merge pull request #77 from EnigmaWeb/development-local
Version 1.1.2
2 parents 37516e2 + 1042c61 commit 70fafd4

File tree

8 files changed

+94
-58
lines changed

8 files changed

+94
-58
lines changed

readme.txt

Lines changed: 35 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: EnigmaWeb, helgatheviking, Base29, macbookandrew
33
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CEJ9HFWJ94BG4
44
Tags: WP Knowledgebase, knowledgebase, knowledge base, faqs, wiki
55
Requires at least: 2.7
6-
Tested up to: 4.4.1
6+
Tested up to: 4.5
77
Stable tag: trunk
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -127,6 +127,20 @@ If you've tried all the obvious stuff and it's still not working please request
127127
4. Available widgets
128128

129129
== Changelog ==
130+
131+
= 1.1.2 =
132+
* fixed count issue on parent category
133+
* fixed page title issue - it will now reflect page name rather than being stuck on "knowledgebase"
134+
* fixed pluralization if there is only one article
135+
* register stylesheet and JS and call only on KBE pages
136+
* only eneque and load search inline script if search is enabled
137+
* move some scripts to footer for better performance
138+
* only print inline styles if color is defined
139+
* add admin notice if theme contains customized templates
140+
* optimize images
141+
* use get_stylesheet_directory instead of replacing built-in constant
142+
* fixed a few typos
143+
130144
= 1.1.1 =
131145
* fixed error warnings
132146
* 'parent' => 0 removed from the terms array to fix reorder of subcategories
@@ -195,67 +209,46 @@ If you've tried all the obvious stuff and it's still not working please request
195209

196210
== Upgrade Notice ==
197211

212+
= 1.1.2 =
213+
This upgrade fixes a lot of small long running issues and optimises performance. All users are encouraged to upgrade.
214+
215+
A big thank you to macbookandrew for his contributions to this release.
216+
198217
= 1.1.1 =
199-
* fixed error warnings
200-
* 'parent' => 0 removed from the terms array to fix reorder of subcategories
201-
* Registered support for 'author'
218+
This is a minor release addressing a few small bugs and enhancements.
202219

203220
= 1.1 =
204-
* renames index.php to wp-knowledgebase.php
205-
* no longer automatically copies template files to theme folder
206-
* no longer deletes kbe template folder from theme
207-
* fixes template redirect issue
208-
* fixes search template issue
209-
* uninstall.php is called automatically as of WP2.7
210-
* no longer silences error_reporting
211-
* no need to flush_rewrite_rules() 3 times
212-
* updates widget registration
213-
* adds optional custom headers/footers
214-
* fix for undefined $i variable
215-
* fixes conditional loading of scripts/styles
216-
* sanitizes merge options
217-
* some minor css fixes
221+
This is a major release which focuses on the plugin's templating system and overall code improvements. Upgrade carefully and please read new FAQ info and description regarding the templating.
222+
223+
A big thank you to helgatheviking for her contributions to this release.
224+
218225

219226
= 1.0.9 =
220-
* Replace TEMPLATEPATH with STYLESHEETPATH.
221-
* Replace get_template_directory_uri() with get_stylesheet_directory_uri().
227+
Minor release, but fixes an important stylesheet issue. Upgrade immediately.
222228

223229
= 1.0.8 =
224-
* Added strip_tags() function for excerpt for the search results.
225-
* Query corrected for getting KBE title and fixing the activation error.
230+
Minor release.
226231

227232
= 1.0.7 =
228-
* CSS file path corrected.
233+
Patch only.
229234

230235
= 1.0.6 =
231-
* Update query corrected on order.
236+
Patch only.
232237

233238
= 1.0.5 =
234-
* Issue with child theme fixed.
235-
* Function corrected for copying plugin template files in to active theme folder
239+
Important fixes to templating and css. Upgrade immediately.
236240

237241
= 1.0.4 =
238-
* Breadcrumbs text issue fixed.
239-
* Added support for Sub-Categories.
240-
* Added support for child theme.
241-
* Added support for multi site.
242-
* Some Code Correction.
243-
* Added support for revisions.
244-
* Languages added
242+
Major release.
245243

246244
= 1.0.3 =
247-
* Minor CSS Changes.
248-
* Breadcrumbs link issue fixed.
249-
* Truncate function removed from the titles
250-
* Function corrected for loading plugin text domain
245+
Minor release, fixing a number of irritating problems. Encouraged to upgrade.
251246

252247
= 1.0.2 =
253-
* Translation issue fixed
254-
* Miscellaneous minor fixes
248+
Minor release.
255249

256250
= 1.0.1 =
257-
* Function fixed which was assigning template to the page
258-
* Theme styling issue fixed
251+
Minor release.
259252

260253
= 1.0 =
261-
* Initial release
254+
Initial release

template/archive-kbe_knowledgebase.php

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22
get_header('knowledgebase');
3+
global $wpdb;
34

45
// load the style and script
56
wp_enqueue_style ( 'kbe_theme_style' );
@@ -68,13 +69,31 @@
6869
$kbe_term_id = $kbe_taxonomy->term_id;
6970
$kbe_term_slug = $kbe_taxonomy->slug;
7071
$kbe_term_name = $kbe_taxonomy->name;
72+
73+
$kbe_taxonomy_parent_count = $kbe_taxonomy->count;
74+
75+
$children = get_term_children($kbe_term_id, KBE_POST_TAXONOMY);
76+
77+
$kbe_count_sum = $wpdb->get_var("SELECT Sum(count)
78+
FROM wp_term_taxonomy
79+
WHERE taxonomy = '".KBE_POST_TAXONOMY."'
80+
And parent = $kbe_term_id"
81+
);
82+
83+
$kbe_count_sum_parent = '';
84+
85+
if($children) {
86+
$kbe_count_sum_parent = $kbe_count_sum + $kbe_taxonomy_parent_count;
87+
} else {
88+
$kbe_count_sum_parent = $kbe_taxonomy_parent_count;
89+
}
7190
?>
7291
<div class="kbe_category">
7392
<h2>
7493
<span class="kbe_count">
7594
<?php
76-
echo $kbe_taxonomy->count;
77-
if ($kbe_taxonomy->count == 1) {
95+
echo $kbe_count_sum_parent;
96+
if ($kbe_count_sum_parent == 1) {
7897
_e(' Article','kbe');
7998
} else {
8099
_e(' Articles','kbe');

template/kbe_knowledgebase.php

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
if( KBE_SEARCH_SETTING == 1 ){
1010
wp_enqueue_script( 'kbe_live_search' );
1111
}
12-
12+
1313
// Classes For main content div
1414
if(KBE_SIDEBAR_HOME == 0) {
1515
$kbe_content_class = 'class="kbe_content_full"';
@@ -70,13 +70,31 @@
7070
$kbe_term_id = $kbe_taxonomy->term_id;
7171
$kbe_term_slug = $kbe_taxonomy->slug;
7272
$kbe_term_name = $kbe_taxonomy->name;
73+
74+
$kbe_taxonomy_parent_count = $kbe_taxonomy->count;
75+
76+
$children = get_term_children($kbe_term_id, KBE_POST_TAXONOMY);
77+
78+
$kbe_count_sum = $wpdb->get_var("SELECT Sum(count)
79+
FROM wp_term_taxonomy
80+
WHERE taxonomy = '".KBE_POST_TAXONOMY."'
81+
And parent = $kbe_term_id"
82+
);
83+
84+
$kbe_count_sum_parent = '';
85+
86+
if($children) {
87+
$kbe_count_sum_parent = $kbe_count_sum + $kbe_taxonomy_parent_count;
88+
} else {
89+
$kbe_count_sum_parent = $kbe_taxonomy_parent_count;
90+
}
7391
?>
7492
<div class="kbe_category">
7593
<h2>
7694
<span class="kbe_count">
7795
<?php
78-
echo $kbe_taxonomy->count;
79-
if ($kbe_taxonomy->count == 1) {
96+
echo $kbe_count_sum_parent;
97+
if ($kbe_count_sum_parent == 1) {
8098
_e(' Article','kbe');
8199
} else {
82100
_e(' Articles','kbe');
@@ -169,6 +187,7 @@
169187
'posts_per_page' => KBE_ARTICLE_QTY,
170188
'orderby' => 'menu_order',
171189
'order' => 'ASC',
190+
'post_parent' => 0,
172191
'tax_query' => array(
173192
array(
174193
'taxonomy' => KBE_POST_TAXONOMY,

template/kbe_style.css

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@
634634
}
635635

636636
/*======> responsive layout <======*/
637-
@media screen and (min-width: 769px) and (max-width: 1024px) {
637+
@media screen and (min-width: 768px) and (max-width: 1024px) {
638638
#kbe_content .kbe_leftcol {
639639
width: 65%;
640640
}
@@ -649,6 +649,9 @@
649649
float: left;
650650
width: 222px;
651651
}
652+
.kbe_content_full {
653+
width: 100% !important;
654+
}
652655
.kbe_content_full .kbe_leftcol {
653656
width: 100% !important;
654657
}
@@ -673,14 +676,15 @@
673676
}
674677
.kbe_content_left {
675678
float: left;
676-
width: 75% !important;
679+
width: 64% !important;
677680
margin-bottom: 30px;
678681
}
679682

680683
.kbe_content_right {
681684
float: left;
682-
width: 75% !important;
685+
width: 64% !important;
683686
margin-bottom: 30px;
687+
margin-right: 36px;
684688
}
685689
.kbe_reply {
686690
width: 80%;
@@ -695,7 +699,7 @@
695699
font-size: 20px;
696700
}
697701
}
698-
@media screen and (min-width: 641px) and (max-width: 768px) {
702+
@media screen and (min-width: 641px) and (max-width: 767px) {
699703
#kbe_content .kbe_leftcol {
700704
width: 65%;
701705
}

template/single-kbe_knowledgebase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
if( KBE_SEARCH_SETTING == 1 ){
77
wp_enqueue_script( 'kbe_live_search' );
88
}
9-
9+
1010
// Classes For main content div
1111
if(KBE_SIDEBAR_INNER == 0) {
1212
$kbe_content_class = 'class="kbe_content_full"';

template/taxonomy-kbe_tags.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
if( KBE_SEARCH_SETTING == 1 ){
77
wp_enqueue_script( 'kbe_live_search' );
88
}
9-
9+
1010
// Classes For main content div
1111
if(KBE_SIDEBAR_INNER == 0) {
1212
$kbe_content_class = 'class="kbe_content_full"';

template/taxonomy-kbe_taxonomy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
if( KBE_SEARCH_SETTING == 1 ){
77
wp_enqueue_script( 'kbe_live_search' );
88
}
9-
9+
1010
// Classes For main content div
1111
if(KBE_SIDEBAR_INNER == 0) {
1212
$kbe_content_class = 'class="kbe_content_full"';

wp-knowledgebase.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
Plugin URI: http://wordpress.org/plugins/wp-knowledgebase
55
Description: Simple and flexible knowledgebase plugin for WordPress
66
Author: Enigma Plugins
7-
Version: 1.1.1
7+
Version: 1.1.2
88
Author URI: http://enigmaplugins.com
99
Requires at least: 2.7
1010
*/
1111

12-
define( 'KBE_PLUGIN_VERSION', '1.1' );
12+
define( 'KBE_PLUGIN_VERSION', '1.1.2' );
1313

1414
//=========> Create language folder
1515
add_action( 'init', 'kbe_plugin_load_textdomain' );
@@ -316,7 +316,8 @@ function update_asset_enqueueing_notice() {
316316

317317
// check for existence of customized files
318318
$base = get_stylesheet_directory() . '/wp_knowledgebase/';
319-
if ( empty( get_option( 'kbe_asset_enqueueing_notice_dismissed' ) ) && ( file_exists( $base . 'archive-kbe_knowledgebase.php' ) || file_exists( $base . 'kbe_knowledgebase.php' ) || file_exists( $base . 'kbe_search.php' ) || file_exists( $base . 'single-kbe_knowledgebase.php' ) || file_exists( $base . 'taxonomy-kbe_tags.php' ) || file_exists( $base . 'taxonomy-kbe_taxonomy.php' ) ) ) {
319+
$notice_dismissed = get_option( 'kbe_asset_enqueueing_notice_dismissed' );
320+
if ( ( ! isset( $notice_dismissed ) || '0' === $notice_dismissed ) && ( file_exists( $base . 'archive-kbe_knowledgebase.php' ) || file_exists( $base . 'kbe_knowledgebase.php' ) || file_exists( $base . 'kbe_search.php' ) || file_exists( $base . 'single-kbe_knowledgebase.php' ) || file_exists( $base . 'taxonomy-kbe_tags.php' ) || file_exists( $base . 'taxonomy-kbe_taxonomy.php' ) ) ) {
320321
printf( '<div class="%1$s"><h2>%2$s</h2><p>%3$s</p><pre><code>%4$s</code></pre></div>', $class, $title, $message, $code );
321322
}
322323
}
@@ -506,7 +507,7 @@ function kbe_breadcrumbs(){
506507

507508
$kbe_slug_case = ucwords(strtolower(KBE_PLUGIN_SLUG));
508509

509-
$url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
510+
$url = $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
510511

511512
if(strpos($url, 'knowledgebase_category') || strpos($url, 'kbe_taxonomy')){
512513
$kbe_bc_name = get_queried_object()->name;

0 commit comments

Comments
 (0)