display_content();
} else {
require_once( dirname( __FILE__ ) . '/includes/allowlist.php' );
$page = new Gglcptch_Allowlist( plugin_basename( __FILE__ ) );
if ( is_object( $page ) ) {
$page->display_content();
}
/*pls */
bws_plugin_reviews_block( $gglcptch_plugin_info['Name'], 'google-captcha' );
/* pls*/
} ?>
roles[0] ) ) {
$role = $current_user->roles[0];
if ( empty( $gglcptch_options ) ) {
register_gglcptch_settings();
}
return ! empty( $gglcptch_options[ $role ] );
} else {
return false;
}
}
}
/* Display google captcha */
if ( ! function_exists( 'gglcptch_display' ) ) {
function gglcptch_display( $content = false ) {
global $gglcptch_options, $gglcptch_count, $gglcptch_plugin_info;
if ( empty( $gglcptch_options ) ) {
register_gglcptch_settings();
}
if ( ! gglcptch_allowlisted_ip() || ( isset( $_GET['action'] ) && 'gglcptch-test-keys' == $_GET['action'] ) ) {
if ( ! $gglcptch_count ) {
$gglcptch_count = 1;
}
$content .= '';
if ( $gglcptch_options['hide_badge'] && 'v2' != $gglcptch_options['recaptcha_version'] ) {
$content .= sprintf(
'
',
__( 'This site is protected by reCAPTCHA and the Google ', 'google-captcha' ),
__( 'Privacy Policy', 'google-captcha' ),
__( ' and ', 'google-captcha' ),
__( 'Terms of Service', 'google-captcha' ),
__( ' apply.', 'google-captcha' )
);
}
if ( ! $gglcptch_options['private_key'] || ! $gglcptch_options['public_key'] ) {
if ( current_user_can( 'manage_options' ) ) {
$content .= sprintf(
'
%s %s %s %s.',
__( 'To use reCaptcha you must get the keys from', 'google-captcha' ),
__( 'here', 'google-captcha' ),
__( 'and enter them on the', 'google-captcha' ),
admin_url( '/admin.php?page=google-captcha.php' ),
__( 'plugin setting page', 'google-captcha' )
);
}
$content .= '
';
$gglcptch_count++;
return $content;
}
$api_url = gglcptch_get_api_url();
/* generating random id value in case of getting content with pagination plugin for not getting duplicate id values */
$id = mt_rand();
if ( isset( $gglcptch_options['recaptcha_version'] ) && in_array( $gglcptch_options['recaptcha_version'], array( 'v2', 'invisible' ) ) ) {
$content .= '