Skip to content

Commit

Permalink
Prepare version 1.1.1 (#13)
Browse files Browse the repository at this point in the history
prepare version 1.1.1
  • Loading branch information
xJuvi authored Oct 7, 2024
1 parent 97b642d commit dfaa2ad
Show file tree
Hide file tree
Showing 7 changed files with 143 additions and 27 deletions.
48 changes: 48 additions & 0 deletions .github/ISSUE_TEMPLATE/01-ISSUE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: Issue Report
about: Use this template to report a problem
title: "[VERSION] [PROBLEM SUMMARY]"
labels: bug
assignees:
---

## Expected Behavior

Please describe the behavior you are expecting

## Current Behavior

What is the current behavior?

## Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

* Project Version:
* Operating System:
* Toolchain:
* Toolchain version:

## Failure Information (for bugs)

Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.

### Steps to Reproduce

Please provide detailed steps for reproducing the issue.

1. step 1
2. step 2
3. you get it...

### Failure Logs

Please include any relevant log snippets or files here.

## Checklist

- [ ] I am running the latest version
- [ ] I checked the documentation and found no answer
- [ ] I checked to make sure that this issue has not already been filed
- [ ] I'm reporting the issue to the correct repository (for multi-repository projects)
- [ ] I have provided sufficient information for the team
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/02-FEATURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Feature Request
about: Use this template for requesting new features
title: "[FEATURE NAME]"
labels: enhancement
assignees:
---

## Expected Behavior

Please describe the behavior you are expecting

## Current Behavior

What is the current behavior?

## Sample Code

If applicable, provide a sample code snippet that demonstrates the gist of feature you're proposing. This can be either from a usage standpoint, or an implementation standpoint.

## Context

Please provide any relevant information about your setup, which will help us ensure the requested support will work for you.

* Project Version:
* Operating System:
* Toolchain version:
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/03-QUESTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Question
about: Use this template to ask a question about the project
title: "[QUESTION SUMMARY]"
labels: ["help wanted", "question"]
assignees:
---

## Question

State your question

## Sample Code
```php
Please include relevant code snippets or files that provide context for your question.
```
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: GitHub Discussions
url: https://github.com/kulturwunsch/Kultur-API-for-WP/discussions
about: Please ask and answer questions here.
- name: Report a security issue
url: https://kulturwunsch.de/kontakt/
about: Please report security vulnerabilities here.
53 changes: 31 additions & 22 deletions admin/partials/ka4wp-form-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,38 @@
* @package KA4WP
* @subpackage KA4WP/admin/partials
*/

if(!is_plugin_active('contact-form-7/wp-contact-form-7.php') && (is_multisite() && !is_plugin_active_for_network('contact-form-7/wp-contact-form-7.php')))
{
wp_die(esc_html_e('You have to install the Contact Form 7 plugin before you can configure this form.','kultur-api-for-wp'), esc_html_e('Contact Form 7 plugin is required','kultur-api-for-wp'));
}

$form_id = !empty($_GET['post']) ? sanitize_text_field($_GET['post']) : null;
$ContactForm = WPCF7_ContactForm::get_instance( $form_id );
if(!empty($ContactForm))
{
$props = $ContactForm->get_properties();

$wpcf7_api_data = $props['ka4wp_api_integrations'] ?? [];
$wpcf7_api_data = $props['ka4wp_api_integrations'] ?: [];

$form_fields = $ContactForm->scan_form_tags();
foreach($form_fields as $form_fields_value){
if($form_fields_value->basetype != 'submit'){
$ka4wp_field_array[$form_fields_value->raw_name] = $wpcf7_api_data['mapping-'.$form_fields_value->raw_name] ?? '';
}
}

$defaultsOptions = KA4WP_Admin::ka4wp_get_endpoint_defaults($wpcf7_api_data["apiendpoint"] ?? []);
$defaultMappings = $defaultsOptions[$wpcf7_api_data["predefined-mapping"]]['options'] ?? [];
}

//load API types
$ApiEndpointPosts = get_posts([
'post_type' => 'ka4wp',
'post_status' => 'publish',
'numberposts' => -1,
'order' => 'ASC'
]);

$defaultsOptions = KA4WP_Admin::ka4wp_get_endpoint_defaults($wpcf7_api_data["apiendpoint"]);
$defaultMappings = $defaultsOptions[$wpcf7_api_data["predefined-mapping"]]['options'] ?? [];
?>

<h2><?php esc_html_e('API Integration','kultur-api-for-wp'); ?></h2>
Expand All @@ -55,7 +60,7 @@
<div class="cf7_row">
<label for="wpcf7-sf-stop_email">
<input type="checkbox" id="wpcf7-sf-stop_email"
name="wpcf7-ka4wp[stop_email]" value = "1" <?php echo checked(1, $wpcf7_api_data["stop_email"] ?? 0); ?>/>
name="wpcf7-ka4wp[stop_email]" value = "1" <?php checked(1, $wpcf7_api_data["stop_email"] ?? 0); ?>/>
<?php esc_html_e('Skip sending emails','kultur-api-for-wp'); ?>
</label>
<p class="description"><?php esc_html_e('If enabled, emails will not be sent upon form submission.','kultur-api-for-wp') ?></p>
Expand All @@ -75,19 +80,23 @@
<label><?php esc_html_e('Here you can select the specified API which should used to transfer the form entered data.','kultur-api-for-wp'); ?></label>
<fieldset>
<div class="cf7_row">
<label for="wpcf7-sf-select-apiendpoint">
<select id="wpcf7-sf-select-apiendpoint" name="wpcf7-ka4wp[apiendpoint]">
<option value="" <?php selected('', $wpcf7_api_data["apiendpoint"] ?? 0, false) ?>></option>
<?php
foreach($ApiEndpointPosts as $singleEndpoint)
{
echo '<option value="'.esc_attr($singleEndpoint->ID).'" '.selected($singleEndpoint->ID, $wpcf7_api_data["apiendpoint"] ?? 0, false).'>'.esc_attr($singleEndpoint->post_title).'</option>';
}
?>
</select>
<?php esc_html_e('Selected API endpoint','kultur-api-for-wp'); ?>
</label>
<p class="description"><?php esc_html_e('You can select here only published api endpoints.','kultur-api-for-wp') ?></p>
<?php if(!empty($ApiEndpointPosts)) { ?>
<label for="wpcf7-sf-select-apiendpoint">
<select id="wpcf7-sf-select-apiendpoint" name="wpcf7-ka4wp[apiendpoint]">
<option value="" <?php selected('', $wpcf7_api_data["apiendpoint"] ?? 0, false) ?>></option>
<?php
foreach($ApiEndpointPosts as $singleEndpoint)
{
echo '<option value="'.$singleEndpoint->ID.'" '.selected($singleEndpoint->ID, $wpcf7_api_data["apiendpoint"] ?? 0, false).'>'.esc_attr($singleEndpoint->post_title).'</option>';
}
?>
</select>
<?php esc_html_e('Selected API endpoint','kultur-api-for-wp'); ?>
</label>
<p class="description"><?php esc_html_e('You can select here only published api endpoints.','kultur-api-for-wp') ?></p>
<?php } else {
esc_html_e('There are no published API endpoints at the moment. Please ensure that your API endpoint is published. You can add the api settings later after submit your new form.','kultur-api-for-wp');
} ?>
</div>
</fieldset>
</div>
Expand Down Expand Up @@ -123,7 +132,7 @@
<fieldset>
<div id="cf7anyapi-form-fields" class="form-fields">
<?php
if($ka4wp_field_array){
if(!empty($ka4wp_field_array)){
foreach($ka4wp_field_array as $ka4wp_form_field_key => $ka4wp_form_field_value){
?>
<div class="cf7_row">
Expand All @@ -147,14 +156,14 @@
<fieldset>
<div id="cf7anyapi-form-fields" class="form-fields">
<?php
if($ka4wp_field_array){
if(!empty($ka4wp_field_array)){
foreach($ka4wp_field_array as $ka4wp_form_field_key => $ka4wp_form_field_value){
?>
<div class="cf7_row">
<label for="wpcf7-field-mapping-<?php echo esc_html($ka4wp_form_field_key); ?>">
<?php echo esc_html($ka4wp_form_field_key); ?> (<?php echo esc_html($ka4wp_form_field_value); ?>)
<select id="wpcf7-field-mapping-<?php echo esc_html($ka4wp_form_field_key); ?>" name="wpcf7-ka4wp[mapping-<?php echo esc_html($ka4wp_form_field_key); ?>]" class="predefined-field-mapping">
<option value="" <?php echo selected('', $ka4wp_form_field_value); ?>><?php esc_html_e("Don't send this field to endpoint via API", 'kultur-api-for-wp' ); ?></option>
<option value="" <?php selected('', $ka4wp_form_field_value, '', false); ?>><?php esc_html_e("Don't send this field to endpoint via API", 'kultur-api-for-wp' ); ?></option>
<?php
if(!empty($defaultMappings))
{
Expand Down
5 changes: 3 additions & 2 deletions kultur-api-for-wp.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
* Plugin Name: Kultur-API for WP
* Plugin URI: https://github.com/kulturwunsch/Kultur-API-for-WP
* Description: Kultur-API for WP is an extension to digitize the entire process of a cultural impart organization.
* Version: 1.1.0
* Version: 1.1.1
* Author: Kulturwunsch Wolfenbüttel e. V.
* Author URI: https://kulturwunsch.de
* License: GPL-3.0+
* License URI: https://www.gnu.org/licenses/gpl-3.0.txt
* Text Domain: kultur-api-for-wp
* Domain Path: /languages
* Requires Plugins: contact-form-7
*/

// If this file is called directly, abort.
Expand All @@ -35,7 +36,7 @@
* Start at version 1.0.0 and use SemVer - https://semver.org
* Rename this for your plugin and update it as you release new versions.
*/
define( 'KA4WP_VERSION', '1.1.0' );
define( 'KA4WP_VERSION', '1.1.1' );

/**
* The code that runs during plugin activation.
Expand Down
13 changes: 10 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@ Donate link: https://kulturwunsch.de/spenden/
Tags: contact form, api, events, culture, multilingual
Requires at least: 6.3
Requires PHP: 7.4
Tested up to: 6.5
Stable tag: 1.1.0
Tested up to: 6.6
Stable tag: 1.1.1
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Demo URI: https://tastewp.com/new?pre-installed-plugin-slug=contact-form-7%2Ckultur-api-for-wp&redirect=edit.php%3Fpost_type%3Dka4wp%26page%3Dka4wp_settings&ni=true

Simple integration of your culture database into WordPress

== Description ==

Kultur-API is a comprehensive plugin for your website. It is aimed in particular at associations that provide free tickets for events. This plugin is intended to create added value and simplify processes.

Aktuell beinhaltet es folgenden Funktionsumfang:
It currently includes the following functions:

* Manage categories for events
* Manage imparting areas
Expand Down Expand Up @@ -62,6 +63,12 @@ For basic usage, have a look at the [plugin's website](https://kulturwunsch.de/)

== Changelog ==

= 1.1.1 =

- fix: some php warning with PHP 8.1 and Above
- fix: some language strings were not translated
- change: add Contact Form 7 as required dependency

= 1.1.0 =

- fix: contact form 7 meta data will be deleted on uninstall this plugin
Expand Down

0 comments on commit dfaa2ad

Please sign in to comment.