Changeset 12985 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/class-plugin.php
- Timestamp:
- 11/30/2023 12:23:54 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/class-plugin.php
r12898 r12985 7 7 use GP_Translation; 8 8 use WordPressdotorg\GlotPress\Customizations\CLI\Stats; 9 use WordPressdotorg\GlotPress\Customizations\CLI\Duplicate_Translations; 9 10 use WP_CLI; 10 11 use function WordPressdotorg\Profiles\assign_badge; … … 76 77 add_action( 'wporg_translate_update_contributor_profile_badges', [ $this, 'update_contributor_profile_badges' ] ); 77 78 add_action( 'wporg_translate_update_polyglots_stats', [ $this, 'update_polyglots_stats' ] ); 79 add_action( 'wporg_translate_duplicate_translations', [ $this, 'duplicate_translations' ] ); 78 80 add_action( 'gp_translation_created', array( $this, 'log_translation_source' ) ); 79 81 add_action( 'gp_translation_saved', array( $this, 'log_translation_source' ) ); … … 202 204 wp_schedule_event( time(), 'daily', 'wporg_translate_update_polyglots_stats' ); 203 205 } 206 if ( ! wp_next_scheduled( 'wporg_translate_duplicate_translations' ) ) { 207 wp_schedule_event( time(), 'daily', 'wporg_translate_duplicate_translations' ); 208 } 204 209 } 205 210 … … 253 258 $stats = new Stats(); 254 259 $stats(); 260 } 261 262 /** 263 * Detects duplicate translations in the database in "current" status and sends a notification to Slack. 264 * 265 * @return void 266 */ 267 public function duplicate_translations() { 268 $duplicates = new Duplicate_Translations(); 269 $duplicates( false, true, false, false ); 255 270 } 256 271 … … 605 620 */ 606 621 public function register_cli_commands() { 622 WP_CLI::add_command( 'wporg-translate duplicate-translations', __NAMESPACE__ . '\CLI\Duplicate_Translations_CLI', $args = [] ); 607 623 WP_CLI::add_command( 'wporg-translate init-locale', __NAMESPACE__ . '\CLI\Init_Locale' ); 608 624 WP_CLI::add_command( 'wporg-translate language-pack', __NAMESPACE__ . '\CLI\Language_Pack' );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)