| Conditions | 2 |
| Paths | 2 |
| Total Lines | 207 |
| Code Lines | 129 |
| 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 |
||
| 11 | function jetpack_get_module_i18n( $key ) { |
||
| 12 | static $modules; |
||
| 13 | if ( ! isset( $modules ) ) { |
||
| 14 | $modules = array( |
||
| 15 | 'after-the-deadline' => array( |
||
| 16 | 'name' => _x( 'Spelling and Grammar', 'Module Name', 'jetpack' ), |
||
| 17 | 'description' => _x( 'Check your spelling, style, and grammar.', 'Module Description', 'jetpack' ), |
||
| 18 | ), |
||
| 19 | |||
| 20 | 'carousel' => array( |
||
| 21 | 'name' => _x( 'Carousel', 'Module Name', 'jetpack' ), |
||
| 22 | 'description' => _x( 'Transform image galleries into gorgeous, full-screen slideshows.', 'Module Description', 'jetpack' ), |
||
| 23 | 'recommended description' => _x( 'Brings your photos and images to life as full-size, easily navigable galleries.', 'Jumpstart Description', 'jetpack' ), |
||
| 24 | ), |
||
| 25 | |||
| 26 | 'comments' => array( |
||
| 27 | 'name' => _x( 'Comments', 'Module Name', 'jetpack' ), |
||
| 28 | 'description' => _x( 'Allow comments with WordPress.com, Twitter, Facebook, or Google+.', 'Module Description', 'jetpack' ), |
||
| 29 | ), |
||
| 30 | |||
| 31 | 'contact-form' => array( |
||
| 32 | 'name' => _x( 'Contact Form', 'Module Name', 'jetpack' ), |
||
| 33 | 'description' => _x( 'Insert a customizable contact form anywhere on your site.', 'Module Description', 'jetpack' ), |
||
| 34 | 'recommended description' => _x( 'Adds a button to your post and page editors, allowing you to build simple forms to help visitors stay in touch.', 'Jumpstart Description', 'jetpack' ), |
||
| 35 | ), |
||
| 36 | |||
| 37 | 'custom-content-types' => array( |
||
| 38 | 'name' => _x( 'Custom Content Types', 'Module Name', 'jetpack' ), |
||
| 39 | 'description' => _x( 'Organize and display different types of content on your site.', 'Module Description', 'jetpack' ), |
||
| 40 | ), |
||
| 41 | |||
| 42 | 'custom-css' => array( |
||
| 43 | 'name' => _x( 'Custom CSS', 'Module Name', 'jetpack' ), |
||
| 44 | 'description' => _x( 'Tweak your site’s CSS without modifying your theme.', 'Module Description', 'jetpack' ), |
||
| 45 | ), |
||
| 46 | |||
| 47 | 'enhanced-distribution' => array( |
||
| 48 | 'name' => _x( 'Enhanced Distribution', 'Module Name', 'jetpack' ), |
||
| 49 | 'description' => _x( 'Increase reach and traffic.', 'Module Description', 'jetpack' ), |
||
| 50 | ), |
||
| 51 | |||
| 52 | 'gravatar-hovercards' => array( |
||
| 53 | 'name' => _x( 'Gravatar Hovercards', 'Module Name', 'jetpack' ), |
||
| 54 | 'description' => _x( 'Enable pop-up business cards over commenters’ Gravatars.', 'Module Description', 'jetpack' ), |
||
| 55 | 'recommended description' => _x( 'Let commenters link their profiles to their Gravatar accounts, making it easy for your visitors to learn more about your community.', 'Jumpstart Description', 'jetpack' ), |
||
| 56 | ), |
||
| 57 | |||
| 58 | 'infinite-scroll' => array( |
||
| 59 | 'name' => _x( 'Infinite Scroll', 'Module Name', 'jetpack' ), |
||
| 60 | 'description' => _x( 'Automatically load new content when a visitor scrolls.', 'Module Description', 'jetpack' ), |
||
| 61 | ), |
||
| 62 | |||
| 63 | 'json-api' => array( |
||
| 64 | 'name' => _x( 'JSON API', 'Module Name', 'jetpack' ), |
||
| 65 | 'description' => _x( 'Allow applications to securely access your content.', 'Module Description', 'jetpack' ), |
||
| 66 | ), |
||
| 67 | |||
| 68 | 'latex' => array( |
||
| 69 | 'name' => _x( 'Beautiful Math', 'Module Name', 'jetpack' ), |
||
| 70 | 'description' => _x( 'Use LaTeX markup for complex equations and other geekery.', 'Module Description', 'jetpack' ), |
||
| 71 | ), |
||
| 72 | |||
| 73 | 'likes' => array( |
||
| 74 | 'name' => _x( 'Likes', 'Module Name', 'jetpack' ), |
||
| 75 | 'description' => _x( 'Give visitors an easy way to show they appreciate your content.', 'Module Description', 'jetpack' ), |
||
| 76 | ), |
||
| 77 | |||
| 78 | 'manage' => array( |
||
| 79 | 'name' => _x( 'Manage', 'Module Name', 'jetpack' ), |
||
| 80 | 'description' => _x( 'Manage all of your sites from a centralized dashboard.', 'Module Description', 'jetpack' ), |
||
| 81 | 'recommended description' => _x( 'Helps you remotely manage plugins, turn on automated updates, and more from <a href="https://wordpress.com/plugins/" target="_blank">wordpress.com</a>.', 'Jumpstart Description', 'jetpack' ), |
||
| 82 | ), |
||
| 83 | |||
| 84 | 'markdown' => array( |
||
| 85 | 'name' => _x( 'Markdown', 'Module Name', 'jetpack' ), |
||
| 86 | 'description' => _x( 'Write posts or pages in plain-text Markdown syntax.', 'Module Description', 'jetpack' ), |
||
| 87 | ), |
||
| 88 | |||
| 89 | 'minileven' => array( |
||
| 90 | 'name' => _x( 'Mobile Theme', 'Module Name', 'jetpack' ), |
||
| 91 | 'description' => _x( 'Optimize your site for smartphones and tablets.', 'Module Description', 'jetpack' ), |
||
| 92 | ), |
||
| 93 | |||
| 94 | 'monitor' => array( |
||
| 95 | 'name' => _x( 'Monitor', 'Module Name', 'jetpack' ), |
||
| 96 | 'description' => _x( 'Receive immediate notifications if your site goes down, 24/7.', 'Module Description', 'jetpack' ), |
||
| 97 | ), |
||
| 98 | |||
| 99 | 'notes' => array( |
||
| 100 | 'name' => _x( 'Notifications', 'Module Name', 'jetpack' ), |
||
| 101 | 'description' => _x( 'Receive instant notifications of site comments and likes.', 'Module Description', 'jetpack' ), |
||
| 102 | ), |
||
| 103 | |||
| 104 | 'omnisearch' => array( |
||
| 105 | 'name' => _x( 'Omnisearch', 'Module Name', 'jetpack' ), |
||
| 106 | 'description' => _x( 'Search your entire database from a single field in your dashboard.', 'Module Description', 'jetpack' ), |
||
| 107 | ), |
||
| 108 | |||
| 109 | 'photon' => array( |
||
| 110 | 'name' => _x( 'Photon', 'Module Name', 'jetpack' ), |
||
| 111 | 'description' => _x( 'Speed up images and photos.', 'Module Description', 'jetpack' ), |
||
| 112 | 'recommended description' => _x( 'Mirrors and serves your images from our free and fast image CDN, improving your site’s performance with no additional load on your servers.', 'Jumpstart Description', 'jetpack' ), |
||
| 113 | ), |
||
| 114 | |||
| 115 | 'post-by-email' => array( |
||
| 116 | 'name' => _x( 'Post by Email', 'Module Name', 'jetpack' ), |
||
| 117 | 'description' => _x( 'Publish posts by sending an email.', 'Module Description', 'jetpack' ), |
||
| 118 | ), |
||
| 119 | |||
| 120 | 'protect' => array( |
||
| 121 | 'name' => _x( 'Protect', 'Module Name', 'jetpack' ), |
||
| 122 | 'description' => _x( 'Prevent and block malicious login attempts.', 'Module Description', 'jetpack' ), |
||
| 123 | ), |
||
| 124 | |||
| 125 | 'publicize' => array( |
||
| 126 | 'name' => _x( 'Publicize', 'Module Name', 'jetpack' ), |
||
| 127 | 'description' => _x( 'Automated social marketing.', 'Module Description', 'jetpack' ), |
||
| 128 | ), |
||
| 129 | |||
| 130 | 'related-posts' => array( |
||
| 131 | 'name' => _x( 'Related Posts', 'Module Name', 'jetpack' ), |
||
| 132 | 'description' => _x( 'Increase page views by showing related content to your visitors.', 'Module Description', 'jetpack' ), |
||
| 133 | 'recommended description' => _x( 'Keep visitors engaged on your blog by highlighting relevant and new content at the bottom of each published post.', 'Jumpstart Description', 'jetpack' ), |
||
| 134 | ), |
||
| 135 | |||
| 136 | 'seo-tools' => array( |
||
| 137 | 'name' => _x( 'SEO tools', 'Module Name', 'jetpack' ), |
||
| 138 | 'description' => _x( 'Better results on search engines and social media.', 'Module Description', 'jetpack' ), |
||
| 139 | 'recommended description' => _x( 'Better results on search engines and social media.', 'Jumpstart Description', 'jetpack' ), |
||
| 140 | ), |
||
| 141 | |||
| 142 | 'sharedaddy' => array( |
||
| 143 | 'name' => _x( 'Sharing', 'Module Name', 'jetpack' ), |
||
| 144 | 'description' => _x( 'Allow visitors to share your content.', 'Module Description', 'jetpack' ), |
||
| 145 | 'recommended description' => _x( 'Twitter, Facebook and Google+ buttons at the bottom of each post, making it easy for visitors to share your content.', 'Jumpstart Description', 'jetpack' ), |
||
| 146 | ), |
||
| 147 | |||
| 148 | 'shortcodes' => array( |
||
| 149 | 'name' => _x( 'Shortcode Embeds', 'Module Name', 'jetpack' ), |
||
| 150 | 'description' => _x( 'Embed media from popular sites without any coding.', 'Module Description', 'jetpack' ), |
||
| 151 | ), |
||
| 152 | |||
| 153 | 'shortlinks' => array( |
||
| 154 | 'name' => _x( 'WP.me Shortlinks', 'Module Name', 'jetpack' ), |
||
| 155 | 'description' => _x( 'Create short and simple links for all posts and pages.', 'Module Description', 'jetpack' ), |
||
| 156 | ), |
||
| 157 | |||
| 158 | 'sitemaps' => array( |
||
| 159 | 'name' => _x( 'Sitemaps', 'Module Name', 'jetpack' ), |
||
| 160 | 'description' => _x( 'Make it easy for search engines to find your site.', 'Module Description', 'jetpack' ), |
||
| 161 | ), |
||
| 162 | |||
| 163 | 'sso' => array( |
||
| 164 | 'name' => _x( 'Single Sign On', 'Module Name', 'jetpack' ), |
||
| 165 | 'description' => _x( 'Secure user authentication with WordPress.com.', 'Module Description', 'jetpack' ), |
||
| 166 | 'recommended description' => _x( 'Lets you log in to all your Jetpack-enabled sites with one click using your WordPress.com account.', 'Jumpstart Description', 'jetpack' ), |
||
| 167 | ), |
||
| 168 | |||
| 169 | 'stats' => array( |
||
| 170 | 'name' => _x( 'Site Stats', 'Module Name', 'jetpack' ), |
||
| 171 | 'description' => _x( 'Collect valuable traffic stats and insights.', 'Module Description', 'jetpack' ), |
||
| 172 | ), |
||
| 173 | |||
| 174 | 'subscriptions' => array( |
||
| 175 | 'name' => _x( 'Subscriptions', 'Module Name', 'jetpack' ), |
||
| 176 | 'description' => _x( 'Notify your readers of new posts and comments by email.', 'Module Description', 'jetpack' ), |
||
| 177 | 'recommended description' => _x( 'Give visitors two easy subscription options — while commenting, or via a separate email subscription widget you can display.', 'Jumpstart Description', 'jetpack' ), |
||
| 178 | ), |
||
| 179 | |||
| 180 | 'tiled-gallery' => array( |
||
| 181 | 'name' => _x( 'Tiled Galleries', 'Module Name', 'jetpack' ), |
||
| 182 | 'description' => _x( 'Display image galleries in a variety of elegant arrangements.', 'Module Description', 'jetpack' ), |
||
| 183 | ), |
||
| 184 | |||
| 185 | 'vaultpress' => array( |
||
| 186 | 'name' => _x( 'Data Backups', 'Module Name', 'jetpack' ), |
||
| 187 | 'description' => _x( 'Off-site backups, security scans, and automatic fixes.', 'Module Description', 'jetpack' ), |
||
| 188 | ), |
||
| 189 | |||
| 190 | 'verification-tools' => array( |
||
| 191 | 'name' => _x( 'Site Verification', 'Module Name', 'jetpack' ), |
||
| 192 | 'description' => _x( 'Establish your site\'s authenticity with external services.', 'Module Description', 'jetpack' ), |
||
| 193 | ), |
||
| 194 | |||
| 195 | 'videopress' => array( |
||
| 196 | 'name' => _x( 'VideoPress', 'Module Name', 'jetpack' ), |
||
| 197 | 'description' => _x( 'Powerful, simple video hosting for WordPress', 'Module Description', 'jetpack' ), |
||
| 198 | ), |
||
| 199 | |||
| 200 | 'widget-visibility' => array( |
||
| 201 | 'name' => _x( 'Widget Visibility', 'Module Name', 'jetpack' ), |
||
| 202 | 'description' => _x( 'Control where widgets appear on your site.', 'Module Description', 'jetpack' ), |
||
| 203 | ), |
||
| 204 | |||
| 205 | 'widgets' => array( |
||
| 206 | 'name' => _x( 'Extra Sidebar Widgets', 'Module Name', 'jetpack' ), |
||
| 207 | 'description' => _x( 'Add images, Twitter streams, and more to your sidebar.', 'Module Description', 'jetpack' ), |
||
| 208 | ), |
||
| 209 | |||
| 210 | 'wordads' => array( |
||
| 211 | 'name' => _x( 'Ads', 'Module Name', 'jetpack' ), |
||
| 212 | 'description' => _x( 'Earn income by allowing Jetpack to insert high quality ads.', 'Module Description', 'jetpack' ), |
||
| 213 | ), |
||
| 214 | ); |
||
| 215 | } |
||
| 216 | return $modules[ $key ]; |
||
| 217 | } |
||
| 218 | /** |
||
| 317 | } |