| License Key: | ' . esc_attr( $support['license'] ) . ' |
| Plugin: | ' . esc_attr( $support['plugin'] ) . ' |
| Website: | ' . esc_url( $support['link'] ) . ' |
' . esc_html( $text ) . '
'; } else { $text = __( 'Sorry, but message did not send. Please, contact us ', 'wp-coder' ) . $to_mail; echo '' . esc_html( $text ) . '
'; } } private static function error(): ?string { if ( ! self::verify() ) { return ''; } $support = $_POST['support']; $fields = [ 'name', 'email', 'link', 'type', 'plugin', 'license', 'message' ]; foreach ( $fields as $field ) { if ( empty( $support[ $field ] ) ) { return __( 'Please complete all required fields before submitting.', 'wp-coder' ); } } return ''; } private static function verify(): bool { $support = $_POST['support'] ?? []; $nonce_name = WPCoder::PREFIX . '_nonce_name'; $nonce_action = WPCoder::PREFIX . '_nonce_action'; return ! empty( $support ) && wp_verify_nonce( $_POST[ $nonce_name ], $nonce_action ); } }