Plugin Directory

Changeset 3752295


Ignore:
Timestamp:
10/17/2026 07:13:00 PM (5 weeks ago)
Author:
linkbraid
Message:

Linkbraid 1.0.8 - first release

Location:
linkbraid
Files:
275 added
4 edited

Legend:

Unmodified
Added
Removed
  • linkbraid/trunk/includes/class-admin.php

    r3750037 r3752295  
    4040        add_action('admin_enqueue_scripts', [$this, 'enqueue_assets']);
    4141        add_action('admin_init', [$this, 'maybe_redirect_to_wizard']);
     42        add_action('admin_init', [$this, 'review_notice_action']);
     43        add_action('admin_notices', [$this, 'review_notice']);
    4244        add_filter('admin_body_class', [$this, 'wizard_body_class']);
    4345        add_action('add_meta_boxes', [$this, 'register_metaboxes']);
    … …  
    260262        $gsc_notice = current_user_can('manage_options') ? $this->gsc_return_notice() : null;
    261263        include LINKBRAID_PATH . 'admin/views/wizard.php';
     264    }
     265
     266    /** Days of use, after the first link scan, before Linkbraid asks for a review. */
     267    const REVIEW_AFTER_DAYS = 7;
     268    const REVIEW_URL = 'https://wordpress.org/support/plugin/linkbraid/reviews/#new-post';
     269
     270    /**
     271     * A one-time review request on Linkbraid's own screens only: shown after a
     272     * week of use and a completed link scan. "Maybe later" snoozes it for 30
     273     * days; the other two buttons end it for this user.
     274     */
     275    public function review_notice() {
     276        if (!current_user_can('manage_options')) return;
     277        $screen = function_exists('get_current_screen') ? get_current_screen() : null;
     278        if (!$screen || strpos((string) $screen->id, 'linkbraid') === false || strpos((string) $screen->id, 'linkbraid-wizard') !== false) return;
     279        $first_seen = (int) get_option('lbraid_first_seen');
     280        if (!$first_seen) {
     281            update_option('lbraid_first_seen', time(), false);
     282            return;
     283        }
     284        if (time() - $first_seen < self::REVIEW_AFTER_DAYS * DAY_IN_SECONDS) return;
     285        $state = (string) get_user_meta(get_current_user_id(), 'lbraid_review_notice', true);
     286        if ($state === 'done' || (ctype_digit($state) && time() < (int) $state)) return;
     287        global $wpdb;
     288        // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- a single-row existence check on the plugin's own table, only on Linkbraid screens.
     289        if (!$wpdb->get_var("SELECT 1 FROM {$wpdb->prefix}lbraid_existing_links LIMIT 1")) return;
     290        $action_url = function ($action) {
     291            return wp_nonce_url(add_query_arg('lbraid_review', $action), 'lbraid_review');
     292        };
     293        ?>
     294        <div class="notice notice-info lbraid-review-notice">
     295            <p><strong><?php esc_html_e( 'Is Linkbraid helping you build better internal links?', 'linkbraid' ); ?></strong>
     296            <?php esc_html_e( 'A short review on WordPress.org helps other site owners find the plugin. It takes about a minute.', 'linkbraid' ); ?></p>
     297            <p>
     298                <a class="button button-primary" href="<?php echo esc_url($action_url('review')); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Leave a review', 'linkbraid' ); ?></a>
     299                <a class="button" href="<?php echo esc_url($action_url('later')); ?>"><?php esc_html_e( 'Maybe later', 'linkbraid' ); ?></a>
     300                <a class="button-link" href="<?php echo esc_url($action_url('done')); ?>"><?php esc_html_e( 'I already left one', 'linkbraid' ); ?></a>
     301            </p>
     302        </div>
     303        <?php
     304    }
     305
     306    /** Handles the review notice buttons (nonce-checked links). */
     307    public function review_notice_action() {
     308        if (!isset($_GET['lbraid_review'])) return;
     309        $action = sanitize_key(wp_unslash($_GET['lbraid_review']));
     310        if (!in_array($action, ['review', 'later', 'done'], true) || !current_user_can('manage_options')) return;
     311        check_admin_referer('lbraid_review');
     312        update_user_meta(get_current_user_id(), 'lbraid_review_notice', $action === 'later' ? (string) (time() + 30 * DAY_IN_SECONDS) : 'done');
     313        if ($action === 'review') {
     314            // phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect -- fixed wordpress.org review form, never user input.
     315            wp_redirect(self::REVIEW_URL);
     316            exit;
     317        }
     318        wp_safe_redirect(remove_query_arg(['lbraid_review', '_wpnonce']));
     319        exit;
    262320    }
    263321
  • linkbraid/trunk/linkbraid.php

    r3751084 r3752295  
    44 * Plugin URI: https://linkbraid.com/
    55 * Description: Don't add links. Weave your site. Linkbraid maps your site as a graph, finds the missing connections, and helps you build clusters that search engines can actually follow.
    6  * Version: 1.0.7
     6 * Version: 1.0.8
    77 * Author: Linkbraid
    88 * License: GPL v2 or later
    … …  
    1717// A second copy must not redeclare global classes/functions.
    1818if (defined('LINKBRAID_VERSION')) return;
    19 define('LINKBRAID_VERSION', '1.0.7');
     19define('LINKBRAID_VERSION', '1.0.8');
    2020define('LINKBRAID_PATH', plugin_dir_path(__FILE__));
    2121define('LINKBRAID_URL', plugin_dir_url(__FILE__));
  • linkbraid/trunk/readme.txt

    r3751084 r3752295  
    11=== Linkbraid - Internal Linking, Link Map & Broken Link Checker ===
    22Contributors: linkbraid
    3 Tags: internal links, seo, broken links, anchor text, link checker
     3Tags: internal linking, internal links, broken links, link checker, orphan pages
    44Requires at least: 5.8
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.0.7
     7Stable tag: 1.0.8
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 Don't add links. Weave your site. Internal link map, broken-link checker, anchor reports, redirect finder and rule-based auto-linking.
     11Internal linking for WordPress: interactive link map, orphan pages, broken link checker, anchor reports and rule-based auto-linking.
    1212
    1313== Description ==
    1414
    15 Linkbraid maps your site as a graph, shows you the missing connections, and helps you build content clusters that search engines can actually follow.
     15Linkbraid shows every internal link on your site as an interactive map, finds orphan pages and broken links, and helps you build internal linking that search engines can follow. Don't add links. Weave your site.
    1616
    1717Everything runs on your own server. Linkbraid Lite sends no content anywhere and needs no account or API key.
    … …  
    105105== Changelog ==
    106106
     107= 1.0.8 =
     108* Added: a one-time request for a review on the Linkbraid screens, shown after a week of use and a completed link scan. "Maybe later" hides it for 30 days; it never appears on other admin pages.
     109* Improved: plugin directory description and tags.
     110
    107111= 1.0.7 =
    108112* Fixed content appearing several times in the Knots list after posts were created with a post-duplication plugin. Copied hidden plugin data is repaired once on update and cleaned automatically afterwards.
  • linkbraid/trunk/uninstall.php

    r3750037 r3752295  
    4343$wpdb->query($wpdb->prepare("DELETE FROM {$wpdb->postmeta} WHERE meta_key LIKE %s", $wpdb->esc_like('_lbraid_') . '%'));
    4444
     45// Per-user state of the review request.
     46delete_metadata('user', 0, 'lbraid_review_notice', '', true);
     47
    4548wp_clear_scheduled_hook('lbraid_job_tick');
Note: See TracChangeset for help on using the changeset viewer.