Changeset 3421791
- Timestamp:
- 12/17/2025 11:01:14 AM (4 months ago)
- Location:
- recordar-for-bluesky
- Files:
-
- 2 edited
-
tags/2.2.1/recordar-for-bluesky.php (modified) (9 diffs)
-
trunk/recordar-for-bluesky.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
recordar-for-bluesky/tags/2.2.1/recordar-for-bluesky.php
r3421779 r3421791 3 3 * Plugin Name: Recordar for Bluesky & Mastodon 4 4 * Description: Automate archive posts (Years & Months) to Bluesky and Mastodon. 5 * Version: 2.2. 05 * Version: 2.2.1 6 6 * Author: JRMora 7 7 * Text Domain: recordar-for-bluesky … … 143 143 $posts_to_publish = []; 144 144 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 ); 146 152 147 153 if ( ! empty( $periods_array ) ) { … … 149 155 } 150 156 151 $final_log = $log_prefix;157 // [TASK 3A] i18n for Log Result 152 158 if ( ! empty( $posts_to_publish ) ) { 153 159 $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; 155 163 } 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' ); 157 165 } 158 166 … … 223 231 $scheduled_time_wp = wp_date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $timestamp ); 224 232 233 // [TASK 3B] i18n for Events List 225 234 $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' ), 227 237 esc_html( $scheduled_time_wp ), 228 238 esc_html( $expected_time ), … … 470 480 if ( 'toplevel_page_recordar-for-bluesky' !== $hook ) return; 471 481 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' ); 473 483 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 ); 475 485 476 486 wp_localize_script( 'recordar-for-bluesky-admin-script', 'rec_bsky_vars', array( … … 649 659 $tax_msg = taxonomy_exists( 'language' ) ? __( 'according to language filter', 'recordar-for-bluesky' ) : __( 'without language filter', 'recordar-for-bluesky' ); 650 660 $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 651 663 foreach ( $posts_found as $post_data ) { 652 664 $has_image = ! empty( $post_data['image_url'] ) ? '✅' : '❌'; 653 665 654 666 $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 ); 657 673 } 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 ); 659 677 } 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>'; 660 680 } 681 661 682 $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>'; 662 683 } else { … … 685 706 ?> 686 707 <div class="wrap"> 687 <h1>Recordar for Bluesky & Mastodon (v2.2. 0)</h1>708 <h1>Recordar for Bluesky & Mastodon (v2.2.1)</h1> 688 709 689 710 <?php echo wp_kses_post( $message_status ); ?> … … 811 832 $time_value = substr( $item['time'], 0, 5 ); 812 833 // Status Check logic 813 // Default (no search run yet or map empty)814 834 $status_icon = '<span class="dashicons dashicons-minus" style="color:#ccc;" title="' . esc_attr__('No search performed', 'recordar-for-bluesky') . '"></span>'; 815 835 … … 819 839 $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>'; 820 840 } else { 821 // NOT FOUND (Neutral, not error)841 // NOT FOUND 822 842 $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>'; 823 843 } -
recordar-for-bluesky/trunk/recordar-for-bluesky.php
r3421779 r3421791 3 3 * Plugin Name: Recordar for Bluesky & Mastodon 4 4 * Description: Automate archive posts (Years & Months) to Bluesky and Mastodon. 5 * Version: 2.2. 05 * Version: 2.2.1 6 6 * Author: JRMora 7 7 * Text Domain: recordar-for-bluesky … … 143 143 $posts_to_publish = []; 144 144 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 ); 146 152 147 153 if ( ! empty( $periods_array ) ) { … … 149 155 } 150 156 151 $final_log = $log_prefix;157 // [TASK 3A] i18n for Log Result 152 158 if ( ! empty( $posts_to_publish ) ) { 153 159 $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; 155 163 } 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' ); 157 165 } 158 166 … … 223 231 $scheduled_time_wp = wp_date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $timestamp ); 224 232 233 // [TASK 3B] i18n for Events List 225 234 $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' ), 227 237 esc_html( $scheduled_time_wp ), 228 238 esc_html( $expected_time ), … … 470 480 if ( 'toplevel_page_recordar-for-bluesky' !== $hook ) return; 471 481 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' ); 473 483 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 ); 475 485 476 486 wp_localize_script( 'recordar-for-bluesky-admin-script', 'rec_bsky_vars', array( … … 649 659 $tax_msg = taxonomy_exists( 'language' ) ? __( 'according to language filter', 'recordar-for-bluesky' ) : __( 'without language filter', 'recordar-for-bluesky' ); 650 660 $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 651 663 foreach ( $posts_found as $post_data ) { 652 664 $has_image = ! empty( $post_data['image_url'] ) ? '✅' : '❌'; 653 665 654 666 $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 ); 657 673 } 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 ); 659 677 } 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>'; 660 680 } 681 661 682 $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>'; 662 683 } else { … … 685 706 ?> 686 707 <div class="wrap"> 687 <h1>Recordar for Bluesky & Mastodon (v2.2. 0)</h1>708 <h1>Recordar for Bluesky & Mastodon (v2.2.1)</h1> 688 709 689 710 <?php echo wp_kses_post( $message_status ); ?> … … 811 832 $time_value = substr( $item['time'], 0, 5 ); 812 833 // Status Check logic 813 // Default (no search run yet or map empty)814 834 $status_icon = '<span class="dashicons dashicons-minus" style="color:#ccc;" title="' . esc_attr__('No search performed', 'recordar-for-bluesky') . '"></span>'; 815 835 … … 819 839 $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>'; 820 840 } else { 821 // NOT FOUND (Neutral, not error)841 // NOT FOUND 822 842 $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>'; 823 843 }
Note: See TracChangeset
for help on using the changeset viewer.