digitalFAQ.com Forum

digitalFAQ.com Forum (https://www.digitalfaq.com/forum/)
-   Website and Server Troubleshooting (https://www.digitalfaq.com/forum/web-tech/)
-   -   Configurable Tag Cloud plugin updated for WordPress 3.4.2+ [DOWNLOAD] (https://www.digitalfaq.com/forum/web-tech/4603-configurable-tag-cloud.html)

kpmedia 09-26-2012 03:25 AM

Configurable Tag Cloud plugin updated for WordPress 3.4.2+ [DOWNLOAD]
 
1 Attachment(s)
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. [x2x]

_______


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.



All times are GMT -5. The time now is 04:37 AM

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.