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

LinkBack Thread Tools
09-26-2012, 01:06 AM
kpmedia's Avatar
kpmedia kpmedia is offline
Site Staff | Web Hosting, Photo
Join Date: Feb 2004
Posts: 4,315
Thanked 372 Times in 341 Posts
A lot of WordPress plugins have not been updated for several years now, and contain deprecated code from the WordPress 2.x era.

The reasons for this vary:
- Many plugin authors have disappeared. Quite often the developer's site no longer exists.
- Some plugins were replaced by better alternatives.
- Some plugins were poorly coded, and deserve to be forgotten with time.

However, there are some unique plugins out there worthy of repair/updates!

While many plugins will obviously fail -- either in the front-end (the public site) or the back-end (wp-admin) -- many more WP2.x-era plugins seem "fine" when its activated on a WP3.x-era site. However, the deprecated code often means that it's not functioning properly, whether you notice or not. The easiest way to detect WP2.x vs WP3.x compliance issues is by enabling debug mode in the wp-config.php file.

And that's where The Digital FAQ comes to the rescue!

WordPress Plugins Downloads:

We've updated the following plugins, and made them available for download on our forum:
WordPress Plugin Code Changes:

In addition to providing convenient downloads of the updates, we've also provided detailed code fixes for other developers or DIY-minded site owners -- which includes those tinfoil hat wearers suspicious of anything that doesn't explicitly come from the WordPress.org site. The code changelog can be found on each plugin's download page.

To support what we try and do for the web hosting and web development communities, consider upgrading to Premium Member status.

Best wishes developing your WordPress sites.


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.

- 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
09-26-2012, 02:10 AM
admin's Avatar
admin admin is offline
Site Staff | Web Development
Join Date: Jul 2003
Posts: 4,330
Thanked 650 Times in 455 Posts
The most common deprecated code issue is with roles and capabilities. Roles (user levels 1-10) were the permissions method used during the WordPress 1.x generation, and was deprecated way back with WordPress 2.0. For whatever reason, people continued to define admin as "8" instead of with a capability like "activate_plugins". There was probably some outdated "master guru" guide out there, written by some self-proclaimed "expert" (a hack, at best), which everybody then followed; it's a common problem with WordPress developers (and wanna-be developers).

Roles vs Capabilities WordPress Error:

In the WordPress debugging mode, the error shows up as:
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

Find Deprecated Code on Linux Server or OS X:

The quickest way to find these outdated lines of code is by running a grep on your server. If you're a Linux admin familiar with SSH usage, you probably already know how to use grep commands. If you're on a Mac, realize that OS X is essentially the same as using Linux (as OS X is based on Unix Darwin). Open the Terminal, and search the folder the same as you would do in SSH on Linux server.
grep -HnR "add_[a-zA-Z].*_page.*, [0-9]*," /folder/where/files/are/

Find Deprecated Code on Windows Server or local desktop:

If you're not an experienced Linux admin, or do not have shell access to your Linux server (a common issue on shared hosting), then you can FTP and download a local desktop copy of your website code. Edit it, then re-upload the fixed code.

On a Windows desktop (or Windows Server), you can use the freeware grepWin utility.
Once grepWin is installed -- note that Windows reboot may be required -- right-click on the plugin's folder, and search for:
add_[a-zA-Z].*_page.*, [0-9]*,
Example of searching with grepWin:

Closings Thought / Notes

This is much easier than manually scanning thousands of lines of code. grep/grepWin is useful for locating pretty much any piece of code anywhere in the file system. And it's a tool that is available on Windows, Mac, or Linux -- both desktops and servers. Use it.

Slightly off-topic side note: the Role Scoper plugin can help with defining additional capabilities, or changing existing ones.


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.

Attached Files
File Type: rar grepWin 32-bit v1.5.9.rar (373.8 KB, 0 downloads)
File Type: rar grepWin 64-bit v1.5.9.rar (429.1 KB, 0 downloads)

- Did this site help you? Then upgrade to Premium Member and show your support!
- Also: Like Us on Facebook for special DVD/Blu-ray news and deals!
Reply With Quote

Similar Threads
Thread Thread Starter Forum Replies Last Post
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
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
WordPress plugins for better admin and SEO admin Website and Server Troubleshooting 0 04-29-2010 04:58 AM

Thread Tools

All times are GMT -5. The time now is 10:46 AM