6 Commits
v1.9.0 ... test

Author SHA1 Message Date
4383982fb2 feat: update version to 1.9.2 and set custom API base URL in SitiWebUpdater
Some checks failed
Build & Release Plugin / release (push) Failing after 5s
2026-02-01 00:44:55 +00:00
github-actions[bot]
5f1dcaf352 chore: update manifest.json 2026-01-31 23:57:25 +00:00
62c688dba4 chore: bump version to 1.9.1 in plugin header 2026-01-31 23:01:39 +00:00
github-actions[bot]
42332635ba chore: update manifest.json 2026-01-31 19:42:48 +00:00
9ae516b77c feat: Add automated commit and push for manifest.json updates 2026-01-31 19:42:38 +00:00
4ff96d98e0 feat: Generate manifest.json from plugin header information 2026-01-31 19:40:26 +00:00
4 changed files with 80 additions and 4 deletions

View File

@@ -38,6 +38,49 @@ jobs:
fi fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT" echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Genereer manifest.json uit plugin header
run: |
python3 - <<'PY'
import json
import re
with open('groq-ai-product-text.php', 'r', encoding='utf-8') as handle:
content = handle.read()
header_match = re.search(r'/\*\*(.*?)\*/', content, re.S)
header = header_match.group(1) if header_match else ''
def read_field(label: str) -> str:
match = re.search(r'^\s*\*\s*' + re.escape(label) + r'\s*:\s*(.+)$', header, re.M)
return match.group(1).strip() if match else ''
manifest = {
'plugin_name': read_field('Plugin Name'),
'description': read_field('Description'),
'version': read_field('Version'),
'author': read_field('Author'),
'author_url': read_field('Author URI'),
}
with open('manifest.json', 'w', encoding='utf-8') as handle:
json.dump(manifest, handle, ensure_ascii=False, indent=2)
print('manifest.json aangemaakt/bijgewerkt')
PY
- name: Commit & push manifest.json
run: |
if git diff --quiet -- manifest.json; then
echo "manifest.json ongewijzigd; geen commit nodig."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add manifest.json
git commit -m "chore: update manifest.json"
git push
- name: Check if tag exists - name: Check if tag exists
id: tagcheck id: tagcheck
run: | run: |

View File

@@ -16,11 +16,20 @@ class SitiWebUpdater {
private $authorize_token; private $authorize_token;
private $api_base_url;
private $auth_header_scheme;
private $download_auth_header_scheme;
private $github_response; private $github_response;
public function __construct( $file ) { public function __construct( $file ) {
$this->file = $file; $this->file = $file;
$this->api_base_url = 'https://api.github.com';
$this->auth_header_scheme = 'bearer';
$this->download_auth_header_scheme = 'token';
$this->set_plugin_properties(); $this->set_plugin_properties();
add_action( 'admin_init', array( $this, 'set_plugin_properties' ) ); add_action( 'admin_init', array( $this, 'set_plugin_properties' ) );
@@ -50,15 +59,29 @@ class SitiWebUpdater {
$this->authorize_token = $token; $this->authorize_token = $token;
} }
public function set_api_base_url( $api_base_url ) {
$this->api_base_url = rtrim( (string) $api_base_url, '/' );
}
public function set_auth_header_scheme( $scheme ) {
$this->auth_header_scheme = (string) $scheme;
}
public function set_download_auth_header_scheme( $scheme ) {
$this->download_auth_header_scheme = (string) $scheme;
}
private function get_repository_info() { private function get_repository_info() {
if ( is_null( $this->github_response ) ) { // Do we have a response? if ( is_null( $this->github_response ) ) { // Do we have a response?
$args = array(); $args = array();
$request_uri = sprintf( 'https://api.github.com/repos/%s/%s/releases', $this->username, $this->repository ); // Build URI $request_uri = sprintf( '%s/repos/%s/%s/releases', $this->api_base_url, $this->username, $this->repository ); // Build URI
$args = array(); $args = array();
if( $this->authorize_token ) { // Is there an access token? if( $this->authorize_token ) { // Is there an access token?
$args['headers']['Authorization'] = "bearer {$this->authorize_token}"; // Set the headers $scheme = trim( $this->auth_header_scheme );
$scheme = '' === $scheme ? 'bearer' : $scheme;
$args['headers']['Authorization'] = $scheme . ' ' . $this->authorize_token; // Set the headers
} }
$response = json_decode( wp_remote_retrieve_body( wp_remote_get( $request_uri, $args ) ), true ); // Get JSON and parse it $response = json_decode( wp_remote_retrieve_body( wp_remote_get( $request_uri, $args ) ), true ); // Get JSON and parse it
@@ -179,7 +202,9 @@ class SitiWebUpdater {
if ( null !== $args['filename'] ) { if ( null !== $args['filename'] ) {
if( $this->authorize_token ) { if( $this->authorize_token ) {
$args = array_merge( $args, array( "headers" => array( "Authorization" => "token {$this->authorize_token}" ) ) ); $scheme = trim( $this->download_auth_header_scheme );
$scheme = '' === $scheme ? 'token' : $scheme;
$args = array_merge( $args, array( "headers" => array( "Authorization" => $scheme . ' ' . $this->authorize_token ) ) );
} }
} }

View File

@@ -2,7 +2,7 @@
/** /**
* Plugin Name: SitiAI Product Teksten * Plugin Name: SitiAI Product Teksten
* Description: Genereer productteksten met diverse AI-aanbieders rechtstreeks vanuit WooCommerce. * Description: Genereer productteksten met diverse AI-aanbieders rechtstreeks vanuit WooCommerce.
* Version: 1.9.0 * Version: 1.9.2
* Author: Roberto Guagliardo | SitiWeb * Author: Roberto Guagliardo | SitiWeb
* Author URI: https://sitiweb.nl/ * Author URI: https://sitiweb.nl/
* Text Domain: siti-ai-product-content-generator * Text Domain: siti-ai-product-content-generator
@@ -79,6 +79,7 @@ if( ! class_exists( 'SitiWebUpdater' ) ){
$updater = new SitiWebUpdater( __FILE__ ); $updater = new SitiWebUpdater( __FILE__ );
$updater->set_username( 'SitiWeb' ); $updater->set_username( 'SitiWeb' );
$updater->set_repository( 'siti-ai-product-content-generator' ); $updater->set_repository( 'siti-ai-product-content-generator' );
$updater->set_api_base_url( 'https://git.robert.ooo/api/v1' );
$updater->initialize(); $updater->initialize();

7
manifest.json Normal file
View File

@@ -0,0 +1,7 @@
{
"plugin_name": "SitiAI Product Teksten",
"description": "Genereer productteksten met diverse AI-aanbieders rechtstreeks vanuit WooCommerce.",
"version": "1.9.1",
"author": "Roberto Guagliardo | SitiWeb",
"author_url": "https://sitiweb.nl/"
}