Plugin Directory

Changeset 3829246


Ignore:
Timestamp:
11/27/2026 10:35:57 AM (less than one hour ago)
Author:
decaffeinatedfullyee695dfe1a
Message:

Release 1.2.1: report setup failures so they can be fixed

Location:
nora-ai-publisher
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • nora-ai-publisher/tags/1.2.1/includes/class-norap-activation.php

    r3689459 r3829246  
    1010if ( ! defined( 'ABSPATH' ) ) {
    1111        exit;
     12}
     13
     14/**
     15 * Save a setup failure for the admin page and report it to the backend.
     16 * Only for failures the backend cannot see: when registration reaches it and
     17 * is refused there, it already logs that itself.
     18 */
     19function norap_registration_failed( $stage, $message ) {
     20        update_option( 'norap_registration_error', $message );
     21        Norap_Api_Client::report_registration_error( $stage, $message );
    1222}
    1323
    … …  
    2535        $user = wp_get_current_user();
    2636        if ( ! $user || ! $user->exists() ) {
    27                 update_option( 'norap_registration_error', 'No current user context during activation.' );
     37                norap_registration_failed( 'no_user', 'No current user context during activation.' );
    2838                return;
    2939        }
    3040
    3141        if ( ! class_exists( 'WP_Application_Passwords' ) ) {
    32                 update_option( 'norap_registration_error', 'Application Passwords are not available on this WordPress install (requires WordPress 5.6+).' );
     42                norap_registration_failed( 'no_app_passwords', 'Application Passwords are not available on this WordPress install (requires WordPress 5.6+).' );
    3343                return;
    3444        }
    … …  
    4151
    4252        if ( is_wp_error( $created ) ) {
    43                 update_option( 'norap_registration_error', $created->get_error_message() );
     53                norap_registration_failed( 'app_password_create', $created->get_error_message() );
    4454                return;
    4555        }
    … …  
    6070
    6171        if ( is_wp_error( $response ) ) {
    62                 update_option( 'norap_registration_error', $response->get_error_message() );
     72                norap_registration_failed( 'register_request', $response->get_error_message() );
    6373                WP_Application_Passwords::delete_application_password( $user->ID, $item['uuid'] );
    6474                return;
  • nora-ai-publisher/tags/1.2.1/includes/class-norap-api-client.php

    r3734394 r3829246  
    6161                                'action'   => 'deregister',
    6262                                'tenantId' => $tenant_id,
     63                        )
     64                );
     65        }
     66
     67        /**
     68         * Tell the backend that setup failed on this site, so failures that
     69         * never reach registration can still be seen. Sends no credentials.
     70         * Fire-and-forget: activation must not wait on it or fail because of it.
     71         */
     72        public static function report_registration_error( $stage, $error ) {
     73                global $wp_version;
     74                wp_remote_post(
     75                        self::base() . '/api/webhooks/wordpress',
     76                        array(
     77                                'timeout'  => 5,
     78                                'blocking' => false,
     79                                'headers'  => array( 'Content-Type' => 'application/json' ),
     80                                'body'     => wp_json_encode(
     81                                        array(
     82                                                'action'        => 'registration_error',
     83                                                'siteUrl'       => home_url( '/' ),
     84                                                'stage'         => $stage,
     85                                                'error'         => $error,
     86                                                'wpVersion'     => $wp_version,
     87                                                'phpVersion'    => PHP_VERSION,
     88                                                'pluginVersion' => NORAP_VERSION,
     89                                        )
     90                                ),
    6391                        )
    6492                );
  • nora-ai-publisher/tags/1.2.1/nora-ai-publisher.php

    r3734712 r3829246  
    44 * Plugin URI:        https://noraaipublisher.com
    55 * Description:       Write and publish blog posts automatically with AI. No API key needed. Articles built to be quoted by Google and AI assistants. Requires connecting to the Nora AI Publisher API (see the "External services" section of the readme).
    6  * Version:           1.2.0
     6 * Version:           1.2.1
    77 * Requires at least: 5.6
    88 * Requires PHP:      7.4
    … …  
    2323define( 'NORAP_PLUGIN_FILE', __FILE__ );
    2424define( 'NORAP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    25 define( 'NORAP_VERSION', '1.2.0' );
     25define( 'NORAP_VERSION', '1.2.1' );
    2626
    2727require_once NORAP_PLUGIN_DIR . 'includes/class-norap-api-client.php';
  • nora-ai-publisher/tags/1.2.1/readme.txt

    r3734712 r3829246  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.2.0
     7Stable tag: 1.2.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    8383* Your settings: the subjects you describe, keywords, tone, languages, publishing mode and schedule (used to write articles that fit your site and to publish them when you asked).
    8484* Your site name and admin email (used to register your account).
     85* If setup fails on your site: your site's URL, the step that failed, the error message, and your WordPress, PHP and plugin versions (used only so we can find and fix setup problems; no passwords or content are sent).
    8586
    8687What the service sends back:
    … …  
    183184
    184185== Changelog ==
     186
     187= 1.2.1 =
     188* Improved: if setup fails when you activate the plugin, the reason is sent to us so we can fix it (see External services). No passwords or content are sent.
    185189
    186190= 1.2.0 =
  • nora-ai-publisher/trunk/includes/class-norap-activation.php

    r3689459 r3829246  
    1010if ( ! defined( 'ABSPATH' ) ) {
    1111        exit;
     12}
     13
     14/**
     15 * Save a setup failure for the admin page and report it to the backend.
     16 * Only for failures the backend cannot see: when registration reaches it and
     17 * is refused there, it already logs that itself.
     18 */
     19function norap_registration_failed( $stage, $message ) {
     20        update_option( 'norap_registration_error', $message );
     21        Norap_Api_Client::report_registration_error( $stage, $message );
    1222}
    1323
    … …  
    2535        $user = wp_get_current_user();
    2636        if ( ! $user || ! $user->exists() ) {
    27                 update_option( 'norap_registration_error', 'No current user context during activation.' );
     37                norap_registration_failed( 'no_user', 'No current user context during activation.' );
    2838                return;
    2939        }
    3040
    3141        if ( ! class_exists( 'WP_Application_Passwords' ) ) {
    32                 update_option( 'norap_registration_error', 'Application Passwords are not available on this WordPress install (requires WordPress 5.6+).' );
     42                norap_registration_failed( 'no_app_passwords', 'Application Passwords are not available on this WordPress install (requires WordPress 5.6+).' );
    3343                return;
    3444        }
    … …  
    4151
    4252        if ( is_wp_error( $created ) ) {
    43                 update_option( 'norap_registration_error', $created->get_error_message() );
     53                norap_registration_failed( 'app_password_create', $created->get_error_message() );
    4454                return;
    4555        }
    … …  
    6070
    6171        if ( is_wp_error( $response ) ) {
    62                 update_option( 'norap_registration_error', $response->get_error_message() );
     72                norap_registration_failed( 'register_request', $response->get_error_message() );
    6373                WP_Application_Passwords::delete_application_password( $user->ID, $item['uuid'] );
    6474                return;
  • nora-ai-publisher/trunk/includes/class-norap-api-client.php

    r3734394 r3829246  
    6161                                'action'   => 'deregister',
    6262                                'tenantId' => $tenant_id,
     63                        )
     64                );
     65        }
     66
     67        /**
     68         * Tell the backend that setup failed on this site, so failures that
     69         * never reach registration can still be seen. Sends no credentials.
     70         * Fire-and-forget: activation must not wait on it or fail because of it.
     71         */
     72        public static function report_registration_error( $stage, $error ) {
     73                global $wp_version;
     74                wp_remote_post(
     75                        self::base() . '/api/webhooks/wordpress',
     76                        array(
     77                                'timeout'  => 5,
     78                                'blocking' => false,
     79                                'headers'  => array( 'Content-Type' => 'application/json' ),
     80                                'body'     => wp_json_encode(
     81                                        array(
     82                                                'action'        => 'registration_error',
     83                                                'siteUrl'       => home_url( '/' ),
     84                                                'stage'         => $stage,
     85                                                'error'         => $error,
     86                                                'wpVersion'     => $wp_version,
     87                                                'phpVersion'    => PHP_VERSION,
     88                                                'pluginVersion' => NORAP_VERSION,
     89                                        )
     90                                ),
    6391                        )
    6492                );
  • nora-ai-publisher/trunk/nora-ai-publisher.php

    r3734712 r3829246  
    44 * Plugin URI:        https://noraaipublisher.com
    55 * Description:       Write and publish blog posts automatically with AI. No API key needed. Articles built to be quoted by Google and AI assistants. Requires connecting to the Nora AI Publisher API (see the "External services" section of the readme).
    6  * Version:           1.2.0
     6 * Version:           1.2.1
    77 * Requires at least: 5.6
    88 * Requires PHP:      7.4
    … …  
    2323define( 'NORAP_PLUGIN_FILE', __FILE__ );
    2424define( 'NORAP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    25 define( 'NORAP_VERSION', '1.2.0' );
     25define( 'NORAP_VERSION', '1.2.1' );
    2626
    2727require_once NORAP_PLUGIN_DIR . 'includes/class-norap-api-client.php';
  • nora-ai-publisher/trunk/readme.txt

    r3734712 r3829246  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.2.0
     7Stable tag: 1.2.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    8383* Your settings: the subjects you describe, keywords, tone, languages, publishing mode and schedule (used to write articles that fit your site and to publish them when you asked).
    8484* Your site name and admin email (used to register your account).
     85* If setup fails on your site: your site's URL, the step that failed, the error message, and your WordPress, PHP and plugin versions (used only so we can find and fix setup problems; no passwords or content are sent).
    8586
    8687What the service sends back:
    … …  
    183184
    184185== Changelog ==
     186
     187= 1.2.1 =
     188* Improved: if setup fails when you activate the plugin, the reason is sent to us so we can fix it (see External services). No passwords or content are sent.
    185189
    186190= 1.2.0 =
Note: See TracChangeset for help on using the changeset viewer.