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

Reply
 
LinkBack Thread Tools
  #1  
09-26-2012, 03:25 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
Configurable Tag Cloud 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.

Configurable Tag Cloud gives the following error when activated:
Code:
Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in X:\...\wp-includes\functions.php on line 2722
Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in X:\...\wp-includes\functions.php on line 2722
These refers to permissions based on user levels (old, wrong) vs permissions based on capabilities (new, correct).

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.

Between lines 59 and 94 of admin_page.php are 8 lines of code that begin with "input style" and contain deprecated code wp_specialchars()

Code:
                    <td><input style="text-align:right" type="text" id="ctc-number" name="ctc-number" value="<?php echo wp_specialchars($options['number'], true); ?>" /></td>
                    <td><input style="text-align:right" type="text" id="ctc-minnum" name="ctc-minnum" value="<?php echo wp_specialchars($options['minnum'], true); ?>" /></td>
                    <td><input style="text-align:right" type="text" id="ctc-maxnum" name="ctc-maxnum" value="<?php echo wp_specialchars($options['maxnum'], true); ?>" /></td>
                    <td><input style="text-align:right" type="text" id="ctc-smallest" name="ctc-smallest" value="<?php echo wp_specialchars($options['smallest'], true); ?>" /></td>
                    <td><input style="text-align:right" type="text" id="ctc-largest" name="ctc-largest" value="<?php echo wp_specialchars($options['largest'], true); ?>" /></td>
                    <td><input style="text-align:right" type="text" id="ctc-mincolor" name="ctc-mincolor" value="<?php echo wp_specialchars($options['mincolor'], true); ?>" /></td>
                    <td><input style="text-align:right" type="text" id="ctc-maxcolor" name="ctc-maxcolor" value="<?php echo wp_specialchars($options['maxcolor'], true); ?>" /></td>
These need to be changed to esc_html() instead:
Code:
                    <td><input style="text-align:right"  type="text" id="ctc-number" name="ctc-number" value="<?php echo  esc_html($options['number'], true); ?>" /></td>
                    <td><input style="text-align:right"  type="text" id="ctc-minnum" name="ctc-minnum" value="<?php echo  esc_html($options['minnum'], true); ?>" /></td>
                    <td><input style="text-align:right"  type="text" id="ctc-maxnum" name="ctc-maxnum" value="<?php echo  esc_html($options['maxnum'], true); ?>" /></td>
                    <td><input style="text-align:right"  type="text" id="ctc-smallest" name="ctc-smallest" value="<?php echo  esc_html($options['smallest'], true); ?>" /></td>
                    <td><input style="text-align:right"  type="text" id="ctc-largest" name="ctc-largest" value="<?php echo  esc_html($options['largest'], true); ?>" /></td>
                    <td><input style="text-align:right"  type="text" id="ctc-mincolor" name="ctc-mincolor" value="<?php echo  esc_html($options['mincolor'], true); ?>" /></td>
                    <td><input style="text-align:right"  type="text" id="ctc-maxcolor" name="ctc-maxcolor" value="<?php echo  esc_html($options['maxcolor'], true); ?>" /></td>
Also in admin_page.php at line 151 is a deprecated reference to user level 8:
Code:
    add_options_page('CTC', 'CTC', 8, 'ctcoptions', 'ctc_options_page');
Change to activate_plugins():
Code:
    add_options_page('CTC', 'CTC', 'activate_plugins', 'ctcoptions', 'ctc_options_page');
Between line 272 and 281 of base.php are 4 lines of deprecated code attribute_escape(), wp_specialchars() and clean_url()
Code:
        $tag_link = clean_url($tag_links[$tag]);
        $tag = wp_specialchars($tag);
            $a[] = "<li class=\"ctc-tag-li\"><a href=\"$tag_link\" class=\"ctc-tag tag-link-$tag_id\" title=\"".attribute_escape(sprintf(__('%d topics'), $count))."\"$rel style=\"font-size: ".$tag_weight
            $a[] = "<a href=\"$tag_link\" class=\"ctc-tag tag-link-$tag_id\" title=\"".attribute_escape(sprintf(__('%d topics'), $count))."\"$rel style=\"font-size: ".$tag_weight
These need to be replaced with esc_attr(), esc_html, and esc_url (respectively):
Code:
        $tag_link = esc_url($tag_links[$tag]);
        $tag = esc_html($tag);
            $a[] = "<li class=\"ctc-tag-li\"><a href=\"$tag_link\" class=\"ctc-tag tag-link-$tag_id\" title=\"".esc_attr(sprintf(__('%d topics'), $count))."\"$rel style=\"font-size: ".$tag_weight
            $a[] = "<a href=\"$tag_link\" class=\"ctc-tag tag-link-$tag_id\" title=\"".esc_attr(sprintf(__('%d topics'), $count))."\"$rel style=\"font-size: ".$tag_weight
Between lines 61 and 100 of widget.php are 8 lines of code with deprecated code wp_specialchars()
Code:
                <td><input style="text-align:right" type="text" id="title" name="title" value="<?php echo wp_specialchars($options['title'], true); ?>" /></td>
                <td><input style="text-align:right" type="text" id="number" name="number" value="<?php echo wp_specialchars($options['number'], true); ?>" /></td>
                <td><input style="text-align:right" type="text" id="minnum" name="minnum" value="<?php echo wp_specialchars($options['minnum'], true); ?>" /></td>
                <td><input style="text-align:right" type="text" id="maxnum" name="maxnum" value="<?php echo wp_specialchars($options['maxnum'], true); ?>" /></td>
                <td><input style="text-align:right" type="text" id="smallest" name="smallest" value="<?php echo wp_specialchars($options['smallest'], true); ?>" /></td>
                <td><input style="text-align:right" type="text" id="largest" name="largest" value="<?php echo wp_specialchars($options['largest'], true); ?>" /></td>
                <td><input style="text-align:right" type="text" id="mincolor" name="mincolor" value="<?php echo wp_specialchars($options['mincolor'], true); ?>" /></td>
                <td><input style="text-align:right" type="text" id="maxcolor" name="maxcolor" value="<?php echo wp_specialchars($options['maxcolor'], true); ?>" /></td>
These need to be changed to esc_html() instead:
Code:
                <td><input style="text-align:right" type="text" id="title" name="title" value="<?php echo esc_html($options['title'], true); ?>" /></td>
                <td><input style="text-align:right" type="text" id="number" name="number" value="<?php echo esc_html($options['number'], true); ?>" /></td>
                <td><input style="text-align:right" type="text" id="minnum" name="minnum" value="<?php echo esc_html($options['minnum'], true); ?>" /></td>
                <td><input style="text-align:right" type="text" id="maxnum" name="maxnum" value="<?php echo esc_html($options['maxnum'], true); ?>" /></td>
                <td><input style="text-align:right" type="text" id="smallest" name="smallest" value="<?php echo esc_html($options['smallest'], true); ?>" /></td>
                <td><input style="text-align:right" type="text" id="largest" name="largest" value="<?php echo esc_html($options['largest'], true); ?>" /></td>
                <td><input style="text-align:right" type="text" id="mincolor" name="mincolor" value="<?php echo esc_html($options['mincolor'], true); ?>" /></td>
                <td><input style="text-align:right" type="text" id="maxcolor" name="maxcolor" value="<?php echo esc_html($options['maxcolor'], true); ?>" /></td>
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 configurable-tag-cloud-widget.rar (191.8 KB, 1 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
List of WordPress plugins updated for WP 3.4.2+ [DOWNLOADS] kpmedia Website and Server Troubleshooting 1 09-26-2012 02:10 AM
Advertising Manager plugin updated for WordPress 3.4.2+ [DOWNLOAD] kpmedia Website and Server Troubleshooting 0 09-26-2012 12:42 AM
Admin Favicon plugin updated for WordPress 3.4.2+ [DOWNLOAD] kpmedia Website and Server Troubleshooting 0 09-25-2012 04:08 AM
GetResponse code in WordPress? plugin? admin Website and Server Troubleshooting 0 04-07-2010 10:05 PM
Looking for WordPress music sidebar plugin for band site admin Website and Server Troubleshooting 0 10-07-2009 08:14 AM

Thread Tools



 
All times are GMT -5. The time now is 07:34 AM