Upload folder via GUI - integrations
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
if(!defined('ABSPATH')) exit;
|
||||
class WMF_Service_RecaptchaV3 extends WMF_Service {
|
||||
public $id='recaptchav3'; public $label='reCAPTCHA v3'; public $group='antispam';
|
||||
protected $credentials=array('site_key'=>'','secret_key'=>'','score'=>'0.5');
|
||||
public function is_connected(){return!empty($this->credentials['site_key'])&&!empty($this->credentials['secret_key']);}
|
||||
public function admin_widget($prev=array()){
|
||||
$c = $this->get_credentials();
|
||||
$int = wmf_get_integrations();
|
||||
$act = $int->action_update;
|
||||
$nonce= wp_create_nonce($act);
|
||||
$conn = $this->is_connected();
|
||||
echo '<div class="wmf-widget-body">';
|
||||
if($conn) echo '<div class="wmf-connected-badge">✓ Verbunden</div>';
|
||||
echo '<form class="wmf-int-form">';
|
||||
echo '<input type="hidden" name="_wpnonce" value="'.esc_attr($nonce).'">';
|
||||
echo '<input type="hidden" name="action" value="'.esc_attr($act).'">';
|
||||
echo '<input type="hidden" name="services[]" value="recaptchav3">';
|
||||
|
||||
echo '<p><label>Website-Schluessel (Site Key)</label>';
|
||||
echo '<input type="text" name="credentials[recaptchav3][site_key]" value="'.esc_attr($c['site_key']??'').'" class="widefat"></p>';
|
||||
echo '<p><label>Geheimer Schluessel (Secret Key)</label>';
|
||||
echo '<input type="text" name="credentials[recaptchav3][secret_key]" value="'.esc_attr($c['secret_key']??'').'" class="widefat"></p>';
|
||||
echo '<p><label>Mindest-Score (0.0-1.0, empfohlen: 0.5)</label>';
|
||||
echo '<input type="number" min="0" max="1" step="0.1" name="credentials[recaptchav3][score]" value="'.esc_attr($c['score']??'0.5').'" class="small-text"></p>';
|
||||
echo '<p class="description"><a href="https://www.google.com/recaptcha/admin/create" target="_blank">Schluessel bei Google erstellen →</a> (Typ: v3)</p>';
|
||||
|
||||
echo '<p><button type="submit" class="button button-primary">Speichern</button></p>';
|
||||
echo '</form>';
|
||||
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user