| Conditions | 2 |
| Paths | 2 |
| Total Lines | 112 |
| Code Lines | 83 |
| 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 |
||
| 29 | public function render() { |
||
| 30 | ?> |
||
| 31 | <!-- User Meta box start--> |
||
| 32 | <fieldset class="options"> |
||
| 33 | <h4><?php _e( 'Select the user role whose user meta fields you want to delete', 'bulk-delete' ); ?></h4> |
||
| 34 | |||
| 35 | <table class="optiontable"> |
||
| 36 | <?php $this->render_user_role_dropdown(); ?> |
||
| 37 | </table> |
||
| 38 | |||
| 39 | <h4><?php _e( 'Choose your user 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 user 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" |
||
| 51 | value="true" type="radio" disabled> |
||
| 52 | <label for="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value"><?php echo __( 'Delete based on user meta key name and value', 'bulk-delete' ); ?></label> |
||
| 53 | <span class="bd-um-pro" style="color:red; vertical-align: middle;"> |
||
| 54 | <?php _e( 'Only available in Pro Addon', 'bulk-delete' ); ?> |
||
| 55 | <a href="http://bulkwp.com/addons/bulk-delete-user-meta/?utm_source=wpadmin&utm_campaign=BulkDelete&utm_medium=buynow&utm_content=bd-m-u" target="_blank">Buy now</a> |
||
| 56 | </span> |
||
| 57 | </td> |
||
| 58 | </tr> |
||
| 59 | |||
| 60 | <tr> |
||
| 61 | <td> |
||
| 62 | <label for="smbd_<?php echo esc_attr( $this->field_slug ); ?>_key"><?php _e( 'User Meta Key ', 'bulk-delete' ); ?></label> |
||
| 63 | <input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_key" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_key" placeholder="<?php _e( 'Meta Key', 'bulk-delete' ); ?>"> |
||
| 64 | </td> |
||
| 65 | </tr> |
||
| 66 | </table> |
||
| 67 | <?php |
||
| 68 | /** |
||
| 69 | * Add more fields to the delete user meta field form. |
||
| 70 | * This hook can be used to add more fields to the delete user meta field form. |
||
| 71 | * |
||
| 72 | * @since 5.4 |
||
| 73 | */ |
||
| 74 | do_action( 'bd_delete_user_meta_form' ); |
||
| 75 | ?> |
||
| 76 | <table class="optiontable"> |
||
| 77 | <tr> |
||
| 78 | <td> |
||
| 79 | <h4><?php _e( 'Choose your deletion options', 'bulk-delete' ); ?></h4> |
||
| 80 | </td> |
||
| 81 | </tr> |
||
| 82 | |||
| 83 | <tr> |
||
| 84 | <td> |
||
| 85 | <label> |
||
| 86 | <input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_limit" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_limit" value="true" type="checkbox"> |
||
| 87 | <?php _e( 'Only delete user meta field from first ', 'bulk-delete' ); ?> |
||
| 88 | </label> |
||
| 89 | <input type="text" name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_limit_to" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_limit_to" |
||
| 90 | disabled value="0" maxlength="4" size="4"> |
||
| 91 | <?php _e( 'users.', 'bulk-delete' ); ?> |
||
| 92 | <?php _e( 'Use this option if there are more than 1000 users and the script times out.', 'bulk-delete' ); ?> |
||
| 93 | </td> |
||
| 94 | </tr> |
||
| 95 | |||
| 96 | <tr> |
||
| 97 | <td> |
||
| 98 | <label> |
||
| 99 | <input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_cron" value="false" type="radio" checked="checked"> |
||
| 100 | <?php _e( 'Delete now', 'bulk-delete' ); ?> |
||
| 101 | </label> |
||
| 102 | <label> |
||
| 103 | <input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_cron" value="true" type="radio" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_cron" disabled> |
||
| 104 | <?php _e( 'Schedule', 'bulk-delete' ); ?> |
||
| 105 | </label> |
||
| 106 | <input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_cron_start" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_cron_start" value="now" type="text" disabled> |
||
| 107 | <?php _e( 'repeat ', 'bulk-delete' ); ?> |
||
| 108 | <select name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_cron_freq" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_cron_freq" disabled> |
||
| 109 | <option value="-1"><?php _e( "Don't repeat", 'bulk-delete' ); ?></option> |
||
| 110 | <?php foreach ( wp_get_schedules() as $key => $value ) : ?> |
||
| 111 | <option value="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $value['display'] ); ?></option> |
||
| 112 | <?php endforeach; ?> |
||
| 113 | </select> |
||
| 114 | |||
| 115 | <span class="bd-um-pro" style="color:red"> |
||
| 116 | <?php _e( 'Only available in Pro Addon', 'bulk-delete' ); ?> |
||
| 117 | <a href = "http://bulkwp.com/addons/bulk-delete-user-meta/?utm_source=wpadmin&utm_campaign=BulkDelete&utm_medium=buynow&utm_content=bd-m-u">Buy now</a> |
||
| 118 | </span> |
||
| 119 | </td> |
||
| 120 | </tr> |
||
| 121 | |||
| 122 | <tr> |
||
| 123 | <td scope="row" colspan="2"> |
||
| 124 | <?php |
||
| 125 | _e( 'Enter time in <strong>Y-m-d H:i:s</strong> format or enter <strong>now</strong> to use current time', 'bulk-delete' ); |
||
| 126 | |||
| 127 | $markup = __( 'Want to add new a Cron schedule?', 'bulk-delete' ) . ' ' . |
||
| 128 | '<a href="https://bulkwp.com/docs/add-a-new-cron-schedule/" target="_blank" rel="noopener">' . __( 'Find out how', 'bulk-delete' ) . '</a>'; |
||
| 129 | |||
| 130 | $content = __( 'Learn how to add your desired Cron schedule.', 'bulk-delete' ); |
||
| 131 | echo ' ', bd_generate_help_tooltip( $markup, $content ); |
||
| 132 | ?> |
||
| 133 | </td> |
||
| 134 | </tr> |
||
| 135 | |||
| 136 | </table> |
||
| 137 | </fieldset> |
||
| 138 | |||
| 139 | <?php $this->render_submit_button(); ?> |
||
| 140 | <!-- User Meta box end--> |
||
| 141 | <?php |
||
| 212 |