Title: PHP notices
Last modified: May 16, 2019

---

# PHP notices

 *  Resolved [Nicholas Turbanov](https://wordpress.org/support/users/ntd/)
 * (@ntd)
 * [7 years ago](https://wordpress.org/support/topic/php-notices-108/)
 * Hi there,
 * First of all, thanks for the plugin.
 * In your code, you’re calling your dynamic class methods statically. This produces
   a lot of PHP notices. I would be great if you could fix these.
 * For instance:
 * `PHP Deprecated: Non-static method LightboxPhotoSwipe::cleanupDatabase() should
   not be called statically in /data/wordpress/htdocs/wordpress/wp-includes/class-
   wp-hook.php on line 286`
 * I haven’t really gone through your code, but the fix would be to either declare
   your methods static, or, instead of using `get_class()` in your `add_action()`
   callbacks, simply use `$this`.
 * Change:
 * `add_action('lbwps_cleanup', array(get_class($this), 'cleanupDatabase'));`
 * to:
 * `add_action('lbwps_cleanup', array($this, 'cleanupDatabase'));`
 * Thanks!
    -  This topic was modified 7 years ago by [Nicholas Turbanov](https://wordpress.org/support/users/ntd/).
    -  This topic was modified 7 years ago by [Nicholas Turbanov](https://wordpress.org/support/users/ntd/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Arno Welzel](https://wordpress.org/support/users/awelzel/)
 * (@awelzel)
 * [7 years ago](https://wordpress.org/support/topic/php-notices-108/#post-11537333)
 * Thanks for your hint. I was not aware of this problem and will change this for
   the next update.
 *  Plugin Author [Arno Welzel](https://wordpress.org/support/users/awelzel/)
 * (@awelzel)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/php-notices-108/#post-11620257)
 * Version 2.0 should not cause any warnings any more.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘PHP notices’ is closed to new replies.

 * ![](https://ps.w.org/lightbox-photoswipe/assets/icon-256x256.png?rev=2906302)
 * [Lightbox with PhotoSwipe](https://wordpress.org/plugins/lightbox-photoswipe/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/lightbox-photoswipe/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/lightbox-photoswipe/)
 * [Active Topics](https://wordpress.org/support/plugin/lightbox-photoswipe/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/lightbox-photoswipe/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/lightbox-photoswipe/reviews/)

## Tags

 * [PHP Deprecated](https://wordpress.org/support/topic-tag/php-deprecated/)
 * [PHP Notice](https://wordpress.org/support/topic-tag/php-notice/)

 * 2 replies
 * 2 participants
 * Last reply from: [Arno Welzel](https://wordpress.org/support/users/awelzel/)
 * Last activity: [6 years, 11 months ago](https://wordpress.org/support/topic/php-notices-108/#post-11620257)
 * Status: resolved