| Conditions | 1 |
| Paths | 1 |
| Total Lines | 61 |
| Code Lines | 34 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 30 | public function render() { |
||
| 31 | ?> |
||
| 32 | <!-- Comment Meta box start--> |
||
| 33 | <fieldset class="options"> |
||
| 34 | <h4><?php _e( 'Select the post type whose comment meta fields you want to delete', 'bulk-delete' ); ?></h4> |
||
| 35 | <table class="optiontable"> |
||
| 36 | <?php $this->render_post_type_as_radios(); ?> |
||
| 37 | </table> |
||
| 38 | |||
| 39 | <h4><?php _e( 'Choose your comment meta field settings', 'bulk-delete' ); ?></h4> |
||
| 40 | <table class="optiontable"> |
||
| 41 | <tr> |
||
| 42 | <td> |
||
| 43 | <input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value" value="false" type="radio" checked> |
||
| 44 | <label for="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value"><?php echo __( 'Delete based on comment meta key name only', 'bulk-delete' ); ?></label> |
||
| 45 | </td> |
||
| 46 | </tr> |
||
| 47 | |||
| 48 | <tr> |
||
| 49 | <td> |
||
| 50 | <input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value" value="true" type="radio" disabled> |
||
| 51 | <label for="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value"><?php echo __( 'Delete based on comment meta key name and value', 'bulk-delete' ); ?></label> |
||
| 52 | <span class="bd-cm-pro" style="color:red; vertical-align: middle;"> |
||
| 53 | <?php _e( 'Only available in Pro Addon', 'bulk-delete' ); ?> <a href = "http://bulkwp.com/addons/bulk-delete-comment-meta/?utm_source=wpadmin&utm_campaign=BulkDelete&utm_medium=buynow&utm_content=bd-m-c" target="_blank">Buy now</a> |
||
| 54 | </span> |
||
| 55 | </td> |
||
| 56 | </tr> |
||
| 57 | |||
| 58 | <tr> |
||
| 59 | <td> |
||
| 60 | <label for="smbd_<?php echo esc_attr( $this->field_slug ); ?>_meta_key"><?php _e( 'Comment Meta Key ', 'bulk-delete' ); ?></label> |
||
| 61 | <input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_meta_key" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_meta_key" placeholder="<?php _e( 'Meta Key', 'bulk-delete' ); ?>"> |
||
| 62 | </td> |
||
| 63 | </tr> |
||
| 64 | </table> |
||
| 65 | |||
| 66 | <?php |
||
| 67 | /** |
||
| 68 | * Add more fields to the delete comment meta field form. |
||
| 69 | * This hook can be used to add more fields to the delete comment meta field form. |
||
| 70 | * |
||
| 71 | * @since 5.4 |
||
| 72 | */ |
||
| 73 | do_action( 'bd_delete_comment_meta_form' ); |
||
| 74 | ?> |
||
| 75 | <table class="optiontable"> |
||
| 76 | <tr> |
||
| 77 | <td colspan="2"> |
||
| 78 | <h4><?php _e( 'Choose your deletion options', 'bulk-delete' ); ?></h4> |
||
| 79 | </td> |
||
| 80 | </tr> |
||
| 81 | |||
| 82 | <?php $this->render_restrict_settings(); ?> |
||
| 83 | <?php $this->render_limit_settings(); ?> |
||
| 84 | <?php $this->render_cron_settings(); ?> |
||
| 85 | |||
| 86 | </table> |
||
| 87 | </fieldset> |
||
| 88 | |||
| 89 | <?php $this->render_submit_button(); ?> |
||
| 90 | |||
| 91 | <!-- Comment Meta box end--> |
||
| 158 |