Changeset 3493744
- Timestamp:
- 03/29/2026 08:38:49 AM (3 days ago)
- Location:
- plugiva-pulse
- Files:
-
- 11 edited
- 10 copied
-
tags/1.1.0 (copied) (copied from plugiva-pulse/trunk)
-
tags/1.1.0/admin (copied) (copied from plugiva-pulse/trunk/admin)
-
tags/1.1.0/admin/class-admin.php (modified) (1 diff)
-
tags/1.1.0/admin/class-responses-page.php (modified) (1 diff)
-
tags/1.1.0/admin/class-responses-table.php (modified) (2 diffs)
-
tags/1.1.0/assets (copied) (copied from plugiva-pulse/trunk/assets)
-
tags/1.1.0/blocks (copied) (copied from plugiva-pulse/trunk/blocks)
-
tags/1.1.0/includes (copied) (copied from plugiva-pulse/trunk/includes)
-
tags/1.1.0/includes/class-pulses.php (modified) (1 diff)
-
tags/1.1.0/languages (copied) (copied from plugiva-pulse/trunk/languages)
-
tags/1.1.0/license.txt (copied) (copied from plugiva-pulse/trunk/license.txt)
-
tags/1.1.0/plugiva-pulse.php (copied) (copied from plugiva-pulse/trunk/plugiva-pulse.php) (2 diffs)
-
tags/1.1.0/readme.txt (copied) (copied from plugiva-pulse/trunk/readme.txt) (3 diffs)
-
tags/1.1.0/uninstall.php (copied) (copied from plugiva-pulse/trunk/uninstall.php) (1 diff)
-
trunk/admin/class-admin.php (modified) (1 diff)
-
trunk/admin/class-responses-page.php (modified) (1 diff)
-
trunk/admin/class-responses-table.php (modified) (2 diffs)
-
trunk/includes/class-pulses.php (modified) (1 diff)
-
trunk/plugiva-pulse.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
plugiva-pulse/tags/1.1.0/admin/class-admin.php
r3464907 r3493744 15 15 Pulses_Page::init(); 16 16 Responses_Page::init(); 17 18 // @since 1.1.0 19 add_action( 'admin_menu', [ __CLASS__, 'maybe_add_responses_bubble' ], 99 ); 20 add_action( 'admin_head', [ __CLASS__, 'add_admin_styles' ] ); 17 21 } 22 23 /** 24 * Maybe add responses bubble to admin menu. 25 * 26 * @return void 27 * @since 1.1.0 28 */ 29 public static function maybe_add_responses_bubble(): void { 30 31 // Get last seen (or fallback to now) 32 $last_seen = get_option( 'ppls_last_seen_responses', '' ); 33 34 if ( empty( $last_seen ) ) { 35 // $last_seen = current_time( 'mysql' ); 36 $last_seen = '2000-01-01 00:00:00'; 37 } 38 39 // Get new responses count 40 $count = \Plugiva\Pulse\Pulses::get_new_responses_count( $last_seen ); 41 42 if ( $count <= 0 ) { 43 return; 44 } 45 46 global $menu; 47 48 foreach ( $menu as $key => $item ) { 49 50 if ( isset( $item[2] ) && $item[2] === 'ppls-pulses' ) { 51 52 $menu[$key][0] .= ' <span class="update-plugins count-' . esc_attr( $count ) . '"> 53 <span class="plugin-count">' . esc_html( $count ) . '</span> 54 </span>'; 55 56 break; 57 } 58 } 59 } 60 61 /** 62 * Add admin styles. 63 * 64 * @return void 65 * @since 1.1.0 66 */ 67 public static function add_admin_styles(): void { 68 ?> 69 <style> 70 .wp-list-table.responses > tbody > tr.ppls-row-new { 71 background-color: #fff8e5; 72 } 73 </style> 74 <?php 75 } 76 18 77 } -
plugiva-pulse/tags/1.1.0/admin/class-responses-page.php
r3464907 r3493744 31 31 $table = new Responses_Table(); 32 32 $table->prepare_items(); 33 34 // Mark responses as seen AFTER rendering logic. 35 // @since 1.1.0 36 update_option( 'ppls_last_seen_responses', current_time( 'mysql' ) ); 33 37 34 38 require PPLS_PATH . 'admin/views/responses-page.php'; -
plugiva-pulse/tags/1.1.0/admin/class-responses-table.php
r3464907 r3493744 21 21 */ 22 22 private const TABLE = 'ppls_responses'; 23 24 /** 25 * Last seen datetime. 26 * 27 * @var string 28 * @since 1.1.0 29 */ 30 protected $last_seen; 23 31 24 32 /** … … 33 41 ] 34 42 ); 43 44 // update the responses seen option 45 // @since 1.1.0 46 $this->last_seen = get_option( 'ppls_last_seen_responses', '' ); 47 48 if ( empty( $this->last_seen ) ) { 49 $this->last_seen = current_time( 'mysql' ); 50 } 51 } 52 53 /** 54 * Render a single row. 55 * 56 * @param array $item 57 * @return void 58 * @since 1.1.0 59 */ 60 public function single_row( $item ) { 61 62 $created_at = $item['created_at'] ?? ''; 63 64 $is_new = ( ! empty( $created_at ) && $created_at > $this->last_seen ); 65 66 $class = $is_new ? 'ppls-row-new' : ''; 67 68 echo '<tr class="' . esc_attr( $class ) . '">'; 69 $this->single_row_columns( $item ); 70 echo '</tr>'; 35 71 } 36 72 -
plugiva-pulse/tags/1.1.0/includes/class-pulses.php
r3464907 r3493744 15 15 16 16 const OPTION_KEY = 'ppls_pulses'; 17 18 /** 19 * Get count of new responses since last seen datetime. 20 * 21 * @param string $last_seen MySQL datetime string. 22 * @return int 23 * @since 1.1.0 24 */ 25 public static function get_new_responses_count( string $last_seen ): int { 26 global $wpdb; 27 28 $table = $wpdb->prefix . 'ppls_responses'; 29 30 return (int) $wpdb->get_var( 31 $wpdb->prepare( 32 "SELECT COUNT(*) FROM {$table} WHERE created_at > %s", 33 $last_seen 34 ) 35 ); 36 } 37 17 38 18 39 /** -
plugiva-pulse/tags/1.1.0/plugiva-pulse.php
r3464907 r3493744 3 3 * Plugin Name: Plugiva Pulse 4 4 * Description: Create lightweight feedback forms and quick polls with yes/no, emoji, and text responses inside WordPress. 5 * Version: 1. 0.05 * Version: 1.1.0 6 6 * Author: Plugiva 7 7 * Author URI: https://plugiva.com … … 16 16 } 17 17 18 define( 'PPLS_VERSION', '1. 0.0' );18 define( 'PPLS_VERSION', '1.1.0' ); 19 19 define( 'PPLS_PATH', plugin_dir_path( __FILE__ ) ); 20 20 define( 'PPLS_URL', plugin_dir_url( __FILE__ ) ); -
plugiva-pulse/tags/1.1.0/readme.txt
r3464907 r3493744 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 1. 0.07 Stable tag: 1.1.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 26 26 * Admin responses table with pagination 27 27 * Bulk delete responses 28 * See new responses instantly with admin notification bubble 28 29 * CSV export of collected responses 29 30 * Clean uninstall (optional data removal) … … 79 80 == Changelog == 80 81 82 = 1.1.0 = 83 * New: Admin "New Responses" bubble in menu 84 * New: Highlight new responses in admin table 85 * Improved: Better visibility of incoming feedback 86 81 87 = 1.0.0 = 82 88 * Initial release -
plugiva-pulse/tags/1.1.0/uninstall.php
r3464907 r3493744 28 28 delete_option( 'ppls_pulses' ); 29 29 delete_option( 'ppls_cleanup_on_uninstall' ); 30 // @since 1.1.0 31 delete_option( 'ppls_last_seen_responses' ); -
plugiva-pulse/trunk/admin/class-admin.php
r3464907 r3493744 15 15 Pulses_Page::init(); 16 16 Responses_Page::init(); 17 18 // @since 1.1.0 19 add_action( 'admin_menu', [ __CLASS__, 'maybe_add_responses_bubble' ], 99 ); 20 add_action( 'admin_head', [ __CLASS__, 'add_admin_styles' ] ); 17 21 } 22 23 /** 24 * Maybe add responses bubble to admin menu. 25 * 26 * @return void 27 * @since 1.1.0 28 */ 29 public static function maybe_add_responses_bubble(): void { 30 31 // Get last seen (or fallback to now) 32 $last_seen = get_option( 'ppls_last_seen_responses', '' ); 33 34 if ( empty( $last_seen ) ) { 35 // $last_seen = current_time( 'mysql' ); 36 $last_seen = '2000-01-01 00:00:00'; 37 } 38 39 // Get new responses count 40 $count = \Plugiva\Pulse\Pulses::get_new_responses_count( $last_seen ); 41 42 if ( $count <= 0 ) { 43 return; 44 } 45 46 global $menu; 47 48 foreach ( $menu as $key => $item ) { 49 50 if ( isset( $item[2] ) && $item[2] === 'ppls-pulses' ) { 51 52 $menu[$key][0] .= ' <span class="update-plugins count-' . esc_attr( $count ) . '"> 53 <span class="plugin-count">' . esc_html( $count ) . '</span> 54 </span>'; 55 56 break; 57 } 58 } 59 } 60 61 /** 62 * Add admin styles. 63 * 64 * @return void 65 * @since 1.1.0 66 */ 67 public static function add_admin_styles(): void { 68 ?> 69 <style> 70 .wp-list-table.responses > tbody > tr.ppls-row-new { 71 background-color: #fff8e5; 72 } 73 </style> 74 <?php 75 } 76 18 77 } -
plugiva-pulse/trunk/admin/class-responses-page.php
r3464907 r3493744 31 31 $table = new Responses_Table(); 32 32 $table->prepare_items(); 33 34 // Mark responses as seen AFTER rendering logic. 35 // @since 1.1.0 36 update_option( 'ppls_last_seen_responses', current_time( 'mysql' ) ); 33 37 34 38 require PPLS_PATH . 'admin/views/responses-page.php'; -
plugiva-pulse/trunk/admin/class-responses-table.php
r3464907 r3493744 21 21 */ 22 22 private const TABLE = 'ppls_responses'; 23 24 /** 25 * Last seen datetime. 26 * 27 * @var string 28 * @since 1.1.0 29 */ 30 protected $last_seen; 23 31 24 32 /** … … 33 41 ] 34 42 ); 43 44 // update the responses seen option 45 // @since 1.1.0 46 $this->last_seen = get_option( 'ppls_last_seen_responses', '' ); 47 48 if ( empty( $this->last_seen ) ) { 49 $this->last_seen = current_time( 'mysql' ); 50 } 51 } 52 53 /** 54 * Render a single row. 55 * 56 * @param array $item 57 * @return void 58 * @since 1.1.0 59 */ 60 public function single_row( $item ) { 61 62 $created_at = $item['created_at'] ?? ''; 63 64 $is_new = ( ! empty( $created_at ) && $created_at > $this->last_seen ); 65 66 $class = $is_new ? 'ppls-row-new' : ''; 67 68 echo '<tr class="' . esc_attr( $class ) . '">'; 69 $this->single_row_columns( $item ); 70 echo '</tr>'; 35 71 } 36 72 -
plugiva-pulse/trunk/includes/class-pulses.php
r3464907 r3493744 15 15 16 16 const OPTION_KEY = 'ppls_pulses'; 17 18 /** 19 * Get count of new responses since last seen datetime. 20 * 21 * @param string $last_seen MySQL datetime string. 22 * @return int 23 * @since 1.1.0 24 */ 25 public static function get_new_responses_count( string $last_seen ): int { 26 global $wpdb; 27 28 $table = $wpdb->prefix . 'ppls_responses'; 29 30 return (int) $wpdb->get_var( 31 $wpdb->prepare( 32 "SELECT COUNT(*) FROM {$table} WHERE created_at > %s", 33 $last_seen 34 ) 35 ); 36 } 37 17 38 18 39 /** -
plugiva-pulse/trunk/plugiva-pulse.php
r3464907 r3493744 3 3 * Plugin Name: Plugiva Pulse 4 4 * Description: Create lightweight feedback forms and quick polls with yes/no, emoji, and text responses inside WordPress. 5 * Version: 1. 0.05 * Version: 1.1.0 6 6 * Author: Plugiva 7 7 * Author URI: https://plugiva.com … … 16 16 } 17 17 18 define( 'PPLS_VERSION', '1. 0.0' );18 define( 'PPLS_VERSION', '1.1.0' ); 19 19 define( 'PPLS_PATH', plugin_dir_path( __FILE__ ) ); 20 20 define( 'PPLS_URL', plugin_dir_url( __FILE__ ) ); -
plugiva-pulse/trunk/readme.txt
r3464907 r3493744 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 1. 0.07 Stable tag: 1.1.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 26 26 * Admin responses table with pagination 27 27 * Bulk delete responses 28 * See new responses instantly with admin notification bubble 28 29 * CSV export of collected responses 29 30 * Clean uninstall (optional data removal) … … 79 80 == Changelog == 80 81 82 = 1.1.0 = 83 * New: Admin "New Responses" bubble in menu 84 * New: Highlight new responses in admin table 85 * Improved: Better visibility of incoming feedback 86 81 87 = 1.0.0 = 82 88 * Initial release -
plugiva-pulse/trunk/uninstall.php
r3464907 r3493744 28 28 delete_option( 'ppls_pulses' ); 29 29 delete_option( 'ppls_cleanup_on_uninstall' ); 30 // @since 1.1.0 31 delete_option( 'ppls_last_seen_responses' );
Note: See TracChangeset
for help on using the changeset viewer.