Skip to content

Commit c5def56

Browse files
authored
Remove todos (#54)
* Remove all todos, in support of issues instead * Drop more todos
1 parent 5aa93d7 commit c5def56

File tree

9 files changed

+0
-31
lines changed

9 files changed

+0
-31
lines changed

class-workflow.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,6 @@ public function update_all_module_options( $mod_name, $new_options ) {
294294
* @return array $post_types All of the post types that are 'on'
295295
*/
296296
public function get_supported_post_types(): array {
297-
// ToDo: Move this function to a shared static helper after we've refactored into static modules
298-
299297
$post_types = [];
300298
$post_types_options = $this->settings->module->options->post_types;
301299

modules/custom-status/custom-status.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,6 @@ public function load_styles_for_block_editor() {
297297

298298
/**
299299
* Check whether custom status stuff should be loaded on this page
300-
*
301-
* @todo migrate this to the base module class
302300
*/
303301
public function is_whitelisted_page() {
304302
global $pagenow;
@@ -319,8 +317,6 @@ public function is_whitelisted_page() {
319317

320318
/**
321319
* Adds all necessary javascripts to make custom statuses work
322-
*
323-
* @todo Support private and future posts on edit.php view
324320
*/
325321
public function post_admin_header() {
326322
global $post, $pagenow;
@@ -339,7 +335,6 @@ public function post_admin_header() {
339335

340336
// $selected can be empty, but must be set because it's used as a JS variable
341337
$selected = '';
342-
$selected_name = '';
343338

344339
if ( ! empty( $post ) ) {
345340
// Get the status of the current post
@@ -460,10 +455,6 @@ private function generate_error_and_delete_bad_data( int $term_id, string $meta
460455
return new WP_Error( 'invalid', sprintf( __( 'Unable to create the custom status, as the %s failed to save.', 'vip-workflow' ), $meta ) );
461456
}
462457

463-
// ToDo: Once custom status has been refactored, the below CRUD methods should be unified with the
464-
// ones from Editorial metadata module and turned into a utility class focused on DB operations.
465-
// We could call that utility class ORM or DAO.
466-
467458
/**
468459
* Adds a new custom status as a term in the wp_terms table.
469460
* Basically a wrapper for the wp_insert_term class.
@@ -678,7 +669,6 @@ public function delete_custom_status( int $status_id ): bool|WP_Error {
678669
// Re-order the positions after deletion
679670
$custom_statuses = $this->get_custom_statuses();
680671

681-
// ToDo: Optimize this to only work on the next or previous item.
682672
$current_postition = 1;
683673

684674
// save each status with the new position
@@ -814,8 +804,6 @@ public function reassign_post_status( string $old_status, string $new_status ):
814804
return true;
815805
}
816806

817-
// ToDo: Move all these hacks to a separate class focused on core hacks, that gets init at the top of the file.
818-
819807
/**
820808
* Display our custom post statuses in post listings when needed.
821809
*

modules/custom-status/lib/custom-status.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// ToDo: Refactor to use vanilla JS instead.
21
jQuery( document ).ready( function () {
32
const i18n = window.__vw_localize_custom_status;
43

modules/custom-status/rest/custom-status-endpoint.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ public static function register_routes() {
9292
'required' => true,
9393
'validate_callback' => function ( $param ) {
9494
$term_id = absint( $param );
95-
// ToDo: Switch this to our own method once Custom Status module has been refactored.
9695
$term = get_term( $term_id, Custom_Status::TAXONOMY_KEY );
9796
return ( $term instanceof WP_Term );
9897
},
@@ -141,7 +140,6 @@ public static function register_routes() {
141140
'required' => true,
142141
'validate_callback' => function ( $param ) {
143142
$term_id = absint( $param );
144-
// ToDo: Switch this to our own method once Custom Status module has been refactored.
145143
$term = get_term( $term_id, Custom_Status::TAXONOMY_KEY );
146144
return ( $term instanceof WP_Term );
147145
},
@@ -168,7 +166,6 @@ public static function register_routes() {
168166
// validate each item in the array.
169167
foreach ( $param as $position => $term_id ) {
170168
$term_id = absint( $term_id );
171-
// ToDo: Switch this to our own method once Custom Status module has been refactored.
172169
$term = get_term( $term_id, Custom_Status::TAXONOMY_KEY );
173170
if ( ! $term instanceof WP_Term ) {
174171
return false;
@@ -343,7 +340,6 @@ public static function handle_reorder_status( WP_REST_Request $request ) {
343340
return new WP_Error( 'invalid', 'Status order must be an array.' );
344341
}
345342

346-
// ToDo: Switch this to be a bulk update instead.
347343
foreach ( $status_order as $position => $term_id ) {
348344

349345
// Have to add 1 to the position because the index started with zero
@@ -371,7 +367,6 @@ private static function is_valid_editorial_metadata_ids( $metadata_ids ) {
371367
return true;
372368
}
373369

374-
// ToDo: Optimize this to batch fetch metadata terms, and only include the ID field.
375370
foreach ( $metadata_ids as $metadata_id ) {
376371
$editorial_metadata = EditorialMetadata::get_editorial_metadata_term_by( 'id', $metadata_id );
377372
if ( is_wp_error( $editorial_metadata ) || ! $editorial_metadata ) {

modules/editorial-metadata/rest/editorial-metadata-endpoint.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ public static function handle_update_editorial_metadata( WP_REST_Request $reques
211211
'name' => $editorial_metadata_name,
212212
];
213213

214-
// ToDo: Ensure that we don't do an update when the name, description and type are the same as the current editorial metadata
215214
$update_editorial_metadata_result = EditorialMetadata::update_editorial_metadata_term( $term_id, $args );
216215

217216
// Regardless of an error being thrown, the result will be returned so the client can handle it.
@@ -225,7 +224,6 @@ public static function handle_update_editorial_metadata( WP_REST_Request $reques
225224
*/
226225
public static function handle_delete_editorial_metadata( WP_REST_Request $request ) {
227226
$term_id = $request->get_param( 'id' );
228-
229227
// Check to make sure the editorial metadata exists
230228
$editorial_metadata_by_id = EditorialMetadata::get_editorial_metadata_term_by( 'id', $term_id );
231229
if ( ! $editorial_metadata_by_id ) {

modules/notifications/notifications.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ public static function schedule_emails( string $action, WP_Post $post, string $s
237237
public static function send_emails( array $recipients, string $subject, string $message, string $message_headers = '' ): void {
238238
$response = wp_mail( $recipients, $subject, $message, $message_headers );
239239

240-
// ToDo: Switch to using log2logstash instead of error_log.
241240
if ( ! $response ) {
242241
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
243242
error_log( 'Unable to send notification to email(s) provided.' );
@@ -296,7 +295,6 @@ public static function send_to_webhook( string $message, string $message_type, s
296295
]
297296
);
298297

299-
// ToDo: Switch to using log2logstash instead of error_log.
300298
if ( is_wp_error( $response ) ) {
301299
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
302300
error_log( 'Unable to send notification to webhook provided.' );

modules/settings/settings.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,6 @@ public function helper_option_custom_post_type( $args = array() ) {
175175
* Validate input from the end user
176176
*/
177177
public function settings_validate( $new_options ) {
178-
// ToDo: There's no error messages shown right now, or any kind of notice that data is invalid.
179-
180178
// Whitelist validation for the post type options
181179
if ( ! isset( $new_options['post_types'] ) ) {
182180
$new_options['post_types'] = [];

phpcs.xml.dist

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@
5353
<!-- Localization is done in a legacy manner in some places, and its been left as is for now -->
5454
<exclude name="WordPress.WP.I18n.InterpolatedVariableSingular" />
5555
<exclude name="WordPress.WP.I18n.InterpolatedVariablePlural" />
56-
<exclude name="WordPress.WP.I18n.MissingSingularPlaceholder" />
57-
<exclude name="WordPress.WP.I18n.NonSingularStringLiteralText" />
58-
<!-- This rule is hard to solve given the heavy use of JS in the PHP code right now -->
59-
<exclude name="Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure" />
6056
</rule>
6157

6258
</ruleset>

vip-workflow.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
define( 'VIP_WORKFLOW_LOADED', true );
2424

25-
// ToDo: When 6.4 is our min version, switch to wp_admin_notice.
2625
global $wp_version;
2726
if ( version_compare( phpversion(), '8.0', '<' ) || version_compare( $wp_version, '6.2', '<' ) ) {
2827
add_action( 'admin_notices', function () {

0 commit comments

Comments
 (0)