Go Back    Forum > Digital Publishing / Web Sites > Website and Server Troubleshooting

Reply
 
LinkBack Thread Tools
  #1  
09-27-2012, 02:53 AM
kpmedia's Avatar
kpmedia kpmedia is offline
Site Staff | Web Hosting, Photo
 
Join Date: Feb 2004
Posts: 4,311
Thanked 374 Times in 341 Posts
Category Posts Widget Update:

A lot of popular WordPress plugins have not been properly updated for several years now, and contain deprecated code. While the plugin may seem "fine" when its activated in wp-admin, deprecated code often means that it's not functioning properly. This tends to only be noticed when you enable debug mode in the wp-config.php file.

Category Posts Widget gives the following errors when activated:
Code:
Notice: Undefined index: sort_by in X:\...\wp-content\plugins\category-posts\cat-posts.php on line 46
Notice: Undefined index: title_link in X:\...\wp-content\plugins\category-posts\cat-posts.php on line 72
Notice: Undefined index: date in X:\...\wp-content\plugins\category-posts\cat-posts.php on line 101    
Notice: Undefined index: excerpt in X:\...\wp-content\plugins\category-posts\cat-posts.php on line 105
Notice: Undefined index: comment_num in X:\...\wp-content\plugins\category-posts\cat-posts.php on line 109
Note that this is seen on the site itself, on pages and posts, not as an error message in the admin area.

Where to Download ?

You can either download our ready-to-use files...

How / Where to Download the Files?
You'll find the attached file downloads at the bottom of this top post. Files are provided for the convenience of our members. To get download access, simply join the forum as either a Free Member or Premium Member. We don't send spam or sell your email addresses. If you're not sure what to do with .zip or .rar files, see this help post.


What Was Changed ?

... or you can make the edits yourself.

Line 46 of cat-posts.php contains incomplete code:
Code:
if ( in_array($instance['sort_by'], $valid_sort_orders) ) {
And needs to be changed to:
Code:
//  if ( in_array($instance['sort_by'], $valid_sort_orders) ) {
    if ( in_array( ( isset($instance['sort_by'] ) && $instance['sort_by'] ), $valid_sort_orders) ) {
At line 72:
Code:
if( $instance["title_link"] )
Change to:
Code:
//  if( $instance["title_link"] )
    if( ( isset($instance["title_link"] ) && $instance["title_link"] ) )
At line 101:
Code:
<?php if ( $instance['date'] ) : ?>
Change to:
Code:
<?php if (isset($instance['date']) && $instance['date']) : ?>
At line 105:
Code:
<?php if ( $instance['excerpt'] ) : ?>
Change to:
Code:
<?php if (isset($instance['excerpt']) && $instance['excerpt']) : ?>
At line 109:
Code:
<?php if ( $instance['comment_num'] ) : ?>
Change to:
Code:
<?php if (isset($instance['comment_num']) && $instance['comment_num']) : ?>
And that's it.

________


Need a good web host? — Read our 2018 Review of the Best Web Hosts
Quite often, problems with web sites are caused by having a rotten web host. Worse yet, many hosts try to blame you (the customer) for the problems! So dump that lousy company. Say goodbye to slow sites, unresponsive support techs, and downtime. Find yourself a new host today. Whether you need shared, reseller, VPS, semi-dedicated, cloud, or dedicated hosting, something on our list should be a good upgrade for you.



Attached Files
File Type: rar category-posts.rar (45.4 KB, 7 downloads)

- Did my advice help you? Then become a Premium Member and support this site.
- Please Like Us on Facebook | Follow Us on Twitter

- Need a good web host? Ask me for help! Get the shared, VPS, semi-dedicated, cloud, or reseller you need.
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Light SEO plugin updated for WordPress 3.4.2+ [DOWNLOAD] kpmedia Website and Server Troubleshooting 0 09-27-2012 01:32 AM
www-Redirect plugin updated for WordPress 3.4.2+ [DOWNLOAD] kpmedia Website and Server Troubleshooting 0 09-27-2012 01:23 AM
Before/After Pictures plugin updated for WordPress 3.4.2+ [DOWNLOAD] kpmedia Website and Server Troubleshooting 0 09-26-2012 10:31 PM
Secure WordPress plugin updated for WordPress 3.4.2+ [DOWNLOAD] kpmedia Website and Server Troubleshooting 0 09-26-2012 06:50 PM
Configurable Tag Cloud plugin updated for WordPress 3.4.2+ [DOWNLOAD] kpmedia Website and Server Troubleshooting 0 09-26-2012 03:25 AM

Thread Tools



 
All times are GMT -5. The time now is 08:31 AM