Changeset 3436721
- Timestamp:
- 01/10/2026 04:27:19 PM (3 months ago)
- Location:
- easy-text-replace
- Files:
-
- 12 edited
- 1 copied
-
tags/1.0.4 (copied) (copied from easy-text-replace/trunk)
-
tags/1.0.4/easy-text-replace.php (modified) (2 diffs)
-
tags/1.0.4/languages/easy-text-replace.pot (modified) (1 diff)
-
tags/1.0.4/readme.txt (modified) (3 diffs)
-
tags/1.0.4/src/Admin/AdminInterface.php (modified) (5 diffs)
-
tags/1.0.4/src/Admin/ReplacementListTable.php (modified) (1 diff)
-
tags/1.0.4/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/easy-text-replace.php (modified) (2 diffs)
-
trunk/languages/easy-text-replace.pot (modified) (1 diff)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/src/Admin/AdminInterface.php (modified) (5 diffs)
-
trunk/src/Admin/ReplacementListTable.php (modified) (1 diff)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easy-text-replace/tags/1.0.4/easy-text-replace.php
r3429459 r3436721 4 4 * Plugin URI: https://wordpress.org/plugins/easy-text-replace/ 5 5 * Description: Lightweight WordPress string replacement plugin that allows administrators to replace strings from themes, plugins, and WordPress core with minimal performance impact. 6 * Version: 1.0. 36 * Version: 1.0.4 7 7 * Author: SH Sajal Chowdhury 8 8 * Author URI: https://easywptools.com … … 21 21 } 22 22 23 define( 'ETRP_VERSION', '1.0. 2' );23 define( 'ETRP_VERSION', '1.0.4' ); 24 24 define( 'ETRP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 25 25 define( 'ETRP_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); -
easy-text-replace/tags/1.0.4/languages/easy-text-replace.pot
r3402755 r3436721 314 314 msgstr[1] "" 315 315 316 #. translators: %d: number of replacements 317 #: src/Admin/AdminInterface.php:720 318 #, php-format 319 msgid "%d replacement deleted." 320 msgid_plural "%d replacements deleted." 321 msgstr[0] "" 322 msgstr[1] "" 323 316 324 #: src/Admin/AdminInterface.php:740 317 325 msgid "Import/Export Replacements" -
easy-text-replace/tags/1.0.4/readme.txt
r3429459 r3436721 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 1.0. 37 Stable tag: 1.0.4 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 468 468 469 469 == Changelog == 470 = 1.0.4 - 2025-01-10 = 471 * Added: Bulk delete functionality - delete multiple replacements at once 472 * Improved: Cleaner admin interface by removing replacement count notice 473 * Enhanced: Better user experience with streamlined replacement management 474 470 475 = 1.0.3 - 2025-12-30 = 471 476 * Update: Compatibility … … 498 503 499 504 == Upgrade Notice == 505 = 1.0.4 = 506 New bulk delete feature and cleaner admin interface for better replacement management. 507 500 508 = 1.0.3 = 501 509 Update compatibility with the WordPress version. -
easy-text-replace/tags/1.0.4/src/Admin/AdminInterface.php
r3420701 r3436721 166 166 $remaining = max( 0, $max_limit - $current_count ); 167 167 168 $count_class = 'notice-info';169 if ( 0 === $remaining ) {170 $count_class = 'notice-error';171 } elseif ( 10 >= $remaining ) {172 $count_class = 'notice-warning';173 }174 175 168 ?> 176 169 <div class="wrap"> … … 191 184 settings_errors( 'etrp_messages' ); 192 185 ?> 193 194 <div class="notice <?php echo esc_attr( $count_class ); ?> inline">195 <p>196 <?php197 printf(198 /* translators: 1: current count, 2: maximum limit, 3: remaining capacity */199 esc_html__( 'Replacements: %1$d / %2$d (Remaining: %3$d)', 'easy-text-replace' ),200 esc_html( $current_count ),201 esc_html( $max_limit ),202 esc_html( $remaining )203 );204 ?>205 <?php if ( 0 === $remaining ) : ?>206 <strong><?php esc_html_e( 'Limit reached! Delete existing replacements to add new ones.', 'easy-text-replace' ); ?></strong>207 <?php endif; ?>208 </p>209 </div>210 186 211 187 <form method="post"> … … 512 488 public function handle_form_submission() { 513 489 // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce verified in individual handlers. 514 if ( ! isset( $_POST['action'] ) ) {490 if ( ! isset( $_POST['action'] ) && ! isset( $_GET['action'] ) ) { 515 491 return; 516 492 } 517 493 494 // Handle GET-based delete action. 495 // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nonce verified in handle_delete_replacement(). 496 if ( isset( $_GET['action'] ) && 'delete' === $_GET['action'] ) { 497 $this->handle_delete_replacement(); 498 return; 499 } 500 518 501 // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce verified in individual handlers. 519 $action = sanitize_text_field( wp_unslash( $_POST['action'] ) );502 $action = isset( $_POST['action'] ) ? sanitize_text_field( wp_unslash( $_POST['action'] ) ) : ''; 520 503 521 504 if ( in_array( $action, array( 'add', 'edit' ), true ) ) { 522 505 $this->handle_save_replacement(); 523 return;524 }525 526 if ( 'delete' === $action ) {527 $this->handle_delete_replacement();528 506 return; 529 507 } … … 533 511 // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce verified in handle_bulk_action(). 534 512 $bulk_action = sanitize_text_field( wp_unslash( $_POST['action2'] ) ); 513 $this->handle_bulk_action( $bulk_action ); 514 } elseif ( isset( $_POST['action'] ) && '-1' !== $_POST['action'] ) { 515 // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce verified in handle_bulk_action(). 516 $bulk_action = sanitize_text_field( wp_unslash( $_POST['action'] ) ); 535 517 $this->handle_bulk_action( $bulk_action ); 536 518 } … … 736 718 _n( '%d replacement disabled.', '%d replacements disabled.', count( $ids ), 'easy-text-replace' ), 737 719 count( $ids ) 720 ), 721 'success' 722 ); 723 } 724 } elseif ( 'bulk-delete' === $bulk_action ) { 725 $deleted_count = 0; 726 foreach ( $ids as $id ) { 727 if ( $this->repository->delete( $id ) ) { 728 $deleted_count++; 729 } 730 } 731 if ( $deleted_count > 0 ) { 732 $this->cache_manager->clear_replacements(); 733 add_settings_error( 734 'etrp_messages', 735 'etrp_bulk_deleted', 736 sprintf( 737 /* translators: %d: number of replacements */ 738 _n( '%d replacement deleted.', '%d replacements deleted.', $deleted_count, 'easy-text-replace' ), 739 $deleted_count 738 740 ), 739 741 'success' -
easy-text-replace/tags/1.0.4/src/Admin/ReplacementListTable.php
r3402755 r3436721 122 122 'bulk-enable' => __( 'Enable', 'easy-text-replace' ), 123 123 'bulk-disable' => __( 'Disable', 'easy-text-replace' ), 124 'bulk-delete' => __( 'Delete', 'easy-text-replace' ), 124 125 ); 125 126 } -
easy-text-replace/tags/1.0.4/vendor/composer/installed.php
r3429459 r3436721 2 2 'root' => array( 3 3 'name' => 'shsajalchowdhury/easy-text-replace', 4 'pretty_version' => '1.0. 3',5 'version' => '1.0. 3.0',6 'reference' => ' ee0dfce7e6dd65e1c01a071be164ee7d0bf11d66',4 'pretty_version' => '1.0.4', 5 'version' => '1.0.4.0', 6 'reference' => '6d23115f69530bc013470b96643ae2b66e641daa', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 21 21 ), 22 22 'shsajalchowdhury/easy-text-replace' => array( 23 'pretty_version' => '1.0. 3',24 'version' => '1.0. 3.0',25 'reference' => ' ee0dfce7e6dd65e1c01a071be164ee7d0bf11d66',23 'pretty_version' => '1.0.4', 24 'version' => '1.0.4.0', 25 'reference' => '6d23115f69530bc013470b96643ae2b66e641daa', 26 26 'type' => 'wordpress-plugin', 27 27 'install_path' => __DIR__ . '/../../', -
easy-text-replace/trunk/easy-text-replace.php
r3429459 r3436721 4 4 * Plugin URI: https://wordpress.org/plugins/easy-text-replace/ 5 5 * Description: Lightweight WordPress string replacement plugin that allows administrators to replace strings from themes, plugins, and WordPress core with minimal performance impact. 6 * Version: 1.0. 36 * Version: 1.0.4 7 7 * Author: SH Sajal Chowdhury 8 8 * Author URI: https://easywptools.com … … 21 21 } 22 22 23 define( 'ETRP_VERSION', '1.0. 2' );23 define( 'ETRP_VERSION', '1.0.4' ); 24 24 define( 'ETRP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 25 25 define( 'ETRP_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); -
easy-text-replace/trunk/languages/easy-text-replace.pot
r3402755 r3436721 314 314 msgstr[1] "" 315 315 316 #. translators: %d: number of replacements 317 #: src/Admin/AdminInterface.php:720 318 #, php-format 319 msgid "%d replacement deleted." 320 msgid_plural "%d replacements deleted." 321 msgstr[0] "" 322 msgstr[1] "" 323 316 324 #: src/Admin/AdminInterface.php:740 317 325 msgid "Import/Export Replacements" -
easy-text-replace/trunk/readme.txt
r3429459 r3436721 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 1.0. 37 Stable tag: 1.0.4 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 468 468 469 469 == Changelog == 470 = 1.0.4 - 2025-01-10 = 471 * Added: Bulk delete functionality - delete multiple replacements at once 472 * Improved: Cleaner admin interface by removing replacement count notice 473 * Enhanced: Better user experience with streamlined replacement management 474 470 475 = 1.0.3 - 2025-12-30 = 471 476 * Update: Compatibility … … 498 503 499 504 == Upgrade Notice == 505 = 1.0.4 = 506 New bulk delete feature and cleaner admin interface for better replacement management. 507 500 508 = 1.0.3 = 501 509 Update compatibility with the WordPress version. -
easy-text-replace/trunk/src/Admin/AdminInterface.php
r3420701 r3436721 166 166 $remaining = max( 0, $max_limit - $current_count ); 167 167 168 $count_class = 'notice-info';169 if ( 0 === $remaining ) {170 $count_class = 'notice-error';171 } elseif ( 10 >= $remaining ) {172 $count_class = 'notice-warning';173 }174 175 168 ?> 176 169 <div class="wrap"> … … 191 184 settings_errors( 'etrp_messages' ); 192 185 ?> 193 194 <div class="notice <?php echo esc_attr( $count_class ); ?> inline">195 <p>196 <?php197 printf(198 /* translators: 1: current count, 2: maximum limit, 3: remaining capacity */199 esc_html__( 'Replacements: %1$d / %2$d (Remaining: %3$d)', 'easy-text-replace' ),200 esc_html( $current_count ),201 esc_html( $max_limit ),202 esc_html( $remaining )203 );204 ?>205 <?php if ( 0 === $remaining ) : ?>206 <strong><?php esc_html_e( 'Limit reached! Delete existing replacements to add new ones.', 'easy-text-replace' ); ?></strong>207 <?php endif; ?>208 </p>209 </div>210 186 211 187 <form method="post"> … … 512 488 public function handle_form_submission() { 513 489 // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce verified in individual handlers. 514 if ( ! isset( $_POST['action'] ) ) {490 if ( ! isset( $_POST['action'] ) && ! isset( $_GET['action'] ) ) { 515 491 return; 516 492 } 517 493 494 // Handle GET-based delete action. 495 // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nonce verified in handle_delete_replacement(). 496 if ( isset( $_GET['action'] ) && 'delete' === $_GET['action'] ) { 497 $this->handle_delete_replacement(); 498 return; 499 } 500 518 501 // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce verified in individual handlers. 519 $action = sanitize_text_field( wp_unslash( $_POST['action'] ) );502 $action = isset( $_POST['action'] ) ? sanitize_text_field( wp_unslash( $_POST['action'] ) ) : ''; 520 503 521 504 if ( in_array( $action, array( 'add', 'edit' ), true ) ) { 522 505 $this->handle_save_replacement(); 523 return;524 }525 526 if ( 'delete' === $action ) {527 $this->handle_delete_replacement();528 506 return; 529 507 } … … 533 511 // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce verified in handle_bulk_action(). 534 512 $bulk_action = sanitize_text_field( wp_unslash( $_POST['action2'] ) ); 513 $this->handle_bulk_action( $bulk_action ); 514 } elseif ( isset( $_POST['action'] ) && '-1' !== $_POST['action'] ) { 515 // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce verified in handle_bulk_action(). 516 $bulk_action = sanitize_text_field( wp_unslash( $_POST['action'] ) ); 535 517 $this->handle_bulk_action( $bulk_action ); 536 518 } … … 736 718 _n( '%d replacement disabled.', '%d replacements disabled.', count( $ids ), 'easy-text-replace' ), 737 719 count( $ids ) 720 ), 721 'success' 722 ); 723 } 724 } elseif ( 'bulk-delete' === $bulk_action ) { 725 $deleted_count = 0; 726 foreach ( $ids as $id ) { 727 if ( $this->repository->delete( $id ) ) { 728 $deleted_count++; 729 } 730 } 731 if ( $deleted_count > 0 ) { 732 $this->cache_manager->clear_replacements(); 733 add_settings_error( 734 'etrp_messages', 735 'etrp_bulk_deleted', 736 sprintf( 737 /* translators: %d: number of replacements */ 738 _n( '%d replacement deleted.', '%d replacements deleted.', $deleted_count, 'easy-text-replace' ), 739 $deleted_count 738 740 ), 739 741 'success' -
easy-text-replace/trunk/src/Admin/ReplacementListTable.php
r3402755 r3436721 122 122 'bulk-enable' => __( 'Enable', 'easy-text-replace' ), 123 123 'bulk-disable' => __( 'Disable', 'easy-text-replace' ), 124 'bulk-delete' => __( 'Delete', 'easy-text-replace' ), 124 125 ); 125 126 } -
easy-text-replace/trunk/vendor/composer/installed.php
r3429459 r3436721 2 2 'root' => array( 3 3 'name' => 'shsajalchowdhury/easy-text-replace', 4 'pretty_version' => '1.0. 3',5 'version' => '1.0. 3.0',6 'reference' => ' ee0dfce7e6dd65e1c01a071be164ee7d0bf11d66',4 'pretty_version' => '1.0.4', 5 'version' => '1.0.4.0', 6 'reference' => '6d23115f69530bc013470b96643ae2b66e641daa', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 21 21 ), 22 22 'shsajalchowdhury/easy-text-replace' => array( 23 'pretty_version' => '1.0. 3',24 'version' => '1.0. 3.0',25 'reference' => ' ee0dfce7e6dd65e1c01a071be164ee7d0bf11d66',23 'pretty_version' => '1.0.4', 24 'version' => '1.0.4.0', 25 'reference' => '6d23115f69530bc013470b96643ae2b66e641daa', 26 26 'type' => 'wordpress-plugin', 27 27 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.