| Conditions | 1 |
| Paths | 1 |
| Total Lines | 61 |
| Code Lines | 25 |
| 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 |
||
| 28 | public function render() { |
||
| 29 | $pages_count = wp_count_posts( 'page' ); |
||
| 30 | $pages = $pages_count->publish; |
||
| 31 | $page_drafts = $pages_count->draft; |
||
| 32 | $page_future = $pages_count->future; |
||
| 33 | $page_pending = $pages_count->pending; |
||
| 34 | $page_private = $pages_count->private; |
||
| 35 | ?> |
||
| 36 | <!-- Pages start--> |
||
| 37 | <h4><?php _e( 'Select the status from which you want to delete pages', 'bulk-delete' ); ?></h4> |
||
| 38 | |||
| 39 | <fieldset class="options"> |
||
| 40 | <table class="optiontable"> |
||
| 41 | <tr> |
||
| 42 | <td> |
||
| 43 | <input name="smbd_published_pages" value="published_pages" type="checkbox"> |
||
| 44 | <label for="smbd_published_pages"><?php _e( 'All Published Pages', 'bulk-delete' ); ?> (<?php echo $pages . ' '; _e( 'Pages', 'bulk-delete' ); ?>)</label> |
||
| 45 | </td> |
||
| 46 | </tr> |
||
| 47 | |||
| 48 | <tr> |
||
| 49 | <td> |
||
| 50 | <input name="smbd_draft_pages" value="draft_pages" type="checkbox"> |
||
| 51 | <label for="smbd_draft_pages"><?php _e( 'All Draft Pages', 'bulk-delete' ); ?> (<?php echo $page_drafts . ' '; _e( 'Pages', 'bulk-delete' ); ?>)</label> |
||
| 52 | </td> |
||
| 53 | </tr> |
||
| 54 | |||
| 55 | <tr> |
||
| 56 | <td> |
||
| 57 | <input name="smbd_future_pages" value="scheduled_pages" type="checkbox"> |
||
| 58 | <label for="smbd_future_pages"><?php _e( 'All Scheduled Pages', 'bulk-delete' ); ?> (<?php echo $page_future . ' '; _e( 'Pages', 'bulk-delete' ); ?>)</label> |
||
| 59 | </td> |
||
| 60 | </tr> |
||
| 61 | |||
| 62 | <tr> |
||
| 63 | <td> |
||
| 64 | <input name="smbd_pending_pages" value="pending_pages" type="checkbox"> |
||
| 65 | <label for="smbd_pending_pages"><?php _e( 'All Pending Pages', 'bulk-delete' ); ?> (<?php echo $page_pending . ' '; _e( 'Pages', 'bulk-delete' ); ?>)</label> |
||
| 66 | </td> |
||
| 67 | </tr> |
||
| 68 | |||
| 69 | <tr> |
||
| 70 | <td> |
||
| 71 | <input name="smbd_private_pages" value="private_pages" type="checkbox"> |
||
| 72 | <label for="smbd_private_pages"><?php _e( 'All Private Pages', 'bulk-delete' ); ?> (<?php echo $page_private . ' '; _e( 'Pages', 'bulk-delete' ); ?>)</label> |
||
| 73 | </td> |
||
| 74 | </tr> |
||
| 75 | </table> |
||
| 76 | |||
| 77 | <table class="optiontable"> |
||
| 78 | <?php |
||
| 79 | $this->render_filtering_table_header(); |
||
| 80 | $this->render_restrict_settings(); |
||
| 81 | $this->render_delete_settings(); |
||
| 82 | $this->render_limit_settings(); |
||
| 83 | $this->render_cron_settings(); |
||
| 84 | ?> |
||
| 85 | </table> |
||
| 86 | </fieldset> |
||
| 87 | <?php |
||
| 88 | $this->render_submit_button(); |
||
| 89 | } |
||
| 142 |