Tackle Plugin Compatibility Issues While Using Popular Libraries

Posted by admin in Wordpress Tips, ... | 08.28.2008 - 4:20 am

I recently got a email from a plugin developer, with regards to him having compatibility issues with one of the plugins I had developed. It turned out that both our plugins used a popular library called PCLZip for adding archiving features. Due to the compatibility issue, accessing his plugin would cause a fatal PHP error saying that the PCLZip class cannot be re-declared, when both our plugins were activated.
The compatibility issue arose because of two things;

A mistake on his part while checking for existence of class objects in the code.
A mistake on my part of using custom libraries, instead of using those provided by WordPress core.

Here is a code snippet used to check for class existence.
if(! function_exists(’class_name’)) {    require_once(’myclass.php’); } $object = new class_name();

The above code is wrong, since:

Class names […]

Original post by Keith Dsouza

    Technorati Tags:

    Related Posts:
  1. Best Of WLTC Part 2
  2. ...
  3. WordPress 3.3 Plugin Compatibility Updates
  4. ...
  5. Core Update Compatibility
  6. ...
  7. WordPress Plugin Compatibility Checker
  8. ...
  9. WordPress Plugin Releases for 5/31
  10. ...
  11. Akismet Updated, Connectivity Issues Solved
  12. ...
  13. WordPress 3.1.1 Released
  14. ...
  15. Akismet Updated, Connectivity Reporting Issues Solved
  16. ...
  17. WordPress Version 2.8.3 Security Release
  18. ...
  19. WordPress Plugin Releases for 11/27
  20. ...
  21. Plugin Developers: What Is Your Wishlist?
  22. ...
  23. WordPress 3.1 Beta 2 Released
  24. ...
  25. Plugin Deactivation Issues Solved With Actions and Filters
  26. ...
  27. BuddyPress 1.2.6 Released
  28. ...
  29. Five WordPress Plugins Already Updated for Version 2.8
  30. ...

  31. No Comments on "Tackle Plugin Compatibility Issues While Using Popular Libraries" »

    No comments yet.

    Leave a comment