Conditions | 1 |
Paths | 1 |
Total Lines | 105 |
Code Lines | 81 |
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 |
||
34 | private static function get_api_addons() { |
||
35 | $addons = array( |
||
36 | 'formidable-pro' => array( |
||
37 | 'title' => 'Formidable Pro', |
||
38 | 'link' => 'pricing/', |
||
39 | 'docs' => '', |
||
40 | 'file' => 'formidable/pro', |
||
41 | 'excerpt' => 'Enhance your basic Formidable forms with a plethora of Pro field types and features. Create advanced forms and data-driven applications in minutes.', |
||
42 | ), |
||
43 | 'mailchimp' => array( |
||
44 | 'title' => 'MailChimp', |
||
45 | 'excerpt' => 'Get on the path to more sales and leads in a matter of minutes. Add leads to a MailChimp mailing list when they submit forms and update their information along with the entry.', |
||
46 | ), |
||
47 | 'registration' => array( |
||
48 | 'title' => 'User Registration', |
||
49 | 'link' => 'downloads/user-registration/', |
||
50 | 'excerpt' => 'Give new users access to your site as quickly and painlessly as possible. Allow users to register, edit and be able to login to their profiles on your site from the front end in a clean, customized registration form.', |
||
51 | ), |
||
52 | 'paypal' => array( |
||
53 | 'title' => 'PayPal Standard', |
||
54 | 'link' => 'downloads/paypal-standard/', |
||
55 | 'excerpt' => 'Automate your business by collecting instant payments from your clients. Collect information, calculate a total, and send them on to PayPal. Require a payment before publishing content on your site.', |
||
56 | ), |
||
57 | 'stripe' => array( |
||
58 | 'title' => 'Stripe', |
||
59 | 'docs' => 'stripe/', |
||
60 | 'excerpt' => 'Any Formidable forms on your site can accept credit card payments without users ever leaving your site.', |
||
61 | ), |
||
62 | 'authorize-net' => array( |
||
63 | 'title' => 'Authorize.net AIM', |
||
64 | 'link' => 'downloads/authorize-net-aim/', |
||
65 | 'docs' => 'authorize-net-aim/', |
||
66 | 'excerpt' => 'Accept one-time payments directly on your site, using Authorize.net AIM.', |
||
67 | ), |
||
68 | 'woocommerce' => array( |
||
69 | 'title' => 'WooCommerce', |
||
70 | 'excerpt' => 'Use a Formidable form on your WooCommerce product pages.', |
||
71 | ), |
||
72 | 'autoresponder' => array( |
||
73 | 'title' => 'Form Action Automation', |
||
74 | 'docs' => 'schedule-autoresponder/', |
||
75 | 'excerpt' => 'Schedule email notifications, SMS messages, and API actions.', |
||
76 | ), |
||
77 | 'modal' => array( |
||
78 | 'title' => 'Bootstrap Modal', |
||
79 | 'link' => 'downloads/bootstrap-modal/', |
||
80 | 'docs' => 'bootstrap-modal/', |
||
81 | 'excerpt' => 'Open a view or form in a Bootstrap popup.', |
||
82 | ), |
||
83 | 'bootstrap' => array( |
||
84 | 'title' => 'Bootstrap', |
||
85 | 'excerpt' => 'Instantly add Bootstrap styling to all your Formidable forms.', |
||
86 | ), |
||
87 | 'zapier' => array( |
||
88 | 'title' => 'Zapier', |
||
89 | 'excerpt' => 'Connect with hundreds of different applications through Zapier. Insert a new row in a Google docs spreadsheet, post on Twitter, or add a new Dropbox file with your form.', |
||
90 | ), |
||
91 | 'signature' => array( |
||
92 | 'title' => 'Signature', |
||
93 | 'excerpt' => 'Add a signature field to your form. The user may write their signature with a trackpad/mouse or just type it.', |
||
94 | ), |
||
95 | 'api' => array( |
||
96 | 'title' => 'Formidable API', |
||
97 | 'link' => 'downloads/formidable-api/', |
||
98 | 'excerpt' => 'Send entry results to any other site that has a Rest API. This includes the option of sending entries from one Formidable site to another.', |
||
99 | ), |
||
100 | 'twilio' => array( |
||
101 | 'title' => 'Twilio', |
||
102 | 'docs' => 'twilio-add-on/', |
||
103 | 'excerpt' => 'Allow users to text their votes for polls created by Formidable Forms, or send SMS notifications when entries are submitted or updated.', |
||
104 | ), |
||
105 | 'aweber' => array( |
||
106 | 'title' => 'AWeber', |
||
107 | 'excerpt' => 'Subscribe users to an AWeber mailing list when they submit a form. AWeber is a powerful email marketing service.', |
||
108 | ), |
||
109 | 'highrise' => array( |
||
110 | 'title' => 'Highrise', |
||
111 | 'excerpt' => 'Add your leads to your Highrise CRM account any time a Formidable form is submitted.', |
||
112 | ), |
||
113 | 'wpml' => array( |
||
114 | 'title' => 'WP Multilingual', |
||
115 | 'link' => 'downloads/wp-multilingual/', |
||
116 | 'docs' => 'formidable-multi-language/', |
||
117 | 'excerpt' => 'Translate your forms into multiple languages using the Formidable-integrated WPML plugin.', |
||
118 | ), |
||
119 | 'polylang' => array( |
||
120 | 'title' => 'Polylang', |
||
121 | 'excerpt' => 'Create bilingual or multilingual forms with help from Polylang.', |
||
122 | ), |
||
123 | 'math-captcha' => array( |
||
124 | 'title' => 'Math Captcha', |
||
125 | 'excerpt' => 'Require users to perform a simple calculation before submitting a form to prevent spam. This add-on extends BestWebSoft\'s Captcha plugin.', |
||
126 | ), |
||
127 | 'locations' => array( |
||
128 | 'title' => 'Locations', |
||
129 | 'excerpt' => 'Populate fields with Countries, States/Provinces, U.S. Counties, and U.S. Cities. This data can then be used in dependent Data from Entries fields.', |
||
130 | ), |
||
131 | 'user-tracking' => array( |
||
132 | 'title' => 'User Tracking', |
||
133 | 'excerpt' => 'Track which pages a user visits prior to submitting a form.', |
||
134 | ), |
||
135 | ); |
||
136 | |||
137 | return $addons; |
||
138 | } |
||
139 | |||
275 |