Plugin Directory

Changeset 3486488


Ignore:
Timestamp:
03/19/2026 01:01:56 PM (13 days ago)
Author:
markai
Message:

Update to version 1.0.5 from GitHub

Location:
mark-ai
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • mark-ai/tags/1.0.5/mark-ai.php

    r3476258 r3486488  
    33 * Plugin Name: Mark AI
    44 * Description: Publish content directly from Mark AI, the platform to create on-brand content at scale.
    5  * Version: 1.0.4
     5 * Version: 1.0.5
    66 * Requires at least: 5.6
    77 * Requires PHP: 7.4
     
    3737
    3838// Define plugin constants
    39 define('MARKAI_VERSION', '1.0.4');
     39define('MARKAI_VERSION', '1.0.5');
    4040define('MARKAI_PLUGIN_DIR', plugin_dir_path(__FILE__));
    4141define('MARKAI_PLUGIN_URL', plugin_dir_url(__FILE__));
     
    225225        if (!$this->verify_signature($body, $signature)) {
    226226            $this->log_activity('auth_failed', null, ['error' => 'Invalid signature']);
     227            $this->report_error_to_api('error', 'HMAC signature verification failed', [
     228                'ip' => $this->get_client_ip(),
     229            ]);
    227230            return false;
    228231        }
     
    289292        if (empty($integration_id)) {
    290293            $this->log_activity('auth_failed', null, ['error' => 'Connection not authorized']);
     294            $this->report_error_to_api('error', 'Connection not authorized — markai_integration_id is empty');
    291295            wp_send_json_error(__('Connection not authorized. Please authorize from your WordPress admin.', 'mark-ai'), 403);
    292296        }
     
    445449                'payload' => $data
    446450            ]);
     451            $this->report_error_to_api('error', 'Publish failed: ' . $post_id->get_error_message(), [
     452                'post_type' => $post_type,
     453            ]);
    447454            wp_send_json_error($post_id->get_error_message(), 500);
    448455        }
     
    18541861                'payload' => $this->sanitize_for_logging($data),
    18551862            ]);
     1863            $this->report_error_to_api('error', 'Elementor publish failed: ' . $post_id->get_error_message());
    18561864            wp_send_json_error($post_id->get_error_message(), 500);
    18571865        }
     
    22472255                'payload' => $this->sanitize_for_logging($data),
    22482256            ]);
     2257            $this->report_error_to_api('error', 'Gutenberg publish failed: ' . $post_id->get_error_message());
    22492258            wp_send_json_error($post_id->get_error_message(), 500);
    22502259        }
     
    29322941
    29332942    /**
     2943     * Report an error to the Mark AI API for Sentry tracking.
     2944     *
     2945     * Fire-and-forget: uses a short timeout and ignores the response.
     2946     * Only sends for important errors (auth failures, publish failures).
     2947     *
     2948     * @since 1.0.5
     2949     * @param string $level   Error level ('error' or 'warning').
     2950     * @param string $message Error message.
     2951     * @param array  $context Optional context data.
     2952     * @return void
     2953     */
     2954    private function report_error_to_api($level, $message, $context = []) {
     2955        $integration_id = get_option('markai_integration_id');
     2956        if (empty($integration_id) || empty($this->api_key)) {
     2957            return;
     2958        }
     2959
     2960        $api_base_url = defined('MARKAI_API_URL')
     2961            ? MARKAI_API_URL
     2962            : 'https://api.markcopy.ai';
     2963
     2964        $payload = [
     2965            'integration_id' => $integration_id,
     2966            'errors' => [
     2967                [
     2968                    'level'     => $level,
     2969                    'message'   => $message,
     2970                    'context'   => array_merge($context, [
     2971                        'site_url'       => get_site_url(),
     2972                        'plugin_version' => MARKAI_VERSION,
     2973                    ]),
     2974                    'timestamp' => time(),
     2975                ],
     2976            ],
     2977        ];
     2978
     2979        $body = wp_json_encode($payload);
     2980        $signature = hash_hmac('sha256', $body, $this->api_key);
     2981
     2982        wp_remote_post($api_base_url . '/integrations/wordpress/plugin-errors', [
     2983            'body'      => $body,
     2984            'headers'   => [
     2985                'Content-Type'       => 'application/json',
     2986                'X-MarkAI-Signature' => $signature,
     2987            ],
     2988            'timeout'   => 5,
     2989            'blocking'  => false,
     2990            'sslverify' => true,
     2991        ]);
     2992    }
     2993
     2994    /**
    29342995     * Log plugin activity to the database.
    29352996     *
  • mark-ai/tags/1.0.5/readme.txt

    r3476258 r3486488  
    44Requires at least: 5.6
    55Tested up to: 6.9
    6 Stable tag: 1.0.4
     6Stable tag: 1.0.5
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    8181
    8282== Changelog ==
     83
     84= 1.0.5 =
     85* Improved error reporting for faster troubleshooting
    8386
    8487= 1.0.4 =
  • mark-ai/trunk/mark-ai.php

    r3476258 r3486488  
    33 * Plugin Name: Mark AI
    44 * Description: Publish content directly from Mark AI, the platform to create on-brand content at scale.
    5  * Version: 1.0.4
     5 * Version: 1.0.5
    66 * Requires at least: 5.6
    77 * Requires PHP: 7.4
     
    3737
    3838// Define plugin constants
    39 define('MARKAI_VERSION', '1.0.4');
     39define('MARKAI_VERSION', '1.0.5');
    4040define('MARKAI_PLUGIN_DIR', plugin_dir_path(__FILE__));
    4141define('MARKAI_PLUGIN_URL', plugin_dir_url(__FILE__));
     
    225225        if (!$this->verify_signature($body, $signature)) {
    226226            $this->log_activity('auth_failed', null, ['error' => 'Invalid signature']);
     227            $this->report_error_to_api('error', 'HMAC signature verification failed', [
     228                'ip' => $this->get_client_ip(),
     229            ]);
    227230            return false;
    228231        }
     
    289292        if (empty($integration_id)) {
    290293            $this->log_activity('auth_failed', null, ['error' => 'Connection not authorized']);
     294            $this->report_error_to_api('error', 'Connection not authorized — markai_integration_id is empty');
    291295            wp_send_json_error(__('Connection not authorized. Please authorize from your WordPress admin.', 'mark-ai'), 403);
    292296        }
     
    445449                'payload' => $data
    446450            ]);
     451            $this->report_error_to_api('error', 'Publish failed: ' . $post_id->get_error_message(), [
     452                'post_type' => $post_type,
     453            ]);
    447454            wp_send_json_error($post_id->get_error_message(), 500);
    448455        }
     
    18541861                'payload' => $this->sanitize_for_logging($data),
    18551862            ]);
     1863            $this->report_error_to_api('error', 'Elementor publish failed: ' . $post_id->get_error_message());
    18561864            wp_send_json_error($post_id->get_error_message(), 500);
    18571865        }
     
    22472255                'payload' => $this->sanitize_for_logging($data),
    22482256            ]);
     2257            $this->report_error_to_api('error', 'Gutenberg publish failed: ' . $post_id->get_error_message());
    22492258            wp_send_json_error($post_id->get_error_message(), 500);
    22502259        }
     
    29322941
    29332942    /**
     2943     * Report an error to the Mark AI API for Sentry tracking.
     2944     *
     2945     * Fire-and-forget: uses a short timeout and ignores the response.
     2946     * Only sends for important errors (auth failures, publish failures).
     2947     *
     2948     * @since 1.0.5
     2949     * @param string $level   Error level ('error' or 'warning').
     2950     * @param string $message Error message.
     2951     * @param array  $context Optional context data.
     2952     * @return void
     2953     */
     2954    private function report_error_to_api($level, $message, $context = []) {
     2955        $integration_id = get_option('markai_integration_id');
     2956        if (empty($integration_id) || empty($this->api_key)) {
     2957            return;
     2958        }
     2959
     2960        $api_base_url = defined('MARKAI_API_URL')
     2961            ? MARKAI_API_URL
     2962            : 'https://api.markcopy.ai';
     2963
     2964        $payload = [
     2965            'integration_id' => $integration_id,
     2966            'errors' => [
     2967                [
     2968                    'level'     => $level,
     2969                    'message'   => $message,
     2970                    'context'   => array_merge($context, [
     2971                        'site_url'       => get_site_url(),
     2972                        'plugin_version' => MARKAI_VERSION,
     2973                    ]),
     2974                    'timestamp' => time(),
     2975                ],
     2976            ],
     2977        ];
     2978
     2979        $body = wp_json_encode($payload);
     2980        $signature = hash_hmac('sha256', $body, $this->api_key);
     2981
     2982        wp_remote_post($api_base_url . '/integrations/wordpress/plugin-errors', [
     2983            'body'      => $body,
     2984            'headers'   => [
     2985                'Content-Type'       => 'application/json',
     2986                'X-MarkAI-Signature' => $signature,
     2987            ],
     2988            'timeout'   => 5,
     2989            'blocking'  => false,
     2990            'sslverify' => true,
     2991        ]);
     2992    }
     2993
     2994    /**
    29342995     * Log plugin activity to the database.
    29352996     *
  • mark-ai/trunk/readme.txt

    r3476258 r3486488  
    44Requires at least: 5.6
    55Tested up to: 6.9
    6 Stable tag: 1.0.4
     6Stable tag: 1.0.5
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    8181
    8282== Changelog ==
     83
     84= 1.0.5 =
     85* Improved error reporting for faster troubleshooting
    8386
    8487= 1.0.4 =
Note: See TracChangeset for help on using the changeset viewer.