dispatch = 'feedwordpress_diagnostics';
$this->filename = __FILE__;
$this->test_html = array();
add_action('feedwordpress_diagnostics_do_http_test', array($this, 'do_http_test'), 10, 1);
}
function has_link () { return false; }
function display () {
if (FeedWordPress::needs_upgrade()) :
fwp_upgrade_page();
return;
endif;
// If this is a POST, validate source and user credentials
FeedWordPressCompatibility::validate_http_request(/*action=*/ 'feedwordpress_diagnostics', /*capability=*/ 'manage_options');
if (strtoupper($_SERVER['REQUEST_METHOD'])=='POST') :
$this->accept_POST();
do_action('feedwordpress_admin_page_diagnostics_save', null, $this);
endif;
////////////////////////////////////////////////
// Prepare settings page ///////////////////////
////////////////////////////////////////////////
$this->display_update_notice_if_updated('Diagnostics');
$this->open_sheet('FeedWordPress Diagnostics');
?>
__('Diagnostic Information'),
'diagnostics_box' => __('Display Diagnostics'),
'updates_box' => __('Diagnostic Messages'),
'tests_box' => __('Diagnostic Tests'),
);
foreach ($boxes_by_methods as $method => $title) :
add_meta_box(
/*id=*/ 'feedwordpress_'.$method,
/*title=*/ $title,
/*callback=*/ array('FeedWordPressDiagnosticsPage', $method),
/*page=*/ $this->meta_box_context(),
/*context=*/ $this->meta_box_context()
);
endforeach;
do_action('feedwordpress_admin_page_diagnostics_meta_boxes', $this);
?>
meta_box_context(), $this->meta_box_context(), $this);
?>
close_sheet();
} /* FeedWordPressDiagnosticsPage::display () */
public function do_requested () {
return ( ! is_null( self::what_requested() ) );
}
public function what_requested () {
return FeedWordPress::post( 'feedwordpress_diagnostics_do' );
}
function accept_POST () {
if ( self::save_requested() || self::do_requested() ) :
update_option( 'feedwordpress_debug', FeedWordPress::post( 'feedwordpress_debug' ) );
update_option( 'feedwordpress_secret_key', FeedWordPress::post( 'feedwordpress_secret_key' ) );
update_option( 'feedwordpress_diagnostics_output', FeedWordPress::post( 'diagnostics_output' ) );
update_option( 'feedwordpress_diagnostics_show', FeedWordPress::post( 'diagnostics_show' ) );
if ( FeedWordPress::post( 'diagnostics_show' )
and in_array( 'updated_feeds:errors:persistent', FeedWordPress::post( 'diagnostics_show' ) ) ) :
update_option('feedwordpress_diagnostics_persistent_errors_hours', (int) FeedWordPress::post( 'diagnostics_persistent_error_hours' ) );
else :
delete_option( 'feedwordpress_diagnostics_persistent_errors_hours' );
endif;
if ( in_array( 'email', FeedWordPress::post( 'diagnostics_output' ) ) ) :
$ded = FeedWordPress::post('diagnostics_email_destination' );
if ( 'mailto' == $ded ) :
$ded .= ':' . FeedWordPress::post('diagnostics_email_destination_address' );
endif;
update_option( 'feedwordpress_diagnostics_email_destination', $ded );
else :
delete_option( 'feedwordpress_diagnostics_email_destination' );
endif;
if ( self::do_requested() ) :
foreach ( self::what_requested() as $do => $value) :
do_action( 'feedwordpress_diagnostics_do_'.$do );
endforeach;
endif;
$this->updated = true; // Default update message
endif;
} /* FeedWordPressDiagnosticsPage::accept_POST () */
static function info_box ($page, $box = NULL) {
global $feedwordpress;
global $wp_version;
$link_category_id = FeedWordPress::link_category_id();
?>