| Conditions | 1 |
| Paths | 1 |
| Total Lines | 76 |
| Code Lines | 58 |
| 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 |
||
| 62 | * @param string $page_slug Page slug. |
||
| 63 | */ |
||
| 64 | return apply_filters( 'bd_upsell_addons', $addon_upsell_details, $page_slug ); |
||
| 65 | } |
||
| 66 | |||
| 67 | /** |
||
| 68 | * Get default list of upsell add-ons for delete posts page. |
||
| 69 | * |
||
| 70 | * Eventually this will come from a feed. |
||
| 71 | * |
||
| 72 | * @return array List of upsell add-on details. |
||
| 73 | */ |
||
| 74 | protected function get_default_post_upsell_addons() { |
||
| 75 | return array( |
||
| 76 | array( |
||
| 77 | 'name' => 'Bulk Delete Posts by Custom Field', |
||
| 78 | 'description' => 'This addon adds the ability to delete posts based on custom field. This will be really useful, if your plugin or theme uses custom fields to store additional information about a post.', |
||
| 79 | 'slug' => 'bulk-delete-posts-by-custom-field', |
||
| 80 | 'url' => 'https://bulkwp.com/addons/bulk-delete-posts-by-custom-field/?utm_campaign=Upsell&utm_medium=wp-admin&utm_source=upsell-module&utm_content=bd-cf', |
||
| 81 | 'buy_url' => '', |
||
| 82 | 'upsell_title' => 'Want to delete Posts based on Custom Field (Post Meta)?', |
||
| 83 | 'upsell_message' => '<strong>Bulk Delete Posts by Custom Field</strong> add-on allows you to delete posts based on custom field (also known as post meta).', |
||
| 84 | ), |
||
| 85 | array( |
||
| 86 | 'name' => 'Bulk Delete Posts by Title', |
||
| 87 | 'description' => 'This addon adds the ability to delete posts based on title.', |
||
| 88 | 'slug' => 'bulk-delete-posts-by-title', |
||
| 89 | 'url' => 'https://bulkwp.com/addons/bulk-delete-posts-by-title/?utm_campaign=Upsell&utm_medium=wp-admin&utm_source=upsell-module&utm_content=bd-ti', |
||
| 90 | 'buy_url' => '', |
||
| 91 | 'upsell_title' => 'Want to delete Posts based on title?', |
||
| 92 | 'upsell_message' => '<strong>Bulk Delete Posts by Title</strong> add-on allows you to delete posts based on title.', |
||
| 93 | ), |
||
| 94 | array( |
||
| 95 | 'name' => 'Bulk Delete Posts by Duplicate Title', |
||
| 96 | 'description' => 'This addon adds the ability to delete posts based on duplicate title.', |
||
| 97 | 'slug' => 'bulk-delete-posts-by-duplicate-title', |
||
| 98 | 'url' => 'https://bulkwp.com/addons/bulk-delete-posts-by-duplicate-title/?utm_campaign=Upsell&utm_medium=wp-admin&utm_source=upsell-module&utm_content=bd-dti', |
||
| 99 | 'buy_url' => '', |
||
| 100 | 'upsell_title' => 'Want to delete Posts that have duplicate titles?', |
||
| 101 | 'upsell_message' => '<strong>Bulk Delete Posts by Duplicate Title</strong> add-on allows you to delete posts that have duplicate title.', |
||
| 102 | ), |
||
| 103 | array( |
||
| 104 | 'name' => 'Bulk Delete Posts by Content', |
||
| 105 | 'description' => 'This addon adds the ability to delete posts based on content.', |
||
| 106 | 'slug' => 'bulk-delete-posts-by-content', |
||
| 107 | 'url' => 'https://bulkwp.com/addons/bulk-delete-posts-by-content/?utm_campaign=Upsell&utm_medium=wp-admin&utm_source=upsell-module&utm_content=bd-p-co', |
||
| 108 | 'buy_url' => '', |
||
| 109 | 'upsell_title' => 'Want to delete Posts based on the post content?', |
||
| 110 | 'upsell_message' => '<strong>Bulk Delete Posts by Content</strong> add-on allows you to delete posts based on its post content.', |
||
| 111 | ), |
||
| 112 | array( |
||
| 113 | 'name' => 'Bulk Delete Posts by User', |
||
| 114 | 'description' => 'This addon adds the ability to delete posts based on the author who created the post.', |
||
| 115 | 'slug' => 'bulk-delete-posts-by-user', |
||
| 116 | 'url' => 'https://bulkwp.com/addons/bulk-delete-posts-by-user/?utm_campaign=Upsell&utm_medium=wp-admin&utm_source=upsell-module&utm_content=bd-p-u', |
||
| 117 | 'buy_url' => '', |
||
| 118 | 'upsell_title' => 'Want to delete Posts based on the user who created it?', |
||
| 119 | 'upsell_message' => '<strong>Bulk Delete Posts by User</strong> add-on allows you to delete posts based on user who created the post.', |
||
| 120 | ), |
||
| 121 | array( |
||
| 122 | 'name' => 'Bulk Delete Posts by Attachment', |
||
| 123 | 'description' => 'This addon adds the ability to delete posts based on attachment.', |
||
| 124 | 'slug' => 'bulk-delete-posts-by-attachment', |
||
| 125 | 'url' => 'https://bulkwp.com/addons/bulk-delete-posts-by-attachment/?utm_campaign=Upsell&utm_medium=wp-admin&utm_source=upsell-module&utm_content=bd-p-at', |
||
| 126 | 'buy_url' => '', |
||
| 127 | 'upsell_title' => 'Want to delete Posts based on whether it has an attachment?', |
||
| 128 | 'upsell_message' => "<strong>Bulk Delete Posts by Attachment</strong> add-on allows you to delete posts based on whether a post contains (or doesn't contain) an attachment.", |
||
| 129 | ), |
||
| 130 | array( |
||
| 131 | 'name' => 'Bulk Delete From Trash', |
||
| 132 | 'description' => 'This addon adds the ability to delete posts or pages from trash.', |
||
| 133 | 'slug' => 'bulk-delete-from-trash', |
||
| 134 | 'url' => 'https://bulkwp.com/addons/bulk-delete-from-trash/?utm_campaign=Upsell&utm_medium=wp-admin&utm_source=upsell-module&utm_content=bd-th', |
||
| 135 | 'buy_url' => '', |
||
| 136 | 'upsell_title' => 'Want to delete Posts that are in trash?', |
||
| 137 | 'upsell_message' => '<strong>Bulk Delete From Trash</strong> add-on allows you to delete posts that are in trash.', |
||
| 138 | ), |
||
| 163 |