Title: PHP Errors
Last modified: August 22, 2016

---

# PHP Errors

 *  Resolved [Wil](https://wordpress.org/support/users/limecanvas/)
 * (@limecanvas)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/php-errors-37/)
 * Hey Dion
 * The plugin is generating the following PHP error
    Error: Non-static method Plugin_Revision_Control_Compat::
   options() should not be called statically, assuming $this from incompatible context
 * Stack trace
    /plugins/revision-control/revision-control.php (252) /plugins/revision-
   control/revision-control.php (25) /plugins/revision-control/revision-control.
   php (10)
 * Cheerz,
    Wil.
 * [https://wordpress.org/plugins/revision-control/](https://wordpress.org/plugins/revision-control/)

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

 *  [renoirb](https://wordpress.org/support/users/renoirb/)
 * (@renoirb)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/php-errors-37/#post-5500240)
 * The fix is easy, classes are called statically and the function definition is
   using old conventions when static methods didn’t exist (before PHP 5.2). In other
   words procedural functions inside a class but its an easy fix.
 * Look at this diff and do the same. I might push upstream the fix someday.
 *     ```
       diff --git i/revision-control.php w/revision-control.php
       index d0d3958..ade99f9 100644
       --- i/revision-control.php
       +++ w/revision-control.php
       @@ -299,7 +299,7 @@ class Plugin_Revision_Control {
        }
   
        class Plugin_Revision_Control_Compat {
       - function postmeta($meta, $post) {
       + public static function postmeta($meta, $post) {
           if ( is_array($meta) )
             return $meta;
   
       @@ -318,7 +318,7 @@ class Plugin_Revision_Control_Compat {
           return $_meta;
         }
   
       - function options($options) {
       + public static function options($options) {
           $_options = $options;
           if ( ! is_array($options) ) { // Upgrade from 1.0 to 1.1
             $options = array( 'post' => $options, 'page' => $options );
       ```
   
 *  [Tom](https://wordpress.org/support/users/atomiktd/)
 * (@atomiktd)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/php-errors-37/#post-5500245)
 * [@renoirb](https://wordpress.org/support/users/renoirb/)
    yeah… I’m sure it is
   easy for you but I am not so familiar with diff so your display says nothing 
   to me 🙁
 * Would you please just put it simple like showing what should I replace with what?
 * Thank you in advance.
 *  [renoirb](https://wordpress.org/support/users/renoirb/)
 * (@renoirb)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/php-errors-37/#post-5500247)
 * Hey Tom,
 * Here’s a TL;DR version of how diff works.
 * Lines starting by +++ and — are saying which files are involved and what symbol(
   add ‘+’, remove ‘-‘) each file has different from the other. In this case its
   a diff between two versions of the same file.
 * Lines with @@ is to describe where in terms of line number, column. Gives hint
   which line to get to.
 * Now the fix is to add ‘public static’. In front of the word ‘function’ for the
   two methods of that class.
 * There are two ways to use classes. As a container of functions which we refer
   as calling “statically” which is the case here.
 * Quixk way to assess? When its called Foo::postmeta(…) compared to
 * $foo = new FooClass();
    echo $foo->bar(‘bazz’);
 *  [Tom](https://wordpress.org/support/users/atomiktd/)
 * (@atomiktd)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/php-errors-37/#post-5500249)
 * [@renoirb](https://wordpress.org/support/users/renoirb/)
    Thank you for short
   tutorial 🙂 I think I was able to identify all 2 places where I had to add “public
   static” in front of proper functions. Lines were different but it helped globally.
   I do not have errors appearing on frontend and there is still one place failing.
   When I go to Settings -> Revision Control I get:
 * `Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback,
   non-static method Plugin_Revision_Control_UI::admin_page() should not be called
   statically in /home/.../public_html/wp-includes/plugin.php on line 496`
 * Maybe it is negligible but I ask just in case.
 *  Plugin Author [Dion Hulse](https://wordpress.org/support/users/dd32/)
 * (@dd32)
 * Meta Developer
 * [11 years, 5 months ago](https://wordpress.org/support/topic/php-errors-37/#post-5500250)
 * This was fixed in the development version that was eventually abandoned.
 * I’ve just released 2.3.1 which includes a fix for the PHP Warnings and also fixes
   a nonce change in WordPress.
 *  [Tom](https://wordpress.org/support/users/atomiktd/)
 * (@atomiktd)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/php-errors-37/#post-5500251)
 * Thanks Dion,
    No errors. No warnings. It looks like it is working now!
 *  Thread Starter [Wil](https://wordpress.org/support/users/limecanvas/)
 * (@limecanvas)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/php-errors-37/#post-5500252)
 * Yup confirm – no errors. Thanks Dion & Happy 2015!

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

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

 * ![](https://s.w.org/plugins/geopattern-icon/revision-control.svg)
 * [Revision Control](https://wordpress.org/plugins/revision-control/)
 * [Support Threads](https://wordpress.org/support/plugin/revision-control/)
 * [Active Topics](https://wordpress.org/support/plugin/revision-control/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/revision-control/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/revision-control/reviews/)

 * 7 replies
 * 4 participants
 * Last reply from: [Wil](https://wordpress.org/support/users/limecanvas/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/php-errors-37/#post-5500252)
 * Status: resolved