• Sa?a

    (@stodorovic)


    I just saw copy/paste mistake in file inc/admin.php:

       public function dfads_enable_count() {
            $output = get_option( 'dfads-settings' );
            $output['dfads_enable_shortcodes_in_widgets'] = isset( $output['dfads_enable_shortcodes_in_widgets'] )  ? $output['dfads_enable_shortcodes_in_widgets'] : 0;
            .....
                            <input name="dfads-settings[dfads_enable_count_for_admin]" id="dfads_enable_count_for_admin"
    

    It’s copied from previous function dfads_enable_shortcode(). I think that it should be:

    $output['dfads_enable_count_for_admin'] = isset( $output['dfads_enable_count_for_admin'] ) ? $output['dfads_enable_count_for_admin'] : 0;

    debug.log:
    PHP Notice: Undefined index: dfads_enable_count_for_admin in .../wp-content/plugins/ads-by-datafeedrcom/inc/admin.php on line 18

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Sa?a

    (@stodorovic)

    Other PHP notice related to settings:

    PHP Deprecated: Non-static method DFADS::orderby_array() should not be called statically, assuming $this from in compatible context in .../plugins/ads-by-datafeedrcom/inc/generator.php on line 38

    The code:
    $orderbys = DFADS::orderby_array();

    I’d guess that should be:

    $ads = new DFADS();
    $orderbys = $ads->orderby_array();

    same as in function dfads:

    function dfads( $args='' ) {
            $ads = new DFADS();
            if ( is_array( $args ) ) {
                    $args = http_build_query( $args );
            }
            return $ads->get_ads( $args );
    }
    Plugin Author datafeedr

    (@datafeedrcom)

    We will fix the undefined notices and static method issues in a future release.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP Notice: Undefined index: dfads_enable_count_for_admin’ is closed to new replies.