Title: PHP Strict errors
Last modified: August 21, 2016

---

# PHP Strict errors

 *  [Chris Reynolds](https://wordpress.org/support/users/jazzs3quence/)
 * (@jazzs3quence)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/php-strict-errors-2/)
 * If you’re coding with PHP Strict Standards, the plugin throws errors:
 *     ```
       Strict Standards: Non-static method GFCPTAddon::get_base_path() should not be called statically in /Users/jazzsequence/Documents/work/wds/trumethods/wp-content/plugins/gravity-forms-custom-post-types/gfcptaddon.php on line 55
   
       Strict Standards: Non-static method GFCPTAddon::get_base_path() should not be called statically in /Users/jazzsequence/Documents/work/wds/trumethods/wp-content/plugins/gravity-forms-custom-post-types/gfcptaddon.php on line 58
       ```
   
 * This is because of how you’re calling your CFCPTAddon class in the init function.
   This wouldn’t be so much of a problem if it wasn’t for the fact that the errors
   break the javascript and you can’t actually build a form if they are showing.
   Here’s the fix (lines 54-59 of gfcptaddon.php):
 *     ```
       //include the base class
                   require_once((new GFCPTAddon )->get_base_path() . '/gfcptaddonbase.php');
   
                   //only supports 1.5 and over
                   require_once((new GFCPTAddon )->get_base_path() . '/gfcptaddon_1-5.php');
                   $gf_cpt_addon = new GFCPTAddon1_5();
       ```
   
 * [https://wordpress.org/plugins/gravity-forms-custom-post-types/](https://wordpress.org/plugins/gravity-forms-custom-post-types/)

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

 *  [tim.samuelsson](https://wordpress.org/support/users/timsamuelsson/)
 * (@timsamuelsson)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/php-strict-errors-2/#post-5104791)
 * I would be very happy if this could be fixed.
 *  Thread Starter [Chris Reynolds](https://wordpress.org/support/users/jazzs3quence/)
 * (@jazzs3quence)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/php-strict-errors-2/#post-5104792)
 * [@tim](https://wordpress.org/support/users/tim/).samuelsson I have a fork of 
   this plugin up on Github with my changes that I’m actively using on a couple 
   live sites until this issue is fixed in the main plugin.
    [https://github.com/jazzsequence/Strict-Gravity-Forms—Custom-Post-Types](https://github.com/jazzsequence/Strict-Gravity-Forms—Custom-Post-Types)
 *  [fradamek](https://wordpress.org/support/users/fradamek/)
 * (@fradamek)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/php-strict-errors-2/#post-5104795)
 * @wtaeke posted [this on Github](https://github.com/bradvin/gravity-forms-custom-post-types/issues/1)
   that might help get rid of the error. I dunno if thats it to fix the issue.
 * Just replace #121
 * protected function get_base_path(){
    with
 * protected static function get_base_path(){
 *  Thread Starter [Chris Reynolds](https://wordpress.org/support/users/jazzs3quence/)
 * (@jazzs3quence)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/php-strict-errors-2/#post-5104796)
 * [@fradamek](https://wordpress.org/support/users/fradamek/) Actually, I ended 
   up eliminating the need to instantiate the class at all on my fork per a suggestion,
   since all those lines are doing is including files: [https://github.com/jazzsequence/Strict-Gravity-Forms—Custom-Post-Types/blob/master/gfcptaddon.php#L54-L58](https://github.com/jazzsequence/Strict-Gravity-Forms—Custom-Post-Types/blob/master/gfcptaddon.php#L54-L58)

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

The topic ‘PHP Strict errors’ is closed to new replies.

 * ![](https://ps.w.org/gravity-forms-custom-post-types/assets/icon-256x256.png?
   rev=2542252)
 * [Gravity Forms + Custom Post Types](https://wordpress.org/plugins/gravity-forms-custom-post-types/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gravity-forms-custom-post-types/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gravity-forms-custom-post-types/)
 * [Active Topics](https://wordpress.org/support/plugin/gravity-forms-custom-post-types/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gravity-forms-custom-post-types/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gravity-forms-custom-post-types/reviews/)

## Tags

 * [php strict](https://wordpress.org/support/topic-tag/php-strict/)

 * 4 replies
 * 3 participants
 * Last reply from: [Chris Reynolds](https://wordpress.org/support/users/jazzs3quence/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/php-strict-errors-2/#post-5104796)
 * Status: not resolved