',
'notice notice-error',
__( 'To use WPScan you have to setup your WPScan API Token. Either in the ', 'wpscan' ),
admin_url( 'admin.php?page=' . $this->page ),
__( 'Settings', 'wpscan' ),
__( ' page, or, within the wp-config.php file.', 'wpscan' )
);
}
}
/**
* Add submenu
*
* @since 1.0.0
* @access public
* @return void
*/
public function menu() {
$title = __( 'Settings', 'wpscan' );
add_submenu_page(
'wpscan',
$title,
$title,
$this->parent->WPSCAN_ROLE,
$this->page,
array( $this, 'page' )
);
}
/**
* Render the page
*
* @since 1.0.0
* @access public
* @return void
*/
public function page() {
echo '
';
echo '';
echo '
' . __( 'Settings', 'wpscan' ) . '
';
echo '
' . __( 'The WPScan WordPress security plugin uses our own constantly updated vulnerability database to stay up to date with the latest WordPress core, plugin and theme vulnerabilities. For the WPScan plugin to retrieve the potential vulnerabilities that may affect your site, you first need to configure your API token, that you can get for free from our database\'s website. Alternatively you can also set your API token in the wp-config.php file using the WPSCAN_API_TOKEN constant.', 'wpscan' ) . '
';
settings_errors();
echo '';
echo '
';
}
/**
* API token field
*
* @since 1.0.0
* @access public
* @return string
*/
public function field_api_token() {
$api_token = esc_attr( get_option( $this->parent->OPT_API_TOKEN ) );
if ( defined( 'WPSCAN_API_TOKEN' ) ) {
$api_token = esc_attr( WPSCAN_API_TOKEN );
$disabled = "disabled='true'";
} else {
$disabled = null;
}
// Field.
echo "";
// Messages.
echo '
';
if ( defined( 'WPSCAN_API_TOKEN' ) ) {
_e( 'Your API Token has been set in a PHP file and been disabled here.', 'wpscan' );
echo ' ';
}
if ( ! empty( $api_token ) ) {
echo sprintf(
__( 'To regenerate your token, or upgrade your plan, %s.', 'wpscan' ),
'' . __( 'check your profile', 'wpscan' ) . ''
);
} else {
echo sprintf(
__( '%s to get your free API Token.', 'wpscan' ),
'' . __( 'Sign up', 'wpscan' ) . ''
);
}
echo '
';
if ( $this->parent->is_interval_scanning_disabled() ) {
_e( 'Automated scanning is currently disabled using the WPSCAN_DISABLE_SCANNING_INTERVAL constant.', 'wpscan' );
} else {
_e( 'This setting will change the frequency that the WPScan plugin will run an automatic scan. This is useful if you want your report, or notifications, to be updated more frequently. Please note that the more frequent scans are run, the more API requests are consumed.', 'wpscan' );
}
echo '
';
}
/**
* Scanning time field.
*
* @since 1.0.0
* @access public
* @return string
*/
public function field_scanning_time() {
$opt = $this->parent->OPT_SCANNING_TIME;
$value = esc_attr( get_option( $opt, date( 'H:i' ) ) );
$disabled = $this->parent->is_interval_scanning_disabled() ? "disabled='true'" : null;
echo " ";
if ( ! $this->parent->is_interval_scanning_disabled() ) {
echo __( 'Current server time is ', 'wpscan' ) . '' . date( 'H:i' ) . '';
}
echo '
';
if ( $this->parent->is_interval_scanning_disabled() ) {
_e( 'Automated scanning is currently disabled using the WPSCAN_DISABLE_SCANNING_INTERVAL constant.', 'wpscan' );
} else {
_e( 'This setting allows you to set the scanning hour for the Daily option. For the Twice Daily this will be the first scan and the second will be 12 hours later. For the Hourly it will affect the first scan only.', 'wpscan' );
}
echo '