Plugin Directory

Changeset 3421791


Ignore:
Timestamp:
12/17/2025 11:01:14 AM (4 months ago)
Author:
jrmora
Message:

release 2.2.1 hotfix

Location:
recordar-for-bluesky
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • recordar-for-bluesky/tags/2.2.1/recordar-for-bluesky.php

    r3421779 r3421791  
    33 * Plugin Name: Recordar for Bluesky & Mastodon
    44 * Description: Automate archive posts (Years & Months) to Bluesky and Mastodon.
    5  * Version: 2.2.0
     5 * Version: 2.2.1
    66 * Author: JRMora
    77 * Text Domain: recordar-for-bluesky
     
    143143    $posts_to_publish = [];
    144144
    145     $log_prefix = "CRON for {$expected_time_string}. Executed at " . wp_date( 'H:i:s' ) . " (Local Blog Time): ";
     145    // [TASK 3A] i18n for Log Prefix
     146    $log_prefix = sprintf(
     147        /* translators: 1: Expected Time, 2: Execution Time */
     148        __( 'CRON for %1$s. Executed at %2$s (Local Blog Time): ', 'recordar-for-bluesky' ),
     149        $expected_time_string,
     150        wp_date( 'H:i:s' )
     151    );
    146152   
    147153    if ( ! empty( $periods_array ) ) {
     
    149155    }
    150156   
    151     $final_log = $log_prefix;
     157    // [TASK 3A] i18n for Log Result
    152158    if ( ! empty( $posts_to_publish ) ) {
    153159        $count = count( $posts_to_publish );
    154         $final_log .= "Success. {$count} posts found to publish.";
     160        /* translators: %s: number of posts found */
     161        $result_text = sprintf( _n( 'Success. %s post found to publish.', 'Success. %s posts found to publish.', $count, 'recordar-for-bluesky' ), $count );
     162        $final_log = $log_prefix . $result_text;
    155163    } else {
    156          $final_log .= "No posts found for ephemeris at this hour.";
     164        $final_log = $log_prefix . __( 'No posts found for ephemeris at this hour.', 'recordar-for-bluesky' );
    157165    }
    158166   
     
    223231                $scheduled_time_wp = wp_date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $timestamp );
    224232               
     233                // [TASK 3B] i18n for Events List
    225234                $events_list[] = sprintf(
    226                     'Scheduled Time (WP Time): %s | Expected Time: %s | Periods: %s',
     235                    /* translators: 1: WP Time, 2: Expected Time, 3: Periods list */
     236                    __( 'Scheduled Time (WP Time): %1$s | Expected Time: %2$s | Periods: %3$s', 'recordar-for-bluesky' ),
    227237                    esc_html( $scheduled_time_wp ),
    228238                    esc_html( $expected_time ),
     
    470480        if ( 'toplevel_page_recordar-for-bluesky' !== $hook ) return;
    471481
    472         wp_enqueue_style( 'recordar-for-bluesky-admin-style', $this->plugin_url . 'assets/css/recordar-for-bluesky-admin.css', array(), '2.2.0' );
     482        wp_enqueue_style( 'recordar-for-bluesky-admin-style', $this->plugin_url . 'assets/css/recordar-for-bluesky-admin.css', array(), '2.2.1' );
    473483        wp_enqueue_script( 'jquery-ui-sortable' );
    474         wp_enqueue_script( 'recordar-for-bluesky-admin-script', $this->plugin_url . 'assets/js/recordar-for-bluesky-admin.js', array( 'jquery', 'jquery-ui-sortable' ), '2.2.0', true );
     484        wp_enqueue_script( 'recordar-for-bluesky-admin-script', $this->plugin_url . 'assets/js/recordar-for-bluesky-admin.js', array( 'jquery', 'jquery-ui-sortable' ), '2.2.1', true );
    475485       
    476486        wp_localize_script( 'recordar-for-bluesky-admin-script', 'rec_bsky_vars', array(
     
    649659                $tax_msg = taxonomy_exists( 'language' ) ? __( 'according to language filter', 'recordar-for-bluesky' ) : __( 'without language filter', 'recordar-for-bluesky' );
    650660                $query_results_html = '<div id="rec-bsky-search-results-box" class="notice notice-info is-dismissible"><h3>' . sprintf( __( 'Archive Search Results for %s %s:', 'recordar-for-bluesky' ), wp_date( 'd/m/Y', strtotime( $test_date_value ) ), $tax_msg ) . '</h3><ul>';
     661               
     662                // [TASK 2] Updated foreach loop for translations
    651663                foreach ( $posts_found as $post_data ) {
    652664                    $has_image = ! empty( $post_data['image_url'] ) ? '✅' : '❌';
    653665                   
    654666                    $period_val = $post_data['period_raw'];
    655                     if (strpos($period_val, 'm') !== false) {
    656                          $query_results_html .= '<li><strong>ID ' . esc_html( $post_data['id'] ) . '</strong>: ' . esc_html( $period_val ) . 'onths ago: ' . esc_html( $post_data['title'] ) . ' (Image: ' . esc_html( $has_image ) . ')</li>';
     667                    $time_text = '';
     668
     669                    if ( strpos( $period_val, 'm' ) !== false ) {
     670                        $months = intval( $period_val );
     671                        /* translators: %s: number of months */
     672                        $time_text = sprintf( _n( '%s month ago', '%s months ago', $months, 'recordar-for-bluesky' ), $months );
    657673                    } else {
    658                          $query_results_html .= '<li><strong>ID ' . esc_html( $post_data['id'] ) . '</strong>: ' . esc_html( $period_val ) . ' years ago: ' . esc_html( $post_data['title'] ) . ' (Image: ' . esc_html( $has_image ) . ')</li>';
     674                        $years = intval( $period_val );
     675                        /* translators: %s: number of years */
     676                        $time_text = sprintf( _n( '%s year ago', '%s years ago', $years, 'recordar-for-bluesky' ), $years );
    659677                    }
     678
     679                    $query_results_html .= '<li><strong>ID ' . esc_html( $post_data['id'] ) . '</strong>: ' . esc_html( $time_text ) . ': ' . esc_html( $post_data['title'] ) . ' (Image: ' . esc_html( $has_image ) . ')</li>';
    660680                }
     681
    661682                $query_results_html .= '</ul><p>' . __( 'Note: Posts excluded by ID do not appear in this list if the ID is correct.', 'recordar-for-bluesky' ) . '</p></div>';
    662683            } else {
     
    685706        ?>
    686707        <div class="wrap">
    687             <h1>Recordar for Bluesky & Mastodon (v2.2.0)</h1>
     708            <h1>Recordar for Bluesky & Mastodon (v2.2.1)</h1>
    688709           
    689710            <?php echo wp_kses_post( $message_status ); ?>
     
    811832                                            $time_value = substr( $item['time'], 0, 5 );
    812833                                            // Status Check logic
    813                                             // Default (no search run yet or map empty)
    814834                                            $status_icon = '<span class="dashicons dashicons-minus" style="color:#ccc;" title="' . esc_attr__('No search performed', 'recordar-for-bluesky') . '"></span>';
    815835                                           
     
    819839                                                    $status_icon = '<span class="dashicons dashicons-yes-alt" style="color:#46b450; font-size: 25px;" title="' . esc_attr__('Content found for this period', 'recordar-for-bluesky') . '"></span>';
    820840                                                } else {
    821                                                     // NOT FOUND (Neutral, not error)
     841                                                    // NOT FOUND
    822842                                                    $status_icon = '<span class="dashicons dashicons-minus" style="color:#a0a5aa; font-size: 25px;" title="' . esc_attr__('No content found for this period', 'recordar-for-bluesky') . '"></span>';
    823843                                                }
  • recordar-for-bluesky/trunk/recordar-for-bluesky.php

    r3421779 r3421791  
    33 * Plugin Name: Recordar for Bluesky & Mastodon
    44 * Description: Automate archive posts (Years & Months) to Bluesky and Mastodon.
    5  * Version: 2.2.0
     5 * Version: 2.2.1
    66 * Author: JRMora
    77 * Text Domain: recordar-for-bluesky
     
    143143    $posts_to_publish = [];
    144144
    145     $log_prefix = "CRON for {$expected_time_string}. Executed at " . wp_date( 'H:i:s' ) . " (Local Blog Time): ";
     145    // [TASK 3A] i18n for Log Prefix
     146    $log_prefix = sprintf(
     147        /* translators: 1: Expected Time, 2: Execution Time */
     148        __( 'CRON for %1$s. Executed at %2$s (Local Blog Time): ', 'recordar-for-bluesky' ),
     149        $expected_time_string,
     150        wp_date( 'H:i:s' )
     151    );
    146152   
    147153    if ( ! empty( $periods_array ) ) {
     
    149155    }
    150156   
    151     $final_log = $log_prefix;
     157    // [TASK 3A] i18n for Log Result
    152158    if ( ! empty( $posts_to_publish ) ) {
    153159        $count = count( $posts_to_publish );
    154         $final_log .= "Success. {$count} posts found to publish.";
     160        /* translators: %s: number of posts found */
     161        $result_text = sprintf( _n( 'Success. %s post found to publish.', 'Success. %s posts found to publish.', $count, 'recordar-for-bluesky' ), $count );
     162        $final_log = $log_prefix . $result_text;
    155163    } else {
    156          $final_log .= "No posts found for ephemeris at this hour.";
     164        $final_log = $log_prefix . __( 'No posts found for ephemeris at this hour.', 'recordar-for-bluesky' );
    157165    }
    158166   
     
    223231                $scheduled_time_wp = wp_date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $timestamp );
    224232               
     233                // [TASK 3B] i18n for Events List
    225234                $events_list[] = sprintf(
    226                     'Scheduled Time (WP Time): %s | Expected Time: %s | Periods: %s',
     235                    /* translators: 1: WP Time, 2: Expected Time, 3: Periods list */
     236                    __( 'Scheduled Time (WP Time): %1$s | Expected Time: %2$s | Periods: %3$s', 'recordar-for-bluesky' ),
    227237                    esc_html( $scheduled_time_wp ),
    228238                    esc_html( $expected_time ),
     
    470480        if ( 'toplevel_page_recordar-for-bluesky' !== $hook ) return;
    471481
    472         wp_enqueue_style( 'recordar-for-bluesky-admin-style', $this->plugin_url . 'assets/css/recordar-for-bluesky-admin.css', array(), '2.2.0' );
     482        wp_enqueue_style( 'recordar-for-bluesky-admin-style', $this->plugin_url . 'assets/css/recordar-for-bluesky-admin.css', array(), '2.2.1' );
    473483        wp_enqueue_script( 'jquery-ui-sortable' );
    474         wp_enqueue_script( 'recordar-for-bluesky-admin-script', $this->plugin_url . 'assets/js/recordar-for-bluesky-admin.js', array( 'jquery', 'jquery-ui-sortable' ), '2.2.0', true );
     484        wp_enqueue_script( 'recordar-for-bluesky-admin-script', $this->plugin_url . 'assets/js/recordar-for-bluesky-admin.js', array( 'jquery', 'jquery-ui-sortable' ), '2.2.1', true );
    475485       
    476486        wp_localize_script( 'recordar-for-bluesky-admin-script', 'rec_bsky_vars', array(
     
    649659                $tax_msg = taxonomy_exists( 'language' ) ? __( 'according to language filter', 'recordar-for-bluesky' ) : __( 'without language filter', 'recordar-for-bluesky' );
    650660                $query_results_html = '<div id="rec-bsky-search-results-box" class="notice notice-info is-dismissible"><h3>' . sprintf( __( 'Archive Search Results for %s %s:', 'recordar-for-bluesky' ), wp_date( 'd/m/Y', strtotime( $test_date_value ) ), $tax_msg ) . '</h3><ul>';
     661               
     662                // [TASK 2] Updated foreach loop for translations
    651663                foreach ( $posts_found as $post_data ) {
    652664                    $has_image = ! empty( $post_data['image_url'] ) ? '✅' : '❌';
    653665                   
    654666                    $period_val = $post_data['period_raw'];
    655                     if (strpos($period_val, 'm') !== false) {
    656                          $query_results_html .= '<li><strong>ID ' . esc_html( $post_data['id'] ) . '</strong>: ' . esc_html( $period_val ) . 'onths ago: ' . esc_html( $post_data['title'] ) . ' (Image: ' . esc_html( $has_image ) . ')</li>';
     667                    $time_text = '';
     668
     669                    if ( strpos( $period_val, 'm' ) !== false ) {
     670                        $months = intval( $period_val );
     671                        /* translators: %s: number of months */
     672                        $time_text = sprintf( _n( '%s month ago', '%s months ago', $months, 'recordar-for-bluesky' ), $months );
    657673                    } else {
    658                          $query_results_html .= '<li><strong>ID ' . esc_html( $post_data['id'] ) . '</strong>: ' . esc_html( $period_val ) . ' years ago: ' . esc_html( $post_data['title'] ) . ' (Image: ' . esc_html( $has_image ) . ')</li>';
     674                        $years = intval( $period_val );
     675                        /* translators: %s: number of years */
     676                        $time_text = sprintf( _n( '%s year ago', '%s years ago', $years, 'recordar-for-bluesky' ), $years );
    659677                    }
     678
     679                    $query_results_html .= '<li><strong>ID ' . esc_html( $post_data['id'] ) . '</strong>: ' . esc_html( $time_text ) . ': ' . esc_html( $post_data['title'] ) . ' (Image: ' . esc_html( $has_image ) . ')</li>';
    660680                }
     681
    661682                $query_results_html .= '</ul><p>' . __( 'Note: Posts excluded by ID do not appear in this list if the ID is correct.', 'recordar-for-bluesky' ) . '</p></div>';
    662683            } else {
     
    685706        ?>
    686707        <div class="wrap">
    687             <h1>Recordar for Bluesky & Mastodon (v2.2.0)</h1>
     708            <h1>Recordar for Bluesky & Mastodon (v2.2.1)</h1>
    688709           
    689710            <?php echo wp_kses_post( $message_status ); ?>
     
    811832                                            $time_value = substr( $item['time'], 0, 5 );
    812833                                            // Status Check logic
    813                                             // Default (no search run yet or map empty)
    814834                                            $status_icon = '<span class="dashicons dashicons-minus" style="color:#ccc;" title="' . esc_attr__('No search performed', 'recordar-for-bluesky') . '"></span>';
    815835                                           
     
    819839                                                    $status_icon = '<span class="dashicons dashicons-yes-alt" style="color:#46b450; font-size: 25px;" title="' . esc_attr__('Content found for this period', 'recordar-for-bluesky') . '"></span>';
    820840                                                } else {
    821                                                     // NOT FOUND (Neutral, not error)
     841                                                    // NOT FOUND
    822842                                                    $status_icon = '<span class="dashicons dashicons-minus" style="color:#a0a5aa; font-size: 25px;" title="' . esc_attr__('No content found for this period', 'recordar-for-bluesky') . '"></span>';
    823843                                                }
Note: See TracChangeset for help on using the changeset viewer.