• Resolved spikespiegel

    (@spikespiegel)


    Whenever I enable wordpress debug and wp job manager, I get an error from WordPress Business Directory plugin at the file debugger.php from the same plugin, but if I turn off wordpress debug, I get a blank page, so I have to manually rename wp job manager folder to anything else, if I want to get my site working again.

    Any clue on what’s happening?

    https://www.ads-software.com/plugins/wp-job-manager/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    What is the error? Maybe “Business Directory” uses the same post types and/or function names? I’m not familiar with it so cannot say for certain.

    Thread Starter spikespiegel

    (@spikespiegel)

    I’ll need some time to test now, cause I disabled business directory, it was also conflicting with other plugins.
    It comes all of a sudden, just says there is an error on debugging.php, on line 69. when I go check it out, I can’t understand a thing.

    Here is what’s from line 39 to 172:

    public static function _php_error_handler($errno, $errstr, $file, $line, $context) {
    		static $errno_to_string = array(
    			E_ERROR => 'error',
    			E_WARNING => 'warning',
    			E_NOTICE => 'notice',
    			E_USER_ERROR => 'user-error',
    			E_USER_WARNING => 'user-warning',
    			E_USER_NOTICE => 'user-notice',
    			E_DEPRECATED => 'deprecated'
    		);
    
    self::add_debug_msg( $errstr,
    							 isset( $errno_to_string[ $errno ] ) ? 'php-' . $errno_to_string[ $errno ] : 'php',
    							 array( 'file' => $file,
    							 		'line' => $line) );
    	}
    
    	public static function debug_off() {
    		self::$debug = false;
    
    		remove_action('admin_footer', array('WPBDP_Debugging', '_debug_bar_footer'), 99999);
    		remove_action('wp_footer', array('WPBDP_Debugging', '_debug_bar_footer'), 99999);
    	}
    
    	public static function _debug_bar_footer() {
    		if (!self::$debug)
    			return;
    
    		global $wpdb;
    		$queries = $wpdb->queries;
    
    		if (!self::$messages && !$queries)
    			return;
    
    		echo '<div id="wpbdp-debugging">';
    		echo '<ul class="tab-selector">';
    		echo '<li class="active"><a href="#logging">Logging</a></li>';
    		echo '<li><a href="#wpdbqueries">$wpdb queries</a></li>';
    		echo '</ul>';
    		echo '<div class="tab" id="wpbdp-debugging-tab-logging">';
    		echo '<table>';
    
    		foreach (self::$messages as $item) {
    			$time = explode( ' ', $item['timestamp'] );
    
    			echo '<tr class="' . $item['type'] . '">';
    			echo '<td class="handle">?</td>';
    			echo '<td class="timestamp">' . date('H:i:s', $time[1]) . '</td>';
    
    			echo '<td class="type">' . $item['type'] . '</td>';
    			echo '<td class="message">' . $item['message'] . '</td>';
    
    			if ($item['context']) {
    				echo '<td class="context">' . $item['context']['function'] . '</td>';
    				echo '<td class="file">' . basename($item['context']['file']) . ':' . $item['context']['line'] . '</td>';
    			} else {
    				echo '<td class="context"></td><td class="file"></td>';
    			}
    			echo '</tr>';
    		}
    
    		echo '</table>';
    		echo '</div>';
    
    		echo '<div class="tab" id="wpbdp-debugging-tab-wpdbqueries">';
    		if ( !$queries ) {
    			echo 'No SQL queries were logged.';
    		} else {
    			echo '<table>';
    
    			foreach ( $queries as $q ) {
    				echo '<tr class="wpdbquery">';
    				echo '<td class="handle">?</td>';
    				echo '<td class="query">';
    				echo $q[0];
    				echo '<div class="extradata">';
    				echo '<dl>';
    				echo '<dt>Time Spent:</dt><dd>' . $q[1] . '</dd>';
    				echo '<dt>Backtrace:</dt><dd>' . $q[2] . '</dd>';
    				echo '</dl>';
    				echo '</div>';
    				echo '</td>';
    				echo '</tr>';
    			}
    
    			echo '</table>';
    		}
    		echo '</div>';
    		echo '</div>';
    	}
    
    	private static function _extract_context($stack) {
    		if ( !is_array( $stack ) || empty( $stack ) )
    			return array();
    
    		$context = array( 'class' => '', 'file' => '', 'function' => '', 'line' => '' );
    
    		foreach ( $stack as $i => &$item ) {
    			if ( ( isset( $item['class'] ) && $item['class'] == 'WPBDP_Debugging' ) || ( isset( $item['file'] ) && $item['file'] == __FILE__ ) )
    				continue;
    
    			if ( isset( $item['function'] ) && in_array( $item['function'], array( 'wpbdp_log', 'wpbdp_debug', 'wpbdp_log_deprecated' ) ) ) {
    				$context['file'] = $item['file'];
    				$context['line'] = $item['line'];
    				$context['function'] = $item['function'];
    
    				$i2 = current( $stack );
    				$context['function'] = $i2['function'];
    				break;
    			} else {
    				$context['file'] = $item['file'];
    				$context['line'] = $item['line'];
    				$context['stack'] = $stack;
    			}
    		}
    
    		return $context;
    	}
    
    	private static function add_debug_msg($msg, $type='debug', $context=null) {
    		self::$messages[] = array( 'timestamp' => microtime(),
    								   'message' => $msg,
    								   'type' => $type,
    								   'context' => wpbdp_starts_with( $type, 'php', false ) ? $context : self::_extract_context($context),
    								 );
    	}
    
    	private static function _var_dump($var) {
    		if ( is_bool( $var ) || is_int( $var ) || ( is_string( $var ) && empty( $var ) ) )
    			return var_export( $var, true );
    
    		return print_r($var, true);
    	}

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been damaged by the forum’s parser.]

    Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    Don’t forget to paste the error here, and also, is there a reason you haven’t requested support from Business Directory, if its their debugger code triggering an error?

    Thread Starter spikespiegel

    (@spikespiegel)

    So far so good, using both plugins and no errors anymore.
    I believe it was a php memory problem, because the feed widget was trying to allocate memory.

    Still testing. If I have the error again, I’ll drive their attention to this post, so they can take a look.

    Hi there spikespiegel I am having the same problem with conflicts betweeen the two plugins can you let me know how you resolved it.

    Kind regards

    KatieKat

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Conflict with wordpress business directory plugin’ is closed to new replies.