August 11, 2008 – 2:44 pm
New version 0.4 of the Log Deprecated Calls plugin.
Now it has an option to toggle logging to the PHP Log, or a table in the database, or both. If logging to the database you can view the records on the admin page (under Plugins->Deprecated Calls. It also has a test function, and if you’re using WordPress 2.7 or up, it will even clean up after itself if you delete it.
Again, this is primarily of use to those who write plugins and themes.
Here’s the link.
Otto has released his Automatic Timezone Plugin as part of the current WordPress plugin competition. In addition to being a handy plugin, it comes with a significant bonus for plugin authors.
In addition to its basic function, the code is designed to serve as a tutorial of sorts, showing authors how to use some very interesting plugin techniques, such as modifying any option on the fly as it is pulled from the options table, or how to modify sections of the core admin pages.
It’s worth a look, and thanks to Otto for sharing.
New plugin for Y’all. This one is of particular interest to plugin authors and theme designers (and… nobody else).
Activate it, and any time WordPress calls a function or file that has been deprecated, a message will be sent to your PHP log file that identifies exactly where the call came from and what to replace it with. This will allow you to very easily keep your plugins and themes calling the most current functions.
(And yes, the message is more informative than the one returned by WP_DEBUG.)
Here’s the link. Go get it!
One of the most powerful features of WordPress is the huge community of developers making plugins that extend the software far beyond what the core application provides. It also allows people to add just what they want to use, rather than having a single bloated homogeneous download. There are drawbacks as well, of course.
Any time a software package opens itself up to third-party additions, there is a potential for mischief. With WordPress, different plugins can end up stumbling over each other, as each is coded for the core but doesn’t anticipate other plugins. You can also have naming conflicts — when functions or variables in different plugins are given the same name. This is often avoided by adding the plugin name to the beginning of each and every function, variable, constant, etc.
If you have multiple plugins, you probably have a good bit of code that you reuse in all of them. If you’ve been appending the plugin name all along, then any time you update those common functions, you can’t simply copy the new versions over to the other plugins — you have to go over them and update the function names and any internal calls from one function to another.
These problems and others can be avoided by using classes.
By wrapping your plugin’s functions in a PHP class, you gain a number of advantages. You can set plugin-wide variables. You can use common function names and create easily-remembered “wrapper” functions that modify the way common WP functions do things. You can create portable functions that can be copy-pasted into other plugins without any adjustment.
Ready? Let’s get started… Read More »
Mark Jaquith has put up a nice article on “How to write a solid and stable WordPress plugin“. It’s more of a rough overview than a detail piece, but he promises more details down the line in separate articles.
This is worth looking at if you write WP plugins, even if you’re pretty experienced — if for nothing more than to check that you’re not missing something….
I’ve updated the Comment Spotlight plugin for WordPress. Changes in 1.1 include:
- Fully WP 2.6 compatible
- Lots of code cleanup
- Fixed spotlight image so it’s NOT inside the first paragraph
- Spotlighted comments add “clear: both” div to end so spot images don’t extend past comment bottom
- Moved Settings screen to Settings menu (was in Comments menu)
- Added direct link to Settings from Plugins “Action” column
- Added Settings page footer
- Moved all functions into a PHP class
- Added get_options and localization functions
- Added nonces to Settings page — better security
Go get it!
Version 2.1.2 of my JavaScript Pull-Quotes plugin for WordPress is up.
The biggest change from the user end is that localizations (i.e. translations) now work. (The had worked previously, but broke somewhere along the way.) It includes French and Italian translations.
If anyone out there would like to translate the plugin for others who speak that language, see the readme in the “languages” folder, and send it along to me – I’ll include it in the next version.
Actually, the French and Italian files could probably use some updating too.
Go get it!
Full changelog (for the geeks):
* Fixed design flaw introduced in 2.1.1. Style option now stores file basename relative to styles directory -- should not store full URL if we're going to let user change the directory.
* BUGFIX: Localizations not working. (Incorrect path)
* Localizations (.mo files) will work directly from languages/ folder
* Changed init() to class constructor -- no more hooking "init" action
* Moved activation hook call to constructor
* Minor code cleanup to comply with WP Coding Standards
http://codex.wordpress.org/WordPress_Coding_Standards
A new version 2.1.1 is up. Among the changes:
- Increased efficiency of version checking
- Fixed a small bug with the admin footer
- Significant cleanup of Style selection code
- Moved Default style to resources folder so it can’t be misplaced
- Significant error checking RE missing or renamed styles
- If chosen style is missing, falls back to default rather than linking nonexistent file
Two notes if you’re upgrading from an old version:
- You may discover that the Styles dropdown in the Settings screen now has two items called “Default”. If so, go into
/jspullquotes/styles/ and delete Default.css — you don’t need it anymore.
- There has been a change to the way the Style setting is saved. It should auto-update existing settings, but if it doesn’t work you may find that your chosen style has reverted to the default. If so, simply go into settings and re-save with the style you want.
As of 2.1, JavaScript Pull-Quotes is fully compatible with WordPress 2.6.
Go get it!