Contact Form 7 Redirection - Version 2.2.7

Version Description

  • Minor styling changes.
Download this release

Release Info

Developer yuvalsabar
Plugin Icon 128x128 Contact Form 7 Redirection
Version 2.2.7
Comparing to
See all releases

Code changes from version 1.3.7 to 2.2.7

Files changed (303) hide show
  1. admin/wpcf7-redirect-admin-script.js +0 -70
  2. admin/wpcf7-redirect-admin-style.css +0 -88
  3. build/css/wpcf7-redirect-backend.css +3158 -0
  4. build/css/wpcf7-redirect-frontend.min.css +13 -0
  5. build/images/accesibie-logo.png +0 -0
  6. build/images/accessibe-full-logo.svg +54 -0
  7. build/images/banner-pro.png +0 -0
  8. build/images/banner.png +0 -0
  9. build/images/bundle.png +0 -0
  10. build/images/hubspot.png +0 -0
  11. build/images/icon-plane.png +0 -0
  12. build/images/icon1.png +0 -0
  13. build/images/icon10.png +0 -0
  14. build/images/icon11.png +0 -0
  15. build/images/icon12.png +0 -0
  16. build/images/icon13.png +0 -0
  17. build/images/icon3.png +0 -0
  18. build/images/icon6.png +0 -0
  19. build/images/icon7.png +0 -0
  20. build/images/icon8.png +0 -0
  21. build/images/icon9.png +0 -0
  22. build/images/loader.gif +0 -0
  23. build/images/logo-querysol.png +0 -0
  24. build/images/paypal.png +0 -0
  25. build/images/salesforce.png +0 -0
  26. build/js/wpcf7-redirect-backend-script.js +1257 -0
  27. build/js/wpcf7-redirect-frontend-script.js +301 -0
  28. class-wpcf7-redirect.php +65 -0
  29. classes/actions/class-wpcf7r-action-firescript.php +83 -0
  30. classes/actions/class-wpcf7r-action-honeypot.php +163 -0
  31. classes/actions/class-wpcf7r-action-redirect.php +263 -0
  32. classes/actions/class-wpcf7r-action-save-lead.php +123 -0
  33. classes/actions/class-wpcf7r-action-send-to-api.php +409 -0
  34. classes/actions/class-wpcf7r-action-sendmail.php +138 -0
  35. classes/actions/html/html-action-redirect.php +13 -0
  36. classes/actions/html/html-action-send-to-email.php +13 -0
  37. classes/actions/html/html-page-settings.php +19 -0
  38. classes/actions/html/index.php +5 -0
  39. classes/actions/html/rule-title.php +23 -0
  40. classes/actions/index.php +5 -0
  41. classes/aff/class-ext-accessibe.php +627 -0
  42. classes/aff/templates/accesibie-content.php +165 -0
  43. classes/class-qs-api.php +213 -0
  44. classes/class-wpcf7r-action.php +809 -0
  45. classes/class-wpcf7r-actions-list.php +102 -0
  46. classes/class-wpcf7r-actions.php +109 -0
  47. classes/class-wpcf7r-base.php +305 -0
  48. classes/class-wpcf7r-extension.php +462 -0
  49. classes/class-wpcf7r-extensions.php +42 -0
  50. classes/class-wpcf7r-form-helper.php +598 -0
  51. classes/class-wpcf7r-form.php +648 -0
  52. classes/class-wpcf7r-html.php +281 -0
  53. classes/class-wpcf7r-lead.php +197 -0
  54. classes/class-wpcf7r-leads-manager.php +232 -0
  55. classes/class-wpcf7r-list-table.php +133 -0
  56. classes/class-wpcf7r-mailchimp-helper.php +251 -0
  57. classes/class-wpcf7r-module.php +77 -0
  58. classes/class-wpcf7r-post-types.php +221 -0
  59. classes/class-wpcf7r-settings.php +293 -0
  60. classes/class-wpcf7r-submission.php +236 -0
  61. classes/class-wpcf7r-updates.php +146 -0
  62. classes/class-wpcf7r-user.php +112 -0
  63. classes/class-wpcf7r-utils.php +1045 -0
  64. classes/index.php +5 -0
  65. img/banner-pro.png +0 -0
  66. index.php +4 -0
  67. js/wpcf7-redirect-script.js +0 -83
  68. lang/index.php +10 -0
  69. lang/readme.txt +3 -3
  70. modules/cf7-shortcode-password-field.php +224 -0
  71. modules/cf7r-shortcode-get-param-field.php +29 -0
  72. modules/index.php +0 -0
  73. readme.txt +61 -24
  74. templates/banner.php +16 -0
  75. templates/blank-popup-template.php +33 -0
  76. templates/block-html.php +8 -0
  77. templates/block-title.php +16 -0
  78. templates/default-settings.php +69 -0
  79. templates/extensions.php +26 -0
  80. templates/extensions/extension-promo-box.php +81 -0
  81. templates/extensions/extensions-table.php +21 -0
  82. templates/fields/field-button.php +18 -0
  83. templates/fields/field-checkbox.php +23 -0
  84. templates/fields/field-debug-log.php +28 -0
  85. templates/fields/field-download.php +29 -0
  86. templates/fields/field-editor.php +37 -0
  87. templates/fields/field-json-editor.php +22 -0
  88. templates/fields/field-leads-mapping.php +72 -0
  89. templates/fields/field-media.php +30 -0
  90. templates/fields/field-notice.php +17 -0
  91. templates/fields/field-number.php +25 -0
  92. templates/fields/field-page-select.php +35 -0
  93. templates/fields/field-password.php +28 -0
  94. templates/fields/field-post-author-select.php +25 -0
  95. templates/fields/field-post-type-select.php +28 -0
  96. templates/fields/field-preview.php +11 -0
  97. templates/fields/field-repeater.php +90 -0
  98. templates/fields/field-rule-blocks.php +38 -0
  99. templates/fields/field-select.php +27 -0
  100. templates/fields/field-tags-map.php +70 -0
  101. templates/fields/field-taxonomy.php +26 -0
  102. templates/fields/field-text.php +29 -0
  103. templates/fields/field-textarea.php +21 -0
  104. templates/fields/field-url.php +23 -0
  105. templates/fields/index.php +2 -0
  106. templates/fields/section.php +32 -0
  107. templates/index.php +2 -0
  108. templates/popup-api-test.php +74 -0
  109. templates/popups/template-1.css +1 -0
  110. templates/popups/template-1.php +27 -0
  111. templates/popups/template-1.scss +148 -0
  112. templates/popups/template-2.css +1 -0
  113. templates/popups/template-2.php +33 -0
  114. templates/popups/template-2.scss +125 -0
  115. templates/popups/template-3.css +1 -0
  116. templates/popups/template-3.php +28 -0
  117. templates/popups/template-3.scss +115 -0
  118. templates/popups/template-4.css +289 -0
  119. templates/popups/template-4.php +26 -0
  120. templates/popups/template-4.scss +301 -0
  121. templates/popups/wpcfr-popup-wrap-default.php +13 -0
  122. templates/save-form.php +21 -0
  123. templates/settings.php +28 -0
  124. vendor/autoload.php +7 -0
  125. vendor/composer/ClassLoader.php +445 -0
  126. vendor/composer/LICENSE +21 -0
  127. vendor/composer/autoload_classmap.php +9 -0
  128. vendor/composer/autoload_namespaces.php +9 -0
  129. vendor/composer/autoload_psr4.php +11 -0
  130. vendor/composer/autoload_real.php +52 -0
  131. vendor/composer/autoload_static.php +36 -0
  132. vendor/composer/installed.json +49 -0
  133. vendor/jhut89/mailchimp3php/CODE_OF_CONDUCT.md +46 -0
  134. vendor/jhut89/mailchimp3php/LICENSE +21 -0
  135. vendor/jhut89/mailchimp3php/PULL_REQUEST_TEMPLATE.md +12 -0
  136. vendor/jhut89/mailchimp3php/README.md +401 -0
  137. vendor/jhut89/mailchimp3php/_config.yml +1 -0
  138. vendor/jhut89/mailchimp3php/composer.json +28 -0
  139. vendor/jhut89/mailchimp3php/composer.lock +1460 -0
  140. vendor/jhut89/mailchimp3php/src/Mailchimp.php +385 -0
  141. vendor/jhut89/mailchimp3php/src/MailchimpException.php +30 -0
  142. vendor/jhut89/mailchimp3php/src/Requests/HttpRequest.php +41 -0
  143. vendor/jhut89/mailchimp3php/src/Requests/MailchimpConnection.php +328 -0
  144. vendor/jhut89/mailchimp3php/src/Requests/MailchimpRequest.php +465 -0
  145. vendor/jhut89/mailchimp3php/src/Resources/Account.php +31 -0
  146. vendor/jhut89/mailchimp3php/src/Resources/ApiResource.php +246 -0
  147. vendor/jhut89/mailchimp3php/src/Resources/AuthorizedApps.php +31 -0
  148. vendor/jhut89/mailchimp3php/src/Resources/Automations.php +98 -0
  149. vendor/jhut89/mailchimp3php/src/Resources/Automations/Emails.php +84 -0
  150. vendor/jhut89/mailchimp3php/src/Resources/Automations/Emails/Queue.php +34 -0
  151. vendor/jhut89/mailchimp3php/src/Resources/Automations/RemovedSubscribers.php +30 -0
  152. vendor/jhut89/mailchimp3php/src/Resources/BatchOperations.php +30 -0
  153. vendor/jhut89/mailchimp3php/src/Resources/BatchWebhooks.php +29 -0
  154. vendor/jhut89/mailchimp3php/src/Resources/CampaignFolders.php +30 -0
  155. vendor/jhut89/mailchimp3php/src/Resources/Campaigns.php +209 -0
  156. vendor/jhut89/mailchimp3php/src/Resources/Campaigns/Content.php +30 -0
  157. vendor/jhut89/mailchimp3php/src/Resources/Campaigns/Feedback.php +31 -0
  158. vendor/jhut89/mailchimp3php/src/Resources/Campaigns/SendChecklist.php +30 -0
  159. vendor/jhut89/mailchimp3php/src/Resources/ConnectedSites.php +52 -0
  160. vendor/jhut89/mailchimp3php/src/Resources/Conversations.php +48 -0
  161. vendor/jhut89/mailchimp3php/src/Resources/Conversations/Messages.php +31 -0
  162. vendor/jhut89/mailchimp3php/src/Resources/EcommerceStores.php +104 -0
  163. vendor/jhut89/mailchimp3php/src/Resources/EcommerceStores/Carts.php +47 -0
  164. vendor/jhut89/mailchimp3php/src/Resources/EcommerceStores/Carts/Lines.php +31 -0
  165. vendor/jhut89/mailchimp3php/src/Resources/EcommerceStores/Customers.php +31 -0
  166. vendor/jhut89/mailchimp3php/src/Resources/EcommerceStores/Orders.php +47 -0
  167. vendor/jhut89/mailchimp3php/src/Resources/EcommerceStores/Orders/Lines.php +31 -0
  168. vendor/jhut89/mailchimp3php/src/Resources/EcommerceStores/Products.php +63 -0
  169. vendor/jhut89/mailchimp3php/src/Resources/EcommerceStores/Products/Images.php +31 -0
  170. vendor/jhut89/mailchimp3php/src/Resources/EcommerceStores/Products/Variants.php +31 -0
  171. vendor/jhut89/mailchimp3php/src/Resources/EcommerceStores/PromoRules.php +47 -0
  172. vendor/jhut89/mailchimp3php/src/Resources/EcommerceStores/PromoRules/PromoCodes.php +32 -0
  173. vendor/jhut89/mailchimp3php/src/Resources/FacebookAds.php +32 -0
  174. vendor/jhut89/mailchimp3php/src/Resources/FileManagerFiles.php +30 -0
  175. vendor/jhut89/mailchimp3php/src/Resources/FileManagerFolders.php +30 -0
  176. vendor/jhut89/mailchimp3php/src/Resources/GoogleAds.php +32 -0
  177. vendor/jhut89/mailchimp3php/src/Resources/LandingPages.php +79 -0
  178. vendor/jhut89/mailchimp3php/src/Resources/LandingPages/Content.php +31 -0
  179. vendor/jhut89/mailchimp3php/src/Resources/Lists.php +190 -0
  180. vendor/jhut89/mailchimp3php/src/Resources/Lists/AbuseReports.php +31 -0
  181. vendor/jhut89/mailchimp3php/src/Resources/Lists/Activity.php +26 -0
  182. vendor/jhut89/mailchimp3php/src/Resources/Lists/Clients.php +30 -0
  183. vendor/jhut89/mailchimp3php/src/Resources/Lists/GrowthHistory.php +31 -0
  184. vendor/jhut89/mailchimp3php/src/Resources/Lists/InterestCategories.php +48 -0
  185. vendor/jhut89/mailchimp3php/src/Resources/Lists/InterestCategories/Interest.php +31 -0
  186. vendor/jhut89/mailchimp3php/src/Resources/Lists/Members.php +96 -0
  187. vendor/jhut89/mailchimp3php/src/Resources/Lists/Members/Activity.php +30 -0
  188. vendor/jhut89/mailchimp3php/src/Resources/Lists/Members/Events.php +30 -0
  189. vendor/jhut89/mailchimp3php/src/Resources/Lists/Members/Goals.php +30 -0
  190. vendor/jhut89/mailchimp3php/src/Resources/Lists/Members/Notes.php +31 -0
  191. vendor/jhut89/mailchimp3php/src/Resources/Lists/Members/Tags.php +30 -0
  192. vendor/jhut89/mailchimp3php/src/Resources/Lists/MergeFields.php +31 -0
  193. vendor/jhut89/mailchimp3php/src/Resources/Lists/Segments.php +68 -0
  194. vendor/jhut89/mailchimp3php/src/Resources/Lists/Segments/Members.php +34 -0
  195. vendor/jhut89/mailchimp3php/src/Resources/Lists/SignupForms.php +31 -0
  196. vendor/jhut89/mailchimp3php/src/Resources/Lists/Webhooks.php +31 -0
  197. vendor/jhut89/mailchimp3php/src/Resources/Ping.php +30 -0
  198. vendor/jhut89/mailchimp3php/src/Resources/Reports.php +188 -0
  199. vendor/jhut89/mailchimp3php/src/Resources/Reports/CampaignAbuse.php +31 -0
  200. vendor/jhut89/mailchimp3php/src/Resources/Reports/CampaignAdvice.php +30 -0
  201. vendor/jhut89/mailchimp3php/src/Resources/Reports/ClickReports.php +47 -0
  202. vendor/jhut89/mailchimp3php/src/Resources/Reports/ClickReports/Members.php +34 -0
  203. vendor/jhut89/mailchimp3php/src/Resources/Reports/DomainPerformance.php +30 -0
  204. vendor/jhut89/mailchimp3php/src/Resources/Reports/EepurlReports.php +30 -0
  205. vendor/jhut89/mailchimp3php/src/Resources/Reports/EmailActivity.php +34 -0
  206. vendor/jhut89/mailchimp3php/src/Resources/Reports/GoogleAnalytics.php +32 -0
  207. vendor/jhut89/mailchimp3php/src/Resources/Reports/OpenDetails.php +31 -0
  208. vendor/jhut89/mailchimp3php/src/Resources/Reports/SentTo.php +34 -0
  209. vendor/jhut89/mailchimp3php/src/Resources/Reports/SubReports.php +30 -0
  210. vendor/jhut89/mailchimp3php/src/Resources/Reports/TopLocations.php +31 -0
  211. vendor/jhut89/mailchimp3php/src/Resources/Reports/Unsubscribes.php +34 -0
  212. vendor/jhut89/mailchimp3php/src/Resources/SearchCampaigns.php +29 -0
  213. vendor/jhut89/mailchimp3php/src/Resources/SearchMembers.php +29 -0
  214. vendor/jhut89/mailchimp3php/src/Resources/TemplateFolders.php +30 -0
  215. vendor/jhut89/mailchimp3php/src/Resources/Templates.php +45 -0
  216. vendor/jhut89/mailchimp3php/src/Resources/Templates/DefaultContent.php +30 -0
  217. vendor/jhut89/mailchimp3php/src/Resources/VerifiedDomains.php +49 -0
  218. vendor/jhut89/mailchimp3php/src/Responses/FailureResponse.php +27 -0
  219. vendor/jhut89/mailchimp3php/src/Responses/MailchimpResponse.php +136 -0
  220. vendor/jhut89/mailchimp3php/src/Responses/SuccessResponse.php +27 -0
  221. vendor/jhut89/mailchimp3php/src/Settings/MailchimpSettings.php +125 -0
  222. vendor/jhut89/mailchimp3php/tests/AccountTest.php +24 -0
  223. vendor/jhut89/mailchimp3php/tests/AuthorizedAppsTest.php +36 -0
  224. vendor/jhut89/mailchimp3php/tests/Automations/Emails/QueueTest.php +39 -0
  225. vendor/jhut89/mailchimp3php/tests/Automations/EmailsTest.php +38 -0
  226. vendor/jhut89/mailchimp3php/tests/Automations/RemovedSubscribersTest.php +26 -0
  227. vendor/jhut89/mailchimp3php/tests/AutomationsTest.php +71 -0
  228. vendor/jhut89/mailchimp3php/tests/BatchOperationsTest.php +36 -0
  229. vendor/jhut89/mailchimp3php/tests/BatchWebhooksTest.php +37 -0
  230. vendor/jhut89/mailchimp3php/tests/CampaignFoldersTest.php +37 -0
  231. vendor/jhut89/mailchimp3php/tests/Campaigns/ContentTest.php +26 -0
  232. vendor/jhut89/mailchimp3php/tests/Campaigns/FeedbackTest.php +39 -0
  233. vendor/jhut89/mailchimp3php/tests/Campaigns/SendChecklistTest.php +26 -0
  234. vendor/jhut89/mailchimp3php/tests/CampaignsTest.php +37 -0
  235. vendor/jhut89/mailchimp3php/tests/ConnectedSitesTest.php +26 -0
  236. vendor/jhut89/mailchimp3php/tests/Conversations/MessagesTest.php +38 -0
  237. vendor/jhut89/mailchimp3php/tests/ConversationsTest.php +26 -0
  238. vendor/jhut89/mailchimp3php/tests/EcommerceStores/Carts/LinesTest.php +39 -0
  239. vendor/jhut89/mailchimp3php/tests/EcommerceStores/CartsTest.php +44 -0
  240. vendor/jhut89/mailchimp3php/tests/EcommerceStores/CustomersTest.php +44 -0
  241. vendor/jhut89/mailchimp3php/tests/EcommerceStores/Orders/LinesTest.php +39 -0
  242. vendor/jhut89/mailchimp3php/tests/EcommerceStores/OrdersTest.php +38 -0
  243. vendor/jhut89/mailchimp3php/tests/EcommerceStores/Products/ImagesTest.php +40 -0
  244. vendor/jhut89/mailchimp3php/tests/EcommerceStores/Products/VariantsTest.php +39 -0
  245. vendor/jhut89/mailchimp3php/tests/EcommerceStores/ProductsTest.php +38 -0
  246. vendor/jhut89/mailchimp3php/tests/EcommerceStores/PromoRules/PromoCodesTest.php +35 -0
  247. vendor/jhut89/mailchimp3php/tests/EcommerceStores/PromoRulesTest.php +34 -0
  248. vendor/jhut89/mailchimp3php/tests/EcommerceStoresTest.php +37 -0
  249. vendor/jhut89/mailchimp3php/tests/FacebookAdsTest.php +33 -0
  250. vendor/jhut89/mailchimp3php/tests/FileManagerFilesTest.php +26 -0
  251. vendor/jhut89/mailchimp3php/tests/FileManagerFoldersTest.php +26 -0
  252. vendor/jhut89/mailchimp3php/tests/GoogleAdsTest.php +26 -0
  253. vendor/jhut89/mailchimp3php/tests/LandingPages/ContentTest.php +19 -0
  254. vendor/jhut89/mailchimp3php/tests/LandingPagesTest.php +26 -0
  255. vendor/jhut89/mailchimp3php/tests/Lists/AbuseReportsTest.php +38 -0
  256. vendor/jhut89/mailchimp3php/tests/Lists/ActivityTest.php +32 -0
  257. vendor/jhut89/mailchimp3php/tests/Lists/ClientsTest.php +32 -0
  258. vendor/jhut89/mailchimp3php/tests/Lists/GrowthHistoryTest.php +44 -0
  259. vendor/jhut89/mailchimp3php/tests/Lists/InterestCategories/InterestsTest.php +39 -0
  260. vendor/jhut89/mailchimp3php/tests/Lists/InterestCategoriesTest.php +44 -0
  261. vendor/jhut89/mailchimp3php/tests/Lists/Members/ActivityTest.php +27 -0
  262. vendor/jhut89/mailchimp3php/tests/Lists/Members/EventsTest.php +23 -0
  263. vendor/jhut89/mailchimp3php/tests/Lists/Members/GoalsTest.php +27 -0
  264. vendor/jhut89/mailchimp3php/tests/Lists/Members/NotesTest.php +39 -0
  265. vendor/jhut89/mailchimp3php/tests/Lists/Members/TagsTest.php +23 -0
  266. vendor/jhut89/mailchimp3php/tests/Lists/MembersTest.php +44 -0
  267. vendor/jhut89/mailchimp3php/tests/Lists/MergeFieldsTest.php +38 -0
  268. vendor/jhut89/mailchimp3php/tests/Lists/Segments/MembersTest.php +39 -0
  269. vendor/jhut89/mailchimp3php/tests/Lists/SegmentsTest.php +38 -0
  270. vendor/jhut89/mailchimp3php/tests/Lists/SignupFormsTest.php +38 -0
  271. vendor/jhut89/mailchimp3php/tests/Lists/WebhooksTest.php +38 -0
  272. vendor/jhut89/mailchimp3php/tests/ListsTest.php +36 -0
  273. vendor/jhut89/mailchimp3php/tests/MailChimpTestCase.php +110 -0
  274. vendor/jhut89/mailchimp3php/tests/MailchimpTest.php +59 -0
  275. vendor/jhut89/mailchimp3php/tests/PingTest.php +20 -0
  276. vendor/jhut89/mailchimp3php/tests/Reports/CampaignAbuseTest.php +38 -0
  277. vendor/jhut89/mailchimp3php/tests/Reports/CampaignAdviceTest.php +26 -0
  278. vendor/jhut89/mailchimp3php/tests/Reports/ClickReports/MembersTest.php +29 -0
  279. vendor/jhut89/mailchimp3php/tests/Reports/ClickReportsTest.php +38 -0
  280. vendor/jhut89/mailchimp3php/tests/Reports/DomainPerformanceTest.php +26 -0
  281. vendor/jhut89/mailchimp3php/tests/Reports/EepurlReportsTest.php +26 -0
  282. vendor/jhut89/mailchimp3php/tests/Reports/EmailActivityTest.php +38 -0
  283. vendor/jhut89/mailchimp3php/tests/Reports/GoogleAnalyticsTest.php +34 -0
  284. vendor/jhut89/mailchimp3php/tests/Reports/OpenDetailsTest.php +22 -0
  285. vendor/jhut89/mailchimp3php/tests/Reports/SentToTest.php +38 -0
  286. vendor/jhut89/mailchimp3php/tests/Reports/SubReportsTest.php +26 -0
  287. vendor/jhut89/mailchimp3php/tests/Reports/TopLocationsTest.php +26 -0
  288. vendor/jhut89/mailchimp3php/tests/Reports/UnsubscribesTest.php +34 -0
  289. vendor/jhut89/mailchimp3php/tests/ReportsTest.php +36 -0
  290. vendor/jhut89/mailchimp3php/tests/Responses/FailureResponseTest.php +23 -0
  291. vendor/jhut89/mailchimp3php/tests/Responses/SuccessResponseTest.php +23 -0
  292. vendor/jhut89/mailchimp3php/tests/SearchCampaignsTest.php +24 -0
  293. vendor/jhut89/mailchimp3php/tests/SearchMembersTest.php +24 -0
  294. vendor/jhut89/mailchimp3php/tests/Settings/MailchimpSettingsTest.php +30 -0
  295. vendor/jhut89/mailchimp3php/tests/TemplateFoldersTest.php +36 -0
  296. vendor/jhut89/mailchimp3php/tests/Templates/DefaultContentTest.php +26 -0
  297. vendor/jhut89/mailchimp3php/tests/TemplatesTest.php +36 -0
  298. vendor/jhut89/mailchimp3php/tests/TestingUtilities/StubbableMailchimp.php +76 -0
  299. vendor/jhut89/mailchimp3php/tests/UtilityTests/MailchimpConnectionTest.php +174 -0
  300. vendor/jhut89/mailchimp3php/tests/UtilityTests/MailchimpRequestTest.php +80 -0
  301. vendor/jhut89/mailchimp3php/tests/VerifiedDomainsTest.php +26 -0
  302. wpcf7-redirect.php +48 -486
  303. wpcf7r-functions.php +657 -0
admin/wpcf7-redirect-admin-script.js DELETED
@@ -1,70 +0,0 @@
1
- jQuery(document).ready(function($) {
2
-
3
- // field - open in a new tab
4
- $( '#wpcf7-redirect-open-in-new-tab' ).change(function() {
5
- if ( $( this ).is( ":checked" ) ) {
6
- $( '.field-notice-alert' ).removeClass( 'field-notice-hidden' );
7
- } else {
8
- $( '.field-notice-alert' ).addClass( 'field-notice-hidden' );
9
- }
10
- });
11
-
12
- if ( $( '#wpcf7-redirect-open-in-new-tab' ).is( ":checked" ) ) {
13
- $( '.field-notice-alert' ).removeClass( 'field-notice-hidden' );
14
- }
15
-
16
- // fields - http build query
17
- $( '#wpcf7-redirect-http-build-query-selectively' ).change(function() {
18
- if ( $( this ).is( ":checked" ) ) {
19
- $( '#wpcf7-redirect-http-build-query-selectively-fields' ).removeClass( 'field-hidden' );
20
- }
21
- });
22
-
23
- $( '#wpcf7-redirect-http-build-query' ).change(function() {
24
- if ( $( this ).is( ":checked" ) ) {
25
- $( '#wpcf7-redirect-http-build-query-selectively-fields' ).addClass( 'field-hidden' );
26
- }
27
- });
28
-
29
- if ( $( '#wpcf7-redirect-http-build-query-selectively' ).is( ":checked" ) ) {
30
- $( '#wpcf7-redirect-http-build-query-selectively-fields' ).removeClass( 'field-hidden' );
31
- }
32
-
33
- $('.checkbox-radio-1').change(function() {
34
- var checked = $(this).is(':checked');
35
- $('.checkbox-radio-1').prop('checked', false);
36
- if ( checked ) {
37
- $(this).prop('checked',true);
38
- }
39
- });
40
-
41
- // field - after sent script
42
- $( '#wpcf7-redirect-after-sent-script' ).keyup(function() {
43
- if ( $(this).val().length != 0 ) {
44
- $( '.field-warning-alert' ).removeClass( 'field-notice-hidden' );
45
- } else {
46
- $( '.field-warning-alert' ).addClass( 'field-notice-hidden' );
47
- }
48
- });
49
-
50
- if ( $( '#wpcf7-redirect-after-sent-script' ).val() ) {
51
- $( '.field-warning-alert' ).removeClass( 'field-notice-hidden' );
52
- }
53
-
54
- $('.wpcf7-redirect-pro-admin-notice .notice-dismiss').click(function(e) {
55
- e.preventDefault();
56
- sign = window.location.href.indexOf("?") > -1 ? '&' : '?';
57
- location.href = window.location.href + sign + 'wpcf7_redirect_dismiss_notice=1';
58
- });
59
-
60
- $('#redirect-panel .banner-wrap .notice-dismiss').click(function(e) {
61
- e.preventDefault();
62
- sign = window.location.href.indexOf("?") > -1 ? '&' : '?';
63
- location.href = window.location.href + sign + 'wpcf7_redirect_dismiss_banner=1';
64
- });
65
-
66
- // Add selected attribute to pages dropdown if none selected
67
- if ( $('#wpcf7-redirect-page-id').val() == 0 ) {
68
- $('#wpcf7-redirect-page-id option:first').attr('selected', 'selected')
69
- }
70
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/wpcf7-redirect-admin-style.css DELETED
@@ -1,88 +0,0 @@
1
- #redirect-panel .banner-wrap {
2
- position: relative;
3
- padding: 15px 40px;
4
- border: 1px solid #ddd;
5
- }
6
- #redirect-panel .banner-wrap img {
7
- display: block;
8
- max-width: 100%;
9
- margin: auto;
10
- }
11
- #redirect-panel .field-wrap {
12
- margin-bottom: 10px;
13
- }
14
- #redirect-panel .field-wrap [type='url'],
15
- #redirect-panel .field-wrap [type='select'] {
16
- height: 28px;
17
- }
18
- #redirect-panel .field-wrap [type='url'],
19
- #redirect-panel .field-wrap [type='text'] {
20
- width: 100%;
21
- }
22
- #redirect-panel .field-wrap [type='checkbox'] {
23
- margin-top: 1px;
24
- }
25
- #redirect-panel .field-wrap textarea {
26
- width: 100%;
27
-
28
- direction: ltr;
29
- }
30
- #redirect-panel .field-wrap-after-sent-script {
31
- margin-top: 10px;
32
- }
33
- #redirect-panel .field-wrap-page-id label,
34
- #redirect-panel .field-wrap-after-sent-script label {
35
- display: block;
36
- margin-bottom: 5px;
37
- }
38
- #redirect-panel .field-wrap-http-build-query-selectively [type='text'] {
39
- margin-top: 10px;
40
- }
41
- #redirect-panel .field-wrap-after-sent-script .field-message {
42
- margin-bottom: 10px;
43
- }
44
- #redirect-panel .field-notice {
45
- padding: 15px;
46
- margin-top: 10px;
47
- margin-bottom: 20px;
48
- background: #fff;
49
- border: 1px solid;
50
- border-radius: 4px;
51
- }
52
- #redirect-panel .field-notice-alert {
53
- color: #8a6d3b;
54
- background-color: #fcf8e3;
55
- border: 1px solid #faebcc;
56
- }
57
- #redirect-panel .field-hidden,
58
- #redirect-panel .field-notice-hidden {
59
- display: none;
60
- }
61
- #redirect-panel .field-warning-alert {
62
- color: #a94442;
63
- background-color: #f2dede;
64
- border-color: #ebccd1;
65
- }
66
- #redirect-panel .get-pro-wrap {
67
- text-align: center;
68
-
69
- direction: ltr;
70
- }
71
- #redirect-panel .get-pro-wrap .get-pro {
72
- display: inline-block;
73
- padding: 15px;
74
- color: #8a6d3b;
75
- background-color: #fff;
76
- border: 1px solid #ddd;
77
- }
78
- #redirect-panel .get-pro-wrap .get-pro .get-pro-text {
79
- margin-bottom: 20px;
80
- }
81
- #redirect-panel .get-pro-wrap .get-pro .dashicons-star-filled {
82
- color: #e7c201;
83
- }
84
- #redirect-panel .get-pro-wrap .get-pro a {
85
- position: relative;
86
- top: 2px;
87
- margin: 0 8px;
88
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
build/css/wpcf7-redirect-backend.css ADDED
@@ -0,0 +1,3158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px;padding:1px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right;margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
2
+
3
+ .settings_page_wpc7_redirect .padbox form > div {
4
+ display: none !important;
5
+ }
6
+
7
+ .settings_page_wpc7_redirect .padbox form > div#setting-error-not-valid-serial {
8
+ display: block !important;
9
+ }
10
+
11
+ #debug-info {
12
+ margin-bottom: 10px;
13
+ }
14
+
15
+ .extensions-list-wrap {
16
+ background: #fff;
17
+ }
18
+
19
+ .extensions-list-wrap .padbox {
20
+ padding: 2rem;
21
+ }
22
+
23
+ .wpcf7r_loader {
24
+ -webkit-transition: all 250ms ease;
25
+ -o-transition: all 250ms ease;
26
+ transition: all 250ms ease;
27
+ position: absolute;
28
+ top: 0;
29
+ right: 0;
30
+ width: 100%;
31
+ height: 100%;
32
+ visibility: hidden;
33
+ background: url("../../build/images/loader.gif") 50% 50% rgba(255, 255, 255, 0.8) no-repeat;
34
+ background-size: 50px;
35
+ opacity: 0;
36
+ }
37
+
38
+ .wpcf7r_loader.active {
39
+ visibility: visible;
40
+ opacity: 1;
41
+ }
42
+
43
+ .new-action-selector {
44
+ display: block;
45
+ float: left;
46
+ margin-right: 10px;
47
+ }
48
+
49
+ .mail-tags-wrapper {
50
+ margin-top: 5px;
51
+ }
52
+
53
+ .settings_page_wpc7_redirect .padbox {
54
+ padding: 20px;
55
+ }
56
+
57
+ div#wpcf7r_leads .field-wrap {
58
+ display: -webkit-box;
59
+ display: -moz-flex;
60
+ display: -ms-flexbox;
61
+ display: flex;
62
+ margin-bottom: 10px;
63
+ }
64
+
65
+ div#wpcf7r_leads .field-wrap label {
66
+ display: -webkit-box;
67
+ display: -moz-flex;
68
+ display: -ms-flexbox;
69
+ display: flex;
70
+ align-items: center;
71
+ -webkit-align-items: center;
72
+ -moz-align-items: center;
73
+ -webkit-box-align: center;
74
+ -ms-flex-align: center;
75
+ width: 40%;
76
+ }
77
+
78
+ .wpcfr-popup-wrap {
79
+ position: fixed;
80
+ top: 0;
81
+ right: 0;
82
+ width: 100%;
83
+ height: 100%;
84
+ z-index: 999999;
85
+ display: -webkit-box;
86
+ display: -moz-flex;
87
+ display: -ms-flexbox;
88
+ display: flex;
89
+ /* width */
90
+ /* Track */
91
+ /* Handle */
92
+ }
93
+
94
+ .wpcfr-popup-wrap.top-right {
95
+ justify-content: flex-end;
96
+ -webkit-justify-content: flex-end;
97
+ -moz-justify-content: flex-end;
98
+ -webkit-box-pack: end;
99
+ -ms-flex-pack: end;
100
+ }
101
+
102
+ .wpcfr-popup-wrap.top-center {
103
+ justify-content: center;
104
+ -webkit-justify-content: center;
105
+ -moz-justify-content: center;
106
+ -webkit-box-pack: center;
107
+ -ms-flex-pack: center;
108
+ }
109
+
110
+ .wpcfr-popup-wrap.top-left {
111
+ justify-content: flex-start;
112
+ -webkit-justify-content: flex-start;
113
+ -moz-justify-content: flex-start;
114
+ -webkit-box-pack: start;
115
+ -ms-flex-pack: start;
116
+ }
117
+
118
+ .wpcfr-popup-wrap.middle-right {
119
+ justify-content: flex-end;
120
+ -webkit-justify-content: flex-end;
121
+ -moz-justify-content: flex-end;
122
+ -webkit-box-pack: end;
123
+ -ms-flex-pack: end;
124
+ align-items: center;
125
+ -webkit-align-items: center;
126
+ -moz-align-items: center;
127
+ -webkit-box-align: center;
128
+ -ms-flex-align: center;
129
+ }
130
+
131
+ .wpcfr-popup-wrap.middle-center {
132
+ justify-content: center;
133
+ -webkit-justify-content: center;
134
+ -moz-justify-content: center;
135
+ -webkit-box-pack: center;
136
+ -ms-flex-pack: center;
137
+ align-items: center;
138
+ -webkit-align-items: center;
139
+ -moz-align-items: center;
140
+ -webkit-box-align: center;
141
+ -ms-flex-align: center;
142
+ }
143
+
144
+ .wpcfr-popup-wrap.middle-left {
145
+ justify-content: flex-start;
146
+ -webkit-justify-content: flex-start;
147
+ -moz-justify-content: flex-start;
148
+ -webkit-box-pack: start;
149
+ -ms-flex-pack: start;
150
+ align-items: center;
151
+ -webkit-align-items: center;
152
+ -moz-align-items: center;
153
+ -webkit-box-align: center;
154
+ -ms-flex-align: center;
155
+ }
156
+
157
+ .wpcfr-popup-wrap.bottom-right {
158
+ justify-content: flex-end;
159
+ -webkit-justify-content: flex-end;
160
+ -moz-justify-content: flex-end;
161
+ -webkit-box-pack: end;
162
+ -ms-flex-pack: end;
163
+ align-items: flex-end;
164
+ -webkit-align-items: flex-end;
165
+ -moz-align-items: flex-end;
166
+ -webkit-box-align: end;
167
+ -ms-flex-align: end;
168
+ }
169
+
170
+ .wpcfr-popup-wrap.bottom-center {
171
+ justify-content: flex-start;
172
+ -webkit-justify-content: flex-start;
173
+ -moz-justify-content: flex-start;
174
+ -webkit-box-pack: start;
175
+ -ms-flex-pack: start;
176
+ align-items: flex-end;
177
+ -webkit-align-items: flex-end;
178
+ -moz-align-items: flex-end;
179
+ -webkit-box-align: end;
180
+ -ms-flex-align: end;
181
+ }
182
+
183
+ .wpcfr-popup-wrap.bottom-left {
184
+ justify-content: flex-start;
185
+ -webkit-justify-content: flex-start;
186
+ -moz-justify-content: flex-start;
187
+ -webkit-box-pack: start;
188
+ -ms-flex-pack: start;
189
+ align-items: flex-end;
190
+ -webkit-align-items: flex-end;
191
+ -moz-align-items: flex-end;
192
+ -webkit-box-align: end;
193
+ -ms-flex-align: end;
194
+ }
195
+
196
+ .wpcfr-popup-wrap .wpcfr-popup-wrap-inner {
197
+ width: 500px;
198
+ height: 300px;
199
+ background: #fff;
200
+ position: relative;
201
+ }
202
+
203
+ .wpcfr-popup-wrap .wpcfr-close-popup {
204
+ position: absolute;
205
+ cursor: pointer;
206
+ }
207
+
208
+ .wpcfr-popup-wrap .wpcfr-close-popup.bottom-right {
209
+ -webkit-transform: translateX(-50%) translateY(50%);
210
+ -ms-transform: translateX(-50%) translateY(50%);
211
+ transform: translateX(-50%) translateY(50%);
212
+ right: 0;
213
+ bottom: 0;
214
+ }
215
+
216
+ .wpcfr-popup-wrap .wpcfr-close-popup.bottom-center {
217
+ -webkit-transform: translateX(-50%) translateY(50%);
218
+ -ms-transform: translateX(-50%) translateY(50%);
219
+ transform: translateX(-50%) translateY(50%);
220
+ bottom: 0;
221
+ left: 50%;
222
+ }
223
+
224
+ .wpcfr-popup-wrap .wpcfr-close-popup.bottom-left {
225
+ -webkit-transform: translateX(-50%) translateY(50%);
226
+ -ms-transform: translateX(-50%) translateY(50%);
227
+ transform: translateX(-50%) translateY(50%);
228
+ bottom: 0;
229
+ left: 0;
230
+ }
231
+
232
+ .wpcfr-popup-wrap .wpcfr-close-popup.top-right {
233
+ -webkit-transform: translateX(50%) translateY(-50%);
234
+ -ms-transform: translateX(50%) translateY(-50%);
235
+ transform: translateX(50%) translateY(-50%);
236
+ right: 0;
237
+ top: 0;
238
+ }
239
+
240
+ .wpcfr-popup-wrap .wpcfr-close-popup.top-center {
241
+ -webkit-transform: translateX(-50%) translateY(-50%);
242
+ -ms-transform: translateX(-50%) translateY(-50%);
243
+ transform: translateX(-50%) translateY(-50%);
244
+ top: 0;
245
+ left: 50%;
246
+ }
247
+
248
+ .wpcfr-popup-wrap .wpcfr-close-popup.top-left {
249
+ -webkit-transform: translateX(-50%) translateY(-50%);
250
+ -ms-transform: translateX(-50%) translateY(-50%);
251
+ transform: translateX(-50%) translateY(-50%);
252
+ top: 0;
253
+ }
254
+
255
+ .wpcfr-popup-wrap.wpcfr-popup-wrap-default {
256
+ background: rgba(0, 0, 0, 0.4);
257
+ }
258
+
259
+ .wpcfr-popup-wrap.wpcfr-popup-wrap-default .wpcfr-popup-wrap-inner {
260
+ max-width: 95%;
261
+ max-height: 100vh;
262
+ width: 500px;
263
+ min-height: 300px;
264
+ background: #fff;
265
+ -webkit-box-shadow: 0px 0px 20px #4b4b4b;
266
+ box-shadow: 0px 0px 20px #4b4b4b;
267
+ border-radius: 2px;
268
+ }
269
+
270
+ .wpcfr-popup-wrap.wpcfr-popup-wrap-default .wpcfr-popup-wrap-content {
271
+ display: -webkit-box;
272
+ display: -moz-flex;
273
+ display: -ms-flexbox;
274
+ display: flex;
275
+ overflow: hidden;
276
+ min-height: 100%;
277
+ }
278
+
279
+ .wpcfr-popup-wrap.wpcfr-popup-wrap-default .wpcfr-popup-wrap-content .wpcfr-2-rows {
280
+ display: -webkit-box;
281
+ display: -moz-flex;
282
+ display: -ms-flexbox;
283
+ display: flex;
284
+ flex-direction: column;
285
+ -moz-flex-direction: column;
286
+ -ms-flex-direction: column;
287
+ -webkit-box-direction: normal;
288
+ -webkit-box-orient: vertical;
289
+ width: 100%;
290
+ }
291
+
292
+ .wpcfr-popup-wrap.wpcfr-popup-wrap-default .wpcfr-popup-wrap-content .wpcfr-2-rows .wpcfr-row {
293
+ height: 40%;
294
+ padding: 2%;
295
+ }
296
+
297
+ .wpcfr-popup-wrap.wpcfr-popup-wrap-default .wpcfr-popup-wrap-content .wpcfr-2-rows .wpcfr-row:nth-child(2) {
298
+ height: 60%;
299
+ background: #e9e9e9;
300
+ }
301
+
302
+ .wpcfr-popup-wrap ::-webkit-scrollbar {
303
+ width: 10px;
304
+ }
305
+
306
+ .wpcfr-popup-wrap ::-webkit-scrollbar-track {
307
+ border-radius: 0;
308
+ }
309
+
310
+ .wpcfr-popup-wrap ::-webkit-scrollbar-thumb {
311
+ background: #ccc;
312
+ border-radius: 0;
313
+ }
314
+
315
+ .wpcfr-popup-wrap .wpcfr-popup-wrap-inner {
316
+ width: 100%;
317
+ max-width: 800px;
318
+ height: 60%;
319
+ padding: 20px;
320
+ border: 1px solid #d1d1d1;
321
+ -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
322
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
323
+ }
324
+
325
+ .wpcfr-popup-wrap .wpcfr-popup-wrap-inner .wpcfr-popup-wrap-content {
326
+ height: 100%;
327
+ overflow-x: hidden;
328
+ overflow-y: auto;
329
+ }
330
+
331
+ .wpcfr-popup-wrap .wpcfr-popup-wrap-inner .wpcfr-popup-wrap-content textarea {
332
+ width: 96%;
333
+ direction: ltr;
334
+ }
335
+
336
+ #leads-panel .dashicons-minus {
337
+ margin-top: 5px;
338
+ }
339
+
340
+ .wpcf7r-update-extensions {
341
+ display: inline-block;
342
+ min-width: 18px;
343
+ height: 18px;
344
+ -webkit-box-sizing: border-box;
345
+ box-sizing: border-box;
346
+ padding: 0 5px;
347
+ margin: 1px 0 -1px 2px;
348
+ font-size: 11px;
349
+ line-height: 1.6;
350
+ color: #fff;
351
+ text-align: center;
352
+ vertical-align: top;
353
+ background-color: #ca4a1f;
354
+ border-radius: 9px;
355
+ }
356
+
357
+ .wrap-wpcf7redirect section.padbox .padbox {
358
+ padding: 20px;
359
+ }
360
+
361
+ .wrap-wpcf7redirect .padbox {
362
+ padding: 8px 12px;
363
+ }
364
+
365
+ .wrap-wpcf7redirect .user-message {
366
+ padding: 20px;
367
+ font-size: 14px;
368
+ color: #000;
369
+ background: #fff;
370
+ border: 1px solid #ccd0d4;
371
+ border-bottom: 0;
372
+ }
373
+
374
+ .wrap-wpcf7redirect .user-message ul {
375
+ margin: 0 10px;
376
+ }
377
+
378
+ .wrap-wpcf7redirect .user-message ul li {
379
+ position: relative;
380
+ }
381
+
382
+ .wrap-wpcf7redirect .user-message ul li:before {
383
+ position: absolute;
384
+ top: 50%;
385
+ left: -10px;
386
+ display: block;
387
+ width: 5px;
388
+ height: 5px;
389
+ content: '';
390
+ background: #65b1fc;
391
+ -webkit-transform: translateY(-50%);
392
+ -ms-transform: translateY(-50%);
393
+ transform: translateY(-50%);
394
+ }
395
+
396
+ .wrap-wpcf7redirect h2 {
397
+ padding: 8px 12px;
398
+ margin: 0 -12px 20px;
399
+ font-size: 14px;
400
+ line-height: 1.4;
401
+ border-bottom: 1px solid #eee;
402
+ }
403
+
404
+ #steps-panel .success-message,
405
+ #extensions-panel .success-message,
406
+ #leads-panel .success-message,
407
+ #redirect-panel .success-message {
408
+ padding: 10px;
409
+ margin-bottom: 20px;
410
+ font-size: 20px;
411
+ color: #fff;
412
+ background: #136ef8;
413
+ }
414
+
415
+ #steps-panel .select2-container .select2-selection--single,
416
+ #extensions-panel .select2-container .select2-selection--single,
417
+ #leads-panel .select2-container .select2-selection--single,
418
+ #redirect-panel .select2-container .select2-selection--single {
419
+ display: block;
420
+ height: 38px;
421
+ -webkit-box-sizing: border-box;
422
+ box-sizing: border-box;
423
+ cursor: pointer;
424
+ -webkit-user-select: none;
425
+ -moz-user-select: none;
426
+ -ms-user-select: none;
427
+ user-select: none;
428
+ }
429
+
430
+ #steps-panel .select2-container--default .select2-selection--single,
431
+ #extensions-panel .select2-container--default .select2-selection--single,
432
+ #leads-panel .select2-container--default .select2-selection--single,
433
+ #redirect-panel .select2-container--default .select2-selection--single {
434
+ border-radius: 0;
435
+ }
436
+
437
+ #steps-panel .field-wrap,
438
+ #extensions-panel .field-wrap,
439
+ #leads-panel .field-wrap,
440
+ #redirect-panel .field-wrap {
441
+ position: relative;
442
+ }
443
+
444
+ #steps-panel label.error,
445
+ #extensions-panel label.error,
446
+ #leads-panel label.error,
447
+ #redirect-panel label.error {
448
+ position: absolute;
449
+ top: 100%;
450
+ z-index: 99;
451
+ display: block;
452
+ width: 100%;
453
+ font-size: 12px;
454
+ color: red;
455
+ text-align: center;
456
+ }
457
+
458
+ #steps-panel .dashicons-minus,
459
+ #extensions-panel .dashicons-minus,
460
+ #leads-panel .dashicons-minus,
461
+ #redirect-panel .dashicons-minus {
462
+ cursor: pointer;
463
+ }
464
+
465
+ #steps-panel [data-toggle],
466
+ #extensions-panel [data-toggle],
467
+ #leads-panel [data-toggle],
468
+ #redirect-panel [data-toggle] {
469
+ -webkit-transition: all 300ms ease;
470
+ -o-transition: all 300ms ease;
471
+ transition: all 300ms ease;
472
+ cursor: pointer;
473
+ }
474
+
475
+ #steps-panel [data-toggle]:after,
476
+ #extensions-panel [data-toggle]:after,
477
+ #leads-panel [data-toggle]:after,
478
+ #redirect-panel [data-toggle]:after {
479
+ opacity: .8;
480
+ }
481
+
482
+ #steps-panel .mail-tags-title,
483
+ #extensions-panel .mail-tags-title,
484
+ #leads-panel .mail-tags-title,
485
+ #redirect-panel .mail-tags-title {
486
+ text-align: right;
487
+ }
488
+
489
+ #steps-panel .wp-list-table-inner tr,
490
+ #extensions-panel .wp-list-table-inner tr,
491
+ #leads-panel .wp-list-table-inner tr,
492
+ #redirect-panel .wp-list-table-inner tr {
493
+ position: relative;
494
+ }
495
+
496
+ #steps-panel span.err,
497
+ #extensions-panel span.err,
498
+ #leads-panel span.err,
499
+ #redirect-panel span.err {
500
+ position: relative;
501
+ display: block;
502
+ font-size: 12px;
503
+ color: red;
504
+ }
505
+
506
+ #steps-panel .section-inner-wrap,
507
+ #extensions-panel .section-inner-wrap,
508
+ #leads-panel .section-inner-wrap,
509
+ #redirect-panel .section-inner-wrap {
510
+ display: none;
511
+ }
512
+
513
+ #steps-panel select,
514
+ #extensions-panel select,
515
+ #leads-panel select,
516
+ #redirect-panel select {
517
+ max-width: 100%;
518
+ }
519
+
520
+ #steps-panel .hide_api_key .tags-map-api-key,
521
+ #extensions-panel .hide_api_key .tags-map-api-key,
522
+ #leads-panel .hide_api_key .tags-map-api-key,
523
+ #redirect-panel .hide_api_key .tags-map-api-key {
524
+ display: none;
525
+ }
526
+
527
+ #steps-panel .qs-tooltip,
528
+ #extensions-panel .qs-tooltip,
529
+ #leads-panel .qs-tooltip,
530
+ #redirect-panel .qs-tooltip {
531
+ position: absolute;
532
+ }
533
+
534
+ #steps-panel .qs-tooltip .qs-tooltip-inner,
535
+ #extensions-panel .qs-tooltip .qs-tooltip-inner,
536
+ #leads-panel .qs-tooltip .qs-tooltip-inner,
537
+ #redirect-panel .qs-tooltip .qs-tooltip-inner {
538
+ -webkit-transition: all 500ms ease;
539
+ -o-transition: all 500ms ease;
540
+ transition: all 500ms ease;
541
+ position: absolute;
542
+ bottom: 100%;
543
+ left: 50%;
544
+ z-index: -1;
545
+ min-width: 200px;
546
+ padding: 20px;
547
+ font-size: 14px;
548
+ background: #fff;
549
+ border: 1px solid;
550
+ border-radius: 5px;
551
+ opacity: 0;
552
+ -webkit-transform: translateX(-50%);
553
+ -ms-transform: translateX(-50%);
554
+ transform: translateX(-50%);
555
+ }
556
+
557
+ #steps-panel .qs-tooltip:hover .qs-tooltip-inner,
558
+ #extensions-panel .qs-tooltip:hover .qs-tooltip-inner,
559
+ #leads-panel .qs-tooltip:hover .qs-tooltip-inner,
560
+ #redirect-panel .qs-tooltip:hover .qs-tooltip-inner {
561
+ z-index: 9999;
562
+ opacity: 1;
563
+ }
564
+
565
+ #steps-panel .wpcf7-redirect-butify-wrap,
566
+ #extensions-panel .wpcf7-redirect-butify-wrap,
567
+ #leads-panel .wpcf7-redirect-butify-wrap,
568
+ #redirect-panel .wpcf7-redirect-butify-wrap {
569
+ float: right;
570
+ }
571
+
572
+ #steps-panel .action-container .repeater-table .field-wrap,
573
+ #extensions-panel .action-container .repeater-table .field-wrap,
574
+ #leads-panel .action-container .repeater-table .field-wrap,
575
+ #redirect-panel .action-container .repeater-table .field-wrap {
576
+ margin-bottom: 0;
577
+ }
578
+
579
+ #steps-panel .action-container .repeater-table td,
580
+ #extensions-panel .action-container .repeater-table td,
581
+ #leads-panel .action-container .repeater-table td,
582
+ #redirect-panel .action-container .repeater-table td {
583
+ padding: 5px 0;
584
+ }
585
+
586
+ #steps-panel .action-container .qs-repeater-action,
587
+ #extensions-panel .action-container .qs-repeater-action,
588
+ #leads-panel .action-container .qs-repeater-action,
589
+ #redirect-panel .action-container .qs-repeater-action {
590
+ padding: 6px 0 0 0;
591
+ margin-top: 0 !important;
592
+ }
593
+
594
+ #steps-panel .action-container .qs-repeater-action span,
595
+ #extensions-panel .action-container .qs-repeater-action span,
596
+ #leads-panel .action-container .qs-repeater-action span,
597
+ #redirect-panel .action-container .qs-repeater-action span {
598
+ -webkit-transition: all 300ms ease;
599
+ -o-transition: all 300ms ease;
600
+ transition: all 300ms ease;
601
+ cursor: pointer;
602
+ }
603
+
604
+ #steps-panel .action-container .qs-repeater-action span:hover,
605
+ #extensions-panel .action-container .qs-repeater-action span:hover,
606
+ #leads-panel .action-container .qs-repeater-action span:hover,
607
+ #redirect-panel .action-container .qs-repeater-action span:hover {
608
+ opacity: .8;
609
+ }
610
+
611
+ #steps-panel .qs-repeater-row .dashicons-plus,
612
+ #extensions-panel .qs-repeater-row .dashicons-plus,
613
+ #leads-panel .qs-repeater-row .dashicons-plus,
614
+ #redirect-panel .qs-repeater-row .dashicons-plus {
615
+ display: none;
616
+ }
617
+
618
+ #steps-panel .qs-repeater-row:last-child .dashicons-plus,
619
+ #extensions-panel .qs-repeater-row:last-child .dashicons-plus,
620
+ #leads-panel .qs-repeater-row:last-child .dashicons-plus,
621
+ #redirect-panel .qs-repeater-row:last-child .dashicons-plus {
622
+ display: inline-block;
623
+ }
624
+
625
+ #steps-panel .qs-repeater-row:first-child .dashicons-minus,
626
+ #extensions-panel .qs-repeater-row:first-child .dashicons-minus,
627
+ #leads-panel .qs-repeater-row:first-child .dashicons-minus,
628
+ #redirect-panel .qs-repeater-row:first-child .dashicons-minus {
629
+ display: none;
630
+ }
631
+
632
+ #steps-panel .qs-repeater-row .qs-repeater-action,
633
+ #extensions-panel .qs-repeater-row .qs-repeater-action,
634
+ #leads-panel .qs-repeater-row .qs-repeater-action,
635
+ #redirect-panel .qs-repeater-row .qs-repeater-action {
636
+ margin-top: 8px;
637
+ }
638
+
639
+ #steps-panel .qs-repeater-row .qs-repeater-action .dashicons,
640
+ #extensions-panel .qs-repeater-row .qs-repeater-action .dashicons,
641
+ #leads-panel .qs-repeater-row .qs-repeater-action .dashicons,
642
+ #redirect-panel .qs-repeater-row .qs-repeater-action .dashicons {
643
+ cursor: pointer;
644
+ }
645
+
646
+ #steps-panel .field-wrap,
647
+ #extensions-panel .field-wrap,
648
+ #leads-panel .field-wrap,
649
+ #redirect-panel .field-wrap {
650
+ padding: 0 10px;
651
+ clear: both;
652
+ }
653
+
654
+ #steps-panel .field-wrap .field-wrap,
655
+ #extensions-panel .field-wrap .field-wrap,
656
+ #leads-panel .field-wrap .field-wrap,
657
+ #redirect-panel .field-wrap .field-wrap {
658
+ clear: none;
659
+ }
660
+
661
+ #steps-panel .qs-section,
662
+ #extensions-panel .qs-section,
663
+ #leads-panel .qs-section,
664
+ #redirect-panel .qs-section {
665
+ padding: 10px;
666
+ margin: 10px;
667
+ background: #f9f9f9;
668
+ border: 1px solid #555;
669
+ }
670
+
671
+ #steps-panel .qs-section > label,
672
+ #extensions-panel .qs-section > label,
673
+ #leads-panel .qs-section > label,
674
+ #redirect-panel .qs-section > label {
675
+ margin-bottom: 0 !important;
676
+ }
677
+
678
+ #steps-panel .clearfix:after,
679
+ #extensions-panel .clearfix:after,
680
+ #leads-panel .clearfix:after,
681
+ #redirect-panel .clearfix:after {
682
+ display: block;
683
+ clear: both;
684
+ content: '';
685
+ }
686
+
687
+ #steps-panel .migrate-from-redirection,
688
+ #steps-panel .migrate-from-send-to-api,
689
+ #extensions-panel .migrate-from-redirection,
690
+ #extensions-panel .migrate-from-send-to-api,
691
+ #leads-panel .migrate-from-redirection,
692
+ #leads-panel .migrate-from-send-to-api,
693
+ #redirect-panel .migrate-from-redirection,
694
+ #redirect-panel .migrate-from-send-to-api {
695
+ float: right;
696
+ }
697
+
698
+ #steps-panel .error-messageselect,
699
+ #extensions-panel .error-messageselect,
700
+ #leads-panel .error-messageselect,
701
+ #redirect-panel .error-messageselect {
702
+ border: 1px solid red;
703
+ }
704
+
705
+ #steps-panel .error-label,
706
+ #extensions-panel .error-label,
707
+ #leads-panel .error-label,
708
+ #redirect-panel .error-label {
709
+ font-size: 14px;
710
+ color: red;
711
+ }
712
+
713
+ #steps-panel .add-new-action-wrap .error-label,
714
+ #extensions-panel .add-new-action-wrap .error-label,
715
+ #leads-panel .add-new-action-wrap .error-label,
716
+ #redirect-panel .add-new-action-wrap .error-label {
717
+ position: absolute;
718
+ top: 100%;
719
+ left: 0;
720
+ }
721
+
722
+ #steps-panel .actions-list tbody tr.action-container > td,
723
+ #extensions-panel .actions-list tbody tr.action-container > td,
724
+ #leads-panel .actions-list tbody tr.action-container > td,
725
+ #redirect-panel .actions-list tbody tr.action-container > td {
726
+ border-bottom: 0 !important;
727
+ }
728
+
729
+ #steps-panel .wpcf7r-checkbox input,
730
+ #extensions-panel .wpcf7r-checkbox input,
731
+ #leads-panel .wpcf7r-checkbox input,
732
+ #redirect-panel .wpcf7r-checkbox input {
733
+ position: absolute;
734
+ visibility: hidden;
735
+ opacity: 0;
736
+ }
737
+
738
+ #steps-panel .wpcf7r-checkbox input:checked + .wpcf7r-on-off-button,
739
+ #extensions-panel .wpcf7r-checkbox input:checked + .wpcf7r-on-off-button,
740
+ #leads-panel .wpcf7r-checkbox input:checked + .wpcf7r-on-off-button,
741
+ #redirect-panel .wpcf7r-checkbox input:checked + .wpcf7r-on-off-button {
742
+ border: 2px solid #1f8cbe;
743
+ }
744
+
745
+ #steps-panel .wpcf7r-checkbox input:checked + .wpcf7r-on-off-button .wpcf7r-toggle-button,
746
+ #extensions-panel .wpcf7r-checkbox input:checked + .wpcf7r-on-off-button .wpcf7r-toggle-button,
747
+ #leads-panel .wpcf7r-checkbox input:checked + .wpcf7r-on-off-button .wpcf7r-toggle-button,
748
+ #redirect-panel .wpcf7r-checkbox input:checked + .wpcf7r-on-off-button .wpcf7r-toggle-button {
749
+ right: 1px;
750
+ background: #1f8cbe;
751
+ }
752
+
753
+ #steps-panel .wpcf7r-checkbox strong.checkbox-label,
754
+ #extensions-panel .wpcf7r-checkbox strong.checkbox-label,
755
+ #leads-panel .wpcf7r-checkbox strong.checkbox-label,
756
+ #redirect-panel .wpcf7r-checkbox strong.checkbox-label {
757
+ font-weight: normal;
758
+ }
759
+
760
+ #steps-panel .wpcf7r-checkbox .wpcf7r-on-off-button,
761
+ #extensions-panel .wpcf7r-checkbox .wpcf7r-on-off-button,
762
+ #leads-panel .wpcf7r-checkbox .wpcf7r-on-off-button,
763
+ #redirect-panel .wpcf7r-checkbox .wpcf7r-on-off-button {
764
+ position: relative;
765
+ top: 3px;
766
+ display: inline-block;
767
+ width: 14px;
768
+ padding: 6px;
769
+ margin-right: 5px;
770
+ border: 2px solid #4f4f4f;
771
+ border-radius: 50px;
772
+ }
773
+
774
+ #steps-panel .wpcf7r-checkbox .wpcf7r-on-off-button .wpcf7r-toggle-button,
775
+ #extensions-panel .wpcf7r-checkbox .wpcf7r-on-off-button .wpcf7r-toggle-button,
776
+ #leads-panel .wpcf7r-checkbox .wpcf7r-on-off-button .wpcf7r-toggle-button,
777
+ #redirect-panel .wpcf7r-checkbox .wpcf7r-on-off-button .wpcf7r-toggle-button {
778
+ -webkit-transition: all 250ms ease;
779
+ -o-transition: all 250ms ease;
780
+ transition: all 250ms ease;
781
+ position: absolute;
782
+ top: 1px;
783
+ right: calc(100% - 12px);
784
+ display: inline-block;
785
+ width: 10px;
786
+ height: 10px;
787
+ cursor: pointer;
788
+ background: #4f4f4f;
789
+ border-radius: 50%;
790
+ }
791
+
792
+ #steps-panel .conditional-logic-blocks,
793
+ #extensions-panel .conditional-logic-blocks,
794
+ #leads-panel .conditional-logic-blocks,
795
+ #redirect-panel .conditional-logic-blocks {
796
+ display: none;
797
+ }
798
+
799
+ #steps-panel .conditional-logic-blocks.active,
800
+ #extensions-panel .conditional-logic-blocks.active,
801
+ #leads-panel .conditional-logic-blocks.active,
802
+ #redirect-panel .conditional-logic-blocks.active {
803
+ display: block;
804
+ }
805
+
806
+ #steps-panel .check-column,
807
+ #extensions-panel .check-column,
808
+ #leads-panel .check-column,
809
+ #redirect-panel .check-column {
810
+ padding: 10px;
811
+ }
812
+
813
+ #steps-panel .check-column .handle,
814
+ #extensions-panel .check-column .handle,
815
+ #leads-panel .check-column .handle,
816
+ #redirect-panel .check-column .handle {
817
+ cursor: pointer;
818
+ }
819
+
820
+ #steps-panel .action-container .wp-list-table-inner td,
821
+ #steps-panel .action-container .wp-list-table-inner th,
822
+ #extensions-panel .action-container .wp-list-table-inner td,
823
+ #extensions-panel .action-container .wp-list-table-inner th,
824
+ #leads-panel .action-container .wp-list-table-inner td,
825
+ #leads-panel .action-container .wp-list-table-inner th,
826
+ #redirect-panel .action-container .wp-list-table-inner td,
827
+ #redirect-panel .action-container .wp-list-table-inner th {
828
+ padding: 5px 10px;
829
+ }
830
+
831
+ #steps-panel .action-container td,
832
+ #extensions-panel .action-container td,
833
+ #leads-panel .action-container td,
834
+ #redirect-panel .action-container td {
835
+ padding: 0;
836
+ }
837
+
838
+ #steps-panel .wp-list-table tr td,
839
+ #extensions-panel .wp-list-table tr td,
840
+ #leads-panel .wp-list-table tr td,
841
+ #redirect-panel .wp-list-table tr td {
842
+ position: relative;
843
+ }
844
+
845
+ #steps-panel .hidden-action,
846
+ #extensions-panel .hidden-action,
847
+ #leads-panel .hidden-action,
848
+ #redirect-panel .hidden-action {
849
+ display: none;
850
+ padding: 10px;
851
+ }
852
+
853
+ #steps-panel .actions-list,
854
+ #extensions-panel .actions-list,
855
+ #leads-panel .actions-list,
856
+ #redirect-panel .actions-list {
857
+ position: relative;
858
+ margin-top: 20px;
859
+ margin-bottom: 20px;
860
+ }
861
+
862
+ #steps-panel .actions-list .actions,
863
+ #extensions-panel .actions-list .actions,
864
+ #leads-panel .actions-list .actions,
865
+ #redirect-panel .actions-list .actions {
866
+ margin-bottom: 20px;
867
+ }
868
+
869
+ #steps-panel .actions-list tbody tr[data-actionid] > td,
870
+ #extensions-panel .actions-list tbody tr[data-actionid] > td,
871
+ #leads-panel .actions-list tbody tr[data-actionid] > td,
872
+ #redirect-panel .actions-list tbody tr[data-actionid] > td {
873
+ border-bottom: 1px solid #e1e1e1;
874
+ }
875
+
876
+ #steps-panel .actions-list tbody tr.non-active .column-status a,
877
+ #extensions-panel .actions-list tbody tr.non-active .column-status a,
878
+ #leads-panel .actions-list tbody tr.non-active .column-status a,
879
+ #redirect-panel .actions-list tbody tr.non-active .column-status a {
880
+ color: red;
881
+ }
882
+
883
+ #steps-panel .open-tab,
884
+ #extensions-panel .open-tab,
885
+ #leads-panel .open-tab,
886
+ #redirect-panel .open-tab {
887
+ float: right;
888
+ cursor: pointer;
889
+ }
890
+
891
+ #steps-panel .active .open-tab.dashicons-arrow-down-alt2:before,
892
+ #extensions-panel .active .open-tab.dashicons-arrow-down-alt2:before,
893
+ #leads-panel .active .open-tab.dashicons-arrow-down-alt2:before,
894
+ #redirect-panel .active .open-tab.dashicons-arrow-down-alt2:before {
895
+ content: '\f343';
896
+ }
897
+
898
+ #steps-panel [data-tab],
899
+ #extensions-panel [data-tab],
900
+ #leads-panel [data-tab],
901
+ #redirect-panel [data-tab] {
902
+ display: none;
903
+ width: 100%;
904
+ clear: both;
905
+ }
906
+
907
+ #steps-panel h3,
908
+ #extensions-panel h3,
909
+ #leads-panel h3,
910
+ #redirect-panel h3 {
911
+ margin-top: 0;
912
+ margin-bottom: 0;
913
+ }
914
+
915
+ #steps-panel h3.active .dashicons-plus-alt:before,
916
+ #extensions-panel h3.active .dashicons-plus-alt:before,
917
+ #leads-panel h3.active .dashicons-plus-alt:before,
918
+ #redirect-panel h3.active .dashicons-plus-alt:before {
919
+ content: '\f460';
920
+ }
921
+
922
+ #steps-panel [data-tab-target],
923
+ #extensions-panel [data-tab-target],
924
+ #leads-panel [data-tab-target],
925
+ #redirect-panel [data-tab-target] {
926
+ cursor: pointer;
927
+ }
928
+
929
+ #steps-panel .conditional-groups-wrap:after,
930
+ #extensions-panel .conditional-groups-wrap:after,
931
+ #leads-panel .conditional-groups-wrap:after,
932
+ #redirect-panel .conditional-groups-wrap:after {
933
+ display: block;
934
+ clear: both;
935
+ content: '';
936
+ }
937
+
938
+ #steps-panel .conditional-groups-wrap .group-title,
939
+ #extensions-panel .conditional-groups-wrap .group-title,
940
+ #leads-panel .conditional-groups-wrap .group-title,
941
+ #redirect-panel .conditional-groups-wrap .group-title {
942
+ padding: 0 10px;
943
+ font-weight: bold;
944
+ }
945
+
946
+ #steps-panel .conditional-groups-wrap .wpcf7r-add-block,
947
+ #extensions-panel .conditional-groups-wrap .wpcf7r-add-block,
948
+ #leads-panel .conditional-groups-wrap .wpcf7r-add-block,
949
+ #redirect-panel .conditional-groups-wrap .wpcf7r-add-block {
950
+ padding: 5px 0;
951
+ cursor: pointer;
952
+ }
953
+
954
+ #steps-panel .conditional-groups-wrap .wpcf7r-add-block:hover,
955
+ #extensions-panel .conditional-groups-wrap .wpcf7r-add-block:hover,
956
+ #leads-panel .conditional-groups-wrap .wpcf7r-add-block:hover,
957
+ #redirect-panel .conditional-groups-wrap .wpcf7r-add-block:hover {
958
+ -webkit-transition: all 150ms ease;
959
+ -o-transition: all 150ms ease;
960
+ transition: all 150ms ease;
961
+ color: #1e8cbe;
962
+ }
963
+
964
+ #steps-panel .conditional-groups-wrap .conditional-groups .dashicons-minus,
965
+ #extensions-panel .conditional-groups-wrap .conditional-groups .dashicons-minus,
966
+ #leads-panel .conditional-groups-wrap .conditional-groups .dashicons-minus,
967
+ #redirect-panel .conditional-groups-wrap .conditional-groups .dashicons-minus {
968
+ -webkit-transition: all 150ms ease;
969
+ -o-transition: all 150ms ease;
970
+ transition: all 150ms ease;
971
+ float: right;
972
+ padding: 3px;
973
+ cursor: pointer;
974
+ border: 1px solid #ccc;
975
+ border-radius: 50%;
976
+ }
977
+
978
+ #steps-panel .conditional-groups-wrap .conditional-groups .dashicons-minus:hover,
979
+ #extensions-panel .conditional-groups-wrap .conditional-groups .dashicons-minus:hover,
980
+ #leads-panel .conditional-groups-wrap .conditional-groups .dashicons-minus:hover,
981
+ #redirect-panel .conditional-groups-wrap .conditional-groups .dashicons-minus:hover {
982
+ color: #fff;
983
+ background: #1e8cbe;
984
+ border: 1px solid #1e8cbe;
985
+ }
986
+
987
+ #steps-panel .conditional-groups-wrap .conditional-groups .row-titles:first-child .row-template:first-child .dashicons-minus,
988
+ #steps-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group:first-child .row-template:first-child .dashicons-minus,
989
+ #extensions-panel .conditional-groups-wrap .conditional-groups .row-titles:first-child .row-template:first-child .dashicons-minus,
990
+ #extensions-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group:first-child .row-template:first-child .dashicons-minus,
991
+ #leads-panel .conditional-groups-wrap .conditional-groups .row-titles:first-child .row-template:first-child .dashicons-minus,
992
+ #leads-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group:first-child .row-template:first-child .dashicons-minus,
993
+ #redirect-panel .conditional-groups-wrap .conditional-groups .row-titles:first-child .row-template:first-child .dashicons-minus,
994
+ #redirect-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group:first-child .row-template:first-child .dashicons-minus {
995
+ display: none;
996
+ }
997
+
998
+ #steps-panel .conditional-groups-wrap .conditional-groups .row-titles ul,
999
+ #steps-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul,
1000
+ #extensions-panel .conditional-groups-wrap .conditional-groups .row-titles ul,
1001
+ #extensions-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul,
1002
+ #leads-panel .conditional-groups-wrap .conditional-groups .row-titles ul,
1003
+ #leads-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul,
1004
+ #redirect-panel .conditional-groups-wrap .conditional-groups .row-titles ul,
1005
+ #redirect-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul {
1006
+ display: -webkit-box;
1007
+ display: -moz-flex;
1008
+ display: -ms-flexbox;
1009
+ display: flex;
1010
+ justify-content: space-around;
1011
+ -webkit-justify-content: space-around;
1012
+ -moz-justify-content: space-around;
1013
+ -ms-flex-pack: distribute;
1014
+ margin-bottom: 0;
1015
+ }
1016
+
1017
+ #steps-panel .conditional-groups-wrap .conditional-groups .row-titles ul li,
1018
+ #steps-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul li,
1019
+ #extensions-panel .conditional-groups-wrap .conditional-groups .row-titles ul li,
1020
+ #extensions-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul li,
1021
+ #leads-panel .conditional-groups-wrap .conditional-groups .row-titles ul li,
1022
+ #leads-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul li,
1023
+ #redirect-panel .conditional-groups-wrap .conditional-groups .row-titles ul li,
1024
+ #redirect-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul li {
1025
+ width: 33%;
1026
+ padding: 0 10px;
1027
+ margin-bottom: 0;
1028
+ }
1029
+
1030
+ #steps-panel .conditional-groups-wrap .conditional-groups .row-titles ul select,
1031
+ #steps-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul select,
1032
+ #extensions-panel .conditional-groups-wrap .conditional-groups .row-titles ul select,
1033
+ #extensions-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul select,
1034
+ #leads-panel .conditional-groups-wrap .conditional-groups .row-titles ul select,
1035
+ #leads-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul select,
1036
+ #redirect-panel .conditional-groups-wrap .conditional-groups .row-titles ul select,
1037
+ #redirect-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul select {
1038
+ width: 100%;
1039
+ }
1040
+
1041
+ #steps-panel .conditional-groups-wrap .conditional-groups .row-titles ul .group_row_value,
1042
+ #steps-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul .group_row_value,
1043
+ #extensions-panel .conditional-groups-wrap .conditional-groups .row-titles ul .group_row_value,
1044
+ #extensions-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul .group_row_value,
1045
+ #leads-panel .conditional-groups-wrap .conditional-groups .row-titles ul .group_row_value,
1046
+ #leads-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul .group_row_value,
1047
+ #redirect-panel .conditional-groups-wrap .conditional-groups .row-titles ul .group_row_value,
1048
+ #redirect-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul .group_row_value {
1049
+ float: left;
1050
+ width: calc(100% - 50px);
1051
+ }
1052
+
1053
+ #steps-panel .conditional-groups-wrap .conditional-groups .row-titles,
1054
+ #extensions-panel .conditional-groups-wrap .conditional-groups .row-titles,
1055
+ #leads-panel .conditional-groups-wrap .conditional-groups .row-titles,
1056
+ #redirect-panel .conditional-groups-wrap .conditional-groups .row-titles {
1057
+ width: 90%;
1058
+ }
1059
+
1060
+ #steps-panel .conditional-groups-wrap .wpcfr-rule-group,
1061
+ #extensions-panel .conditional-groups-wrap .wpcfr-rule-group,
1062
+ #leads-panel .conditional-groups-wrap .wpcfr-rule-group,
1063
+ #redirect-panel .conditional-groups-wrap .wpcfr-rule-group {
1064
+ padding: 0 0 10px 0;
1065
+ }
1066
+
1067
+ #steps-panel .conditional-groups-wrap .wpcfr-rule-group:after,
1068
+ #extensions-panel .conditional-groups-wrap .wpcfr-rule-group:after,
1069
+ #leads-panel .conditional-groups-wrap .wpcfr-rule-group:after,
1070
+ #redirect-panel .conditional-groups-wrap .wpcfr-rule-group:after {
1071
+ display: block;
1072
+ clear: both;
1073
+ content: '';
1074
+ }
1075
+
1076
+ #steps-panel .conditional-groups-wrap .wpcfr-rule-group:first-child .group-title,
1077
+ #extensions-panel .conditional-groups-wrap .wpcfr-rule-group:first-child .group-title,
1078
+ #leads-panel .conditional-groups-wrap .wpcfr-rule-group:first-child .group-title,
1079
+ #redirect-panel .conditional-groups-wrap .wpcfr-rule-group:first-child .group-title {
1080
+ display: none;
1081
+ }
1082
+
1083
+ #steps-panel .leads-list input,
1084
+ #extensions-panel .leads-list input,
1085
+ #leads-panel .leads-list input,
1086
+ #redirect-panel .leads-list input {
1087
+ max-width: 100%;
1088
+ }
1089
+
1090
+ #steps-panel .leads-list td,
1091
+ #extensions-panel .leads-list td,
1092
+ #leads-panel .leads-list td,
1093
+ #redirect-panel .leads-list td {
1094
+ padding: 5px !important;
1095
+ }
1096
+
1097
+ #steps-panel .leads-list td input,
1098
+ #steps-panel .leads-list td select,
1099
+ #steps-panel .leads-list td textarea,
1100
+ #extensions-panel .leads-list td input,
1101
+ #extensions-panel .leads-list td select,
1102
+ #extensions-panel .leads-list td textarea,
1103
+ #leads-panel .leads-list td input,
1104
+ #leads-panel .leads-list td select,
1105
+ #leads-panel .leads-list td textarea,
1106
+ #redirect-panel .leads-list td input,
1107
+ #redirect-panel .leads-list td select,
1108
+ #redirect-panel .leads-list td textarea {
1109
+ width: 100%;
1110
+ }
1111
+
1112
+ #steps-panel .leads-list td .field-wrap,
1113
+ #extensions-panel .leads-list td .field-wrap,
1114
+ #leads-panel .leads-list td .field-wrap,
1115
+ #redirect-panel .leads-list td .field-wrap {
1116
+ padding: 0;
1117
+ }
1118
+
1119
+ #steps-panel .groups-actions,
1120
+ #extensions-panel .groups-actions,
1121
+ #leads-panel .groups-actions,
1122
+ #redirect-panel .groups-actions {
1123
+ margin-top: 10px;
1124
+ }
1125
+
1126
+ #steps-panel .add-condition,
1127
+ #extensions-panel .add-condition,
1128
+ #leads-panel .add-condition,
1129
+ #redirect-panel .add-condition {
1130
+ display: none;
1131
+ float: right;
1132
+ }
1133
+
1134
+ #steps-panel .wpcf7r-what-to-do .field-wrap label,
1135
+ #extensions-panel .wpcf7r-what-to-do .field-wrap label,
1136
+ #leads-panel .wpcf7r-what-to-do .field-wrap label,
1137
+ #redirect-panel .wpcf7r-what-to-do .field-wrap label {
1138
+ float: right;
1139
+ width: calc(100% - 30px);
1140
+ }
1141
+
1142
+ #steps-panel .group-group-0 .row-template:first-child .dashicons-minus,
1143
+ #extensions-panel .group-group-0 .row-template:first-child .dashicons-minus,
1144
+ #leads-panel .group-group-0 .row-template:first-child .dashicons-minus,
1145
+ #redirect-panel .group-group-0 .row-template:first-child .dashicons-minus {
1146
+ display: none;
1147
+ }
1148
+
1149
+ #steps-panel .conditional-group-block,
1150
+ #extensions-panel .conditional-group-block,
1151
+ #leads-panel .conditional-group-block,
1152
+ #redirect-panel .conditional-group-block {
1153
+ display: none;
1154
+ }
1155
+
1156
+ #steps-panel .conditional-group-block.active,
1157
+ #extensions-panel .conditional-group-block.active,
1158
+ #leads-panel .conditional-group-block.active,
1159
+ #redirect-panel .conditional-group-block.active {
1160
+ display: block;
1161
+ }
1162
+
1163
+ #steps-panel .conditional-group-block tbody tr:last-child .add-condition,
1164
+ #extensions-panel .conditional-group-block tbody tr:last-child .add-condition,
1165
+ #leads-panel .conditional-group-block tbody tr:last-child .add-condition,
1166
+ #redirect-panel .conditional-group-block tbody tr:last-child .add-condition {
1167
+ display: block;
1168
+ }
1169
+
1170
+ #steps-panel .title-or,
1171
+ #extensions-panel .title-or,
1172
+ #leads-panel .title-or,
1173
+ #redirect-panel .title-or {
1174
+ padding: 8px !important;
1175
+ margin-bottom: 10px;
1176
+ text-align: center;
1177
+ background: #e8e8e8;
1178
+ }
1179
+
1180
+ #steps-panel .field-wrap input[type='checkbox']:checked + label + input,
1181
+ #extensions-panel .field-wrap input[type='checkbox']:checked + label + input,
1182
+ #leads-panel .field-wrap input[type='checkbox']:checked + label + input,
1183
+ #redirect-panel .field-wrap input[type='checkbox']:checked + label + input {
1184
+ display: block;
1185
+ }
1186
+
1187
+ #steps-panel .conditional-group-block-title,
1188
+ #extensions-panel .conditional-group-block-title,
1189
+ #leads-panel .conditional-group-block-title,
1190
+ #redirect-panel .conditional-group-block-title {
1191
+ padding: 0 10px;
1192
+ }
1193
+
1194
+ #steps-panel .conditional-group-titles,
1195
+ #extensions-panel .conditional-group-titles,
1196
+ #leads-panel .conditional-group-titles,
1197
+ #redirect-panel .conditional-group-titles {
1198
+ display: -webkit-box;
1199
+ display: -moz-flex;
1200
+ display: -ms-flexbox;
1201
+ display: flex;
1202
+ flex-wrap: wrap;
1203
+ -webkit-flex-wrap: wrap;
1204
+ -moz-flex-wrap: wrap;
1205
+ -ms-flex-wrap: wrap;
1206
+ }
1207
+
1208
+ #steps-panel .conditional-group-titles:after,
1209
+ #extensions-panel .conditional-group-titles:after,
1210
+ #leads-panel .conditional-group-titles:after,
1211
+ #redirect-panel .conditional-group-titles:after {
1212
+ display: block;
1213
+ clear: both;
1214
+ content: '';
1215
+ }
1216
+
1217
+ #steps-panel .conditional-group-titles .block-title,
1218
+ #extensions-panel .conditional-group-titles .block-title,
1219
+ #leads-panel .conditional-group-titles .block-title,
1220
+ #redirect-panel .conditional-group-titles .block-title {
1221
+ display: -webkit-box;
1222
+ display: -moz-flex;
1223
+ display: -ms-flexbox;
1224
+ display: flex;
1225
+ }
1226
+
1227
+ #steps-panel .conditional-group-titles .block-title:first-child .dashicons-minus,
1228
+ #extensions-panel .conditional-group-titles .block-title:first-child .dashicons-minus,
1229
+ #leads-panel .conditional-group-titles .block-title:first-child .dashicons-minus,
1230
+ #redirect-panel .conditional-group-titles .block-title:first-child .dashicons-minus {
1231
+ display: none !important;
1232
+ }
1233
+
1234
+ #steps-panel .conditional-group-titles .block-title [type='text'][readonly],
1235
+ #extensions-panel .conditional-group-titles .block-title [type='text'][readonly],
1236
+ #leads-panel .conditional-group-titles .block-title [type='text'][readonly],
1237
+ #redirect-panel .conditional-group-titles .block-title [type='text'][readonly] {
1238
+ display: inline-block;
1239
+ width: auto !important;
1240
+ cursor: pointer;
1241
+ border: 0;
1242
+ -webkit-box-shadow: none;
1243
+ box-shadow: none;
1244
+ }
1245
+
1246
+ #steps-panel .conditional-group-titles .block-title .dashicons,
1247
+ #extensions-panel .conditional-group-titles .block-title .dashicons,
1248
+ #leads-panel .conditional-group-titles .block-title .dashicons,
1249
+ #redirect-panel .conditional-group-titles .block-title .dashicons {
1250
+ margin-top: 4px;
1251
+ cursor: pointer;
1252
+ }
1253
+
1254
+ #steps-panel .conditional-group-titles .block-title .dashicons.show-on-edit,
1255
+ #extensions-panel .conditional-group-titles .block-title .dashicons.show-on-edit,
1256
+ #leads-panel .conditional-group-titles .block-title .dashicons.show-on-edit,
1257
+ #redirect-panel .conditional-group-titles .block-title .dashicons.show-on-edit {
1258
+ display: none;
1259
+ }
1260
+
1261
+ #steps-panel .conditional-group-titles .block-title.active,
1262
+ #extensions-panel .conditional-group-titles .block-title.active,
1263
+ #leads-panel .conditional-group-titles .block-title.active,
1264
+ #redirect-panel .conditional-group-titles .block-title.active {
1265
+ color: #0085ba;
1266
+ }
1267
+
1268
+ #steps-panel .conditional-group-titles .block-title.active input,
1269
+ #extensions-panel .conditional-group-titles .block-title.active input,
1270
+ #leads-panel .conditional-group-titles .block-title.active input,
1271
+ #redirect-panel .conditional-group-titles .block-title.active input {
1272
+ color: #0085ba;
1273
+ }
1274
+
1275
+ #steps-panel .conditional-group-titles .block-title.edit .dashicons,
1276
+ #extensions-panel .conditional-group-titles .block-title.edit .dashicons,
1277
+ #leads-panel .conditional-group-titles .block-title.edit .dashicons,
1278
+ #redirect-panel .conditional-group-titles .block-title.edit .dashicons {
1279
+ display: none;
1280
+ cursor: pointer;
1281
+ }
1282
+
1283
+ #steps-panel .conditional-group-titles .block-title.edit .dashicons.show-on-edit,
1284
+ #extensions-panel .conditional-group-titles .block-title.edit .dashicons.show-on-edit,
1285
+ #leads-panel .conditional-group-titles .block-title.edit .dashicons.show-on-edit,
1286
+ #redirect-panel .conditional-group-titles .block-title.edit .dashicons.show-on-edit {
1287
+ display: block;
1288
+ }
1289
+
1290
+ #steps-panel .wpcf7-then,
1291
+ #extensions-panel .wpcf7-then,
1292
+ #leads-panel .wpcf7-then,
1293
+ #redirect-panel .wpcf7-then {
1294
+ padding: 10px;
1295
+ }
1296
+
1297
+ #steps-panel [data-redirect-type],
1298
+ #extensions-panel [data-redirect-type],
1299
+ #leads-panel [data-redirect-type],
1300
+ #redirect-panel [data-redirect-type] {
1301
+ display: none;
1302
+ }
1303
+
1304
+ #steps-panel .wpcfr-banner-holder .dashicons-no,
1305
+ #extensions-panel .wpcfr-banner-holder .dashicons-no,
1306
+ #leads-panel .wpcfr-banner-holder .dashicons-no,
1307
+ #redirect-panel .wpcfr-banner-holder .dashicons-no {
1308
+ cursor: pointer;
1309
+ }
1310
+
1311
+ #steps-panel img,
1312
+ #extensions-panel img,
1313
+ #leads-panel img,
1314
+ #redirect-panel img {
1315
+ max-width: 100%;
1316
+ }
1317
+
1318
+ #steps-panel .wpcf7-error-message,
1319
+ #extensions-panel .wpcf7-error-message,
1320
+ #leads-panel .wpcf7-error-message,
1321
+ #redirect-panel .wpcf7-error-message {
1322
+ padding: 20px 0;
1323
+ color: red;
1324
+ }
1325
+
1326
+ #steps-panel .select2-container,
1327
+ #extensions-panel .select2-container,
1328
+ #leads-panel .select2-container,
1329
+ #redirect-panel .select2-container {
1330
+ display: block;
1331
+ width: 100% !important;
1332
+ }
1333
+
1334
+ #steps-panel .select2-container--default .select2-selection--single .select2-selection__arrow,
1335
+ #extensions-panel .select2-container--default .select2-selection--single .select2-selection__arrow,
1336
+ #leads-panel .select2-container--default .select2-selection--single .select2-selection__arrow,
1337
+ #redirect-panel .select2-container--default .select2-selection--single .select2-selection__arrow {
1338
+ height: 36px;
1339
+ }
1340
+
1341
+ #steps-panel .select2-container--default .select2-selection--single .select2-selection__rendered,
1342
+ #extensions-panel .select2-container--default .select2-selection--single .select2-selection__rendered,
1343
+ #leads-panel .select2-container--default .select2-selection--single .select2-selection__rendered,
1344
+ #redirect-panel .select2-container--default .select2-selection--single .select2-selection__rendered {
1345
+ line-height: 35px;
1346
+ }
1347
+
1348
+ #steps-panel .wpcf7-success-message,
1349
+ #extensions-panel .wpcf7-success-message,
1350
+ #leads-panel .wpcf7-success-message,
1351
+ #redirect-panel .wpcf7-success-message {
1352
+ margin-top: 10px;
1353
+ font-weight: bold;
1354
+ color: green;
1355
+ }
1356
+
1357
+ #steps-panel .field-wrap,
1358
+ #extensions-panel .field-wrap,
1359
+ #leads-panel .field-wrap,
1360
+ #redirect-panel .field-wrap {
1361
+ margin-bottom: 10px;
1362
+ }
1363
+
1364
+ #steps-panel .field-wrap select,
1365
+ #steps-panel .field-wrap [type='number'],
1366
+ #steps-panel .field-wrap [type='email'],
1367
+ #steps-panel .field-wrap [type='password'],
1368
+ #steps-panel .field-wrap [type='url'],
1369
+ #steps-panel .field-wrap [type='text'],
1370
+ #extensions-panel .field-wrap select,
1371
+ #extensions-panel .field-wrap [type='number'],
1372
+ #extensions-panel .field-wrap [type='email'],
1373
+ #extensions-panel .field-wrap [type='password'],
1374
+ #extensions-panel .field-wrap [type='url'],
1375
+ #extensions-panel .field-wrap [type='text'],
1376
+ #leads-panel .field-wrap select,
1377
+ #leads-panel .field-wrap [type='number'],
1378
+ #leads-panel .field-wrap [type='email'],
1379
+ #leads-panel .field-wrap [type='password'],
1380
+ #leads-panel .field-wrap [type='url'],
1381
+ #leads-panel .field-wrap [type='text'],
1382
+ #redirect-panel .field-wrap select,
1383
+ #redirect-panel .field-wrap [type='number'],
1384
+ #redirect-panel .field-wrap [type='email'],
1385
+ #redirect-panel .field-wrap [type='password'],
1386
+ #redirect-panel .field-wrap [type='url'],
1387
+ #redirect-panel .field-wrap [type='text'] {
1388
+ width: 100%;
1389
+ height: 38px;
1390
+ margin: 0;
1391
+ border-radius: 0;
1392
+ }
1393
+
1394
+ #steps-panel .field-wrap textarea,
1395
+ #extensions-panel .field-wrap textarea,
1396
+ #leads-panel .field-wrap textarea,
1397
+ #redirect-panel .field-wrap textarea {
1398
+ width: 100%;
1399
+ margin: 0;
1400
+ border-radius: 0;
1401
+ -webkit-box-shadow: 0;
1402
+ box-shadow: 0;
1403
+ }
1404
+
1405
+ #steps-panel .field-wrap .image-uploader-btn,
1406
+ #extensions-panel .field-wrap .image-uploader-btn,
1407
+ #leads-panel .field-wrap .image-uploader-btn,
1408
+ #redirect-panel .field-wrap .image-uploader-btn {
1409
+ display: block;
1410
+ clear: both;
1411
+ }
1412
+
1413
+ #steps-panel .field-wrap .wp-picker-container .wp-color-result,
1414
+ #extensions-panel .field-wrap .wp-picker-container .wp-color-result,
1415
+ #leads-panel .field-wrap .wp-picker-container .wp-color-result,
1416
+ #redirect-panel .field-wrap .wp-picker-container .wp-color-result {
1417
+ width: 38px;
1418
+ height: 38px;
1419
+ overflow: hidden;
1420
+ text-indent: -999px;
1421
+ vertical-align: top;
1422
+ border: 1px solid #000;
1423
+ border-radius: 50%;
1424
+ }
1425
+
1426
+ #steps-panel .field-wrap [type='checkbox'],
1427
+ #extensions-panel .field-wrap [type='checkbox'],
1428
+ #leads-panel .field-wrap [type='checkbox'],
1429
+ #redirect-panel .field-wrap [type='checkbox'] {
1430
+ margin-top: 1px;
1431
+ }
1432
+
1433
+ #steps-panel .field-wrap textarea,
1434
+ #extensions-panel .field-wrap textarea,
1435
+ #leads-panel .field-wrap textarea,
1436
+ #redirect-panel .field-wrap textarea {
1437
+ width: 100%;
1438
+ direction: ltr;
1439
+ }
1440
+
1441
+ #steps-panel .repeater-wrap,
1442
+ #extensions-panel .repeater-wrap,
1443
+ #leads-panel .repeater-wrap,
1444
+ #redirect-panel .repeater-wrap {
1445
+ display: block;
1446
+ width: 100%;
1447
+ }
1448
+
1449
+ #steps-panel .repeater-wrap:before,
1450
+ #steps-panel .repeater-wrap:after,
1451
+ #extensions-panel .repeater-wrap:before,
1452
+ #extensions-panel .repeater-wrap:after,
1453
+ #leads-panel .repeater-wrap:before,
1454
+ #leads-panel .repeater-wrap:after,
1455
+ #redirect-panel .repeater-wrap:before,
1456
+ #redirect-panel .repeater-wrap:after {
1457
+ display: table;
1458
+ clear: both;
1459
+ content: ' ';
1460
+ }
1461
+
1462
+ #steps-panel .qs-row,
1463
+ #extensions-panel .qs-row,
1464
+ #leads-panel .qs-row,
1465
+ #redirect-panel .qs-row {
1466
+ float: left;
1467
+ width: 100%;
1468
+ -webkit-box-sizing: border-box;
1469
+ box-sizing: border-box;
1470
+ margin: 0 auto;
1471
+ }
1472
+
1473
+ #steps-panel .qs-row .image-uploader-btn,
1474
+ #extensions-panel .qs-row .image-uploader-btn,
1475
+ #leads-panel .qs-row .image-uploader-btn,
1476
+ #redirect-panel .qs-row .image-uploader-btn {
1477
+ max-width: 100px;
1478
+ text-align: center;
1479
+ padding: 5px;
1480
+ min-height: 0;
1481
+ height: auto;
1482
+ line-height: normal;
1483
+ }
1484
+
1485
+ #steps-panel .qs-row:before,
1486
+ #steps-panel .qs-row:after,
1487
+ #extensions-panel .qs-row:before,
1488
+ #extensions-panel .qs-row:after,
1489
+ #leads-panel .qs-row:before,
1490
+ #leads-panel .qs-row:after,
1491
+ #redirect-panel .qs-row:before,
1492
+ #redirect-panel .qs-row:after {
1493
+ display: table;
1494
+ clear: both;
1495
+ content: ' ';
1496
+ }
1497
+
1498
+ #steps-panel .qs-row .qs-col,
1499
+ #extensions-panel .qs-row .qs-col,
1500
+ #leads-panel .qs-row .qs-col,
1501
+ #redirect-panel .qs-row .qs-col {
1502
+ position: relative;
1503
+ float: left;
1504
+ -webkit-box-sizing: border-box;
1505
+ box-sizing: border-box;
1506
+ padding-right: 10px;
1507
+ padding-left: 10px;
1508
+ clear: none;
1509
+ }
1510
+
1511
+ #steps-panel .qs-row .qs-col.clear,
1512
+ #extensions-panel .qs-row .qs-col.clear,
1513
+ #leads-panel .qs-row .qs-col.clear,
1514
+ #redirect-panel .qs-row .qs-col.clear {
1515
+ clear: both;
1516
+ }
1517
+
1518
+ #steps-panel .qs-row label,
1519
+ #extensions-panel .qs-row label,
1520
+ #leads-panel .qs-row label,
1521
+ #redirect-panel .qs-row label {
1522
+ display: block;
1523
+ }
1524
+
1525
+ #steps-panel .qs-row .qs-col-12,
1526
+ #extensions-panel .qs-row .qs-col-12,
1527
+ #leads-panel .qs-row .qs-col-12,
1528
+ #redirect-panel .qs-row .qs-col-12 {
1529
+ width: 100%;
1530
+ }
1531
+
1532
+ #steps-panel .qs-row .qs-col-8,
1533
+ #extensions-panel .qs-row .qs-col-8,
1534
+ #leads-panel .qs-row .qs-col-8,
1535
+ #redirect-panel .qs-row .qs-col-8 {
1536
+ width: 66%;
1537
+ }
1538
+
1539
+ #steps-panel .qs-row .qs-col-7,
1540
+ #extensions-panel .qs-row .qs-col-7,
1541
+ #leads-panel .qs-row .qs-col-7,
1542
+ #redirect-panel .qs-row .qs-col-7 {
1543
+ width: 58%;
1544
+ }
1545
+
1546
+ #steps-panel .qs-row .qs-col-6,
1547
+ #extensions-panel .qs-row .qs-col-6,
1548
+ #leads-panel .qs-row .qs-col-6,
1549
+ #redirect-panel .qs-row .qs-col-6 {
1550
+ width: 50%;
1551
+ }
1552
+
1553
+ #steps-panel .qs-row .qs-col-5,
1554
+ #extensions-panel .qs-row .qs-col-5,
1555
+ #leads-panel .qs-row .qs-col-5,
1556
+ #redirect-panel .qs-row .qs-col-5 {
1557
+ width: 43%;
1558
+ }
1559
+
1560
+ #steps-panel .qs-row .qs-col-4,
1561
+ #extensions-panel .qs-row .qs-col-4,
1562
+ #leads-panel .qs-row .qs-col-4,
1563
+ #redirect-panel .qs-row .qs-col-4 {
1564
+ width: 33%;
1565
+ }
1566
+
1567
+ #steps-panel .qs-row .qs-col-3,
1568
+ #extensions-panel .qs-row .qs-col-3,
1569
+ #leads-panel .qs-row .qs-col-3,
1570
+ #redirect-panel .qs-row .qs-col-3 {
1571
+ width: 25%;
1572
+ }
1573
+
1574
+ #steps-panel .qs-row .qs-col-2,
1575
+ #extensions-panel .qs-row .qs-col-2,
1576
+ #leads-panel .qs-row .qs-col-2,
1577
+ #redirect-panel .qs-row .qs-col-2 {
1578
+ width: 16.666666666666%;
1579
+ }
1580
+
1581
+ #steps-panel .qs-row .qs-col-1,
1582
+ #extensions-panel .qs-row .qs-col-1,
1583
+ #leads-panel .qs-row .qs-col-1,
1584
+ #redirect-panel .qs-row .qs-col-1 {
1585
+ width: 8%;
1586
+ }
1587
+
1588
+ #steps-panel .field-wrap-after-sent-script,
1589
+ #extensions-panel .field-wrap-after-sent-script,
1590
+ #leads-panel .field-wrap-after-sent-script,
1591
+ #redirect-panel .field-wrap-after-sent-script {
1592
+ margin-top: 10px;
1593
+ }
1594
+
1595
+ #steps-panel .field-wrap-page-id label,
1596
+ #steps-panel .field-wrap-after-sent-script label,
1597
+ #extensions-panel .field-wrap-page-id label,
1598
+ #extensions-panel .field-wrap-after-sent-script label,
1599
+ #leads-panel .field-wrap-page-id label,
1600
+ #leads-panel .field-wrap-after-sent-script label,
1601
+ #redirect-panel .field-wrap-page-id label,
1602
+ #redirect-panel .field-wrap-after-sent-script label {
1603
+ margin-bottom: 5px;
1604
+ }
1605
+
1606
+ #steps-panel .field-wrap-http-build-query-selectively [type='text'],
1607
+ #extensions-panel .field-wrap-http-build-query-selectively [type='text'],
1608
+ #leads-panel .field-wrap-http-build-query-selectively [type='text'],
1609
+ #redirect-panel .field-wrap-http-build-query-selectively [type='text'] {
1610
+ margin-top: 10px;
1611
+ }
1612
+
1613
+ #steps-panel .field-wrap-after-sent-script .field-message,
1614
+ #extensions-panel .field-wrap-after-sent-script .field-message,
1615
+ #leads-panel .field-wrap-after-sent-script .field-message,
1616
+ #redirect-panel .field-wrap-after-sent-script .field-message {
1617
+ margin-bottom: 10px;
1618
+ }
1619
+
1620
+ #steps-panel .field-notice,
1621
+ #extensions-panel .field-notice,
1622
+ #leads-panel .field-notice,
1623
+ #redirect-panel .field-notice {
1624
+ padding: 5px;
1625
+ margin-top: 10px;
1626
+ margin-bottom: 10px;
1627
+ background: #fff;
1628
+ border: 1px solid;
1629
+ border-radius: 4px;
1630
+ }
1631
+
1632
+ #steps-panel .field-notice-alert,
1633
+ #extensions-panel .field-notice-alert,
1634
+ #leads-panel .field-notice-alert,
1635
+ #redirect-panel .field-notice-alert {
1636
+ color: #8a6d3b;
1637
+ background-color: #fcf8e3;
1638
+ border: 1px solid #faebcc;
1639
+ }
1640
+
1641
+ #steps-panel .field-hidden,
1642
+ #steps-panel .field-notice-hidden,
1643
+ #extensions-panel .field-hidden,
1644
+ #extensions-panel .field-notice-hidden,
1645
+ #leads-panel .field-hidden,
1646
+ #leads-panel .field-notice-hidden,
1647
+ #redirect-panel .field-hidden,
1648
+ #redirect-panel .field-notice-hidden {
1649
+ display: none;
1650
+ }
1651
+
1652
+ #steps-panel .field-warning-alert,
1653
+ #extensions-panel .field-warning-alert,
1654
+ #leads-panel .field-warning-alert,
1655
+ #redirect-panel .field-warning-alert {
1656
+ color: #a94442;
1657
+ background-color: #f2dede;
1658
+ border-color: #ebccd1;
1659
+ }
1660
+
1661
+ .home-hero-minititle {
1662
+ color: #fff !important;
1663
+ }
1664
+
1665
+ .accessibe-logo {
1666
+ padding: 10px 0;
1667
+ background: #fff;
1668
+ }
1669
+
1670
+ .accessibe-logo img {
1671
+ width: 200px;
1672
+ }
1673
+
1674
+ .page-settings .image-uploader-btn {
1675
+ display: block;
1676
+ margin-top: 10PX;
1677
+ }
1678
+
1679
+ .page-settings .field-wrap {
1680
+ display: -webkit-box;
1681
+ display: -ms-flexbox;
1682
+ display: flex;
1683
+ float: left;
1684
+ width: 48%;
1685
+ padding: 0 1% !important;
1686
+ margin-bottom: 20px;
1687
+ clear: none !important;
1688
+ -webkit-box-orient: vertical;
1689
+ -webkit-box-direction: normal;
1690
+ -ms-flex-direction: column;
1691
+ flex-direction: column;
1692
+ }
1693
+
1694
+ .page-settings .field-wrap select,
1695
+ .page-settings .field-wrap input {
1696
+ width: 100%;
1697
+ }
1698
+
1699
+ .page-settings .field-wrap label {
1700
+ margin-bottom: 10px;
1701
+ }
1702
+
1703
+ .page-settings .field-wrap.field-wrap-footerHtml {
1704
+ width: 100%;
1705
+ }
1706
+
1707
+ #debug-panel label.error {
1708
+ font-weight: bold;
1709
+ color: red;
1710
+ }
1711
+
1712
+ .extensions-list .button-primary {
1713
+ display: -webkit-box;
1714
+ display: -moz-flex;
1715
+ display: -ms-flexbox;
1716
+ display: flex;
1717
+ align-items: center;
1718
+ -webkit-align-items: center;
1719
+ -moz-align-items: center;
1720
+ -webkit-box-align: center;
1721
+ -ms-flex-align: center;
1722
+ justify-content: center;
1723
+ -webkit-justify-content: center;
1724
+ -moz-justify-content: center;
1725
+ -webkit-box-pack: center;
1726
+ -ms-flex-pack: center;
1727
+ }
1728
+
1729
+ .extensions-list .button-primary.btn-deactivate {
1730
+ font-size: 16px;
1731
+ color: #000;
1732
+ background: #f1f1f1;
1733
+ }
1734
+
1735
+ .extensions-list .actions {
1736
+ position: relative;
1737
+ }
1738
+
1739
+ .extensions-list .extensions {
1740
+ display: -webkit-box;
1741
+ display: -moz-flex;
1742
+ display: -ms-flexbox;
1743
+ display: flex;
1744
+ flex-wrap: wrap;
1745
+ -webkit-flex-wrap: wrap;
1746
+ -moz-flex-wrap: wrap;
1747
+ -ms-flex-wrap: wrap;
1748
+ justify-content: space-between;
1749
+ -webkit-justify-content: space-between;
1750
+ -moz-justify-content: space-between;
1751
+ -webkit-box-pack: justify;
1752
+ -ms-flex-pack: justify;
1753
+ position: relative;
1754
+ -webkit-box-sizing: border-box;
1755
+ box-sizing: border-box;
1756
+ margin: 0 -10px;
1757
+ }
1758
+
1759
+ .extensions-list .extensions .needs-activation .promo-purchase-link,
1760
+ .extensions-list .extensions .needs-activation .actions .btn-activate {
1761
+ font-size: 18px;
1762
+ background: #333;
1763
+ }
1764
+
1765
+ .extensions-list .extensions .dashicons-editor-code {
1766
+ margin-right: 5px;
1767
+ }
1768
+
1769
+ .extensions-list .extensions .promo-box {
1770
+ height: 100%;
1771
+ border: 1px solid #e6e6e6;
1772
+ }
1773
+
1774
+ .extensions-list .extensions .promo-purchase-link {
1775
+ display: -webkit-box;
1776
+ display: -moz-flex;
1777
+ display: -ms-flexbox;
1778
+ display: flex;
1779
+ align-items: center;
1780
+ -webkit-align-items: center;
1781
+ -moz-align-items: center;
1782
+ -webkit-box-align: center;
1783
+ -ms-flex-align: center;
1784
+ justify-content: center;
1785
+ -webkit-justify-content: center;
1786
+ -moz-justify-content: center;
1787
+ -webkit-box-pack: center;
1788
+ -ms-flex-pack: center;
1789
+ padding: 0 10px 2px 10px;
1790
+ font-size: 1.1rem;
1791
+ line-height: normal;
1792
+ color: #fff;
1793
+ text-decoration: none;
1794
+ cursor: pointer;
1795
+ background: #007cba;
1796
+ border-radius: 0;
1797
+ }
1798
+
1799
+ .extensions-list .extensions .promo-purchase-link:hover {
1800
+ opacity: .8;
1801
+ }
1802
+
1803
+ .extensions-list .extensions .promo-purchase-link a {
1804
+ font-size: 1.1rem;
1805
+ color: #fff;
1806
+ text-decoration: none;
1807
+ }
1808
+
1809
+ .extensions-list .extensions .dashicons-arrow-down-alt {
1810
+ margin: 0 10px;
1811
+ }
1812
+
1813
+ .extensions-list .extensions .actions .btn-activate,
1814
+ .extensions-list .extensions .btn-getit {
1815
+ display: -webkit-box;
1816
+ display: -ms-flexbox;
1817
+ display: flex;
1818
+ -webkit-box-pack: center;
1819
+ -ms-flex-pack: center;
1820
+ justify-content: center;
1821
+ -webkit-box-align: center;
1822
+ -ms-flex-align: center;
1823
+ align-items: center;
1824
+ width: 100%;
1825
+ padding: 8px;
1826
+ font-size: 16px;
1827
+ color: #fff;
1828
+ text-decoration: none;
1829
+ text-shadow: none;
1830
+ background: #007cba;
1831
+ border-color: #007cba;
1832
+ }
1833
+
1834
+ .extensions-list .extensions .actions .btn-activate:hover,
1835
+ .extensions-list .extensions .btn-getit:hover {
1836
+ opacity: .8;
1837
+ }
1838
+
1839
+ .extensions-list .extensions .button-primary {
1840
+ margin-left: 5px;
1841
+ font-size: 16px;
1842
+ border-color: transparent;
1843
+ border-radius: 0;
1844
+ }
1845
+
1846
+ .extensions-list .extensions .promo-box-inner {
1847
+ display: -webkit-box;
1848
+ display: -moz-flex;
1849
+ display: -ms-flexbox;
1850
+ display: flex;
1851
+ justify-content: space-between;
1852
+ -webkit-justify-content: space-between;
1853
+ -moz-justify-content: space-between;
1854
+ -webkit-box-pack: justify;
1855
+ -ms-flex-pack: justify;
1856
+ flex-direction: column;
1857
+ -moz-flex-direction: column;
1858
+ -ms-flex-direction: column;
1859
+ -webkit-box-direction: normal;
1860
+ -webkit-box-orient: vertical;
1861
+ height: 100%;
1862
+ }
1863
+
1864
+ .extensions-list .extensions .promo-box-inner h2 {
1865
+ margin-bottom: 0;
1866
+ }
1867
+
1868
+ .extensions-list .extensions .has-update .btn-update {
1869
+ color: #000;
1870
+ background: #ffdc2e;
1871
+ border-color: #000;
1872
+ }
1873
+
1874
+ .extensions-list .extensions .serial {
1875
+ display: -webkit-box;
1876
+ display: -moz-flex;
1877
+ display: -ms-flexbox;
1878
+ display: flex;
1879
+ -webkit-transition: all 350ms ease;
1880
+ -o-transition: all 350ms ease;
1881
+ transition: all 350ms ease;
1882
+ position: absolute;
1883
+ top: 0;
1884
+ width: 100%;
1885
+ height: 100%;
1886
+ visibility: hidden;
1887
+ background: #fff;
1888
+ opacity: 0;
1889
+ }
1890
+
1891
+ .extensions-list .extensions .serial.open {
1892
+ visibility: visible;
1893
+ opacity: 1;
1894
+ }
1895
+
1896
+ .extensions-list .extensions .serial input[type='text'] {
1897
+ width: 70%;
1898
+ min-height: 0;
1899
+ }
1900
+
1901
+ .extensions-list .extensions .serial button {
1902
+ margin: 0 1px;
1903
+ line-height: normal;
1904
+ }
1905
+
1906
+ .extensions-list .extensions div.err {
1907
+ position: absolute;
1908
+ top: 100%;
1909
+ left: 0;
1910
+ z-index: 999;
1911
+ padding: 0 0;
1912
+ color: red;
1913
+ }
1914
+
1915
+ .extensions-list .extensions .extension {
1916
+ -webkit-transition: all 250ms ease;
1917
+ -o-transition: all 250ms ease;
1918
+ transition: all 250ms ease;
1919
+ position: relative;
1920
+ width: 300px;
1921
+ -webkit-box-sizing: border-box;
1922
+ box-sizing: border-box;
1923
+ box-sizing: border-box;
1924
+ margin: 0 10px 20px 10px;
1925
+ text-align: center;
1926
+ background: #fff;
1927
+ -webkit-box-flex: 1;
1928
+ -ms-flex-positive: 1;
1929
+ flex-grow: 1;
1930
+ }
1931
+
1932
+ .extensions-list .extensions .extension h2 {
1933
+ font-size: 18px;
1934
+ font-weight: 500;
1935
+ color: #0e579f;
1936
+ }
1937
+
1938
+ .extensions-list .extensions .extension .promo-box-thumb {
1939
+ padding: 40px;
1940
+ background: #f5f5f5;
1941
+ }
1942
+
1943
+ .extensions-list .extensions .extension .promo-box-thumb img {
1944
+ height: 50px;
1945
+ }
1946
+
1947
+ .extensions-list .extensions .extension .description {
1948
+ min-height: 65px;
1949
+ font-size: 14px;
1950
+ line-height: 16px;
1951
+ color: #999;
1952
+ }
1953
+
1954
+ .extensions-list .extensions .extension .dashicons-buddicons-groups:before {
1955
+ position: relative;
1956
+ content: '\f456';
1957
+ }
1958
+
1959
+ .extensions-list .extensions .extension .promo-version {
1960
+ display: -webkit-box;
1961
+ display: -moz-flex;
1962
+ display: -ms-flexbox;
1963
+ display: flex;
1964
+ justify-content: center;
1965
+ -webkit-justify-content: center;
1966
+ -moz-justify-content: center;
1967
+ -webkit-box-pack: center;
1968
+ -ms-flex-pack: center;
1969
+ align-items: center;
1970
+ -webkit-align-items: center;
1971
+ -moz-align-items: center;
1972
+ -webkit-box-align: center;
1973
+ -ms-flex-align: center;
1974
+ flex-direction: row-reverse;
1975
+ -moz-flex-direction: row-reverse;
1976
+ -ms-flex-direction: row-reverse;
1977
+ -webkit-box-direction: reverse;
1978
+ -webkit-box-orient: horizontal;
1979
+ color: #000;
1980
+ }
1981
+
1982
+ .extensions-list .extensions .extension .promo-version .badge {
1983
+ padding: 3px 10px;
1984
+ font-size: 16px;
1985
+ line-height: normal;
1986
+ color: #fff;
1987
+ background: #c90a0abd;
1988
+ }
1989
+
1990
+ .extensions-list .extensions .extension .promo-version span {
1991
+ font-size: 20px;
1992
+ }
1993
+
1994
+ .extensions-list .extensions .extension .promo-version small {
1995
+ font-size: 16px;
1996
+ }
1997
+
1998
+ .extensions-list .extensions .extension .promo-box-content {
1999
+ height: 100%;
2000
+ padding: 0;
2001
+ }
2002
+
2003
+ .extensions-list .extensions .extension .promo-bot-title {
2004
+ display: -webkit-box;
2005
+ display: -moz-flex;
2006
+ display: -ms-flexbox;
2007
+ display: flex;
2008
+ justify-content: space-between;
2009
+ -webkit-justify-content: space-between;
2010
+ -moz-justify-content: space-between;
2011
+ -webkit-box-pack: justify;
2012
+ -ms-flex-pack: justify;
2013
+ height: 31px;
2014
+ padding: 9px 15px;
2015
+ background: #f1f1f1;
2016
+ border-bottom: 1px solid #e6e6e6;
2017
+ }
2018
+
2019
+ .extensions-list .extensions .extension:hover {
2020
+ -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
2021
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
2022
+ }
2023
+
2024
+ .extensions-list .extensions .extension .promo-box-description {
2025
+ padding: 20px;
2026
+ text-align: left;
2027
+ }
2028
+
2029
+ .extensions-list .extensions .extension .promo-box-description h3 {
2030
+ height: 24px;
2031
+ margin-top: 0;
2032
+ }
2033
+
2034
+ .extensions-list .extensions .extension .promo-actions-box {
2035
+ position: relative;
2036
+ overflow: hidden;
2037
+ }
2038
+
2039
+ section.padbox .padbox {
2040
+ padding: 20px;
2041
+ }
2042
+
2043
+ .mail-tags-wrapper-inner.field-hidden {
2044
+ padding: 10px;
2045
+ background: #ddd;
2046
+ border: 1px solid;
2047
+ }
2048
+
2049
+ .accessibie-plugin .promo-box-thumb img {
2050
+ max-width: 90% !important;
2051
+ }
2052
+
2053
+ .rp-overlay {
2054
+ position: fixed;
2055
+ top: 0;
2056
+ left: 0;
2057
+ z-index: 99;
2058
+ display: -webkit-box;
2059
+ display: -ms-flexbox;
2060
+ display: flex;
2061
+ -webkit-box-pack: center;
2062
+ -ms-flex-pack: center;
2063
+ justify-content: center;
2064
+ -webkit-box-align: center;
2065
+ -ms-flex-align: center;
2066
+ align-items: center;
2067
+ width: 100%;
2068
+ height: 100%;
2069
+ color: #fff;
2070
+ visibility: hidden;
2071
+ background: rgba(0, 0, 0, 0.8);
2072
+ opacity: 0;
2073
+ -webkit-transition: all 500ms ease;
2074
+ -o-transition: all 500ms ease;
2075
+ transition: all 500ms ease;
2076
+ direction: ltr;
2077
+ }
2078
+
2079
+ .rp-overlay.active {
2080
+ visibility: visible;
2081
+ opacity: 1;
2082
+ }
2083
+
2084
+ .rp-overlay * {
2085
+ -webkit-box-sizing: border-box;
2086
+ box-sizing: border-box;
2087
+ }
2088
+
2089
+ .rp-overlay .rp-discount {
2090
+ position: relative;
2091
+ display: block;
2092
+ width: 700px;
2093
+ max-width: 100%;
2094
+ height: 500px;
2095
+ padding: 40px 30px;
2096
+ margin: auto;
2097
+ background: url(../../build/images/banner-pro.png);
2098
+ background-size: cover;
2099
+ }
2100
+
2101
+ .rp-overlay .rp-discount .rp-contact-form-form input[type=email] {
2102
+ width: 100%;
2103
+ padding: 6px 10px;
2104
+ }
2105
+
2106
+ .rp-overlay .rp-discount .rp-close {
2107
+ position: absolute;
2108
+ top: 10px;
2109
+ right: 15px;
2110
+ padding: 0;
2111
+ font-size: 44px;
2112
+ color: #fff;
2113
+ cursor: pointer;
2114
+ background: none;
2115
+ border: none;
2116
+ }
2117
+
2118
+ .rp-overlay .rp-discount .rp-top-title {
2119
+ display: inline-block;
2120
+ padding-bottom: 8px;
2121
+ margin-bottom: 30px;
2122
+ font-size: 20px;
2123
+ font-weight: 700;
2124
+ color: #9cd8eb;
2125
+ text-transform: uppercase;
2126
+ border-bottom: 1px solid #72aee2;
2127
+ }
2128
+
2129
+ .rp-overlay .rp-discount .rp-title-large {
2130
+ display: block;
2131
+ font-size: 62px;
2132
+ font-weight: 800;
2133
+ line-height: 1;
2134
+ text-transform: uppercase;
2135
+ }
2136
+
2137
+ .rp-overlay .rp-discount .rp-features-list {
2138
+ margin-bottom: 30px;
2139
+ }
2140
+
2141
+ .rp-overlay .rp-discount .rp-features-list li {
2142
+ font-size: 20px;
2143
+ font-weight: 500;
2144
+ }
2145
+
2146
+ .rp-overlay .rp-discount .rp-features-list li:before {
2147
+ position: relative;
2148
+ top: 9px;
2149
+ font-family: 'dashicons';
2150
+ font-size: 34px;
2151
+ content: '\f147';
2152
+ }
2153
+
2154
+ .rp-overlay .rp-discount .rp-contact-form ::-webkit-input-placeholder {
2155
+ color: #fff;
2156
+ }
2157
+
2158
+ .rp-overlay .rp-discount .rp-contact-form ::-moz-placeholder {
2159
+ color: #fff;
2160
+ }
2161
+
2162
+ .rp-overlay .rp-discount .rp-contact-form :-ms-input-placeholder {
2163
+ color: #fff;
2164
+ }
2165
+
2166
+ .rp-overlay .rp-discount .rp-contact-form :-moz-placeholder {
2167
+ color: #fff;
2168
+ }
2169
+
2170
+ .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-title {
2171
+ display: block;
2172
+ padding: 0 20px;
2173
+ margin-bottom: 10px;
2174
+ font-size: 20px;
2175
+ font-weight: 500;
2176
+ color: #9cd8eb;
2177
+ }
2178
+
2179
+ .rp-overlay .rp-discount .rp-contact-form .rp-cols {
2180
+ display: -webkit-box;
2181
+ display: -ms-flexbox;
2182
+ display: flex;
2183
+ -webkit-box-pack: justify;
2184
+ -ms-flex-pack: justify;
2185
+ justify-content: space-between;
2186
+ }
2187
+
2188
+ .rp-overlay .rp-discount .rp-contact-form .rp-form-message {
2189
+ position: absolute;
2190
+ top: 67px;
2191
+ left: 0;
2192
+ width: 100%;
2193
+ padding-left: 5px;
2194
+ font-size: 12px;
2195
+ }
2196
+
2197
+ .rp-overlay .rp-discount .rp-contact-form .rp-form-message .rp-form-message-text {
2198
+ display: block;
2199
+ padding: 16px;
2200
+ padding-top: 5px;
2201
+ color: #1478ce;
2202
+ text-decoration: none;
2203
+ background: #fff;
2204
+ }
2205
+
2206
+ .rp-overlay .rp-discount .rp-contact-form .rp-col-featured .rp-text {
2207
+ display: block;
2208
+ margin-bottom: 5px;
2209
+ font-size: 14px;
2210
+ color: #fff;
2211
+ }
2212
+
2213
+ .rp-overlay .rp-discount .rp-contact-form .rp-col-featured .logo-querysol {
2214
+ display: block;
2215
+ width: 140px;
2216
+ height: 18px;
2217
+ background: url(../../build/images/logo-querysol.png);
2218
+ background-size: 100%;
2219
+ }
2220
+
2221
+ .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form strong {
2222
+ font-size: 14px;
2223
+ font-weight: bold;
2224
+ text-decoration: underline;
2225
+ }
2226
+
2227
+ .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form .input-wrap {
2228
+ position: relative;
2229
+ margin-bottom: 5px;
2230
+ }
2231
+
2232
+ .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form .input-wrap .btn-rp-submit {
2233
+ display: -webkit-box;
2234
+ display: -moz-flex;
2235
+ display: -ms-flexbox;
2236
+ display: flex;
2237
+ justify-content: center;
2238
+ -webkit-justify-content: center;
2239
+ -moz-justify-content: center;
2240
+ -webkit-box-pack: center;
2241
+ -ms-flex-pack: center;
2242
+ align-items: center;
2243
+ -webkit-align-items: center;
2244
+ -moz-align-items: center;
2245
+ -webkit-box-align: center;
2246
+ -ms-flex-align: center;
2247
+ position: absolute;
2248
+ top: 1px;
2249
+ right: 0;
2250
+ width: 40px;
2251
+ height: calc(100% - 2px);
2252
+ padding: 0;
2253
+ padding: 0;
2254
+ cursor: pointer;
2255
+ background: #388cd5;
2256
+ border: none;
2257
+ }
2258
+
2259
+ .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form .input-wrap .btn-rp-submit:focus {
2260
+ outline: none;
2261
+ }
2262
+
2263
+ .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form .input-wrap .btn-rp-submit .rp-icon-plane {
2264
+ position: relative;
2265
+ width: 17px;
2266
+ height: 17px;
2267
+ background: url(../../build/images/icon-plane.png);
2268
+ background-size: 100%;
2269
+ }
2270
+
2271
+ .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form .input-wrap .btn-rp-submit .rp-icon-plane:hover {
2272
+ opacity: .8;
2273
+ }
2274
+
2275
+ .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form .checkbox-wrap {
2276
+ display: -webkit-box;
2277
+ display: -ms-flexbox;
2278
+ display: flex;
2279
+ -webkit-box-align: center;
2280
+ -ms-flex-align: center;
2281
+ align-items: center;
2282
+ }
2283
+
2284
+ .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form .checkbox-wrap #rp_get_offers {
2285
+ width: 14px;
2286
+ min-width: 14px;
2287
+ height: 14px;
2288
+ min-height: 14px;
2289
+ margin: 0 5px;
2290
+ }
2291
+
2292
+ .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form .checkbox-wrap label {
2293
+ font-size: 12px;
2294
+ }
2295
+
2296
+ .rp-overlay .rp-footer {
2297
+ position: absolute;
2298
+ bottom: 0;
2299
+ left: 0;
2300
+ width: 100%;
2301
+ padding: 0 30px 7px;
2302
+ }
2303
+
2304
+ .rp-overlay .rp-footer .rp-footer-top {
2305
+ padding: 10px 0;
2306
+ border-top: 1px solid #72aee2;
2307
+ border-bottom: 1px solid #72aee2;
2308
+ }
2309
+
2310
+ .rp-overlay .rp-footer .rp-footer-top a {
2311
+ font-weight: 600;
2312
+ color: #fff;
2313
+ }
2314
+
2315
+ .rp-overlay .rp-footer .rp-footer-bottom {
2316
+ padding: 12px 30px;
2317
+ font-size: 12px;
2318
+ text-align: center;
2319
+ }
2320
+
2321
+ .rp-loader-wrap {
2322
+ display: block;
2323
+ padding: 5px;
2324
+ text-align: center;
2325
+ }
2326
+
2327
+ .rp-loader-wrap .rp-loader {
2328
+ display: inline-block;
2329
+ width: 20px;
2330
+ height: 20px;
2331
+ border: 3px solid #f3f3f3;
2332
+ border-top: 3px solid #3498db;
2333
+ border-radius: 50%;
2334
+ -webkit-animation: rp_spin 2s linear infinite;
2335
+ animation: rp_spin 2s linear infinite;
2336
+ }
2337
+
2338
+ @-webkit-keyframes rp_spin {
2339
+ 0% {
2340
+ -webkit-transform: rotate(0deg);
2341
+ }
2342
+
2343
+ 100% {
2344
+ -webkit-transform: rotate(360deg);
2345
+ }
2346
+ }
2347
+
2348
+ @keyframes rp_spin {
2349
+ 0% {
2350
+ -webkit-transform: rotate(0deg);
2351
+ transform: rotate(0deg);
2352
+ }
2353
+
2354
+ 100% {
2355
+ -webkit-transform: rotate(360deg);
2356
+ transform: rotate(360deg);
2357
+ }
2358
+ }
2359
+
2360
+ .wrap-accesibe {
2361
+ direction: ltr;
2362
+ }
2363
+
2364
+ .wrap-accesibe iframe {
2365
+ height: calc(100vh - 280px) !important;
2366
+ }
2367
+
2368
+ .wrap-accesibe .wp-picker-container .button,
2369
+ .wrap-accesibe .wp-picker-container .button-secondary {
2370
+ width: 38px;
2371
+ height: 38px;
2372
+ overflow: hidden;
2373
+ text-indent: -999px;
2374
+ vertical-align: top;
2375
+ border: 1px solid #000;
2376
+ border-radius: 50%;
2377
+ }
2378
+
2379
+ .wrap-accesibe .success-message {
2380
+ padding: 24px 40px;
2381
+ margin-bottom: 30px;
2382
+ font-size: 18px;
2383
+ font-weight: normal;
2384
+ line-height: 21px;
2385
+ color: #fff;
2386
+ background: #1871f8;
2387
+ }
2388
+
2389
+ .wrap-accesibe .success-message h3 {
2390
+ margin: 0;
2391
+ font-size: 24px;
2392
+ font-style: normal;
2393
+ font-weight: 600;
2394
+ line-height: 32px;
2395
+ color: #80d9ff;
2396
+ /* identical to box height */
2397
+ text-align: left;
2398
+ }
2399
+
2400
+ .wrap-accesibe .success-content a {
2401
+ font-weight: 600;
2402
+ color: #80d8ff;
2403
+ }
2404
+
2405
+ .wrap-accesibe .success-message-subtitle {
2406
+ margin-bottom: 20px;
2407
+ }
2408
+
2409
+ .wrap-accesibe .accesibe-settings-form-footer {
2410
+ padding: 0 40px;
2411
+ margin-top: 40px;
2412
+ }
2413
+
2414
+ .wrap-accesibe .logo-row {
2415
+ display: -webkit-box;
2416
+ display: -ms-flexbox;
2417
+ display: flex;
2418
+ -webkit-box-pack: justify;
2419
+ -ms-flex-pack: justify;
2420
+ justify-content: space-between;
2421
+ padding: 10px 0;
2422
+ }
2423
+
2424
+ .wrap-accesibe .logo-row .accesibe-settings-form {
2425
+ height: auto;
2426
+ padding: 0;
2427
+ overflow: auto;
2428
+ }
2429
+
2430
+ .wrap-accesibe .top-logo {
2431
+ padding: 10px 30px;
2432
+ }
2433
+
2434
+ .wrap-accesibe .top-logo .site-button {
2435
+ padding: 0 20px !important;
2436
+ margin-top: 0 !important;
2437
+ }
2438
+
2439
+ .wrap-accesibe .home-hero {
2440
+ position: relative;
2441
+ display: block !important;
2442
+ min-height: 700px;
2443
+ max-height: none !important;
2444
+ padding: 0 !important;
2445
+ background-attachment: fixed;
2446
+ }
2447
+
2448
+ .wrap-accesibe .scanning {
2449
+ padding: 10px 40px;
2450
+ font-size: 18px;
2451
+ font-weight: bold;
2452
+ background: #e7faf0;
2453
+ }
2454
+
2455
+ .wrap-accesibe .scanning-tip {
2456
+ padding: 11px 40px;
2457
+ font-size: 16px;
2458
+ background: blanchedalmond;
2459
+ }
2460
+
2461
+ .wrap-accesibe .reg-form.wrapper {
2462
+ position: relative;
2463
+ z-index: 9;
2464
+ }
2465
+
2466
+ .wrap-accesibe .home-hero-cta {
2467
+ display: -webkit-box;
2468
+ display: -moz-flex;
2469
+ display: -ms-flexbox;
2470
+ display: flex;
2471
+ justify-content: space-between;
2472
+ -webkit-justify-content: space-between;
2473
+ -moz-justify-content: space-between;
2474
+ -webkit-box-pack: justify;
2475
+ -ms-flex-pack: justify;
2476
+ align-items: center;
2477
+ -webkit-align-items: center;
2478
+ -moz-align-items: center;
2479
+ -webkit-box-align: center;
2480
+ -ms-flex-align: center;
2481
+ flex-wrap: wrap;
2482
+ -webkit-flex-wrap: wrap;
2483
+ -moz-flex-wrap: wrap;
2484
+ -ms-flex-wrap: wrap;
2485
+ flex-direction: column;
2486
+ -moz-flex-direction: column;
2487
+ -ms-flex-direction: column;
2488
+ -webkit-box-direction: normal;
2489
+ -webkit-box-orient: vertical;
2490
+ }
2491
+
2492
+ .wrap-accesibe .home-hero .home-hero-image {
2493
+ position: absolute;
2494
+ top: 0;
2495
+ right: 0;
2496
+ z-index: 1;
2497
+ z-index: 999;
2498
+ width: 47%;
2499
+ height: auto;
2500
+ -webkit-transition: all .15s ease;
2501
+ -o-transition: all .15s ease;
2502
+ transition: all .15s ease;
2503
+ }
2504
+
2505
+ .wrap-accesibe .home-hero .home-hero-image:hover .play-button {
2506
+ -webkit-transform: scale(1.1);
2507
+ -ms-transform: scale(1.1);
2508
+ transform: scale(1.1);
2509
+ }
2510
+
2511
+ .wrap-accesibe .home-hero .home-hero-image:active .play-button {
2512
+ -webkit-transform: scale(1);
2513
+ -ms-transform: scale(1);
2514
+ transform: scale(1);
2515
+ }
2516
+
2517
+ .wrap-accesibe .home-hero .home-hero-image .hero-tooltip {
2518
+ position: absolute;
2519
+ top: 0;
2520
+ right: 0;
2521
+ }
2522
+
2523
+ .wrap-accesibe .home-hero .home-hero-image .hero-cover-image {
2524
+ display: block;
2525
+ display: none;
2526
+ width: 95%;
2527
+ max-width: 100% !important;
2528
+ max-height: 400px;
2529
+ margin-left: auto;
2530
+ -o-object-fit: contain;
2531
+ object-fit: contain;
2532
+ -o-object-position: top right;
2533
+ object-position: top right;
2534
+ }
2535
+
2536
+ .wrap-accesibe .home-hero .home-hero-image .play-button-wrap {
2537
+ position: absolute;
2538
+ top: 50%;
2539
+ left: 50%;
2540
+ width: 100%;
2541
+ height: 100%;
2542
+ cursor: pointer;
2543
+ -webkit-transform: translateX(-50%) translateY(-50%);
2544
+ -ms-transform: translateX(-50%) translateY(-50%);
2545
+ transform: translateX(-50%) translateY(-50%);
2546
+ }
2547
+
2548
+ .wrap-accesibe .home-hero .home-hero-image .play-button-wrap .play-button {
2549
+ position: relative;
2550
+ top: -70px;
2551
+ right: -50px;
2552
+ z-index: 2;
2553
+ margin: auto;
2554
+ }
2555
+
2556
+ .wrap-accesibe .site-button {
2557
+ width: 100%;
2558
+ max-width: 300px;
2559
+ height: 57px;
2560
+ font-size: 16px;
2561
+ font-weight: 600;
2562
+ line-height: 21px;
2563
+ color: #fff;
2564
+ text-align: center;
2565
+ background: #136ef8;
2566
+ border: 0;
2567
+ border-radius: 10px;
2568
+ -webkit-box-shadow: none;
2569
+ box-shadow: none;
2570
+ }
2571
+
2572
+ .wrap-accesibe input[type='checkbox'] {
2573
+ width: auto;
2574
+ }
2575
+
2576
+ .wrap-accesibe .accesibe-settings-form {
2577
+ height: 100%;
2578
+ padding: 20px 30px 30px 30px;
2579
+ overflow: auto;
2580
+ }
2581
+
2582
+ .wrap-accesibe .accesibe-settings-form .site-button {
2583
+ width: auto;
2584
+ min-width: 200px;
2585
+ margin-top: 20px;
2586
+ }
2587
+
2588
+ .wrap-accesibe .accesibe-settings-form .field-wrap {
2589
+ margin-bottom: 10px;
2590
+ }
2591
+
2592
+ .wrap-accesibe .accesibe-settings-form .field-wrap select,
2593
+ .wrap-accesibe .accesibe-settings-form .field-wrap [type='number'],
2594
+ .wrap-accesibe .accesibe-settings-form .field-wrap [type='email'],
2595
+ .wrap-accesibe .accesibe-settings-form .field-wrap [type='url'],
2596
+ .wrap-accesibe .accesibe-settings-form .field-wrap [type='text'] {
2597
+ width: 100%;
2598
+ height: 38px;
2599
+ margin: 0;
2600
+ border-radius: 0;
2601
+ }
2602
+
2603
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-minititle {
2604
+ display: block;
2605
+ font-size: 17px;
2606
+ font-weight: 600;
2607
+ line-height: 1;
2608
+ color: #136ef8;
2609
+ letter-spacing: -.5px;
2610
+ }
2611
+
2612
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-title {
2613
+ font-size: 28px;
2614
+ }
2615
+
2616
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-title {
2617
+ margin: 0;
2618
+ margin-bottom: 100px;
2619
+ font-size: 42px;
2620
+ font-style: normal;
2621
+ font-weight: 600;
2622
+ line-height: 48px;
2623
+ color: #fff;
2624
+ }
2625
+
2626
+ .wrap-accesibe .hero-right-inner {
2627
+ max-width: 462px;
2628
+ padding: 40px 0;
2629
+ margin: auto;
2630
+ margin-left: 10%;
2631
+ }
2632
+
2633
+ .wrap-accesibe .hero-right-inner h4 {
2634
+ font-size: 24px;
2635
+ font-weight: 600;
2636
+ line-height: 32px;
2637
+ color: #136ef8;
2638
+ }
2639
+
2640
+ .wrap-accesibe .hero-right-inner .accessibe-logo {
2641
+ padding: 0;
2642
+ margin-bottom: 40px;
2643
+ }
2644
+
2645
+ .wrap-accesibe .hero-left-inner {
2646
+ max-width: 600px;
2647
+ }
2648
+
2649
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-title em:before {
2650
+ bottom: 10px;
2651
+ }
2652
+
2653
+ .wrap-accesibe .home-hero-checkmarks {
2654
+ margin-top: 20px;
2655
+ }
2656
+
2657
+ .wrap-accesibe .main-form-wrap {
2658
+ display: -webkit-box;
2659
+ display: -ms-flexbox;
2660
+ display: flex;
2661
+ -webkit-box-pack: center;
2662
+ -ms-flex-pack: center;
2663
+ justify-content: center;
2664
+ }
2665
+
2666
+ .wrap-accesibe .main-form-wrap .field-wrap textarea,
2667
+ .wrap-accesibe .main-form-wrap .field-wrap select,
2668
+ .wrap-accesibe .main-form-wrap .field-wrap [type='number'],
2669
+ .wrap-accesibe .main-form-wrap .field-wrap [type='email'],
2670
+ .wrap-accesibe .main-form-wrap .field-wrap [type='url'],
2671
+ .wrap-accesibe .main-form-wrap .field-wrap [type='password'],
2672
+ .wrap-accesibe .main-form-wrap .field-wrap [type='text'] {
2673
+ height: 57px;
2674
+ -webkit-box-sizing: border-box;
2675
+ box-sizing: border-box;
2676
+ padding: 0 10px;
2677
+ font-size: 16px;
2678
+ font-style: normal;
2679
+ font-weight: 600;
2680
+ line-height: 21px;
2681
+ color: #bfbfbf;
2682
+ border: 2px solid #eaeaea;
2683
+ border-radius: 10px;
2684
+ }
2685
+
2686
+ .wrap-accesibe .main-form-wrap label {
2687
+ margin-bottom: 16px;
2688
+ font-size: 16px;
2689
+ font-style: normal;
2690
+ font-weight: 600;
2691
+ line-height: 21px;
2692
+ color: #bfbfbf;
2693
+ }
2694
+
2695
+ .wrap-accesibe .home-hero-checkmarks .home-hero-checkmark {
2696
+ position: relative;
2697
+ display: block;
2698
+ padding-left: 45px;
2699
+ margin: 30px 0;
2700
+ font-size: 18px;
2701
+ line-height: 1.3;
2702
+ color: #fff;
2703
+ text-align: left;
2704
+ }
2705
+
2706
+ .wrap-accesibe section.home-hero.hero-standard.hero-standard-full {
2707
+ position: relative;
2708
+ }
2709
+
2710
+ .wrap-accesibe h3.home-hero-title {
2711
+ color: #fff;
2712
+ }
2713
+
2714
+ .wrap-accesibe .home-hero-content {
2715
+ display: block;
2716
+ width: 100%;
2717
+ -webkit-box-sizing: border-box;
2718
+ box-sizing: border-box;
2719
+ background: #136ef8;
2720
+ }
2721
+
2722
+ .wrap-accesibe .hero-right,
2723
+ .wrap-accesibe .hero-left {
2724
+ width: 50%;
2725
+ }
2726
+
2727
+ .wrap-accesibe .hero-left {
2728
+ display: -webkit-box;
2729
+ display: -moz-flex;
2730
+ display: -ms-flexbox;
2731
+ display: flex;
2732
+ justify-content: center;
2733
+ -webkit-justify-content: center;
2734
+ -moz-justify-content: center;
2735
+ -webkit-box-pack: center;
2736
+ -ms-flex-pack: center;
2737
+ align-items: space-between;
2738
+ -webkit-align-items: space-between;
2739
+ -moz-align-items: space-between;
2740
+ -webkit-box-align: space-between;
2741
+ -ms-flex-align: space-between;
2742
+ flex-direction: column;
2743
+ -moz-flex-direction: column;
2744
+ -ms-flex-direction: column;
2745
+ -webkit-box-direction: normal;
2746
+ -webkit-box-orient: vertical;
2747
+ padding: 120px 40px;
2748
+ }
2749
+
2750
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-checkmarks .home-hero-checkmark .icon {
2751
+ display: -webkit-box;
2752
+ display: -moz-flex;
2753
+ display: -ms-flexbox;
2754
+ display: flex;
2755
+ justify-content: center;
2756
+ -webkit-justify-content: center;
2757
+ -moz-justify-content: center;
2758
+ -webkit-box-pack: center;
2759
+ -ms-flex-pack: center;
2760
+ align-items: center;
2761
+ -webkit-align-items: center;
2762
+ -moz-align-items: center;
2763
+ -webkit-box-align: center;
2764
+ -ms-flex-align: center;
2765
+ position: absolute;
2766
+ top: -5px;
2767
+ left: 0;
2768
+ width: 23px;
2769
+ height: 23px;
2770
+ padding: 6px;
2771
+ background-color: #81d9ff;
2772
+ border-radius: 50%;
2773
+ }
2774
+
2775
+ .wrap-accesibe .agreement {
2776
+ margin-top: 10px;
2777
+ margin-bottom: 20px;
2778
+ }
2779
+
2780
+ .wrap-accesibe .popup.popup-account .content .account-stages-wrapper .account-stage-wrapper .account-body .highlight a {
2781
+ color: #136ef8;
2782
+ }
2783
+
2784
+ .wrap-accesibe .highlight {
2785
+ background: transparent;
2786
+ }
2787
+
2788
+ .wrap-accesibe .field-wrap {
2789
+ padding: 0 0;
2790
+ margin-bottom: 20px;
2791
+ }
2792
+
2793
+ .wrap-accesibe .agreement {
2794
+ display: -webkit-box;
2795
+ display: -ms-flexbox;
2796
+ display: flex;
2797
+ -webkit-box-pack: justify;
2798
+ -ms-flex-pack: justify;
2799
+ justify-content: space-between;
2800
+ -webkit-box-align: center;
2801
+ -ms-flex-align: center;
2802
+ align-items: center;
2803
+ }
2804
+
2805
+ .wrap-accesibe .agreement label a,
2806
+ .wrap-accesibe .agreement label {
2807
+ font-size: 16px;
2808
+ font-style: normal;
2809
+ font-weight: normal;
2810
+ line-height: 10px;
2811
+ color: #bfbfbf;
2812
+ }
2813
+
2814
+ .wrap-accesibe .agreement input[type=checkbox] {
2815
+ position: relative;
2816
+ top: 3px;
2817
+ }
2818
+
2819
+ .wrap-accesibe .home-hero-cta .field-wrap {
2820
+ display: -webkit-box;
2821
+ display: -ms-flexbox;
2822
+ display: flex;
2823
+ width: calc(100%);
2824
+ padding: 0 0;
2825
+ margin-bottom: 30px;
2826
+ -webkit-box-orient: vertical;
2827
+ -webkit-box-direction: normal;
2828
+ -ms-flex-direction: column;
2829
+ flex-direction: column;
2830
+ }
2831
+
2832
+ .wrap-accesibe .footer-wrap {
2833
+ display: -webkit-box;
2834
+ display: -ms-flexbox;
2835
+ display: flex;
2836
+ -webkit-box-pack: justify;
2837
+ -ms-flex-pack: justify;
2838
+ justify-content: space-between;
2839
+ padding: 0 40px;
2840
+ margin: 40px 0;
2841
+ text-align: right;
2842
+ }
2843
+
2844
+ .wrap-accesibe .home-hero .home-hero-logos {
2845
+ position: absolute;
2846
+ bottom: -75px;
2847
+ left: 50%;
2848
+ z-index: 2;
2849
+ width: 90%;
2850
+ max-width: 1024px;
2851
+ padding: 30px 50px;
2852
+ text-align: center;
2853
+ background-color: #fff;
2854
+ border-radius: 10px;
2855
+ -webkit-box-shadow: 0 0 50px 0 rgba(50, 50, 50, 0.1);
2856
+ box-shadow: 0 0 50px 0 rgba(50, 50, 50, 0.1);
2857
+ -webkit-transform: translateX(-50%);
2858
+ -ms-transform: translateX(-50%);
2859
+ transform: translateX(-50%);
2860
+ }
2861
+
2862
+ .wrap-accesibe .home-hero .home-hero-logos .home-hero-logos-title {
2863
+ display: block;
2864
+ margin-bottom: 20px;
2865
+ font-size: 18px;
2866
+ line-height: 1;
2867
+ }
2868
+
2869
+ .wrap-accesibe .home-hero .home-hero-logos .home-hero-logos-title br {
2870
+ display: none !important;
2871
+ }
2872
+
2873
+ .wrap-accesibe .home-hero .home-hero-logos .home-hero-logos-title em {
2874
+ display: inline-block;
2875
+ padding: 5px 12px;
2876
+ margin: 0 3px;
2877
+ font-style: normal;
2878
+ font-weight: 600;
2879
+ color: #136ef8;
2880
+ background-color: #e3e8fb;
2881
+ border-radius: 50px;
2882
+ }
2883
+
2884
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item {
2885
+ display: -webkit-box;
2886
+ display: -ms-flexbox;
2887
+ display: flex;
2888
+ -webkit-box-pack: center;
2889
+ -ms-flex-pack: center;
2890
+ justify-content: center;
2891
+ -webkit-box-align: center;
2892
+ -ms-flex-align: center;
2893
+ align-items: center;
2894
+ height: 50px;
2895
+ }
2896
+
2897
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item img {
2898
+ display: block;
2899
+ max-width: 110px !important;
2900
+ max-height: 35px !important;
2901
+ margin: auto;
2902
+ -webkit-transition: all .15s ease;
2903
+ -o-transition: all .15s ease;
2904
+ transition: all .15s ease;
2905
+ }
2906
+
2907
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item img:hover {
2908
+ -webkit-transform: scale(1.15);
2909
+ -ms-transform: scale(1.15);
2910
+ transform: scale(1.15);
2911
+ }
2912
+
2913
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item img:active {
2914
+ -webkit-transform: scale(1);
2915
+ -ms-transform: scale(1);
2916
+ transform: scale(1);
2917
+ }
2918
+
2919
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item .logo-higher img {
2920
+ max-height: 45px !important;
2921
+ }
2922
+
2923
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item .logo-shorter img {
2924
+ max-height: 25px !important;
2925
+ }
2926
+
2927
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item .logo-wider img {
2928
+ max-width: 125px !important;
2929
+ }
2930
+
2931
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav .owl-prev {
2932
+ left: -25px;
2933
+ }
2934
+
2935
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav .owl-next {
2936
+ right: -25px;
2937
+ }
2938
+
2939
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav .owl-prev,
2940
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav .owl-next {
2941
+ top: -10px;
2942
+ width: 20px;
2943
+ height: 20px;
2944
+ background: transparent;
2945
+ -webkit-box-shadow: 0 0 0 transparent;
2946
+ box-shadow: 0 0 0 transparent;
2947
+ }
2948
+
2949
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav .owl-prev .icon,
2950
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav .owl-next .icon {
2951
+ width: 17px;
2952
+ }
2953
+
2954
+ @media screen and (max-width: 1700px) {
2955
+ .wrap-accesibe .home-hero .home-hero-image .hero-cover-image {
2956
+ width: auto !important;
2957
+ }
2958
+
2959
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-minititle {
2960
+ font-size: 16px;
2961
+ }
2962
+
2963
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-checkmarks .home-hero-checkmark {
2964
+ font-size: 16px;
2965
+ }
2966
+
2967
+ .wrap-accesibe .home-hero .home-hero-logos .home-hero-logos-title {
2968
+ font-size: 16px;
2969
+ }
2970
+
2971
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item img {
2972
+ max-width: 100px !important;
2973
+ max-height: 30px !important;
2974
+ }
2975
+
2976
+ .wrap-accesibe .home-hero .home-hero-logos {
2977
+ max-width: 960px;
2978
+ padding-top: 20px;
2979
+ padding-bottom: 20px;
2980
+ }
2981
+ }
2982
+
2983
+ @media screen and (max-width: 1300px) {
2984
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-title {
2985
+ font-size: 28px;
2986
+ }
2987
+
2988
+ .wrap-accesibe .main-form-wrap {
2989
+ flex-direction: column;
2990
+ -moz-flex-direction: column;
2991
+ -ms-flex-direction: column;
2992
+ -webkit-box-direction: normal;
2993
+ -webkit-box-orient: vertical;
2994
+ }
2995
+
2996
+ .wrap-accesibe .hero-right,
2997
+ .wrap-accesibe .hero-left {
2998
+ width: 100%;
2999
+ }
3000
+
3001
+ .wrap-accesibe .hero-right-inner,
3002
+ .wrap-accesibe .hero-left {
3003
+ padding: 40px 40px;
3004
+ }
3005
+
3006
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-title {
3007
+ margin-bottom: 20px;
3008
+ }
3009
+
3010
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-checkmarks .home-hero-checkmark {
3011
+ margin: 28px 0;
3012
+ }
3013
+
3014
+ .wrap-accesibe .hero-right-inner {
3015
+ margin-left: 0;
3016
+ }
3017
+ }
3018
+
3019
+ @media screen and (max-width: 1024px) {
3020
+ .wrap-accesibe .home-hero .home-hero-image .hero-tooltip {
3021
+ display: none !important;
3022
+ }
3023
+
3024
+ .wrap-accesibe .home-hero .home-hero-image .hero-cover-image {
3025
+ max-width: 100% !important;
3026
+ height: auto;
3027
+ max-height: 100%;
3028
+ }
3029
+
3030
+ .wrap-accesibe .home-hero .home-hero-image {
3031
+ position: relative;
3032
+ top: auto;
3033
+ right: auto;
3034
+ bottom: auto;
3035
+ left: auto;
3036
+ display: none;
3037
+ float: right;
3038
+ width: 100%;
3039
+ height: auto;
3040
+ padding-left: 50px;
3041
+ margin: 0;
3042
+ }
3043
+
3044
+ .wrap-accesibe .home-hero .home-hero-logos .home-hero-logos-title {
3045
+ max-width: 450px;
3046
+ margin-right: auto;
3047
+ margin-left: auto;
3048
+ }
3049
+
3050
+ .wrap-accesibe .home-hero .home-hero-logos {
3051
+ position: relative;
3052
+ top: auto;
3053
+ right: auto;
3054
+ bottom: -50px;
3055
+ left: auto;
3056
+ z-index: 3;
3057
+ max-width: 750px;
3058
+ margin: auto;
3059
+ -webkit-transform: translateY(0);
3060
+ -ms-transform: translateY(0);
3061
+ transform: translateY(0);
3062
+ }
3063
+
3064
+ .wrap-accesibe .home-hero {
3065
+ height: auto;
3066
+ background-attachment: scroll;
3067
+ }
3068
+ }
3069
+
3070
+ @media screen and (max-width: 700px) {
3071
+ .wrap-accesibe .home-hero .home-hero-image {
3072
+ display: block;
3073
+ height: 350px;
3074
+ }
3075
+
3076
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-checkmarks .home-hero-checkmark {
3077
+ text-align: left;
3078
+ }
3079
+
3080
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav .owl-prev {
3081
+ left: 10px;
3082
+ }
3083
+
3084
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav .owl-next {
3085
+ right: 10px;
3086
+ }
3087
+
3088
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav {
3089
+ display: none;
3090
+ }
3091
+
3092
+ .wrap-accesibe .home-hero .home-hero-logos {
3093
+ padding: 20px;
3094
+ }
3095
+ }
3096
+
3097
+ @media screen and (max-width: 500px) {
3098
+ .wrap-accesibe .home-hero .home-hero-image .play-button-wrap .play-button {
3099
+ top: -25px;
3100
+ right: -25px;
3101
+ }
3102
+
3103
+ .wrap-accesibe .home-hero .home-hero-image {
3104
+ height: auto;
3105
+ }
3106
+
3107
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-title br {
3108
+ display: none;
3109
+ }
3110
+
3111
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-title {
3112
+ font-size: 27px;
3113
+ }
3114
+
3115
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-checkmarks .home-hero-checkmark {
3116
+ font-size: 16px;
3117
+ }
3118
+
3119
+ .wrap-accesibe .home-hero .home-hero-logos .home-hero-logos-title {
3120
+ margin-bottom: 30px;
3121
+ font-size: 16px;
3122
+ }
3123
+
3124
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item:nth-child(-n + 10) {
3125
+ display: block;
3126
+ }
3127
+
3128
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item {
3129
+ display: none;
3130
+ width: 50% !important;
3131
+ }
3132
+
3133
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage {
3134
+ display: -webkit-box;
3135
+ display: -ms-flexbox;
3136
+ display: flex;
3137
+ -webkit-box-pack: justify;
3138
+ -ms-flex-pack: justify;
3139
+ justify-content: space-between;
3140
+ -webkit-box-align: start;
3141
+ -ms-flex-align: start;
3142
+ align-items: flex-start;
3143
+ width: 100% !important;
3144
+ -webkit-transform: none !important;
3145
+ -ms-transform: none !important;
3146
+ transform: none !important;
3147
+ -ms-flex-wrap: wrap;
3148
+ flex-wrap: wrap;
3149
+ }
3150
+
3151
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav {
3152
+ display: none !important;
3153
+ }
3154
+
3155
+ .wrap-accesibe .home-hero .home-hero-logos {
3156
+ bottom: -35px;
3157
+ }
3158
+ }
build/css/wpcf7-redirect-frontend.min.css ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .popup-template .modal {
2
+ opacity: 0;
3
+ -webkit-transition: all 250ms ease;
4
+ -o-transition: all 250ms ease;
5
+ transition: all 250ms ease;
6
+ }
7
+
8
+ .popup-template .modal.is-open {
9
+ opacity: 1;
10
+ -webkit-transition: all 250ms ease;
11
+ -o-transition: all 250ms ease;
12
+ transition: all 250ms ease;
13
+ }
build/images/accesibie-logo.png ADDED
Binary file
build/images/accessibe-full-logo.svg ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
3
+ viewBox="0 0 1358 198" style="enable-background:new 0 0 1358 198;" xml:space="preserve">
4
+ <style type="text/css">
5
+ .st0{opacity:0.8;fill:#60D0FF;enable-background:new ;}
6
+ .st1{fill:#136EF8;}
7
+ .st2{fill:#2D7FFF;}
8
+ .st3{fill:#0047D8;}
9
+ </style>
10
+ <g>
11
+ <path class="st0" d="M87.2,198.6c-2.5-5.9-21.6-0.4-31.6-0.5C34.8,144.3,22.6,112.6,1.8,58.7c-1.6-3.9-2.7-7.8-0.9-12.2
12
+ s4.6-4.9,7.6-4.8c23.5,0,47,0.4,70.6-0.1c7.6-0.2,12.5,3.3,16.2,13.6c7.5,20.8,15.8,40.9,23.7,61.3c0,0.3,0,0.6,0,1
13
+ c-4.1,10.3-8.1,20.5-12.1,30.8C95.1,178.2,98.8,168.6,87.2,198.6z"/>
14
+ <path class="st1" d="M110.8,58.4c6.5-16.8,12.9-33.7,19.5-50.5c1.9-4.9,5.1-7.5,9-7.5c25.7,0,51.4,0,77,0.2c5.7,0,8.6,7.6,5.8,14.9
15
+ c-23.4,60.4-46.8,120.8-70.3,181.1c-0.2,0.4-0.5,1.1-0.7,1.5c-0.6-1.6-1.1-3.5-1.7-5.1c-0.2-0.7-0.5-1.5-0.7-2.2l0,0
16
+ c0.1-0.8,0.4-1.7,0.2-2.3c-4.9-17-9.9-33.9-14.9-50.9c-3-10.4-6-20.8-8.9-31.3c-2.6-8.9-5.1-17.9-7.7-26.8
17
+ C115.1,72.6,112.9,65.5,110.8,58.4z"/>
18
+ <path class="st2" d="M149.3,193.1c0.6,1.6,1.2,3.4,1.8,5c-13.9,0.1-27.9,0-41.8,0.1c-16.1,0.1-32.3,0-48.4-0.1c-1.3,0-3.1,0-4.4,0
19
+ c11.6-30,23.7-61.3,35.3-91.3c4-10.3,8.1-20.5,12.1-30.8c2.1,5.3,4.2,10.5,6.3,15.8c3,7.8,6,15.6,9,23.4
20
+ c3.6,9.4,7.3,18.9,10.9,28.3c1.4,3.8,2.7,7.6,4.2,11.4c4.7,12,9.5,24,14.3,36.1l0,0C148.8,191.6,149.1,192.3,149.3,193.1z"/>
21
+ <polyline class="st3" points="119.9,34.7 103.5,77.2 151.1,198.1 120.3,35.8 151,197.1 "/>
22
+ </g>
23
+ <g>
24
+ <path class="st1" d="M377.5,192.4l-0.1,0.6l-32.5,3c-3.7-4.6-6.7-10.6-7.8-18.6h-0.6c-10.2,11.5-24.3,18.6-42.8,18.6
25
+ c-23.9,0-43.7-11.6-43.7-37.3c0-28,23.3-47.8,79.8-47.8h6.7c-1.2-19-12.8-26.6-33.2-26.6c-14.5,0-26,4-38.5,12.2h-0.5l-9.8-27.6
26
+ c17.1-9.1,34.3-13,55.4-13c42.7,0,62.2,16,62.2,57.1v34.1C372.2,169.3,373.5,181.1,377.5,192.4z M336.7,136.3V132h-7.6
27
+ c-33.7,0-43.6,10.5-43.6,22c0,10.3,8.2,15.9,19.7,15.9C321.4,169.8,336.7,158.8,336.7,136.3z"/>
28
+ <path class="st1" d="M426.6,127.1c0,25.2,11.3,38.6,33.7,38.6c12,0,24.7-3.9,35-11.9h0.5l10.2,28.8c-11.4,6.6-30,13.4-51,13.4
29
+ c-45,0-67.8-29.4-67.8-69.1c0-41.2,24.6-71.1,71.4-71.1c23.1,0,39.8,7.3,46.2,12.6l-10.2,28.3h-0.5c-8.6-6.5-20.8-10.7-32.7-10.7
30
+ C439.8,85.9,426.6,99.8,426.6,127.1z"/>
31
+ <path class="st1" d="M547.6,127.1c0,25.2,11.3,38.6,33.7,38.6c12,0,24.7-3.9,35-11.9h0.5l10.2,28.8c-11.4,6.6-30,13.4-51,13.4
32
+ c-45,0-67.8-29.4-67.8-69.1c0-41.2,24.6-71.1,71.4-71.1c23.1,0,39.8,7.3,46.2,12.6l-10.2,28.3h-0.5c-8.6-6.5-20.8-10.7-32.7-10.7
33
+ C560.8,85.9,547.6,99.8,547.6,127.1z"/>
34
+ <path class="st1" d="M751.6,134.4h-85.3c2.4,23.5,15.1,33.5,37.4,33.5c16.6,0,30-4.2,39.7-12.1h0.5l9.6,26.9
35
+ c-10.9,6.3-31.6,13.1-54.6,13.1c-49,0-70-29.8-70-67.8c0-42.8,26.5-72.5,70.2-72.5c38.1,0,56,22.6,56,58.5c0,5-0.4,11.5-1,18
36
+ L751.6,134.4z M722.8,106.7c0-14.7-8.7-25.3-25.1-25.3c-16.5,0-28.3,10.9-31.1,33.5l56-2C722.8,111.3,722.8,109.9,722.8,106.7z"/>
37
+ <path class="st1" d="M865,95.6h-0.7c-11.2-8.7-24.2-13.8-37.8-13.8c-14,0-21.8,5.5-21.8,13.7c0,24.5,72.2,9.7,72.2,58.4
38
+ c0,28.5-24.6,41.7-59.7,41.7c-22,0-42.1-5.3-55.6-13.7l9.7-26.6h0.6c10.2,8.9,25.1,14.4,41.8,14.4c15.5,0,24.3-4.8,24.3-14
39
+ c0-25.5-71.1-11.4-71.1-59c0-25.7,20.8-41.1,57.7-41.1c19.8,0,35.6,4.6,50,13L865,95.6z"/>
40
+ <path class="st1" d="M985.3,95.6h-0.7c-11.2-8.7-24.2-13.8-37.8-13.8c-14,0-21.8,5.5-21.8,13.7c0,24.5,72.2,9.7,72.2,58.4
41
+ c0,28.5-24.6,41.7-59.7,41.7c-22,0-42.1-5.3-55.6-13.7l9.7-26.6h0.6c10.2,8.9,25.1,14.4,41.8,14.4c15.5,0,24.3-4.8,24.3-14
42
+ c0-25.5-71.1-11.4-71.1-59c0-25.7,20.8-41.1,57.7-41.1c19.8,0,35.6,4.6,50,13L985.3,95.6z"/>
43
+ <path class="st1" d="M1007.6,21.7c0-11.1,9-19,24.8-19c14.8,0,23.5,6.9,23.5,17.9c0,11.3-9.3,19.3-24.7,19.3
44
+ C1016.1,39.8,1007.6,33,1007.6,21.7z M1011.9,64.3l38.5-6.1v135.3h-38.5V64.3z"/>
45
+ <path class="st1" d="M1221.4,143c0,32.4-25.2,53.4-91.7,53.4c-12.5,0-29.3-0.7-53.3-3.5V16c18.2-2.3,34-3.5,50-3.5
46
+ c66.5,0,87.9,20.4,87.9,48.9c0,16-6.7,30.1-25.3,38.5v0.9C1214.9,108.3,1221.4,126.4,1221.4,143z M1116,40.4v49.3h26
47
+ c23.6,0,34.1-7.8,34.1-23.9c0-16.9-11.4-26-43.1-26C1128.6,39.7,1122.7,40,1116,40.4z M1180.8,141.5c0-17.3-11.3-24.8-34.9-24.8
48
+ H1116v50.8c5.7,0.4,10.6,0.5,15,0.5C1169.6,168,1180.8,158.8,1180.8,141.5z"/>
49
+ <path class="st1" d="M1352.4,134.4h-85.3c2.4,23.5,15.1,33.5,37.4,33.5c16.6,0,30-4.2,39.7-12.1h0.5l9.6,26.9
50
+ c-10.9,6.3-31.6,13.1-54.6,13.1c-49,0-70-29.8-70-67.8c0-42.8,26.5-72.5,70.2-72.5c38.1,0,56,22.6,56,58.5c0,5-0.4,11.5-1,18
51
+ L1352.4,134.4z M1323.6,106.7c0-14.7-8.7-25.3-25.1-25.3c-16.5,0-28.3,10.9-31.1,33.5l56-2C1323.6,111.3,1323.6,109.9,1323.6,106.7
52
+ z"/>
53
+ </g>
54
+ </svg>
build/images/banner-pro.png ADDED
Binary file
build/images/banner.png ADDED
Binary file
build/images/bundle.png ADDED
Binary file
build/images/hubspot.png ADDED
Binary file
build/images/icon-plane.png ADDED
Binary file
build/images/icon1.png ADDED
Binary file
build/images/icon10.png ADDED
Binary file
build/images/icon11.png ADDED
Binary file
build/images/icon12.png ADDED
Binary file
build/images/icon13.png ADDED
Binary file
build/images/icon3.png ADDED
Binary file
build/images/icon6.png ADDED
Binary file
build/images/icon7.png ADDED
Binary file
build/images/icon8.png ADDED
Binary file
build/images/icon9.png ADDED
Binary file
build/images/loader.gif ADDED
Binary file
build/images/logo-querysol.png ADDED
Binary file
build/images/paypal.png ADDED
Binary file
build/images/salesforce.png ADDED
Binary file
build/js/wpcf7-redirect-backend-script.js ADDED
@@ -0,0 +1,1257 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! jQuery Validation Plugin - v1.19.2 - 5/23/2020
2
+ * https://jqueryvalidation.org/
3
+ * Copyright (c) 2020 Jörn Zaefferer; Licensed MIT */
4
+ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.on("click.validate",":submit",function(b){c.submitButton=b.currentTarget,a(this).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(this).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.on("submit.validate",function(b){function d(){var d,e;return c.submitButton&&(c.settings.submitHandler||c.formSubmitted)&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),!(c.settings.submitHandler&&!c.settings.debug)||(e=c.settings.submitHandler.call(c,c.currentForm,b),d&&d.remove(),void 0!==e&&e)}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c,d;return a(this[0]).is("form")?b=this.validate().form():(d=[],b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b,b||(d=d.concat(c.errorList))}),c.errorList=d),b},rules:function(b,c){var d,e,f,g,h,i,j=this[0],k="undefined"!=typeof this.attr("contenteditable")&&"false"!==this.attr("contenteditable");if(null!=j&&(!j.form&&k&&(j.form=this.closest("form")[0],j.name=this.attr("name")),null!=j.form)){if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(a,b){i[b]=f[b],delete f[b]}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g)),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}});var b=function(a){return a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};a.extend(a.expr.pseudos||a.expr[":"],{blank:function(c){return!b(""+a(c).val())},filled:function(c){var d=a(c).val();return null!==d&&!!b(""+d)},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:void 0===c?b:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(b,c){var d=[16,17,18,20,35,36,37,38,39,40,45,144,225];9===c.which&&""===this.elementValue(b)||a.inArray(c.keyCode,d)!==-1||(b.name in this.submitted||b.name in this.invalid)&&this.element(b)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}."),step:a.validator.format("Please enter a multiple of {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c="undefined"!=typeof a(this).attr("contenteditable")&&"false"!==a(this).attr("contenteditable");if(!this.form&&c&&(this.form=a(this).closest("form")[0],this.name=a(this).attr("name")),d===this.form){var e=a.data(this.form,"validator"),f="on"+b.type.replace(/^validate/,""),g=e.settings;g[f]&&!a(this).is(g.ignore)&&g[f].call(e,this,b)}}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.currentForm,e=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){e[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox'], [contenteditable], [type='button']",b).on("click.validate","select, option, [type='radio'], [type='checkbox']",b),this.settings.invalidHandler&&a(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c,d,e=this.clean(b),f=this.validationTargetFor(e),g=this,h=!0;return void 0===f?delete this.invalid[e.name]:(this.prepareElement(f),this.currentElements=a(f),d=this.groups[f.name],d&&a.each(this.groups,function(a,b){b===d&&a!==f.name&&(e=g.validationTargetFor(g.clean(g.findByName(a))),e&&e.name in g.invalid&&(g.currentElements.push(e),h=g.check(e)&&h))}),c=this.check(f)!==!1,h=h&&c,c?this.invalid[f.name]=!1:this.invalid[f.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),a(b).attr("aria-invalid",!c)),h},showErrors:function(b){if(b){var c=this;a.extend(this.errorMap,b),this.errorList=a.map(this.errorMap,function(a,b){return{message:a,element:c.findByName(b)[0]}}),this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.invalid={},this.submitted={},this.prepareForm(),this.hideErrors();var b=this.elements().removeData("previousValue").removeAttr("aria-invalid");this.resetElements(b)},resetElements:function(a){var b;if(this.settings.unhighlight)for(b=0;a[b];b++)this.settings.unhighlight.call(this,a[b],this.settings.errorClass,""),this.findByName(a[b].name).removeClass(this.settings.validClass);else a.removeClass(this.settings.errorClass).removeClass(this.settings.validClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)void 0!==a[b]&&null!==a[b]&&a[b]!==!1&&c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").trigger("focus").trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var d=this.name||a(this).attr("name"),e="undefined"!=typeof a(this).attr("contenteditable")&&"false"!==a(this).attr("contenteditable");return!d&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),e&&(this.form=a(this).closest("form")[0],this.name=d),this.form===b.currentForm&&(!(d in c||!b.objectLength(a(this).rules()))&&(c[d]=!0,!0))})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},resetInternals:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([])},reset:function(){this.resetInternals(),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d,e=a(b),f=b.type,g="undefined"!=typeof e.attr("contenteditable")&&"false"!==e.attr("contenteditable");return"radio"===f||"checkbox"===f?this.findByName(b.name).filter(":checked").val():"number"===f&&"undefined"!=typeof b.validity?b.validity.badInput?"NaN":e.val():(c=g?e.text():e.val(),"file"===f?"C:\\fakepath\\"===c.substr(0,12)?c.substr(12):(d=c.lastIndexOf("/"),d>=0?c.substr(d+1):(d=c.lastIndexOf("\\"),d>=0?c.substr(d+1):c)):"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f,g=a(b).rules(),h=a.map(g,function(a,b){return b}).length,i=!1,j=this.elementValue(b);"function"==typeof g.normalizer?f=g.normalizer:"function"==typeof this.settings.normalizer&&(f=this.settings.normalizer),f&&(j=f.call(b,j),delete g.normalizer);for(d in g){e={method:d,parameters:g[d]};try{if(c=a.validator.methods[d].call(this,j,b,e.parameters),"dependency-mismatch"===c&&1===h){i=!0;continue}if(i=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(k){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",k),k instanceof TypeError&&(k.message+=". Exception occurred when checking element "+b.id+", check the '"+e.method+"' method."),k}}if(!i)return this.objectLength(g)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a]},defaultMessage:function(b,c){"string"==typeof c&&(c={method:c});var d=this.findDefined(this.customMessage(b.name,c.method),this.customDataMessage(b,c.method),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c.method],"<strong>Warning: No message defined for "+b.name+"</strong>"),e=/\$?\{(\d+)\}/g;return"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),d},formatAndAdd:function(a,b){var c=this.defaultMessage(a,b);this.errorList.push({message:c,element:a,method:b.method}),this.errorMap[a.name]=c,this.submitted[a.name]=c},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g,h=this.errorsFor(b),i=this.idOrName(b),j=a(b).attr("aria-describedby");h.length?(h.removeClass(this.settings.validClass).addClass(this.settings.errorClass),h.html(c)):(h=a("<"+this.settings.errorElement+">").attr("id",i+"-error").addClass(this.settings.errorClass).html(c||""),d=h,this.settings.wrapper&&(d=h.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement.call(this,d,a(b)):d.insertAfter(b),h.is("label")?h.attr("for",i):0===h.parents("label[for='"+this.escapeCssMeta(i)+"']").length&&(f=h.attr("id"),j?j.match(new RegExp("\\b"+this.escapeCssMeta(f)+"\\b"))||(j+=" "+f):j=f,a(b).attr("aria-describedby",j),e=this.groups[b.name],e&&(g=this,a.each(g.groups,function(b,c){c===e&&a("[name='"+g.escapeCssMeta(b)+"']",g.currentForm).attr("aria-describedby",h.attr("id"))})))),!c&&this.settings.success&&(h.text(""),"string"==typeof this.settings.success?h.addClass(this.settings.success):this.settings.success(h,b)),this.toShow=this.toShow.add(h)},errorsFor:function(b){var c=this.escapeCssMeta(this.idOrName(b)),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+this.escapeCssMeta(d).replace(/\s+/g,", #")),this.errors().filter(e)},escapeCssMeta:function(a){return a.replace(/([\\!"#$%&'()*+,.\/:;<=>?@\[\]^`{|}~])/g,"\\$1")},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(b){return this.checkable(b)&&(b=this.findByName(b.name)),a(b).not(this.settings.ignore)[0]},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+this.escapeCssMeta(b)+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return!this.dependTypes[typeof a]||this.dependTypes[typeof a](a,b)},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(b){this.pending[b.name]||(this.pendingRequest++,a(b).addClass(this.settings.pendingClass),this.pending[b.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],a(b).removeClass(this.settings.pendingClass),c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.submitButton&&a("input:hidden[name='"+this.submitButton.name+"']",this.currentForm).remove(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b,c){return c="string"==typeof c&&c||"remote",a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,{method:c})})},destroy:function(){this.resetForm(),a(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur").find(".validate-lessThan-blur").off(".validate-lessThan").removeClass("validate-lessThan-blur").find(".validate-lessThanEqual-blur").off(".validate-lessThanEqual").removeClass("validate-lessThanEqual-blur").find(".validate-greaterThanEqual-blur").off(".validate-greaterThanEqual").removeClass("validate-greaterThanEqual-blur").find(".validate-greaterThan-blur").off(".validate-greaterThan").removeClass("validate-greaterThan-blur")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},normalizeAttributeRule:function(a,b,c,d){/min|max|step/.test(c)&&(null===b||/number|range|text/.test(b))&&(d=Number(d),isNaN(d)&&(d=void 0)),d||0===d?a[c]=d:b===c&&"range"!==b&&(a[c]=!0)},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),this.normalizeAttributeRule(e,g,c,d);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),""===d&&(d=!0),this.normalizeAttributeRule(e,g,c,d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0===e.param||e.param:(a.data(c.form,"validator").resetElements(a(c)),delete b[d])}}),a.each(b,function(d,e){b[d]=a.isFunction(e)&&"normalizer"!==d?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(null!=b.min&&null!=b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),null!=b.minlength&&null!=b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:void 0!==b&&null!==b&&b.length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[\/?#]\S*)?$/i.test(a)},date:function(){var a=!1;return function(b,c){return a||(a=!0,this.settings.debug&&window.console&&console.warn("The `date` method is deprecated and will be removed in version '2.0.0'.\nPlease don't use it, since it relies on the Date constructor, which\nbehaves very differently across browsers and locales. Use `dateISO`\ninstead or one of the locale specific methods in `localizations/`\nand `additional-methods.js`.")),this.optional(c)||!/Invalid|NaN/.test(new Date(b).toString())}}(),dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e<=d},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||a<=c},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},step:function(b,c,d){var e,f=a(c).attr("type"),g="Step attribute on input type "+f+" is not supported.",h=["text","number","range"],i=new RegExp("\\b"+f+"\\b"),j=f&&!i.test(h.join()),k=function(a){var b=(""+a).match(/(?:\.(\d+))?$/);return b&&b[1]?b[1].length:0},l=function(a){return Math.round(a*Math.pow(10,e))},m=!0;if(j)throw new Error(g);return e=k(d),(k(b)>e||l(b)%l(d)!==0)&&(m=!1),this.optional(c)||m},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.not(".validate-equalTo-blur").length&&e.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d,e){if(this.optional(c))return"dependency-mismatch";e="string"==typeof e&&e||"remote";var f,g,h,i=this.previousValue(c,e);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),i.originalMessage=i.originalMessage||this.settings.messages[c.name][e],this.settings.messages[c.name][e]=i.message,d="string"==typeof d&&{url:d}||d,h=a.param(a.extend({data:b},d.data)),i.old===h?i.valid:(i.old=h,f=this,this.startRequest(c),g={},g[c.name]=b,a.ajax(a.extend(!0,{mode:"abort",port:"validate"+c.name,dataType:"json",data:g,context:f.currentForm,success:function(a){var d,g,h,j=a===!0||"true"===a;f.settings.messages[c.name][e]=i.originalMessage,j?(h=f.formSubmitted,f.resetInternals(),f.toHide=f.errorsFor(c),f.formSubmitted=h,f.successList.push(c),f.invalid[c.name]=!1,f.showErrors()):(d={},g=a||f.defaultMessage(c,{method:e,parameters:b}),d[c.name]=i.message=g,f.invalid[c.name]=!0,f.showErrors(d)),i.valid=j,f.stopRequest(c,j)}},d)),"pending")}}});var c,d={};return a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,c){var e=a.port;"abort"===a.mode&&(d[e]&&d[e].abort(),d[e]=c)}):(c=a.ajax,a.ajax=function(b){var e=("mode"in b?b:a.ajaxSettings).mode,f=("port"in b?b:a.ajaxSettings).port;return"abort"===e?(d[f]&&d[f].abort(),d[f]=c.apply(this,arguments),d[f]):c.apply(this,arguments)}),a});
5
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
6
+ !function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(u){var e=function(){if(u&&u.fn&&u.fn.select2&&u.fn.select2.amd)var e=u.fn.select2.amd;var t,n,r,h,o,s,f,g,m,v,y,_,i,a,b;function w(e,t){return i.call(e,t)}function l(e,t){var n,r,i,o,s,a,l,c,u,d,p,h=t&&t.split("/"),f=y.map,g=f&&f["*"]||{};if(e){for(s=(e=e.split("/")).length-1,y.nodeIdCompat&&b.test(e[s])&&(e[s]=e[s].replace(b,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),u=0;u<e.length;u++)if("."===(p=e[u]))e.splice(u,1),--u;else if(".."===p){if(0===u||1===u&&".."===e[2]||".."===e[u-1])continue;0<u&&(e.splice(u-1,2),u-=2)}e=e.join("/")}if((h||g)&&f){for(u=(n=e.split("/")).length;0<u;--u){if(r=n.slice(0,u).join("/"),h)for(d=h.length;0<d;--d)if(i=(i=f[h.slice(0,d).join("/")])&&i[r]){o=i,a=u;break}if(o)break;!l&&g&&g[r]&&(l=g[r],c=u)}!o&&l&&(o=l,a=c),o&&(n.splice(0,a,o),e=n.join("/"))}return e}function A(t,n){return function(){var e=a.call(arguments,0);return"string"!=typeof e[0]&&1===e.length&&e.push(null),s.apply(h,e.concat([t,n]))}}function x(t){return function(e){m[t]=e}}function D(e){if(w(v,e)){var t=v[e];delete v[e],_[e]=!0,o.apply(h,t)}if(!w(m,e)&&!w(_,e))throw new Error("No "+e);return m[e]}function c(e){var t,n=e?e.indexOf("!"):-1;return-1<n&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function S(e){return e?c(e):[]}return e&&e.requirejs||(e?n=e:e={},m={},v={},y={},_={},i=Object.prototype.hasOwnProperty,a=[].slice,b=/\.js$/,f=function(e,t){var n,r,i=c(e),o=i[0],s=t[1];return e=i[1],o&&(n=D(o=l(o,s))),o?e=n&&n.normalize?n.normalize(e,(r=s,function(e){return l(e,r)})):l(e,s):(o=(i=c(e=l(e,s)))[0],e=i[1],o&&(n=D(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:n}},g={require:function(e){return A(e)},exports:function(e){var t=m[e];return void 0!==t?t:m[e]={}},module:function(e){return{id:e,uri:"",exports:m[e],config:(t=e,function(){return y&&y.config&&y.config[t]||{}})};var t}},o=function(e,t,n,r){var i,o,s,a,l,c,u,d=[],p=typeof n;if(c=S(r=r||e),"undefined"==p||"function"==p){for(t=!t.length&&n.length?["require","exports","module"]:t,l=0;l<t.length;l+=1)if("require"===(o=(a=f(t[l],c)).f))d[l]=g.require(e);else if("exports"===o)d[l]=g.exports(e),u=!0;else if("module"===o)i=d[l]=g.module(e);else if(w(m,o)||w(v,o)||w(_,o))d[l]=D(o);else{if(!a.p)throw new Error(e+" missing "+o);a.p.load(a.n,A(r,!0),x(o),{}),d[l]=m[o]}s=n?n.apply(m[e],d):void 0,e&&(i&&i.exports!==h&&i.exports!==m[e]?m[e]=i.exports:s===h&&u||(m[e]=s))}else e&&(m[e]=n)},t=n=s=function(e,t,n,r,i){if("string"==typeof e)return g[e]?g[e](t):D(f(e,S(t)).f);if(!e.splice){if((y=e).deps&&s(y.deps,y.callback),!t)return;t.splice?(e=t,t=n,n=null):e=h}return t=t||function(){},"function"==typeof n&&(n=r,r=i),r?o(h,e,t,n):setTimeout(function(){o(h,e,t,n)},4),s},s.config=function(e){return s(e)},t._defined=m,(r=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),w(m,e)||w(v,e)||(v[e]=[e,t,n])}).amd={jQuery:!0},e.requirejs=t,e.require=n,e.define=r),e.define("almond",function(){}),e.define("jquery",[],function(){var e=u||$;return null==e&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),e}),e.define("select2/utils",["jquery"],function(o){var i={};function u(e){var t=e.prototype,n=[];for(var r in t){"function"==typeof t[r]&&"constructor"!==r&&n.push(r)}return n}i.Extend=function(e,t){var n={}.hasOwnProperty;function r(){this.constructor=e}for(var i in t)n.call(t,i)&&(e[i]=t[i]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e},i.Decorate=function(r,i){var e=u(i),t=u(r);function o(){var e=Array.prototype.unshift,t=i.prototype.constructor.length,n=r.prototype.constructor;0<t&&(e.call(arguments,r.prototype.constructor),n=i.prototype.constructor),n.apply(this,arguments)}i.displayName=r.displayName,o.prototype=new function(){this.constructor=o};for(var n=0;n<t.length;n++){var s=t[n];o.prototype[s]=r.prototype[s]}function a(e){var t=function(){};e in o.prototype&&(t=o.prototype[e]);var n=i.prototype[e];return function(){return Array.prototype.unshift.call(arguments,t),n.apply(this,arguments)}}for(var l=0;l<e.length;l++){var c=e[l];o.prototype[c]=a(c)}return o};function e(){this.listeners={}}e.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},e.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),(n[0]._type=e)in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},e.prototype.invoke=function(e,t){for(var n=0,r=e.length;n<r;n++)e[n].apply(this,t)},i.Observable=e,i.generateChars=function(e){for(var t="",n=0;n<e;n++){t+=Math.floor(36*Math.random()).toString(36)}return t},i.bind=function(e,t){return function(){e.apply(t,arguments)}},i._convertData=function(e){for(var t in e){var n=t.split("-"),r=e;if(1!==n.length){for(var i=0;i<n.length;i++){var o=n[i];(o=o.substring(0,1).toLowerCase()+o.substring(1))in r||(r[o]={}),i==n.length-1&&(r[o]=e[t]),r=r[o]}delete e[t]}}return e},i.hasScroll=function(e,t){var n=o(t),r=t.style.overflowX,i=t.style.overflowY;return(r!==i||"hidden"!==i&&"visible"!==i)&&("scroll"===r||"scroll"===i||(n.innerHeight()<t.scrollHeight||n.innerWidth()<t.scrollWidth))},i.escapeMarkup=function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},i.appendMany=function(e,t){if("1.7"===o.fn.jquery.substr(0,3)){var n=o();o.map(t,function(e){n=n.add(e)}),t=n}e.append(t)},i.__cache={};var n=0;return i.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null==t&&(e.id?(t=e.id,e.setAttribute("data-select2-id",t)):(e.setAttribute("data-select2-id",++n),t=n.toString())),t},i.StoreData=function(e,t,n){var r=i.GetUniqueElementId(e);i.__cache[r]||(i.__cache[r]={}),i.__cache[r][t]=n},i.GetData=function(e,t){var n=i.GetUniqueElementId(e);return t?i.__cache[n]&&null!=i.__cache[n][t]?i.__cache[n][t]:o(e).data(t):i.__cache[n]},i.RemoveData=function(e){var t=i.GetUniqueElementId(e);null!=i.__cache[t]&&delete i.__cache[t],e.removeAttribute("data-select2-id")},i}),e.define("select2/results",["jquery","./utils"],function(h,f){function r(e,t,n){this.$element=e,this.data=n,this.options=t,r.__super__.constructor.call(this)}return f.Extend(r,f.Observable),r.prototype.render=function(){var e=h('<ul class="select2-results__options" role="listbox"></ul>');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},r.prototype.clear=function(){this.$results.empty()},r.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=h('<li role="alert" aria-live="assertive" class="select2-results__option"></li>'),r=this.options.get("translations").get(e.message);n.append(t(r(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},r.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},r.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var r=e.results[n],i=this.option(r);t.push(i)}this.$results.append(t)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},r.prototype.position=function(e,t){t.find(".select2-results").append(e)},r.prototype.sort=function(e){return this.options.get("sorter")(e)},r.prototype.highlightFirstItem=function(){var e=this.$results.find(".select2-results__option[aria-selected]"),t=e.filter("[aria-selected=true]");0<t.length?t.first().trigger("mouseenter"):e.first().trigger("mouseenter"),this.ensureHighlightVisible()},r.prototype.setClasses=function(){var t=this;this.data.current(function(e){var r=h.map(e,function(e){return e.id.toString()});t.$results.find(".select2-results__option[aria-selected]").each(function(){var e=h(this),t=f.GetData(this,"data"),n=""+t.id;null!=t.element&&t.element.selected||null==t.element&&-1<h.inArray(n,r)?e.attr("aria-selected","true"):e.attr("aria-selected","false")})})},r.prototype.showLoading=function(e){this.hideLoading();var t={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(e)},n=this.option(t);n.className+=" loading-results",this.$results.prepend(n)},r.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},r.prototype.option=function(e){var t=document.createElement("li");t.className="select2-results__option";var n={role:"option","aria-selected":"false"},r=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(var i in(null!=e.element&&r.call(e.element,":disabled")||null==e.element&&e.disabled)&&(delete n["aria-selected"],n["aria-disabled"]="true"),null==e.id&&delete n["aria-selected"],null!=e._resultId&&(t.id=e._resultId),e.title&&(t.title=e.title),e.children&&(n.role="group",n["aria-label"]=e.text,delete n["aria-selected"]),n){var o=n[i];t.setAttribute(i,o)}if(e.children){var s=h(t),a=document.createElement("strong");a.className="select2-results__group";h(a);this.template(e,a);for(var l=[],c=0;c<e.children.length;c++){var u=e.children[c],d=this.option(u);l.push(d)}var p=h("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});p.append(l),s.append(a),s.append(p)}else this.template(e,t);return f.StoreData(t,"data",e),t},r.prototype.bind=function(t,e){var l=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){l.clear(),l.append(e.data),t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("results:append",function(e){l.append(e.data),t.isOpen()&&l.setClasses()}),t.on("query",function(e){l.hideMessages(),l.showLoading(e)}),t.on("select",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("open",function(){l.$results.attr("aria-expanded","true"),l.$results.attr("aria-hidden","false"),l.setClasses(),l.ensureHighlightVisible()}),t.on("close",function(){l.$results.attr("aria-expanded","false"),l.$results.attr("aria-hidden","true"),l.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=l.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=l.getHighlightedResults();if(0!==e.length){var t=f.GetData(e[0],"data");"true"==e.attr("aria-selected")?l.trigger("close",{}):l.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e);if(!(n<=0)){var r=n-1;0===e.length&&(r=0);var i=t.eq(r);i.trigger("mouseenter");var o=l.$results.offset().top,s=i.offset().top,a=l.$results.scrollTop()+(s-o);0===r?l.$results.scrollTop(0):s-o<0&&l.$results.scrollTop(a)}}),t.on("results:next",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var r=t.eq(n);r.trigger("mouseenter");var i=l.$results.offset().top+l.$results.outerHeight(!1),o=r.offset().top+r.outerHeight(!1),s=l.$results.scrollTop()+o-i;0===n?l.$results.scrollTop(0):i<o&&l.$results.scrollTop(s)}}),t.on("results:focus",function(e){e.element.addClass("select2-results__option--highlighted")}),t.on("results:message",function(e){l.displayMessage(e)}),h.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=l.$results.scrollTop(),n=l.$results.get(0).scrollHeight-t+e.deltaY,r=0<e.deltaY&&t-e.deltaY<=0,i=e.deltaY<0&&n<=l.$results.height();r?(l.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):i&&(l.$results.scrollTop(l.$results.get(0).scrollHeight-l.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(e){var t=h(this),n=f.GetData(this,"data");"true"!==t.attr("aria-selected")?l.trigger("select",{originalEvent:e,data:n}):l.options.get("multiple")?l.trigger("unselect",{originalEvent:e,data:n}):l.trigger("close",{})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(e){var t=f.GetData(this,"data");l.getHighlightedResults().removeClass("select2-results__option--highlighted"),l.trigger("results:focus",{data:t,element:h(this)})})},r.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},r.prototype.destroy=function(){this.$results.remove()},r.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find("[aria-selected]").index(e),n=this.$results.offset().top,r=e.offset().top,i=this.$results.scrollTop()+(r-n),o=r-n;i-=2*e.outerHeight(!1),t<=2?this.$results.scrollTop(0):(o>this.$results.outerHeight()||o<0)&&this.$results.scrollTop(i)}},r.prototype.template=function(e,t){var n=this.options.get("templateResult"),r=this.options.get("escapeMarkup"),i=n(e,t);null==i?t.style.display="none":"string"==typeof i?t.innerHTML=r(i):h(t).append(i)},r}),e.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2/selection/base",["jquery","../utils","../keys"],function(n,r,i){function o(e,t){this.$element=e,this.options=t,o.__super__.constructor.call(this)}return r.Extend(o,r.Observable),o.prototype.render=function(){var e=n('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=r.GetData(this.$element[0],"old-tabindex")?this._tabindex=r.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),e.attr("aria-disabled","false"),this.$selection=e},o.prototype.bind=function(e,t){var n=this,r=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===i.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",r),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.trigger("focus"),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex),n.$selection.attr("aria-disabled","false")}),e.on("disable",function(){n.$selection.attr("tabindex","-1"),n.$selection.attr("aria-disabled","true")})},o.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},o.prototype._attachCloseHandler=function(e){n(document.body).on("mousedown.select2."+e.id,function(e){var t=n(e.target).closest(".select2");n(".select2.select2-container--open").each(function(){this!=t[0]&&r.GetData(this,"element").select2("close")})})},o.prototype._detachCloseHandler=function(e){n(document.body).off("mousedown.select2."+e.id)},o.prototype.position=function(e,t){t.find(".selection").append(e)},o.prototype.destroy=function(){this._detachCloseHandler(this.container)},o.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},o.prototype.isEnabled=function(){return!this.isDisabled()},o.prototype.isDisabled=function(){return this.options.get("disabled")},o}),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,r){function i(){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},i.prototype.bind=function(t,e){var n=this;i.__super__.bind.apply(this,arguments);var r=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",r).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",r),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.trigger("focus")})},i.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},i.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},i.prototype.selectionContainer=function(){return e("<span></span>")},i.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),r=this.display(t,n);n.empty().append(r);var i=t.title||t.text;i?n.attr("title",i):n.removeAttr("title")}else this.clear()},i}),e.define("select2/selection/multiple",["jquery","./base","../utils"],function(i,e,l){function n(e,t){n.__super__.constructor.apply(this,arguments)}return l.Extend(n,e),n.prototype.render=function(){var e=n.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('<ul class="select2-selection__rendered"></ul>'),e},n.prototype.bind=function(e,t){var r=this;n.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){r.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){if(!r.isDisabled()){var t=i(this).parent(),n=l.GetData(t[0],"data");r.trigger("unselect",{originalEvent:e,data:n})}})},n.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},n.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},n.prototype.selectionContainer=function(){return i('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>')},n.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=0;n<e.length;n++){var r=e[n],i=this.selectionContainer(),o=this.display(r,i);i.append(o);var s=r.title||r.text;s&&i.attr("title",s),l.StoreData(i[0],"data",r),t.push(i)}var a=this.$selection.find(".select2-selection__rendered");l.appendMany(a,t)}},n}),e.define("select2/selection/placeholder",["../utils"],function(e){function t(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return t.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},t.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();return n.html(this.display(t)),n.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),n},t.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id;if(1<t.length||n)return e.call(this,t);this.clear();var r=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(r)},t}),e.define("select2/selection/allowClear",["jquery","../keys","../utils"],function(i,r,a){function e(){}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(e){r._handleClear(e)}),t.on("keypress",function(e){r._handleKeyboardClear(e,t)})},e.prototype._handleClear=function(e,t){if(!this.isDisabled()){var n=this.$selection.find(".select2-selection__clear");if(0!==n.length){t.stopPropagation();var r=a.GetData(n[0],"data"),i=this.$element.val();this.$element.val(this.placeholder.id);var o={data:r};if(this.trigger("clear",o),o.prevented)this.$element.val(i);else{for(var s=0;s<r.length;s++)if(o={data:r[s]},this.trigger("unselect",o),o.prevented)return void this.$element.val(i);this.$element.trigger("input").trigger("change"),this.trigger("toggle",{})}}}},e.prototype._handleKeyboardClear=function(e,t,n){n.isOpen()||t.which!=r.DELETE&&t.which!=r.BACKSPACE||this._handleClear(t)},e.prototype.update=function(e,t){if(e.call(this,t),!(0<this.$selection.find(".select2-selection__placeholder").length||0===t.length)){var n=this.options.get("translations").get("removeAllItems"),r=i('<span class="select2-selection__clear" title="'+n()+'">&times;</span>');a.StoreData(r[0],"data",t),this.$selection.find(".select2-selection__rendered").prepend(r)}},e}),e.define("select2/selection/search",["jquery","../utils","../keys"],function(r,a,l){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=r('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></li>');this.$searchContainer=t,this.$search=t.find("input");var n=e.call(this);return this._transferTabIndex(),n},e.prototype.bind=function(e,t,n){var r=this,i=t.id+"-results";e.call(this,t,n),t.on("open",function(){r.$search.attr("aria-controls",i),r.$search.trigger("focus")}),t.on("close",function(){r.$search.val(""),r.$search.removeAttr("aria-controls"),r.$search.removeAttr("aria-activedescendant"),r.$search.trigger("focus")}),t.on("enable",function(){r.$search.prop("disabled",!1),r._transferTabIndex()}),t.on("disable",function(){r.$search.prop("disabled",!0)}),t.on("focus",function(e){r.$search.trigger("focus")}),t.on("results:focus",function(e){e.data._resultId?r.$search.attr("aria-activedescendant",e.data._resultId):r.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2-search--inline",function(e){r.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){r._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented(),e.which===l.BACKSPACE&&""===r.$search.val()){var t=r.$searchContainer.prev(".select2-selection__choice");if(0<t.length){var n=a.GetData(t[0],"data");r.searchRemoveChoice(n),e.preventDefault()}}}),this.$selection.on("click",".select2-search--inline",function(e){r.$search.val()&&e.stopPropagation()});var o=document.documentMode,s=o&&o<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(e){s?r.$selection.off("input.search input.searchcheck"):r.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(e){if(s&&"input"===e.type)r.$selection.off("input.search input.searchcheck");else{var t=e.which;t!=l.SHIFT&&t!=l.CTRL&&t!=l.ALT&&t!=l.TAB&&r.handleSearch(e)}})},e.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},e.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},e.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.trigger("focus")},e.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},e.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},e.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="";""!==this.$search.attr("placeholder")?e=this.$selection.find(".select2-selection__rendered").width():e=.75*(this.$search.val().length+1)+"em";this.$search.css("width",e)},e}),e.define("select2/selection/eventRelay",["jquery"],function(s){function e(){}return e.prototype.bind=function(e,t,n){var r=this,i=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],o=["opening","closing","selecting","unselecting","clearing"];e.call(this,t,n),t.on("*",function(e,t){if(-1!==s.inArray(e,i)){t=t||{};var n=s.Event("select2:"+e,{params:t});r.$element.trigger(n),-1!==s.inArray(e,o)&&(t.prevented=n.isDefaultPrevented())}})},e}),e.define("select2/translation",["jquery","require"],function(t,n){function r(e){this.dict=e||{}}return r.prototype.all=function(){return this.dict},r.prototype.get=function(e){return this.dict[e]},r.prototype.extend=function(e){this.dict=t.extend({},e.all(),this.dict)},r._cache={},r.loadPath=function(e){if(!(e in r._cache)){var t=n(e);r._cache[e]=t}return new r(r._cache[e])},r}),e.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","œ":"oe","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ώ":"ω","ς":"σ","’":"'"}}),e.define("select2/data/base",["../utils"],function(r){function n(e,t){n.__super__.constructor.call(this)}return r.Extend(n,r.Observable),n.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},n.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},n.prototype.bind=function(e,t){},n.prototype.destroy=function(){},n.prototype.generateResultId=function(e,t){var n=e.id+"-result-";return n+=r.generateChars(4),null!=t.id?n+="-"+t.id.toString():n+="-"+r.generateChars(4),n},n}),e.define("select2/data/select",["./base","../utils","jquery"],function(e,a,l){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return a.Extend(n,e),n.prototype.current=function(e){var n=[],r=this;this.$element.find(":selected").each(function(){var e=l(this),t=r.item(e);n.push(t)}),e(n)},n.prototype.select=function(i){var o=this;if(i.selected=!0,l(i.element).is("option"))return i.element.selected=!0,void this.$element.trigger("input").trigger("change");if(this.$element.prop("multiple"))this.current(function(e){var t=[];(i=[i]).push.apply(i,e);for(var n=0;n<i.length;n++){var r=i[n].id;-1===l.inArray(r,t)&&t.push(r)}o.$element.val(t),o.$element.trigger("input").trigger("change")});else{var e=i.id;this.$element.val(e),this.$element.trigger("input").trigger("change")}},n.prototype.unselect=function(i){var o=this;if(this.$element.prop("multiple")){if(i.selected=!1,l(i.element).is("option"))return i.element.selected=!1,void this.$element.trigger("input").trigger("change");this.current(function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n].id;r!==i.id&&-1===l.inArray(r,t)&&t.push(r)}o.$element.val(t),o.$element.trigger("input").trigger("change")})}},n.prototype.bind=function(e,t){var n=this;(this.container=e).on("select",function(e){n.select(e.data)}),e.on("unselect",function(e){n.unselect(e.data)})},n.prototype.destroy=function(){this.$element.find("*").each(function(){a.RemoveData(this)})},n.prototype.query=function(r,e){var i=[],o=this;this.$element.children().each(function(){var e=l(this);if(e.is("option")||e.is("optgroup")){var t=o.item(e),n=o.matches(r,t);null!==n&&i.push(n)}}),e({results:i})},n.prototype.addOptions=function(e){a.appendMany(this.$element,e)},n.prototype.option=function(e){var t;e.children?(t=document.createElement("optgroup")).label=e.text:void 0!==(t=document.createElement("option")).textContent?t.textContent=e.text:t.innerText=e.text,void 0!==e.id&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);var n=l(t),r=this._normalizeItem(e);return r.element=t,a.StoreData(t,"data",r),n},n.prototype.item=function(e){var t={};if(null!=(t=a.GetData(e[0],"data")))return t;if(e.is("option"))t={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if(e.is("optgroup")){t={text:e.prop("label"),children:[],title:e.prop("title")};for(var n=e.children("option"),r=[],i=0;i<n.length;i++){var o=l(n[i]),s=this.item(o);r.push(s)}t.children=r}return(t=this._normalizeItem(t)).element=e[0],a.StoreData(e[0],"data",t),t},n.prototype._normalizeItem=function(e){e!==Object(e)&&(e={id:e,text:e});return null!=(e=l.extend({},{text:""},e)).id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),l.extend({},{selected:!1,disabled:!1},e)},n.prototype.matches=function(e,t){return this.options.get("matcher")(e,t)},n}),e.define("select2/data/array",["./select","../utils","jquery"],function(e,f,g){function r(e,t){this._dataToConvert=t.get("data")||[],r.__super__.constructor.call(this,e,t)}return f.Extend(r,e),r.prototype.bind=function(e,t){r.__super__.bind.call(this,e,t),this.addOptions(this.convertToOptions(this._dataToConvert))},r.prototype.select=function(n){var e=this.$element.find("option").filter(function(e,t){return t.value==n.id.toString()});0===e.length&&(e=this.option(n),this.addOptions(e)),r.__super__.select.call(this,n)},r.prototype.convertToOptions=function(e){var t=this,n=this.$element.find("option"),r=n.map(function(){return t.item(g(this)).id}).get(),i=[];function o(e){return function(){return g(this).val()==e.id}}for(var s=0;s<e.length;s++){var a=this._normalizeItem(e[s]);if(0<=g.inArray(a.id,r)){var l=n.filter(o(a)),c=this.item(l),u=g.extend(!0,{},a,c),d=this.option(u);l.replaceWith(d)}else{var p=this.option(a);if(a.children){var h=this.convertToOptions(a.children);f.appendMany(p,h)}i.push(p)}}return i},r}),e.define("select2/data/ajax",["./array","../utils","jquery"],function(e,t,o){function n(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),n.__super__.constructor.call(this,e,t)}return t.Extend(n,e),n.prototype._applyDefaults=function(e){var t={data:function(e){return o.extend({},e,{q:e.term})},transport:function(e,t,n){var r=o.ajax(e);return r.then(t),r.fail(n),r}};return o.extend({},t,e,!0)},n.prototype.processResults=function(e){return e},n.prototype.query=function(n,r){var i=this;null!=this._request&&(o.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var t=o.extend({type:"GET"},this.ajaxOptions);function e(){var e=t.transport(t,function(e){var t=i.processResults(e,n);i.options.get("debug")&&window.console&&console.error&&(t&&t.results&&o.isArray(t.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),r(t)},function(){"status"in e&&(0===e.status||"0"===e.status)||i.trigger("results:message",{message:"errorLoading"})});i._request=e}"function"==typeof t.url&&(t.url=t.url.call(this.$element,n)),"function"==typeof t.data&&(t.data=t.data.call(this.$element,n)),this.ajaxOptions.delay&&null!=n.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(e,this.ajaxOptions.delay)):e()},n}),e.define("select2/data/tags",["jquery"],function(u){function e(e,t,n){var r=n.get("tags"),i=n.get("createTag");void 0!==i&&(this.createTag=i);var o=n.get("insertTag");if(void 0!==o&&(this.insertTag=o),e.call(this,t,n),u.isArray(r))for(var s=0;s<r.length;s++){var a=r[s],l=this._normalizeItem(a),c=this.option(l);this.$element.append(c)}}return e.prototype.query=function(e,c,u){var d=this;this._removeOldTags(),null!=c.term&&null==c.page?e.call(this,c,function e(t,n){for(var r=t.results,i=0;i<r.length;i++){var o=r[i],s=null!=o.children&&!e({results:o.children},!0);if((o.text||"").toUpperCase()===(c.term||"").toUpperCase()||s)return!n&&(t.data=r,void u(t))}if(n)return!0;var a=d.createTag(c);if(null!=a){var l=d.option(a);l.attr("data-select2-tag",!0),d.addOptions([l]),d.insertTag(r,a)}t.results=r,u(t)}):e.call(this,c,u)},e.prototype.createTag=function(e,t){var n=u.trim(t.term);return""===n?null:{id:n,text:n}},e.prototype.insertTag=function(e,t,n){t.unshift(n)},e.prototype._removeOldTags=function(e){this.$element.find("option[data-select2-tag]").each(function(){this.selected||u(this).remove()})},e}),e.define("select2/data/tokenizer",["jquery"],function(d){function e(e,t,n){var r=n.get("tokenizer");void 0!==r&&(this.tokenizer=r),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".select2-search__field")},e.prototype.query=function(e,t,n){var i=this;t.term=t.term||"";var r=this.tokenizer(t,this.options,function(e){var t,n=i._normalizeItem(e);if(!i.$element.find("option").filter(function(){return d(this).val()===n.id}).length){var r=i.option(n);r.attr("data-select2-tag",!0),i._removeOldTags(),i.addOptions([r])}t=n,i.trigger("select",{data:t})});r.term!==t.term&&(this.$search.length&&(this.$search.val(r.term),this.$search.trigger("focus")),t.term=r.term),e.call(this,t,n)},e.prototype.tokenizer=function(e,t,n,r){for(var i=n.get("tokenSeparators")||[],o=t.term,s=0,a=this.createTag||function(e){return{id:e.term,text:e.term}};s<o.length;){var l=o[s];if(-1!==d.inArray(l,i)){var c=o.substr(0,s),u=a(d.extend({},t,{term:c}));null!=u?(r(u),o=o.substr(s+1)||"",s=0):s++}else s++}return{term:o}},e}),e.define("select2/data/minimumInputLength",[],function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",t.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumInputLength",[],function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",0<this.maximumInputLength&&t.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("select",function(){r._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var r=this;this._checkIfMaximumSelected(function(){e.call(r,t,n)})},e.prototype._checkIfMaximumSelected=function(e,n){var r=this;this.current(function(e){var t=null!=e?e.length:0;0<r.maximumSelectionLength&&t>=r.maximumSelectionLength?r.trigger("results:message",{message:"maximumSelected",args:{maximum:r.maximumSelectionLength}}):n&&n()})},e}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('<span class="select2-dropdown"><span class="select2-results"></span></span>');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery","../utils"],function(o,e){function t(){}return t.prototype.render=function(e){var t=e.call(this),n=o('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></span>');return this.$searchContainer=n,this.$search=n.find("input"),t.prepend(n),t},t.prototype.bind=function(e,t,n){var r=this,i=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){o(this).off("keyup")}),this.$search.on("keyup input",function(e){r.handleSearch(e)}),t.on("open",function(){r.$search.attr("tabindex",0),r.$search.attr("aria-controls",i),r.$search.trigger("focus"),window.setTimeout(function(){r.$search.trigger("focus")},0)}),t.on("close",function(){r.$search.attr("tabindex",-1),r.$search.removeAttr("aria-controls"),r.$search.removeAttr("aria-activedescendant"),r.$search.val(""),r.$search.trigger("blur")}),t.on("focus",function(){t.isOpen()||r.$search.trigger("focus")}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(r.showSearch(e)?r.$searchContainer.removeClass("select2-search--hide"):r.$searchContainer.addClass("select2-search--hide"))}),t.on("results:focus",function(e){e.data._resultId?r.$search.attr("aria-activedescendant",e.data._resultId):r.$search.removeAttr("aria-activedescendant")})},t.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t}),e.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,r){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,r)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),r=t.length-1;0<=r;r--){var i=t[r];this.placeholder.id===i.id&&n.splice(r,1)}return n},e}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function e(e,t,n,r){this.lastParams={},e.call(this,t,n,r),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("query",function(e){r.lastParams=e,r.loading=!0}),t.on("query:append",function(e){r.lastParams=e,r.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);if(!this.loading&&e){var t=this.$results.offset().top+this.$results.outerHeight(!1);this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=t+50&&this.loadMore()}},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(f,a){function e(e,t,n){this.$dropdownParent=f(n.get("dropdownParent")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("open",function(){r._showDropdown(),r._attachPositioningHandler(t),r._bindContainerResultHandlers(t)}),t.on("close",function(){r._hideDropdown(),r._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=f("<span></span>"),n=e.call(this);return t.append(n),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){if(!this._containerResultsHandlersBound){var n=this;t.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:message",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("select",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("unselect",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0}},e.prototype._attachPositioningHandler=function(e,t){var n=this,r="scroll.select2."+t.id,i="resize.select2."+t.id,o="orientationchange.select2."+t.id,s=this.$container.parents().filter(a.hasScroll);s.each(function(){a.StoreData(this,"select2-scroll-position",{x:f(this).scrollLeft(),y:f(this).scrollTop()})}),s.on(r,function(e){var t=a.GetData(this,"select2-scroll-position");f(this).scrollTop(t.y)}),f(window).on(r+" "+i+" "+o,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,r="resize.select2."+t.id,i="orientationchange.select2."+t.id;this.$container.parents().filter(a.hasScroll).off(n),f(window).off(n+" "+r+" "+i)},e.prototype._positionDropdown=function(){var e=f(window),t=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),r=null,i=this.$container.offset();i.bottom=i.top+this.$container.outerHeight(!1);var o={height:this.$container.outerHeight(!1)};o.top=i.top,o.bottom=i.top+o.height;var s=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=a<i.top-s,u=l>i.bottom+s,d={left:i.left,top:o.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h={top:0,left:0};(f.contains(document.body,p[0])||p[0].isConnected)&&(h=p.offset()),d.top-=h.top,d.left-=h.left,t||n||(r="below"),u||!c||t?!c&&u&&t&&(r="below"):r="above",("above"==r||t&&"below"!==r)&&(d.top=o.top-h.top-s),null!=r&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+r),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+r)),this.$dropdownContainer.css(d)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,r){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,r)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,r=0;r<t.length;r++){var i=t[r];i.children?n+=e(i.children):n++}return n}(t.data.results)<this.minimumResultsForSearch)&&e.call(this,t)},e}),e.define("select2/dropdown/selectOnClose",["../utils"],function(o){function e(){}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("close",function(e){r._handleSelectOnClose(e)})},e.prototype._handleSelectOnClose=function(e,t){if(t&&null!=t.originalSelect2Event){var n=t.originalSelect2Event;if("select"===n._type||"unselect"===n._type)return}var r=this.getHighlightedResults();if(!(r.length<1)){var i=o.GetData(r[0],"data");null!=i.element&&i.element.selected||null==i.element&&i.selected||this.trigger("select",{data:i})}},e}),e.define("select2/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("select",function(e){r._selectTriggered(e)}),t.on("unselect",function(e){r._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&(n.ctrlKey||n.metaKey)||this.trigger("close",{originalEvent:n,originalSelect2Event:t})},e}),e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return 1!=t&&(n+="s"),n},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"}}}),e.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(c,u,d,p,h,f,g,m,v,y,s,t,_,$,b,w,A,x,D,S,E,C,O,T,q,L,I,j,e){function n(){this.reset()}return n.prototype.apply=function(e){if(null==(e=c.extend(!0,{},this.defaults,e)).dataAdapter){if(null!=e.ajax?e.dataAdapter=b:null!=e.data?e.dataAdapter=$:e.dataAdapter=_,0<e.minimumInputLength&&(e.dataAdapter=y.Decorate(e.dataAdapter,x)),0<e.maximumInputLength&&(e.dataAdapter=y.Decorate(e.dataAdapter,D)),0<e.maximumSelectionLength&&(e.dataAdapter=y.Decorate(e.dataAdapter,S)),e.tags&&(e.dataAdapter=y.Decorate(e.dataAdapter,w)),null==e.tokenSeparators&&null==e.tokenizer||(e.dataAdapter=y.Decorate(e.dataAdapter,A)),null!=e.query){var t=u(e.amdBase+"compat/query");e.dataAdapter=y.Decorate(e.dataAdapter,t)}if(null!=e.initSelection){var n=u(e.amdBase+"compat/initSelection");e.dataAdapter=y.Decorate(e.dataAdapter,n)}}if(null==e.resultsAdapter&&(e.resultsAdapter=d,null!=e.ajax&&(e.resultsAdapter=y.Decorate(e.resultsAdapter,T)),null!=e.placeholder&&(e.resultsAdapter=y.Decorate(e.resultsAdapter,O)),e.selectOnClose&&(e.resultsAdapter=y.Decorate(e.resultsAdapter,I))),null==e.dropdownAdapter){if(e.multiple)e.dropdownAdapter=E;else{var r=y.Decorate(E,C);e.dropdownAdapter=r}if(0!==e.minimumResultsForSearch&&(e.dropdownAdapter=y.Decorate(e.dropdownAdapter,L)),e.closeOnSelect&&(e.dropdownAdapter=y.Decorate(e.dropdownAdapter,j)),null!=e.dropdownCssClass||null!=e.dropdownCss||null!=e.adaptDropdownCssClass){var i=u(e.amdBase+"compat/dropdownCss");e.dropdownAdapter=y.Decorate(e.dropdownAdapter,i)}e.dropdownAdapter=y.Decorate(e.dropdownAdapter,q)}if(null==e.selectionAdapter){if(e.multiple?e.selectionAdapter=h:e.selectionAdapter=p,null!=e.placeholder&&(e.selectionAdapter=y.Decorate(e.selectionAdapter,f)),e.allowClear&&(e.selectionAdapter=y.Decorate(e.selectionAdapter,g)),e.multiple&&(e.selectionAdapter=y.Decorate(e.selectionAdapter,m)),null!=e.containerCssClass||null!=e.containerCss||null!=e.adaptContainerCssClass){var o=u(e.amdBase+"compat/containerCss");e.selectionAdapter=y.Decorate(e.selectionAdapter,o)}e.selectionAdapter=y.Decorate(e.selectionAdapter,v)}e.language=this._resolveLanguage(e.language),e.language.push("en");for(var s=[],a=0;a<e.language.length;a++){var l=e.language[a];-1===s.indexOf(l)&&s.push(l)}return e.language=s,e.translations=this._processTranslations(e.language,e.debug),e},n.prototype.reset=function(){function a(e){return e.replace(/[^\u0000-\u007E]/g,function(e){return t[e]||e})}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:y.escapeMarkup,language:{},matcher:function e(t,n){if(""===c.trim(t.term))return n;if(n.children&&0<n.children.length){for(var r=c.extend(!0,{},n),i=n.children.length-1;0<=i;i--)null==e(t,n.children[i])&&r.children.splice(i,1);return 0<r.children.length?r:e(t,r)}var o=a(n.text).toUpperCase(),s=a(t.term).toUpperCase();return-1<o.indexOf(s)?n:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},n.prototype.applyFromElement=function(e,t){var n=e.language,r=this.defaults.language,i=t.prop("lang"),o=t.closest("[lang]").prop("lang"),s=Array.prototype.concat.call(this._resolveLanguage(i),this._resolveLanguage(n),this._resolveLanguage(r),this._resolveLanguage(o));return e.language=s,e},n.prototype._resolveLanguage=function(e){if(!e)return[];if(c.isEmptyObject(e))return[];if(c.isPlainObject(e))return[e];var t;t=c.isArray(e)?e:[e];for(var n=[],r=0;r<t.length;r++)if(n.push(t[r]),"string"==typeof t[r]&&0<t[r].indexOf("-")){var i=t[r].split("-")[0];n.push(i)}return n},n.prototype._processTranslations=function(e,t){for(var n=new s,r=0;r<e.length;r++){var i=new s,o=e[r];if("string"==typeof o)try{i=s.loadPath(o)}catch(e){try{o=this.defaults.amdLanguageBase+o,i=s.loadPath(o)}catch(e){t&&window.console&&console.warn&&console.warn('Select2: The language file for "'+o+'" could not be automatically loaded. A fallback will be used instead.')}}else i=c.isPlainObject(o)?new s(o):o;n.extend(i)}return n},n.prototype.set=function(e,t){var n={};n[c.camelCase(e)]=t;var r=y._convertData(n);c.extend(!0,this.defaults,r)},new n}),e.define("select2/options",["require","jquery","./defaults","./utils"],function(r,d,i,p){function e(e,t){if(this.options=e,null!=t&&this.fromElement(t),null!=t&&(this.options=i.applyFromElement(this.options,t)),this.options=i.apply(this.options),t&&t.is("input")){var n=r(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=p.Decorate(this.options.dataAdapter,n)}}return e.prototype.fromElement=function(e){var t=["select2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),p.GetData(e[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),p.StoreData(e[0],"data",p.GetData(e[0],"select2Tags")),p.StoreData(e[0],"tags",!0)),p.GetData(e[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",p.GetData(e[0],"ajaxUrl")),p.StoreData(e[0],"ajax-Url",p.GetData(e[0],"ajaxUrl")));var n={};function r(e,t){return t.toUpperCase()}for(var i=0;i<e[0].attributes.length;i++){var o=e[0].attributes[i].name,s="data-";if(o.substr(0,s.length)==s){var a=o.substring(s.length),l=p.GetData(e[0],a);n[a.replace(/-([a-z])/g,r)]=l}}d.fn.jquery&&"1."==d.fn.jquery.substr(0,2)&&e[0].dataset&&(n=d.extend(!0,{},e[0].dataset,n));var c=d.extend(!0,{},p.GetData(e[0]),n);for(var u in c=p._convertData(c))-1<d.inArray(u,t)||(d.isPlainObject(this.options[u])?d.extend(this.options[u],c[u]):this.options[u]=c[u]);return this},e.prototype.get=function(e){return this.options[e]},e.prototype.set=function(e,t){this.options[e]=t},e}),e.define("select2/core",["jquery","./options","./utils","./keys"],function(o,c,u,r){var d=function(e,t){null!=u.GetData(e[0],"select2")&&u.GetData(e[0],"select2").destroy(),this.$element=e,this.id=this._generateId(e),t=t||{},this.options=new c(t,e),d.__super__.constructor.call(this);var n=e.attr("tabindex")||0;u.StoreData(e[0],"old-tabindex",n),e.attr("tabindex","-1");var r=this.options.get("dataAdapter");this.dataAdapter=new r(e,this.options);var i=this.render();this._placeContainer(i);var o=this.options.get("selectionAdapter");this.selection=new o(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,i);var s=this.options.get("dropdownAdapter");this.dropdown=new s(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,i);var a=this.options.get("resultsAdapter");this.results=new a(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var l=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){l.trigger("selection:update",{data:e})}),e.addClass("select2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),u.StoreData(e[0],"select2",this),e.data("select2",this)};return u.Extend(d,u.Observable),d.prototype._generateId=function(e){return"select2-"+(null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+u.generateChars(2):u.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},d.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},d.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var r=this._resolveWidth(e,"style");return null!=r?r:this._resolveWidth(e,"element")}if("element"==t){var i=e.outerWidth(!1);return i<=0?"auto":i+"px"}if("style"!=t)return"computedstyle"!=t?t:window.getComputedStyle(e[0]).width;var o=e.attr("style");if("string"!=typeof o)return null;for(var s=o.split(";"),a=0,l=s.length;a<l;a+=1){var c=s[a].replace(/\s/g,"").match(n);if(null!==c&&1<=c.length)return c[1]}return null},d.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},d.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.select2",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this.$element.on("focus.select2",function(e){t.trigger("focus",e)}),this._syncA=u.bind(this._syncAttributes,this),this._syncS=u.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=e?(this._observer=new e(function(e){t._syncA(),t._syncS(null,e)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",t._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",t._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",t._syncS,!1))},d.prototype._registerDataEvents=function(){var n=this;this.dataAdapter.on("*",function(e,t){n.trigger(e,t)})},d.prototype._registerSelectionEvents=function(){var n=this,r=["toggle","focus"];this.selection.on("toggle",function(){n.toggleDropdown()}),this.selection.on("focus",function(e){n.focus(e)}),this.selection.on("*",function(e,t){-1===o.inArray(e,r)&&n.trigger(e,t)})},d.prototype._registerDropdownEvents=function(){var n=this;this.dropdown.on("*",function(e,t){n.trigger(e,t)})},d.prototype._registerResultsEvents=function(){var n=this;this.results.on("*",function(e,t){n.trigger(e,t)})},d.prototype._registerEvents=function(){var n=this;this.on("open",function(){n.$container.addClass("select2-container--open")}),this.on("close",function(){n.$container.removeClass("select2-container--open")}),this.on("enable",function(){n.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){n.$container.addClass("select2-container--disabled")}),this.on("blur",function(){n.$container.removeClass("select2-container--focus")}),this.on("query",function(t){n.isOpen()||n.trigger("open",{}),this.dataAdapter.query(t,function(e){n.trigger("results:all",{data:e,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(e){n.trigger("results:append",{data:e,query:t})})}),this.on("keypress",function(e){var t=e.which;n.isOpen()?t===r.ESC||t===r.TAB||t===r.UP&&e.altKey?(n.close(e),e.preventDefault()):t===r.ENTER?(n.trigger("results:select",{}),e.preventDefault()):t===r.SPACE&&e.ctrlKey?(n.trigger("results:toggle",{}),e.preventDefault()):t===r.UP?(n.trigger("results:previous",{}),e.preventDefault()):t===r.DOWN&&(n.trigger("results:next",{}),e.preventDefault()):(t===r.ENTER||t===r.SPACE||t===r.DOWN&&e.altKey)&&(n.open(),e.preventDefault())})},d.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.isDisabled()?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},d.prototype._isChangeMutation=function(e,t){var n=!1,r=this;if(!e||!e.target||"OPTION"===e.target.nodeName||"OPTGROUP"===e.target.nodeName){if(t)if(t.addedNodes&&0<t.addedNodes.length)for(var i=0;i<t.addedNodes.length;i++){t.addedNodes[i].selected&&(n=!0)}else t.removedNodes&&0<t.removedNodes.length?n=!0:o.isArray(t)&&o.each(t,function(e,t){if(r._isChangeMutation(e,t))return!(n=!0)});else n=!0;return n}},d.prototype._syncSubtree=function(e,t){var n=this._isChangeMutation(e,t),r=this;n&&this.dataAdapter.current(function(e){r.trigger("selection:update",{data:e})})},d.prototype.trigger=function(e,t){var n=d.__super__.trigger,r={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===t&&(t={}),e in r){var i=r[e],o={prevented:!1,name:e,args:t};if(n.call(this,i,o),o.prevented)return void(t.prevented=!0)}n.call(this,e,t)},d.prototype.toggleDropdown=function(){this.isDisabled()||(this.isOpen()?this.close():this.open())},d.prototype.open=function(){this.isOpen()||this.isDisabled()||this.trigger("query",{})},d.prototype.close=function(e){this.isOpen()&&this.trigger("close",{originalEvent:e})},d.prototype.isEnabled=function(){return!this.isDisabled()},d.prototype.isDisabled=function(){return this.options.get("disabled")},d.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},d.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},d.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},d.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},d.prototype.data=function(){this.options.get("debug")&&0<arguments.length&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var t=[];return this.dataAdapter.current(function(e){t=e}),t},d.prototype.val=function(e){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==e||0===e.length)return this.$element.val();var t=e[0];o.isArray(t)&&(t=o.map(t,function(e){return e.toString()})),this.$element.val(t).trigger("input").trigger("change")},d.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",u.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),u.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},d.prototype.render=function(){var e=o('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),u.StoreData(e[0],"element",this.$element),e},d}),e.define("jquery-mousewheel",["jquery"],function(e){return e}),e.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(i,e,o,t,s){if(null==i.fn.select2){var a=["open","close","destroy"];i.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var e=i.extend(!0,{},t);new o(i(this),e)}),this;if("string"!=typeof t)throw new Error("Invalid arguments for Select2: "+t);var n,r=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=s.GetData(this,"select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),n=e[t].apply(e,r)}),-1<i.inArray(t,a)?this:n}}return null==i.fn.select2.defaults&&(i.fn.select2.defaults=t),o}),{define:e.define,require:e.require}}(),t=e.require("jquery.select2");return u.fn.select2.amd=e,t});;
7
+ /**
8
+ * Validation for fields
9
+ * @constructor
10
+ */
11
+ function Wpcf7_admin_validations($){
12
+ this.rules = {
13
+ rules: {
14
+ }
15
+ };
16
+ this.init = function(){
17
+ this.addMethods();
18
+ $('#wpcf7-contact-form-editor form').validate({
19
+ rules: this.rules,
20
+ onfocusout: function(element) {
21
+ this.element(element);
22
+ }
23
+ });
24
+ };
25
+ this.addMethods = function(){
26
+ this.nospaces();
27
+ this.englishAndNumbersOnly();
28
+ };
29
+ /**
30
+ * Allow only enlish and numbers
31
+ * @return {[type]} [description]
32
+ */
33
+ this.englishAndNumbersOnly = function(){
34
+ $.validator.addMethod("validateenglishnumbers", function(value, element) {
35
+ return this.optional(element) || /^[a-z0-9_\-," "]+$/i.test(value);
36
+ }, "English and numbers only");
37
+ $.validator.addClassRules("validateenglishnumbers", {
38
+ validateenglishnumbers: true
39
+ });
40
+ };
41
+ /**
42
+ * Disallow spaces
43
+ */
44
+ this.nospaces = function(){
45
+ $.validator.addMethod("validatenospace", function(value, element) {
46
+ return value.indexOf(" ") < 0 && value != "";
47
+ }, "No spaces please");
48
+ $.validator.addClassRules("validatenospace", {
49
+ validatenospace: true
50
+ });
51
+ };
52
+ this.init();
53
+ }
54
+ var wpcf7_redirect_admin;
55
+
56
+ (function ($) {
57
+ function Wpcf7_redirect_admin() {
58
+
59
+ /**
60
+ * Initialize the class
61
+ * @return {[type]} [description]
62
+ */
63
+ this.init = function () {
64
+ this.setparams();
65
+ //set hooks for handling the redirect settings tab
66
+ this.admin_field_handlers();
67
+ //set hooks
68
+ this.register_action_hooks();
69
+ //hide select options
70
+ this.hide_select_options();
71
+ //init drag and drop features
72
+ this.init_draggable();
73
+ this.renumber_rows();
74
+ this.admin_validations = new Wpcf7_admin_validations($);
75
+ this.init_select2();
76
+
77
+ this.init_media_field();
78
+ this.init_colorpickers();
79
+ this.mark_default_select_fields();
80
+ };
81
+
82
+ /**
83
+ * Avoid alert while trying to leave page
84
+ */
85
+ this.mark_default_select_fields = function () {
86
+ $('.action-container select').each(function () {
87
+ if ($(this).val() === 0 || !$(this).val()) {
88
+ $(this).find('option:first-child').prop('selected', 'selected')
89
+ }
90
+ })
91
+ }
92
+
93
+ this.init_colorpickers = function () {
94
+ $('input.colorpicker').addClass('rendered').wpColorPicker();
95
+ }
96
+
97
+ this.setparams = function () {
98
+ /**
99
+ * Define jquery selectors
100
+ * @type {String}
101
+ */
102
+ this.banner_selector = '.wpcfr-banner-holder';
103
+ this.add_and_selector = '.add-condition';
104
+ this.row_template_selector = '.row-template';
105
+ this.remove_and_selector = '.qs-condition-actions .dashicons-minus';
106
+ this.add_group_button_selector = '.wpcfr-add-group';
107
+ this.rule_group_selector = '.wpcfr-rule-group';
108
+ this.edit_block_title_selector = '.conditional-group-titles .dashicons-edit';
109
+ this.cancel_block_title_selector = '.conditional-group-titles .dashicons-no';
110
+ this.save_block_title_edit_selector = '.conditional-group-titles .dashicons-yes';
111
+ this.tab_title_all_selector = '.block-title';
112
+ this.tab_title_selector = '.block-title:not(.edit)';
113
+ this.tab_title_active_selector = '.block-title.active';
114
+ this.active_tab_selector = '.conditional-group-block.active';
115
+ this.tab_inner_title = '.conditional-group-block-title';
116
+ this.new_block_counter = 1;
117
+ this.add_block_button_selector = '.wpcf7r-add-block';
118
+ this.blocks_container_selector = '.conditional-group-blocks';
119
+ this.remove_block_button_selector = '.remove-block';
120
+ this.group_row_value_select_selector = '.group_row_value_select';
121
+ this.group_select_field_selector = '.wpcf7r-fields';
122
+ this.open_tab_selector = '#redirect-panel h3[data-tab-target]';
123
+ this.show_action_selector = '.actions-list .edit a';
124
+ this.move_action_to_trash_selector = '.actions-list .row-actions .trash a';
125
+ this.move_lead_to_trash_selector = '.leads-list .trash a';
126
+ this.add_new_action_selector = '.wpcf7-add-new-action';
127
+ this.custom_checkbox_selector = '.wpcf7r-checkbox input';
128
+ this.action_title_field = '.wpcf7-redirect-post-title-fields';
129
+ this.migrate_from_cf7_api_selector = '.migrate-from-send-to-api';
130
+ this.migrate_from_cf7_redirect_selector = '.migrate-from-redirection';
131
+ this.json_textarea_selector = '.json-container';
132
+ this.butify_button_selector = '.wpcf7-redirect-butify';
133
+ this.add_repeater_field_selector = '.qs-repeater-action .dashicons-plus';
134
+ this.remove_repeater_field_selector = '.qs-repeater-action .dashicons-minus';
135
+ this.api_test_button_selector = '.wpcf7-redirect-test_button-fields';
136
+ this.toggler_handler_selector = '.actions-list [data-toggle] input';
137
+ this.mailchimp_get_lists = '.wpcf7-redirect-get_mailchimp_lists-fields';
138
+ this.mailchimp_create_list = '.wpcf7-redirect-create_list-fields';
139
+ this.mailchimp_list_selector = '.field-wrap-mailchimp_list_id select';
140
+ this.tab_actions_selector = '[href="#redirect-panel"]';
141
+ this.pro_banner_submit_btn_selector = '.btn-rp-submit';
142
+ this.pro_banner_user_email_selecttor = '[name="rp_user_email"]';
143
+ this.pro_banner_close_selector = '.rp-close';
144
+ this.new_group_counter = 0;
145
+ this.migrate_again_class = '.migrate_again';
146
+ this.new_row_counter = 0;
147
+ this.notice_dismiss_selector = '.wpcf7r-notice .notice-dismiss';
148
+ this.mail_tags_toggle = '.mail-tags-title';
149
+ this.validate_salesforce_app_details = '.wpcf7-redirect-validate_connection-fields';
150
+ this.debug_import_button_selector = '.reacreate-from-debug';
151
+ this.debug_send_button_selector = '.send-debug-info'
152
+ }
153
+
154
+ /**
155
+ * Initialize Select 2 fields
156
+ */
157
+ this.init_select2 = function (e) {
158
+ $('.select2-field select:not(.rendered)').each(function () {
159
+ var options = {
160
+ width: 'resolve'
161
+ };
162
+ $('.select2-field select:not(.rendered)').select2(options).addClass('rendered');
163
+ });
164
+ }
165
+
166
+ /**
167
+ * Init wp media uploader
168
+ */
169
+ this.init_media_field = function () {
170
+ var $imgContainer, imgIdInput = '';
171
+
172
+ if (typeof wp.media == 'undefined') {
173
+ console.log('no media support');
174
+ return;
175
+ }
176
+
177
+ file_frame = wp.media.frames.file_frame = wp.media({
178
+ frame: 'post',
179
+ state: 'insert',
180
+ multiple: false
181
+ });
182
+
183
+ file_frame.on('insert', function (e) {
184
+ // Get media attachment details from the frame state
185
+ var attachment = file_frame.state().get('selection').first().toJSON();
186
+ $imgContainer.find('.popup-image').remove();
187
+ // Send the attachment URL to our custom image input field.
188
+ $imgContainer.prepend('<img src="' + attachment.url + '" alt="" style="max-width:100px;" class="popup-image"/>');
189
+ // Send the attachment id to our hidden input
190
+ imgIdInput.val(attachment.url).change();
191
+ });
192
+
193
+ $(document.body).on('click', '.image-uploader-btn', function () {
194
+ imgIdInput = $(this).parent().find('input[type=hidden]');
195
+ $imgContainer = $(this).parent();
196
+ file_frame.open();
197
+ });
198
+ }
199
+
200
+ /**
201
+ * Beutify the user input (XML/JSON)
202
+ * @param {[type]} e [description]
203
+ * @return {[type]} [description]
204
+ */
205
+ this.beutify_json_and_css = function (e) {
206
+ e.preventDefault();
207
+ $clicked_button = $(e.currentTarget);
208
+ var $parent = $clicked_button.parents('.hidden-action');
209
+ var record_type = $parent.find('.field-wrap-record_type select').val();
210
+ this.remove_errors();
211
+ var $textarea = $('textarea', $parent);
212
+ var string = $textarea.val();
213
+ try {
214
+ if (record_type == 'json') {
215
+ var json_object = jQuery.parseJSON(string);
216
+ if (json_object) {
217
+ string = JSON.stringify(json_object, null, "\t");
218
+ if (string) {
219
+ $textarea.val(string);
220
+ }
221
+ }
222
+ } else if (record_type == 'xml') {
223
+ var xml_object = jQuery.parseXML(string);
224
+ if (xml_object) {
225
+ var xmlString = (new XMLSerializer()).serializeToString(xml_object);
226
+ $textarea.val(xmlString);
227
+ }
228
+ }
229
+ } catch (err) {
230
+ this.add_error($textarea, err);
231
+ }
232
+ }
233
+
234
+ /**
235
+ * Init sortable elements
236
+ */
237
+ this.init_draggable = function () {
238
+ var _this = this;
239
+
240
+ $('#the_list').sortable({
241
+ 'items': '.drag',
242
+ 'axis': 'y',
243
+ 'helper': fixHelper,
244
+ 'update': function (e, ui) {
245
+ params = {
246
+ 'order': $('#the_list').sortable('serialize')
247
+ };
248
+ _this.make_ajax_call('wpcf7r_set_action_menu_order', params, 'after_ajax_call');
249
+
250
+ var actionid = $(ui.item).data('actionid');
251
+
252
+ $(ui.item).after($('.action-container[data-actionid=' + actionid + ']'));
253
+ _this.renumber_rows();
254
+ }
255
+ });
256
+
257
+ var fixHelper = function (e, ui) {
258
+ ui.children().children().each(function () {
259
+ $(this).width($(this).width());
260
+ });
261
+ return ui;
262
+ };
263
+ }
264
+
265
+ /**
266
+ * Replace or add query parameter to url
267
+ */
268
+ this.replace_query_var = function (uri, key, value) {
269
+ var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
270
+ var separator = uri.indexOf('?') !== -1 ? "&" : "?";
271
+ if (uri.match(re)) {
272
+ return uri.replace(re, '$1' + key + "=" + value + '$2');
273
+ }
274
+ else {
275
+ return uri + separator + key + "=" + value;
276
+ }
277
+ }
278
+
279
+ /**
280
+ * A callback used to rearange numbering after sort
281
+ * @return {[type]} [description]
282
+ */
283
+ this.renumber_rows = function () {
284
+ numbering = 1;
285
+ $('#the_list tr .num').each(function () {
286
+ $(this).html(numbering);
287
+ numbering++;
288
+ });
289
+ }
290
+
291
+ /**
292
+ * Register all the event handlers
293
+ * @return {[type]} [description]
294
+ */
295
+ this.register_action_hooks = function () {
296
+ //connect event handler for close banner button click
297
+ $(document.body).on('click', this.banner_selector + ' .close-banner', this.close_banner.bind(this));
298
+ //add and rule
299
+ $(document.body).on('click', this.add_and_selector, this.add_and_row.bind(this));
300
+ //remove rule
301
+ $(document.body).on('click', this.remove_and_selector, this.remove_and_row.bind(this));
302
+ //add group
303
+ $(document.body).on('click', this.add_group_button_selector, this.add_new_group.bind(this));
304
+ //edit group block title
305
+ $(document.body).on('click', this.edit_block_title_selector, this.edit_block_title.bind(this));
306
+ //cancel group block title change
307
+ $(document.body).on('click', this.cancel_block_title_selector, this.cancel_block_title_edit.bind(this));
308
+ //save group block title change
309
+ $(document.body).on('click', this.save_block_title_edit_selector, this.save_block_title_edit.bind(this));
310
+ //change tab
311
+ $(document.body).on('click', this.tab_title_selector, this.switch_tab.bind(this));
312
+ //add a new rule block
313
+ $(document.body).on('click', this.add_block_button_selector, this.add_new_block.bind(this));
314
+ //remove block button
315
+ $(document.body).on('click', this.remove_block_button_selector, this.remove_block.bind(this));
316
+ //set select value
317
+ $(document.body).on('change', this.group_row_value_select_selector, this.set_select_value.bind(this));
318
+ //set select value
319
+ $(document.body).on('change', this.group_select_field_selector, this.show_field_options.bind(this));
320
+ //show/hide tabs
321
+ $(document.body).on('click', this.open_tab_selector, this.show_hide_tab.bind(this));
322
+ //show action
323
+ $(document.body).on('click', this.show_action_selector, this.show_hide_action.bind(this));
324
+ //move action to trash
325
+ $(document.body).on('click', this.move_action_to_trash_selector, this.move_post_to_trash.bind(this));
326
+ //move lead to trash
327
+ $(document.body).on('click', this.move_lead_to_trash_selector, this.move_post_to_trash.bind(this));
328
+ //after ajax call handler
329
+ $(document.body).on('wpcf7r_after_ajax_call', this.after_ajax_call.bind(this));
330
+ //add new action
331
+ $(document.body).on('click', this.add_new_action_selector, this.add_new_action.bind(this));
332
+ //checkbox change event
333
+ $(document.body).on('change', this.custom_checkbox_selector, this.checkbox_changed.bind(this));
334
+ //title change
335
+ $(document.body).on('keyup', this.action_title_field, this.action_title_field_changed.bind(this));
336
+ //migrate from wp7 api
337
+ $(document.body).on('click', this.migrate_from_cf7_api_selector, this.migrate_from_cf7_api.bind(this));
338
+ //migrate from wp7 redirect
339
+ $(document.body).on('click', this.migrate_from_cf7_redirect_selector, this.migrate_from_cf7_api.bind(this));
340
+ //butify json and xml
341
+ $(document.body).on('click', this.butify_button_selector, this.beutify_json_and_css.bind(this));
342
+ //add repeater field
343
+ $(document.body).on('click', this.add_repeater_field_selector, this.add_repeating_field.bind(this));
344
+ //remove repeater field
345
+ $(document.body).on('click', this.remove_repeater_field_selector, this.remove_repeating_field.bind(this));
346
+ //make API test
347
+ $(document.body).on('click', this.api_test_button_selector, this.make_api_test_call.bind(this));
348
+
349
+ //data toggler function
350
+ $(document.body).on('change', this.toggler_handler_selector, this.data_toggler.bind(this));
351
+ //get mailchimp lists
352
+ $(document.body).on('click', this.mailchimp_get_lists, this.mailchimp_get_lists_handler.bind(this));
353
+ //create mailchimp list
354
+ $(document.body).on('click', this.mailchimp_create_list, this.mailchimp_create_list_handler.bind(this));
355
+ //change the selected list calback
356
+ $(document.body).on('change', this.mailchimp_list_selector, this.mailchimp_list_select_handler.bind(this));
357
+ //migrate again from old plugin
358
+ $(document.body).on('click', this.migrate_again_class, this.migrate_all_forms.bind(this));
359
+ //show pro banner
360
+ $(document.body).on('click', this.tab_actions_selector, this.show_pro_banner.bind(this));
361
+ //submit pro banner ajax request
362
+ $(document.body).on('click', this.pro_banner_submit_btn_selector, this.ajax_get_coupon.bind(this));
363
+ //submit pro banner get a coupon request when clicking enter key
364
+ $(document.body).on('keyup', this.pro_banner_user_email_selector, this.pro_banner_user_email_keyup.bind(this));
365
+ //pro banner close
366
+ $(document.body).on('click', this.pro_banner_close_selector, this.pro_banner_close.bind(this));
367
+ //toggle mail tags
368
+ $(document.body).on('click', this.mail_tags_toggle, this.toggle_mail_tags.bind(this));
369
+ //create an enviorment based on debug
370
+ $(document.body).on('click', this.debug_import_button_selector, this.import_debug.bind(this));
371
+ //send debug info
372
+ $(document.body).on('click', this.debug_send_button_selector, this.send_debug_info.bind(this));
373
+ }
374
+
375
+ /**
376
+ * show or hide mail tags section
377
+ * @param {event} e
378
+ */
379
+ this.toggle_mail_tags = function (e) {
380
+ var $clicked_button = $(e.currentTarget);
381
+ $clicked_button.next().slideToggle('fast');
382
+ }
383
+
384
+ /**
385
+ * Send debug info via api
386
+ * @param {event} e
387
+ */
388
+ this.send_debug_info = function (e) {
389
+ e.preventDefault();
390
+
391
+ var params = {
392
+ form_id: $('#post_ID').val()
393
+ }
394
+
395
+ if ($('.approve-debug').is(':checked')) {
396
+ this.show_loader($('#debug-panel'));
397
+
398
+ this.make_ajax_call('send_debug_info', params, 'after_ajax_call');
399
+ } else {
400
+ $('.approve-debug').parent().addClass('error');
401
+ }
402
+ }
403
+ /**
404
+ * import and create forms and actions based on debug info
405
+ * @param {EVENT} e
406
+ */
407
+ this.import_debug = function (e) {
408
+ e.preventDefault();
409
+
410
+ var $clicked_button = $(e.currentTarget);
411
+
412
+ params = {
413
+ 'debug_info': $('#debug-info').val()
414
+ };
415
+
416
+ this.make_ajax_call('import_from_debug', params, 'after_ajax_call');
417
+
418
+ this.show_action_loader($clicked_button);
419
+
420
+ }
421
+ /**
422
+ * Gets the available mailchimp lists
423
+ * @param {[type]} e [description]
424
+ * @return {[type]} [description]
425
+ */
426
+ this.mailchimp_create_list_handler = function (e) {
427
+ var $clicked_button = $(e.currentTarget);
428
+ var $parent_action = $clicked_button.parents('.action-container').first();
429
+ var list_name = prompt("Please enter list name");
430
+ if (list_name != null) {
431
+ this.mailchimp_get_lists_handler(e, list_name);
432
+ }
433
+ }
434
+
435
+ /**
436
+ * Set the available mailchimp tags on the merge table
437
+ * @return {[type]} [description]
438
+ */
439
+ this.mailchimp_list_select_handler = function (e) {
440
+ var $changed_element = $(e.currentTarget);
441
+ var $parent_action = $changed_element.parents('.action-container').first();
442
+ var lists = $parent_action.find('.field-wrap-mailchimp_settings').data('lists');
443
+ var selected_list = $parent_action.find(this.mailchimp_list_selector).val();
444
+ lists = this.maybe_parse_json(lists);
445
+ list_fields = lists[selected_list].list_fields;
446
+ merge_tags_selects = $parent_action.find('.field-wrap-mailchimp_key select');
447
+ $.each(merge_tags_selects, function (key, select) {
448
+ $(select).html('');
449
+ var o = '<option value="">Select field</option>';
450
+ $(select).append(o);
451
+ $.each(list_fields, function (k, v) {
452
+ var o = '<option value="' + k + '">' + v + '</option>';
453
+ $(select).append(o);
454
+ });
455
+ });
456
+ }
457
+
458
+ /**
459
+ * Try to parse the string
460
+ * OR return already json
461
+ * @param {[type]} string [description]
462
+ * @return {[type]} [description]
463
+ */
464
+ this.maybe_parse_json = function (string) {
465
+ try {
466
+ a = JSON.parse(string);
467
+ } catch (e) {
468
+ a = string;
469
+ }
470
+ return a;
471
+ }
472
+
473
+ this.mailchimp_get_lists_handler = function (e, list_name) {
474
+ var $clicked_button = $(e.currentTarget);
475
+ var $parent_action = $clicked_button.parents('.action-container').first();
476
+ this.remove_errors();
477
+
478
+ if (!$('.wpcf7-redirect-mailchimp_api_key-fields').val()) {
479
+ this.add_error('.wpcf7-redirect-mailchimp_api_key-fields', 'Add your key and save the form');
480
+ return false;
481
+ }
482
+
483
+ this.show_action_loader($clicked_button);
484
+
485
+ params = {
486
+ 'action_id': this.get_block_action_id($clicked_button),
487
+ 'mailchimp_api_key': $parent_action.find('.wpcf7-redirect-mailchimp_api_key-fields').val(),
488
+ 'list_name': list_name
489
+ };
490
+
491
+ this.make_ajax_call('wpcf7r_get_mailchimp_lists', params, 'after_ajax_call');
492
+ }
493
+
494
+ /**
495
+ * Show ajax loader on the open action tab
496
+ * @param {[type]} $inner_element [description]
497
+ * @return {[type]} [description]
498
+ */
499
+ this.show_action_loader = function ($inner_element) {
500
+ var $action_wrap = $inner_element.parents('.field-wrap-test_section').first();
501
+ this.show_loader($inner_element.parents('.hidden-action').first());
502
+ }
503
+
504
+ this.data_toggler = function (e) {
505
+ //prevent checkbox input from firing duplicated event but keep its original functionality
506
+ var $clicked_button = $(e.currentTarget);
507
+ var $parent_action = $clicked_button.parents('.action-container').first();
508
+ var toggle_element = $clicked_button.parents('[data-toggle]').data('toggle');
509
+ if (toggle_element) {
510
+ $parent_action.find(toggle_element).slideToggle('fast');
511
+ }
512
+ }
513
+
514
+ this.make_api_test_call = function (e) {
515
+ e.preventDefault();
516
+ var $clicked_button = $(e.currentTarget);
517
+ var $action_wrap = $clicked_button.parents('.field-wrap-test_section').first();
518
+ this.show_loader($clicked_button.parents('.hidden-action').first());
519
+
520
+ params = {
521
+ 'action_id': $clicked_button.data('action_id'),
522
+ 'cf7_id': $clicked_button.data('cf7_id'),
523
+ 'rule_id': $clicked_button.data('ruleid'),
524
+ 'data': $action_wrap.find('input').serialize()
525
+ };
526
+
527
+ this.make_ajax_call('wpcf7r_make_api_test', params, 'after_ajax_call');
528
+ }
529
+
530
+ this.remove_repeating_field = function (e) {
531
+ e.preventDefault();
532
+ var $clicked_button = $(e.currentTarget);
533
+ $clicked_button.parents('.qs-repeater-row').remove();
534
+ }
535
+
536
+ this.add_repeating_field = function (e) {
537
+ e.preventDefault();
538
+ var $clicked_button = $(e.currentTarget);
539
+ var $parent_element = $clicked_button.parents('[data-repeater-template]');
540
+ var next_row_count = $parent_element.find('[data-repeater-row-count]').length - 1;
541
+ next_row_count++;
542
+ var template = $parent_element.data('repeater-template');
543
+ template_html = this.replaceAll(template.template, 'new_row', next_row_count);
544
+ $parent_element.append(template_html);
545
+ $(document.body).trigger('added-repeating-row', [$parent_element]);
546
+ }
547
+
548
+ this.migrate_from_cf7_api = function (e) {
549
+ e.preventDefault();
550
+ $clicked_button = $(e.currentTarget);
551
+ this.show_loader($clicked_button.parents('.actions-list'));
552
+ params = {
553
+ 'post_id': $clicked_button.data('id'),
554
+ 'rule_id': $clicked_button.data('ruleid'),
555
+ 'action_type': $clicked_button.data('migration-type'),
556
+ };
557
+
558
+ this.make_ajax_call('wpcf7r_add_action', params, 'after_ajax_call');
559
+
560
+ $clicked_button.fadeOut(function () {
561
+ $(this).remove();
562
+ });
563
+ }
564
+
565
+ this.action_title_field_changed = function (e) {
566
+ e.preventDefault();
567
+ $changed_title = $(e.currentTarget);
568
+ action_id = this.get_block_action_id($changed_title);
569
+ $('.primary[data-actionid="' + action_id + '"] .column-post-title').html($changed_title.val());
570
+ }
571
+
572
+ /**
573
+ * Catch checkbox change event
574
+ * @param {[type]} e [description]
575
+ * @return {[type]} [description]
576
+ */
577
+ this.checkbox_changed = function (e) {
578
+ e.preventDefault();
579
+ $clicked_button = $(e.currentTarget);
580
+ checkbox_on = $clicked_button.is(':checked');
581
+ $parent_element = $clicked_button.parents('.hidden-action');
582
+ $field_wrap = $clicked_button.parents('.field-wrap').first();
583
+ if ($clicked_button.data('toggle-label')) {
584
+ toggle_data = $clicked_button.data('toggle-label');
585
+ jQuery.each(toggle_data, function (css_class, toggle) {
586
+ if (checkbox_on) {
587
+ string = toggle[0];
588
+ } else {
589
+ string = toggle[1];
590
+ }
591
+ $parent_element.find(css_class).html(string);
592
+ });
593
+ }
594
+ }
595
+
596
+ /**
597
+ * Add a new action handler
598
+ * @param {[type]} e [description]
599
+ * @return {[type]} [description]
600
+ */
601
+ this.add_new_action = function (e) {
602
+ e.preventDefault();
603
+ $clicked_button = $(e.currentTarget);
604
+ var $action_selector = $clicked_button.siblings('.new-action-selector');
605
+ var action_type = $action_selector.val();
606
+ this.remove_errors();
607
+ if (!action_type) {
608
+ this.add_error('.new-action-selector', 'Please choose an action');
609
+ return false;
610
+ }
611
+ if ('purchase' === $action_selector.find(':selected').data('action')) {
612
+ window.open(action_type);
613
+ } else {
614
+ this.show_loader($clicked_button.parents('.actions-list'));
615
+ params = {
616
+ 'post_id': $clicked_button.data('id'),
617
+ 'rule_id': $clicked_button.data('ruleid'),
618
+ 'action_type': action_type,
619
+ };
620
+ $('.hidden-action').slideUp('fast');
621
+ this.make_ajax_call('wpcf7r_add_action', params, 'after_ajax_call');
622
+ }
623
+ }
624
+
625
+ this.remove_errors = function () {
626
+ $('.error-message').removeClass('error-message');
627
+ $('.error-label').remove();
628
+ }
629
+
630
+ this.add_error = function (selector, message) {
631
+ $(selector).addClass('error-message').after('<span class="error-label">' + message + '</span>');
632
+ }
633
+
634
+ this.show_loader = function (selector) {
635
+ $(selector).append('<div class="wpcf7r_loader"></div>');
636
+ $('.wpcf7r_loader').addClass('active');
637
+ }
638
+
639
+ this.hide_loader = function () {
640
+ $('.wpcf7r_loader').fadeOut(function () {
641
+ $(this).remove();
642
+ });
643
+ }
644
+
645
+ /**
646
+ * A callback after ajax actions
647
+ * @param {[type]} e [description]
648
+ * @param {[type]} params [description]
649
+ * @param {[type]} response [description]
650
+ * @param {[type]} action [description]
651
+ * @return {[type]} [description]
652
+ */
653
+ this.after_ajax_call = function (e, params, response, action) {
654
+ var _this = this;
655
+ var $action_wrap;
656
+
657
+ /**
658
+ * Handle action delete request
659
+ * @param {[type]} [action== 'wpcf7r_delete_action'] [description]
660
+ * @return {[type]} [description]
661
+ */
662
+ if ('wpcf7r_delete_action' === action) {
663
+ $(params).each(function (k, v) {
664
+ $('[data-actionid="' + v.post_id + '"]').fadeOut(function () {
665
+ $(this).remove();
666
+ _this.renumber_rows();
667
+ });
668
+ $('[data-postid="' + v.post_id + '"]').fadeOut(function () {
669
+ $(this).remove();
670
+ });
671
+ });
672
+ }
673
+
674
+ /**
675
+ * Handle action add request
676
+ * @param {[type]} [action== 'wpcf7r_add_action'] [description]
677
+ * @return {[type]} [description]
678
+ */
679
+ if ('wpcf7r_add_action' === action) {
680
+ $('[data-wrapid=' + params.rule_id + '] #the_list').append(response.action_row);
681
+ _this.init_select2();
682
+ _this.renumber_rows();
683
+ _this.init_colorpickers();
684
+ }
685
+
686
+ /**
687
+ * Make an API test
688
+ * @param {[type]} [action== 'wpcf7r_make_api_test'] [description]
689
+ * @return {[type]} [description]
690
+ */
691
+ if ('wpcf7r_make_api_test' === action) {
692
+ $action_wrap = $('[data-actionid=' + params.action_id + '] .field-wrap-test_section');
693
+ $('span.err').remove();
694
+ if (typeof response.status != 'undefined' && response.status === 'failed') {
695
+ $.each(response.invalid_fields, function (field_key, error) {
696
+ $action_wrap.find('.' + field_key).append('<span class="err">' + error.reason + '</span>');
697
+ });
698
+ } else {
699
+ $('body').append(response.html);
700
+ }
701
+ }
702
+
703
+ /**
704
+ * After getting mailchimp lists
705
+ * @param {[type]} [action== 'wpcf7r_get_mailchimp_lists'] [description]
706
+ * @return {[type]} [description]
707
+ */
708
+ if ('wpcf7r_get_mailchimp_lists' === action) {
709
+ $action_wrap = $('[data-actionid=' + params.action_id + ']');
710
+ $lists_select = $action_wrap.find('.field-wrap-mailchimp_list_id select');
711
+ $api_key_input = $action_wrap.find('.field-wrap-mailchimp_api_key');
712
+ $lists_select.html('');
713
+ if (typeof response.error != 'undefined' && response.error) {
714
+ this.add_error($api_key_input, response.error);
715
+ } else {
716
+ $action_wrap.find('.field-wrap-mailchimp_settings')
717
+ .attr('data-lists', JSON.stringify(response.lists))
718
+ .data('lists', JSON.stringify(response.lists));
719
+
720
+ $.each(response.lists, function (k, v) {
721
+ var o = '<option value="' + v.list_id + '">' + v.list_name + '</option>';
722
+ $lists_select.append(o);
723
+ });
724
+
725
+ $lists_select.change();
726
+ }
727
+ }
728
+ this.hide_loader();
729
+ }
730
+
731
+ this.move_post_to_trash = function (e) {
732
+ e.preventDefault();
733
+ $clicked_button = $(e.currentTarget);
734
+ this.show_loader($clicked_button.parents('td'));
735
+ params = [{
736
+ 'post_id': $clicked_button.data('id')
737
+ }];
738
+ this.make_ajax_call('wpcf7r_delete_action', params, 'ater_ajax_delete');
739
+ }
740
+
741
+ this.show_hide_action = function (e) {
742
+ e.preventDefault();
743
+ $clicked_button = $(e.currentTarget);
744
+ $hidden_action_to_show = $clicked_button.parents('tr').next().find('.hidden-action');
745
+ $('.hidden-action').not($hidden_action_to_show).slideUp('fast');
746
+ $hidden_action_to_show.slideToggle('fast');
747
+ }
748
+
749
+ this.show_hide_tab = function (e) {
750
+ $clicked_tab = $(e.currentTarget);
751
+ var target = $clicked_tab.data('tab-target');
752
+ $clicked_tab.toggleClass('active');
753
+ $('[data-tab=' + target + ']').slideToggle('fast');
754
+ }
755
+
756
+ this.hide_select_options = function (e) {
757
+ $('.row-template .wpcf7r-fields').each(function () {
758
+ $(this).trigger('change');
759
+ });
760
+ }
761
+
762
+ this.show_field_options = function (e) {
763
+ $changed_select = $(e.currentTarget);
764
+ $row = $changed_select.parents('.row-template');
765
+
766
+ if ($changed_select.val()) {
767
+ $elem_to_show = $row.find('.group_row_value[data-rel=' + $changed_select.val() + ']');
768
+ } else {
769
+ $elem_to_show = "";
770
+ }
771
+
772
+ $row.find('.group_row_value').hide();
773
+
774
+ if ($elem_to_show.length) {
775
+ $elem_to_show.show();
776
+ $row.find('.compare-options option').hide();
777
+ $row.find('.compare-options option[data-comparetype=select]').show();
778
+ } else {
779
+ $row.find('.compare-options option').show();
780
+ $row.find('.wpcf7-redirect-value').show();
781
+ }
782
+ }
783
+
784
+ this.set_select_value = function (e) {
785
+ $changed_select = $(e.currentTarget);
786
+ $changed_select.siblings('.wpcf7-redirect-value').val($changed_select.val());
787
+ }
788
+
789
+ /**
790
+ * Removes a block of rules from the DOM
791
+ * @param {[type]} e [description]
792
+ * @return {[type]} [description]
793
+ */
794
+ this.remove_block = function (e) {
795
+ e.preventDefault();
796
+ $clicked_button = $(e.currentTarget);
797
+ $clicked_button_parent = $clicked_button.parents('.block-title').first();
798
+ var tab_to_remove = $clicked_button_parent.data('rel');
799
+ $clicked_button_parent.prev().click();
800
+ $('.conditional-group-block[data-block-id=' + tab_to_remove + ']').remove();
801
+ $('.block-title[data-rel=' + tab_to_remove + ']').remove();
802
+ }
803
+
804
+ /**
805
+ * Adds a new block to the DOM
806
+ * @param {[type]} e [description]
807
+ * @return {[type]} [description]
808
+ */
809
+ this.add_new_block = function (e) {
810
+ this.new_block_counter++;
811
+ $clicked_button = $(e.currentTarget);
812
+ action_id = this.get_block_action_id($clicked_button);
813
+ html_block_template = wpcfr_template.block_html;
814
+ block_title_html = wpcfr_template.block_title_html;
815
+ html_block_template = this.replaceAll(html_block_template, 'new_block', 'block_' + this.new_block_counter);
816
+ html_block_template = this.replaceAll(html_block_template, 'action_id', action_id);
817
+ block_title_html = this.replaceAll(block_title_html, 'new_block', 'block_' + this.new_block_counter);
818
+ block_title_html = this.replaceAll(block_title_html, 'action_id', action_id);
819
+ $(this.tab_title_all_selector).last().after(block_title_html);
820
+ $(this.blocks_container_selector).append(html_block_template);
821
+ $(this.tab_title_all_selector).last().click();
822
+ }
823
+
824
+ /**
825
+ * Switch between tabs
826
+ * @param {[type]} e [description]
827
+ * @return {[type]} [description]
828
+ */
829
+ this.switch_tab = function (e) {
830
+ e.preventDefault();
831
+ $clicked_button = $(e.currentTarget);
832
+ var tab_to_show = $clicked_button.data('rel');
833
+ var $tab_to_show = $('[data-block-id=' + tab_to_show + ']');
834
+ $(this.active_tab_selector).removeClass('active');
835
+ $(this.tab_title_active_selector).removeClass('active');
836
+ $clicked_button.addClass('active');
837
+ $tab_to_show.addClass('active');
838
+ }
839
+
840
+ /**
841
+ * Update block title upon save
842
+ * @param {[type]} e [description]
843
+ * @return {[type]} [description]
844
+ */
845
+ this.save_block_title_edit = function (e) {
846
+ e.preventDefault();
847
+ $clicked_button = $(e.currentTarget);
848
+ var tab_to_show = $clicked_button.data('rel');
849
+ var $tab_to_show = $('[data-block-id=' + tab_to_show + ']');
850
+ $clicked_button.siblings('input').attr('readonly', 'readonly');
851
+ $clicked_button.parent().removeClass('edit');
852
+ $tab_to_show.find(this.tab_inner_title).html($clicked_button.siblings('input').val());
853
+ }
854
+
855
+ /**
856
+ * Close the text field for editing
857
+ * @param {[type]} e [description]
858
+ * @return {[type]} [description]
859
+ */
860
+ this.cancel_block_title_edit = function (e) {
861
+ e.preventDefault();
862
+ $clicked_button = $(e.currentTarget);
863
+ var tab_to_show = $clicked_button.data('rel');
864
+ var $tab_to_show = $('[data-block-id=' + tab_to_show + ']');
865
+ $clicked_button.siblings('input').val($clicked_button.siblings('input').data('original')).attr('readonly', 'readonly');
866
+ $clicked_button.parent().removeClass('edit');
867
+ $tab_to_show.find(this.tab_inner_title).html($clicked_button.siblings('input').val());
868
+ }
869
+
870
+ /**
871
+ * Open block title for editing
872
+ * @param {[type]} e [description]
873
+ * @return {[type]} [description]
874
+ */
875
+ this.edit_block_title = function (e) {
876
+ e.preventDefault();
877
+ $clicked_button = $(e.currentTarget);
878
+ $clicked_button.parent().addClass('edit');
879
+ $clicked_button.siblings('input').removeAttr('readonly');
880
+ }
881
+
882
+ /**
883
+ * Add a new group of fields (OR)
884
+ * @param {[type]} e [description]
885
+ * @return {[type]} [description]
886
+ */
887
+ this.add_new_group = function (e) {
888
+ e.preventDefault();
889
+
890
+ $clicked_button = $(e.currentTarget);
891
+ var block_id = 'block_1';
892
+ var action_id = this.get_block_action_id($clicked_button);
893
+ var $rule_group = $clicked_button.parents('.conditional-group-blocks').find('.wpcfr-rule-groups');
894
+ this.new_group_counter = $rule_group.find('.wpcfr-rule-group').length;
895
+ this.new_group_counter++;
896
+ group_html = wpcfr_template.group_html;
897
+ group_html = this.replaceAll(group_html, 'group-new_group', 'group-' + this.new_group_counter);
898
+ group_html = this.replaceAll(group_html, 'new_group', 'group-' + this.new_group_counter);
899
+ group_html = this.replaceAll(group_html, 'new_block', block_id);
900
+ group_html = this.replaceAll(group_html, 'action_id', action_id);
901
+
902
+ $rule_group.append(group_html);
903
+ }
904
+
905
+ /**
906
+ * Remove an and row from the dom
907
+ * @param {[type]} e [description]
908
+ * @return {[type]} [description]
909
+ */
910
+ this.remove_and_row = function (e) {
911
+ e.preventDefault();
912
+ $clicked_button = $(e.currentTarget);
913
+ if ($clicked_button.parents(this.rule_group_selector).find('.row-template').length == 1) {
914
+ $clicked_button.parents(this.rule_group_selector).remove();
915
+ } else {
916
+ $clicked_button.parents(this.row_template_selector).remove();
917
+ }
918
+ }
919
+
920
+ this.get_block_action_id = function ($inner_item) {
921
+ return $inner_item.parents('[data-actionid]').data('actionid');
922
+ }
923
+
924
+ /**
925
+ * Add an and row to the dom
926
+ * @param {[type]} e [description]
927
+ * @return {[type]} [description]
928
+ */
929
+ this.add_and_row = function (e) {
930
+ e.preventDefault();
931
+ this.new_row_counter++;
932
+
933
+ $clicked_button = $(e.currentTarget);
934
+ action_id = this.get_block_action_id($clicked_button);
935
+ block_id = 'block_1';
936
+ group_id = $clicked_button.parents('[data-group-id]').first().data('group-id');
937
+
938
+ $(wpcfr_template.row_html).find(this.add_and_selector).remove();
939
+
940
+ row_html = wpcfr_template.row_html;
941
+ row_html = this.replaceAll(row_html, 'new_block', block_id);
942
+ row_html = this.replaceAll(row_html, 'new_group', group_id);
943
+ row_html = this.replaceAll(row_html, 'new_row', 'row-' + this.new_row_counter);
944
+ row_html = this.replaceAll(row_html, 'action_id', action_id);
945
+
946
+ $clicked_button.parents('table').first().find('tbody').append(row_html);
947
+ }
948
+
949
+ /**
950
+ * Close displayed banner
951
+ * @return {[type]} [description]
952
+ */
953
+ this.close_banner = function () {
954
+ $(this.banner_selector).slideUp('fast');
955
+ this.make_ajax_call('dismiss-cf7r-notices', ['dismiss-cf7r-notices'], '');
956
+ }
957
+
958
+ /**
959
+ * Dismiss admin notices
960
+ */
961
+ this.dismiss_notices = function () {
962
+ this.make_ajax_call('close_ad_banner', [], '');
963
+ }
964
+
965
+ /**
966
+ * Replace all instances of a string
967
+ * @param {[type]} str [description]
968
+ * @param {[type]} find [description]
969
+ * @param {[type]} replace [description]
970
+ * @return {[type]} [description]
971
+ */
972
+ this.replaceAll = function (str, find, replace) {
973
+ return str.replace(new RegExp(find, 'g'), replace);
974
+ }
975
+ this.admin_fields_init = function () {
976
+ $('.field-wrap input[type=checkbox],.field-wrap select').each(function () {
977
+ if ($(this).is(":checked")) {
978
+ $(this).siblings('.field-notice-hidden').removeClass('field-notice-hidden').addClass('field-notice-show');
979
+ }
980
+ });
981
+ $('.wpcf7-redirect-after-sent-script').each(function () {
982
+ if ($(this).val()) {
983
+ $(this).siblings('.field-warning-alert').removeClass('field-notice-hidden');
984
+ }
985
+ });
986
+ }
987
+
988
+ /**
989
+ * Show/hide fields according to user selections
990
+ * @return {[type]} [description]
991
+ */
992
+ this.admin_field_handlers = function () {
993
+ this.admin_fields_init();
994
+ // field - open in a new tab
995
+ $(document.body).on('change', '.field-wrap input[type=checkbox],.field-wrap select', function () {
996
+ if ($(this).is(":checked")) {
997
+ $(this).siblings('.field-notice-hidden').removeClass('field-notice-hidden').addClass('field-notice-show');
998
+ } else {
999
+ $(this).siblings('.field-notice-show').addClass('field-notice-hidden').removeClass('field-notice-show');
1000
+ }
1001
+ });
1002
+ // field - after sent script
1003
+ $(document.body).on('keyup', '.wpcf7-redirect-after-sent-script', function (event) {
1004
+ if ($(this).val().length != 0) {
1005
+ $(this).siblings('.field-warning-alert').removeClass('field-notice-hidden');
1006
+ } else {
1007
+ $(this).siblings('.field-warning-alert').addClass('field-notice-hidden');
1008
+ }
1009
+ });
1010
+ $(document.body).on('change', '.checkbox-radio-1', function () {
1011
+ var checked = $(this).is(':checked');
1012
+ $('.checkbox-radio-1').prop('checked', false);
1013
+ if (checked) {
1014
+ $(this).prop('checked', true);
1015
+ }
1016
+ });
1017
+ }
1018
+
1019
+ this.migrate_all_forms = function (e) {
1020
+ e.preventDefault();
1021
+ var action = 'wpcf7r_migrate_all_forms';
1022
+ var params = [];
1023
+ // TODO: Translation
1024
+ if (confirm('Are you sure? this process will delete all current actions and create new actions according to the old plugin settings. There is no way back from this process!')) {
1025
+ this.make_ajax_call(action, params);
1026
+ }
1027
+ }
1028
+
1029
+ /**
1030
+ * Basic function to make admin ajax calls
1031
+ * @param {[type]} params [description]
1032
+ * @return {[type]} [description]
1033
+ */
1034
+ this.make_ajax_call = function (action, params) {
1035
+ jQuery.ajax({
1036
+ type: "post",
1037
+ dataType: "json",
1038
+ url: ajaxurl,
1039
+ data: {
1040
+ action: action,
1041
+ data: params
1042
+ },
1043
+ success: function (response) {
1044
+ $(document.body).trigger('wpcf7r_after_ajax_call', [params, response, action]);
1045
+ }
1046
+ });
1047
+ }
1048
+
1049
+ /**
1050
+ * Show PRO Banner
1051
+ */
1052
+ this.show_pro_banner = function (e) {
1053
+ window.setTimeout(function () {
1054
+ $('.rp-overlay').addClass('active');
1055
+ }, 500);
1056
+ }
1057
+
1058
+ /**
1059
+ * Send pro banner ajax request when clicking 'enter' key
1060
+ */
1061
+ this.pro_banner_user_email_keyup = function (e) {
1062
+ e.stopPropagation();
1063
+ if (e.key === 'Enter' || e.keyCode === 13) {
1064
+ e.preventDefault();
1065
+ this.ajax_get_coupon();
1066
+ }
1067
+ }
1068
+
1069
+ /**
1070
+ * PRO Banner ajax request - get a coupon request
1071
+ */
1072
+ this.ajax_get_coupon = function (e) {
1073
+ $('.rp-form-message').html('<span class="rp-loader-wrap"><span class="rp-loader"></span></span>');
1074
+ var get_offers = $('[name="rp_get_offers"]').prop("checked") == true ? '1' : '0';
1075
+ $.ajax({
1076
+ type: 'POST',
1077
+ dataType: 'json',
1078
+ url: ajaxurl,
1079
+ data: {
1080
+ action: 'get_coupon',
1081
+ data: {
1082
+ email: $('[name="rp_user_email"]').val(),
1083
+ get_offers: get_offers
1084
+ }
1085
+ },
1086
+ success: function (results) {
1087
+ if (!results.url) {
1088
+ $('.rp-form-message').html('<span class="rp-form-message-text ' + results.status + '">' + results.message + '</span>');
1089
+ } else {
1090
+ location.href = results.url;
1091
+ }
1092
+ }
1093
+ });
1094
+ }
1095
+ /**
1096
+ * Close pro banner
1097
+ */
1098
+ this.pro_banner_close = function (e) {
1099
+ e.preventDefault();
1100
+ sign = window.location.href.indexOf("?") > -1 ? '&' : '?';
1101
+ location.href = window.location.href + sign + 'wpcf7_redirect_dismiss_banner=1';
1102
+ }
1103
+ this.init();
1104
+ }
1105
+
1106
+ $(document).ready(function ($) {
1107
+ //init the class functionality
1108
+ wpcf7_redirect_admin = new Wpcf7_redirect_admin();
1109
+
1110
+ $(document.body).trigger('wpcf7r-loaded', wpcf7_redirect_admin);
1111
+ });
1112
+ })(jQuery);
1113
+ jQuery(document).ready(function () {
1114
+ set_event_listeneres();
1115
+ disply_updates_marks();
1116
+ });
1117
+
1118
+ function disply_updates_marks() {
1119
+ var update_count = jQuery('.extensions-list .has-update').length;
1120
+ if (update_count) {
1121
+ jQuery('li#extensions-panel-tab a').append(' <span class="update-plugins wpcf7r-update-extensions"><span class="plugin-count">' + update_count + '</span></span>');
1122
+ }
1123
+ }
1124
+
1125
+ function set_event_listeneres() {
1126
+ activate_serial_handler();
1127
+ close_promo_box();
1128
+ serial_activation_handler();
1129
+ extension_deactivate_handler();
1130
+ extension_update_handler();
1131
+ }
1132
+
1133
+ function extension_update_handler() {
1134
+ jQuery('.extensions').on('click', '.promo-box .btn-update', function (e) {
1135
+ e.preventDefault();
1136
+ $extension = jQuery(this).parents('.promo-box');
1137
+ show_extension_loader($extension);
1138
+ update_wpcf7r_extension($extension);
1139
+ });
1140
+ }
1141
+
1142
+ function activate_serial_handler() {
1143
+ jQuery('.extensions').on('click', '.promo-box .btn-activate', function (e) {
1144
+ e.preventDefault();
1145
+ jQuery(this).parents('.promo-box').find('.serial').addClass('open');
1146
+ });
1147
+ }
1148
+
1149
+ function close_promo_box() {
1150
+ jQuery('.extensions').on('click', '.promo-box .btn-close', function (e) {
1151
+ e.preventDefault();
1152
+ jQuery(this).parents('.promo-box').find('.serial').removeClass('open');
1153
+ });
1154
+ }
1155
+
1156
+ function serial_activation_handler() {
1157
+ jQuery('.extensions').on('click', '.promo-box .btn-activate-serial', function (e) {
1158
+ e.preventDefault();
1159
+ $extension = jQuery(this).parents('.promo-box');
1160
+ var serial = $extension.find('.serial-number').val();
1161
+ if (!serial) {
1162
+ $extension.find('.serial-number').addClass('err');
1163
+ return false;
1164
+ }
1165
+ $extension.find('.serial-number').removeClass('err');
1166
+ show_extension_loader($extension);
1167
+ activate_extension($extension, serial);
1168
+ });
1169
+ }
1170
+
1171
+ function extension_deactivate_handler() {
1172
+ jQuery('.extensions').on('click', '.promo-box .btn-deactivate', function (e) {
1173
+ e.preventDefault();
1174
+ $extension = jQuery(this).parents('.promo-box');
1175
+ show_extension_loader($extension);
1176
+ deactivate_plugin_license($extension);
1177
+ });
1178
+ }
1179
+
1180
+ function show_extension_loader($extension) {
1181
+ $extension.append('<div class="wpcf7r_loader active"></div>');
1182
+ }
1183
+
1184
+ function deactivate_plugin_license($extension) {
1185
+ var extension_name = $extension.data('extension');
1186
+
1187
+ jQuery.ajax({
1188
+ type: "post",
1189
+ dataType: "json",
1190
+ url: ajaxurl,
1191
+ data: {
1192
+ action: "deactivate_wpcf7r_extension",
1193
+ extension_name: extension_name
1194
+ },
1195
+ success: function (response) {
1196
+ console.log(response);
1197
+ if (typeof response.error != 'undefined') {
1198
+ jQuery('.actions').after('<div class="err">' + response.error + '</div>');
1199
+ } else if (typeof response.extension_html != 'undefined') {
1200
+ $extension.replaceWith(response.extension_html);
1201
+ }
1202
+ remove_extension_loader();
1203
+ }
1204
+ });
1205
+ }
1206
+
1207
+ function remove_extension_loader() {
1208
+ jQuery('.wpcf7r_loader').remove();
1209
+ }
1210
+
1211
+ function update_wpcf7r_extension($extension) {
1212
+ var extension_name = $extension.data('extension');
1213
+
1214
+ jQuery.ajax({
1215
+ type: "post",
1216
+ dataType: "json",
1217
+ url: ajaxurl,
1218
+ data: {
1219
+ action: "wpcf7r_extension_update",
1220
+ extension_name: extension_name
1221
+ },
1222
+ success: function (response) {
1223
+ if (response.extension_html != 'undefined' && response.extension_html) {
1224
+ $extension.replaceWith(response.extension_html);
1225
+ } else if (typeof response.error != 'undefined' && response.error) {
1226
+ jQuery('.actions').after('<div class="err">' + response.error + '</div>');
1227
+ }
1228
+ remove_extension_loader();
1229
+ }
1230
+ });
1231
+ }
1232
+
1233
+ function activate_extension($extension, serial) {
1234
+ var extension_name = $extension.data('extension');
1235
+
1236
+ jQuery.ajax({
1237
+ type: "post",
1238
+ dataType: "json",
1239
+ url: ajaxurl,
1240
+ data: {
1241
+ action: "activate_wpcf7r_extension",
1242
+ extension_name: extension_name,
1243
+ serial: serial
1244
+ },
1245
+ success: function (response) {
1246
+ if (response.extension_html != 'undefined' && response.extension_html) {
1247
+ $extension.replaceWith(response.extension_html);
1248
+ window.location.reload();
1249
+ } else if (typeof response.error != 'undefined' && response.error) {
1250
+ $extension.find('.err').remove();
1251
+ $extension.append('<div class="err">' + response.error + '</div>');
1252
+ }
1253
+
1254
+ remove_extension_loader();
1255
+ }
1256
+ });
1257
+ }
build/js/wpcf7-redirect-frontend-script.js ADDED
@@ -0,0 +1,301 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var wpcf7_redirect;
2
+
3
+ (function ($) {
4
+ function Wpcf7_redirect() {
5
+ this.init = function () {
6
+
7
+ this.wpcf7_redirect_mailsent_handler();
8
+
9
+ };
10
+
11
+ this.wpcf7_redirect_mailsent_handler = function () {
12
+
13
+ document.addEventListener('wpcf7mailsent', function (event) {
14
+
15
+ var form = $(event.target);
16
+
17
+ $(document.body).trigger('wpcf7r-mailsent', [event]);
18
+
19
+ if (typeof event.detail.apiResponse != 'undefined' && event.detail.apiResponse) {
20
+
21
+ var apiResponse = event.detail.apiResponse;
22
+
23
+ var actionDelay = 0;
24
+
25
+ //handle api response
26
+
27
+ if (typeof apiResponse.api_url_request != 'undefined' && apiResponse.api_url_request) {
28
+
29
+ wpcf7_redirect.handle_api_action(apiResponse.api_url_request);
30
+
31
+ }
32
+
33
+ //handle api response
34
+
35
+ if (typeof apiResponse.api_json_xml_request != 'undefined' && apiResponse.api_json_xml_request) {
36
+
37
+ wpcf7_redirect.handle_api_action(apiResponse.api_json_xml_request);
38
+
39
+ }
40
+
41
+ //handle fire javascript action
42
+
43
+ if (typeof apiResponse.FireScript != 'undefined' && apiResponse.FireScript) {
44
+
45
+ actionDelay = typeof apiResponse.FireScript.delay_redirect != 'undefined' ? apiResponse.FireScript.delay_redirect : actionDelay;
46
+
47
+ window.setTimeout(function () {
48
+
49
+ wpcf7_redirect.handle_javascript_action(apiResponse.FireScript);
50
+
51
+ }, actionDelay);
52
+
53
+ }
54
+
55
+ //catch and handle popup action
56
+
57
+ if (typeof apiResponse.popup != 'undefined' && apiResponse.popup) {
58
+
59
+ wpcf7_redirect.handle_popups(apiResponse.popup);
60
+
61
+ }
62
+
63
+ //catch redirect to paypal
64
+
65
+ if (typeof apiResponse.redirect_to_paypal != 'undefined' && apiResponse.redirect_to_paypal) {
66
+
67
+ actionDelay = typeof apiResponse.redirect_to_paypal.delay_redirect != 'undefined' ? apiResponse.redirect_to_paypal.delay_redirect : actionDelay;
68
+
69
+ window.setTimeout(function () {
70
+
71
+ wpcf7_redirect.handle_redirect_action(apiResponse.redirect_to_paypal);
72
+
73
+ }, actionDelay);
74
+
75
+ }
76
+
77
+ //catch redirect action
78
+
79
+ if (typeof apiResponse.redirect != 'undefined' && apiResponse.redirect) {
80
+
81
+ actionDelay = typeof apiResponse.redirect.delay_redirect != 'undefined' ? apiResponse.redirect.delay_redirect : actionDelay;
82
+
83
+ window.setTimeout(function () {
84
+
85
+ wpcf7_redirect.handle_redirect_action(apiResponse.redirect);
86
+
87
+ }, actionDelay);
88
+
89
+ }
90
+
91
+ }
92
+
93
+ }, false);
94
+
95
+ document.addEventListener('wpcf7invalid', function (event) {
96
+
97
+ var form = $(event.target);
98
+
99
+ $(document.body).trigger('wpcf7r-invalid', [event]);
100
+
101
+ if (typeof event.detail.apiResponse != 'undefined' && event.detail.apiResponse) {
102
+
103
+ response = event.detail.apiResponse;
104
+
105
+ if (response.invalidFields) {
106
+
107
+ //support for multistep by ninja
108
+
109
+ wpcf7_redirect.ninja_multistep_mov_to_invalid_tab(event, response);
110
+
111
+ }
112
+
113
+ }
114
+
115
+ });
116
+
117
+ };
118
+
119
+ this.handle_popups = function (popups) {
120
+
121
+ $(document.body).trigger('wpcf7r-before-open-popup', [event]);
122
+
123
+ $.each(popups, function (k, popup) {
124
+
125
+ var $new_elem = $(popup['popup-template']);
126
+
127
+ $(document.body).append($new_elem);
128
+
129
+ $(document.body).addClass(popup['template-name']);
130
+
131
+ window.setTimeout(function () {
132
+
133
+ $(document.body).addClass('modal-popup-open');
134
+
135
+ $new_elem.addClass('is-open');
136
+
137
+ }, 1000);
138
+
139
+ $new_elem.find('.close-button').on('click', function () {
140
+
141
+ $new_elem.removeClass('is-open').addClass('fade');
142
+
143
+ $(document.body).removeClass('modal-popup-open');
144
+
145
+ window.setTimeout(function () {
146
+
147
+ $('.wpcf7r-modal').remove();
148
+
149
+ $(document.body).trigger('wpcf7r-popup-removed', [$new_elem]);
150
+
151
+ }, 4000);
152
+
153
+ });
154
+
155
+ $(document.body).trigger('wpcf7r-popup-appended', [$new_elem]);
156
+
157
+ });
158
+
159
+ }
160
+
161
+ this.handle_api_action = function (send_to_api_result, request) {
162
+
163
+ $.each(send_to_api_result, function (k, v) {
164
+
165
+ if (!v.result_javascript) {
166
+
167
+ return;
168
+
169
+ }
170
+
171
+ response = typeof v.api_response != 'undefined' ? v.api_response : '';
172
+
173
+ request = typeof v.request != 'undefined' ? v.request : '';
174
+
175
+ eval(v.result_javascript);
176
+
177
+ });
178
+
179
+ };
180
+
181
+ this.ninja_multistep_mov_to_invalid_tab = function (event, response) {
182
+
183
+ if ($('.fieldset-cf7mls-wrapper').length) {
184
+
185
+ var form = $(event.target);
186
+
187
+ var first_invalid_field = response.invalidFields[0];
188
+
189
+ var parent_step = $(first_invalid_field.into).parents('fieldset');
190
+
191
+ form.find('.fieldset-cf7mls').removeClass('cf7mls_current_fs');
192
+
193
+ parent_step.addClass('cf7mls_current_fs').removeClass('cf7mls_back_fs');
194
+
195
+ if (form.find('.cf7mls_progress_bar').length) {
196
+
197
+ form.find('.cf7mls_progress_bar li').eq(form.find("fieldset.fieldset-cf7mls").index(previous_fs)).addClass("current");
198
+
199
+ form.find('.cf7mls_progress_bar li').eq(form.find("fieldset.fieldset-cf7mls").index(current_fs)).removeClass("active current");
200
+
201
+ }
202
+
203
+ }
204
+
205
+ }
206
+
207
+ this.handle_redirect_action = function (redirect) {
208
+
209
+ $(document.body).trigger('wpcf7r-handle_redirect_action', [redirect]);
210
+
211
+ $.each(redirect, function (k, v) {
212
+
213
+ var delay = typeof v.delay != 'undefined' && v.delay ? v.delay : '';
214
+
215
+ delay = delay * 1000;
216
+
217
+ window.setTimeout(function (v) {
218
+
219
+ var redirect_url = typeof v.redirect_url != 'undefined' && v.redirect_url ? v.redirect_url : '';
220
+
221
+ var type = typeof v.type != 'undefined' && v.type ? v.type : '';
222
+
223
+ if (typeof v.form != 'undefined' && v.form) {
224
+
225
+ $('body').append(v.form);
226
+
227
+ $('#cf7r-result-form').submit();
228
+
229
+ } else {
230
+
231
+ if (redirect_url && type == 'redirect') {
232
+
233
+ window.location = redirect_url;
234
+
235
+ } else if (redirect_url && type == 'new_tab') {
236
+
237
+ window.open(redirect_url);
238
+
239
+ }
240
+
241
+ }
242
+
243
+ }, delay, v);
244
+
245
+ });
246
+
247
+ };
248
+
249
+ this.handle_javascript_action = function (scripts) {
250
+
251
+ $(document.body).trigger('wpcf7r-handle_javascript_action', [scripts]);
252
+
253
+ $.each(scripts, function (k, script) {
254
+
255
+ eval(script); //not using user input
256
+
257
+ });
258
+
259
+ };
260
+
261
+ this.htmlspecialchars_decode = function (string) {
262
+
263
+ var map = {
264
+
265
+ '&amp;': '&',
266
+
267
+ '&#038;': "&",
268
+
269
+ '&lt;': '<',
270
+
271
+ '&gt;': '>',
272
+
273
+ '&quot;': '"',
274
+
275
+ '&#039;': "'",
276
+
277
+ '&#8217;': "’",
278
+
279
+ '&#8216;': "‘",
280
+
281
+ '&#8211;': "–",
282
+
283
+ '&#8212;': "—",
284
+
285
+ '&#8230;': "…",
286
+
287
+ '&#8221;': '”'
288
+
289
+ };
290
+
291
+ return string.replace(/\&[\w\d\#]{2,5}\;/g, function (m) { return map[m]; });
292
+
293
+ };
294
+
295
+ this.init();
296
+
297
+ }
298
+
299
+ wpcf7_redirect = new Wpcf7_redirect();
300
+
301
+ })(jQuery);
class-wpcf7-redirect.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Main Contact Form 7 Redirect Class
4
+ */
5
+ class Wpcf7_Redirect {
6
+ public function init() {
7
+ $this->define();
8
+ $this->load_dependencies();
9
+ $this->cf7_redirect_base = new WPCF7R_Base();
10
+
11
+ add_action( 'plugins_loaded', array( $this, 'notice_to_remove_old_plugin' ) );
12
+ }
13
+
14
+ /**
15
+ * Load dependencies
16
+ */
17
+ public function load_dependencies() {
18
+ // Load all actions
19
+ foreach ( glob( WPCF7_PRO_REDIRECT_BASE_PATH . 'modules/*.php' ) as $filename ) {
20
+ require_once( $filename );
21
+ }
22
+ require_once( WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-wpcf7r-base.php' );
23
+ }
24
+
25
+ /**
26
+ * Notice to remove old plugin
27
+ */
28
+ public function notice_to_remove_old_plugin() {
29
+ if ( ! function_exists( 'is_plugin_active' ) ) {
30
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
31
+ }
32
+ if ( is_plugin_active( 'cf7-to-api/cf7-to-api.php' ) ) {
33
+ add_action( 'admin_notices', 'wpcf7_remove_contact_form_7_to_api' );
34
+ }
35
+ }
36
+
37
+ /**
38
+ * Defines
39
+ */
40
+ public function define() {
41
+ define( 'WPCF7_PRO_REDIRECT_PLUGIN_PAGE_URL', 'https://redirection-for-contact-form7.com/' );
42
+ define( 'WPCF7_PRO_REDIRECT_DEBUG_URL', 'https://redirection-for-contact-form7.com/wp-json/api-v1/debug' );
43
+ define( 'WPCF7_PRO_REDIRECT_PLUGIN_ACTIVATION_URL', 'https://redirection-for-contact-form7.com/wp-admin/admin-ajax.php' );
44
+ define( 'WPCF7_PRO_REDIRECT_PLUGIN_UPDATES', 'https://redirection-for-contact-form7.com/wp-json/api-v1/check-for-updates/' );
45
+ define( 'ACCESSIBE_API_URI', 'https://redirection-for-contact-form7.com/wp-json/accesibe-api/activate' );
46
+
47
+ define( 'WPCF7_PRO_REDIRECT_PLUGIN_ID', '6XpU046EOVs7v6O' );
48
+ define( 'WPCF7_PRO_REDIRECT_PLUGIN_SKU', 'wpcfr-pro' );
49
+ define( 'WPCF7_PRO_REDIRECT_BASE_NAME', plugin_basename( __FILE__ ) );
50
+ define( 'WPCF7_PRO_REDIRECT_BASE_PATH', plugin_dir_path( __FILE__ ) );
51
+ define( 'WPCF7_PRO_REDIRECT_BASE_URL', plugin_dir_url( __FILE__ ) );
52
+ define( 'WPCF7_PRO_REDIRECT_PLUGINS_PATH', plugin_dir_path( dirname( __FILE__ ) ) );
53
+ define( 'WPCF7_PRO_REDIRECT_TEMPLATE_PATH', WPCF7_PRO_REDIRECT_BASE_PATH . 'templates/' );
54
+ define( 'WPCF7_PRO_REDIRECT_ACTIONS_TEMPLATE_PATH', WPCF7_PRO_REDIRECT_CLASSES_PATH . 'actions/html/' );
55
+ define( 'WPCF7_PRO_REDIRECT_ADDONS_PATH', WPCF7_PRO_REDIRECT_PLUGINS_PATH . 'wpcf7r-addons/' );
56
+ define( 'WPCF7_PRO_REDIRECT_ACTIONS_PATH', WPCF7_PRO_REDIRECT_CLASSES_PATH . 'actions/' );
57
+ define( 'WPCF7_PRO_REDIRECT_FIELDS_PATH', WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'fields/' );
58
+ define( 'WPCF7_PRO_REDIRECT_POPUP_TEMPLATES_PATH', WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'popups/' );
59
+ define( 'WPCF7_PRO_REDIRECT_POPUP_TEMPLATES_URL', WPCF7_PRO_REDIRECT_BASE_URL . '/templates/popups/' );
60
+ define( 'WPCF7_PRO_REDIRECT_ASSETS_PATH', WPCF7_PRO_REDIRECT_BASE_URL . 'assets/' );
61
+ define( 'WPCF7_PRO_REDIRECT_BUILD_PATH', WPCF7_PRO_REDIRECT_BASE_URL . 'build/' );
62
+
63
+ define( 'QFORM_BASE', WPCF7_PRO_REDIRECT_BASE_PATH . 'form/' );
64
+ }
65
+ }
classes/actions/class-wpcf7r-action-firescript.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Action_FireScript file - handles JavaScript actions
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ register_wpcf7r_actions(
9
+ 'FireScript',
10
+ __( 'Fire JavaScript', 'wpcf7-redirect' ),
11
+ 'WPCF7R_Action_FireScript',
12
+ 2
13
+ );
14
+
15
+ class WPCF7R_Action_FireScript extends WPCF7R_Action {
16
+
17
+ public function __construct( $post ) {
18
+ parent::__construct( $post );
19
+
20
+ }
21
+
22
+ /**
23
+ * Get the fields relevant for this action
24
+ */
25
+ public function get_action_fields() {
26
+ return array_merge(
27
+ array(
28
+ 'script' => array(
29
+ 'name' => 'script',
30
+ 'type' => 'textarea',
31
+ 'label' => __( 'Paste your JavaScript here.', 'wpcf7-redirect' ),
32
+ 'sub_title' => esc_html( __( '(Don\'t use <script> tags)', 'wpcf7-redirect' ) ),
33
+ 'placeholder' => __( 'Paste your JavaScript here', 'wpcf7-redirect' ),
34
+ 'value' => $this->get( 'script' ),
35
+ ),
36
+ 'short-tags-usage' => array(
37
+ 'name' => 'general-alert',
38
+ 'type' => 'notice',
39
+ 'label' => __( 'Notice!', 'wpcf7-redirect' ),
40
+ /* Translators: available mail tags */
41
+ 'sub_title' => sprintf( __( 'You can use the following tags.<div>%s</div>', 'wpcf7-redirect' ), $this->get_formatted_mail_tags() ),
42
+ 'placeholder' => '',
43
+ 'class' => 'field-notice-alert',
44
+ 'show_selector' => '',
45
+ ),
46
+ 'general-alert' => array(
47
+ 'name' => 'general-alert',
48
+ 'type' => 'notice',
49
+ 'label' => __( 'Warning!', 'wpcf7-redirect' ),
50
+ 'sub_title' => __(
51
+ 'This option is for developers only - use with caution. If the plugin does not redirect after you have added scripts,
52
+ it means you have a problem with your script. Either fix the script, or remove it.',
53
+ 'wpcf7-redirect'
54
+ ),
55
+ 'placeholder' => '',
56
+ 'class' => 'field-warning-alert',
57
+ 'show_selector' => '',
58
+ ),
59
+ ),
60
+ parent::get_default_fields()
61
+ );
62
+ }
63
+
64
+ /**
65
+ * Get settings page
66
+ */
67
+ public function get_action_settings() {
68
+ $this->get_settings_template( 'html-action-send-to-email.php' );
69
+ }
70
+
71
+ /**
72
+ * Handle a simple redirect rule
73
+ */
74
+ public function process( $submission ) {
75
+
76
+ $script = $this->get( 'script' );
77
+
78
+ $script = $this->replace_tags( $script, array() );
79
+
80
+ return $script;
81
+ }
82
+
83
+ }
classes/actions/class-wpcf7r-action-honeypot.php ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Action_Honeypot
4
+ * A Class that handles javascript actions
5
+ */
6
+
7
+ defined( 'ABSPATH' ) || exit;
8
+
9
+ register_wpcf7r_actions(
10
+ 'honeypot',
11
+ __( 'Honeypot', 'wpcf7-redirect' ),
12
+ 'WPCF7R_Action_Honeypot',
13
+ 5
14
+ );
15
+
16
+ class WPCF7R_Action_Honeypot extends WPCF7R_Action {
17
+ public function __construct( $post ) {
18
+ parent::__construct( $post );
19
+ }
20
+
21
+ /**
22
+ * Get the fields relevant for this action
23
+ */
24
+ public function get_action_fields() {
25
+ return array_merge(
26
+ array(
27
+ 'general-alert' => array(
28
+ 'name' => 'general-alert',
29
+ 'type' => 'notice',
30
+ 'label' => __( 'Notice!', 'wpcf7-redirect' ),
31
+ 'sub_title' => __(
32
+ 'Honeypot creates a random number of anti-spam fields on your form. If a robot fills out one of these fields the submission is marked as spam.<br/>
33
+ <a href="https://en.wikipedia.org/wiki/Honeypot_(computing)" target="_blank">Learn More</a>',
34
+ 'wpcf7-redirect'
35
+ ),
36
+ 'placeholder' => '',
37
+ 'class' => 'field-warning-notice',
38
+ 'show_selector' => '',
39
+ ),
40
+ ),
41
+ parent::get_default_fields()
42
+ );
43
+ }
44
+
45
+ /**
46
+ * Create the honeypot field names
47
+ *
48
+ * @param integer $length
49
+ */
50
+ function readable_random_string( $length = 6 ) {
51
+ $string = '';
52
+ $vowels = array( 'a', 'e', 'i', 'o', 'u' );
53
+ $consonants = array(
54
+ 'b',
55
+ 'c',
56
+ 'd',
57
+ 'f',
58
+ 'g',
59
+ 'h',
60
+ 'j',
61
+ 'k',
62
+ 'l',
63
+ 'm',
64
+ 'n',
65
+ 'p',
66
+ 'r',
67
+ 's',
68
+ 't',
69
+ 'v',
70
+ 'w',
71
+ 'x',
72
+ 'y',
73
+ 'z',
74
+ );
75
+ $max = $length / 2;
76
+
77
+ for ( $i = 1; $i <= $max; $i++ ) {
78
+ $string .= $consonants[ rand( 0, 19 ) ];
79
+ $string .= $vowels[ rand( 0, 4 ) ];
80
+ }
81
+
82
+ return $string;
83
+ }
84
+
85
+ /**
86
+ * Get the honeypot fields names
87
+ */
88
+ private function get_honeypot_names() {
89
+ return get_post_meta( $this->get_id(), 'honeypot_names', true );
90
+ }
91
+
92
+ /**
93
+ * Render callback
94
+ */
95
+ public function render_callback_once( $properties ) {
96
+ add_action(
97
+ 'wp_footer',
98
+ function() {
99
+ $honeypot_names = $this->get_honeypot_names();
100
+
101
+ foreach ( $honeypot_names as $honeypot_name ) {
102
+ echo "<style>.{$honeypot_name}{transform:scale(0);position: absolute;z-index: -10;}</style>";
103
+ }
104
+ }
105
+ );
106
+
107
+ return $properties;
108
+ }
109
+
110
+ /**
111
+ * Render an element on the form frontend.
112
+ *
113
+ * @param array $properties
114
+ * @param object $form
115
+ */
116
+ public function render_callback( $properties, $form ) {
117
+ $honeypot_names = $this->get_honeypot_names();
118
+
119
+ if ( ! $honeypot_names ) {
120
+ $rand = rand( 1, 4 );
121
+ $honeypot_names = array();
122
+
123
+ for ( $i = 1;$i <= $rand;$i++ ) {
124
+ $honeypot_names[] = $this->readable_random_string();
125
+ }
126
+
127
+ update_post_meta( $this->get_id(), 'honeypot_names', $honeypot_names );
128
+ }
129
+
130
+ if ( isset( $properties['form'] ) ) {
131
+ foreach ( $honeypot_names as $honeypot_name ) {
132
+ $properties['form'] .= "<p class='{$honeypot_name}'>[text {$honeypot_name}]</p>";
133
+ }
134
+ }
135
+
136
+ return $properties;
137
+ }
138
+
139
+ /**
140
+ * Process the honeypot validations
141
+ */
142
+ public function process_validation( $submission ) {
143
+ $response = array();
144
+ $posted_data = $submission->get_posted_data();
145
+ $honeypot_names = $this->get_honeypot_names();
146
+
147
+ if ( $honeypot_names ) {
148
+ foreach ( $honeypot_names as $honeypot_name ) {
149
+ if ( isset( $posted_data[ $honeypot_name ] ) && $posted_data[ $honeypot_name ] ) {
150
+ $error = array(
151
+ 'tag' => $honeypot_name,
152
+ 'error_message' => __( 'Something went wrong', 'wpcf7-redirect' ),
153
+ );
154
+ $response['invalid_tags'][] = new WP_error( 'tag_invalid', $error );
155
+ } else {
156
+ $response['ignored_tags'][] = $honeypot_name;
157
+ }
158
+ }
159
+ }
160
+
161
+ return $response;
162
+ }
163
+ }
classes/actions/class-wpcf7r-action-redirect.php ADDED
@@ -0,0 +1,263 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Action_Redirect file.
4
+ */
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) {
7
+ exit;
8
+ }
9
+
10
+ register_wpcf7r_actions(
11
+ 'redirect',
12
+ __( 'Redirect', 'wpcf7-redirect' ),
13
+ 'WPCF7R_Action_Redirect',
14
+ 1
15
+ );
16
+
17
+ /**
18
+ * Class WPCF7R_Action_Redirect
19
+ * A Class that handles redirect actions
20
+ */
21
+ class WPCF7R_Action_Redirect extends WPCF7R_Action {
22
+
23
+ /**
24
+ * Init the parent action class
25
+ *
26
+ * @param $post
27
+ */
28
+ public function __construct( $post ) {
29
+ parent::__construct( $post );
30
+
31
+ }
32
+
33
+ /**
34
+ * Get the action admin fields
35
+ */
36
+ public function get_action_fields() {
37
+
38
+ $parent_fields = parent::get_default_fields();
39
+
40
+ unset( $parent_fields['action_status'] );
41
+
42
+ return array_merge(
43
+ array(
44
+ array(
45
+ 'name' => 'use_external_url',
46
+ 'type' => 'checkbox',
47
+ 'label' => __( 'Use custom URL', 'wpcf7-redirect' ),
48
+ 'sub_title' => '',
49
+ 'placeholder' => '',
50
+ 'show_selector' => '.field-wrap-external_url,.field-wrap-page_id',
51
+ 'value' => $this->get( 'use_external_url' ),
52
+ ),
53
+ array(
54
+ 'name' => 'page_id',
55
+ 'type' => 'page_select',
56
+ 'label' => __( 'Select a page', 'wpcf7-redirect' ),
57
+ 'placeholder' => __( 'Select a page', 'wpcf7-redirect' ),
58
+ 'value' => $this->get( 'page_id' ),
59
+ 'class' => $this->get( 'use_external_url' ) ? 'field-hidden' : '',
60
+ ),
61
+ array(
62
+ 'name' => 'external_url',
63
+ 'type' => 'url',
64
+ 'label' => __( 'Use external URL', 'wpcf7-redirect' ),
65
+ 'placeholder' => __( 'Use external URL', 'wpcf7-redirect' ),
66
+ 'tooltip' => __( 'You can build a custom url like this https://example.com/[your-name]?[your-email]&[your-tel]', 'wpcf7-redirect' ),
67
+ 'footer' => '<div>' . $this->get_formatted_mail_tags() . '</div><div class="wpcf7-redirect-butify-wrap"></div>',
68
+ 'value' => $this->get( 'external_url' ),
69
+ 'class' => $this->get( 'use_external_url' ) ? '' : 'field-hidden',
70
+ ),
71
+ array(
72
+ 'name' => 'redirect_as_x_form_encoded_url',
73
+ 'type' => 'checkbox',
74
+ 'label' => __( 'Redirect as X-WWW-FORM-URLENCODED (Form Post)', 'wpcf7-redirect' ),
75
+ 'sub_title' => '',
76
+ 'placeholder' => '',
77
+ 'value' => $this->get( 'redirect_as_x_form_encoded_url' ),
78
+ ),
79
+ array(
80
+ 'name' => 'open_in_new_tab',
81
+ 'type' => 'checkbox',
82
+ 'label' => __( 'Open page in a new tab', 'wpcf7-redirect' ),
83
+ 'sub_title' => '',
84
+ 'placeholder' => '',
85
+ 'show_selector' => '.field-wrap-open_in_new_tab_notice',
86
+ 'value' => $this->get( 'open_in_new_tab' ),
87
+ ),
88
+ array(
89
+ 'name' => 'open_in_new_tab_notice',
90
+ 'type' => 'notice',
91
+ 'label' => '<strong>' . __( 'Notice!', 'wpcf7-redirect' ) . '</strong>',
92
+ 'sub_title' => __( 'This option might not work as expected, since browsers often block popup windows. This option depends on the browser settings.', 'wpcf7-redirect' ),
93
+ 'placeholder' => '',
94
+ 'class' => $this->get( 'open_in_new_tab' ) ? 'field-notice-alert' : 'field-hidden field-notice-alert',
95
+ 'show_selector' => '',
96
+ ),
97
+ array(
98
+ 'name' => 'http_build_query',
99
+ 'type' => 'checkbox',
100
+ 'label' => __( 'Pass all the fields from the form as URL query parameters', 'wpcf7-redirect' ),
101
+ 'sub_title' => '',
102
+ 'placeholder' => '',
103
+ 'show_selector' => '.field-wrap-get_param_shortcode',
104
+ 'value' => $this->get( 'http_build_query' ),
105
+ ),
106
+ array(
107
+ 'name' => 'http_build_query_selectively',
108
+ 'type' => 'checkbox',
109
+ 'label' => __( 'Pass specific fields from the form as URL query parameters', 'wpcf7-redirect' ),
110
+ 'sub_title' => '',
111
+ 'placeholder' => '',
112
+ 'show_selector' => '.field-wrap-http_build_query_selectively_fields,.field-wrap-get_param_shortcode',
113
+ 'value' => $this->get( 'http_build_query_selectively' ),
114
+ ),
115
+ array(
116
+ 'name' => 'http_build_query_selectively_fields',
117
+ 'type' => 'text',
118
+ 'label' => __( 'Fields to pass as URL query parameters, separated by commas:', 'wpcf7-redirect' ),
119
+ 'footer' => '<div>' . $this->get_formatted_mail_tags( true ) . '</div><div class="wpcf7-redirect-butify-wrap"></div>',
120
+ 'placeholder' => '',
121
+ 'value' => $this->get( 'http_build_query_selectively_fields' ),
122
+ 'class' => $this->get( 'http_build_query_selectively' ) ? '' : 'field-hidden',
123
+ ),
124
+ array(
125
+ 'name' => 'get_param_shortcode',
126
+ 'type' => 'notice',
127
+ 'label' => '<strong>' . __( '[get_param]!', 'wpcf7-redirect' ) . '</strong>',
128
+ 'sub_title' => __( 'You can use this tag on the target page to collect the data transerred [get_param param="your-name"].', 'wpcf7-redirect' ),
129
+ 'placeholder' => '',
130
+ 'class' => $this->get( 'http_build_query_selectively' ) ? 'field-notice-alert' : 'field-hidden field-notice-alert',
131
+ 'show_selector' => '',
132
+ ),
133
+ array(
134
+ 'name' => 'delay_redirect_seconds',
135
+ 'type' => 'number',
136
+ 'label' => __( 'How many seconds to delay', 'wpcf7-redirect' ),
137
+ 'placeholder' => __( 'Number of seconds', 'wpcf7-redirect' ),
138
+ 'value' => $this->get( 'delay_redirect_seconds' ),
139
+ 'class' => '',
140
+ ),
141
+ 'action_status' => array(
142
+ 'name' => 'action_status',
143
+ 'type' => 'checkbox',
144
+ 'label' => $this->get_action_status_label(),
145
+ 'sub_title' => __( 'if this is off the rule will not be applied', 'wpcf7-redirect' ),
146
+ 'placeholder' => '',
147
+ 'show_selector' => '.field-wrap-disable_default_email',
148
+ 'toggle-label' => json_encode(
149
+ array(
150
+ '.field-wrap-action_status .checkbox-label,.column-status a' => array(
151
+ __( 'Enabled', 'wpcf7-redirect' ),
152
+ __( 'Disabled', 'wpcf7-redirect' ),
153
+ ),
154
+ )
155
+ ),
156
+ 'value' => $this->get( 'action_status' ),
157
+ ),
158
+ 'disable_default_email' => array(
159
+ 'name' => 'disable_default_email',
160
+ 'type' => 'notice',
161
+ 'label' => __( '<strong>NOTICE!</strong><br/>', 'wpcf7-redirect' ),
162
+ 'sub_title' => __( 'Redirection will always be the last action regardless of the actions order.', 'wpcf7-redirect' ),
163
+ 'placeholder' => '',
164
+ 'class' => $this->get( 'action_status' ) ? 'field-notice-alert' : 'field-hidden field-notice-alert',
165
+ 'show_selector' => '',
166
+ ),
167
+ ),
168
+ $parent_fields
169
+ );
170
+ }
171
+
172
+ /**
173
+ * Get an HTML of the
174
+ */
175
+ public function get_action_settings() {
176
+ $this->get_settings_template( 'html-action-redirect.php' );
177
+ }
178
+
179
+ /**
180
+ * Handle a simple redirect rule
181
+ *
182
+ * @param $submission
183
+ */
184
+ public function process( $submission ) {
185
+ $response = array();
186
+
187
+ $this->posted_data = $submission->get_posted_data();
188
+
189
+ if ( $this->get( 'use_external_url' ) === 'on' && $this->get( 'external_url' ) ) {
190
+ $response = array(
191
+ 'type' => 'redirect',
192
+ 'redirect_url' => $this->replace_tags( $this->get( 'external_url' ) ),
193
+ 'delay' => $this->get( 'delay_redirect_seconds' ) ? (int) $this->get( 'delay_redirect_seconds' ) : 0,
194
+ );
195
+ } elseif ( $this->get( 'page_id' ) ) {
196
+ $response = array(
197
+ 'type' => 'redirect',
198
+ 'redirect_url' => get_permalink( $this->get( 'page_id' ) ),
199
+ 'delay' => $this->get( 'delay_redirect_seconds' ) ? (int) $this->get( 'delay_redirect_seconds' ) : 0,
200
+ );
201
+ }
202
+
203
+ if ( $this->get( 'redirect_as_x_form_encoded_url' ) && isset( $response['redirect_url'] ) && $response['redirect_url'] ) {
204
+
205
+ ob_start();
206
+
207
+ $params = parse_url( $response['redirect_url'] );
208
+
209
+ parse_str( $params['query'], $fields );
210
+
211
+ if ( isset( $fields['sum'] ) && isset( $fields['qty'] ) ) {
212
+ $fields['sum'] = $fields['sum'] * $fields['qty'];
213
+ }
214
+
215
+ if ( $this->get( 'http_build_query_selectively' ) === 'on' ) {
216
+ $fields_to_add = explode( ',', $this->get( 'http_build_query_selectively_fields' ) );
217
+
218
+ foreach ( $fields_to_add as $field_to_add ) {
219
+ $field_to_add = trim( $field_to_add );
220
+ $fields[ $field_to_add ] = isset( $this->posted_data[ $field_to_add ] ) ? $this->posted_data[ $field_to_add ] : '';
221
+ }
222
+ } elseif ( $this->get( 'http_build_query' ) === 'on' ) {
223
+ $fields = array_merge( $this->posted_data, $fields );
224
+ }
225
+
226
+ ?>
227
+ <form id="cf7r-result-form" action="<?php echo $response['redirect_url']; ?>" method="post">
228
+ <?php foreach ( $fields as $field_key => $field_value ) : ?>
229
+ <input type="hidden" name="<?php echo $field_key; ?>" value="<?php echo $field_value; ?>">
230
+ <?php endforeach; ?>
231
+ </form>
232
+ <?php
233
+ $response['form'] = ob_get_clean();
234
+
235
+ } elseif ( $this->get( 'http_build_query' ) === 'on' ) {
236
+
237
+ $response['http_build_query'] = true;
238
+ $response['redirect_url'] = add_query_arg( $this->posted_data, $response['redirect_url'] );
239
+
240
+ } elseif ( $this->get( 'http_build_query_selectively' ) === 'on' ) {
241
+
242
+ $fields_to_add = explode( ',', $this->get( 'http_build_query_selectively_fields' ) );
243
+ $fields_to_add_args = array();
244
+
245
+ foreach ( $fields_to_add as $field_to_add ) {
246
+ $field_to_add = trim( $field_to_add );
247
+ $fields_to_add_args[ $field_to_add ] = isset( $this->posted_data[ $field_to_add ] ) ? $this->posted_data[ $field_to_add ] : '';
248
+ }
249
+
250
+ $response['redirect_url'] = add_query_arg( $fields_to_add_args, $response['redirect_url'] );
251
+ }
252
+
253
+ if ( $this->get( 'after_sent_script' ) ) {
254
+ $response['after_sent_script'] = $this->get( 'after_sent_script' );
255
+ }
256
+
257
+ if ( $this->get( 'open_in_new_tab' ) === 'on' ) {
258
+ $response['type'] = 'new_tab';
259
+ }
260
+
261
+ return $response;
262
+ }
263
+ }
classes/actions/class-wpcf7r-action-save-lead.php ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Action_Save_Lead file - handles send send to api process
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ register_wpcf7r_actions( 'save_lead', __( 'Save Lead', 'wpcf7-redirect' ), 'WPCF7R_Action_Save_Lead', 3 );
9
+
10
+ class WPCF7R_Action_Save_Lead extends WPCF7R_Action {
11
+
12
+ /**
13
+ * Init the parent action class
14
+ */
15
+ public function __construct( $post ) {
16
+ parent::__construct( $post );
17
+ $this->priority = 1;
18
+ }
19
+
20
+ /**
21
+ * Get the action admin fields
22
+ */
23
+ public function get_action_fields() {
24
+
25
+ $parent_fields = parent::get_default_fields();
26
+
27
+ unset( $parent_fields['action_status'] );
28
+
29
+ return array_merge(
30
+ array(
31
+ 'tags_map_mapping_section' => array(
32
+ 'name' => 'tags_map_mapping_section',
33
+ 'type' => 'section',
34
+ 'title' => __( 'Tags mapping', 'wpcf7-redirect' ),
35
+ 'fields' => array(
36
+ array(
37
+ 'name' => 'leads_map',
38
+ 'type' => 'leads_map',
39
+ 'label' => '',
40
+ 'sub_title' => '',
41
+ 'placeholder' => '',
42
+ 'show_selector' => '',
43
+ 'value' => maybe_unserialize( $this->get( 'leads_map' ) ),
44
+ 'tags' => WPCF7R_Form::get_mail_tags(),
45
+ ),
46
+ ),
47
+ ),
48
+ 'action_status' => array(
49
+ 'name' => 'action_status',
50
+ 'type' => 'checkbox',
51
+ 'label' => $this->get_action_status_label(),
52
+ 'sub_title' => __( 'if this is off the rule will not be applied', 'wpcf7-redirect' ),
53
+ 'placeholder' => '',
54
+ 'show_selector' => '',
55
+ 'toggle-label' => json_encode(
56
+ array(
57
+ '.field-wrap-action_status .checkbox-label,.column-status a' => array(
58
+ __( 'Enabled', 'wpcf7-redirect' ),
59
+ __( 'Disabled', 'wpcf7-redirect' ),
60
+ ),
61
+ )
62
+ ),
63
+ 'value' => $this->get( 'action_status' ),
64
+ ),
65
+ ),
66
+ $parent_fields
67
+ );
68
+ }
69
+
70
+ /**
71
+ * Get an HTML of the
72
+ */
73
+ public function get_action_settings() {
74
+
75
+ $this->get_settings_template( 'html-action-redirect.php' );
76
+
77
+ }
78
+
79
+ /**
80
+ * Handle a simple redirect rule
81
+ *
82
+ * @param $submission
83
+ */
84
+ public function process( $submission ) {
85
+ $contact_form = $submission->get_contact_form();
86
+
87
+ //insert the lead to the DB
88
+ $files = $submission->uploaded_files();
89
+
90
+ $submitted_files = array();
91
+
92
+ $posted_values = $submission->get_posted_data();
93
+
94
+ if ( $files ) {
95
+ foreach ( $files as $file_key => $file_path ) {
96
+
97
+ $type = pathinfo( $file_path, PATHINFO_EXTENSION );
98
+
99
+ $submitted_files[ $file_key ] = array(
100
+ 'type' => $type,
101
+ 'name' => basename( $file_path ),
102
+ 'base64_file' => wpcf7r_base_64_file( $file_path ),
103
+ 'path' => $file_path,
104
+ );
105
+ unset( $posted_values[ $file_key ] );
106
+ }
107
+ }
108
+
109
+ $lead = WPCF7R_Leads_Manager::insert_lead( $contact_form->id(), $posted_values, $submitted_files , 'contact', $this->get_id() );
110
+
111
+ self::set_lead_id( $lead->post_id );
112
+
113
+ $response = array(
114
+ 'type' => 'save_lead',
115
+ 'data' => array(
116
+ 'lead_id' => $lead->post_id,
117
+ ),
118
+ );
119
+
120
+ return $response;
121
+ }
122
+ }
123
+
classes/actions/class-wpcf7r-action-send-to-api.php ADDED
@@ -0,0 +1,409 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Action_api_url_request file
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ class WPCF7R_Action_Send_To_Api extends WPCF7R_Action {
9
+
10
+ public function __construct( $post ) {
11
+ $this->action_id = $post->ID;
12
+ }
13
+
14
+ /**
15
+ * The handler that will send the data to the api
16
+ *
17
+ * @param $args
18
+ */
19
+ public function qs_cf7_send_data_to_api( $args ) {
20
+ $this->defaults = $args['tags_defaults'];
21
+ $this->functions = $args['tags_functions'];
22
+ $this->headers = $args['api_headers'];
23
+ $this->headers = array_filter( $this->headers );
24
+
25
+ $tags_map = $args['tags'];
26
+ $record_type = $args['record_type'];
27
+ $input_type = $args['input_type'];
28
+ $base_url = $args['base_url'];
29
+ $submission = isset( $args['submission'] ) ? $args['submission'] : '';
30
+ $template = $args['request_template'];
31
+
32
+ if ( 'xml' === $record_type ) {
33
+ $this->headers['Content-Type'] = 'text/xml';
34
+ } elseif ( 'json' === $record_type ) {
35
+ $this->headers['Content-Type'] = 'application/json';
36
+ }
37
+
38
+ $submission = WPCF7_Submission::get_instance();
39
+ $wpcf7 = $submission->get_contact_form();
40
+
41
+ $this->post = $wpcf7;
42
+ $this->clear_error_log( $this->post->id() );
43
+
44
+ $submission_url = $submission->get_meta( 'url' );
45
+
46
+ //always save last call results for debugging
47
+
48
+ $record = $this->get_record( $submission, $tags_map, $record_type, $template );
49
+ $record['url'] = $base_url;
50
+
51
+ if ( isset( $record['url'] ) && $record['url'] ) {
52
+ do_action( 'qs_cf7_api_before_sent_to_api', $record );
53
+ $response = $this->send_lead( $record, true, $input_type, $record_type, $tags_map );
54
+ do_action( 'qs_cf7_api_after_sent_to_api', $record, $response );
55
+
56
+ } else {
57
+ $this->log_result( __( 'Missing url' ), '' );
58
+ }
59
+
60
+ return array( $response, $record );
61
+ }
62
+
63
+ public function log_result( $record, $response ) {
64
+ if ( isset( $record['url'] ) ) {
65
+ update_post_meta( $this->action_id, 'api_debug_url', $record['url'] );
66
+ }
67
+
68
+ if ( is_wp_error( $response ) || is_wp_error( $record ) ) {
69
+ update_post_meta( $this->action_id, 'api_debug_result', $response );
70
+ update_post_meta( $this->action_id, 'api_debug_params', $record );
71
+ } else {
72
+ update_post_meta( $this->action_id, 'api_debug_params', $record );
73
+ update_post_meta( $this->action_id, 'api_debug_result', $response );
74
+ }
75
+ }
76
+
77
+ /**
78
+ * Clear error log
79
+ */
80
+ function clear_error_log( $post_id ) {
81
+ delete_post_meta( $post_id, 'api_errors' );
82
+ }
83
+
84
+ /**
85
+ * Convert the form keys to the API keys according to the mapping instructions
86
+ *
87
+ * @param $submission
88
+ * @param $tags_map
89
+ * @param string $type
90
+ * @param string $template
91
+ */
92
+ function get_record( $submission, $tags_map, $type = 'params', $template = '' ) {
93
+ $submited_data = $submission->get_posted_data();
94
+
95
+ if ( 'xml' === $type || 'json' === $type ) {
96
+ $template = $this->replace_lead_id_tag( $template );
97
+
98
+ foreach ( $tags_map as $form_key => $qs_cf7_form_key ) {
99
+ if ( is_array( $qs_cf7_form_key ) ) {
100
+
101
+ //arrange checkbox arrays
102
+ if ( isset( $submited_data[ $form_key ] ) ) {
103
+ $value = apply_filters( 'set_record_value', $submited_data[ $form_key ], $qs_cf7_form_key, $form_key );
104
+ $value = is_array( $value ) ? implode( ',', $value ) : $value;
105
+ }
106
+ } else {
107
+ $value = isset( $submited_data[ $form_key ] ) ? $submited_data[ $form_key ] : '';
108
+ $value = apply_filters( 'set_record_value', $value, $qs_cf7_form_key, $form_key );
109
+
110
+ //flattan radio
111
+ if ( is_array( $value ) ) {
112
+ $value = reset( $value );
113
+ }
114
+ }
115
+
116
+ //set defaults
117
+
118
+ if ( ! $value ) {
119
+ if ( isset( $this->defaults[ $form_key ] ) ) {
120
+ if ( is_array( $this->defaults[ $form_key ] ) ) {
121
+ $value = array();
122
+
123
+ foreach ( $this->defaults[ $form_key ] as $key => $sub_value ) {
124
+ if ( isset( $this->functions[ $key ] ) && $this->functions[ $key ] ) {
125
+ $sub_value = $this->run_function( $this->functions[ $key ], $sub_value );
126
+ }
127
+
128
+ if ( $sub_value ) {
129
+ $value[] = $sub_value;
130
+ }
131
+
132
+ $template = str_replace( "[{$key}]", $sub_value, $template );
133
+ }
134
+
135
+ $value = implode( ',', $value );
136
+
137
+ } else {
138
+ $value = $this->defaults[ $form_key ];
139
+ }
140
+ }
141
+ }
142
+
143
+ if ( isset( $this->functions[ $form_key ] ) && $this->functions[ $form_key ] ) {
144
+
145
+ //dont call the function again on arrays (checkvoxes)
146
+
147
+ if ( ! is_array( $this->functions[ $form_key ] ) ) {
148
+ $value = $this->run_function( $this->functions[ $form_key ], $value );
149
+ }
150
+ }
151
+
152
+ $value = trim( preg_replace( '/(\r\n)|\n|\r/', '\\n', $value ) );
153
+ $template = str_replace( "[{$form_key}]", $value, $template );
154
+ }
155
+
156
+ //replace special mail tags
157
+
158
+ foreach ( WPCF7R_Form::get_special_mail_tags() as $mail_tag ) {
159
+ $special = apply_filters( 'wpcf7_special_mail_tags', null, $mail_tag->field_name(), $template, $mail_tag );
160
+ $template = str_replace( "[{$mail_tag->field_name()}]", $special, $template );
161
+ }
162
+
163
+ //clean unchanged tags
164
+
165
+ $template = $this->replace_tags( $template );
166
+ $record['fields'] = $template;
167
+
168
+ } else {
169
+ $record = $this->get_record_by_tag_map( $submited_data, $tags_map );
170
+ $record = $this->set_defaults_and_run_functions( $record, $tags_map );
171
+ }
172
+
173
+ $record = apply_filters( 'cf7api_create_record', $record, $submited_data, $tags_map, $type, $template );
174
+
175
+ return $record;
176
+ }
177
+
178
+ /**
179
+ * Create a record object
180
+ *
181
+ * @param $submited_data
182
+ * @param $tags_map
183
+ */
184
+ public function get_record_by_tag_map( $submited_data, $tags_map ) {
185
+
186
+ $record = array();
187
+
188
+ foreach ( $tags_map as $form_key => $qs_cf7_form_key ) {
189
+ if ( $qs_cf7_form_key ) {
190
+ if ( is_array( $qs_cf7_form_key ) ) {
191
+
192
+ //arrange checkbox arrays
193
+ foreach ( $submited_data[ $form_key ] as $value ) {
194
+ if ( $value ) {
195
+ if ( 'lead_id' === $form_key ) {
196
+ $record['fields'][ $qs_cf7_form_key[ $value ] ] = apply_filters( 'set_record_value', self::get_lead_id(), $qs_cf7_form_key );
197
+ } else {
198
+ $record['fields'][ $qs_cf7_form_key[ $value ] ] = apply_filters( 'set_record_value', $value, $qs_cf7_form_key );
199
+ }
200
+ }
201
+ }
202
+ } else {
203
+ $value = isset( $submited_data[ $form_key ] ) ? $submited_data[ $form_key ] : '';
204
+
205
+ //flattan radio
206
+ if ( is_array( $value ) && count( $value ) === 1 ) {
207
+ $value = reset( $value );
208
+ }
209
+
210
+ if ( 'lead_id' === $form_key ) {
211
+ $record['fields'][ $qs_cf7_form_key ] = apply_filters( 'set_record_value', self::get_lead_id(), $qs_cf7_form_key );
212
+ } else {
213
+ $record['fields'][ $qs_cf7_form_key ] = apply_filters( 'set_record_value', $value, $qs_cf7_form_key );
214
+ }
215
+ }
216
+ }
217
+ }
218
+
219
+ return $record;
220
+ }
221
+
222
+ /**
223
+ * Set the fields defaults
224
+ */
225
+ public function set_defaults_and_run_functions( $record, $tags_map ) {
226
+
227
+ //set default values
228
+
229
+ if ( $this->defaults && array_values( $this->defaults ) ) {
230
+ foreach ( $this->defaults as $default_field_key => $default_value ) {
231
+ if ( $default_value ) {
232
+ $api_key = $tags_map[ $default_field_key ];
233
+ $record['fields'][ $api_key ] = isset( $record['fields'][ $api_key ] ) && $record['fields'][ $api_key ] ? $record['fields'][ $api_key ] : $default_value;
234
+ }
235
+ }
236
+ }
237
+
238
+ //run functions on values
239
+
240
+ if ( $this->functions && array_values( $this->functions ) ) {
241
+ foreach ( $this->functions as $field_key => $function ) {
242
+ $api_key = $tags_map[ $field_key ];
243
+ $field_value = $record['fields'][ $api_key ];
244
+
245
+ if ( $function && $field_value ) {
246
+ $record['fields'][ $api_key ] = $this->run_function( $function, $field_value );
247
+ }
248
+ }
249
+ }
250
+
251
+ return $record;
252
+ }
253
+
254
+ /**
255
+ * Run custom functions on user submission
256
+ *
257
+ * @param $function
258
+ * @param $field_value
259
+ */
260
+ public function run_function( $function, $field_value ) {
261
+
262
+ $function = WPCF7r_Utils::get_available_text_functions( $function, 'all' );
263
+
264
+ if ( $function ) {
265
+ $class = $function[0];
266
+ $method = $function[1];
267
+
268
+ return call_user_func( array( $class, $method ), $field_value );
269
+ }
270
+
271
+ return $field_value;
272
+ }
273
+
274
+ /**
275
+ * Send the lead using wp_remote
276
+ *
277
+ * @param $record
278
+ * @param boolean $debug
279
+ * @param string $method
280
+ * @param string $record_type
281
+ */
282
+ private function send_lead( $record, $debug = false, $method = 'GET', $record_type = 'params' ) {
283
+
284
+ global $wp_version;
285
+
286
+ $lead = $record['fields'];
287
+ $url = $record['url'];
288
+
289
+ if ( ( 'get' === $method || 'GET' === $method ) && ( 'params' === $record_type || 'json' === $record_type ) ) {
290
+ $args = array(
291
+ 'timeout' => 100,
292
+ 'redirection' => 5,
293
+ 'httpversion' => '1.0',
294
+ 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url(),
295
+ 'blocking' => true,
296
+ 'headers' => $this->headers,
297
+ 'cookies' => array(),
298
+ 'body' => null,
299
+ 'compress' => false,
300
+ 'decompress' => true,
301
+ 'sslverify' => true,
302
+ 'stream' => false,
303
+ 'filename' => null,
304
+ );
305
+
306
+ if ( 'xml' === $record_type ) {
307
+ $xml = $this->get_xml( $lead );
308
+ if ( is_wp_error( $xml ) ) {
309
+ return $xml;
310
+ }
311
+
312
+ $args['body'] = $xml->asXML();
313
+ } elseif ( 'json' === $record_type ) {
314
+ $json = wp_json_encode( $lead );
315
+ if ( is_wp_error( $json ) ) {
316
+ return $json;
317
+ } else {
318
+ $args['body'] = $json;
319
+ }
320
+ } else {
321
+ $lead_string = http_build_query( $lead );
322
+ $url = strpos( '?', $url ) ? $url . '&' . $lead_string : $url . '?' . $lead_string;
323
+ }
324
+
325
+ $args = apply_filters( 'qs_cf7_api_get_args', $args );
326
+ $url = apply_filters( 'qs_cf7_api_get_url', $url, $record );
327
+ $url = $this->replace_tags( $url );
328
+
329
+ $result = wp_remote_get( $url, $args );
330
+ } else {
331
+ $args = array(
332
+ 'timeout' => 100,
333
+ 'redirection' => 5,
334
+ 'method' => strtoupper( $method ),
335
+ 'httpversion' => '1.0',
336
+ 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url(),
337
+ 'blocking' => true,
338
+ 'headers' => $this->headers,
339
+ 'cookies' => array(),
340
+ 'body' => $lead,
341
+ 'compress' => false,
342
+ 'decompress' => true,
343
+ 'sslverify' => true,
344
+ 'stream' => false,
345
+ 'filename' => null,
346
+ );
347
+
348
+ if ( 'xml' === $record_type ) {
349
+ $xml = $this->get_xml( $lead );
350
+
351
+ if ( is_wp_error( $xml ) ) {
352
+ return $xml;
353
+ }
354
+
355
+ $args['body'] = $xml->asXML();
356
+ } elseif ( 'json' === $record_type ) {
357
+ $json = wp_json_encode( json_decode( $lead ) );
358
+ if ( is_wp_error( $json ) ) {
359
+ return $json;
360
+ } else {
361
+ $args['body'] = $json;
362
+ }
363
+ }
364
+
365
+ $args = apply_filters( 'qs_cf7_api_get_args', $args );
366
+ $url = apply_filters( 'qs_cf7_api_post_url', $url );
367
+ $url = $this->replace_tags( $url );
368
+
369
+ $result = wp_remote_request( $url, $args );
370
+ }
371
+
372
+ $this->log_result( $args, $result );
373
+
374
+ do_action( 'after_qs_cf7_api_send_lead', $result, $record, $args );
375
+
376
+ if ( ! is_wp_error( $result ) ) {
377
+ $results['response_raw'] = $result;
378
+ $results['response'] = wp_remote_retrieve_body( $result );
379
+ }
380
+
381
+ return $result;
382
+ }
383
+
384
+ /**
385
+ * Get XML
386
+ *
387
+ * @param $lead
388
+ */
389
+ private function get_xml( $lead ) {
390
+
391
+ $xml = '';
392
+
393
+ if ( function_exists( 'simplexml_load_string' ) ) {
394
+ libxml_use_internal_errors( true );
395
+ $xml = simplexml_load_string( $lead );
396
+
397
+ if ( false === $xml ) {
398
+ $xml = new WP_Error(
399
+ 'xml',
400
+ __( 'XML Structure is incorrect', 'wpcf7-redirect' )
401
+ );
402
+
403
+ }
404
+ }
405
+
406
+ return $xml;
407
+ }
408
+ }
409
+
classes/actions/class-wpcf7r-action-sendmail.php ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Action_SendMail file - handles send mail action
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ register_wpcf7r_actions(
9
+ 'SendMail',
10
+ __( 'Send Email', 'wpcf7-redirect' ),
11
+ 'WPCF7R_Action_SendMail',
12
+ 4
13
+ );
14
+
15
+ class WPCF7R_Action_SendMail extends WPCF7R_Action {
16
+ public function __construct( $post ) {
17
+ parent::__construct( $post );
18
+ }
19
+ /**
20
+ * Get the fields relevant for this action
21
+ */
22
+ public function get_action_fields() {
23
+ $parent_fields = parent::get_default_fields();
24
+
25
+ unset( $parent_fields['action_status'] );
26
+
27
+ $fields = array_merge(
28
+ array(
29
+ 'send_to_emails_values' => array(
30
+ 'name' => 'send_to_emails_values',
31
+ 'type' => 'text',
32
+ 'label' => __( 'To:', 'wpcf7-redirect' ),
33
+ 'placeholder' => __( 'Email addresses seperated by comma (,)', 'wpcf7-redirect' ),
34
+ 'value' => $this->get( 'send_to_emails_values' ),
35
+ ),
36
+ 'email_sender' => array(
37
+ 'name' => 'email_sender',
38
+ 'type' => 'text',
39
+ 'label' => __( 'From:', 'wpcf7-redirect' ),
40
+ 'placeholder' => __( 'name <address>', 'wpcf7-redirect' ),
41
+ 'value' => $this->get( 'email_sender' ),
42
+ ),
43
+ 'email_subject' => array(
44
+ 'name' => 'email_subject',
45
+ 'type' => 'text',
46
+ 'label' => __( 'Subject:', 'wpcf7-redirect' ),
47
+ 'placeholder' => __( '', 'wpcf7-redirect' ),
48
+ 'value' => $this->get( 'email_subject' ),
49
+ ),
50
+ 'email_format' => array(
51
+ 'name' => 'email_format',
52
+ 'type' => 'textarea',
53
+ 'label' => __( 'Email Format (use the same structure used on Contact Form 7)', 'wpcf7-redirect' ),
54
+ 'footer' => $this->get_formatted_mail_tags(),
55
+ 'placeholder' => __( '', 'wpcf7-redirect' ),
56
+ 'value' => $this->get( 'email_format' ),
57
+ ),
58
+ 'action_status' => array(
59
+ 'name' => 'action_status',
60
+ 'type' => 'checkbox',
61
+ 'label' => $this->get_action_status_label(),
62
+ 'sub_title' => __( 'if this is off the rule will not be applied', 'wpcf7-redirect' ),
63
+ 'placeholder' => '',
64
+ 'show_selector' => '.field-wrap-disable_default_email',
65
+ 'toggle-label' => json_encode(
66
+ array(
67
+ '.field-wrap-action_status .checkbox-label,.column-status a' => array(
68
+ __( 'Enabled', 'wpcf7-redirect' ),
69
+ __( 'Disabled', 'wpcf7-redirect' ),
70
+ ),
71
+ )
72
+ ),
73
+ 'value' => $this->get( 'action_status' ),
74
+ ),
75
+ 'disable_default_email' => array(
76
+ 'name' => 'disable_default_email',
77
+ 'type' => 'notice',
78
+ 'label' => '<strong>' . __( 'Notice!', 'wpcf7-redirect' ) . '</strong>',
79
+ 'sub_title' => __( 'When email action is enabled the default Contact Form 7 mailing feature will be disabled.', 'wpcf7-redirect' ),
80
+ 'placeholder' => '',
81
+ 'class' => $this->get( 'action_status' ) ? 'field-notice-alert' : 'field-hidden field-notice-alert',
82
+ 'show_selector' => '',
83
+ ),
84
+ ),
85
+ $parent_fields
86
+ );
87
+ return $fields;
88
+ }
89
+
90
+ /**
91
+ * Get settings page
92
+ */
93
+ public function get_action_settings() {
94
+ $this->get_settings_template( 'html-action-send-to-email.php' );
95
+ }
96
+
97
+ /**
98
+ * Handle a simple redirect rule
99
+ *
100
+ * @param $rules
101
+ * @param $response
102
+ */
103
+ public function process( $submission ) {
104
+ $response = array();
105
+ $email_to = $this->get( 'send_to_emails_values' );
106
+ $email_sender = $this->get( 'email_sender' );
107
+ $email_format = $this->get( 'email_format' );
108
+ $email_subject = $this->get( 'email_subject' );
109
+
110
+ // set the email address to recipient
111
+ $mail_settings = $this->cf7r_form->cf7_post->get_properties( 'mail' );
112
+ if ( $email_to ) {
113
+ $mail_settings['mail']['recipient'] = $email_to;
114
+ }
115
+ if ( $email_sender ) {
116
+ $mail_settings['mail']['sender'] = $email_sender;
117
+ }
118
+ if ( $email_format ) {
119
+ $mail_settings['mail']['body'] = $email_format;
120
+ }
121
+ if ( $email_subject ) {
122
+ $mail_settings['mail']['subject'] = $email_subject;
123
+ }
124
+ $result = $this->send_mail( $mail_settings['mail'] );
125
+
126
+ return $result;
127
+ }
128
+
129
+ /**
130
+ * Use contact form 7 function to send the email
131
+ *
132
+ * @param $mail
133
+ */
134
+ public function send_mail( $mail ) {
135
+ $result = WPCF7_Mail::send( $mail, 'mail' );
136
+ return $result;
137
+ }
138
+ }
classes/actions/html/html-action-redirect.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * HTML action redirect
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ /**
9
+ * HTML itterator to display redirect actions fields.
10
+ */
11
+ foreach ( $this->get_action_fields() as $field ) {
12
+ $this->render_field( $field, $prefix );
13
+ }
classes/actions/html/html-action-send-to-email.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * html-action-send-to-email file.
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ /**
9
+ * Send to mail action html fields
10
+ */
11
+ foreach ( $this->get_action_fields() as $field ) {
12
+ $this->render_field( $field, $prefix );
13
+ }
classes/actions/html/html-page-settings.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * HTML action-send-to-email file.
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <section class="page-settings">
10
+
11
+ <?php
12
+ // Send to mail action html fields
13
+ foreach ( $this->get_action_fields() as $field ) {
14
+ $this->render_field( $field, $prefix );
15
+ }
16
+ ?>
17
+
18
+ </section>
19
+
classes/actions/html/index.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
classes/actions/html/rule-title.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * rule-title.php file.
4
+ *
5
+ * @package cf7r
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit;
10
+ }
11
+
12
+ /**
13
+ * Display the block title
14
+ *
15
+ * @version 1.0.0
16
+ */
17
+ ?>
18
+ <div class="field-wrap field-wrap-post-title">
19
+ <label for="wpcf7-redirect-post-title">
20
+ <strong><?php esc_html_e( 'Rule Title', 'wpcf7-redirect' );?></strong>
21
+ </label>
22
+ <input type="text" class="wpcf7-redirect-post-title-fields" placeholder="<?php esc_html_e( 'Rule title', 'wpcf7-redirect' );?>" name="wpcf7-redirect<?php echo $prefix;?>[post_title]" value="<?php echo $this->get_title();?>">
23
+ </div>
classes/actions/index.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
classes/aff/class-ext-accessibe.php ADDED
@@ -0,0 +1,627 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Accesibe Extension Class
4
+ *
5
+ * @category Ext_Accessibe
6
+ * @package Ext_Accessibe
7
+ * @author Author <info@querysol.com>
8
+ * @license https://opensource.org/licenses/MIT MIT License
9
+ * @link http://querysol.com/
10
+ */
11
+ class Ext_Accessibe extends WPCF7R_Action {
12
+ public $ver = '1.0';
13
+ private $api_url = ACCESSIBE_API_URI;
14
+ private $ext_name = 'accessibe';
15
+
16
+ /**
17
+ * Class constructor
18
+ */
19
+ public function __construct() {
20
+ if ( isset( $_GET['scan'] ) ) {
21
+ $this->reset_scan_results();
22
+ }
23
+ if ( is_admin() ) {
24
+ $this->admin_init();
25
+ }
26
+ }
27
+
28
+ /**
29
+ * Get the extension name
30
+ */
31
+ public function get_name() {
32
+ $name = $this->ext_name;
33
+ return $name;
34
+ }
35
+
36
+ /**
37
+ * Get the option key that will store the widget settings
38
+ */
39
+ public function get_widget_option_key() {
40
+ $key = 'accesibe_widget_options';
41
+ if ( defined( 'ICL_LANGUAGE_CODE' ) ) {
42
+ $key .= '_' . ICL_LANGUAGE_CODE;
43
+ }
44
+ return $key;
45
+ }
46
+
47
+ /**
48
+ * Initiate admin scripts
49
+ */
50
+ public function admin_init() {
51
+ if ( isset( $_GET['page'] ) && qs_get_plugin_display_name() === $_GET['page'] ) {
52
+ $response = $this->acctivate_acccesbe_menu();
53
+ }
54
+ if ( isset( $_REQUEST['start-free-trial'] ) && qs_get_plugin_display_name() === $_REQUEST['start-free-trial'] ) {
55
+ $response = $this->mark_scan_completed();
56
+ }
57
+ if ( isset( $_POST['activate-accesibe'] ) && $_POST['activate-accesibe'] ) {
58
+ $response = $this->activate();
59
+ if ( is_wp_error( $response ) ) {
60
+ WPCF7r_Utils::add_admin_notice( 'alert', $response->get_error_message() );
61
+ } else {
62
+ WPCF7r_Utils::add_admin_notice( 'notice', __( 'Successfully activated' ) );
63
+ }
64
+ }
65
+ if ( isset( $_GET['deactivate'] ) && qs_get_plugin_display_name() === $_GET['deactivate'] ) {
66
+ $this->deactivate();
67
+ }
68
+ if ( isset( $_REQUEST['save_ext_settings'] ) && qs_get_plugin_display_name() === $_REQUEST['save_ext_settings'] ) {
69
+ $this->save();
70
+ }
71
+ $this->init();
72
+ }
73
+
74
+ /**
75
+ * Save widget settings
76
+ */
77
+ private function save() {
78
+ $name = $this->get_name();
79
+ $key = $this->get_widget_option_key();
80
+ if ( isset( $_REQUEST['wpcf7-redirect'][ $key ][ $name ] ) && $_REQUEST['wpcf7-redirect'][ $key ][ $name ] ) {
81
+ $data = $_REQUEST['wpcf7-redirect'][ $key ][ $name ];
82
+ update_option( $key, $data );
83
+ } elseif ( isset( $_REQUEST['save_ext_settings'] ) ) {
84
+ update_option( $key, array() );
85
+ }
86
+ $this->init();
87
+ }
88
+
89
+ /**
90
+ * Get this extension settings page url
91
+ */
92
+ public function get_settings_url() {
93
+ return admin_url( '/admin.php?page=' . qs_get_plugin_display_name() );
94
+ }
95
+
96
+ /**
97
+ * The link will reset the scan data to allow a new scan to process
98
+ */
99
+ public function get_scan_link() {
100
+ $url = $this->get_settings_url();
101
+ $url = add_query_arg(
102
+ array(
103
+ 'scan' => true,
104
+ )
105
+ );
106
+ return $url;
107
+ }
108
+
109
+ /**
110
+ * Check if scan was commited and saved
111
+ */
112
+ public function get_scan_results() {
113
+ return get_option( 'accesibe_scan_results' );
114
+ }
115
+
116
+ /**
117
+ * Get the widget settings
118
+ */
119
+ public function get_widget_settings() {
120
+ $key = $this->get_widget_option_key();
121
+ return get_option( $key );
122
+ }
123
+
124
+ /**
125
+ * Check if the plugin is active
126
+ */
127
+ public function is_active() {
128
+ $settings = $this->get_settings();
129
+ return $settings ? true : false;
130
+ }
131
+
132
+ /**
133
+ * Check if the current screen is a registration form
134
+ * @return boolean
135
+ */
136
+ public function is_registration_form() {
137
+ return ! $this->is_scan() && ! $this->is_active();
138
+ }
139
+
140
+ /**
141
+ * Check if the plugin is active
142
+ *
143
+ * @return boolean
144
+ */
145
+ public function is_scan() {
146
+ $results = $this->get_scan_results();
147
+ return $results ? false : true;
148
+ }
149
+
150
+ /**
151
+ * Set a flag that a scan was completed
152
+ */
153
+ public function mark_scan_completed() {
154
+ update_option( 'accesibe_scan_results', true );
155
+ }
156
+
157
+ /**
158
+ * Allow the user to rescan the website
159
+ */
160
+ public function reset_scan_results() {
161
+ delete_option( 'accesibe_scan_results' );
162
+ }
163
+
164
+ /**
165
+ * Init extension
166
+ */
167
+ public function init() {
168
+ if ( ! get_option( 'hide_accessibie_menu' ) && get_option( 'show_accessibie_menu' ) ) {
169
+ add_action( 'admin_menu', array( $this, 'accessibie_menu' ) );
170
+ }
171
+ $this->accesibe_widget_options = $this->get_widget_settings();
172
+ }
173
+
174
+ /**
175
+ * Deactivate the extension
176
+ */
177
+ public function deactivate() {
178
+ delete_option( 'show_accessibie_menu' );
179
+ delete_option( 'accesibe_options' );
180
+ delete_option( 'accesibe_scan_results' );
181
+ update_option( 'hide_accessibie_menu', true );
182
+ }
183
+
184
+ /**
185
+ * Get the value of a specific field
186
+ */
187
+ public function get_field_value( $field ) {
188
+ if ( $this->accesibe_widget_options ) {
189
+ return isset( $this->accesibe_widget_options[ $field ] ) ? $this->accesibe_widget_options[ $field ] : '';
190
+ }
191
+ }
192
+
193
+ /**
194
+ * Get the template to display on the admin field
195
+ *
196
+ * @param $template
197
+ */
198
+ public function get_settings_template( $template ) {
199
+ $name = $this->get_name();
200
+ $prefix = "[accesibe_widget_options][{$name}]";
201
+ include WPCF7_PRO_REDIRECT_ACTIONS_TEMPLATE_PATH . $template;
202
+ }
203
+
204
+ /**
205
+ * General function to retrieve meta
206
+ *
207
+ * @param $key
208
+ */
209
+ public function get( $key ) {
210
+ return isset( $this->accesibe_widget_options[ $key ] ) ? $this->accesibe_widget_options[ $key ] : '';
211
+ }
212
+
213
+ /**
214
+ * Get the accessibe settings form
215
+ */
216
+ public function get_settings_form() {
217
+ $this->get_settings_template( 'html-page-settings.php' );
218
+ }
219
+
220
+ /**
221
+ * Display settings fields for active users
222
+ */
223
+ public function get_accesibe_settings() {
224
+ $this->html = new WPCF7R_html( '' );
225
+ include( WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'settings.php' );
226
+ }
227
+
228
+ /**
229
+ * Get the fields relevant for this action
230
+ */
231
+ public function get_action_fields() {
232
+ return
233
+ array(
234
+ array(
235
+ 'name' => 'hideMobile',
236
+ 'type' => 'checkbox',
237
+ 'label' => __( 'Hide On Mobile', 'wpcf7-redirect' ),
238
+ 'sub_title' => '',
239
+ 'placeholder' => '',
240
+ 'value' => $this->get( 'hideMobile' ),
241
+ ),
242
+ array(
243
+ 'name' => 'hideTrigger',
244
+ 'type' => 'checkbox',
245
+ 'label' => __( 'Hide Trigger', 'wpcf7-redirect' ),
246
+ 'sub_title' => '',
247
+ 'placeholder' => '',
248
+ 'value' => $this->get( 'hideTrigger' ),
249
+ ),
250
+ array(
251
+ 'name' => 'leadColor',
252
+ 'type' => 'text',
253
+ 'input_class' => 'colorpicker',
254
+ 'label' => __( 'Main Color', 'wpcf7-redirect' ),
255
+ 'class' => 'qs-col qs-col-6',
256
+ 'sub_title' => '',
257
+ 'placeholder' => '',
258
+ 'value' => $this->get( 'leadColor' ) ? $this->get( 'leadColor' ) : '#146FF8',
259
+ ),
260
+ array(
261
+ 'name' => 'triggerColor',
262
+ 'type' => 'text',
263
+ 'input_class' => 'colorpicker',
264
+ 'label' => __( 'Trigger Color', 'wpcf7-redirect' ),
265
+ 'class' => 'qs-col qs-col-6',
266
+ 'sub_title' => '',
267
+ 'placeholder' => '',
268
+ 'value' => $this->get( 'triggerColor' ) ? $this->get( 'triggerColor' ) : '#146FF8',
269
+ ),
270
+ array(
271
+ 'name' => 'triggerIcon',
272
+ 'type' => 'media',
273
+ 'label' => __( 'Trigger Icon', 'wpcf7-redirect' ),
274
+ 'class' => '',
275
+ 'sub_title' => '',
276
+ 'placeholder' => '',
277
+ 'value' => $this->get( 'triggerIcon' ) ? $this->get( 'triggerIcon' ) : 'default',
278
+ ),
279
+ array(
280
+ 'name' => 'triggerSize',
281
+ 'type' => 'select',
282
+ 'label' => __( 'Trigger Size', 'wpcf7-redirect' ),
283
+ 'class' => '',
284
+ 'sub_title' => '',
285
+ 'placeholder' => '',
286
+ 'options' => array(
287
+ 'small' => __( 'Small' ),
288
+ 'medium' => __( 'Medium' ),
289
+ 'large' => __( 'Large' ),
290
+ ),
291
+ 'value' => $this->get( 'triggerSize' ) ? $this->get( 'triggerSize' ) : 'medium',
292
+ ),
293
+ array(
294
+ 'name' => 'statementLink',
295
+ 'type' => 'url',
296
+ 'label' => __( 'Link To Statment', 'wpcf7-redirect' ),
297
+ 'sub_title' => '',
298
+ 'placeholder' => '',
299
+ 'value' => $this->get( 'statementLink' ),
300
+ ),
301
+ array(
302
+ 'name' => 'feedbackLink',
303
+ 'type' => 'url',
304
+ 'label' => __( 'Link To Feedback', 'wpcf7-redirect' ),
305
+ 'sub_title' => '',
306
+ 'placeholder' => '',
307
+ 'value' => $this->get( 'feedbackLink' ),
308
+ ),
309
+ array(
310
+ 'name' => 'language',
311
+ 'type' => 'select',
312
+ 'label' => __( 'Widget Language', 'wpcf7-redirect' ),
313
+ 'class' => 'select2-field',
314
+ 'sub_title' => '',
315
+ 'placeholder' => '',
316
+ 'options' => $this->get_available_languages(),
317
+ 'value' => $this->get( 'language' ),
318
+ ),
319
+ array(
320
+ 'name' => 'position',
321
+ 'type' => 'select',
322
+ 'label' => __( 'Widget Position', 'wpcf7-redirect' ),
323
+ 'class' => '',
324
+ 'options' => array(
325
+ 'right' => __( 'Right' ),
326
+ 'left' => __( 'Left' ),
327
+ ),
328
+ 'sub_title' => '',
329
+ 'placeholder' => '',
330
+ 'value' => $this->get( 'position' ),
331
+ ),
332
+ array(
333
+ 'name' => 'triggerRadius',
334
+ 'type' => 'number',
335
+ 'label' => __( 'Trigger Border Radius (%)', 'wpcf7-redirect' ),
336
+ 'class' => '',
337
+ 'sub_title' => '',
338
+ 'placeholder' => '',
339
+ 'value' => $this->get( 'triggerRadius' ) ? $this->get( 'triggerRadius' ) : '50%',
340
+ ),
341
+ array(
342
+ 'name' => 'triggerPositionX',
343
+ 'type' => 'select',
344
+ 'label' => __( 'Trigger Position (X)', 'wpcf7-redirect' ),
345
+ 'class' => '',
346
+ 'sub_title' => '',
347
+ 'placeholder' => '',
348
+ 'options' => array(
349
+ 'right' => __( 'Right' ),
350
+ 'left' => __( 'Left' ),
351
+ ),
352
+ 'value' => $this->get( 'triggerPositionX' ) ? $this->get( 'triggerPositionX' ) : 'left',
353
+ ),
354
+ array(
355
+ 'name' => 'triggerOffsetX',
356
+ 'type' => 'number',
357
+ 'label' => __( 'Trigger Offset X (Pixels)', 'wpcf7-redirect' ),
358
+ 'class' => '',
359
+ 'sub_title' => '',
360
+ 'placeholder' => '',
361
+ 'value' => $this->get( 'triggerOffsetX' ) ? $this->get( 'triggerOffsetX' ) : 0,
362
+ ),
363
+ array(
364
+ 'name' => 'triggerPositionY',
365
+ 'type' => 'select',
366
+ 'label' => __( 'Trigger Position (X)', 'wpcf7-redirect' ),
367
+ 'class' => '',
368
+ 'sub_title' => '',
369
+ 'placeholder' => '',
370
+ 'options' => array(
371
+ 'top' => __( 'Top' ),
372
+ 'bottom' => __( 'Bottom' ),
373
+ ),
374
+ 'value' => $this->get( 'triggerPositionY' ) ? $this->get( 'triggerPositionY' ) : 'bottom',
375
+ ),
376
+ array(
377
+ 'name' => 'triggerOffsetY',
378
+ 'type' => 'number',
379
+ 'label' => __( 'Trigger Offset Y (Pixels)', 'wpcf7-redirect' ),
380
+ 'class' => '',
381
+ 'sub_title' => '',
382
+ 'placeholder' => '',
383
+ 'value' => $this->get( 'triggerOffsetY' ) ? $this->get( 'triggerOffsetY' ) : 0,
384
+ ),
385
+ array(
386
+ 'name' => 'triggerSizeMobile',
387
+ 'type' => 'select',
388
+ 'label' => __( 'Trigger Size Mobile', 'wpcf7-redirect' ),
389
+ 'class' => '',
390
+ 'sub_title' => '',
391
+ 'placeholder' => '',
392
+ 'options' => array(
393
+ 'small' => __( 'Small' ),
394
+ 'medium' => __( 'Medium' ),
395
+ 'large' => __( 'Large' ),
396
+ ),
397
+ 'value' => $this->get( 'triggerSizeMobile' ) ? $this->get( 'triggerSizeMobile' ) : 'medium',
398
+ ),
399
+ array(
400
+ 'name' => 'triggerPositionXMobile',
401
+ 'type' => 'select',
402
+ 'label' => __( 'Trigger Position (X) Mobile', 'wpcf7-redirect' ),
403
+ 'class' => '',
404
+ 'sub_title' => '',
405
+ 'placeholder' => '',
406
+ 'options' => array(
407
+ 'right' => __( 'Right' ),
408
+ 'left' => __( 'Left' ),
409
+ ),
410
+ 'value' => $this->get( 'triggerPositionXMobile' ) ? $this->get( 'triggerPositionXMobile' ) : 'left',
411
+ ),
412
+ array(
413
+ 'name' => 'triggerOffsetXMobile',
414
+ 'type' => 'number',
415
+ 'label' => __( 'Trigger Offset X (Pixels) Mobile', 'wpcf7-redirect' ),
416
+ 'class' => '',
417
+ 'sub_title' => '',
418
+ 'placeholder' => '',
419
+ 'value' => $this->get( 'triggerOffsetXMobile' ) ? $this->get( 'triggerOffsetXMobile' ) : 0,
420
+ ),
421
+ array(
422
+ 'name' => 'triggerPositionYMobile',
423
+ 'type' => 'select',
424
+ 'label' => __( 'Trigger Position (X) Mobile', 'wpcf7-redirect' ),
425
+ 'class' => '',
426
+ 'sub_title' => '',
427
+ 'placeholder' => '',
428
+ 'options' => array(
429
+ 'top' => __( 'Top' ),
430
+ 'bottom' => __( 'Bottom' ),
431
+ ),
432
+ 'value' => $this->get( 'triggerPositionYMobile' ) ? $this->get( 'triggerPositionYMobile' ) : 'bottom',
433
+ ),
434
+ array(
435
+ 'name' => 'triggerOffsetYMobile',
436
+ 'type' => 'number',
437
+ 'label' => __( 'Trigger Offset Y (Pixels)', 'wpcf7-redirect' ),
438
+ 'class' => '',
439
+ 'sub_title' => '',
440
+ 'placeholder' => '',
441
+ 'value' => $this->get( 'triggerOffsetYMobile' ) ? $this->get( 'triggerOffsetYMobile' ) : 0,
442
+ ),
443
+ array(
444
+ 'name' => 'triggerRadiusMobile',
445
+ 'type' => 'number',
446
+ 'label' => __( 'Trigger Border Radius (%) Mobile', 'wpcf7-redirect' ),
447
+ 'class' => '',
448
+ 'sub_title' => '',
449
+ 'placeholder' => '',
450
+ 'value' => $this->get( 'triggerRadiusMobile' ) ? $this->get( 'triggerRadiusMobile' ) : '50%',
451
+ ),
452
+ array(
453
+ 'name' => 'footerHtml',
454
+ 'type' => 'editor',
455
+ 'label' => __( 'Footer Html', 'wpcf7-redirect' ),
456
+ 'sub_title' => '',
457
+ 'placeholder' => '',
458
+ 'value' => $this->get( 'footerHtml' ),
459
+ ),
460
+ );
461
+ }
462
+
463
+ /**
464
+ * Get a list of available widget languages
465
+ */
466
+ public function get_available_languages() {
467
+ return wpcf7_get_languages_list();
468
+ }
469
+
470
+ /**
471
+ * Display accesibe menu
472
+ */
473
+ public function acctivate_acccesbe_menu() {
474
+ update_option( 'show_accessibie_menu', true );
475
+ delete_option( 'hide_accessibie_menu' );
476
+ }
477
+
478
+ /**
479
+ * Activate the extension
480
+ */
481
+ public function activate() {
482
+ $args = array(
483
+ 'email' => sanitize_email( $_POST['email'] ),
484
+ 'name' => sanitize_text_field( $_POST['fullname'] ),
485
+ 'password' => sanitize_text_field( $_POST['password'] ),
486
+ 'domain' => str_replace( array( 'http://', 'https://' ), '', home_url() ),
487
+ 'ip_address' => $_SERVER['SERVER_ADDR'],
488
+ 'contactCountry' => isset( $_POST['user-country'] ) ? sanitize_text_field( $_POST['user-country'] ) : '',
489
+ 'contactPhone' => isset( $_POST['phone-number'] ) ? sanitize_text_field( $_POST['phone-number'] ) : '',
490
+ );
491
+ $post_args = array(
492
+ 'method' => 'POST',
493
+ 'timeout' => 45,
494
+ 'redirection' => 5,
495
+ 'httpversion' => '1.0',
496
+ 'sslverify' => false,
497
+ 'headers' => array(
498
+ 'Content-Type' => 'application/json',
499
+ ),
500
+ 'body' => wp_json_encode( $args ),
501
+ 'cookies' => array(),
502
+ );
503
+ $response = wp_remote_post( $this->api_url, $post_args );
504
+
505
+ if ( ! is_wp_error( $response ) ) {
506
+ $response = wp_remote_retrieve_body( $response );
507
+ $response = (object) json_decode( $response, true );
508
+ if ( 1 === $response->status ) {
509
+ $options_args = array(
510
+ 'accessibe_plugin_active' => $this->ver,
511
+ 'accessibe_plugin_domain' => $args['domain'],
512
+ 'accessibe_plugin_dativation_date' => current_time( 'Ymd' ),
513
+ );
514
+ update_option( 'accesibe_options', $options_args );
515
+ } else {
516
+ $options_args = array(
517
+ 'accessibe_plugin_active' => $this->ver,
518
+ 'accessibe_plugin_domain' => $args['domain'],
519
+ 'accessibe_plugin_dativation_date' => current_time( 'Ymd' ),
520
+ );
521
+ update_option( 'accesibe_options', $options_args );
522
+ $response = new WP_Error( 'activate', __( 'This Domain Is Already Registered' ) );
523
+ }
524
+ }
525
+ return $response;
526
+ }
527
+
528
+ /**
529
+ * Get accesibe options
530
+ */
531
+ public function get_settings() {
532
+ return get_option( 'accesibe_options' );
533
+ }
534
+
535
+ /**
536
+ * Create Accesibie Menu
537
+ */
538
+ public function accessibie_menu() {
539
+ // Add the menu item and page!
540
+ $page_title = qs_get_plugin_display_name();
541
+ $capability = 'manage_options';
542
+ $callback = array( $this, 'accesibie_settings_page_content' );
543
+ $icon = WPCF7_PRO_REDIRECT_BUILD_PATH . '/images/accesibie-logo.png';
544
+ add_menu_page(
545
+ $page_title,
546
+ $page_title,
547
+ $capability,
548
+ $page_title,
549
+ $callback,
550
+ $icon
551
+ );
552
+ }
553
+
554
+ /**
555
+ * Extension page Content
556
+ */
557
+ public function accesibie_settings_page_content() {
558
+ do_action( 'before_settings_fields' );
559
+ ?>
560
+
561
+ <div class="wrap wrap-accesibe">
562
+ <div class="postbox">
563
+ <div class="padbox">
564
+ <div class="content">
565
+ <?php include 'templates/accesibie-content.php'; ?>
566
+ </div>
567
+ </div>
568
+ </div>
569
+ </div>
570
+ <?php
571
+ }
572
+
573
+ /**
574
+ * Echo the script in the footer
575
+ */
576
+ public function footer_script() {
577
+ $params = array(
578
+ 'statementLink' => $this->get( 'statementLink' ),
579
+ 'feedbackLink' => $this->get( 'feedbackLink' ),
580
+ 'footerHtml' => $this->get( 'footerHtml' ),
581
+ 'hideMobile' => $this->get( 'hideMobile' ),
582
+ 'hideTrigger' => $this->get( 'hideTrigger' ),
583
+ 'language' => $this->get( 'language' ) ? $this->get( 'language' ) : 'en',
584
+ 'position' => $this->get( 'position' ) ? $this->get( 'position' ) : 'right',
585
+ 'leadColor' => $this->get( 'leadColor' ) ? $this->get( 'leadColor' ) : '#146FF8',
586
+ 'triggerColor' => $this->get( 'triggerColor' ) ? $this->get( 'triggerColor' ) : '#146FF8',
587
+ 'triggerRadius' => $this->get( 'triggerRadius' ) ? $this->get( 'triggerRadius' ) : '50%',
588
+ 'triggerPositionX' => $this->get( 'triggerPositionX' ) ? $this->get( 'triggerPositionX' ) : 'right',
589
+ 'triggerPositionY' => $this->get( 'triggerPositionY' ) ? $this->get( 'triggerPositionY' ) : 'bottom',
590
+ 'triggerIcon' => $this->get( 'triggerIcon' ) ? $this->get( 'triggerIcon' ) : 'default',
591
+ 'triggerSize' => $this->get( 'triggerSize' ) ? $this->get( 'triggerSize' ) : 'medium',
592
+ 'triggerOffsetX' => $this->get( 'triggerOffsetX' ) ? $this->get( 'triggerOffsetX' ) : 20,
593
+ 'triggerOffsetY' => $this->get( 'triggerOffsetY' ) ? $this->get( 'triggerOffsetY' ) : 20,
594
+ 'mobile' => (object) array(
595
+ 'triggerSize' => $this->get( 'triggerSizeMobile' ) ? $this->get( 'triggerSizeMobile' ) : 'small',
596
+ 'triggerPositionX' => $this->get( 'triggerPositionXMobile' ) ? $this->get( 'triggerPositionXMobile' ) : 'right',
597
+ 'triggerPositionY' => $this->get( 'triggerPositionYMobile' ) ? $this->get( 'triggerPositionYMobile' ) : 'center',
598
+ 'triggerOffsetX' => $this->get( 'triggerOffsetXMobile' ) ? $this->get( 'triggerOffsetXMobile' ) : 0,
599
+ 'triggerOffsetY' => $this->get( 'triggerOffsetYMobile' ) ? $this->get( 'triggerOffsetYMobile' ) : 0,
600
+ 'triggerRadius' => $this->get( 'triggerRadiusMobile' ) ? $this->get( 'triggerRadiusMobile' ) : '50%',
601
+ ),
602
+ );
603
+ $options = json_encode( $params, JSON_UNESCAPED_UNICODE );
604
+ ?>
605
+ <script>(function(){var s = document.createElement('script'),e = ! document.body ? document.querySelector('head') : document.body;s.src = 'https://acsbapp.com/apps/app/assets/js/acsb.js';s.async = s.defer = true;s.onload = function(){acsbJS.init(<?php echo $options; ?>);};e.appendChild(s);}());</script>
606
+ <?php
607
+ }
608
+
609
+ /**
610
+ * Enqueue script if the plugin is active
611
+ */
612
+ public static function enqueue_script() {
613
+ if ( ! is_admin() ) {
614
+ $instance = new self();
615
+ $instance->init();
616
+ if ( $instance->is_active() ) {
617
+ add_action( 'wp_footer', array( $instance, 'footer_script' ) );
618
+ }
619
+ }
620
+ }
621
+ }
622
+
623
+ function qs_get_plugin_display_name() {
624
+ return apply_filters( 'qs_get_plugin_display_name', 'Accessibility' );
625
+ }
626
+
627
+ Ext_Accessibe::enqueue_script();
classes/aff/templates/accesibie-content.php ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php defined( 'ABSPATH' ) || exit; ?>
2
+
3
+ <?php $user = wp_get_current_user(); ?>
4
+
5
+ <section class="home-hero hero-standard hero-standard-full">
6
+ <div class="wrapper flex <?php echo ! $this->is_scan() && ! $this->is_active() ? 'reg-form' : ''; ?> ">
7
+ <?php if ( ! $this->is_registration_form() ) : ?>
8
+ <div class="logo-row flex top-logo">
9
+ <div class="accessibe-logo">
10
+ <img class="hero-cover-image" data-lazyload-ignore="true" src="<?php echo WPCF7_PRO_REDIRECT_BUILD_PATH . 'images/accessibe-full-logo.svg'; ?>" alt="Blind person hero image">
11
+ </div>
12
+ <?php if ( $this->is_scan() ) : ?>
13
+ <form action="<?php echo $this->get_settings_url(); ?>" method="post" class="accesibe-settings-form">
14
+ <button type="submit" class="site-button js-active site-button-animate site-button-right-icon site-button-full" data-element="signup-button">
15
+ <span class="align-middle">
16
+ <?php _e( 'Create a Free Account!', 'wpcf7-redirect' ); ?> <span class="dashicons dashicons-arrow-right-alt2"></span>
17
+ </span>
18
+ </button>
19
+ <input type="hidden" name="start-free-trial" value="<?php echo qs_get_plugin_display_name(); ?>" />
20
+ </form>
21
+ <?php endif; ?>
22
+ </div>
23
+ <?php endif; ?>
24
+ <?php
25
+ if ( $this->is_registration_form() ) :
26
+ ?>
27
+ <div class="main-form-wrap">
28
+ <div class="home-hero-content hero-left">
29
+ <div class="hero-left-inner">
30
+ <h3 class="home-hero-title">The #1 <em>Fully</em> <em>Automated</em> <br> Web Accessibility Solution <br> for ADA &amp; WCAG Compliance</h3>
31
+ <ul class="home-hero-checkmarks">
32
+ <li class="home-hero-checkmark">
33
+ <i class="icon icon-checkmark icon-pack-icomoon ">
34
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
35
+ <title>checkmark</title>
36
+ <path d="M13.5 2l-7.5 7.5-3.5-3.5-2.5 2.5 6 6 10-10z"></path>
37
+ </svg>
38
+ </i>
39
+ <strong>Affordable.</strong> $49/month, free trial, no credit card required
40
+ </li>
41
+ <li class="home-hero-checkmark">
42
+ <i class="icon icon-checkmark icon-pack-icomoon ">
43
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
44
+ <title>checkmark</title>
45
+ <path d="M13.5 2l-7.5 7.5-3.5-3.5-2.5 2.5 6 6 10-10z"></path>
46
+ </svg>
47
+ </i>
48
+ <strong>Effortless.</strong> Add a single line of code for 24/7 automated compliance
49
+ </li>
50
+ <li class="home-hero-checkmark">
51
+ <i class="icon icon-checkmark icon-pack-icomoon ">
52
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
53
+ <title>checkmark</title>
54
+ <path d="M13.5 2l-7.5 7.5-3.5-3.5-2.5 2.5 6 6 10-10z"></path>
55
+ </svg>
56
+ </i>
57
+ <strong>Compliant.</strong> Accessibility statement and certificate of performance
58
+ </li>
59
+ </ul>
60
+ </div>
61
+ </div>
62
+ <div class="hero-right">
63
+ <div class="hero-right-inner">
64
+ <div class="accessibe-logo">
65
+ <img class="hero-cover-image" data-lazyload-ignore="true" src="<?php echo WPCF7_PRO_REDIRECT_BUILD_PATH . 'images/accessibe-full-logo.svg'; ?>" alt="Blind person hero image">
66
+ </div>
67
+ <h4>Create A 30-Day Trial Account</h4>
68
+ <form name="accesibe-registration" action="" method="post" class="accesibe-registration-form-fields">
69
+ <div class="home-hero-cta">
70
+ <div class="field-wrap">
71
+ <label for="email"><?php _e( 'Your Email Address', 'wpcf7-redirect' ); ?></label>
72
+ <input type="email" name="email" value="<?php echo get_option( 'admin_email' ); ?>" required placeholder="example@example.com"/>
73
+ </div>
74
+ <div class="field-wrap">
75
+ <label for="fullname"><?php _e( 'Your Full Name', 'wpcf7-redirect' ); ?></label>
76
+ <input type="text" name="fullname" minlength="3" value="<?php echo $user->first_name . ' ' . $user->last_name; ?>" required placeholder="John Smith"/>
77
+ </div>
78
+ <div class="field-wrap">
79
+ <label for="password"><?php _e( 'Your Password', 'wpcf7-redirect' ); ?></label>
80
+ <input type="password" name="password" minlength="8" value="" required placeholder="<?php _e( '8+ Charachters', 'wpcf7-redirect' ); ?>"/>
81
+ </div>
82
+
83
+ <span class="loader-spinner-container spinner-light" data-loader="spinner">
84
+ <span class="loader-spinner"></span></span>
85
+ </button>
86
+ </div>
87
+ <div class="agreement">
88
+ <div class="highlight">
89
+ <input type="checkbox" name="tos" id="tos" checked="" data-activate-on-check="signup-button" required>
90
+ <label for="tos"><?php _e( 'By signing up you agree to our', 'wpcf7-redirect' ); ?> <a href="https://accessibe.com/terms-of-service" target="_blank"><?php _e( 'Terms of Service', 'wpcf7-redirect' ); ?></a></label>
91
+ </div>
92
+ </div>
93
+ <div class="field-wrap">
94
+ <button type="submit" class="site-button js-active site-button-animate site-button-right-icon site-button-full" data-element="signup-button">
95
+ <span class="align-middle">
96
+ <?php _e( 'Create a Free Account!', 'wpcf7-redirect' ); ?> <span class="dashicons dashicons-arrow-right-alt2"></span>
97
+ </span>
98
+ </button>
99
+ </div>
100
+ <input type="hidden" name="activate-accesibe" value="1" />
101
+ <div class="footer-wrap">
102
+ <a class=" align-middle" href="<?php echo admin_url( '?deactivate=' . qs_get_plugin_display_name() ); ?>">
103
+ <?php _e( 'Hide this special offer', 'wpcf7-redirect' ); ?>
104
+ </a>
105
+ <a href="<?php echo $this->get_scan_link(); ?>" class="scan-again"><?php _e( 'Scan my website again.', 'wpcf7-redirect' ); ?></a>
106
+ </div>
107
+ </form>
108
+ </div>
109
+ </div>
110
+
111
+ </div>
112
+ </form>
113
+ <?php elseif ( $this->is_scan() ) : ?>
114
+ <div class="qs-row">
115
+ <div class="qs-col">
116
+ <div class="scanning">
117
+ Please wait a few seconds while we process your website accessibility report.
118
+ </div>
119
+ <div class="scanning-tip">
120
+ <strong>Results guide:</strong> <strong>Compliant</strong> - You're all good. <strong>Semi/Not Compliant</strong> - We recommend you to install accessiBe
121
+ </div>
122
+ </div>
123
+ </div>
124
+ <?php $url = add_query_arg( 'accesibedomainscan', str_replace( 'http:', 'https:', home_url() ), 'https://querysol.com/scan' ); ?>
125
+ <iframe src="<?php echo $url; ?>" scrolling="no" style=" width: 100%; height: 100vh; overflow: hidden;" ></iframe>
126
+ <form action="<?php echo $this->get_settings_url(); ?>" method="post" class="accesibe-settings-form-footer">
127
+ <button type="submit" class="site-button js-active site-button-animate site-button-right-icon site-button-full" data-element="signup-button">
128
+ <span class="align-middle">
129
+ <?php _e( 'Create a Free Account!', 'wpcf7-redirect' ); ?> <span class="dashicons dashicons-arrow-right-alt2"></span>
130
+ </span>
131
+ </button>
132
+ <input type="hidden" name="start-free-trial" value="<?php echo qs_get_plugin_display_name(); ?>" />
133
+ </form>
134
+ <div class="footer-wrap">
135
+ <a class=" align-middle" href="<?php echo admin_url( '?deactivate=' . qs_get_plugin_display_name() ); ?>">
136
+ <?php _e( 'Hide This Special Offer', 'wpcf7-redirect' ); ?>
137
+ </a>
138
+ </div>
139
+ <?php else : ?>
140
+ <form name="accesibe-registration" action="<?php echo $this->get_settings_url(); ?>" method="post" class="accesibe-settings-form">
141
+ <div class="success-message">
142
+ <h3>
143
+ Thank you for installing accessibe!
144
+ </h3>
145
+ <div class="success-message-subtitle">
146
+ The plugin is now active on your website.
147
+ </div>
148
+ <div class="success-content">
149
+ If you want to customize the widget settings you can do it here: <br/>
150
+ To deactivate the plugin you can <a class=" align-middle" href="<?php echo admin_url( '?deactivate=' . qs_get_plugin_display_name() ); ?>">Click Here.</a>
151
+ </div>
152
+ </div>
153
+ <?php $this->get_settings_form(); ?>
154
+
155
+ <div class="qs-row">
156
+ <div class="qs-col">
157
+ <button type="submit" class="site-button js-active site-button-animate site-button-right-icon site-button-full" data-element="signup-button">
158
+ <span class="align-middle"><?php _e( 'Save', 'wpcf7-redirect' ); ?></span>
159
+ </button>
160
+ </div>
161
+ </div>
162
+ <input type="hidden" name="save_ext_settings" value="<?php echo qs_get_plugin_display_name(); ?>" />
163
+ </form>
164
+ <?php endif; ?>
165
+ </section>
classes/class-qs-api.php ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Qs_Api
4
+ * A class used for contacting Query Solutions API
5
+ */
6
+
7
+ defined( 'ABSPATH' ) || exit;
8
+
9
+ class Qs_Api {
10
+
11
+ public function __construct() {
12
+ $this->activation_url = WPCF7_PRO_REDIRECT_PLUGIN_ACTIVATION_URL;
13
+ $this->api_url = WPCF7_PRO_REDIRECT_PLUGIN_UPDATES;
14
+ $this->store_id = WPCF7_PRO_REDIRECT_PLUGIN_ID;
15
+ $this->sku = WPCF7_PRO_REDIRECT_PLUGIN_SKU;
16
+ }
17
+
18
+ public function extension_has_update( $extension ) {
19
+ $current_ver = $extension->get_extension_ver();
20
+ $params = array(
21
+ 'action' => 'license_key_validate',
22
+ 'store_code' => $this->store_id,
23
+ 'license_key' => $extension->get_serial(),
24
+ 'domain' => $this->get_current_domain(),
25
+ 'sku' => $extension->get_name(),
26
+ 'activation_id' => $extension->get_activation_id(),
27
+ );
28
+ $results = $this->api_call( $this->activation_url, $params );
29
+ if ( ! is_wp_error( $results ) && isset( $results->data->version ) ) {
30
+ return floatval( $results->data->version ) > floatval( $current_ver );
31
+ }
32
+ }
33
+
34
+ /**
35
+ * Make the API call
36
+ */
37
+ public function api_call( $url, $params, $args = array() ) {
38
+ $defaults = array(
39
+ 'timeout' => 100,
40
+ 'redirection' => 5,
41
+ 'httpversion' => '1.0',
42
+ 'blocking' => true,
43
+ 'headers' => array(),
44
+ 'cookies' => array(),
45
+ 'body' => $params,
46
+ 'compress' => false,
47
+ 'decompress' => true,
48
+ 'sslverify' => true,
49
+ 'stream' => false,
50
+ 'filename' => null,
51
+ );
52
+
53
+ $args = wp_parse_args( $args, $defaults );
54
+
55
+ $results = wp_remote_post( $url, $args );
56
+
57
+ if ( ! is_wp_error( $results ) ) {
58
+ $body = wp_remote_retrieve_body( $results );
59
+ $results = json_decode( $body );
60
+
61
+ if ( ! isset( $results->error ) ) {
62
+ return new WP_Error( $params['action'], 'Unknow error' );
63
+ }
64
+
65
+ if ( $results->error ) {
66
+ return new WP_Error( $params['action'], $results->errors );
67
+ }
68
+
69
+ if ( isset( $results->data ) ) {
70
+ $results->data->downloadable = '';
71
+ }
72
+ }
73
+
74
+ return $results;
75
+ }
76
+
77
+ /**
78
+ * Get the domain where the plugin is intalled for authentication
79
+ */
80
+ public function get_current_domain() {
81
+ return isset( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : '';
82
+ }
83
+
84
+ /**
85
+ * Check if the serial is valid
86
+ *
87
+ * @param $activation_id
88
+ * @param $serial
89
+ * @param $sku
90
+ */
91
+ public function validate_serial( $activation_id, $serial, $sku = '' ) {
92
+ $params = array(
93
+ 'action' => 'license_key_validate',
94
+ 'store_code' => $this->store_id,
95
+ 'license_key' => $serial,
96
+ 'domain' => $this->get_current_domain(),
97
+ 'sku' => $sku ? $sku : $this->sku,
98
+ 'activation_id' => $activation_id,
99
+ );
100
+
101
+ $results = $this->api_call( $this->activation_url, $params );
102
+
103
+ return $results;
104
+ }
105
+
106
+ /**
107
+ * Deactivate the specific activation serial
108
+ *
109
+ * @param $activation_id
110
+ * @param $serial
111
+ * @param string $sku
112
+ */
113
+ public function deactivate_liscense( $activation_id, $serial, $sku = '' ) {
114
+ $params = array(
115
+ 'action' => 'license_key_deactivate',
116
+ 'store_code' => $this->store_id,
117
+ 'license_key' => $serial,
118
+ 'domain' => $this->get_current_domain(),
119
+ 'sku' => $sku ? $sku : $this->sku,
120
+ 'activation_id' => $activation_id,
121
+ );
122
+
123
+ $results = $this->api_call( $this->activation_url, $params );
124
+
125
+ return $results;
126
+ }
127
+
128
+ public function get_extension_file( $activation_data, $sku ) {
129
+ $params = array(
130
+ 'action' => 'get_extension_file',
131
+ 'store_code' => $this->store_id,
132
+ 'license_key' => $activation_data->the_key,
133
+ 'domain' => $this->get_current_domain(),
134
+ 'sku' => $sku ? $sku : $this->sku,
135
+ 'activation_id' => $activation_data->activation_id,
136
+ 'sub_action' => 'download',
137
+ );
138
+
139
+ $url = add_query_arg( $params, $this->api_url );
140
+
141
+ $args = array(
142
+ 'timeout' => 100,
143
+ 'redirection' => 5,
144
+ 'httpversion' => '1.0',
145
+ 'blocking' => true,
146
+ 'headers' => array(),
147
+ 'cookies' => array(),
148
+ 'body' => $params,
149
+ 'compress' => false,
150
+ 'decompress' => true,
151
+ 'sslverify' => true,
152
+ 'stream' => false,
153
+ 'filename' => null,
154
+ );
155
+
156
+ $results = wp_remote_post( $url, $args );
157
+
158
+ if ( ! is_wp_error( $results ) && $results ) {
159
+
160
+ $results = wp_remote_retrieve_body( $results );
161
+
162
+ if ( ! is_wp_error( $results ) ) {
163
+ $results = json_decode( $results );
164
+ $results = download_url( $results->download_link, 1000 );
165
+ }
166
+ } elseif ( ! $results ) {
167
+ $results = new WP_Error( 'get_extension_file', __( 'Cannot download the file', 'wpcf7-redirect' ) );
168
+ }
169
+
170
+ return $results;
171
+ }
172
+
173
+ /**
174
+ * Activate the serial
175
+ *
176
+ * @param $serial
177
+ * @param $sku
178
+ */
179
+ public function activate_serial( $serial, $sku = '' ) {
180
+ $params = array(
181
+ 'action' => 'license_key_activate',
182
+ 'store_code' => $this->store_id,
183
+ 'license_key' => $serial,
184
+ 'domain' => $this->get_current_domain(),
185
+ 'sku' => $sku ? $sku : $this->sku,
186
+ );
187
+
188
+ $results = $this->api_call( $this->activation_url, $params );
189
+
190
+ return $results;
191
+ }
192
+
193
+ /**
194
+ * Check if the API returned a vlid response
195
+ *
196
+ * @param $results
197
+ * @return boolean
198
+ */
199
+ public function is_valid_response( $results ) {
200
+ if ( ! is_wp_error( $results ) ) {
201
+ if ( is_object( $results ) ) {
202
+ if ( isset( $results->error ) && ! $results->error ) {
203
+ return true;
204
+ }
205
+ } else {
206
+ if ( isset( $results['error'] ) && ! $results['error'] ) {
207
+ return true;
208
+ }
209
+ }
210
+ }
211
+ return false;
212
+ }
213
+ }
classes/class-wpcf7r-action.php ADDED
@@ -0,0 +1,809 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Action - פarent class that handles all redirect actions
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ class WPCF7R_Action {
9
+ // save a reference to the lead id in case the save lead action is on
10
+ public static $lead_id;
11
+
12
+ // saved data from validation action to submission action
13
+ public static $data;
14
+
15
+ /**
16
+ * Class constructor
17
+ * Set required parameters
18
+ *
19
+ * @param string $post [description]
20
+ */
21
+ public function __construct( $post = '' ) {
22
+ $this->priority = 2;
23
+
24
+ if ( $post ) {
25
+ // save a refference to the action post
26
+ $this->action_post = $post;
27
+ // set the action post ID
28
+ $this->action_post_id = $post->ID;
29
+ // get the custom action fields
30
+ $this->fields_values = get_post_custom( $this->action_post_id );
31
+ // get tje contact form 7 post id
32
+ $this->wpcf7_id = $this->get_action_wpcf7_id( $this->action_post_id );
33
+ // get the type of action
34
+ $this->action = self::get_action_type( $this->action_post_id );
35
+ // get tje status of the action (is it active or not)
36
+ $this->action_status = $this->get_action_status( $this->action_post_id );
37
+ // get conditional logic blocks
38
+ $this->logic_blocks = $this->get( 'blocks' );
39
+ }
40
+ }
41
+
42
+ /**
43
+ * Process validation action
44
+ * This function will be called on validation hook
45
+ *
46
+ * @param $submission
47
+ */
48
+ public function process_validation( $submission ) { }
49
+
50
+ /**
51
+ * Get action name
52
+ */
53
+ public function get_name() {
54
+ return WPCF7r_Utils::get_action_name( $this->action );
55
+ }
56
+
57
+ /**
58
+ * Adds a blank select option for select fields
59
+ */
60
+ public function get_tags_optional() {
61
+ $tags = $this->get_mail_tags_array();
62
+ $tags_optional = array_merge( array( __( 'Select', 'wpcf7-redirect' ) ), $tags );
63
+ return $tags_optional;
64
+ }
65
+
66
+ /**
67
+ * save a reference to the lead id in case the save lead action is on
68
+ *
69
+ * @param $lead_id
70
+ */
71
+ public function set_lead_id( $lead_id ) {
72
+ self::$lead_id = $lead_id;
73
+ }
74
+
75
+ /**
76
+ * Get all system user roles
77
+ */
78
+ public function get_available_user_roles() {
79
+ return wp_roles()->get_names();
80
+ }
81
+
82
+ /**
83
+ * Return the current lead id if it is availavle
84
+ */
85
+ public static function get_lead_id() {
86
+ return isset( self::$lead_id ) ? self::$lead_id : '';
87
+ }
88
+
89
+ /**
90
+ * General function to retrieve meta
91
+ *
92
+ * @param $key
93
+ */
94
+ public function get( $key ) {
95
+ return isset( $this->fields_values[ $key ][0] ) ? $this->fields_values[ $key ][0] : '';
96
+ }
97
+
98
+ /**
99
+ * Get the contact form 7 related post id
100
+ */
101
+ public function get_cf7_post_id() {
102
+ return isset( $this->wpcf7_id ) ? $this->wpcf7_id : '';
103
+ }
104
+
105
+ /**
106
+ * Set action property
107
+ *
108
+ * @param $key
109
+ * @param $value
110
+ */
111
+ public function set( $key, $value ) {
112
+ update_post_meta( $this->action_post_id, $key, $value );
113
+ $this->fields_values[ $key ][0] = $value;
114
+ }
115
+
116
+ /**
117
+ * Enqueue extension scripts and styles.
118
+ *
119
+ * @return void
120
+ */
121
+ public static function enqueue_backend_scripts() {
122
+
123
+ }
124
+
125
+ /**
126
+ * Enqueue extension scripts and styles.
127
+ *
128
+ * @return void
129
+ */
130
+ public static function enqueue_frontend_scripts() {
131
+
132
+ }
133
+ /**
134
+ * Parent get action fields function
135
+ */
136
+ public function get_action_fields() {
137
+ return array();
138
+ }
139
+
140
+ /**
141
+ * Get a set of fields/specific field settings by key
142
+ *
143
+ * @param $fields_key
144
+ */
145
+ public function get_fields_settings( $fields_key ) {
146
+ $fields = $this->get_action_fields();
147
+
148
+ return $fields[ $fields_key ];
149
+ }
150
+
151
+ /**
152
+ * Get the id of the rule
153
+ */
154
+ public function get_rule_id() {
155
+ return $this->get( 'wpcf7_rule_id' );
156
+ }
157
+
158
+ /**
159
+ * Get all fields values
160
+ */
161
+ public function get_fields_values() {
162
+ $fields = $this->get_action_fields();
163
+ foreach ( $fields as $field ) {
164
+ $values[ $field['name'] ] = $this->get_field_value( $field );
165
+ }
166
+ return $values;
167
+ }
168
+
169
+ /**
170
+ * Get mail tags objects
171
+ */
172
+ public function get_mail_tags() {
173
+ $mail_tags = WPCF7R_Form::get_mail_tags();
174
+ return $mail_tags;
175
+ }
176
+
177
+ /**
178
+ * Get mail tags objects
179
+ */
180
+ public function get_mail_tags_array() {
181
+ $mail_tags = WPCF7R_Form::get_mail_tags();
182
+ $mail_tags_array = array();
183
+ if ( $mail_tags ) {
184
+ foreach ( $mail_tags as $mail_tag ) {
185
+ $mail_tags_array[ $mail_tag->name ] = $mail_tag->name;
186
+ }
187
+ }
188
+ return $mail_tags_array;
189
+ }
190
+
191
+ /**
192
+ * Get mail tags to display on the settings panel
193
+ *
194
+ * @param boolean $clean
195
+ */
196
+ public function get_formatted_mail_tags( $clean = false ) {
197
+ $formatted_tags = array();
198
+
199
+ foreach ( WPCF7R_Form::get_mail_tags() as $mail_tag ) {
200
+ $formatted_tags[] = "<span class='mailtag code'>[{$mail_tag->name}]</span>";
201
+ }
202
+
203
+ // foreach( WPCF7R_Form::get_special_mail_tags() as $mail_tag ){
204
+ // $formatted_tags[] = "<br/><span class='mailtag code'>[".$mail_tag->field_name()."]</span>";
205
+ // }
206
+
207
+ $formatted_tags = implode( '', $formatted_tags );
208
+ if ( $clean ) {
209
+ $formatted_tags = str_replace( array( ']' ), ', ', $formatted_tags );
210
+ $formatted_tags = str_replace( array( '[' ), '', $formatted_tags );
211
+ }
212
+
213
+ ob_start();
214
+ ?>
215
+
216
+ <div class="mail-tags-wrapper">
217
+ <div class="mail-tags-title" data-toggle=".mail-tags-wrapper-inner">
218
+ <strong><?php _e( 'Available mail tags', 'wpcf7-redirect' ); ?></strong> <span class="dashicons dashicons-arrow-down"></span>
219
+ </div>
220
+ <div class="mail-tags-wrapper-inner field-hidden">
221
+ <?php echo $formatted_tags; ?>
222
+ <div class="special-mail-tags">
223
+ <br/>
224
+ <a href="https://contactform7.com/special-mail-tags/"><?php _e( 'Special mail tags' ); ?></a>
225
+ <div><small><?php _e( 'These tags are available only inside the loop as described by the plugin author', 'wpcf7-redirect' ); ?></small></div>
226
+ </div>
227
+ </div>
228
+ </div>
229
+ <?php
230
+ return ob_get_clean();
231
+ }
232
+
233
+ /**
234
+ * Replace lead id from the lead manager
235
+ *
236
+ * @param $template
237
+ */
238
+ public function replace_lead_id_tag( $template ) {
239
+ return str_replace( '[lead_id]', self::get_lead_id(), $template );
240
+ }
241
+
242
+ /**
243
+ * Replace all mail tags in a string
244
+ *
245
+ * @param $content
246
+ * @param $args
247
+ */
248
+ public function replace_tags( $content, $args = '' ) {
249
+ if ( true === $args ) {
250
+ $args = array( 'html' => true );
251
+ }
252
+ $args = wp_parse_args(
253
+ $args,
254
+ array(
255
+ 'html' => false,
256
+ 'exclude_blank' => false,
257
+ )
258
+ );
259
+ $replaced_tags = wpcf7_mail_replace_tags( $content, $args );
260
+ $replaced_tags = do_shortcode( $replaced_tags );
261
+ $replaced_tags = $this->replace_lead_id_tag( $replaced_tags );
262
+ return $replaced_tags;
263
+ }
264
+
265
+ /**
266
+ * Get the value of a specific field
267
+ *
268
+ * @param $field
269
+ */
270
+ public function get_field_value( $field ) {
271
+ if ( is_array( $field ) ) {
272
+ return get_post_meta( $this->action_post_id, '_wpcf7_redirect_' . $field['name'], true );
273
+ } else {
274
+ return get_post_meta( $this->action_post_id, '_wpcf7_redirect_' . $field, true );
275
+ }
276
+ }
277
+
278
+ /**
279
+ * Get an instance of the relevant action class
280
+ *
281
+ * @param $post
282
+ */
283
+ public static function get_action( $post ) {
284
+ if ( is_int( $post ) ) {
285
+ $post = get_post( $post );
286
+ }
287
+
288
+ if ( ! isset( $post->ID ) ) {
289
+ return false;
290
+ }
291
+
292
+ $action_type = self::get_action_type( $post->ID );
293
+ $class = "WPCF7R_Action_{$action_type}";
294
+ $action = '';
295
+
296
+ if ( class_exists( $class ) ) {
297
+ $action = new $class( $post );
298
+ } else {
299
+ $action_type = str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $action_type ) ) );
300
+ $class = "WPCF7R_Action_{$action_type}";
301
+
302
+ if ( class_exists( $class ) ) {
303
+ $action = new $class( $post );
304
+ } else {
305
+ $action = new WP_Error( 'get_action', "Class {$class} Does not exist" );
306
+ }
307
+ }
308
+
309
+ return $action;
310
+ }
311
+
312
+ /**
313
+ * Get the action post_id
314
+ */
315
+ public function get_id() {
316
+ return $this->action_post_id;
317
+ }
318
+
319
+ /**
320
+ * Get the type of the action
321
+ *
322
+ * @param $post_id
323
+ */
324
+ public static function get_action_type( $post_id ) {
325
+ return get_post_meta( $post_id, 'action_type', true );
326
+ }
327
+
328
+ /**
329
+ * Get action status
330
+ */
331
+ public function get_action_status() {
332
+ return $this->get( 'action_status' );
333
+ }
334
+
335
+ /**
336
+ * Get action status
337
+ */
338
+ public function get_action_status_label() {
339
+
340
+ /* translators:%s the action status name */
341
+ return $this->get_action_status() === 'on' ? sprintf( __( 'Enable %s', 'wpcf7-redirect' ), $this->get_name() ) : __( 'Disabled', 'wpcf7-redirect' );
342
+ }
343
+
344
+
345
+ /**
346
+ * Get contact form id
347
+ *
348
+ * @return int form id
349
+ */
350
+ public function get_action_wpcf7_id() {
351
+ return $this->get( 'wpcf7_id' );
352
+ }
353
+
354
+ /**
355
+ * Get the action title
356
+ *
357
+ * @return string action title
358
+ */
359
+ public function get_title() {
360
+ return $this->action_post->post_title;
361
+ }
362
+
363
+ /**
364
+ * Get the action type
365
+ *
366
+ * @return string action type
367
+ */
368
+ public function get_type() {
369
+ return $this->action;
370
+ }
371
+
372
+ /**
373
+ * Get the action pretty name
374
+ *
375
+ * @return string action pretty name
376
+ */
377
+ public function get_type_label() {
378
+ $actions = wpcf7r_get_available_actions();
379
+ $type = $actions[ $this->get_type() ]['label'];
380
+ return $type;
381
+ }
382
+
383
+ /**
384
+ * Get the action status
385
+ *
386
+ * @return string action status
387
+ */
388
+ public function get_status() {
389
+ return $this->action_status;
390
+ }
391
+
392
+ /**
393
+ * Get the action menu order
394
+ */
395
+ public function get_menu_order() {
396
+ return $this->action_post->menu_order;
397
+ }
398
+
399
+ /**
400
+ * Get the tags used on the form
401
+ *
402
+ * @param string $tag_name
403
+ */
404
+ public function get_validation_mail_tags( $tag_name = '' ) {
405
+ $tags = WPCF7R_Form::get_validation_obj_tags();
406
+ if ( $tag_name ) {
407
+ foreach ( $tags as $tag ) {
408
+ if ( $tag->name === $tag_name ) {
409
+ return $tag;
410
+ }
411
+ }
412
+ } else {
413
+ return $tags;
414
+ }
415
+ }
416
+
417
+ /**
418
+ * Get default actions field
419
+ * This actions will apply for all child action classes
420
+ */
421
+ function get_default_fields() {
422
+ $args = array(
423
+ 'action_status' => array(
424
+ 'name' => 'action_status',
425
+ 'type' => 'checkbox',
426
+ 'label' => $this->get_action_status_label(),
427
+ 'sub_title' => 'if this is off the rule will not be applied',
428
+ 'placeholder' => '',
429
+ 'show_selector' => '',
430
+ 'toggle-label' => json_encode(
431
+ array(
432
+ '.field-wrap-action_status .checkbox-label,.column-status a' => array(
433
+ __( 'Enabled', 'wpcf7-redirect' ),
434
+ __( 'Disabled', 'wpcf7-redirect' ),
435
+ ),
436
+ )
437
+ ),
438
+ 'value' => $this->get( 'action_status' ),
439
+ ),
440
+ );
441
+
442
+ if ( conditional_logic_enabled() ) {
443
+ $args['conditional_logic'] = array(
444
+ 'name' => 'conditional_logic',
445
+ 'type' => 'checkbox',
446
+ 'label' => __( 'Conditional Logic', 'wpcf7-redirect' ),
447
+ 'sub_title' => '',
448
+ 'placeholder' => '',
449
+ 'show_selector' => '.conditional-logic-blocks',
450
+ 'value' => $this->get( 'conditional_logic' ),
451
+ );
452
+ } else {
453
+ $args['conditional_logic'] = array(
454
+ 'name' => 'conditional_logic',
455
+ 'type' => 'notice',
456
+ 'label' => __( '<strong>CONDITIONAL LOGIC!</strong><br/>', 'wpcf7-redirect' ),
457
+ 'sub_title' => __( 'You can purchase and activate conditional logic addon on the extensions tab.', 'wpcf7-redirect' ),
458
+ 'placeholder' => '',
459
+ 'class' => 'field-notice-alert',
460
+ 'show_selector' => '',
461
+ );
462
+ }
463
+
464
+ $args['blocks'] = array(
465
+ 'name' => 'blocks',
466
+ 'type' => 'blocks',
467
+ 'has_conditional_logic' => $this->get( 'conditional_logic' ),
468
+ 'blocks' => $this->get_conditional_blocks(),
469
+ );
470
+ return $args;
471
+ }
472
+
473
+ /**
474
+ * Reset all action fields
475
+ */
476
+ public function delete_all_fields() {
477
+ $fields = $this->get_action_fields();
478
+
479
+ foreach ( $fields as $field ) {
480
+ delete_post_meta( $this->action_post_id, $field['name'] );
481
+ }
482
+ }
483
+
484
+ /**
485
+ * Get the template to display on the admin field
486
+ *
487
+ * @param $template
488
+ */
489
+ public function get_settings_template( $template ) {
490
+ $prefix = "[actions][$this->action_post_id]";
491
+ include WPCF7_PRO_REDIRECT_ACTIONS_TEMPLATE_PATH . 'rule-title.php';
492
+ include WPCF7_PRO_REDIRECT_ACTIONS_TEMPLATE_PATH . $template;
493
+ }
494
+
495
+ /**
496
+ * Get a single action row
497
+ */
498
+ public function get_action_row() {
499
+ ob_start();
500
+ do_action( 'before_wpcf7r_action_row', $this );
501
+ ?>
502
+ <tr class="drag primary <?php echo $this->get_action_status() ? 'active' : 'non-active'; ?>" data-actionid="<?php echo $this->get_id(); ?>" id="post-<?php echo $this->get_id(); ?>">
503
+ <td class="manage-column check-column ">
504
+ <span class="num"><?php echo $this->get_menu_order(); ?></span>
505
+ </td>
506
+ <td class="manage-column column-title column-primary sortable desc">
507
+ <span class="edit">
508
+ <a href="#" class="column-post-title" aria-label="<?php _e( 'Edit', 'wpcf7-redirect' ); ?>"><?php echo $this->get_title(); ?></a>
509
+ </span>
510
+ <div class="row-actions">
511
+ <span class="edit">
512
+ <a href="#" aria-label="<?php _e( 'Edit', 'wpcf7-redirect' ); ?>"><?php _e( 'Edit', 'wpcf7-redirect' ); ?></a> |
513
+ </span>
514
+ <span class="trash">
515
+ <a href="#" class="submitdelete" data-id="<?php echo $this->get_id(); ?>" aria-label="<?php _e( 'Move to trash', 'wpcf7-redirect' ); ?>"><?php _e( 'Move to trash', 'wpcf7-redirect' ); ?></a> |
516
+ </span>
517
+ <?php if ( $this->get_type() === 'save_lead' ) : ?>
518
+ <span class="view-leads">
519
+ <a href="<?php echo WPCF7R_Leads_Manager::get_admin_url( $this->wpcf7_id ); ?>" class="show-leads" data-id="<?php echo $this->get_id(); ?>" aria-label="<?php _e( 'View Leads', 'wpcf7-redirect' ); ?>" target="_blank"><?php _e( 'View Leads', 'wpcf7-redirect' ); ?></a> |
520
+ </span>
521
+ <?php endif; ?>
522
+
523
+ <?php do_action( 'wpcf7r_after_actions_links', $this ); ?>
524
+ </div>
525
+ </td>
526
+ <td class="manage-column column-primary sortable desc edit">
527
+ <a href="#" aria-label="<?php _e( 'Edit', 'wpcf7-redirect' ); ?>"><?php echo $this->get_type_label(); ?></a>
528
+ </td>
529
+ <td class="manage-column column-primary sortable desc edit column-status">
530
+ <a href="#" aria-label="<?php _e( 'Edit', 'wpcf7-redirect' ); ?>"><?php echo $this->get_action_status_label(); ?></a>
531
+ </td>
532
+ <td class="manage-column check-column">
533
+ <input type="hidden" name="post[]" value="<?php echo $this->get_id(); ?>">
534
+ <span class="dashicons dashicons-menu handle"></span>
535
+ </td>
536
+ </tr>
537
+ <tr data-actionid="<?php echo $this->get_id(); ?>" class="action-container">
538
+ <td colspan="5" >
539
+ <div class="hidden-action">
540
+ <?php $this->get_action_settings(); ?>
541
+ </div>
542
+ </td>
543
+ </tr>
544
+ <?php
545
+
546
+ do_action( 'after_wpcf7r_action_row', $this );
547
+
548
+ return apply_filters( 'wpcf7r_get_action_rows', ob_get_clean(), $this );
549
+ }
550
+
551
+ /**
552
+ * Get settings page
553
+ */
554
+ public function get_action_settings() {
555
+ $this->get_settings_template( 'html-action-send-to-email.php' );
556
+ }
557
+
558
+ /**
559
+ * Render HTML field
560
+ *
561
+ * @param $field
562
+ * @param $prefix
563
+ */
564
+ public function render_field( $field, $prefix ) {
565
+ WPCF7R_Html::render_field( $field, $prefix );
566
+ }
567
+
568
+ /**
569
+ * Check if the action has conditional rules
570
+ *
571
+ * @return boolean
572
+ */
573
+ public function has_conditional_logic() {
574
+ return $this->get( 'conditional_logic' ) && conditional_logic_enabled() ? true : false;
575
+ }
576
+
577
+ /**
578
+ * Maybe perform actions before sending results to the user
579
+ */
580
+ public function maybe_perform_pre_result_action() {
581
+ }
582
+
583
+ /**
584
+ * Get the submitted form data
585
+ */
586
+ public function get_posted_data() {
587
+ return $this->submission_data;
588
+ }
589
+
590
+ /**
591
+ * This will process the required rules
592
+ *
593
+ * @param $cf7r_form
594
+ */
595
+ public function process_action( $cf7r_form ) {
596
+ $results = array();
597
+
598
+ $this->cf7r_form = $cf7r_form;
599
+ $this->submission_data = $this->cf7r_form->get_submission();
600
+ $this->posted_data_raw = $this->submission_data->get_posted_data();
601
+ $this->form_tags = $this->cf7r_form->get_cf7_form_instance()->scan_form_tags();
602
+
603
+ // get conditional logic object
604
+ $clogic = class_exists( 'WPCF7_Redirect_Conditional_Logic' ) ? new WPCF7_Redirect_Conditional_Logic( $this->logic_blocks, $this->cf7r_form ) : '';
605
+
606
+ if ( ! conditional_logic_enabled() || ! $this->has_conditional_logic() ) {
607
+ // if no conditions are defined
608
+ $results = $this->process( $this->submission_data );
609
+ } elseif ( conditional_logic_enabled() && $clogic->conditions_met() ) {
610
+ $results = $this->process( $this->submission_data );
611
+ }
612
+
613
+ return $results;
614
+ }
615
+
616
+ /**
617
+ * Handle a simple redirect rule
618
+ *
619
+ * @param $rules
620
+ * @param $response
621
+ */
622
+ public function process( $submission ) {
623
+
624
+ }
625
+
626
+ /**
627
+ * Get all saved blocks
628
+ */
629
+ public function get_conditional_blocks() {
630
+ $blocks = $this->get( 'blocks' );
631
+ if ( ! $blocks ) {
632
+ $blocks = array(
633
+ array(
634
+ 'block_title' => 'Block title',
635
+ 'groups' => $this->get_groups(),
636
+ 'block_key' => 'block_1',
637
+ ),
638
+ );
639
+ } else {
640
+ $blocks = maybe_unserialize( $blocks );
641
+ $blocks['block_1']['block_key'] = 'block_1';
642
+ $blocks['block_1']['block_title'] = 'Block title';
643
+ }
644
+ return $blocks;
645
+ }
646
+
647
+ /**
648
+ * Find the relevant rule to use
649
+ */
650
+ public function get_valid_rule_block() {
651
+ $blocks = $this->get( 'blocks' );
652
+ $blocks = maybe_unserialize( $blocks );
653
+ if ( isset( $blocks ) && $blocks ) {
654
+ foreach ( $blocks as $block ) {
655
+ if ( isset( $block['groups'] ) && $block['groups'] ) {
656
+ foreach ( $block['groups'] as $and_rows ) {
657
+ $valid = true;
658
+ if ( $and_rows ) {
659
+ foreach ( $and_rows as $and_row ) {
660
+ if ( ! $this->is_valid( $and_row ) ) {
661
+ $valid = false;
662
+ break;
663
+ }
664
+ }
665
+ if ( $valid ) {
666
+ break;
667
+ }
668
+ }
669
+ }
670
+ if ( $valid ) {
671
+ return $block;
672
+ }
673
+ }
674
+ }
675
+ }
676
+ }
677
+
678
+ /**
679
+ * Get an instance of a form tag object
680
+ *
681
+ * @param $form_tag_name
682
+ */
683
+ private function get_form_tag( $form_tag_name ) {
684
+ if ( $this->form_tags ) {
685
+ foreach ( $this->form_tags as $form_tag ) {
686
+ if ( $form_tag->name === $form_tag_name ) {
687
+ return $form_tag;
688
+ }
689
+ }
690
+ }
691
+ }
692
+
693
+ /**
694
+ * Use cf7 mechanizm to get the form tag value
695
+ * Including pipes and default values
696
+ *
697
+ * @param $form_tag_name
698
+ */
699
+ private function get_form_tag_posted_data( $form_tag_name ) {
700
+ $form_tag = $this->get_form_tag( $form_tag_name );
701
+ $value = '';
702
+
703
+ if ( $form_tag ) {
704
+ $posted_value = $this->submission_data->get_posted_data( $form_tag_name );
705
+ $type = $form_tag->type;
706
+ $name = $form_tag->name;
707
+ $pipes = $form_tag->pipes;
708
+ $value_orig = $value;
709
+ $value_orig = $posted_value;
710
+ if (
711
+ ( defined( 'WPCF7_USE_PIPE' ) && WPCF7_USE_PIPE )
712
+ && $pipes instanceof WPCF7_Pipes
713
+ && ! $pipes->zero()
714
+ ) {
715
+ if ( is_array( $value_orig ) ) {
716
+ $value = array();
717
+ foreach ( $value_orig as $v ) {
718
+ $value[] = $pipes->do_pipe( wp_unslash( $v ) );
719
+ }
720
+ } else {
721
+ $value = $pipes->do_pipe( wp_unslash( $value_orig ) );
722
+ }
723
+ } else {
724
+ $value = $posted_value;
725
+ }
726
+ }
727
+ return $value;
728
+ }
729
+
730
+ /**
731
+ * Check rule
732
+ *
733
+ * @param $and_row
734
+ */
735
+ public function is_valid( $and_row ) {
736
+ $valid = false;
737
+ if ( isset( $and_row['condition'] ) && $and_row['condition'] ) {
738
+ $tag_name = isset( $and_row['if'] ) ? $and_row['if'] : '';
739
+ $posted_value = $this->get_form_tag_posted_data( $tag_name );
740
+ $compare_value = $and_row['value'];
741
+ switch ( $and_row['condition'] ) {
742
+ case 'equal':
743
+ if ( isset( $posted_value ) && is_array( $posted_value ) ) {
744
+ $valid = in_array( $compare_value, $posted_value, true ) || $compare_value === $posted_value ? true : false;
745
+ } else {
746
+ $valid = $compare_value === $posted_value;
747
+ }
748
+ break;
749
+ case 'not-equal':
750
+ if ( is_array( $posted_value ) ) {
751
+ $valid = ! in_array( $compare_value, $posted_value, true );
752
+ } else {
753
+ $valid = $compare_value !== $posted_value;
754
+ }
755
+ break;
756
+ case 'contain':
757
+ $valid = strpos( $posted_value, $compare_value ) !== false;
758
+ break;
759
+ case 'not-contain':
760
+ $valid = strpos( $posted_value, $compare_value ) === false;
761
+ break;
762
+ case 'greater_than':
763
+ $valid = $posted_value > $compare_value;
764
+ break;
765
+ case 'less_than':
766
+ $valid = $posted_value < $compare_value;
767
+ break;
768
+ case 'is_null':
769
+ $valid = '' === $posted_value;
770
+ break;
771
+ case 'is_not_null':
772
+ $valid = '' === $posted_value;
773
+ break;
774
+ }
775
+ }
776
+ return apply_filters( 'wpcf7r_is_valid', $valid, $and_row );
777
+ }
778
+
779
+ /**
780
+ * Get the fields relevant for conditional group
781
+ */
782
+ public function get_group_fields() {
783
+ return array_merge(
784
+ array(
785
+ array(
786
+ 'if' => '',
787
+ 'condition' => '',
788
+ 'value' => '',
789
+ ),
790
+ )
791
+ );
792
+ }
793
+
794
+ /**
795
+ * Get the saved groups or display the default first one
796
+ */
797
+ public function get_groups() {
798
+ $groups = array(
799
+ 'group-0' => $this->get_group_fields(),
800
+ );
801
+ return $groups;
802
+ }
803
+
804
+ /**
805
+ * Process all pre cf7 submit actions
806
+ */
807
+ public function process_pre_submit_actions() {
808
+ }
809
+ }
classes/class-wpcf7r-actions-list.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit;
3
+
4
+ class Wpcf7r_Actions_List {
5
+ public static $action_posts;
6
+
7
+ public function __construct( $actions_posts = '' ) {
8
+
9
+ self::$action_posts = $actions_posts;
10
+
11
+ parent::__construct(
12
+ array(
13
+ 'singular' => __( 'Action', 'wpcf7-redirect' ), // singular name of the listed records
14
+ 'plural' => __( 'Actions', 'wpcf7-redirect' ), // plural name of the listed records
15
+ 'ajax' => false, // should this table support ajax?
16
+ )
17
+ );
18
+ }
19
+
20
+ public function record_count() {
21
+ return count( self::$action_posts );
22
+ }
23
+
24
+ /**
25
+ * Text diwpcf7-redirect layed when no customer data is available
26
+ */
27
+ public function no_items() {
28
+ _e( 'No Actions Avaliable.', 'wpcf7-redirect' );
29
+ }
30
+
31
+ /**
32
+ * Return an associative array containing the bulk action
33
+ *
34
+ * @return array
35
+ */
36
+ public function get_bulk_actions() {
37
+ $actions = array(
38
+ 'bulk-delete' => 'Delete',
39
+ );
40
+
41
+ return $actions;
42
+ }
43
+
44
+ /**
45
+ * Handles data query and filter, sorting, and pagination.
46
+ */
47
+ public function prepare_items() {
48
+ $this->_column_headers = $this->get_column_info();
49
+
50
+ /** Process bulk action */
51
+ $this->process_bulk_action();
52
+
53
+ $per_page = 10;
54
+ $current_page = $this->get_pagenum();
55
+ $total_items = $this->record_count();
56
+
57
+ $this->set_pagination_args(
58
+ array(
59
+ 'total_items' => $total_items, //WE have to calculate the total number of items
60
+ 'per_page' => $per_page, //WE have to determine how many items to show on a page
61
+ )
62
+ );
63
+
64
+ $this->items = self::$action_posts;
65
+ }
66
+
67
+ public function process_bulk_action() {
68
+
69
+ //Detect when a bulk action is being triggered...
70
+ if ( 'delete' === $this->current_action() ) {
71
+
72
+ // In our file that handles the request, verify the nonce.
73
+ $nonce = esc_attr( $_REQUEST['_wpnonce'] );
74
+
75
+ if ( ! wp_verify_nonce( $nonce, 'sp_delete_customer' ) ) {
76
+ die( 'Go get a life script kiddies' );
77
+ } else {
78
+ self::delete_customer( absint( $_GET['customer'] ) );
79
+
80
+ wp_redirect( esc_url( add_query_arg() ) );
81
+ exit;
82
+ }
83
+ }
84
+
85
+ // If the delete bulk action is triggered
86
+ if ( ( isset( $_POST['action'] ) && 'bulk-delete' === $_POST['action'] )
87
+ || ( isset( $_POST['action2'] ) && 'bulk-delete' === $_POST['action2'] )
88
+ ) {
89
+
90
+ $delete_ids = esc_sql( $_POST['bulk-delete'] );
91
+
92
+ // loop over the array of record IDs and delete them
93
+ foreach ( $delete_ids as $id ) {
94
+ self::delete_customer( $id );
95
+
96
+ }
97
+
98
+ wp_redirect( esc_url( add_query_arg() ) );
99
+ exit;
100
+ }
101
+ }
102
+ }
classes/class-wpcf7r-actions.php ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Actions
4
+ * A helper class for managing form actions
5
+ */
6
+
7
+ defined( 'ABSPATH' ) || exit;
8
+
9
+ class WPCF7R_Actions {
10
+ public function __construct( $post_id, $wpcf7r_form ) {
11
+ $this->post_type = 'wpcf7r_action';
12
+ $this->wpcf7_post_id = $post_id;
13
+ $this->html = new WPCF7R_Html( WPCF7R_Form::$mail_tags );
14
+ }
15
+
16
+ /**
17
+ * Get all actions that are relevant to this form
18
+ *
19
+ * @param $rule_id
20
+ * @param integer $count
21
+ * @param boolean $active
22
+ * @param array $args
23
+ */
24
+ public function get_actions( $rule_id, $count = -1, $active = false, $args = array() ) {
25
+ $this->actions = array();
26
+ $actions = array();
27
+
28
+ $actions_posts = $this->get_action_posts( $rule_id, $count, $active, $args );
29
+
30
+ if ( $actions_posts && is_array( $actions_posts ) ) {
31
+ $counter = 0;
32
+ foreach ( $actions_posts as $action_post ) {
33
+ $action = WPCF7R_Action::get_action( $action_post );
34
+
35
+ if ( is_object( $action ) && ! is_wp_error( $action ) ) {
36
+ $actions[ $action->priority . '_' . $counter ] = $action;
37
+ $counter++;
38
+ }
39
+ }
40
+ }
41
+
42
+ ksort( $actions );
43
+ $this->actions = $actions;
44
+
45
+ return $this->actions;
46
+ }
47
+
48
+ /**
49
+ * Get and return the posts that are used as actions
50
+ *
51
+ * @param $rule_id
52
+ * @param integer $count
53
+ * @param boolean $active
54
+ * @param array $extra_args
55
+ */
56
+ public function get_action_posts( $rule_id, $count = -1, $active = false, $extra_args = array() ) {
57
+
58
+ $post_type = $this->post_type;
59
+ $post_id = $this->wpcf7_post_id;
60
+
61
+ $actions = wpcf7r_get_actions( $post_type, $count, $post_id, $rule_id, $extra_args, $active );
62
+
63
+ return $actions;
64
+ }
65
+
66
+ /**
67
+ * Echo the templates used for the javascript process
68
+ */
69
+ public function html_fregments() {
70
+ if ( ! isset( $this->wpcf7_post_id ) ) {
71
+ return;
72
+ }
73
+ $action = new WPCF7R_Action();
74
+ $new_block = array(
75
+ 'block_title' => __( 'New Block', 'wpcf7-redirect' ),
76
+ 'groups' => $action->get_groups(),
77
+ 'block_key' => 'new_block',
78
+
79
+ );
80
+
81
+ $default_group = $action->get_group_fields();
82
+ $prefix = '[actions][action_id]';
83
+ $fields = $this->get_plugin_default_fields_values();
84
+ $row_template = $this->html->get_conditional_row_template( $new_block['block_key'], 'new_group', 'new_row', reset( $default_group ), $prefix );
85
+ $options['row_html'] = $row_template;
86
+ $options['group_html'] = $this->html->group_display( 'new_block', 'new_group', reset( $new_block['groups'] ), $prefix );
87
+ $options['block_html'] = $this->html->get_block_html( 'new_block', $new_block, false, false, $prefix );
88
+ $options['block_title_html'] = $this->html->get_block_title( 'new_block', $new_block, false, false, $prefix );
89
+ $options['mail_tags'] = WPCF7R_Form::$mail_tags;
90
+
91
+ echo '<script>';
92
+ echo 'var wpcfr_template = ' . json_encode( $options );
93
+ echo '</script>';
94
+ }
95
+
96
+ /**
97
+ * Get form values
98
+ */
99
+ public function get_plugin_default_fields_values() {
100
+
101
+ $fields = WPCF7r_Form_Helper::get_plugin_default_fields();
102
+
103
+ foreach ( $fields as $field ) {
104
+ // get_post_meta( $this->wpcf7_post_id, '_wpcf7_redirect_' . $field['name'] , true );
105
+ $values[ $field['name'] ] = '';
106
+ }
107
+ return $values;
108
+ }
109
+ }
classes/class-wpcf7r-base.php ADDED
@@ -0,0 +1,305 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The main class that manages the plugin.
4
+ *
5
+ * @package wpcf7r
6
+ */
7
+
8
+ defined( 'ABSPATH' ) || exit;
9
+
10
+ /**
11
+ * WPCF7R_Base Class.
12
+ */
13
+ class WPCF7R_Base {
14
+
15
+ /**
16
+ * Holds a refrence to the object instance.
17
+ *
18
+ * @var [object]
19
+ */
20
+ public static $instance;
21
+
22
+ /**
23
+ * Class Constructor, load all dependencies and scripts.
24
+ */
25
+ public function __construct() {
26
+ self::$instance = $this;
27
+
28
+ $this->plugin_path = WPCF7_PRO_REDIRECT_BASE_PATH;
29
+
30
+ $this->version = WPCF7_PRO_REDIRECT_PLUGIN_VERSION;
31
+
32
+ $this->load_dependencies();
33
+ $this->init_plugin_dependencies();
34
+ $this->post_types();
35
+ $this->add_action_hooks();
36
+ $this->add_ajax_hooks();
37
+ }
38
+
39
+ /**
40
+ * Create instances of all required objects
41
+ */
42
+ public function init_plugin_dependencies() {
43
+ $this->wpcf_settings = new WPCF7r_Settings();
44
+
45
+ $this->wpcf7_redirect = new WPCF7r_Form_Helper();
46
+
47
+ $this->wpcf7_utils = new WPCF7r_Utils();
48
+
49
+ $this->wpcf7_submission = new WPCF7r_Submission();
50
+
51
+ $this->wpcf7_updates_class = new Wpcf7r_Updates( $this->version, WPCF7_PRO_REDIRECT_BASE_NAME );
52
+
53
+ $this->wpcf7_updates_class = new WPCF7R_User();
54
+ }
55
+
56
+ /**
57
+ * Register the post type required for the action managment
58
+ */
59
+ public function post_types() {
60
+ new WPCF7R_Post_Types();
61
+ }
62
+
63
+ /**
64
+ * Get a singelton
65
+ */
66
+ public static function get_instance() {
67
+ if ( null === self::$instance ) {
68
+ self::$instance = new self();
69
+ }
70
+ return self::$instance;
71
+ }
72
+
73
+ /**
74
+ * Some general plugin hooks
75
+ */
76
+ public function add_action_hooks() {
77
+ // display banner on the redirect settings page
78
+ // the banner will be used to the premium version
79
+ // add_action( 'before_redirect_settings_tab_title' , array( $this->wpcf7_utils , 'get_banner' ) , 10 );.
80
+ add_action( 'before_settings_fields', array( $this->wpcf7_utils, 'show_admin_notices' ), 10 );
81
+
82
+ add_action( 'admin_notices', array( $this, 'show_admin_notices' ), 10 );
83
+
84
+ add_action( 'admin_init', array( $this, 'dismiss_admin_notice' ) );
85
+ // form submission hook.
86
+ add_action( 'wpcf7_before_send_mail', array( $this->wpcf7_submission, 'handle_valid_actions' ) );
87
+ // validation actions.
88
+ add_filter( 'wpcf7_validate', array( $this->wpcf7_submission, 'handle_validation_actions' ), 10, 2 );
89
+ // handle contact form response.
90
+ add_filter( 'wpcf7_feedback_response', array( $this->wpcf7_submission, 'manipulate_cf7_response_object' ), 10, 2 );
91
+ add_action(
92
+ 'init',
93
+ function() {
94
+ if ( ! is_admin() ) {
95
+ // handle form rendering.
96
+ add_filter( 'wpcf7_contact_form_properties', array( $this->wpcf7_utils, 'render_actions_elements' ), 10, 2 );
97
+ }
98
+ }
99
+ );
100
+ // support for browsers that does not support ajax.
101
+ add_action( 'wpcf7_submit', array( $this->wpcf7_submission, 'non_ajax_redirection' ) );
102
+ // add_action( 'after_plugin_row_' . WPCF7_PRO_REDIRECT_BASE_NAME , array( $this->wpcf7_utils , 'license_details_message' ), 10, 2 );
103
+ // handle form duplication.
104
+ add_action( 'wpcf7_after_create', array( $this->wpcf7_utils, 'duplicate_form_support' ) );
105
+ // handle form deletion.
106
+ add_action( 'before_delete_post', array( $this->wpcf7_utils, 'delete_all_form_actions' ) );
107
+ // catch submission for early $_POST manupulations.
108
+ add_action( 'wpcf7_contact_form', array( $this->wpcf7_submission, 'after_cf7_object_created' ) );
109
+ // handle poppup preview.
110
+ add_action( 'init', array( $this->wpcf7_utils, 'show_action_preview' ) );
111
+ // handle affiliate extensions.
112
+ add_action( 'init', array( $this, 'start_affiliate_extensions' ) );
113
+ // add filter by form on leads list.
114
+ if ( class_exists( 'WPCF7R_Leads_Manager' ) && class_exists( 'WPCF7R_Action_Save_Lead' ) ) {
115
+ add_action( 'restrict_manage_posts', array( 'WPCF7R_Leads_Manager', 'add_form_filter' ) );
116
+ add_filter( 'parse_query', array( 'WPCF7R_Leads_Manager', 'filter_request_query' ), 10 );
117
+ }
118
+ }
119
+
120
+ /**
121
+ * Initialize affiliate extensions
122
+ */
123
+ public function start_affiliate_extensions() {
124
+ $this->aff['accesibie'] = new Ext_Accessibe();
125
+ }
126
+
127
+ /**
128
+ * Dismiss admin notice
129
+ *
130
+ * @return void
131
+ */
132
+ public function dismiss_admin_notice() {
133
+ if ( isset( $_REQUEST['dismiss-cf7r-notices'] ) ) {
134
+ delete_option( 'wpcf7_redirect_notifications' );
135
+ }
136
+ }
137
+ /**
138
+ * Display admin notifications
139
+ *
140
+ * @return void
141
+ */
142
+ public function show_admin_notices() {
143
+ $notices = get_option( 'wpcf7_redirect_notifications' );
144
+
145
+ add_action(
146
+ 'admin_footer',
147
+ function() {
148
+ ?>
149
+ <script>jQuery(document.body).on('click', '.wpcf7r-notice .notice-dismiss' , function(e){
150
+ e.preventDefault();
151
+ var url = window.location.href;
152
+ if (url.indexOf('?') > -1){
153
+ url += '&dismiss-cf7r-notices=1'
154
+ }else{
155
+ url += '?dismiss-cf7r-notices=1'
156
+ }
157
+
158
+ window.location.href = url;
159
+ });</script>
160
+ <?php
161
+ }
162
+ );
163
+ if ( $notices ) {
164
+ foreach ( $notices as $notice_type => $notice ) :
165
+ ?>
166
+
167
+ <div class="notice is-dismissible <?php echo esc_html( $notice_type ); ?>">
168
+ <p><?php echo $notice ; ?></p>
169
+ </div>
170
+
171
+ <?php
172
+ endforeach;
173
+ }
174
+ }
175
+ /**
176
+ * Convert all old plugin settings to actions
177
+ */
178
+ public function migrate_all_forms() {
179
+ WPCF7r_Utils::auto_migrate( 'migrate_from_cf7_redirect', true );
180
+ }
181
+
182
+ /**
183
+ * Register plugins ajax hooks
184
+ */
185
+ public function add_ajax_hooks() {
186
+ // init modules.
187
+ add_action( 'plugins_loaded', array( 'WPCF7r_Module', 'init_modules' ) );
188
+ // handle send debug info.
189
+ add_action( 'wp_ajax_send_debug_info', array( $this->wpcf7_utils, 'send_debug_info' ) );
190
+
191
+ add_action( 'wp_ajax_close_ad_banner', array( $this->wpcf7_utils, 'close_banner' ) );
192
+
193
+ add_action( 'wp_ajax_wpcf7r_delete_action', array( $this->wpcf7_utils, 'delete_action_post' ) );
194
+
195
+ add_action( 'wp_ajax_wpcf7r_add_action', array( $this->wpcf7_utils, 'add_action_post' ) );
196
+ // save actions order.
197
+ add_action( 'wp_ajax_wpcf7r_set_action_menu_order', array( $this->wpcf7_utils, 'set_action_menu_order' ) );
198
+ // make an api test.
199
+ add_action( 'wp_ajax_wpcf7r_make_api_test', array( $this->wpcf7_utils, 'make_api_test' ) );
200
+ // get mailchimp lists.
201
+ add_action( 'wp_ajax_wpcf7r_get_mailchimp_lists', array( $this->wpcf7_utils, 'get_mailchimp_lists' ) );
202
+ // get popup template.
203
+ add_action( 'wp_ajax_wpcf7r_get_action_template', array( $this->wpcf7_utils, 'get_action_template' ) );
204
+
205
+ // alert conflicts.
206
+ add_action( 'admin_init', array( $this, 'alert_conflicts' ) );
207
+ // run the migration process.
208
+ add_action( 'wp_ajax_wpcf7r_migrate_all_forms', array( $this, 'migrate_all_forms' ) );
209
+
210
+ add_action( 'wp_ajax_nopriv_wpcf7r_get_nonce', array( $this, 'wpcf7r_get_nonce' ) );
211
+ add_action( 'wp_ajax_wpcf7r_get_nonce', array( $this, 'wpcf7r_get_nonce' ) );
212
+ // debug create form.
213
+ add_action( 'wp_ajax_import_from_debug', array( $this->wpcf7_utils, 'import_from_debug' ) );
214
+
215
+ }
216
+
217
+ /**
218
+ * Generate nonce field
219
+ *
220
+ * @return void
221
+ */
222
+ public function wpcf7r_get_nonce() {
223
+ $nonce_action = isset( $_POST['param'] ) && wp_unslash( sanitize_text_field( $_POST['param'] ) ) ? wp_unslash( sanitize_text_field( $_POST['param'] ) ) : '';
224
+
225
+ $nonce = wp_create_nonce( $nonce_action );
226
+
227
+ wp_send_json_success( array( 'nonce' => $nonce ) );
228
+ }
229
+
230
+ /**
231
+ * Alert the user of a conflict between free and premium plugin
232
+ */
233
+ public function alert_conflicts() {
234
+ if ( class_exists( 'Mailchimp' ) ) {
235
+ $reflector = new ReflectionClass( 'Mailchimp' );
236
+ /* Translators: the file location */
237
+ WPCF7r_Utils::add_admin_notice( 'alert', sprintf( __( 'There might be a conflict that causing mailchimp action not to function properly, disable any mailchimp plugin to avoid problems, mailchimp is already defined on %s', 'wpcf7-redirect' ), $reflector->getFileName() ) );
238
+ }
239
+ }
240
+
241
+ /**
242
+ * Get files required to run the plugin
243
+ */
244
+ public function load_dependencies() {
245
+ require_once WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-wpcf7r-list-table.php';
246
+ require_once WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-wpcf7r-leads-manager.php';
247
+ require_once WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-wpcf7r-lead.php';
248
+ require_once WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-wpcf7r-settings.php';
249
+ require_once WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-wpcf7r-submission.php';
250
+
251
+ $this->include_conditional_logic_file();
252
+
253
+ require_once WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-wpcf7r-utils.php';
254
+ require_once WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-wpcf7r-form-helper.php';
255
+ require_once WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-wpcf7r-post-types.php';
256
+ require_once WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-wpcf7r-actions.php';
257
+ require_once WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-wpcf7r-form.php';
258
+ require_once WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-wpcf7r-html.php';
259
+ require_once WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-qs-api.php';
260
+ require_once WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-wpcf7r-updates.php';
261
+ require_once WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-wpcf7r-action.php';
262
+ require_once WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-wpcf7r-user.php';
263
+ require_once WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-wpcf7r-mailchimp-helper.php';
264
+ require_once WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-wpcf7r-extensions.php';
265
+ require_once WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-wpcf7r-extension.php';
266
+ require_once WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-wpcf7r-module.php';
267
+
268
+ if ( ! class_exists( 'Mailchimp' ) ) {
269
+ require_once WPCF7_PRO_REDIRECT_BASE_PATH . 'vendor/autoload.php';
270
+ }
271
+
272
+ // Load all actions.
273
+ foreach ( glob( WPCF7_PRO_REDIRECT_CLASSES_PATH . 'actions/*.php' ) as $filename ) {
274
+ require_once $filename;
275
+ }
276
+
277
+ // Load all addons.
278
+ if ( is_dir( WPCF7_PRO_REDIRECT_ADDONS_PATH ) ) {
279
+ foreach ( glob( WPCF7_PRO_REDIRECT_ADDONS_PATH . '*.php' ) as $filename ) {
280
+ require_once $filename;
281
+ }
282
+ }
283
+
284
+ // Load affiliate extensions.
285
+ foreach ( glob( WPCF7_PRO_REDIRECT_CLASSES_PATH . 'aff/*.php' ) as $filename ) {
286
+ require_once $filename;
287
+ }
288
+ }
289
+
290
+ /**
291
+ * Check and include the conditional logic files if exists
292
+ */
293
+ private function include_conditional_logic_file() {
294
+ $paths = array(
295
+ WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-wpcf7r-conditions.php',
296
+ WPCF7_PRO_REDIRECT_ADDONS_PATH . 'class-wpcf7r-conditions.php',
297
+ );
298
+
299
+ foreach ( $paths as $path ) {
300
+ if ( file_exists( $path ) ) {
301
+ require_once $path;
302
+ }
303
+ }
304
+ }
305
+ }
classes/class-wpcf7r-extension.php ADDED
@@ -0,0 +1,462 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class for handling contact form 7 redirection pro extensions
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ class WPCF7R_Extension {
9
+ public function __construct( $extension ) {
10
+
11
+ $this->name = $extension['name'];
12
+ $this->title = $extension['title'];
13
+ $this->description = $extension['description'];
14
+ $this->icon = $extension['icon'];
15
+ $this->type = isset( $extension['type'] ) ? $extension['type'] : 'extension';
16
+ $this->btn_text = isset( $extension['btn_text'] ) ? $extension['btn_text'] : '';
17
+ $this->external_url = isset( $extension['external_url'] ) ? $extension['external_url'] : '';
18
+ $this->badge = isset( $extension['badge'] ) ? $extension['badge'] : '';
19
+ $this->classname = '';
20
+ $this->extension_file_name = '';
21
+ $this->sku = $this->get_sku();
22
+
23
+ if ( 'affiliate' !== $this->type ) {
24
+ $this->serial = $this->get_serial();
25
+ $this->extension_file_name = isset( $extension['filename'] ) ? $extension['filename'] : '';
26
+ $this->extension_ver = $this->get_ver();
27
+ $this->classname = $extension['classname'];
28
+
29
+ if ( ! $this->extension_file_exists() ) {
30
+ $this->reset_activation();
31
+
32
+ $this->deactivate_license();
33
+ }
34
+ }
35
+ }
36
+
37
+ /**
38
+ * Get affiliate url (if the extension is affiliated)
39
+ */
40
+ public function get_aff_url() {
41
+ return isset( $this->external_url ) ? $this->external_url : '';
42
+ }
43
+
44
+ /**
45
+ * Get the btn label
46
+ */
47
+ public function get_btn_text() {
48
+ return $this->btn_text;
49
+ }
50
+
51
+ /**
52
+ * Get the extension version
53
+ */
54
+ public function get_ver() {
55
+
56
+ $ver = '2.0';
57
+
58
+ if ( $this->extension_file_exists() ) {
59
+ $info_headers = array(
60
+ 'ver' => 'ver',
61
+ );
62
+
63
+ $info = get_file_data( $this->get_extension_file_path(), $info_headers );
64
+
65
+ $ver = $info['ver'];
66
+ }
67
+
68
+ return $ver;
69
+ }
70
+
71
+ /**
72
+ * Get the extension name
73
+ */
74
+ public function get_name() {
75
+ return $this->name;
76
+ }
77
+
78
+ /**
79
+ * Get the extension type
80
+ */
81
+ public function get_type() {
82
+ return $this->type;
83
+ }
84
+
85
+ /**
86
+ * Get the installed extension version
87
+ */
88
+ public function get_extension_ver() {
89
+ return isset( $this->extension_ver ) ? $this->extension_ver : '';
90
+ }
91
+
92
+ /**
93
+ * Get the path of the extension
94
+ */
95
+ public function get_extension_file_path() {
96
+ $path = '';
97
+
98
+ if ( class_exists( $this->get_class_name() ) && class_exists( 'ReflectionClass' ) ) {
99
+ $reflector = new ReflectionClass( $this->get_class_name() );
100
+ $path = $reflector->getFileName();
101
+ } elseif ( $this->extension_file_name ) {
102
+ $path = wpcf7r_get_addon_path( $this->extension_file_name );
103
+ }
104
+
105
+ return $path;
106
+ }
107
+
108
+ /**
109
+ * Get the path of the extension for plugin activation
110
+ */
111
+ public function get_extension_relative_path() {
112
+
113
+ $relative_path = $this->get_name() . '/' . $this->extension_file_name;
114
+
115
+ return $relative_path;
116
+ }
117
+
118
+ /**
119
+ * Get the extension file name
120
+ *
121
+ * @return void
122
+ */
123
+ public function get_class_name() {
124
+ return $this->classname;
125
+ }
126
+
127
+ /**
128
+ * Check if the file required for the extension exists
129
+ */
130
+ public function extension_file_exists() {
131
+ return file_exists( $this->get_extension_file_path() );
132
+ }
133
+
134
+ /**
135
+ * Set the required update flag
136
+ */
137
+ public function set_updated() {
138
+ delete_option( 'wpcf7r_extension-needs-update-' . $this->get_name() );
139
+ }
140
+
141
+ /**
142
+ * Check if an extension requires an update
143
+ *
144
+ * @return boolean
145
+ */
146
+ public function has_update() {
147
+ return get_option( 'wpcf7r_extension-needs-update-' . $this->get_name() ) && $this->is_active();
148
+ }
149
+
150
+ /**
151
+ * Set the required update flag
152
+ */
153
+ public function set_needs_update() {
154
+ update_option( 'wpcf7r_extension-needs-update-' . $this->get_name(), true );
155
+ }
156
+
157
+ /**
158
+ * Get the HTML box to display the promo box
159
+ */
160
+ public function get_action_promo() {
161
+ include( WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'extensions/extension-promo-box.php' );
162
+ }
163
+
164
+ /**
165
+ * If the plugin file exists but license was not activated
166
+ *
167
+ * @return void
168
+ */
169
+ public function needs_activation() {
170
+ return ! $this->is_active() && $this->extension_file_exists();
171
+ }
172
+ /**
173
+ * Check if the license is active
174
+ */
175
+ public function is_active() {
176
+ return $this->get_activation_data() && $this->extension_file_exists();
177
+ }
178
+
179
+ /**
180
+ * Get the saved serial number
181
+ */
182
+ public function get_serial() {
183
+ return get_option( 'wpcf7r_activation_serial-' . $this->get_name() );
184
+ }
185
+
186
+ /**
187
+ * Get the saved license activation data
188
+ */
189
+ public function get_activation_data() {
190
+ return get_option( 'wpcf7r_activation_data-' . $this->get_name() );
191
+ }
192
+
193
+ /**
194
+ * Activate the serial via API
195
+ *
196
+ * @param $serial
197
+ */
198
+ public function activate( $serial ) {
199
+ $this->api = new Qs_Api();
200
+
201
+ if ( ! $serial ) {
202
+ die( '-1' );
203
+ }
204
+
205
+ $activation_id = $this->get_activation_data();
206
+
207
+ $this->sku = $this->get_name();
208
+
209
+ if ( $activation_id ) {
210
+ $is_valid = $this->api->validate_serial( $activation_id, $serial, $this->get_name() );
211
+ } else {
212
+ $is_valid = $this->api->activate_serial( $serial, $this->get_name() );
213
+
214
+ if ( is_wp_error( $is_valid ) ) {
215
+ $is_valid = $this->api->activate_serial( $serial, $this->get_name() . '-unlimited' );
216
+ $this->sku = $this->get_name() . '-unlimited';
217
+ }
218
+
219
+ if ( is_wp_error( $is_valid ) ) {
220
+ $is_valid = $this->api->activate_serial( $serial, $this->get_name() . '-pro' );
221
+ $this->sku = $this->get_name() . '-pro';
222
+ }
223
+ }
224
+
225
+ //serial was not valid
226
+ if ( is_wp_error( $is_valid ) ) {
227
+
228
+ $message = $is_valid->get_error_message();
229
+
230
+ if ( is_object( $message ) && isset( $message->license_key ) ) {
231
+ $message = $message->license_key[0];
232
+ }
233
+
234
+ $this->reset_activation();
235
+
236
+ $this->deactivate_license();
237
+
238
+ $response = array(
239
+ 'error' => $message,
240
+ );
241
+
242
+ } else {
243
+
244
+ //serial was valid, update the activation key for future validation
245
+ $this->set_activation( $is_valid->data, $serial );
246
+
247
+ $response = $this->save_extension_file();
248
+
249
+ if ( ! isset( $response['error'] ) ) {
250
+ $response['extension_html'] = $this->ajax_extension_html();
251
+ }
252
+
253
+ $file_path = $this->get_destination_path() . '/' . $this->extension_file_name;
254
+
255
+ //check if the require file exists
256
+ if ( file_exists( $file_path ) ) {
257
+ //check if the class exists if not include the required file
258
+ if ( ! class_exists( $this->classname ) ) {
259
+ if ( $file_path ) {
260
+ include( $file_path );
261
+ }
262
+ }
263
+
264
+ //if now both class exists and has a setup method.. run it
265
+ if ( class_exists( $this->classname ) && method_exists( $this->classname, 'setup' ) ) {
266
+ call_user_func( array( $this->classname, 'setup' ) );
267
+ }
268
+
269
+ $this->activate_new_plugin();
270
+ }
271
+ }
272
+
273
+ return $response;
274
+ }
275
+
276
+ public function get_destination_path() {
277
+ return WPCF7_PRO_REDIRECT_PLUGINS_PATH . $this->get_name();
278
+ }
279
+
280
+ /**
281
+ * Save the Newly downloaded file to the plugins dir
282
+ */
283
+ public function save_extension_file() {
284
+ global $wp_filesystem;
285
+
286
+ $this->api = isset( $this->api ) && $this->api ? $this->api : new Qs_Api();
287
+
288
+ $response = array();
289
+
290
+ $file_path = $this->api->get_extension_file( $this->get_activation_data(), $this->get_sku() );
291
+
292
+ if ( is_wp_error( $file_path ) ) {
293
+ $response = array(
294
+ 'error' => $file_path->get_error_message(),
295
+ );
296
+
297
+ $this->reset_activation();
298
+ } else {
299
+
300
+ WP_Filesystem();
301
+
302
+ $destination_path = $this->get_destination_path();
303
+
304
+ /**
305
+ * Create a directory for the action addons and create index.php for security
306
+ */
307
+ if ( ! is_dir( $destination_path ) ) {
308
+ @mkdir( $destination_path );
309
+ $wp_filesystem->put_contents( $destination_path . '/index.php', 'SILENCE IS GOLDEN', FS_CHMOD_FILE );
310
+ }
311
+
312
+ if ( ! is_dir( $destination_path ) ) {
313
+ $response = array(
314
+ /* translators: %s: Destination path */
315
+ 'error' => sprintf( __( 'Cannot create %s. Please create a directory manualy or fix permission issue.', 'wpcf7-redirect' ), $destination_path ),
316
+ );
317
+ } else {
318
+ $unzipfile = unzip_file( $file_path, $destination_path );
319
+
320
+ unlink( $file_path );
321
+
322
+ if ( is_wp_error( $unzipfile ) ) {
323
+ $response = array(
324
+ 'error' => $unzipfile->get_error_message(),
325
+ );
326
+ $this->reset_activation();
327
+ } else {
328
+ $this->set_updated();
329
+ }
330
+ }
331
+ }
332
+
333
+ return $response;
334
+ }
335
+
336
+ /**
337
+ * Activate new downloaded extension
338
+ *
339
+ * @return void
340
+ */
341
+ public function activate_new_plugin() {
342
+
343
+ if ( ! function_exists( 'activate_plugin' ) ) {
344
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
345
+ }
346
+
347
+ if ( ! is_plugin_active( $this->get_extension_relative_path() ) ) {
348
+ activate_plugin( $this->get_extension_relative_path() );
349
+ }
350
+
351
+ }
352
+ /**
353
+ * Get extension badge text
354
+ *
355
+ * @return void
356
+ */
357
+ public function get_badge() {
358
+ return $this->badge ? "<span class='badge'>" . $this->badge . '</span>' : '';
359
+ }
360
+
361
+ /**
362
+ * Set all data related with the plugin activation
363
+ *
364
+ * @param $validation_data
365
+ * @param $serial
366
+ */
367
+ public function set_activation( $validation_data, $serial ) {
368
+ update_option( 'wpcf7r_activation_id-' . $this->get_name(), $validation_data->activation_id );
369
+ update_option( 'wpcf7r_activation_expiration-' . $this->get_name(), $validation_data->expire );
370
+ update_option( 'wpcf7r_activation_data-' . $this->get_name(), $validation_data );
371
+ update_option( 'wpcf7r_activation_serial-' . $this->get_name(), $serial );
372
+ update_option( 'wpcf7r_activation_' . $this->get_name() . '-sku', $this->sku );
373
+ }
374
+
375
+ /**
376
+ * Clear all activation data
377
+ */
378
+ public function reset_activation() {
379
+ delete_option( 'wpcf7r_activation_id-' . $this->get_name() );
380
+ delete_option( 'wpcf7r_activation_expiration-' . $this->get_name() );
381
+ delete_option( 'wpcf7r_activation_data-' . $this->get_name() );
382
+ delete_option( 'wpcf7r_activation_serial-' . $this->get_name() );
383
+ update_option( 'wpcf7r_activation_' . $this->get_name() . '-sku', $this->sku );
384
+ }
385
+
386
+ public function get_sku() {
387
+ return isset( $this->sku ) && $this->sku ? $this->sku : get_option( 'wpcf7r_activation_' . $this->get_name() . '-sku' );
388
+ }
389
+ /**
390
+ * Get the activation key
391
+ */
392
+ public function get_activation_id() {
393
+ return get_option( 'wpcf7r_activation_id-' . $this->get_name() );
394
+ }
395
+
396
+ /**
397
+ * Deactivate extension license
398
+ */
399
+ public function deactivate_license( $serial = '' ) {
400
+
401
+ $api = new Qs_Api();
402
+
403
+ $response = array();
404
+
405
+ $serial = $serial ? $serial : $this->get_serial();
406
+
407
+ $activation_id = $this->get_activation_id();
408
+
409
+ if ( ! $activation_id ) {
410
+ $this->reset_activation();
411
+ } else {
412
+ $results = $api->deactivate_liscense( $activation_id, $serial, $this->get_name() );
413
+
414
+ $this->reset_activation();
415
+ }
416
+
417
+ $response['extension_html'] = $this->ajax_extension_html();
418
+
419
+ return $response;
420
+ }
421
+
422
+ /**
423
+ * Ajax function for getting the extension html box
424
+ */
425
+ public function ajax_extension_html() {
426
+ ob_start();
427
+
428
+ $this->get_action_promo();
429
+
430
+ $html = ob_get_clean();
431
+
432
+ return $html;
433
+ }
434
+
435
+ /**
436
+ * Get the link to purchase the extension
437
+ */
438
+ public function get_purchase_link() {
439
+ return WPCF7_PRO_REDIRECT_PLUGIN_PAGE_URL . $this->name;
440
+ }
441
+
442
+ /**
443
+ * Get the extension description
444
+ */
445
+ public function get_description() {
446
+ return $this->description;
447
+ }
448
+
449
+ /**
450
+ * Get the extension icon
451
+ */
452
+ public function get_icon() {
453
+ return $this->icon;
454
+ }
455
+
456
+ /**
457
+ * Get the extension name
458
+ */
459
+ public function get_title() {
460
+ return $this->title;
461
+ }
462
+ }
classes/class-wpcf7r-extensions.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit;
3
+
4
+ class WPCF7R_Extensions {
5
+
6
+ public function __construct() {
7
+ $this->available_extensions = wpcf7_get_extensions();
8
+ $this->set_available_extensions();
9
+ }
10
+
11
+ /**
12
+ * Set available extensions
13
+ */
14
+ private function set_available_extensions() {
15
+ foreach ( $this->available_extensions as $extension ) {
16
+ $this->extensions[] = new WPCF7R_Extension( $extension );
17
+ }
18
+ }
19
+
20
+ /**
21
+ * Initialize extensions table tab
22
+ */
23
+ public function init() {
24
+ $this->display();
25
+ }
26
+
27
+ /**
28
+ * View available extensions
29
+ */
30
+ public function get_extensions() {
31
+ return $this->extensions;
32
+ }
33
+
34
+ /**
35
+ * Display the extensions list
36
+ *
37
+ * @return void
38
+ */
39
+ public function display() {
40
+ include( WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'extensions.php' );
41
+ }
42
+ }
classes/class-wpcf7r-form-helper.php ADDED
@@ -0,0 +1,598 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The main class that manages the plugin.
4
+ *
5
+ * @package wpcf7r
6
+ */
7
+
8
+ defined( 'ABSPATH' ) || exit;
9
+
10
+ /**
11
+ * Class WPCF7r_Form_Helper - Adds contact form scripts and actions
12
+ */
13
+ class WPCF7r_Form_Helper {
14
+
15
+ /**
16
+ * Class Constructor
17
+ */
18
+ public function __construct() {
19
+
20
+ $this->plugin_url = WPCF7_PRO_REDIRECT_BASE_URL;
21
+ $this->assets_js_lib = WPCF7_PRO_REDIRECT_BASE_URL . 'assets/lib/';
22
+ $this->assets_js_url = WPCF7_PRO_REDIRECT_BASE_URL . 'assets/js/';
23
+ $this->assets_css_url = WPCF7_PRO_REDIRECT_BASE_URL . 'assets/css/';
24
+ $this->build_js_url = WPCF7_PRO_REDIRECT_BASE_URL . 'build/js/';
25
+ $this->build_css_url = WPCF7_PRO_REDIRECT_BASE_URL . 'build/css/';
26
+ $this->extensions = wpcf7_get_extensions();
27
+ $this->add_actions();
28
+
29
+ }
30
+
31
+ /**
32
+ * Add Actions
33
+ */
34
+ private function add_actions() {
35
+
36
+ global $pagenow;
37
+
38
+ add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
39
+ add_action( 'wpcf7_editor_panels', array( $this, 'add_panel' ) );
40
+ add_action( 'wpcf7_after_save', array( $this, 'store_meta' ) );
41
+ // add contact form scripts.
42
+ add_action( 'wp_enqueue_scripts', array( $this, 'front_end_scripts' ) );
43
+ // add contact form scripts for admin panel.
44
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_backend' ) );
45
+ add_action( 'wp_ajax_activate_wpcf7r_extension', array( $this, 'activate_extension' ) );
46
+ add_action( 'wp_ajax_deactivate_wpcf7r_extension', array( $this, 'deactivate_plugin_license' ) );
47
+ add_action( 'admin_init', array( $this, 'maybe_update_extensions_check' ), 10 );
48
+ add_action( 'wp_ajax_wpcf7r_extension_update', array( $this, 'maybe_update_extension' ), 10 );
49
+ add_action( 'wp_ajax_get_coupon', array( $this, 'get_coupon' ) );
50
+ add_action( 'wpcf7_admin_notices', array( $this, 'render_discount_banner' ), 15, 3 );
51
+ add_action( 'admin_init', array( $this, 'dismiss_ads' ) );
52
+ }
53
+
54
+ /**
55
+ * Check if an extension requires an update
56
+ *
57
+ * @return void
58
+ */
59
+ public function maybe_update_extension() {
60
+
61
+ $extension_name = isset( $_POST['extension_name'] ) && $_POST['extension_name'] ? sanitize_text_field( $_POST['extension_name'] ) : '';
62
+
63
+ if ( $extension_name ) {
64
+ $extension = $this->get_extension_object( $extension_name );
65
+
66
+ if ( $extension->has_update() ) {
67
+ $results = $extension->save_extension_file();
68
+ }
69
+
70
+ $results['html'] = $extension->ajax_extension_html();
71
+ }
72
+
73
+ wp_send_json( $results );
74
+ }
75
+
76
+ /**
77
+ * Check if there is a need for update check.
78
+ *
79
+ * @return void
80
+ */
81
+ public function maybe_update_extensions_check() {
82
+
83
+ $current = get_transient( 'update_wpcf7r_extensions' );
84
+
85
+ if ( $current && ! isset( $_GET['force-check'] ) ) {
86
+ return;
87
+ }
88
+
89
+ $current = new stdClass();
90
+
91
+ $current->version_checked = $wp_version;
92
+ $current->last_checked = current_time( 'timestamp' );
93
+
94
+ set_transient( 'update_wpcf7r_extensions', $current, HOUR_IN_SECONDS * 24 * 12 );
95
+
96
+ $this->check_for_extensions_update();
97
+
98
+ }
99
+
100
+ /**
101
+ * Check for extension update from API.
102
+ *
103
+ * @return void
104
+ */
105
+ public function check_for_extensions_update() {
106
+
107
+ $api = new Qs_Api();
108
+
109
+ foreach ( $this->extensions as $extension_type => $extension_details ) {
110
+
111
+ $extension = new WPCF7R_Extension( $extension_details );
112
+
113
+ if ( $extension->is_active() ) {
114
+
115
+ $has_update = $api->extension_has_update( $extension );
116
+
117
+ if ( $has_update ) {
118
+
119
+ $extension->set_needs_update();
120
+
121
+ } else {
122
+
123
+ $extension->set_updated();
124
+
125
+ }
126
+ }
127
+ }
128
+
129
+ }
130
+
131
+ /**
132
+ * Get the extension object
133
+ *
134
+ * @param [string] $extention_name - the name of the extension.
135
+ * @return object - $extention_object - the extension object.
136
+ */
137
+ public function get_extension_object( $extention_name ) {
138
+
139
+ $extention_object = isset( $this->extensions[ $extention_name ] ) ? new WPCF7R_Extension( $this->extensions[ $extention_name ] ) : '';
140
+
141
+ return $extention_object;
142
+
143
+ }
144
+
145
+ /**
146
+ * Deactivate plugin license.
147
+ *
148
+ * @return void
149
+ */
150
+ public function deactivate_plugin_license() {
151
+
152
+ if ( ! isset( $_POST['extension_name'] ) ) {
153
+
154
+ $results = array(
155
+ 'message' => __( 'Missing name or serial', 'wpcf7-redirect' ),
156
+ );
157
+
158
+ } else {
159
+
160
+ $extentsion_settings = $this->extensions[ $_POST['extension_name'] ];
161
+
162
+ if ( $extentsion_settings ) {
163
+ $extentsion = new WPCF7R_Extension( $extentsion_settings );
164
+ $results = $extentsion->deactivate_license();
165
+ }
166
+ }
167
+
168
+ wp_send_json( $results );
169
+
170
+ }
171
+
172
+ /**
173
+ * Activate extension license.
174
+ *
175
+ * @return void
176
+ */
177
+ public function activate_extension() {
178
+
179
+ if ( ! isset( $_POST['extension_name'] ) || ! isset( $_POST['serial'] ) ) {
180
+ $results = array(
181
+ 'message' => __( 'Missing name or serial', 'wpcf7-redirect' ),
182
+ );
183
+ } else {
184
+
185
+ $extentsion_settings = $this->extensions[ $_POST['extension_name'] ];
186
+
187
+ if ( $extentsion_settings ) {
188
+ $extentsion = new WPCF7R_extension( $extentsion_settings );
189
+ $serial = sanitize_text_field( $_POST['serial'] );
190
+ $results = $extentsion->activate( $serial );
191
+ } else {
192
+ $results['extension_html'] = __( 'Somthing went wrong', 'wpcf7-redirect' );
193
+ }
194
+ }
195
+
196
+ wp_send_json( $results );
197
+ }
198
+
199
+ /**
200
+ * Dismiss plugin ads
201
+ */
202
+ public function dismiss_ads() {
203
+
204
+ if ( isset( $_GET['wpcf7_redirect_dismiss_banner'] ) && '1' === $_GET['wpcf7_redirect_dismiss_banner'] ) {
205
+ update_option( 'wpcf7_redirect_dismiss_banner', 1 );
206
+ }
207
+
208
+ }
209
+
210
+ /**
211
+ * Only load scripts when contact form instance is created
212
+ */
213
+ public function front_end_scripts() {
214
+
215
+ wp_register_style( 'wpcf7-redirect-script-frontend', $this->build_css_url . 'wpcf7-redirect-frontend.min.css', '1.1' );
216
+ wp_enqueue_style( 'wpcf7-redirect-script-frontend' );
217
+ wp_register_script( 'wpcf7-redirect-script', $this->build_js_url . 'wpcf7-redirect-frontend-script.js', array( 'jquery' ), '1.1', true );
218
+ wp_enqueue_script( 'wpcf7-redirect-script' );
219
+ wp_localize_script( 'wpcf7-redirect-script', 'wpcf7r', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );
220
+
221
+ // Load active extensions scripts and styles.
222
+ $installed_extensions = wpcf7r_get_available_actions();
223
+
224
+ foreach ( $installed_extensions as $installed_extension ) {
225
+ if ( method_exists( $installed_extension['handler'], 'enqueue_frontend_scripts' ) ) {
226
+ call_user_func( array( $installed_extension['handler'], 'enqueue_frontend_scripts' ) );
227
+ }
228
+ }
229
+
230
+ // add support for other plugins
231
+ do_action( 'wpcf7_redirect_enqueue_frontend', $this );
232
+ }
233
+
234
+ /**
235
+ * Check if the current page is the plugin settings page
236
+ */
237
+ public function is_wpcf7_settings_page() {
238
+ return isset( $_GET['page'] ) && 'wpc7_redirect' === $_GET['page'];
239
+ }
240
+
241
+ /**
242
+ * Check if the current admin post type is a lead post type.
243
+ *
244
+ * @return boolean
245
+ */
246
+ public function is_wpcf7_lead_page() {
247
+ return 'wpcf7r_leads' === get_post_type();
248
+ }
249
+
250
+ /**
251
+ * Check if the current admin page is accesibe plugin page.
252
+ *
253
+ * @return boolean
254
+ */
255
+ public function is_accesibe_page() {
256
+ $screen = get_current_screen();
257
+
258
+ return 'toplevel_page_' . qs_get_plugin_display_name() === $screen->base;
259
+ }
260
+
261
+ /**
262
+ * Check if the current page is the contact form edit screen
263
+ */
264
+ public function is_wpcf7_edit() {
265
+ global $post;
266
+
267
+ $wpcf7_page = isset( $_GET['page'] ) && 'wpcf7' === $_GET['page'] && isset( $_GET['post'] ) && $_GET['post'];
268
+ $wpcf7_page_new_page = isset( $_GET['page'] ) && 'wpcf7-new' === $_GET['page'];
269
+ $wpcf7_post = isset( $post->post_type ) && 'wpcf7_contact_form' === $post->post_type ? true : false;
270
+
271
+ return $wpcf7_page_new_page || $wpcf7_page || $wpcf7_post;
272
+ }
273
+
274
+ /**
275
+ * Load plugin textdomain.
276
+ */
277
+ public function load_textdomain() {
278
+ load_plugin_textdomain( 'wpcf7-redirect', false, basename( dirname( __FILE__ ) ) . '/lang' );
279
+ }
280
+
281
+ /**
282
+ * Enqueue theme styles and scripts - back-end
283
+ */
284
+ public function enqueue_backend() {
285
+
286
+ if ( $this->is_wpcf7_edit() || $this->is_wpcf7_settings_page() || $this->is_wpcf7_lead_page() || $this->is_accesibe_page() ) {
287
+
288
+ wp_enqueue_style( 'admin-build', $this->build_css_url . 'wpcf7-redirect-backend.css', array(), WPCF7_PRO_REDIRECT_PLUGIN_VERSION );
289
+ wp_enqueue_script( 'admin-build-js', $this->build_js_url . 'wpcf7-redirect-backend-script.js', array(), WPCF7_PRO_REDIRECT_PLUGIN_VERSION, true );
290
+ wp_enqueue_script(
291
+ array(
292
+ 'jquery-ui-core',
293
+ 'jquery-ui-sortable',
294
+ 'wp-color-picker',
295
+ )
296
+ );
297
+
298
+ // Load active extensions scripts and styles.
299
+ $installed_extensions = wpcf7r_get_available_actions();
300
+
301
+ foreach ( $installed_extensions as $installed_extension ) {
302
+ if ( method_exists( $installed_extension['handler'], 'enqueue_backend_scripts' ) ) {
303
+ call_user_func( array( $installed_extension['handler'], 'enqueue_backend_scripts' ) );
304
+ }
305
+ }
306
+
307
+ // add support for other plugins.
308
+ do_action( 'wpcf_7_redirect_admin_scripts', $this );
309
+ }
310
+ }
311
+
312
+ /**
313
+ * Store form data.
314
+ *
315
+ * @param [object] $cf7 -contact form object.
316
+ */
317
+ public function store_meta( $cf7 ) {
318
+
319
+ $form = get_cf7r_form( $cf7->id() );
320
+ $form->store_meta( $cf7 );
321
+ }
322
+
323
+ /**
324
+ * Adds a tab to the editor on the form edit page
325
+ *
326
+ * @param array $panels An array of panels. Each panel has a callback function.
327
+ */
328
+ public function add_panel( $panels ) {
329
+
330
+ // Disable plugin functionality for old contact form 7 installations.
331
+
332
+ if ( wpcf7_get_cf7_ver() > 4.8 ) {
333
+
334
+ $panels['redirect-panel'] = array(
335
+ 'title' => __( 'Actions', 'wpcf7-redirect' ),
336
+ 'callback' => array( $this, 'create_panel_inputs' ),
337
+ );
338
+
339
+ $panels['extensions-panel'] = array(
340
+ 'title' => __( 'Extensions', 'wpcf7-redirect' ),
341
+ 'callback' => array( $this, 'extensions_manager' ),
342
+ );
343
+
344
+ if ( is_wpcf7r_debug() ) {
345
+
346
+ $panels['debug-panel'] = array(
347
+ 'title' => __( 'Debug', 'wpcf7-redirect' ),
348
+ 'callback' => array( $this, 'wpcf7_debug' ),
349
+ );
350
+
351
+ }
352
+ }
353
+
354
+ return $panels;
355
+ }
356
+
357
+ /**
358
+ * Get the default fields
359
+ */
360
+ public static function get_plugin_default_fields() {
361
+
362
+ return array(
363
+ array(
364
+ 'name' => 'redirect_type',
365
+ 'type' => 'text',
366
+ ),
367
+ );
368
+ }
369
+
370
+ /**
371
+ * Handler to retrive banner to display
372
+ * At the moment used to display the pro version bannner
373
+ */
374
+ public function banner() {
375
+ $banner_manager = new Banner_Manager();
376
+ $banner_manager->show_banner();
377
+ }
378
+
379
+ /**
380
+ * Create the panel inputs.
381
+ *
382
+ * @param object $cf7 - Contact form 7 post object.
383
+ */
384
+ public function create_panel_inputs( $cf7 ) {
385
+
386
+ $form = get_cf7r_form( $cf7->id() );
387
+
388
+ $form->init();
389
+ }
390
+
391
+ /**
392
+ * Manage contact form 7 redirection pro extensions
393
+ *
394
+ * @param object $cf7 - Contact form 7 post object.
395
+ */
396
+ public function extensions_manager( $cf7 ) {
397
+
398
+ $this->extensions_manager = $this->get_extension_manager();
399
+ $this->extensions_manager->init();
400
+
401
+ }
402
+
403
+ /**
404
+ * Get extension manager instance
405
+ *
406
+ * @return object - extensions manager object.
407
+ */
408
+ public function get_extension_manager() {
409
+ return isset( $this->extensions_manager ) ? $this->extensions_manager : new WPCF7R_Extensions();
410
+ }
411
+
412
+ /**
413
+ * Display debug tab on contact form
414
+ *
415
+ * @param $cf7 - Contact form 7 post object.
416
+ * @return void
417
+ */
418
+ public function wpcf7_debug( $cf7 ) {
419
+
420
+ global $wp_version;
421
+
422
+ $form_json = self::get_debug_data( $cf7->id() );
423
+
424
+ echo '<h3>' . __( 'Debug Information', 'wpcf7-redirect' ) . '</h3>';
425
+ echo '<div>' . __( 'The debug information includes the following details', 'wpcf7-redirect' ) . '</div><ul>';
426
+ echo '<li>' . __( 'Form post data.', 'wpcf7-redirect' ) . '</li>';
427
+ echo '<li>' . __( 'Actions post data.', 'wpcf7-redirect' ) . '</li>';
428
+ echo '<li>' . __( 'PHP Version', 'wpcf7-redirect' ) . '</li>';
429
+ echo '<li>' . __( 'Installed plugins list', 'wpcf7-redirect' ) . '</li>';
430
+ echo '<li>' . __( 'WordPress Version', 'wpcf7-redirect' ) . '</li>';
431
+ echo '</ul>';
432
+ echo '<div style="color:red;font-size:18px;margin-bottom:20px;">' . __( 'The data is used for debug purposes only!', 'wpcf7-redirect' ) . '</div>';
433
+ echo "<div><textarea style='width:100%;height:200px;margin-bottom:40px;font-size:11px'>{$form_json}</textarea><br/></div>";
434
+ echo '<input type="submit" class="button button-primary send-debug-info" value="Send Debug Report"/><br/><br/>';
435
+ echo '<label><input type="checkbox" class="approve-debug" /> I approve sending debug information to Query Solutions support team.</label>';
436
+
437
+ }
438
+
439
+ /**
440
+ * Get encoded debug data
441
+ *
442
+ * @param $form_id - contact form 7 ID.
443
+ * @return void
444
+ */
445
+ public static function get_debug_data( $form_id ) {
446
+ global $wp_version;
447
+
448
+ $cf7r_form = get_cf7r_form( (int) $form_id );
449
+
450
+ $form_json = base64_encode(
451
+ serialize(
452
+ array(
453
+ 'actions' => $cf7r_form->get_active_actions(),
454
+ 'form_meta' => get_post_custom( $form_id ),
455
+ 'form_post' => get_post( $form_id ),
456
+ 'plugins' => json_encode( get_plugins() ),
457
+ 'phpver' => phpversion(),
458
+ 'wp_version' => $wp_version,
459
+ 'site_url' => home_url(),
460
+ )
461
+ )
462
+ );
463
+
464
+ return $form_json;
465
+ }
466
+
467
+ /**
468
+ * Render discount banner
469
+ *
470
+ * @param [object] $page - the current page.
471
+ * @param [object] $action - the required action.
472
+ * @param [object] $object - contact form 7 object.
473
+ */
474
+ public function render_discount_banner( $page, $action, $object ) {
475
+
476
+ if ( 'edit' === $action ) {
477
+ if ( ! get_option( 'wpcf7_redirect_dismiss_banner' ) ) :
478
+ ?>
479
+ <div class="rp-overlay">
480
+ <div class="rp-discount">
481
+ <button type="button" class="rp-close" aria-label="<?php _e( 'Close Banner', 'wpcf7-redirect' ); ?>" title="<?php _e( 'Close Banner', 'wpcf7-redirect' ); ?>">&times;</button>
482
+ <span class="rp-top-title">
483
+ <?php _e( 'Redirection Pro for Contact Form 7', 'wpcf7-redirect' ); ?>
484
+ </span>
485
+ <span class="rp-title-large">
486
+ <?php _e( 'Get 20% Off', 'wpcf7-redirect' ); ?>
487
+ </span>
488
+ <ul class="rp-features-list">
489
+ <li>
490
+ <?php _e( 'Get 20% OffUpgrade your Contact Form 7 experience', 'wpcf7-redirect' ); ?>
491
+ </li>
492
+ <li>
493
+ <?php _e( 'With conditional actions management', 'wpcf7-redirect' ); ?>
494
+ </li>
495
+ </ul>
496
+ <div class="rp-contact-form">
497
+ <span class="rp-contact-form-title">
498
+ <?php _e( 'With conditional actions managementGet it now -', 'wpcf7-redirect' ); ?>
499
+ </span>
500
+ <div class="rp-cols">
501
+ <div class="rp-col-form">
502
+ <div class="rp-contact-form-form">
503
+ <div class="input-wrap">
504
+ <input type="email" name="rp_user_email" id="rp_user_email" aria-label="Enter your e-mail here" value="<?php echo get_option( 'admin_email' ); ?>" placeholder="Enter your e-mail here" />
505
+ <button class="btn-rp-submit" aria-label="Contact Form 7 Redirection Pro - submit application for a discount">
506
+ <span class="rp-icon-plane"></span>
507
+ </button>
508
+ </div>
509
+ <div class="checkbox-wrap">
510
+ <input type="checkbox" name="rp_get_offers" id="rp_get_offers" value="0">
511
+ <label for="rp_get_offers">
512
+ <?php _e( 'Keep me up to date on updates and exclusive offers', 'wpcf7-redirect' ); ?>
513
+ </label>
514
+ </div>
515
+ <div class="rp-form-message">
516
+ <span class="rp-loader"></span>
517
+ </div>
518
+ </div>
519
+ </div>
520
+ <div class="rp-col-featured">
521
+ <a href="<?php echo WPCF7_PRO_REDIRECT_PLUGIN_PAGE_URL; ?>" rel="noopener" target="_blank">
522
+ <span class="rp-text">
523
+ <?php _e( 'Featured in:', 'wpcf7-redirect' ); ?>
524
+ </span>
525
+ <span class="logo-querysol"></span>
526
+ </a>
527
+ </div>
528
+ </div>
529
+ </div>
530
+ <footer class="rp-footer">
531
+ <div class="rp-footer-top">
532
+ <strong><?php _e( 'WHY IT’S THE MIGHTIEST', 'wpcf7-redirect' ); ?></strong><?php _e( ' - Powerful conditional logic - Manage custom error messages - Manage direction rules -', 'wpcf7-redirect' ); ?>
533
+ <?php _e( 'Mailchimp integration - Paypal integration - Manage Google/Facebook Pixels', 'wpcf7-redirect' ); ?>
534
+ <a href="<?php echo WPCF7_PRO_REDIRECT_PLUGIN_PAGE_URL; ?>" target="_blank" rel="noopener">
535
+ <?php _e( 'Learn More', 'wpcf7-redirect' ); ?>
536
+ </a>
537
+ </div>
538
+ <div class="rp-footer-bottom">
539
+ <?php _e( 'Query Solutions Ltd. 2010 Ⓒ', 'wpcf7-redirect' ); ?>
540
+ </div>
541
+ </footer>
542
+ </div>
543
+ </div>
544
+ <?php
545
+ endif;
546
+ }
547
+ }
548
+
549
+ /**
550
+ * Get coupon ajax function
551
+ */
552
+ public function get_coupon() {
553
+ $data = $_POST['data'];
554
+
555
+ $email = isset( $data['email'] ) && is_email( $data['email'] ) ? $data['email'] : false;
556
+
557
+ if ( ! $email ) {
558
+ $results = array(
559
+ 'status' => 'rp-error',
560
+ 'message' => 'Please enter a valid email.',
561
+ );
562
+
563
+ wp_send_json( $results );
564
+ } else {
565
+ $ip = $_SERVER['REMOTE_ADDR'];
566
+ $url = home_url();
567
+ $accept = sanitize_text_field( $data['get_offers'] );
568
+ $params = array(
569
+ 'ip_address' => $ip,
570
+ 'accept' => $accept,
571
+ 'email' => $email,
572
+ 'url' => $url,
573
+ );
574
+
575
+ $params = http_build_query( $params );
576
+
577
+ $endpoint = WPCF7_PRO_REDIRECT_PLUGIN_PAGE_URL . "wp-json/api-v1/get-coupon?{$params}";
578
+
579
+ $response = wp_remote_post( $endpoint );
580
+
581
+ $body = json_decode( wp_remote_retrieve_body( $response ), true );
582
+
583
+ if ( isset( $body['message'] ) ) {
584
+ $results = array(
585
+ 'status' => 'rp-success',
586
+ 'message' => $body['message'],
587
+ );
588
+ } elseif ( isset( $body['redirect'] ) ) {
589
+ $results = array(
590
+ 'status' => 'rp-success',
591
+ 'url' => $body['redirect'],
592
+ );
593
+ }
594
+ }
595
+
596
+ wp_send_json( $results );
597
+ }
598
+ }
classes/class-wpcf7r-form.php ADDED
@@ -0,0 +1,648 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Form - Container class that wraps the CF7 form object and adds functionality
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ class WPCF7R_Form {
9
+ // Refrence to the mail tags
10
+ public static $mail_tags;
11
+
12
+ // Refrence to the current contact form 7 form
13
+ public static $cf7_form;
14
+
15
+ // Save refrence to the current instance
16
+ public static $instance;
17
+ public static $action_to_submit;
18
+
19
+ // holds an array of items remove from $_POST for security reasons
20
+ public static $removed_data;
21
+
22
+ // Save proceesed actions from validation stage
23
+ public static $processed_actions;
24
+
25
+ // Refrence to the current submitted torm validation obj
26
+ public static $wpcf_validation_obj;
27
+
28
+ // Reference to the current submitted form
29
+ public static $submission;
30
+
31
+ /**
32
+ * Main class Constructor
33
+ *
34
+ * @param $cf7
35
+ * @param $submission
36
+ * @param $validation_obj
37
+ */
38
+ public function __construct( $cf7, $submission = '', $validation_obj = '' ) {
39
+ if ( is_int( $cf7 ) ) {
40
+ $this->post_id = $cf7;
41
+ $cf7 = WPCF7_ContactForm::get_instance( $this->post_id );
42
+ } elseif ( $cf7 ) {
43
+ $this->post_id = $cf7->id();
44
+ } else {
45
+ return;
46
+ }
47
+
48
+ // keep refrences
49
+ if ( $cf7 ) {
50
+ self::$cf7_form = $cf7;
51
+ }
52
+ if ( $validation_obj ) {
53
+ self::$wpcf_validation_obj = $validation_obj;
54
+ }
55
+ if ( $submission ) {
56
+ self::$submission = $submission;
57
+ }
58
+
59
+ $this->redirect_actions = new WPCF7R_Actions( $this->post_id, $this );
60
+ $this->cf7_post = $cf7;
61
+
62
+ // avoid creating 2 instances of the same form
63
+ if ( self::$instance && self::$instance->post_id === $this->post_id ) {
64
+ return self::$instance;
65
+ }
66
+
67
+ add_action( 'admin_footer', array( $this->redirect_actions, 'html_fregments' ) );
68
+ }
69
+
70
+ /**
71
+ * Get submission refrerence
72
+ */
73
+ public function get_submission() {
74
+ return self::$submission;
75
+ }
76
+
77
+ /**
78
+ * Get the form submission status
79
+ */
80
+ public function get_submission_status() {
81
+ return self::get_submission()->get_status();
82
+ }
83
+
84
+ /**
85
+ * Disable all form actions except the requested one
86
+ *
87
+ * @param $action_id
88
+ */
89
+ public function enable_action( $action_id ) {
90
+ self::$action_to_submit = $action_id;
91
+ }
92
+
93
+ /**
94
+ * In case a specific action was required (used for testing)
95
+ */
96
+ public function get_action_to_submit() {
97
+ return self::$action_to_submit;
98
+ }
99
+
100
+ /**
101
+ * Get an instance of wpcf7 object
102
+ */
103
+ public function get_cf7_form_instance() {
104
+ return $this->cf7_post;
105
+ }
106
+
107
+ /**
108
+ * Get old redirection plugin rules
109
+ */
110
+ public function get_cf7_redirection_settings() {
111
+ $custom_data = get_post_custom( $this->post_id );
112
+ $old_settings = array();
113
+ if ( isset( $custom_data['_wpcf7_redirect_redirect_type'] ) ) {
114
+ $old_settings['_wpcf7_redirect_redirect_type'] = maybe_unserialize( $custom_data['_wpcf7_redirect_redirect_type'][0] );
115
+ }
116
+ if ( isset( $custom_data['_wpcf7_redirect_page_id'] ) ) {
117
+ $old_settings['page_id'] = maybe_unserialize( $custom_data['_wpcf7_redirect_page_id'][0] );
118
+ }
119
+ if ( isset( $custom_data['_wpcf7_redirect_external_url'] ) ) {
120
+ $old_settings['external_url'] = maybe_unserialize( $custom_data['_wpcf7_redirect_external_url'][0] );
121
+ }
122
+ if ( isset( $custom_data['_wpcf7_redirect_use_external_url'] ) ) {
123
+ $old_settings['use_external_url'] = maybe_unserialize( $custom_data['_wpcf7_redirect_use_external_url'][0] );
124
+ }
125
+ if ( isset( $custom_data['_wpcf7_redirect_open_in_new_tab'] ) ) {
126
+ $old_settings['open_in_new_tab'] = maybe_unserialize( $custom_data['_wpcf7_redirect_open_in_new_tab'][0] );
127
+ }
128
+ if ( isset( $custom_data['_wpcf7_redirect_http_build_query'] ) ) {
129
+ $old_settings['http_build_query'] = maybe_unserialize( $custom_data['_wpcf7_redirect_http_build_query'][0] );
130
+ }
131
+ if ( isset( $custom_data['_wpcf7_redirect_http_build_query_selectively'] ) ) {
132
+ $old_settings['http_build_query_selectively'] = maybe_unserialize( $custom_data['_wpcf7_redirect_http_build_query_selectively'][0] );
133
+ }
134
+ if ( isset( $custom_data['_wpcf7_redirect_http_build_query_selectively_fields'] ) ) {
135
+ $old_settings['http_build_query_selectively_fields'] = maybe_unserialize( $custom_data['_wpcf7_redirect_http_build_query_selectively_fields'][0] );
136
+ }
137
+ if ( isset( $custom_data['_wpcf7_redirect_after_sent_script'] ) ) {
138
+ $old_settings['fire_sctipt'] = maybe_unserialize( $custom_data['_wpcf7_redirect_after_sent_script'][0] );
139
+ }
140
+
141
+ if ( isset( $custom_data['_wpcf7_redirect_delay_redirect'] ) && (int) $custom_data['_wpcf7_redirect_delay_redirect'] > 0 ) {
142
+ $old_settings['delay_redirect_seconds'] = $custom_data['_wpcf7_redirect_delay_redirect'][0] / 1000;
143
+ }
144
+
145
+ return $old_settings;
146
+ }
147
+
148
+ /**
149
+ * Get the old contact form 7 to api settings
150
+ */
151
+ public function get_cf7_api_settings() {
152
+ $custom_data = get_post_custom( $this->post_id );
153
+ $old_settings = array();
154
+ if ( isset( $custom_data['_wpcf7_api_data'] ) ) {
155
+ $old_settings['_wpcf7_api_data'] = maybe_unserialize( $custom_data['_wpcf7_api_data'][0] );
156
+ }
157
+ if ( isset( $custom_data['_wpcf7_api_data_map'] ) ) {
158
+ $old_settings['_wpcf7_api_data_map'] = maybe_unserialize( $custom_data['_wpcf7_api_data_map'][0] );
159
+ }
160
+ if ( isset( $custom_data['_template'] ) ) {
161
+ $old_settings['_template'] = maybe_unserialize( $custom_data['_template'][0] );
162
+ }
163
+ if ( isset( $custom_data['_json_template'] ) ) {
164
+ $old_settings['_json_template'] = maybe_unserialize( $custom_data['_json_template'][0] );
165
+ }
166
+ return $old_settings;
167
+ }
168
+
169
+ /**
170
+ * Check if a form has a specific action type
171
+ *
172
+ * @param $type
173
+ * @return boolean
174
+ */
175
+ public function has_action( $type ) {
176
+ $args = array();
177
+ $meta_query = array(
178
+ array(
179
+ 'key' => 'action_type',
180
+ 'value' => $type,
181
+ ),
182
+ );
183
+ $args['meta_query'] = $meta_query;
184
+ $actions = $this->get_actions( 'default', 1, true, $args );
185
+
186
+ return $actions ? $actions : false;
187
+ }
188
+
189
+ /**
190
+ * Update the plugin has migrated
191
+ *
192
+ * @param $migration_type
193
+ */
194
+ public function update_migration( $migration_type ) {
195
+ update_post_meta( $this->post_id, $migration_type, true );
196
+ }
197
+
198
+ /**
199
+ * Check if a form was migrated from old version
200
+ *
201
+ * @param $migration_type
202
+ * @return boolean
203
+ */
204
+ public function has_migrated( $migration_type ) {
205
+ return get_post_meta( $this->post_id, $migration_type, true );
206
+ }
207
+
208
+ /**
209
+ * Check if there is old data on the DB
210
+ *
211
+ * @param $type
212
+ * @return boolean
213
+ */
214
+ public function has_old_data( $type ) {
215
+ if ( 'migrate_from_cf7_api' === $type ) {
216
+ return $this->get_cf7_api_settings();
217
+ } else {
218
+ return $this->get_cf7_redirection_settings();
219
+ }
220
+ }
221
+
222
+ /**
223
+ * Get a singelton
224
+ *
225
+ * @param string $post_id
226
+ */
227
+ public static function get_instance( $post_id = '' ) {
228
+ if ( null === self::$instance || ( self::$cf7_form->id() !== $post_id && $post_id ) ) {
229
+ self::$instance = new self( $post_id );
230
+ }
231
+ return self::$instance;
232
+ }
233
+
234
+ public function is_new_form() {
235
+ return isset( $this->post_id ) && $this->post_id ? false : true;
236
+ }
237
+
238
+ /**
239
+ * Initialize form
240
+ */
241
+ public function init() {
242
+ // Check if this is a new form
243
+ if ( $this->is_new_form() ) {
244
+ self::$mail_tags = __( 'You need to save your form', 'wpcf7-redirect' );
245
+ include WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'save-form.php';
246
+ } else {
247
+ self::$mail_tags = $this->get_cf7_fields();
248
+ $fields = $this->get_fields_values();
249
+ $redirect_type = isset( $fields['redirect_type'] ) && $fields['redirect_type'] ? $fields['redirect_type'] : '';
250
+ $active_tab_title = 'active';
251
+ $active_tab = 'active';
252
+ $this->html = new WPCF7R_html( self::$mail_tags );
253
+ include WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'settings.php';
254
+ }
255
+ }
256
+
257
+ /**
258
+ * Get all posts relevant to this contact form
259
+ * returns posts object
260
+ *
261
+ * @param $rule
262
+ */
263
+ public function get_action_posts( $rule ) {
264
+ return $this->redirect_actions->get_action_posts( $rule );
265
+ }
266
+
267
+ /**
268
+ * Get all actions relevant for this contact form
269
+ * Returns action classes
270
+ *
271
+ * @param $rule
272
+ * @param integer $count
273
+ * @param boolean $is_active
274
+ * @param array $args
275
+ */
276
+ public function get_actions( $rule, $count = -1, $is_active = false, $args = array() ) {
277
+ $action_id = $this->get_action_to_submit();
278
+
279
+ if ( $action_id ) {
280
+ $args['post__in'] = array( $action_id );
281
+ }
282
+
283
+ $actions = isset( $this->redirect_actions ) && $this->redirect_actions ? $this->redirect_actions->get_actions( $rule, -1, $is_active, $args ) : array();
284
+
285
+ $this->actions = $actions;
286
+
287
+ return $actions;
288
+ }
289
+
290
+ /**
291
+ * Get all active actions
292
+ */
293
+ public function get_active_actions() {
294
+ return $this->get_actions( 'default', -1, true );
295
+ }
296
+
297
+ /**
298
+ * Save reference for the items removed from the $_POST data
299
+ *
300
+ * @param $removed_data
301
+ */
302
+ public function set_removed_posted_data( $removed_data ) {
303
+ if ( isset( self::$removed_data ) ) {
304
+ self::$removed_data = array_merge( $removed_data, self::$removed_data );
305
+ } else {
306
+ self::$removed_data = $removed_data;
307
+ }
308
+ }
309
+
310
+ /**
311
+ * Get all params removed from the $_POST
312
+ */
313
+ public function get_removed_form_params() {
314
+ return isset( self::$removed_data ) ? self::$removed_data : '';
315
+ }
316
+
317
+ /**
318
+ * Validate and store meta data
319
+ */
320
+ public function store_meta() {
321
+ if ( ! isset( $_POST ) || empty( $_POST['wpcf7-redirect'] ) ) {
322
+ return;
323
+ } else {
324
+ if ( ! wp_verify_nonce( $_POST['wpcf7_redirect_page_metaboxes_nonce'], 'wpcf7_redirect_page_metaboxes' ) ) {
325
+ return;
326
+ }
327
+ $form_id = $this->post_id;
328
+ $fields = $this->get_plugin_fields( $form_id );
329
+ $data = $_POST['wpcf7-redirect'];
330
+ $this->save_meta_fields( $form_id, $fields, $data );
331
+ if ( isset( $data['actions'] ) && $data['actions'] ) {
332
+ $this->save_actions( $data['actions'] );
333
+ }
334
+ }
335
+ }
336
+
337
+ /**
338
+ * Save all actions and actions data
339
+ *
340
+ * @param $actions
341
+ */
342
+ public function save_actions( $actions ) {
343
+ foreach ( $actions as $post_id => $action_fields ) {
344
+ $action = WPCF7R_Action::get_action( $post_id );
345
+ if ( $action ) {
346
+ $action->delete_all_fields();
347
+ foreach ( $action_fields as $action_field_key => $action_field_value ) {
348
+ update_post_meta( $post_id, $action_field_key, $action_field_value );
349
+ }
350
+ if ( isset( $action_fields['post_title'] ) ) {
351
+ $update_post = array(
352
+ 'ID' => $post_id,
353
+ 'post_title' => $action_fields['post_title'],
354
+ );
355
+ wp_update_post( $update_post );
356
+ }
357
+ }
358
+ }
359
+ }
360
+
361
+ /**
362
+ * Save meta fields to cf7 post
363
+ * Save each action to its relevant action post
364
+ *
365
+ * @param $post_id
366
+ * @param $fields
367
+ * @param $data
368
+ */
369
+ public function save_meta_fields( $post_id, $fields, $data ) {
370
+ unset( $data['actions'] );
371
+ if ( $data ) {
372
+ foreach ( $fields as $field ) {
373
+ $value = isset( $data[ $field['name'] ] ) ? $data[ $field['name'] ] : '';
374
+ switch ( $field['type'] ) {
375
+ case 'password':
376
+ case 'text':
377
+ case 'checkbox':
378
+ $value = sanitize_text_field( $value );
379
+ break;
380
+ case 'textarea':
381
+ $value = htmlspecialchars( $value );
382
+ break;
383
+ case 'number':
384
+ $value = intval( $value );
385
+ break;
386
+ case 'url':
387
+ $value = esc_url_raw( $value );
388
+ break;
389
+ }
390
+ update_post_meta( $post_id, '_wpcf7_redirect_' . $field['name'], $value );
391
+ }
392
+ }
393
+ }
394
+
395
+ /**
396
+ * Check if the form has active actions
397
+ */
398
+ public function has_actions() {
399
+ $rule = 'default';
400
+ $count = 1;
401
+ $is_active = true;
402
+ $args = array();
403
+ $actions = $this->get_actions( $rule, $count, $is_active, $args ) ? true : false;
404
+
405
+ return $actions;
406
+ }
407
+
408
+ /**
409
+ * Get specific form fields
410
+ *
411
+ * @param $fields
412
+ */
413
+ public function get_form_fields( $fields ) {
414
+ $forms = array();
415
+ foreach ( $fields as $field ) {
416
+ $forms[ $this->post_id ][ $field['name'] ] = get_post_meta( $this->post_id, '_wpcf7_redirect_' . $field['name'], true );
417
+ if ( 'textarea' === $field['type'] ) {
418
+ $forms[ $this->post_id ][ $field['name'] ] = $forms[ $this->post_id ][ $field['name'] ];
419
+ }
420
+ }
421
+
422
+ // Thank you page URL is a little bit different...
423
+ $forms[ $this->post_id ]['thankyou_page_url'] = $forms[ $this->post_id ]['page_id'] ? get_permalink( $forms[ $this->post_id ]['page_id'] ) : '';
424
+ return reset( $forms );
425
+ }
426
+
427
+ /**
428
+ * Get rules for a specific contact form
429
+ */
430
+ public function get_redirect_rules() {
431
+ return get_post_meta( $this->post_id, '_wpcf7_redirect_' . $field['name'], true );
432
+ }
433
+
434
+ /**
435
+ * Get all fields values
436
+ */
437
+ public function get_fields_values() {
438
+ $fields = $this->get_plugin_fields();
439
+ foreach ( $fields as $field ) {
440
+ $values[ $field['name'] ] = get_post_meta( $this->post_id, '_wpcf7_redirect_' . $field['name'], true );
441
+ }
442
+ return $values;
443
+ }
444
+
445
+ /**
446
+ * Create plugin fields
447
+ */
448
+ public function get_plugin_fields() {
449
+ $fields = array_merge(
450
+ WPCF7r_Form_Helper::get_plugin_default_fields(),
451
+ array(
452
+ array(
453
+ 'name' => 'blocks',
454
+ 'type' => 'blocks',
455
+ ),
456
+ )
457
+ );
458
+ return $fields;
459
+ }
460
+
461
+ /**
462
+ * Get the contact form id
463
+ */
464
+ public function get_id() {
465
+ return $this->post_id;
466
+ }
467
+
468
+ /**
469
+ * Get the form fields for usage on the selectors
470
+ */
471
+ public function get_cf7_fields() {
472
+ $tags = self::get_mail_tags();
473
+ return $tags;
474
+ }
475
+
476
+ /**
477
+ * Get special mail tags
478
+ */
479
+ static function get_special_mail_tags() {
480
+ $mailtags = array();
481
+ $special_mail_tags = array(
482
+ '_remote_ip',
483
+ '_user_agent',
484
+ '_url',
485
+ '_date',
486
+ '_time',
487
+ '_post_id',
488
+ '_post_name',
489
+ '_post_title',
490
+ '_post_url',
491
+ '_post_author',
492
+ '_post_author_email',
493
+ '_site_title',
494
+ '_site_description',
495
+ '_site_url',
496
+ '_site_admin_email',
497
+ 'user_login',
498
+ 'user_email',
499
+ 'user_url',
500
+ );
501
+
502
+ foreach ( $special_mail_tags as $special_mail_tag ) {
503
+ $tag = new WPCF7_MailTag( $special_mail_tag, $special_mail_tag, array() );
504
+ $mailtags[] = $tag;
505
+ }
506
+
507
+ return $mailtags;
508
+ }
509
+
510
+ /**
511
+ * Collect the mail tags from the form
512
+ */
513
+ static function get_mail_tags() {
514
+ // If this is a new form there are no tags yet
515
+ if ( ! isset( self::$cf7_form ) || ! self::$cf7_form ) {
516
+ return;
517
+ }
518
+ $tags = apply_filters( 'wpcf7r_collect_mail_tags', self::$cf7_form->scan_form_tags() );
519
+ foreach ( (array) $tags as $tag ) {
520
+ $type = trim( $tag['type'], ' *' );
521
+ if ( empty( $type ) || empty( $tag['name'] ) ) {
522
+ continue;
523
+ } elseif ( ! empty( $args['include'] ) ) {
524
+ if ( ! in_array( $type, $args['include'], true ) ) {
525
+ continue;
526
+ }
527
+ } elseif ( ! empty( $args['exclude'] ) ) {
528
+ if ( in_array( $type, $args['exclude'], true ) ) {
529
+ continue;
530
+ }
531
+ }
532
+ $mailtags[] = $tag;
533
+ }
534
+
535
+ // create an instance to get the current form instance
536
+ $instance = self::get_instance( self::$cf7_form );
537
+
538
+ // add a save lead tag in case save lead action is on
539
+ if ( $instance->has_action( 'save_lead' ) ) {
540
+ $scanned_tag = array(
541
+ 'type' => 'lead_id',
542
+ 'basetype' => trim( '[lead_id]', '*' ),
543
+ 'name' => 'lead_id',
544
+ 'options' => array(),
545
+ 'raw_values' => array(),
546
+ 'values' => array(
547
+ WPCF7R_Action::get_lead_id(),
548
+ ),
549
+ 'pipes' => null,
550
+ 'labels' => array(),
551
+ 'attr' => '',
552
+ 'content' => '',
553
+ );
554
+ $mailtags[] = new WPCF7_FormTag( $scanned_tag );
555
+ }
556
+
557
+ return $mailtags;
558
+ }
559
+
560
+ /**
561
+ * Process actions that are relevant for validation process
562
+ */
563
+ public function process_validation_actions() {
564
+ $actions = $this->get_active_actions();
565
+ $results = array();
566
+
567
+ if ( $actions ) {
568
+ foreach ( $actions as $action ) {
569
+ $action_result = $action->process_validation( self::get_submission() );
570
+ if ( $action_result ) {
571
+ $results[ $action->get_type() ][] = $action_result;
572
+ }
573
+ }
574
+ }
575
+ return $results;
576
+ }
577
+
578
+ /**
579
+ * Get validation object
580
+ */
581
+ public static function get_validation_obj() {
582
+ return self::$wpcf_validation_obj;
583
+ }
584
+
585
+ /**
586
+ * Get validation object $tags
587
+ */
588
+ public static function get_validation_obj_tags() {
589
+ $validation_obj = self::get_validation_obj();
590
+ return isset( $validation_obj->tags ) ? $validation_obj->tags : '';
591
+ }
592
+
593
+ /**
594
+ * Save a referrence to the validaiont object
595
+ * This will enable invalidating tags later on
596
+ *
597
+ * @param object $wpcf_validation_obj
598
+ */
599
+ public function set_validation_obj( $wpcf_validation_obj ) {
600
+ self::$wpcf_validation_obj = $wpcf_validation_obj;
601
+ }
602
+
603
+ /**
604
+ * Handles submission actions
605
+ */
606
+ public function process_actions() {
607
+ // get all active actions
608
+ $actions = $this->get_active_actions();
609
+ // prepeare the results array
610
+ $results = array();
611
+ // get removed fom data
612
+ self::$submission->removed_posted_data = $this->get_removed_form_params();
613
+
614
+ if ( $actions ) {// loop through actions and process
615
+ foreach ( $actions as $action ) {
616
+ // save the validation object in case this action manipulates validations
617
+ // do the action
618
+ $action_result = $action->process_action( $this );
619
+ // add the action to the results array
620
+ $results[ $action->get_type() ][] = $action_result;
621
+ self::$processed_actions[] = $action;
622
+ }
623
+ } else {
624
+ return false;
625
+ }
626
+
627
+ return $results;
628
+ }
629
+
630
+ /**
631
+ * Get all processed actions
632
+ */
633
+ public function get_processed_actions() {
634
+ return isset( self::$processed_actions ) && self::$processed_actions ? self::$processed_actions : '';
635
+ }
636
+
637
+ /**
638
+ * Check if actions hold one last thing to do before returning result to the user
639
+ */
640
+ public function maybe_perform_pre_result_action() {
641
+ $actions = $this->get_processed_actions();
642
+ if ( $actions ) {
643
+ foreach ( $actions as $action ) {
644
+ $action->maybe_perform_pre_result_action();
645
+ }
646
+ }
647
+ }
648
+ }
classes/class-wpcf7r-html.php ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Html - Mainly static functions class to create html fregments
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ class WPCF7R_Html {
9
+ public static $mail_tags;
10
+
11
+ public static $active_conditional_logic;
12
+ /**
13
+ * The main class constructor
14
+ *
15
+ * @param string $mail_tags
16
+ */
17
+
18
+ public function __construct( $mail_tags = '' ) {
19
+ self::$mail_tags = $mail_tags;
20
+ }
21
+
22
+ /**
23
+ * Display admin groupos
24
+ */
25
+ public static function conditional_groups_display( $group_block, $prefix ) {
26
+ foreach ( $group_block['groups'] as $group_key => $group ) {
27
+ echo self::group_display( 'block_1', $group_key, $group, $prefix );
28
+ }
29
+ }
30
+
31
+ /**
32
+ * Print a single group of seetings
33
+ */
34
+ public static function group_display( $block_key = '', $group_key = '', $group = array(), $prefix ) {
35
+ ob_start();
36
+ echo self::get_conditional_row_group_start( $group_key, $group );
37
+ echo self::get_conditional_row_group_rows_start( $group_key, $group );
38
+
39
+ foreach ( $group as $group_row => $row_fields ) {
40
+ echo self::get_conditional_row_template( $block_key, $group_key, $group_row, $row_fields, $prefix );
41
+ }
42
+
43
+ echo self::get_conditional_row_group_rows_end();
44
+ echo self::get_conditional_row_group_end();
45
+ return ob_get_clean();
46
+ }
47
+
48
+ /**
49
+ * Conditional group row start html
50
+ */
51
+ public static function get_conditional_row_group_rows_start( $group_key, $group ) {
52
+ return '<div class="conditional-group-block active" data-block-id="block_1">
53
+ <table class="wp-list-table widefat fixed striped pages repeater-table leads-list">
54
+ <thead>
55
+ <tr>
56
+ <th colspan="4"><h3>' . __( 'IF', 'wpcf7-redirect' ) . '</h3></th>
57
+ </tr>
58
+ </thead>
59
+ <tbody>';
60
+ }
61
+
62
+ /**
63
+ * Conditional group row end html
64
+ */
65
+ public static function get_conditional_row_group_rows_end() {
66
+ return '</tbody></table></div>';
67
+ }
68
+
69
+ /**
70
+ * Conditional row group start
71
+ */
72
+ public static function get_conditional_row_group_start( $group_key, $group ) {
73
+ return '<div class="wpcfr-rule-group group-' . $group_key . '" data-group-id="' . $group_key . '"><div class="group-title title-or"><h3>' . __( 'OR', 'wpcf7-redirect' ) . '</h3></div>';
74
+ }
75
+
76
+ /**
77
+ * Get Conditional Row Group End
78
+ */
79
+ public static function get_conditional_row_group_end() {
80
+ return '</div>';
81
+ }
82
+
83
+ /**
84
+ * Get the title html block
85
+ * @param $group_block_key
86
+ * @param $group_block
87
+ * @param $active_tab_title
88
+ * @param boolean $echo
89
+ * @param $prefix
90
+ */
91
+ public static function get_block_title( $group_block_key, $group_block, $active_tab_title, $echo = true, $prefix ) {
92
+ ob_start();
93
+ include( WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'block-title.php' );
94
+ if ( $echo ) {
95
+ echo ob_get_clean();
96
+ } else {
97
+ return ob_get_clean();
98
+ }
99
+ }
100
+
101
+ /**
102
+ * Get an HTML template of a condition row
103
+ */
104
+ public static function get_conditional_row_template( $block_key = '', $group_key = '', $group_row = '', $row_fields = array(), $prefix ) {
105
+ ob_start();
106
+ $condition = $row_fields['condition'];
107
+ ?>
108
+ <tr class="row-template">
109
+ <td>
110
+ <select class="wpcf7r-fields" name="wpcf7-redirect<?php echo $prefix; ?>[blocks][<?php echo $block_key; ?>][groups][<?php echo $group_key; ?>][<?php echo $group_row; ?>][if]" required>
111
+ <option value=""><?php _e( 'Select' ); ?></option>
112
+ <?php foreach ( WPCF7R_Form::get_mail_tags() as $mail_tag ) : ?>
113
+ <option value="<?php echo $mail_tag['name']; ?>" <?php selected( $mail_tag['name'], $row_fields['if'] ); ?>><?php echo $mail_tag['name']; ?></option>
114
+ <?php endforeach; ?>
115
+ </select>
116
+ </td>
117
+ <td>
118
+ <select class="compare-options" name="wpcf7-redirect<?php echo $prefix; ?>[blocks][<?php echo $block_key; ?>][groups][<?php echo $group_key; ?>][<?php echo $group_row; ?>][condition]" required>
119
+ <option value=""><?php _e( 'Select', 'wpcf7-redirect' ); ?></option>
120
+ <option value="equal" <?php selected( $condition, 'equal' ); ?> data-comparetype="select"><?php _e( 'Equal', 'wpcf7-redirect' ); ?></option>
121
+ <option value="not-equal" <?php selected( $condition, 'not-equal' ); ?> data-comparetype="select"><?php _e( 'Non Equal', 'wpcf7-redirect' ); ?></option>
122
+ <option value="contain" <?php selected( $condition, 'contain' ); ?> data-comparetype=""><?php _e( 'Contains', 'wpcf7-redirect' ); ?></option>
123
+ <option value="not-contain" <?php selected( $condition, 'not-contain' ); ?> data-comparetype=""><?php _e( 'Does not Contain', 'wpcf7-redirect' ); ?></option>
124
+ <option value="less_than" <?php selected( $condition, 'less_than' ); ?> data-comparetype=""><?php _e( 'Less than', 'wpcf7-redirect' ); ?></option>
125
+ <option value="greater_than" <?php selected( $condition, 'greater_than' ); ?> data-comparetype=""><?php _e( 'Greater than', 'wpcf7-redirect' ); ?></option>
126
+ <option value="is_null" <?php selected( $condition, 'is_null' ); ?> data-comparetype=""><?php _e( 'Is Empty', 'wpcf7-redirect' ); ?></option>
127
+ <option value="is_not_null" <?php selected( $condition, 'is_not_null' ); ?> data-comparetype=""><?php _e( 'Is Not Empty', 'wpcf7-redirect' ); ?></option>
128
+ </select>
129
+ </td>
130
+ <td>
131
+ <?php
132
+ $select_visible = false;
133
+ $select_fields = array(
134
+ 'select',
135
+ 'radio',
136
+ 'checkbox',
137
+ );
138
+ foreach ( WPCF7R_Form::get_mail_tags() as $mail_tag ) :
139
+ ?>
140
+ <?php if ( in_array( $mail_tag->type, $select_fields, true ) ) : ?>
141
+ <?php $select_visible = $row_fields['if'] === $mail_tag['name'] ? true : $select_visible; ?>
142
+ <select class="group_row_value group_row_value_select" style="<?php echo $row_fields['if'] !== $mail_tag['name'] ? 'display:none;' : ''; ?>" data-rel="<?php echo $mail_tag['name']; ?>">
143
+ <option value=""><?php _e( 'Select', 'wpcf7-redirect' ); ?></option>
144
+ <?php
145
+ foreach ( $mail_tag->raw_values as $orig_value ) :
146
+ $orig_value = explode( '|', $orig_value );
147
+ $label = $orig_value[0];
148
+ $value = isset( $orig_value[1] ) && $orig_value[1] ? $orig_value[1] : $orig_value[0];
149
+ ?>
150
+ <option value="<?php echo $value; ?>"
151
+ <?php
152
+ if ( isset( $row_fields['value'] ) ) :
153
+ selected( $row_fields['value'], $value );
154
+ endif;
155
+ ?>
156
+ >
157
+ <?php echo $label; ?>
158
+ </option>
159
+ <?php endforeach; ?>
160
+ </select>
161
+ <?php endif; ?>
162
+ <?php endforeach; ?>
163
+ <input type="text" class="group_row_value wpcf7-redirect-value" name="wpcf7-redirect<?php echo $prefix; ?>[blocks][<?php echo $block_key; ?>][groups][<?php echo $group_key; ?>][<?php echo $group_row; ?>][value]" value="<?php echo isset( $row_fields['value'] ) ? esc_html( $row_fields['value'] ) : ''; ?>" placeholder="<?php _e( 'Your value here' ); ?>" style="<?php echo $select_visible ? 'display:none;' : ''; ?>">
164
+ </td>
165
+ <td>
166
+ <div class="qs-condition-actions">
167
+ <div class="group-actions">
168
+ <span class="dashicons dashicons-minus"></span>
169
+ <a href="#" class="button add-condition"><?php _e( 'And', 'wpcf7-redirect' ); ?></a>
170
+ </div>
171
+ </div>
172
+ </td>
173
+ </tr>
174
+ <?php
175
+ return ob_get_clean();
176
+ }
177
+
178
+ /**
179
+ * Get the html of the rule block
180
+ * @param $group_block_key
181
+ * @param $group_block
182
+ * @param $active_tab
183
+ * @param boolean $echo
184
+ * @param $prefix
185
+ */
186
+ public static function get_block_html( $group_block_key, $group_block, $active_tab, $echo = true, $prefix ) {
187
+ ob_start();
188
+ include( WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'block-html.php' );
189
+ if ( $echo ) {
190
+ echo ob_get_clean();
191
+ } else {
192
+ return ob_get_clean();
193
+ }
194
+ }
195
+
196
+ /**
197
+ * A function that returns the relevant field HTML
198
+ * @param $field
199
+ * @param $prefix
200
+ */
201
+ public static function render_field( $field, $prefix ) {
202
+ switch ( $field['type'] ) {
203
+ case 'text':
204
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-text.php';
205
+ break;
206
+ case 'download':
207
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-download.php';
208
+ break;
209
+ case 'password':
210
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-password.php';
211
+ break;
212
+ case 'url':
213
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-url.php';
214
+ break;
215
+ case 'textarea':
216
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-textarea.php';
217
+ break;
218
+ case 'blocks':
219
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-rule-blocks.php';
220
+ break;
221
+ case 'checkbox':
222
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-checkbox.php';
223
+ break;
224
+ case 'post_type_select':
225
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-post-type-select.php';
226
+ break;
227
+ case 'page_select':
228
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-page-select.php';
229
+ break;
230
+ case 'notice':
231
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-notice.php';
232
+ break;
233
+ case 'select':
234
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-select.php';
235
+ break;
236
+ case 'tags_map':
237
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-tags-map.php';
238
+ break;
239
+ case 'leads_map':
240
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-leads-mapping.php';
241
+ break;
242
+ case 'debug_log':
243
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-debug-log.php';
244
+ break;
245
+ case 'json':
246
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-json-editor.php';
247
+ break;
248
+ case 'repeater':
249
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-repeater.php';
250
+ break;
251
+ case 'section':
252
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'section.php';
253
+ break;
254
+ case 'button':
255
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-button.php';
256
+ break;
257
+ case 'description':
258
+ case 'editor':
259
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-editor.php';
260
+ break;
261
+ case 'number':
262
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-number.php';
263
+ break;
264
+ case 'taxonomy':
265
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-taxonomy.php';
266
+ break;
267
+ case 'post_author_select':
268
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-post-author-select.php';
269
+ break;
270
+ case 'media':
271
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-media.php';
272
+ break;
273
+ case 'preview':
274
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-preview.php';
275
+ break;
276
+ }
277
+
278
+ $template = apply_filters( 'render_field', $template, $field, $prefix, WPCF7_PRO_REDIRECT_FIELDS_PATH );
279
+ include $template;
280
+ }
281
+ }
classes/class-wpcf7r-lead.php ADDED
@@ -0,0 +1,197 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Lead - Container class that handles lead
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ class WPCF7R_Lead {
9
+
10
+ /**
11
+ * Create an instance
12
+ * Save the post id and post reference
13
+ *
14
+ * @param string $post_id
15
+ */
16
+ public function __construct( $post_id = '' ) {
17
+ if ( is_object( $post_id ) ) {
18
+ $this->post_id = $post_id->ID;
19
+ $this->post = $post_id;
20
+ } else {
21
+ $this->post_id = $post_id;
22
+ $this->post = $post_id;
23
+ }
24
+ }
25
+
26
+ /**
27
+ * Update submitted form data
28
+ *
29
+ * @param array $args
30
+ */
31
+ public function update_lead_data( $args = array() ) {
32
+ if ( $args ) {
33
+ foreach ( $args as $meta_key => $meta_value ) {
34
+ update_post_meta( $this->post_id, $meta_key, $meta_value );
35
+ }
36
+ }
37
+ }
38
+
39
+ /**
40
+ * Return the lead ID
41
+ */
42
+ public function get_id() {
43
+ return $this->post_id;
44
+ }
45
+
46
+ /**
47
+ * Get the post title
48
+ */
49
+ public function get_title() {
50
+ return get_the_title( $this->get_id() );
51
+ }
52
+
53
+ /**
54
+ * Update the type of lead
55
+ *
56
+ * @param $lead_type
57
+ */
58
+ public function update_lead_type( $lead_type ) {
59
+ update_post_meta( $this->post_id, 'lead_type', $lead_type );
60
+ }
61
+
62
+ /**
63
+ * Save the action reference and results
64
+ * @param $action_id
65
+ * @param $action_type
66
+ * @param $action_results
67
+ */
68
+ public function add_action_debug( $action_id, $action_type, $action_results ) {
69
+ $action_details = array(
70
+ 'action_id' => $action_id,
71
+ 'results' => $action_results,
72
+ );
73
+ add_post_meta( $this->post_id, $action_type, $action_details );
74
+ }
75
+
76
+ /**
77
+ * Get the creation post of the lead
78
+ */
79
+ public function get_date() {
80
+ return get_the_date( get_option( 'date_format' ), $this->post_id );
81
+ }
82
+
83
+ /**
84
+ * Get the creation post of the lead
85
+ */
86
+ public function get_time() {
87
+ return get_the_date( get_option( 'time_format' ), $this->post_id );
88
+ }
89
+
90
+ /**
91
+ * Get the lead type
92
+ */
93
+ public function get_lead_type() {
94
+ return get_post_meta( $this->post_id, 'lead_type', true );
95
+ }
96
+
97
+ /**
98
+ * Save the user submitted files
99
+ *
100
+ * @return void
101
+ */
102
+ public function update_lead_files( $files ) {
103
+ update_post_meta( $this->post_id, 'files', $files );
104
+ }
105
+
106
+ /**
107
+ * Get lead fields
108
+ */
109
+ public function get_lead_fields() {
110
+ $action_id = get_post_meta( $this->post_id, 'cf7_action_id', true );
111
+
112
+ $custom_meta_fields = get_post_custom( $this->post_id );
113
+ $lead_fields = array();
114
+
115
+ $action = WPCF7R_Action::get_action( (int) $action_id );
116
+
117
+ if ( $action_id && $action ) {
118
+
119
+ $fields = maybe_unserialize( $action->get( 'leads_map' ) );
120
+
121
+ foreach ( $fields as $field_key => $field_value ) {
122
+ if ( 'lead_id' === $field_key ) {
123
+ continue;
124
+ } else {
125
+ if ( isset( $custom_meta_fields[ $field_key ] ) ) {
126
+ $value = maybe_unserialize( $custom_meta_fields[ $field_key ][0] );
127
+ } elseif ( isset( $custom_meta_fields['files'] ) && $custom_meta_fields['files'] ) {
128
+ $value = maybe_unserialize( $custom_meta_fields['files'][0] );
129
+ $value = isset( $value[ $field_key ] ) && $value[ $field_key ] ? $value[ $field_key ] : '';
130
+ }
131
+ }
132
+
133
+ if ( is_array( $value ) ) {
134
+ if ( isset( $value['path'] ) ) {
135
+ $lead_fields[ $field_key ] = array(
136
+ 'type' => 'download',
137
+ 'placeholder' => '',
138
+ 'value' => $value['base64_file'],
139
+ 'filetype' => $value['type'],
140
+ 'filename' => $value['name'],
141
+ 'label' => isset( $field_value['tag'] ) && $field_value['tag'] ? $field_value['tag'] : __( 'File', 'wpcf7-redirect' ),
142
+ 'name' => $field_key,
143
+ 'prefix' => '',
144
+ );
145
+ } else {
146
+ foreach ( $value as $value_field_key => $value_field_value ) {
147
+ $lead_fields[ $field_key . '-' . $value_field_key ] = array(
148
+ 'type' => 'text',
149
+ 'placeholder' => '',
150
+ 'label' => isset( $field_value['tag'] ) && $field_value['tag'] ? $field_value['tag'] : $field_key,
151
+ 'name' => $field_key,
152
+ 'value' => maybe_unserialize( $value_field_value ),
153
+ 'prefix' => '',
154
+ );
155
+ }
156
+ }
157
+ } else {
158
+ $lead_fields[ $field_key ] = array(
159
+ 'type' => 'text',
160
+ 'placeholder' => '',
161
+ 'value' => $value,
162
+ 'label' => isset( $field_value['tag'] ) && $field_value['tag'] ? $field_value['tag'] : $field_key,
163
+ 'name' => $field_key,
164
+ 'prefix' => '',
165
+ );
166
+ }
167
+ }
168
+ } else {
169
+ foreach ( $custom_meta_fields as $field_key => $field_value ) {
170
+ $value = maybe_unserialize( $field_value[0] );
171
+ if ( is_array( $value ) ) {
172
+ foreach ( $value as $value_field_key => $value_field_value ) {
173
+ $lead_fields[ $field_key . '-' . $value_field_key ] = array(
174
+ 'type' => 'text',
175
+ 'placeholder' => '',
176
+ 'label' => $field_key,
177
+ 'name' => $field_key,
178
+ 'value' => maybe_unserialize( $value_field_value ),
179
+ 'prefix' => '',
180
+ );
181
+ }
182
+ } else {
183
+ $lead_fields[ $field_key ] = array(
184
+ 'type' => 'text',
185
+ 'placeholder' => '',
186
+ 'value' => $value,
187
+ 'label' => $field_key,
188
+ 'name' => $field_key,
189
+ 'prefix' => '',
190
+ );
191
+ }
192
+ }
193
+ }
194
+
195
+ return apply_filters( 'wpcf7r_fields' , $lead_fields );
196
+ }
197
+ }
classes/class-wpcf7r-leads-manager.php ADDED
@@ -0,0 +1,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Leads_Manager - Container class that handles leads management
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ class WPCF7R_Leads_Manager {
9
+ /**
10
+ * Save a reference to the last lead inserted to the DB
11
+ */
12
+ public static $new_lead_id;
13
+
14
+ /**
15
+ * Define the leads post type
16
+ */
17
+ public static $post_type = 'wpcf7r_leads';
18
+
19
+ public function __construct( $cf7_id ) {
20
+ $this->cf7_id = $cf7_id;
21
+
22
+ $this->leads = array();
23
+
24
+ }
25
+
26
+ /**
27
+ * Get the leads post type
28
+ */
29
+ public static function get_post_type() {
30
+ return self::$post_type;
31
+ }
32
+
33
+ /**
34
+ * Add A select filter on edit.php screen to filter records by form
35
+ */
36
+ public static function add_form_filter() {
37
+ if ( isset( $_GET['post_type'] ) && self::get_post_type() === $_GET['post_type'] ) {
38
+ $values = array();
39
+
40
+ $forms = get_posts(
41
+ array(
42
+ 'post_status' => 'any',
43
+ 'posts_per_page' => -1,
44
+ 'post_type' => 'wpcf7_contact_form',
45
+ )
46
+ );
47
+
48
+ foreach ( $forms as $form ) :
49
+ $values[ $form->post_title ] = $form->ID;
50
+ endforeach;
51
+
52
+ ?>
53
+
54
+ <select name="cf7_form">
55
+ <option value=""><?php _e( 'Form', 'wpcf7-redirect' ); ?></option>
56
+ <?php
57
+ $current_v = isset( $_GET['cf7_form'] ) ? (int) $_GET['cf7_form'] : '';
58
+
59
+ foreach ( $values as $label => $value ) {
60
+ printf(
61
+ '<option value="%s"%s>%s</option>',
62
+ $value,
63
+ $value === $current_v ? ' selected="selected"' : '',
64
+ $label
65
+ );
66
+ }
67
+ ?>
68
+ </select>
69
+
70
+ <?php
71
+ }
72
+ }
73
+
74
+ /**
75
+ * Search by filters
76
+ */
77
+ public static function filter_request_query( $query ) {
78
+ //modify the query only if it admin and main query.
79
+ if ( ! ( is_admin() && $query->is_main_query() ) ) {
80
+ return $query;
81
+ }
82
+
83
+ //we want to modify the query for the targeted custom post and filter option
84
+ if ( ! isset( $query->query['post_type'] ) || ( ! ( self::get_post_type() === $query->query['post_type'] && isset( $_REQUEST['cf7_form'] ) ) ) ) {
85
+ return $query;
86
+ }
87
+
88
+ //for the default value of our filter no modification is required
89
+ if ( 0 === (int) $_REQUEST['cf7_form'] ) {
90
+ return $query;
91
+ }
92
+ //modify the query_vars.
93
+
94
+ $posted_value = isset( $_REQUEST['cf7_form'] ) && (int) $_REQUEST['cf7_form'] ? (int) $_REQUEST['cf7_form'] : '';
95
+
96
+ $meta_query = $query->get( 'meta_query' );
97
+
98
+ if ( ! $meta_query ) {
99
+ $meta_query = array();
100
+ }
101
+
102
+ $meta_query[] = array(
103
+ array(
104
+ 'key' => 'cf7_form',
105
+ 'value' => $posted_value,
106
+ 'compare' => '=',
107
+ ),
108
+ );
109
+
110
+ $query->set( 'meta_query', $meta_query );
111
+
112
+ return $query;
113
+ }
114
+
115
+ /**
116
+ * Initialize leads table tab
117
+ */
118
+ public function init() {
119
+ include( WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'leads . php' );
120
+ }
121
+
122
+ /**
123
+ * get the url to the admin post type list
124
+ * Auto filter by selected action
125
+ */
126
+ public static function get_admin_url( $form_id ) {
127
+ $url = admin_url( 'edit.php?post_type=' . self::get_post_type() );
128
+
129
+ return add_query_arg( 'cf7_form', $form_id, $url );
130
+ }
131
+
132
+ /**
133
+ * Get leads
134
+ */
135
+ public function get_leads() {
136
+ $args = array(
137
+ 'post_type' => self::get_post_type(),
138
+ 'post_status' => 'private',
139
+ 'posts_per_page' => 20,
140
+ 'meta_query' => array(
141
+ array(
142
+ 'key' => 'cf7_form',
143
+ 'value' => $this->cf7_id,
144
+ ),
145
+ ),
146
+ );
147
+
148
+ $leads_posts = get_posts( $args );
149
+
150
+ if ( $leads_posts ) {
151
+ foreach ( $leads_posts as $leads_post ) {
152
+ $lead = new WPCF7R_Lead( $leads_post );
153
+
154
+ $this->leads[] = $lead;
155
+ }
156
+ }
157
+
158
+ return $this->leads;
159
+ }
160
+ /**
161
+ * Insert new lead
162
+ */
163
+ public static function insert_lead( $cf7_form_id, $args, $files = array(), $lead_type, $action_id ) {
164
+ $args['cf7_form'] = $cf7_form_id;
165
+ $args['cf7_action_id'] = $action_id;
166
+
167
+ $contact_form_title = get_the_title( $cf7_form_id );
168
+
169
+ $new_post = array(
170
+ 'post_type' => self::get_post_type(),
171
+ 'post_status' => 'private',
172
+ 'post_title' => __( 'Lead from contact form: ', 'wpcf7-redirect' ) . $contact_form_title,
173
+ );
174
+
175
+ self::$new_lead_id = wp_insert_post( $new_post );
176
+
177
+ $lead = new WPCF7R_Lead( self::$new_lead_id );
178
+
179
+ $lead->update_lead_data( $args );
180
+
181
+ $lead->update_lead_files( $files );
182
+
183
+ $lead->update_lead_type( $lead_type );
184
+
185
+ return $lead;
186
+ }
187
+
188
+ /**
189
+ * Save the action to the db lead
190
+ * @param $lead_id
191
+ * @param $action_name
192
+ * @param $details
193
+ */
194
+ public static function save_action( $lead_id, $action_name, $details ) {
195
+ add_post_meta( $lead_id, 'action - ' . $action_name, $details );
196
+ }
197
+
198
+ /**
199
+ * Get a single action row
200
+ */
201
+ public function get_lead_row( $lead ) {
202
+ ob_start();
203
+ do_action( 'before_wpcf7r_lead_row', $this );
204
+ ?>
205
+
206
+ <tr class="primary" data-postid="<?php echo $lead->get_id(); ?>">
207
+ <td class="manage-column column-primary sortable desc edit column-id">
208
+ <?php echo $lead->get_id(); ?>
209
+ <div class="row-actions">
210
+ <span class="edit">
211
+ <a href="<?php echo get_edit_post_link( $lead->get_id() ); ?>" data-id="<?php echo $lead->get_id(); ?>" aria-label="<?php _e( 'View', 'wpcf7-redirect' ); ?>" target="_blank"><?php _e( 'View', 'wpcf7-redirect' ); ?></a> |
212
+ </span>
213
+ <span class="trash">
214
+ <a href="#" class="submitdelete" data-id="<?php echo $lead->get_id(); ?>" aria-label="<?php _e( 'Move to trash', 'wpcf7-redirect' ); ?>"><?php _e( 'Move to trash', 'wpcf7-redirect' ); ?></a> |
215
+ </span>
216
+ <?php do_action( 'wpcf7r_after_lead_links', $lead ); ?>
217
+ </div>
218
+ </td>
219
+ <td class="manage-column column-primary sortable desc edit column-date">
220
+ <?php echo $lead->get_date(); ?>
221
+ </td>
222
+ <td class="manage-column column-primary sortable desc edit column-time"><?php echo $lead->get_time(); ?></td>
223
+ <td class="manage-column column-primary sortable desc edit column-type"><?php echo $lead->get_lead_type(); ?></td>
224
+ <td></td>
225
+ </tr>
226
+
227
+ <?php
228
+ do_action( 'after_wpcf7r_lead_row', $this );
229
+
230
+ return apply_filters( 'wpcf7r_get_lead_row', ob_get_clean(), $this );
231
+ }
232
+ }
classes/class-wpcf7r-list-table.php ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit;
3
+
4
+ if ( class_exists( 'WP_List_Table' ) ) {
5
+ class WPCF7R_List_Table extends WP_List_Table {
6
+
7
+ public $list_data = array();
8
+ /**
9
+ * Constructor will create the menu item
10
+ */
11
+ public function __construct( $columns, $data ) {
12
+
13
+ parent::__construct();
14
+
15
+ $this->list_data = $data;
16
+
17
+ $this->columns = $columns;
18
+
19
+ }
20
+
21
+ /**
22
+ * Display the list table page
23
+ */
24
+ public function list_table_page() {
25
+
26
+ $this->prepare_items();
27
+
28
+ $this->display();
29
+ }
30
+
31
+ /**
32
+ * Prepare the items for the table to process
33
+ */
34
+ public function prepare_items() {
35
+ $columns = $this->get_columns();
36
+ $hidden = $this->get_hidden_columns();
37
+ $sortable = $this->get_sortable_columns();
38
+ $data = $this->list_data;
39
+ $per_page = 2;
40
+ $current_page = $this->get_pagenum();
41
+
42
+ usort( $data, array( &$this, 'sort_data' ) );
43
+ $total_items = count( $data );
44
+
45
+ $this->set_pagination_args(
46
+ array(
47
+ 'total_items' => $total_items,
48
+ 'per_page' => $per_page,
49
+ )
50
+ );
51
+
52
+ $data = array_slice( $data, ( ( $current_page - 1 ) * $per_page ), $per_page );
53
+
54
+ $this->_column_headers = array( $columns, $hidden, $sortable );
55
+ $this->items = $data;
56
+
57
+ }
58
+
59
+ /**
60
+ * Override the parent columns method. Defines the columns to use in your listing table
61
+ */
62
+ public function get_columns() {
63
+ return $this->columns;
64
+ }
65
+
66
+ /**
67
+ * Define which columns are hidden
68
+ */
69
+ public function get_hidden_columns() {
70
+ return array();
71
+ }
72
+
73
+ /**
74
+ * Define the sortable columns
75
+ */
76
+ public function get_sortable_columns() {
77
+ return array( 'title' => array( 'title', false ) );
78
+ }
79
+
80
+ /**
81
+ * Define what data to show on each column of the table
82
+ *
83
+ * @param $item
84
+ * @param $column_name
85
+ */
86
+ public function column_default( $item, $column_name ) {
87
+
88
+ switch ( $column_name ) {
89
+ case 'id':
90
+ case 'title':
91
+ case 'description':
92
+ case 'year':
93
+ case 'director':
94
+ case 'rating':
95
+ return $item[ $column_name ];
96
+
97
+ default:
98
+ return print_r( $item, true );
99
+ }
100
+ }
101
+
102
+ /**
103
+ * Allows you to sort the data by the variables set in the $_GET
104
+ *
105
+ * @param $a
106
+ * @param $b
107
+ */
108
+ private function sort_data( $a, $b ) {
109
+ // Set defaults
110
+ $orderby = 'title';
111
+ $order = 'asc';
112
+
113
+ // If orderby is set, use this as the sort column
114
+ if ( ! empty( $_GET['orderby'] ) ) {
115
+ $orderby = $_GET['orderby'];
116
+ }
117
+
118
+ // If order is set use this as the order
119
+ if ( ! empty( $_GET['order'] ) ) {
120
+ $order = $_GET['order'];
121
+ }
122
+
123
+ $result = strcmp( $a[ $orderby ], $b[ $orderby ] );
124
+
125
+ if ( 'asc' === $order ) {
126
+ return $result;
127
+ }
128
+
129
+ return -$result;
130
+ }
131
+ }
132
+ }
133
+
classes/class-wpcf7r-mailchimp-helper.php ADDED
@@ -0,0 +1,251 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ use MailchimpAPI\Mailchimp;
3
+
4
+ /**
5
+ * Class WPCF7_mailchimp - The main class that manages this extension
6
+ */
7
+
8
+ defined( 'ABSPATH' ) || exit;
9
+
10
+ class WPCF7R_Mailchimp_Helper {
11
+ public static $instance;
12
+ public static $mailchimp;
13
+ public static $api_key;
14
+
15
+ public function __construct( $api_key ) {
16
+ self::$instance = $this;
17
+
18
+ self::$api_key = $api_key;
19
+
20
+ self::$mailchimp = new Mailchimp( $api_key );
21
+ }
22
+
23
+ /**
24
+ * Get a singelton
25
+ *
26
+ * @param string $api_key
27
+ */
28
+ public static function get_instance( $api_key = '' ) {
29
+
30
+ if ( null === self::$instance ) {
31
+ self::$instance = new self( $api_key );
32
+ }
33
+
34
+ return self::$instance;
35
+ }
36
+
37
+ /**
38
+ * Get a clean list to return to the browser
39
+ *
40
+ * @param $api_key
41
+ */
42
+ public static function get_lists_clean( $api_key ) {
43
+ $instance = self::get_instance( $api_key );
44
+
45
+ $lists = self::get_lists( $api_key );
46
+
47
+ $lists_array = array();
48
+
49
+ if ( ! is_wp_error( $lists ) && $lists ) {
50
+ foreach ( $lists as $list ) {
51
+
52
+ $list_fields = $instance->get_list_fields( $list->id );
53
+ $list_fields_clean = array();
54
+
55
+ if ( $list_fields ) {
56
+ foreach ( $list_fields as $list_field ) {
57
+ $list_fields_clean[ $list_field->tag ] = $list_field->name;
58
+ }
59
+ }
60
+
61
+ $lists_array[ $list->id ] = array(
62
+ 'list_id' => $list->id,
63
+ 'list_name' => $list->name,
64
+ 'list_fields' => $list_fields_clean,
65
+ );
66
+ }
67
+ } else {
68
+ return $lists;
69
+ }
70
+
71
+ return $lists_array;
72
+ }
73
+
74
+ /**
75
+ * Create a user on the mailchimp list
76
+ *
77
+ * @param $list_id
78
+ * @param $api_key
79
+ * @param $post_params
80
+ */
81
+ public static function create_mailchimp_user( $list_id, $api_key, $post_params ) {
82
+ $instance = self::get_instance( $api_key );
83
+
84
+ try {
85
+ if ( isset( $post_params['merge_fields']['ADDRESS'] ) && $post_params['merge_fields']['ADDRESS'] ) {
86
+ $post_params['ADDRESS']['addr1'] = $post_params['merge_fields']['ADDRESS'];
87
+ }
88
+
89
+ $results = self::$mailchimp
90
+ ->lists( $list_id )
91
+ ->members()
92
+ ->post( $post_params );
93
+
94
+ } catch ( Exception $ex ) {
95
+ $response = new WP_Error( 'create_mailchimp_user', $ex->message . " List:{$list_id}" );
96
+ return $response;
97
+ }
98
+
99
+ $response = $results->deserialize();
100
+
101
+ if ( '400' === $response->status ) {
102
+ $response = new WP_Error( 'lists', $response->detail . " List:{$list_id}" );
103
+ } else {
104
+ $new_response = array(
105
+ 'id' => $response->id,
106
+ 'unique_email_id' => $response->unique_email_id,
107
+ 'status' => $response->status,
108
+ 'list_id' => $response->list_id,
109
+ );
110
+
111
+ $response = $new_response;
112
+ }
113
+
114
+ return $response;
115
+ }
116
+
117
+ /**
118
+ * Create a new list
119
+ * @param $api_key
120
+ * @param $list_name
121
+ */
122
+ public static function create_list( $api_key, $list_name ) {
123
+ $instance = self::get_instance( $api_key );
124
+
125
+ $response = '';
126
+
127
+ try {
128
+ $contact = new stdclass;
129
+
130
+ $contact->company = 'test';
131
+ $contact->address1 = 'address1';
132
+ $contact->city = 'city';
133
+ $contact->state = 'state';
134
+ $contact->zip = 'zip';
135
+ $contact->country = 'country';
136
+ $contact->phone = 'phone';
137
+
138
+ $campaign_defaults = new stdclass;
139
+ $campaign_defaults->from_name = 'name';
140
+ $campaign_defaults->from_email = 'test@gmail.com';
141
+ $campaign_defaults->subject = 'test';
142
+ $campaign_defaults->language = 'en';
143
+
144
+ $post_params = array(
145
+ 'name' => $list_name,
146
+ 'email_address' => 'example@domain.com',
147
+ 'contact' => $contact,
148
+ 'permission_reminder' => __( 'You are receiving this email because you asked for it.', 'wpcf7-redirect' ),
149
+ 'email_type_option' => true,
150
+ 'campaign_defaults' => $campaign_defaults,
151
+ );
152
+
153
+ $results = self::$mailchimp
154
+ ->lists()
155
+ ->post( $post_params );
156
+
157
+ } catch ( Exception $ex ) {
158
+ $response = new WP_Error( 'lists', $ex->message . ' Check that your API key is correct' );
159
+ return $response;
160
+ }
161
+
162
+ $results_desirialized = $results->deserialize();
163
+
164
+ if ( isset( $results_desirialized->errors ) && $results_desirialized->errors ) {
165
+ $error_message = '';
166
+ foreach ( $results_desirialized->errors as $error ) {
167
+ $error_message .= ' ' . $error->message;
168
+ }
169
+ $response = new WP_Error( 'lists', $error_message );
170
+ }
171
+
172
+ return $response;
173
+ }
174
+ /**
175
+ * Get the lists from the API
176
+ * @param [type] $api_key [description]
177
+ * @return [type] [description]
178
+ */
179
+ public static function get_lists( $api_key ) {
180
+ $instance = self::get_instance( $api_key );
181
+
182
+ try {
183
+ $results = self::$mailchimp->lists()->get(
184
+ array(
185
+ 'count' => '200',
186
+ )
187
+ );
188
+ } catch ( Exception $ex ) {
189
+ $response = new WP_Error( 'lists', $ex->message . ' Check that your API key is correct' );
190
+ return $response;
191
+ }
192
+
193
+ if ( is_a( $results, 'MailchimpAPI\Responses\FailureResponse' ) ) {
194
+ $class_name = get_class( $results );
195
+ $methods = get_class_methods( $class_name );
196
+
197
+ $error_message = $results->getBody();
198
+
199
+ $response = new WP_Error( 'get_lists', $error_message );
200
+
201
+ return $response;
202
+ }
203
+
204
+ $results_desirialized = $results->deserialize();
205
+
206
+ if ( isset( $results_desirialized->lists ) && $results_desirialized->lists ) {
207
+ $response = $results_desirialized->lists;
208
+
209
+ } else {
210
+ $response = new WP_Error( 'lists', $ex->message . ' Check that your API key is correct' );
211
+ }
212
+
213
+ return $response;
214
+ }
215
+
216
+ /**
217
+ * Get merge tags from the relevant list
218
+ * @param [type] $list_id [description]
219
+ * @return [type] [description]
220
+ */
221
+ private function get_list_fields( $list_id ) {
222
+ try {
223
+ $results = self::$mailchimp->lists( $list_id )->mergeFields()->get();
224
+
225
+ $results = $results->deserialize();
226
+
227
+ return $results->merge_fields;
228
+ } catch ( Exception $ex ) {
229
+ $response = new WP_Error( 'custom_fields', 'Check that your API key is correct' );
230
+ return $response;
231
+ }
232
+ }
233
+
234
+ /**
235
+ * Create an array from the raw list
236
+ * @param [type] $lists_raw [description]
237
+ * @return [type] [description]
238
+ */
239
+ public static function get_lists_array( $lists_raw ) {
240
+ $mailchimp_lists = array();
241
+
242
+ if ( $lists_raw ) {
243
+ $lists_raw = maybe_unserialize( $lists_raw );
244
+ foreach ( $lists_raw as $list_raw ) {
245
+ $mailchimp_lists[ $list_raw['list_id'] ] = $list_raw['list_name'];
246
+ }
247
+ }
248
+
249
+ return $mailchimp_lists;
250
+ }
251
+ }
classes/class-wpcf7r-module.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Module - parent class for all wpcf7r Modules
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ class WPCF7R_Module {
9
+
10
+ /**
11
+ * Hold the active modules
12
+ *
13
+ * @var [type]
14
+ */
15
+ private static $registered_modules;
16
+
17
+ /**
18
+ * General init function for all child modules
19
+ *
20
+ * @return void
21
+ */
22
+ public function init( $module ) {
23
+ $this->name = $module['name'];
24
+ $this->title = $module['title'];
25
+
26
+ //register global modules actions
27
+ if ( method_exists( get_class( $this ), 'add_panel' ) ) {
28
+ add_action( 'wpcf7_editor_panels', array( $this, 'add_panel' ) );
29
+ }
30
+ //enqueue required admin scripts or styles
31
+ if ( method_exists( get_class( $this ), 'enqueue_admin_scripts' ) ) {
32
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) );
33
+ }
34
+ }
35
+
36
+ /**
37
+ * Add a new module
38
+ *
39
+ * @param [string] $name the module name
40
+ * @param [string] $title the module title
41
+ * @param [string] $class the name of the module main class
42
+ * @return void
43
+ */
44
+ public static function register_module( $name, $title, $class ) {
45
+ self::$registered_modules[ $name ] = array(
46
+ 'name' => $name,
47
+ 'title' => $title,
48
+ 'class' => $class,
49
+ );
50
+ }
51
+
52
+ /**
53
+ * Initialize all registered modules
54
+ *
55
+ * @return void
56
+ */
57
+ public static function init_modules() {
58
+ if ( self::get_active_modules() ) {
59
+ foreach ( self::get_active_modules() as $module ) {
60
+ $class_name = $module['class'];
61
+ $module_object = new $class_name;
62
+
63
+ //create an instance of the loaded module
64
+ $module_object->init( $module );
65
+ }
66
+ }
67
+ }
68
+
69
+ /**
70
+ * Return the registered modules array
71
+ *
72
+ * @return void
73
+ */
74
+ public static function get_active_modules() {
75
+ return self::$registered_modules;
76
+ }
77
+ }
classes/class-wpcf7r-post-types.php ADDED
@@ -0,0 +1,221 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Post_Types
4
+ * Create a post type that will act as a container for the form actions
5
+ * This post type is invisible to all users and displayed only under Contact Form 7 tab
6
+ */
7
+
8
+ defined( 'ABSPATH' ) || exit;
9
+
10
+ class WPCF7R_Post_Types {
11
+
12
+ public function __construct() {
13
+ add_action( 'init', array( $this, 'wpcf7r_post_type' ) );
14
+ add_action( 'add_meta_boxes', array( $this, 'wporg_add_custom_box' ) );
15
+ add_action( 'save_post', array( $this, 'save_changes' ) );
16
+ add_action( 'init', array( $this, 'wpcf7r_leads_post_type' ) );
17
+ }
18
+
19
+ /**
20
+ * Register leads post type
21
+ */
22
+ public function wpcf7r_leads_post_type() {
23
+
24
+ if ( class_exists( 'WPCF7R_Leads_Manager' ) && class_exists( 'WPCF7R_Action_Save_Lead' ) ) {
25
+ $labels = array(
26
+ 'name' => _x( 'wpcf7r_lead', 'Post Type General Name', 'wpcf7-redirect' ),
27
+ 'singular_name' => _x( 'wpcf7r_lead', 'Post Type Singular Name', 'wpcf7-redirect' ),
28
+ 'menu_name' => __( 'Leads', 'wpcf7-redirect' ),
29
+ 'name_admin_bar' => __( 'Post Type', 'wpcf7-redirect' ),
30
+ 'archives' => __( 'Item Archives', 'wpcf7-redirect' ),
31
+ 'attributes' => __( 'Item Attributes', 'wpcf7-redirect' ),
32
+ 'parent_item_colon' => __( 'Parent Item:', 'wpcf7-redirect' ),
33
+ 'all_items' => __( 'All Items', 'wpcf7-redirect' ),
34
+ 'add_new_item' => __( 'Add New Item', 'wpcf7-redirect' ),
35
+ 'add_new' => __( 'Add New', 'wpcf7-redirect' ),
36
+ 'new_item' => __( 'New Item', 'wpcf7-redirect' ),
37
+ 'edit_item' => __( 'Edit Item', 'wpcf7-redirect' ),
38
+ 'update_item' => __( 'Update Item', 'wpcf7-redirect' ),
39
+ 'view_item' => __( 'View Item', 'wpcf7-redirect' ),
40
+ 'view_items' => __( 'View Items', 'wpcf7-redirect' ),
41
+ 'search_items' => __( 'Search Item', 'wpcf7-redirect' ),
42
+ 'not_found' => __( 'Not found', 'wpcf7-redirect' ),
43
+ 'not_found_in_trash' => __( 'Not found in Trash', 'wpcf7-redirect' ),
44
+ 'featured_image' => __( 'Featured Image', 'wpcf7-redirect' ),
45
+ 'set_featured_image' => __( 'Set featured image', 'wpcf7-redirect' ),
46
+ 'remove_featured_image' => __( 'Remove featured image', 'wpcf7-redirect' ),
47
+ 'use_featured_image' => __( 'Use as featured image', 'wpcf7-redirect' ),
48
+ 'insert_into_item' => __( 'Insert into item', 'wpcf7-redirect' ),
49
+ 'uploaded_to_this_item' => __( 'Uploaded to this item', 'wpcf7-redirect' ),
50
+ 'items_list' => __( 'Items list', 'wpcf7-redirect' ),
51
+ 'items_list_navigation' => __( 'Items list navigation', 'wpcf7-redirect' ),
52
+ 'filter_items_list' => __( 'Filter items list', 'wpcf7-redirect' ),
53
+ );
54
+ $args = array(
55
+ 'label' => __( 'wpcf7r_leads', 'wpcf7-redirect' ),
56
+ 'description' => __( 'wpcf7r_leads', 'wpcf7-redirect' ),
57
+ 'labels' => $labels,
58
+ 'supports' => array( 'title' ),
59
+ 'hierarchical' => false,
60
+ 'public' => false,
61
+ 'show_ui' => true,
62
+ 'show_in_menu' => 'admin.php?page=wpcf7',
63
+ 'menu_position' => 5,
64
+ 'show_in_admin_bar' => false,
65
+ 'show_in_nav_menus' => false,
66
+ 'can_export' => true,
67
+ 'has_archive' => false,
68
+ 'exclude_from_search' => false,
69
+ 'publicly_queryable' => false,
70
+ 'rewrite' => false,
71
+ 'capability_type' => 'page',
72
+ 'show_in_rest' => false,
73
+ );
74
+ register_post_type( 'wpcf7r_leads', $args );
75
+
76
+ if ( defined( 'CF7_REDIRECT_DEBUG' ) && CF7_REDIRECT_DEBUG ) {
77
+ add_post_type_support( 'wpcf7r_leads', 'custom-fields' );
78
+ }
79
+
80
+ add_action( 'admin_menu', 'my_admin_menu' );
81
+ }
82
+
83
+ function my_admin_menu() {
84
+ add_submenu_page( 'wpcf7', 'Leads', 'Leads', 'manage_options', 'edit.php?post_type=wpcf7r_leads' );
85
+ //add_submenu_page( 'wpcf7', 'New lead', 'New lead', 'manage_options', 'post-new.php?post_type=wpcf7r_leads' );
86
+ }
87
+ }
88
+
89
+ // Register Custom Post Type
90
+ function wpcf7r_post_type() {
91
+ $labels = array(
92
+ 'name' => _x( 'wpcf7r_actions', 'Post Type General Name', 'wpcf7-redirect' ),
93
+ 'singular_name' => _x( 'wpcf7r_action', 'Post Type Singular Name', 'wpcf7-redirect' ),
94
+ 'menu_name' => __( 'wpcf7r_actions', 'wpcf7-redirect' ),
95
+ 'name_admin_bar' => __( 'Post Type', 'wpcf7-redirect' ),
96
+ 'archives' => __( 'Item Archives', 'wpcf7-redirect' ),
97
+ 'attributes' => __( 'Item Attributes', 'wpcf7-redirect' ),
98
+ 'parent_item_colon' => __( 'Parent Item:', 'wpcf7-redirect' ),
99
+ 'all_items' => __( 'All Items', 'wpcf7-redirect' ),
100
+ 'add_new_item' => __( 'Add New Item', 'wpcf7-redirect' ),
101
+ 'add_new' => __( 'Add New', 'wpcf7-redirect' ),
102
+ 'new_item' => __( 'New Item', 'wpcf7-redirect' ),
103
+ 'edit_item' => __( 'Edit Item', 'wpcf7-redirect' ),
104
+ 'update_item' => __( 'Update Item', 'wpcf7-redirect' ),
105
+ 'view_item' => __( 'View Item', 'wpcf7-redirect' ),
106
+ 'view_items' => __( 'View Items', 'wpcf7-redirect' ),
107
+ 'search_items' => __( 'Search Item', 'wpcf7-redirect' ),
108
+ 'not_found' => __( 'Not found', 'wpcf7-redirect' ),
109
+ 'not_found_in_trash' => __( 'Not found in Trash', 'wpcf7-redirect' ),
110
+ 'featured_image' => __( 'Featured Image', 'wpcf7-redirect' ),
111
+ 'set_featured_image' => __( 'Set featured image', 'wpcf7-redirect' ),
112
+ 'remove_featured_image' => __( 'Remove featured image', 'wpcf7-redirect' ),
113
+ 'use_featured_image' => __( 'Use as featured image', 'wpcf7-redirect' ),
114
+ 'insert_into_item' => __( 'Insert into item', 'wpcf7-redirect' ),
115
+ 'uploaded_to_this_item' => __( 'Uploaded to this item', 'wpcf7-redirect' ),
116
+ 'items_list' => __( 'Items list', 'wpcf7-redirect' ),
117
+ 'items_list_navigation' => __( 'Items list navigation', 'wpcf7-redirect' ),
118
+ 'filter_items_list' => __( 'Filter items list', 'wpcf7-redirect' ),
119
+ );
120
+
121
+ $args = array(
122
+ 'label' => __( 'Redirection For Contact Form 7 Actions', 'wpcf7-redirect' ),
123
+ 'description' => __( 'wpcf7r_actions', 'wpcf7-redirect' ),
124
+ 'labels' => $labels,
125
+ 'supports' => array( 'title', 'custom_fields', 'custom-fields' ),
126
+ 'hierarchical' => true,
127
+ 'public' => CF7_REDIRECT_DEBUG,
128
+ 'show_ui' => CF7_REDIRECT_DEBUG,
129
+ 'show_in_menu' => 'admin.php?page=wpcf7',
130
+ 'menu_position' => 5,
131
+ 'show_in_admin_bar' => CF7_REDIRECT_DEBUG,
132
+ 'show_in_nav_menus' => CF7_REDIRECT_DEBUG,
133
+ 'can_export' => CF7_REDIRECT_DEBUG,
134
+ 'has_archive' => CF7_REDIRECT_DEBUG,
135
+ 'exclude_from_search' => CF7_REDIRECT_DEBUG,
136
+ 'publicly_queryable' => CF7_REDIRECT_DEBUG,
137
+ 'rewrite' => CF7_REDIRECT_DEBUG,
138
+ 'capability_type' => 'page',
139
+ 'show_in_rest' => CF7_REDIRECT_DEBUG,
140
+ );
141
+
142
+ register_post_type( 'wpcf7r_action', $args );
143
+ add_post_type_support( 'wpcf7r_action', 'custom-fields' );
144
+
145
+ if ( defined( 'CF7_REDIRECT_DEBUG' ) && CF7_REDIRECT_DEBUG ) {
146
+ add_action( 'admin_menu', 'add_actions_menu' );
147
+
148
+ function add_actions_menu() {
149
+ add_submenu_page( 'wpcf7', __( 'Actions List', 'wpcf7-redirect' ), __( 'Actions List', 'wpcf7-redirect' ), 'manage_options', 'edit.php?post_type=wpcf7r_action' );
150
+ }
151
+ }
152
+
153
+ }
154
+
155
+ function wporg_add_custom_box() {
156
+ $screens = array( 'wpcf7r_action' );
157
+ if ( is_wpcf7r_debug() ) {
158
+ $screens[] = 'wpcf7r_leads';
159
+ }
160
+
161
+ foreach ( $screens as $screen ) {
162
+ add_meta_box(
163
+ 'wpcf7r_action_meta',
164
+ __( 'Action Meta', 'wpcf7-redirect' ),
165
+ array( $this, 'debug_helper' ),
166
+ $screen
167
+ );
168
+ }
169
+
170
+ add_meta_box(
171
+ 'wpcf7r_leads',
172
+ __( 'Lead Details', 'wpcf7-redirect' ),
173
+ array( $this, 'lead_fields_html' ),
174
+ 'wpcf7r_leads'
175
+ );
176
+ }
177
+
178
+ /**
179
+ * Get the meta html
180
+ *
181
+ * @param $post
182
+ */
183
+ function lead_fields_html( $post ) {
184
+ $lead = new WPCF7R_Lead( $post->ID );
185
+
186
+ $fields = $lead->get_lead_fields();
187
+
188
+ foreach ( $fields as $field ) {
189
+ switch ( $field['name'] ) {
190
+ case 'action-save_lead':
191
+ $field['value'] = $field['value']['data']['lead_id'];
192
+ break;
193
+ case 'action-mailchimp':
194
+ if ( is_wp_error( $field['value'] ) ) {
195
+ $field['value'] = $field['value']->get_error_message();
196
+ }
197
+ break;
198
+ }
199
+
200
+ WPCF7R_Html::render_field( $field, $field['prefix'] );
201
+ }
202
+ }
203
+
204
+ public function save_changes( $post_id ) {
205
+ $post_type = get_post_type( $post_id );
206
+
207
+ if ( 'wpcf7r_leads' === $post_type ) {
208
+ if ( isset( $_POST['wpcf7-redirect'] ) ) {
209
+ foreach ( $_POST['wpcf7-redirect'] as $meta_key => $meta_value ) {
210
+ update_post_meta( $post_id, $meta_key, $meta_value );
211
+ }
212
+ }
213
+ }
214
+ }
215
+
216
+ function debug_helper() {
217
+ echo '<pre>';
218
+ print_r( get_post_custom() );
219
+ echo '</pre>';
220
+ }
221
+ }
classes/class-wpcf7r-settings.php ADDED
@@ -0,0 +1,293 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class WPCF7r_Settings file.
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ /**
9
+ * Contact form 7 Redirect Settings panel
10
+ */
11
+ class WPCF7r_Settings {
12
+ public $product_url = WPCF7_PRO_REDIRECT_PLUGIN_PAGE_URL;
13
+
14
+ public function __construct() {
15
+ $this->page_slug = 'wpc7_redirect';
16
+ $this->api = new Qs_Api();
17
+
18
+ add_action( 'admin_menu', array( $this, 'create_plugin_settings_page' ) );
19
+ add_action( 'admin_init', array( $this, 'wpcf7r_register_options' ) );
20
+ add_filter( 'plugin_row_meta', array( $this, 'register_plugin_links' ), 10, 2 );
21
+
22
+ }
23
+
24
+ /**
25
+ * Deactivate the license - Disabled on v2.0
26
+ */
27
+ public function deactivate_license() {
28
+ $serial = WPCF7r_Utils::get_serial_key();
29
+ $activation_id = WPCF7r_Utils::get_activation_id();
30
+
31
+ $this->api->deactivate_liscense( $activation_id, $serial );
32
+ $this->reset_activation();
33
+
34
+ wp_redirect( WPCF7r_Utils::get_plugin_settings_page_url() );
35
+ }
36
+
37
+ /**
38
+ * Register plugin options
39
+ */
40
+ public function wpcf7r_register_options() {
41
+ $this->fields = array();
42
+ //$this->add_license_section();
43
+ $this->add_settings_section();
44
+
45
+ foreach ( $this->fields as $field ) {
46
+ $args = array();
47
+ add_settings_field( $field['uid'], $field['label'], array( $this, 'field_callback' ), $this->page_slug, $field['section'], $field );
48
+ //$args['sanitize_callback'] = array($this, 'validate_serial_key');
49
+ register_setting( $this->page_slug, $field['uid'], $args );
50
+ }
51
+ }
52
+
53
+ public function add_settings_section() {
54
+
55
+ add_settings_section( 'settings_section', __( 'Global Settings', 'wpcf7-redirect' ), array( $this, 'section_callback' ), $this->page_slug );
56
+
57
+ $this->fields = array_merge(
58
+ $this->fields,
59
+ array(
60
+ array(
61
+ 'uid' => 'wpcf_debug',
62
+ 'label' => 'Debug',
63
+ 'section' => 'settings_section',
64
+ 'type' => 'checkbox',
65
+ 'options' => false,
66
+ 'placeholder' => '',
67
+ 'helper' => '',
68
+ 'supplemental' => __( 'This will open the actions post type and display debug feature.', 'wpcf7-redirect' ),
69
+ 'default' => '',
70
+ ),
71
+ )
72
+ );
73
+ }
74
+
75
+ /**
76
+ * add_license_section - Deprecated
77
+ */
78
+ public function add_license_section() {
79
+ add_settings_section( 'serial_section', __( 'License Information', 'wpcf7-redirect' ), array( $this, 'section_callback' ), $this->page_slug );
80
+
81
+ $this->fields = array_merge(
82
+ $this->fields,
83
+ array(
84
+ array(
85
+ 'uid' => 'wpcf7r_serial_number',
86
+ 'label' => 'Serial Number',
87
+ 'section' => 'serial_section',
88
+ 'type' => 'text',
89
+ 'options' => false,
90
+ 'placeholder' => 'Type your serial here',
91
+ 'helper' => '',
92
+ 'supplemental' => __( 'This process will send your serial/domain to a 3rd party validation server to validate the key authenticity', 'wpcf7-redirect' ),
93
+ 'default' => '',
94
+ ),
95
+ )
96
+ );
97
+
98
+ return $fields;
99
+ }
100
+
101
+ /**
102
+ * Validate serial key process
103
+ *
104
+ * @param $serial
105
+ */
106
+ public function validate_serial_key( $serial ) {
107
+ if ( ! $serial ) {
108
+ return;
109
+ }
110
+
111
+ $activation_id = WPCF7r_Utils::get_activation_id();
112
+
113
+ if ( ! $activation_id ) {
114
+ $is_valid = $this->api->activate_serial( $serial );
115
+ } else {
116
+ $is_valid = $this->api->validate_serial( $activation_id, $serial );
117
+ }
118
+
119
+ //serial was not valid
120
+ if ( is_wp_error( $is_valid ) ) {
121
+ $message = $is_valid->get_error_message();
122
+ if ( is_object( $message ) && isset( $message->license_key ) ) {
123
+ $message = $message->license_key[0];
124
+ }
125
+ add_settings_error(
126
+ 'wpcf7r_serial_number',
127
+ 'not-valid-serial',
128
+ $message,
129
+ 'error'
130
+ );
131
+ $this->reset_activation();
132
+ return false;
133
+ } elseif ( ! $activation_id ) {
134
+ //serial was valid, update the activation key for future validation
135
+ $this->set_activation( $is_valid->data );
136
+ }
137
+
138
+ if ( isset( $_GET['deactivate'] ) ) {
139
+ return '';
140
+ }
141
+
142
+ return $serial;
143
+ }
144
+
145
+ /**
146
+ * Delete all activation data - use in case activation validation or activation returns an error
147
+ */
148
+ public function reset_activation() {
149
+ delete_option( 'wpcf7r_activation_id' );
150
+ delete_option( 'wpcf7r_activation_expiration' );
151
+ delete_option( 'wpcf7r_activation_data' );
152
+
153
+ WPCF7r_Utils::delete_serial_key();
154
+ }
155
+
156
+ /**
157
+ * Set all data related with the plugin activation
158
+ *
159
+ * @param $validation_data
160
+ */
161
+ public function set_activation( $validation_data ) {
162
+ update_option( 'wpcf7r_activation_id', $validation_data->activation_id );
163
+ update_option( 'wpcf7r_activation_expiration', $validation_data->expire );
164
+ update_option( 'wpcf7r_activation_data', $validation_data );
165
+ }
166
+
167
+ /**
168
+ * A function for displaying a field on the admin settings page
169
+ */
170
+ public function field_callback( $arguments ) {
171
+ $value = get_option( $arguments['uid'] ); // Get the current value, if there is one
172
+ if ( ! $value ) { // If no value exists
173
+ $value = $arguments['default']; // Set to our default
174
+ }
175
+ // Check which type of field we want
176
+ switch ( $arguments['type'] ) {
177
+ case 'text': // If it is a text field
178
+ case 'password':
179
+ printf( '<input name="%1$s" id="%1$s" type="%2$s" placeholder="%3$s" value="%4$s" class="widefat" />', $arguments['uid'], $arguments['type'], $arguments['placeholder'], $value );
180
+ break;
181
+ case 'checkbox': // If it is a text field
182
+ $checked = checked( $value, '1', false );
183
+ printf( '<input name="%1$s" id="%1$s" type="%2$s" placeholder="%3$s" value="%4$s" class="widefat" %5$s/>', $arguments['uid'], $arguments['type'], $arguments['placeholder'], '1', $checked );
184
+ break;
185
+ }
186
+
187
+ $helper = $arguments['helper'];
188
+ $supplimental = $arguments['supplemental'];
189
+
190
+ // If there is help text
191
+ if ( $helper ) {
192
+ printf( '<span class="helper"> %s</span>', $helper ); // Show it
193
+ }
194
+
195
+ // If there is supplemental text
196
+ if ( $supplimental ) {
197
+ printf( '<p class="description">%s</p>', $supplimental ); // Show it
198
+ }
199
+ }
200
+
201
+ /**
202
+ * Main call for creating the settings page
203
+ */
204
+ public function create_plugin_settings_page() {
205
+ // Add the menu item and page
206
+ $page_title = 'Extensions';
207
+ $menu_title = 'Extensions';
208
+ $capability = 'manage_options';
209
+ $callback = array( $this, 'plugin_settings_page_content' );
210
+ $icon = 'dashicons-admin-plugins';
211
+ $position = 100;
212
+
213
+ add_submenu_page(
214
+ 'wpcf7',
215
+ $page_title,
216
+ $page_title,
217
+ $capability,
218
+ $this->page_slug,
219
+ $callback
220
+ );
221
+ }
222
+
223
+ /**
224
+ * The setting page template HTML
225
+ */
226
+ public function plugin_settings_page_content() {
227
+ $wpcf7_extensions = new WPCF7R_Extensions();
228
+ ?>
229
+ <section class="padbox">
230
+ <div class="wrap wrap-wpcf7redirect">
231
+ <h2>
232
+ <span>
233
+ <?php _e( 'Redirection For Contact Form 7', 'wpcf7-redirect' ); ?>
234
+ </span>
235
+ </h2>
236
+ <div class="user-message">
237
+ <ul>
238
+ <li>The new and improved Submission Action System is how redirection for Contact Form 7 processes submission data.</li>
239
+ <li>Submission Actions are like modules which can be added to each form.</li>
240
+ <li>You can add multiple actions to a single form or a single action can be added to any form.</li>
241
+ <li>Create custom login/registration forms, manage your conversion pixels, set conditional rules and much more.</li>
242
+ </ul>
243
+ </div>
244
+ <div class="postbox extensions-list-wrap">
245
+ <div class="padbox">
246
+ <?php $wpcf7_extensions->display(); ?>
247
+ </div>
248
+ </div>
249
+ <div class="postbox">
250
+ <div class="padbox">
251
+ <form method="POST" action="options.php" name="wpcfr7_settings">
252
+ <?php
253
+ do_action( 'before_settings_fields' );
254
+ settings_fields( $this->page_slug );
255
+ do_settings_sections( $this->page_slug );
256
+ submit_button();
257
+ ?>
258
+ </form>
259
+ <?php if ( is_wpcf7r_debug() ) : ?>
260
+ <input type="button" name="migrate_again" value="<?php _e( 'Migrate again from old settings', 'wpcf7-redirect' ); ?>" class="migrate_again button button-secondary" />
261
+
262
+ <h3><?php _e( 'Recreate from Debug', 'wpcf7-redirect' ); ?></h3>
263
+ <textarea id="debug-info" style="width:100%;"></textarea>
264
+ <button class="reacreate-from-debug button button-primary"><?php _e( 'Recreate From Debug', 'wpcf7-redirect' ); ?></button>
265
+ <?php endif; ?>
266
+ </div>
267
+ </div>
268
+ </div>
269
+ </section>
270
+ <?php
271
+ }
272
+
273
+ /**
274
+ * Create a section on the admin settings page
275
+ */
276
+ public function section_callback( $arguments ) {
277
+ switch ( $arguments['id'] ) {
278
+ case 'serial_section':
279
+ echo sprintf( "In order to gain access to plugin updates, please enter your license key below. If you don't have a licence key, please <a href='%s' target='_blank'>click Here</a>.", $this->product_url );
280
+ break;
281
+ }
282
+ }
283
+
284
+ /**
285
+ * Add a link to the options page to the plugin description block.
286
+ */
287
+ function register_plugin_links( $links, $file ) {
288
+ if ( WPCF7_PRO_REDIRECT_BASE_NAME === $file ) {
289
+ $links[] = WPCF7r_Utils::get_settings_link();
290
+ }
291
+ return $links;
292
+ }
293
+ }
classes/class-wpcf7r-submission.php ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Redirection for Contact Form 7 Submission handler
4
+ *
5
+ * @package wpcf7r
6
+ */
7
+
8
+ defined( 'ABSPATH' ) || exit;
9
+
10
+ /**
11
+ * WPCF7r_Submission Class - handles the submission process.
12
+ */
13
+ class WPCF7r_Submission {
14
+ /**
15
+ * Change the response object returned to the client
16
+ *
17
+ * @param [object] $response - contact form 7 response object.
18
+ * @return [object] $response - contact form 7 updated response object.
19
+ */
20
+ public function manipulate_cf7_response_object( $response ) {
21
+
22
+ if ( isset( $this->response ) && $this->response ) {
23
+ $response = array_merge( $this->response, $response );
24
+ }
25
+
26
+ return apply_filters( 'wpcf7r_manipulate_cf7_response_object', $response, $this );
27
+ }
28
+
29
+ /**
30
+ * Add plugin support to browsers that don't support ajax.
31
+ *
32
+ * @param [object] $wpcf7 - contact form 7 form object.
33
+ * @return void
34
+ */
35
+ public function non_ajax_redirection( $wpcf7 ) {
36
+
37
+ if ( ! WPCF7_Submission::is_restful() ) {
38
+
39
+ $submission = WPCF7_Submission::get_instance();
40
+
41
+ $wpcf7_form = get_cf7r_form( $wpcf7, $submission );
42
+
43
+ if ( 'mail_sent' === $wpcf7_form->get_submission_status() ) {
44
+
45
+ $results = $this->handle_valid_actions( $wpcf7 );
46
+
47
+ if ( $results ) {
48
+ foreach ( $results as $result_type => $result_actions ) {
49
+ if ( ( 'FireScript' === $result_type || 'firescript' === strtolower( $result_type ) ) && $result_action ) {
50
+ $this->scripts = $result_actions;
51
+
52
+ add_action( 'wp_head', array( $this, 'add_header_script' ) );
53
+ }
54
+
55
+ foreach ( $result_actions as $result_action ) {
56
+ if ( 'redirect' === $result_type ) {
57
+ $this->redirect_url = $result_action['redirect_url'];
58
+
59
+ if ( 'new_tab' === $result_action['type'] ) {
60
+ add_action( 'wp_head', array( $this, 'open_new_tab' ), 9999 );
61
+ } else {
62
+ // Do this last.
63
+ add_action( 'wp_head', array( $this, 'redirect' ), 9999 );
64
+ }
65
+ }
66
+ }
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
72
+
73
+ /**
74
+ * Print header scripts for non ajax submits
75
+ */
76
+ public function add_header_script() {
77
+ if ( isset( $this->scripts ) && $this->scripts ) {
78
+ foreach ( $this->scripts as $script ) {
79
+ echo '<script>' . $script . '</script>';
80
+ }
81
+ }
82
+ }
83
+
84
+ /**
85
+ * Redirect support for non ajax browsers
86
+ */
87
+ public function redirect() {
88
+ // Allow other plugins to manipulate the redirect url settings.
89
+ $redirect_url = apply_filters( 'wpcf7_redirect_url', $this->redirect_url );
90
+
91
+ echo "<script>window.location='" . esc_attr( $redirect_url ) . "'</script>";
92
+ }
93
+
94
+ /**
95
+ * Open new tab on non ajax submits
96
+ */
97
+ public function open_new_tab() {
98
+ // Allow other plugins to manipulate the redirect url settings.
99
+ $redirect_url = apply_filters( 'wpcf7_redirect_url', $this->redirect_url );
100
+
101
+ echo "<script>window.open('" . esc_attr( $redirect_url ) . "')</script>";
102
+ }
103
+
104
+ /**
105
+ * This function is fired before send email
106
+ *
107
+ * @param [object] $wpcf7 - cf7 form object.
108
+ * @return mixed - redirect response
109
+ */
110
+ public function handle_valid_actions( $wpcf7 ) {
111
+
112
+ $submission = WPCF7_Submission::get_instance();
113
+
114
+ $wpcf7_form = get_cf7r_form( $wpcf7, $submission );
115
+
116
+ if ( $submission && $wpcf7_form->has_actions() ) {
117
+ // Get the submitted data.
118
+ $this->posted_data = $submission->get_posted_data();
119
+
120
+ // Process all relevant actions.
121
+ $this->response = $wpcf7_form->process_actions();
122
+
123
+ // Skip default contact form 7 email.
124
+ if ( isset( $this->response['send_mail'] ) && $this->response['send_mail'] ) {
125
+ add_filter(
126
+ 'wpcf7_skip_mail',
127
+ function() {
128
+ return true;
129
+ }
130
+ );
131
+ }
132
+
133
+ $this->save_lead_actions( $this->response );
134
+
135
+ $wpcf7_form->maybe_perform_pre_result_action();
136
+
137
+ return $this->response;
138
+ }
139
+ }
140
+
141
+ /**
142
+ * Save lead actions
143
+ *
144
+ * @param [array] $actions_results - save actions on the lead record.
145
+ * @return void
146
+ */
147
+ public function save_lead_actions( $actions_results ) {
148
+ foreach ( $actions_results as $action_type => $actions_result ) {
149
+ WPCF7R_Leads_Manager::save_action( WPCF7R_Action::get_lead_id(), $action_type, $actions_result );
150
+ }
151
+ }
152
+
153
+ /**
154
+ * Early hook to catch cf7 submissions before they are processed
155
+ *
156
+ * @param [object] $cf7 - contact form 7 form object.
157
+ * @return void
158
+ */
159
+ public function after_cf7_object_created( $cf7 ) {
160
+ if ( WPCF7_Submission::is_restful() || isset( $_POST['_wpcf7'] ) ) {
161
+ // Get an instance of contact form 7 redirection post.
162
+ $wpcf7_form = get_cf7r_form( $cf7 );
163
+
164
+ // Check if the form has validation actions.
165
+ $actions = $wpcf7_form->get_active_actions();
166
+
167
+ if ( $actions ) {
168
+ foreach ( $actions as $action ) {
169
+ $results = $action->process_pre_submit_actions();
170
+ // Saved reference for the items removed from the $_POST data.
171
+ if ( isset( $results['removed_params'] ) && $results['removed_params'] ) {
172
+ $wpcf7_form->set_removed_posted_data( $results['removed_params'] );
173
+ }
174
+ }
175
+ }
176
+ }
177
+ }
178
+
179
+ /**
180
+ * Handle validation actions
181
+ *
182
+ * @param [object] $wpcf_validation_obj - validation object.
183
+ * @param [array] $tags - contact form 7 tags array.
184
+ * @return object - $new_validation_obj - the updated validation object.
185
+ */
186
+ public function handle_validation_actions( $wpcf_validation_obj, $tags ) {
187
+
188
+ // store refrence to the form tags status.
189
+ $wpcf_validation_obj->tags = $tags;
190
+ // get an instance of the form submission.
191
+ $submission = WPCF7_Submission::get_instance();
192
+
193
+ if ( ! $submission ) {
194
+ return $wpcf_validation_obj;
195
+ }
196
+
197
+ // Get an instance of the contact form 7 form.
198
+ $cf7_form = $submission->get_contact_form();
199
+ // Get an instance of contact form 7 redirection post.
200
+ $wpcf7_form = get_cf7r_form( $cf7_form, $submission, $wpcf_validation_obj );
201
+
202
+ $new_validation_obj = $wpcf_validation_obj;
203
+
204
+ // Check if the form has validation actions.
205
+ if ( $submission && $wpcf7_form->has_actions() ) {
206
+ // process all actions.
207
+ $invalid_tags = $wpcf7_form->process_validation_actions();
208
+
209
+ if ( $invalid_tags ) {
210
+ $new_validation_obj = new WPCF7_Validation();
211
+
212
+ // Invalidate all invalid tags.
213
+ if ( isset( $invalid_tags ) && $invalid_tags ) {
214
+ foreach ( reset( $invalid_tags ) as $custom_error_action_results ) {
215
+ if ( isset( $custom_error_action_results['invalid_tags'] ) && $custom_error_action_results['invalid_tags'] ) {
216
+ foreach ( $custom_error_action_results['invalid_tags'] as $wp_error ) {
217
+ $error = $wp_error->get_error_message();
218
+
219
+ $new_validation_obj->invalidate( $error['tag'], $error['error_message'] );
220
+ }
221
+ }
222
+
223
+ // invalidate default tag errors.
224
+ foreach ( $tags as $tag ) {
225
+ if ( ! $custom_error_action_results['ignored_tags'] || ! in_array( $tag->name, $custom_error_action_results['ignored_tags'], true ) ) {
226
+ $result = apply_filters( "wpcf7_validate_{$tag->type}", $new_validation_obj, $tag );
227
+ }
228
+ }
229
+ }
230
+ }
231
+ }
232
+ }
233
+
234
+ return $new_validation_obj;
235
+ }
236
+ }
classes/class-wpcf7r-updates.php ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Wpcf7r_Updates
4
+ * A class used for updating the plugin using th QS API
5
+ */
6
+
7
+ defined( 'ABSPATH' ) || exit;
8
+
9
+ class Wpcf7r_Updates {
10
+ // Plugin current version
11
+ private $current_version;
12
+
13
+ // Plugin remote update path
14
+ private $update_url;
15
+
16
+ // Plugin Slug (plugin_directory/plugin_file.php)
17
+ private $plugin_slug;
18
+
19
+ // Plugin name (plugin_file)
20
+ private $slug;
21
+
22
+ /**
23
+ * Initialize a new instance of the WordPress Auto-Update class
24
+ *
25
+ * @param $current_version
26
+ * @param $plugin_slug
27
+ */
28
+ public function __construct( $current_version, $plugin_slug ) {
29
+ // Set the class public variables
30
+ $this->current_version = $current_version;
31
+ $this->update_url = add_query_arg( 'update', '', WPCF7_PRO_REDIRECT_PLUGIN_UPDATES );
32
+
33
+ // Set the Plugin Slug
34
+ $this->plugin_slug = $plugin_slug;
35
+ list ($t1, $t2) = explode( '/', $plugin_slug );
36
+ $this->slug = str_replace( '.php', '', $t2 );
37
+
38
+ $this->activation_id = WPCF7r_Utils::get_activation_id();
39
+ $this->serial = WPCF7r_Utils::get_serial_key();
40
+ $this->domain = $_SERVER['HTTP_HOST'];
41
+ // define the alternative API for updating checking
42
+ add_filter( 'pre_set_site_transient_update_plugins', array( &$this, 'check_update' ) );
43
+
44
+ // Define the alternative response for information checking
45
+ add_filter( 'plugins_api', array( &$this, 'check_info' ), 10, 3 );
46
+ }
47
+
48
+ /**
49
+ * Add our self-hosted autoupdate plugin to the filter transient
50
+ *
51
+ * @param $transient
52
+ * @return 'self-hosted' autoupdate plugin to the filter transient
53
+ */
54
+ public function check_update( $transient ) {
55
+
56
+ if ( empty( $transient->checked ) ) {
57
+ return $transient;
58
+ }
59
+
60
+ // Get the remote version
61
+ $remote_version = $this->get_remote( 'version' );
62
+
63
+ if ( $remote_version && ! is_wp_error( $remote_version ) ) {
64
+ // If a newer version is available, add the update
65
+ if ( version_compare( $this->current_version, $remote_version->new_version, '<' ) ) {
66
+ $obj = new stdClass();
67
+ $obj->slug = $this->slug;
68
+ $obj->new_version = $remote_version->new_version;
69
+ $obj->url = $remote_version->url;
70
+ $obj->requires = $remote_version->requires;
71
+ $obj->plugin = $this->plugin_slug;
72
+ $obj->package = $remote_version->package;
73
+ $obj->tested = $remote_version->tested;
74
+ $transient->response[ $this->plugin_slug ] = $obj;
75
+ }
76
+ }
77
+
78
+ return $transient;
79
+ }
80
+
81
+ /**
82
+ * Add our self-hosted description to the filter
83
+ *
84
+ * @param $false
85
+ * @param $action
86
+ * @param $arg
87
+ * @return bool|object
88
+ */
89
+ public function check_info( $false, $action, $arg ) {
90
+ if ( ( 'query_plugins' === $action || 'plugin_information' === $action ) &&
91
+ isset( $arg->slug ) && $arg->slug === $this->slug ) {
92
+
93
+ $information = $this->get_remote( 'info' );
94
+
95
+ $information->sections = (array) $information->sections;
96
+ $information->banners = (array) $information->banners;
97
+
98
+ $array_pattern = array(
99
+ '/^([\*\s])*(\d\d\.\d\d\.\d\d\d\d[^\n]*)/m',
100
+ '/^\n+|^[\t\s]*\n+/m',
101
+ '/\n/',
102
+ );
103
+ $array_replace = array(
104
+ '<h4>$2</h4>',
105
+ '</div><div>',
106
+ '</div><div>',
107
+ );
108
+
109
+ $information->sections['changelog'] = '<div>' . preg_replace( $array_pattern, $array_replace, $information->sections['changelog'] ) . '</div>';
110
+
111
+ return $information;
112
+ }
113
+
114
+ return $false;
115
+ }
116
+
117
+ /**
118
+ * Return the remote version
119
+ *
120
+ * @param $action
121
+ * @return string $remote_version
122
+ */
123
+ public function get_remote( $action = '' ) {
124
+
125
+ $params = array(
126
+ 'body' => array(
127
+ 'action' => $action,
128
+ 'activation_id' => $this->activation_id,
129
+ 'serial' => $this->serial,
130
+ 'plugin' => $this->plugin_slug,
131
+ 'domain' => $this->domain,
132
+ ),
133
+ );
134
+
135
+ // Make the POST request
136
+ $response = wp_remote_post( $this->update_url, $params );
137
+
138
+ // Check if response is valid
139
+ if ( ! is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) === 200 ) {
140
+ $response = json_decode( wp_remote_retrieve_body( $response ) );
141
+
142
+ }
143
+
144
+ return $response;
145
+ }
146
+ }
classes/class-wpcf7r-user.php ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_user - Parent class that handles all redirect actions
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ class WPCF7R_User {
9
+ public function __construct() {
10
+ add_action( 'show_user_profile', array( $this, 'additional_profile_fields' ) );
11
+ add_action( 'edit_user_profile', array( $this, 'additional_profile_fields' ) );
12
+
13
+ add_action( 'personal_options_update', array( $this, 'save_custom_user_fields' ) );
14
+ add_action( 'edit_user_profile_update', array( $this, 'save_custom_user_fields' ) );
15
+
16
+ }
17
+
18
+ private function get_all_forms_fields() {
19
+ $this->fields = array();
20
+
21
+ $cf7_forms = $this->get_cf7_forms();
22
+
23
+ if ( $cf7_forms ) {
24
+ foreach ( $cf7_forms as $cf7_form ) {
25
+ $wpcf7r_form = get_cf7r_form( $cf7_form->ID );
26
+
27
+ $actions = $wpcf7r_form->get_actions( 'default' );
28
+
29
+ foreach ( $actions as $action ) {
30
+ $action_type = $action->get( 'action_type' );
31
+ if ( 'register' === $action_type ) {
32
+
33
+ $fields_mapping = maybe_unserialize( $action->get( 'user_fields' ) );
34
+
35
+ if ( $fields_mapping ) {
36
+ $this->fields = array_merge( $fields_mapping, $this->fields );
37
+ }
38
+ }
39
+ }
40
+ }
41
+ }
42
+
43
+ return $this->fields;
44
+ }
45
+
46
+ private function get_cf7_forms() {
47
+ $args = array(
48
+ 'post_type' => 'wpcf7_contact_form',
49
+ 'posts_per_page' => -1,
50
+ );
51
+
52
+ $cf7_forms = get_posts( $args );
53
+
54
+ return $cf7_forms;
55
+ }
56
+
57
+ /**
58
+ * Add new fields above 'Update' button.
59
+ *
60
+ * @param $user_id
61
+ */
62
+ public function save_custom_user_fields( $user_id ) {
63
+
64
+ if ( ! current_user_can( 'edit_user', $user_id ) ) {
65
+ return false;
66
+ }
67
+
68
+ $fields = $this->get_all_forms_fields();
69
+
70
+ if ( ! $fields ) {
71
+ return;
72
+ }
73
+
74
+ foreach ( $fields as $field ) {
75
+ $value = isset( $_POST[ $field['user_field_key'] ] ) ? $_POST[ $field['user_field_key'] ] : '';
76
+ update_user_meta( $user_id, $field['user_field_key'], $value );
77
+ }
78
+ }
79
+
80
+ /**
81
+ * Add new fields above 'Update' button.
82
+ *
83
+ * @param WP_User $user User object.
84
+ */
85
+ public function additional_profile_fields( $user ) {
86
+
87
+ $fields = $this->get_all_forms_fields();
88
+
89
+ if ( ! $fields ) {
90
+ return;
91
+ }
92
+ ?>
93
+
94
+ <h3><?php _e( 'Extra profile information', 'wpcf7-redirect' ); ?></h3>
95
+
96
+ <table class="form-table">
97
+ <?php foreach ( $fields as $field ) : ?>
98
+ <?php $value = get_user_meta( $user->ID, $field['user_field_key'], true ); ?>
99
+ <tr>
100
+ <th>
101
+ <label for="<?php echo $field['user_field_key']; ?>"><?php echo $field['user_field_key']; ?></label>
102
+ </th>
103
+ <td>
104
+ <input type="text" name="<?php echo $field['user_field_key']; ?>" value="<?php echo $value; ?>">
105
+ </td>
106
+ </tr>
107
+ <?php endforeach; ?>
108
+ </table>
109
+ <?php
110
+ }
111
+
112
+ }
classes/class-wpcf7r-utils.php ADDED
@@ -0,0 +1,1045 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class WPCF7r_Utils file.
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ /**
9
+ * Contact form 7 redirect utilities
10
+ */
11
+ class WPCF7r_Utils {
12
+ public $banner_version = 1.01;
13
+ public static $instance;
14
+ public static $actions_list = array();
15
+ public static $rendered_elements = array();
16
+
17
+ public function __construct() {
18
+ self::$instance = $this;
19
+
20
+ $this->api = new Qs_Api();
21
+ }
22
+
23
+ /**
24
+ * Add a message to the session collector
25
+ *
26
+ * @param $type
27
+ * @param $message
28
+ */
29
+ public static function add_admin_notice( $type, $message ) {
30
+ $_SESSION['wpcf7r_admin_notices'][ $type ] = $message;
31
+ }
32
+
33
+ /**
34
+ * Register a new type of action
35
+ *
36
+ * @param $name
37
+ * @param $title
38
+ * @param $class
39
+ */
40
+ public static function register_wpcf7r_actions( $name, $title, $class, $order ) {
41
+ self::$actions_list[ $name ] = array(
42
+ 'label' => $title,
43
+ 'attr' => '',
44
+ 'handler' => $class,
45
+ 'order' => $order,
46
+ );
47
+ }
48
+
49
+ /**
50
+ * Get action name
51
+ *
52
+ * @param $action_type
53
+ */
54
+ public static function get_action_name( $action_type ) {
55
+ return isset( self::$actions_list[ $action_type ] ) ? self::$actions_list[ $action_type ]['label'] : $action_type;
56
+ }
57
+
58
+ /**
59
+ * Get the available actions
60
+ */
61
+ public static function get_wpcf7r_actions() {
62
+ return self::$actions_list;
63
+ }
64
+
65
+ /**
66
+ * Duplicate all action posts and connect it to the new created form
67
+ *
68
+ * @param $new_cf7
69
+ */
70
+ public function duplicate_form_support( $new_cf7 ) {
71
+
72
+ if ( isset( $_POST['wpcf7-copy'] ) && 'Duplicate' === $_POST['wpcf7-copy'] || ( isset( $_GET['action'] ) && 'copy' === $_GET['action'] ) ) {
73
+
74
+ $original_post_id = isset( $_POST['post_ID'] ) ? (int) $_POST['post_ID'] : (int) $_GET['post'];
75
+ $original_cf7 = get_cf7r_form( $original_post_id );
76
+
77
+ $original_action_posts = $original_cf7->get_actions( 'default' );
78
+
79
+ if ( $original_action_posts ) {
80
+ foreach ( $original_action_posts as $original_action_post ) {
81
+ $new_post_id = $this->duplicate_post( $original_action_post->action_post );
82
+ update_post_meta( $new_post_id, 'wpcf7_id', $new_cf7->id() );
83
+ }
84
+ }
85
+ }
86
+ }
87
+
88
+ /**
89
+ * After form deletion delete all its actions
90
+ *
91
+ * @param int $post_id
92
+ */
93
+ public function delete_all_form_actions( $post_id ) {
94
+ global $post_type;
95
+
96
+ if ( get_post_type( $post_id ) === 'wpcf7_contact_form' ) {
97
+
98
+ $wpcf7r = get_cf7r_form( $post_id );
99
+
100
+ $action_posts = $wpcf7r->get_actions( 'default' );
101
+
102
+ if ( $action_posts ) {
103
+ foreach ( $action_posts as $action_post ) {
104
+ wp_delete_post( $action_post->get_id() );
105
+ }
106
+ }
107
+ };
108
+
109
+ }
110
+
111
+ /**
112
+ * Dupplicate contact form and all its actions
113
+ *
114
+ * @param $post
115
+ */
116
+ public function duplicate_post( $post ) {
117
+ global $wpdb;
118
+
119
+ // if you don't want current user to be the new post author,
120
+ // then change next couple of lines to this: $new_post_author = $post->post_author;
121
+ $current_user = wp_get_current_user();
122
+ $new_post_author = $current_user->ID;
123
+ $post_id = $post->ID;
124
+
125
+ // if post data exists, create the post duplicate
126
+ if ( isset( $post ) && null !== $post ) {
127
+ // new post data array
128
+ $args = array(
129
+ 'comment_status' => $post->comment_status,
130
+ 'ping_status' => $post->ping_status,
131
+ 'post_author' => $new_post_author,
132
+ 'post_content' => $post->post_content,
133
+ 'post_excerpt' => $post->post_excerpt,
134
+ 'post_name' => $post->post_name,
135
+ 'post_parent' => $post->post_parent,
136
+ 'post_password' => $post->post_password,
137
+ 'post_status' => 'private',
138
+ 'post_title' => $post->post_title,
139
+ 'post_type' => $post->post_type,
140
+ 'to_ping' => $post->to_ping,
141
+ 'menu_order' => $post->menu_order,
142
+ );
143
+
144
+ // insert the post by wp_insert_post() function
145
+ $new_post_id = wp_insert_post( $args );
146
+
147
+ // get all current post terms ad set them to the new post draft
148
+ $taxonomies = get_object_taxonomies( $post->post_type );
149
+
150
+ // returns array of taxonomy names for post type, ex array("category", "post_tag");
151
+ if ( $taxonomies ) {
152
+ foreach ( $taxonomies as $taxonomy ) {
153
+ $post_terms = wp_get_object_terms( $post_id, $taxonomy, array( 'fields' => 'slugs' ) );
154
+ wp_set_object_terms( $new_post_id, $post_terms, $taxonomy, false );
155
+ }
156
+ }
157
+
158
+ // duplicate all post meta just in two SQL queries
159
+ $post_meta_infos = $wpdb->get_results( $wpdb->prepare( 'SELECT meta_key, meta_value FROM %s WHERE post_id=%s', $wpdb->postmeta, $post_id ) );
160
+ if ( count( $post_meta_infos ) !== 0 ) {
161
+ $sql_query = "INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) ";
162
+
163
+ foreach ( $post_meta_infos as $meta_info ) {
164
+ $meta_key = $meta_info->meta_key;
165
+ if ( '_wp_old_slug' === $meta_key ) {
166
+ continue;
167
+ }
168
+ $meta_value = addslashes( $meta_info->meta_value );
169
+ $sql_query_sel[] = "SELECT $new_post_id, '$meta_key', '$meta_value'";
170
+ }
171
+
172
+ $sql_query .= implode( ' UNION ALL ', $sql_query_sel );
173
+
174
+ $wpdb->query( $sql_query );
175
+ }
176
+
177
+ return $new_post_id;
178
+ }
179
+ }
180
+
181
+ /**
182
+ * Set actions order
183
+ */
184
+ public function set_action_menu_order() {
185
+ global $wpdb;
186
+
187
+ parse_str( $_POST['data']['order'], $data );
188
+
189
+ if ( ! is_array( $data ) ) {
190
+ return false;
191
+ }
192
+
193
+ // get objects per now page
194
+ $id_arr = array();
195
+ foreach ( $data as $key => $values ) {
196
+ foreach ( $values as $position => $id ) {
197
+ $id_arr[] = $id;
198
+ }
199
+ }
200
+
201
+ foreach ( $id_arr as $key => $post_id ) {
202
+ $menu_order = $key + 1;
203
+ $wpdb->update( $wpdb->posts, array( 'menu_order' => $menu_order ), array( 'ID' => intval( $post_id ) ) );
204
+ }
205
+ }
206
+
207
+ /**
208
+ * Render elements required by actions
209
+ *
210
+ * @return void
211
+ */
212
+ public function render_actions_elements( $properties, $form ) {
213
+
214
+ $action_posts = wpcf7r_get_actions( 'wpcf7r_action', -1, $form->id(), 'default', array(), true );
215
+
216
+ if ( $action_posts ) {
217
+ foreach ( $action_posts as $action_post ) {
218
+ $action = WPCF7R_Action::get_action( $action_post );
219
+
220
+ if ( ! isset( self::$rendered_elements[ $action_post->ID ] ) ) {
221
+ // these actions will run once.
222
+ if ( is_object( $action ) && ! is_wp_error( $action ) && method_exists( $action, 'render_callback_once' ) ) {
223
+ $properties = $action->render_callback_once( $properties, $form );
224
+ }
225
+
226
+ self::$rendered_elements[ $action_post->ID ] = $action_post->ID;
227
+ }
228
+
229
+ // Render_callback will be called several times because of the way contact form 7 uses these properties.
230
+ // use state and db on the action to limit it to run only once.
231
+ if ( is_object( $action ) && ! is_wp_error( $action ) && method_exists( $action, 'render_callback' ) ) {
232
+ $properties = $action->render_callback( $properties, $form );
233
+ }
234
+ }
235
+ }
236
+
237
+ return $properties;
238
+ }
239
+ /**
240
+ * Delete an action
241
+ */
242
+ public function delete_action_post() {
243
+ $data = isset( $_POST['data'] ) ? $_POST['data'] : '';
244
+
245
+ $response['status'] = 'failed';
246
+
247
+ if ( $data ) {
248
+ foreach ( $data as $post_to_delete ) {
249
+ if ( $post_to_delete ) {
250
+ wp_trash_post( $post_to_delete['post_id'] );
251
+ $response['status'] = 'deleted';
252
+ }
253
+ }
254
+ }
255
+
256
+ wp_send_json( $response );
257
+ }
258
+
259
+ /**
260
+ * Show notices on admin panel
261
+ */
262
+ public function show_admin_notices() {
263
+ global $wp_sessions;
264
+
265
+ if ( ! isset( $_SESSION['wpcf7r_admin_notices'] ) ) {
266
+ return;
267
+ }
268
+
269
+ foreach ( $_SESSION['wpcf7r_admin_notices'] as $notice_type => $notice ) :
270
+ ?>
271
+
272
+ <div class="notice notice-error is-dismissible <?php echo $notice_type; ?>">
273
+ <p><?php echo $notice; ?></p>
274
+ </div>
275
+
276
+ <?php
277
+ endforeach;
278
+ }
279
+
280
+ /**
281
+ * Send debug data to querysol support api
282
+ *
283
+ * @return void
284
+ */
285
+ public function send_debug_info() {
286
+ $data = isset( $_POST['data'] ) ? $_POST['data'] : '';
287
+
288
+ if ( $data['form_id'] ) {
289
+ $debug_data = WPCF7r_Form_Helper::get_debug_data( $data['form_id'] );
290
+
291
+ $api = new Qs_Api();
292
+
293
+ $args = array(
294
+ 'headers' => array( 'Content-Type' => 'application/json; charset=utf-8' ),
295
+ );
296
+
297
+ $url = add_query_arg( 'site_url', home_url(), WPCF7_PRO_REDIRECT_DEBUG_URL );
298
+
299
+ $api->api_call( $url, json_encode( array( 'debug_data' => $debug_data ) ), $args );
300
+ }
301
+
302
+ wp_send_json_success();
303
+ }
304
+ /**
305
+ * Auto function to migrate old plugin to the new one
306
+ *
307
+ * @param $migration_action migrate_from_cf7_redirect/migrate_from_cf7_api
308
+ * @param boolean $force
309
+ */
310
+ public static function auto_migrate( $migration_action, $force = false ) {
311
+
312
+ $instance = self::get_instance();
313
+
314
+ $cf7_forms = self::get_all_cf7_forms();
315
+
316
+ foreach ( $cf7_forms as $cf7_form_id ) {
317
+
318
+ $cf7r_form = new WPCF7R_Form( $cf7_form_id );
319
+
320
+ $instance->delete_all_form_actions( $cf7_form_id );
321
+
322
+ if ( ! $cf7r_form->has_migrated( $migration_action ) || $force ) {
323
+ $instance->convert_to_action( $cf7r_form, $migration_action, $cf7_form_id, 'default' );
324
+
325
+ $cf7r_form->update_migration( $migration_action );
326
+ }
327
+ }
328
+ }
329
+
330
+ /**
331
+ * Create form and actions based on debug info
332
+ *
333
+ * @return void
334
+ */
335
+ public function import_from_debug() {
336
+ $data = isset( $_POST['data'] ) && $_POST['data'] ? $_POST['data'] : '';
337
+
338
+ if ( $data ) {
339
+ $formdata = unserialize( base64_decode( $data['debug_info'] ) );
340
+
341
+ $this->install_plugins( json_decode( $formdata['plugins'] ) );
342
+
343
+ $form_id = $this->import_form( $formdata );
344
+
345
+ $this->import_actions( $form_id, $formdata['actions'] );
346
+
347
+ }
348
+ }
349
+
350
+ /**
351
+ * Import actions to post
352
+ *
353
+ * @return void
354
+ */
355
+ private function import_actions( $form_id, $actions ) {
356
+ foreach ( $actions as $action ) {
357
+ $post = (array) $action->action_post;
358
+ unset( $post['ID'] );
359
+
360
+ $post_id = wp_insert_post( $post );
361
+
362
+ foreach ( $action->fields_values as $meta_key => $meta_values ) {
363
+ if ( 'wpcf7_id' === $meta_key ) {
364
+ continue;
365
+ }
366
+ foreach ( $meta_values as $meta_value ) {
367
+ add_post_meta( $post_id, $meta_key, maybe_unserialize( $meta_value ) );
368
+ }
369
+ }
370
+
371
+ update_post_meta( $post_id, 'wpcf7_id', $form_id );
372
+
373
+ }
374
+ }
375
+ /**
376
+ * Import form from debug info
377
+ *
378
+ * @return void
379
+ */
380
+ private function import_form( $formdata ) {
381
+
382
+ $new_form_post = (array) $formdata['form_post'];
383
+
384
+ unset( $new_form_post['ID'] );
385
+
386
+ $form_id = wp_insert_post( $new_form_post );
387
+
388
+ foreach ( $formdata['form_meta'] as $meta_key => $meta_values ) {
389
+ foreach ( $meta_values as $meta_value ) {
390
+ add_post_meta( $form_id, $meta_key, maybe_unserialize( $meta_value ) );
391
+ }
392
+ }
393
+
394
+ return $form_id;
395
+ }
396
+ /**
397
+ * Install a list of plugins
398
+ *
399
+ * @return void
400
+ */
401
+ private function install_plugins( $plugins ) {
402
+
403
+ include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
404
+ include_once ABSPATH . 'wp-admin/includes/file.php';
405
+ include_once ABSPATH . 'wp-admin/includes/misc.php';
406
+ include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
407
+
408
+ $results = array();
409
+
410
+ foreach ( $plugins as $slug => $plugin ) {
411
+
412
+ if ( ! is_plugin_active( $slug ) ) {
413
+ $results[ $slug ] = $this->install_plugin( $slug );
414
+ }
415
+ }
416
+
417
+ return $results;
418
+ }
419
+
420
+ /**
421
+ * Install and activate a plugin
422
+ *
423
+ * @return void
424
+ */
425
+ public function install_plugin( $plugin_slug ) {
426
+
427
+ $api = plugins_api(
428
+ 'plugin_information',
429
+ array(
430
+ 'slug' => basename( $plugin_slug, '.php' ),
431
+ 'fields' => array(
432
+ 'short_description' => false,
433
+ 'sections' => false,
434
+ 'requires' => false,
435
+ 'rating' => false,
436
+ 'ratings' => false,
437
+ 'downloaded' => false,
438
+ 'last_updated' => false,
439
+ 'added' => false,
440
+ 'tags' => false,
441
+ 'compatibility' => false,
442
+ 'homepage' => false,
443
+ 'donate_link' => false,
444
+ ),
445
+ )
446
+ );
447
+
448
+ if ( ! is_wp_error( $api ) ) {
449
+ $upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact( 'title', 'url', 'nonce', 'plugin', 'api' ) ) );
450
+
451
+ $upgrader->install( $api->download_link );
452
+
453
+ if ( ! is_wp_error( $upgrader->skin->api ) ) {
454
+ return activate_plugin( $plugin_slug );
455
+ } else {
456
+ return $upgrader->skin->api;
457
+ }
458
+ } else {
459
+ return $api;
460
+ }
461
+
462
+ }
463
+
464
+ /**
465
+ * Get all Contact Forms 7 forms
466
+ */
467
+ public static function get_all_cf7_forms() {
468
+ $args = array(
469
+ 'post_type' => 'wpcf7_contact_form',
470
+ 'posts_per_page' => -1,
471
+ 'fields' => 'ids',
472
+ 'suppress_filters' => true,
473
+ );
474
+
475
+ $cf7_forms = get_posts( $args );
476
+
477
+ return $cf7_forms;
478
+ }
479
+
480
+ /**
481
+ * Create a new action post
482
+ */
483
+ public function add_action_post() {
484
+ $results['action_row'] = '';
485
+
486
+ $post_id = isset( $_POST['data']['post_id'] ) ? (int) sanitize_text_field( $_POST['data']['post_id'] ) : '';
487
+ $rule_id = isset( $_POST['data']['rule_id'] ) ? sanitize_text_field( $_POST['data']['rule_id'] ) : '';
488
+ $action_type = isset( $_POST['data']['action_type'] ) ? sanitize_text_field( $_POST['data']['action_type'] ) : '';
489
+
490
+ $rule_name = __( 'New Action', 'wpcf7-redirect' );
491
+
492
+ $this->cf7r_form = get_cf7r_form( $post_id );
493
+
494
+ $actions = array();
495
+
496
+ // migrate from old api plugin
497
+ if ( 'migrate_from_cf7_api' === $action_type || 'migrate_from_cf7_redirect' === $action_type ) {
498
+ if ( ! $this->cf7r_form->has_migrated( $action_type ) ) {
499
+ $actions = $this->convert_to_action( $action_type, $post_id, $rule_name, $rule_id );
500
+ $this->cf7r_form->update_migration( $action_type );
501
+ }
502
+ } else {
503
+ $actions[] = $this->create_action( $post_id, $rule_name, $rule_id, $action_type );
504
+ }
505
+
506
+ if ( $actions ) {
507
+ foreach ( $actions as $action ) {
508
+ $results['action_row'] .= $action->get_action_row();
509
+ }
510
+ } else {
511
+ $results['action_row'] = '';
512
+ }
513
+
514
+ wp_send_json( $results );
515
+ }
516
+
517
+ /**
518
+ * Convert old plugin data to new structure
519
+ *
520
+ * @param $required_conversion
521
+ * @param $post_id
522
+ * @param $rule_name
523
+ * @param $rule_id
524
+ * @return Actions
525
+ *
526
+ * @version 1.2
527
+ */
528
+
529
+ private function convert_to_action( $cf7r_form, $required_conversion, $post_id, $rule_id ) {
530
+ $actions = array();
531
+
532
+ if ( 'migrate_from_cf7_redirect' === $required_conversion ) {
533
+ $old_api_action = $cf7r_form->get_cf7_redirection_settings();
534
+
535
+ if ( $old_api_action ) {
536
+ // CREATE JAVSCRIPT ACTION
537
+ if ( $old_api_action['fire_sctipt'] ) {
538
+ $javscript_action = $this->create_action( $post_id, __( 'Migrated Javascript Action From Old Plugin', 'wpcf7-redirect' ), $rule_id, 'FireScript' );
539
+
540
+ $javscript_action->set( 'script', $old_api_action['fire_sctipt'] );
541
+ $javscript_action->set( 'action_status', 'on' );
542
+
543
+ unset( $old_api_action['fire_sctipt'] );
544
+
545
+ $actions[] = $javscript_action;
546
+ }
547
+
548
+ // CREATE REDIRECT ACTION
549
+ $action = $this->create_action( $post_id, __( 'Migrated Redirect Action From Old Plugin', 'wpcf7-redirect' ), $rule_id, 'redirect' );
550
+
551
+ $action->set( 'action_status', 'on' );
552
+
553
+ foreach ( $old_api_action as $key => $value ) {
554
+ $action->set( $key, $value );
555
+ }
556
+
557
+ $actions[] = $action;
558
+
559
+ }
560
+ } elseif ( 'migrate_from_cf7_api' === $required_conversion ) {
561
+ $old_api_action = $cf7r_form->get_cf7_api_settings();
562
+
563
+ if ( $old_api_action ) {
564
+
565
+ $old_api__wpcf7_api_data = $old_api_action['_wpcf7_api_data'];
566
+ $old_tags_map = $old_api_action['_wpcf7_api_data_map'];
567
+
568
+ if ( 'params' === $old_api__wpcf7_api_data['input_type'] ) {
569
+ $action_type = 'api_url_request';
570
+ } elseif ( 'xml' === $old_api__wpcf7_api_data['input_type'] || 'json' === $old_api__wpcf7_api_data['input_type'] ) {
571
+ $action_type = 'api_json_xml_request';
572
+ }
573
+
574
+ $action = $this->create_action( $post_id, __( 'Migrated Data from Old Plugin', 'wpcf7-redirect' ), $rule_id, $action_type );
575
+
576
+ if ( ! is_wp_error( $action ) ) {
577
+ $action->set( 'base_url', $old_api__wpcf7_api_data['base_url'] );
578
+ $action->set( 'input_type', strtolower( $old_api__wpcf7_api_data['method'] ) );
579
+ $action->set( 'record_type', strtolower( $old_api__wpcf7_api_data['input_type'] ) );
580
+ $action->set( 'show_debug', '' );
581
+ $action->set( 'action_status', $old_api__wpcf7_api_data['send_to_api'] );
582
+
583
+ $tags_map = array();
584
+
585
+ if ( $old_tags_map ) {
586
+ foreach ( $old_tags_map as $tag_key => $tag_api_key ) {
587
+ $tags_map[ $tag_key ] = $tag_api_key;
588
+ }
589
+
590
+ $action->set( 'tags_map', $tags_map );
591
+ }
592
+
593
+ if ( isset( $old_api_action['_template'] ) && $old_api_action['_template'] ) {
594
+ $action->set( 'request_template', $old_api_action['_template'] );
595
+ } elseif ( isset( $old_api_action['_json_template'] ) && $old_api_action['_json_template'] ) {
596
+ $action->set( 'request_template', $old_api_action['_json_template'] );
597
+ }
598
+
599
+ $actions[] = $action;
600
+ }
601
+ }
602
+ }
603
+
604
+ return $actions;
605
+ }
606
+
607
+ /**
608
+ * Create new post that will hold the action
609
+ *
610
+ * @param $rule_name
611
+ * @param $rule_id
612
+ * @param $action_type
613
+ * @return Actions
614
+ */
615
+ public function create_action( $post_id, $rule_name, $rule_id, $action_type ) {
616
+ $new_action_post = array(
617
+ 'post_type' => 'wpcf7r_action',
618
+ 'post_title' => $rule_name,
619
+ 'post_status' => 'private',
620
+ 'menu_order' => 1,
621
+ 'meta_input' => array(
622
+ 'wpcf7_id' => $post_id,
623
+ 'wpcf7_rule_id' => $rule_id,
624
+ 'action_type' => $action_type,
625
+ 'action_status' => 'on',
626
+ ),
627
+ );
628
+
629
+ $new_action_id = wp_insert_post( $new_action_post );
630
+
631
+ return WPCF7R_Action::get_action( $new_action_id, $post_id );
632
+ }
633
+
634
+ /**
635
+ * Get instance
636
+ */
637
+ public static function get_instance() {
638
+ if ( null === self::$instance ) {
639
+ self::$instance = new self();
640
+ }
641
+ return self::$instance;
642
+ }
643
+
644
+ /**
645
+ * Get the banner template
646
+ */
647
+ public function get_banner() {
648
+ if ( $this->get_option( 'last_banner_displayed' ) === $this->banner_version ) {
649
+ return;
650
+ }
651
+ ob_start();
652
+
653
+ include WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'banner.php';
654
+
655
+ $banner_html = ob_get_clean();
656
+
657
+ echo $banner_html;
658
+ }
659
+
660
+ /**
661
+ * Show a message containing the license details
662
+ */
663
+ public function license_details_message() {
664
+ if ( ! self::get_activation_id() ) {
665
+ printf(
666
+ '<tr class="plugin-update-tr active" id="wpcf7-redirect-pro-update" data-slug="wpcf7-redirect-pro" data-plugin="contact-form-7-redirection-pro/wpcf7-redirect-pro.php"><td colspan="3" class="plugin-update colspanchange"><div class="update-message notice inline notice-warning notice-alt"><p><strong>%s</strong> %s</p></div></td></tr>',
667
+ __( 'Please activate plugin license for updates', 'wpcf7-redirect' ),
668
+ self::get_settings_link()
669
+ );
670
+
671
+ }
672
+
673
+ }
674
+
675
+ /**
676
+ * Get all data related with plugin activation
677
+ */
678
+ public static function get_activation_data() {
679
+ return get_option( 'wpcf7r_activation_data' );
680
+ }
681
+
682
+ /**
683
+ * Get date of plugin license expiration
684
+ */
685
+ public static function get_activation_expiration() {
686
+ return get_option( 'wpcf7r_activation_expiration' );
687
+ }
688
+
689
+ /**
690
+ * A validation function to test the serial key
691
+ */
692
+ public static function validate_serial_key() {
693
+ $instance = self::get_instance();
694
+
695
+ $serial = self::get_serial_key();
696
+ $activation_id = self::get_activation_id();
697
+
698
+ return $instance->api->validate_serial( $activation_id, $serial );
699
+ }
700
+
701
+ /**
702
+ * Get the used serial key
703
+ */
704
+ public static function get_serial_key() {
705
+ return get_option( 'wpcf7r_serial_number' );
706
+ }
707
+
708
+ /**
709
+ * Delete the used setial key
710
+ */
711
+ public static function delete_serial_key() {
712
+ return delete_option( 'wpcf7r_serial_number' );
713
+ }
714
+
715
+ /**
716
+ * Get a url to deactivate plugin license
717
+ */
718
+ public static function get_deactivation_link() {
719
+ $url = self::get_plugin_settings_page_url();
720
+
721
+ $url = add_query_arg( 'wpcf7r_deactivate_license', '', $url );
722
+
723
+ return $url;
724
+ }
725
+
726
+ /**
727
+ * Get the plugin settings link
728
+ */
729
+ public static function get_plugin_settings_page_url() {
730
+ return get_admin_url( null, 'options-general.php?page=wpc7_redirect' );
731
+ }
732
+
733
+ /**
734
+ * Get the activation id
735
+ */
736
+ public static function get_activation_id() {
737
+ return get_option( 'wpcf7r_activation_id' );
738
+ }
739
+
740
+ /**
741
+ * Get a link to the admin settings panel
742
+ */
743
+ public static function get_settings_link() {
744
+ return '<a href="' . self::get_plugin_settings_page_url() . '">' . __( 'Settings', 'wpcf7-redirect' ) . '</a>';
745
+ }
746
+
747
+ /**
748
+ * Close banner
749
+ */
750
+ public function close_banner() {
751
+ $this->update_option( 'last_banner_displayed', $this->banner_version );
752
+ }
753
+
754
+ /**
755
+ * Get specific option by key
756
+ */
757
+ public function get_option( $key ) {
758
+ $options = $this->get_wpcf7_options();
759
+
760
+ return isset( $options[ $key ] ) ? $options[ $key ] : '';
761
+ }
762
+
763
+ /**
764
+ * Update specific option
765
+ *
766
+ * @param $key
767
+ * @param $value
768
+ */
769
+ public function update_option( $key, $value ) {
770
+ $options = $this->get_wpcf7_options();
771
+
772
+ $options[ $key ] = $value;
773
+
774
+ $this->save_wpcf7_options( $options );
775
+
776
+ }
777
+
778
+ /**
779
+ * Get the plugin options
780
+ */
781
+ public function get_wpcf7_options() {
782
+ return get_option( 'wpcf_redirect_options' );
783
+ }
784
+
785
+ /**
786
+ * Save the plugin options
787
+ *
788
+ * @param $options
789
+ */
790
+ public function save_wpcf7_options( $options ) {
791
+ update_option( 'wpcf_redirect_options', $options );
792
+ }
793
+
794
+ /**
795
+ * Get a list of avaiable text functions and callbacks
796
+ *
797
+ * @param string $func
798
+ * @param string $field_type
799
+ */
800
+ public static function get_available_text_functions( $func = '', $field_type = '' ) {
801
+ $functions = array(
802
+ 'md5' => array( 'WPCF7r_Utils', 'func_md5' ),
803
+ 'base64_encode' => array( 'WPCF7r_Utils', 'func_base64_encode' ),
804
+ 'utf8_encode' => array( 'WPCF7r_Utils', 'func_utf8_encode' ),
805
+ 'urlencode' => array( 'WPCF7r_Utils', 'func_urlencode' ),
806
+ 'json_encode' => array( 'WPCF7r_Utils', 'func_json_encode' ),
807
+ 'esc_html' => array( 'WPCF7r_Utils', 'func_esc_html' ),
808
+ 'esc_attr' => array( 'WPCF7r_Utils', 'func_esc_attr' ),
809
+ );
810
+
811
+ if ( 'checkbox' === $field_type || 'checkbox*' === $field_type || 'all' === $field_type ) {
812
+ $functions['implode'] = array( 'WPCF7r_Utils', 'func_implode' );
813
+ }
814
+
815
+ $functions = apply_filters( 'get_available_text_functions', $functions );
816
+
817
+ if ( $func ) {
818
+ return isset( $functions[ $func ] ) ? $functions[ $func ] : '';
819
+ }
820
+
821
+ return $functions;
822
+ }
823
+
824
+ /**
825
+ * [func_utf8_encode description]
826
+ *
827
+ * @param $value
828
+ */
829
+ public static function func_utf8_encode( $value ) {
830
+ return apply_filters( 'func_utf8_encode', utf8_encode( $value ), $value );
831
+ }
832
+
833
+ /**
834
+ * [func_base64_encode description]
835
+ *
836
+ * @param $value
837
+ */
838
+ public static function func_base64_encode( $value ) {
839
+ return apply_filters( 'func_base64_encode', base64_encode( $value ), $value );
840
+ }
841
+
842
+ /**
843
+ * [func_base64_encode description]
844
+ *
845
+ * @param $value
846
+ */
847
+ public static function func_urlencode( $value ) {
848
+ return apply_filters( 'func_urlencode', urlencode( $value ), $value );
849
+ }
850
+
851
+ /**
852
+ * Esc html callback
853
+ *
854
+ * @param $value
855
+ */
856
+ public function func_esc_html( $value ) {
857
+ return apply_filters( 'func_esc_html', esc_html( $value ), $value );
858
+ }
859
+
860
+ /**
861
+ * Esc Attr callback
862
+ *
863
+ * @param $value
864
+ */
865
+ public function func_esc_attr( $value ) {
866
+ return apply_filters( 'func_esc_attr', esc_attr( $value ), $value );
867
+ }
868
+
869
+ /**
870
+ * Json Encode callback
871
+ *
872
+ * @param $value
873
+ */
874
+ public function func_json_encode( $value ) {
875
+ return apply_filters( 'func_json_encode', wp_json_encode( $value ), $value );
876
+ }
877
+ /**
878
+ * [func_base64_encode description]
879
+ *
880
+ * @param $value
881
+ */
882
+ public static function func_implode( $value ) {
883
+
884
+ if ( is_array( $value ) ) {
885
+ $value = apply_filters( 'func_implode', implode( ',', $value ), $value );
886
+ }
887
+
888
+ return $value;
889
+ }
890
+
891
+ /**
892
+ * md5 function
893
+ *
894
+ * @param $value
895
+ */
896
+ public static function func_md5( $value ) {
897
+ return apply_filters( 'func_md5', md5( $value ), $value );
898
+ }
899
+
900
+ public function make_api_test() {
901
+ parse_str( $_POST['data']['data'], $data );
902
+
903
+ if ( ! is_array( $data ) ) {
904
+ die( '-1' );
905
+ }
906
+
907
+ $action_id = isset( $_POST['data']['action_id'] ) ? (int) sanitize_text_field( $_POST['data']['action_id'] ) : '';
908
+ $cf7_id = isset( $_POST['data']['cf7_id'] ) ? (int) sanitize_text_field( $_POST['data']['cf7_id'] ) : '';
909
+ $rule_id = isset( $_POST['data']['rule_id'] ) ? $_POST['data']['rule_id'] : '';
910
+
911
+ add_filter( 'after_qs_cf7_api_send_lead', array( $this, 'after_fake_submission' ), 10, 3 );
912
+
913
+ if ( isset( $data['wpcf7-redirect']['actions'] ) ) {
914
+ $response = array();
915
+
916
+ $posted_action = reset( $data['wpcf7-redirect']['actions'] );
917
+ $posted_action = $posted_action['test_values'];
918
+ $_POST = $posted_action;
919
+ // this will create a fake form submission
920
+ $this->cf7r_form = get_cf7r_form( $cf7_id );
921
+ $this->cf7r_form->enable_action( $action_id );
922
+
923
+ $cf7_form = $this->cf7r_form->get_cf7_form_instance();
924
+ $submission = WPCF7_Submission::get_instance( $cf7_form );
925
+
926
+ if ( $submission->get_status() === 'validation_failed' ) {
927
+ $invalid_fields = $submission->get_invalid_fields();
928
+ $response['status'] = 'failed';
929
+ $response['invalid_fields'] = $invalid_fields;
930
+ } else {
931
+ $response['status'] = 'success';
932
+ $response['html'] = $this->get_test_api_results_html();
933
+ }
934
+
935
+ wp_send_json( $response );
936
+ }
937
+ }
938
+ /**
939
+ * Store the results from the API
940
+ *
941
+ * @param $result
942
+ * @param $record
943
+ */
944
+ public function after_fake_submission( $result, $record, $args ) {
945
+ $this->results = $result;
946
+ $this->record = $record;
947
+ $this->request = $args;
948
+
949
+ return $result;
950
+ }
951
+
952
+ /**
953
+ * Show A preview for the action
954
+ */
955
+ public function show_action_preview() {
956
+ if ( isset( $_GET['wpcf7r-preview'] ) ) {
957
+ $action_id = (int) $_GET['wpcf7r-preview'];
958
+
959
+ $action = WPCF7R_Action::get_action( $action_id );
960
+
961
+ $action->dynamic_params['popup-template'] = isset( $_GET['template'] ) ? sanitize_text_field( $_GET['template'] ) : '';
962
+
963
+ $action->preview();
964
+ }
965
+ }
966
+
967
+ /**
968
+ * Get action template in case field are dynamicaly changed
969
+ */
970
+ public function get_action_template() {
971
+ $data = isset( $_POST['data'] ) ? $_POST['data'] : '';
972
+
973
+ $response = array();
974
+
975
+ if ( isset( $data['action_id'] ) ) {
976
+ $action_id = (int) $data['action_id'];
977
+ $popup_template = sanitize_text_field( $data['template'] );
978
+
979
+ $action = WPCF7R_Action::get_action( $action_id );
980
+
981
+ ob_start();
982
+
983
+ $params = array(
984
+ 'popup-template' => $popup_template,
985
+ );
986
+
987
+ $action->get_action_settings( $params );
988
+
989
+ $response['action_content'] = ob_get_clean();
990
+ }
991
+
992
+ wp_send_json_success( $response );
993
+ }
994
+
995
+ /**
996
+ * Get the popup html
997
+ */
998
+ public function get_test_api_results_html() {
999
+ ob_start();
1000
+
1001
+ include WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'popup-api-test.php';
1002
+
1003
+ return ob_get_clean();
1004
+ }
1005
+
1006
+ /**
1007
+ * Get lists, maybe create new list
1008
+ */
1009
+ public function get_mailchimp_lists() {
1010
+ $data = $_POST['data'];
1011
+
1012
+ $results = array();
1013
+
1014
+ if ( ! is_array( $data ) ) {
1015
+ die( '-1' );
1016
+ }
1017
+
1018
+ $api_key = $data['mailchimp_api_key'];
1019
+
1020
+ // A request to create a list
1021
+ if ( isset( $data['list_name'] ) && $data['list_name'] ) {
1022
+ $new_list_results = WPCF7R_Mailchimp_Helper::create_list( $api_key, $data['list_name'] );
1023
+
1024
+ if ( is_wp_error( $new_list_results ) ) {
1025
+ $results['error'] = $new_list_results->get_error_message();
1026
+ }
1027
+ }
1028
+
1029
+ // In the end return the lists
1030
+ if ( ! isset( $results['error'] ) ) {
1031
+ $lists = WPCF7R_Mailchimp_Helper::get_lists_clean( $api_key );
1032
+
1033
+ update_post_meta( $data['action_id'], 'mailchimp_lists', $lists );
1034
+
1035
+ if ( is_wp_error( $lists ) ) {
1036
+ $results['error'] = $lists->get_error_message();
1037
+ } else {
1038
+ $results['lists'] = $lists;
1039
+ }
1040
+ }
1041
+
1042
+ wp_send_json( $results );
1043
+ }
1044
+
1045
+ }
classes/index.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
img/banner-pro.png DELETED
Binary file
index.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
js/wpcf7-redirect-script.js DELETED
@@ -1,83 +0,0 @@
1
- jQuery(document).ready(function() {
2
- wpcf7_redirect_mailsent_handler();
3
- });
4
-
5
- function wpcf7_redirect_mailsent_handler() {
6
- document.addEventListener( 'wpcf7mailsent', function( event ) {
7
- form = wpcf7_redirect_forms [ event.detail.contactFormId ];
8
-
9
- // Script to run after sent.
10
- if ( form.after_sent_script ) {
11
- form.after_sent_script = htmlspecialchars_decode( form.after_sent_script );
12
- eval( form.after_sent_script );
13
- }
14
-
15
- // Set redirect URL
16
- if ( form.use_external_url && form.external_url ) {
17
- redirect_url = form.external_url;
18
- } else {
19
- redirect_url = form.thankyou_page_url;
20
- }
21
-
22
- // Build http query
23
- if ( form.http_build_query ) {
24
- temp_http_query = jQuery.param( event.detail.inputs, true );
25
- http_query = temp_http_query.replace(new RegExp('\\+', 'g'), '%20');
26
- redirect_url = redirect_url + '?' + decodeURIComponent(http_query);
27
- } else if ( form.http_build_query_selectively ) {
28
- http_query = '?';
29
- selective_fields = form.http_build_query_selectively_fields.split(' ').join('');
30
- event.detail.inputs.forEach( function(element, index) {
31
- if ( selective_fields.indexOf( element.name ) != -1 ) {
32
- http_query += element.name + '=' + element.value + '&';
33
- }
34
- });
35
-
36
- http_query = http_query.slice(0, -1);
37
- redirect_url = redirect_url + decodeURIComponent(http_query);
38
- }
39
-
40
- // Redirect
41
- if ( redirect_url ) {
42
- if ( ! form.open_in_new_tab ) {
43
- // Open in current tab
44
- if ( form.delay_redirect ) {
45
- setTimeout(function() {
46
- location.href = redirect_url;
47
- }, form.delay_redirect);
48
- } else {
49
- location.href = redirect_url;
50
- }
51
- } else {
52
- // Open in external tab
53
- if ( form.delay_redirect ) {
54
- setTimeout(function() {
55
- window.open( redirect_url );
56
- }, form.delay_redirect);
57
- } else {
58
- window.open( redirect_url );
59
- }
60
- }
61
- }
62
-
63
- }, false );
64
- }
65
-
66
- function htmlspecialchars_decode( string ) {
67
- var map = {
68
- '&amp;': '&',
69
- '&#038;': "&",
70
- '&lt;': '<',
71
- '&gt;': '>',
72
- '&quot;': '"',
73
- '&#039;': "'",
74
- '&#8217;': "’",
75
- '&#8216;': "‘",
76
- '&#8211;': "–",
77
- '&#8212;': "—",
78
- '&#8230;': "…",
79
- '&#8221;': '”'
80
- };
81
-
82
- return string.replace(/\&[\w\d\#]{2,5}\;/g, function(m) { return map[m]; });
83
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lang/index.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+
7
+ exit;
8
+
9
+ }
10
+
lang/readme.txt CHANGED
@@ -1,3 +1,3 @@
1
- Translations have moved to https://translate.wordpress.org/projects/wp-plugins/wpcf7-redirect
2
-
3
- Your are more than welcome contribute :)
1
+ Translations have moved to https://translate.wordpress.org/projects/wp-plugins/wpcf7-redirect
2
+
3
+ Your are more than welcome contribute :)
modules/cf7-shortcode-password-field.php ADDED
@@ -0,0 +1,224 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * A base module for the following types of tags:
4
+ * [text] and [text*] # Single-line text
5
+ * [email] and [email*] # Email address
6
+ * [url] and [url*] # URL
7
+ * [tel] and [tel*] # Telephone number
8
+ */
9
+
10
+ defined( 'ABSPATH' ) || exit;
11
+
12
+ /* form_tag handler */
13
+ add_action( 'wpcf7_init', 'wpcf7_add_form_tag_password', 10, 0 );
14
+
15
+ function wpcf7_add_form_tag_password() {
16
+ if ( function_exists( 'wpcf7_add_form_tag' ) ) {
17
+ wpcf7_add_form_tag(
18
+ array( 'password', 'password*' ),
19
+ 'wpcf7_password_form_tag_handler',
20
+ array( 'name-attr' => true )
21
+ );
22
+ }
23
+ }
24
+
25
+ function wpcf7_password_form_tag_handler( $tag ) {
26
+ if ( empty( $tag->name ) ) {
27
+ return '';
28
+ }
29
+
30
+ $validation_error = wpcf7_get_validation_error( $tag->name );
31
+ $class = wpcf7_form_controls_class( $tag->type, 'wpcf7-password' );
32
+
33
+ if ( in_array( $tag->basetype, array( 'password' ), true ) ) {
34
+ $class .= ' wpcf7-validates-as-' . $tag->basetype;
35
+ }
36
+
37
+ if ( $validation_error ) {
38
+ $class .= ' wpcf7-not-valid';
39
+ }
40
+
41
+ $atts = array();
42
+ $atts['size'] = $tag->get_size_option( '40' );
43
+ $atts['maxlength'] = $tag->get_maxlength_option();
44
+ $atts['minlength'] = $tag->get_minlength_option();
45
+
46
+ if ( $atts['maxlength'] && $atts['minlength'] ) {
47
+ $atts['pattern'] = ".{{$atts['minlength']},{$atts['maxlength']}}";
48
+ } elseif ( $atts['minlength'] ) {
49
+ $atts['pattern'] = ".{{$atts['minlength']},}";
50
+ }
51
+
52
+ if ( $atts['maxlength'] and $atts['minlength'] && $atts['maxlength'] < $atts['minlength'] ) {
53
+ unset( $atts['maxlength'], $atts['minlength'] );
54
+ }
55
+
56
+ $atts['class'] = $tag->get_class_option( $class );
57
+ $atts['id'] = $tag->get_id_option();
58
+ $atts['tabindex'] = $tag->get_option( 'tabindex', 'signed_int', true );
59
+ $atts['autocomplete'] = $tag->get_option(
60
+ 'autocomplete',
61
+ '[-0-9a-zA-Z]+',
62
+ true
63
+ );
64
+
65
+ if ( $tag->has_option( 'readonly' ) ) {
66
+ $atts['readonly'] = 'readonly';
67
+ }
68
+
69
+ if ( $tag->is_required() ) {
70
+ $atts['aria-required'] = 'true';
71
+ }
72
+
73
+ $atts['aria-invalid'] = $validation_error ? 'true' : 'false';
74
+ $value = (string) reset( $tag->values );
75
+
76
+ if ( $tag->has_option( 'placeholder' ) || $tag->has_option( 'watermark' ) ) {
77
+ $atts['placeholder'] = $value;
78
+ $value = '';
79
+ }
80
+
81
+ $value = $tag->get_default_option( $value );
82
+ $value = wpcf7_get_hangover( $tag->name, $value );
83
+ $atts['value'] = $value;
84
+
85
+ if ( wpcf7_support_html5() ) {
86
+ $atts['type'] = $tag->basetype;
87
+ } else {
88
+ $atts['type'] = 'password';
89
+ }
90
+
91
+ $atts['name'] = $tag->name;
92
+ $atts = wpcf7_format_atts( $atts );
93
+ $html = sprintf(
94
+ '<span class="wpcf7-form-control-wrap %1$s"><input %2$s autocomplete="false"/>%3$s</span>',
95
+ sanitize_html_class( $tag->name ),
96
+ $atts,
97
+ $validation_error
98
+ );
99
+
100
+ return $html;
101
+ }
102
+
103
+ /* Validation filter */
104
+ add_filter( 'wpcf7_validate_password', 'wpcf7_password_validation_filter', 10, 2 );
105
+ add_filter( 'wpcf7_validate_password*', 'wpcf7_password_validation_filter', 10, 2 );
106
+
107
+ function wpcf7_password_validation_filter( $result, $tag ) {
108
+ $name = $tag->name;
109
+ $value = isset( $_POST[ $name ] )
110
+ ? trim( wp_unslash( strtr( (string) $_POST[ $name ], "\n", ' ' ) ) )
111
+ : '';
112
+ if ( 'password' === $tag->basetype ) {
113
+ if ( $tag->is_required() and '' === $value ) {
114
+ $result->invalidate( $tag, wpcf7_get_message( 'invalid_required' ) );
115
+ }
116
+ $atts['maxlength'] = $tag->get_maxlength_option();
117
+ $atts['minlength'] = $tag->get_minlength_option();
118
+ if ( $atts['maxlength'] && strlen( $value ) > $atts['maxlength'] ) {
119
+ $result->invalidate( $tag, wpcf7_get_message( 'invalid_too_long' ) );
120
+ }
121
+ if ( $atts['minlength'] && strlen( $value ) < $atts['minlength'] ) {
122
+ $result->invalidate( $tag, wpcf7_get_message( 'invalid_too_short' ) );
123
+ }
124
+ }
125
+ return $result;
126
+ }
127
+
128
+ /* Messages */
129
+ add_filter( 'wpcf7_messages', 'wpcf7_password_messages', 10, 1 );
130
+
131
+ function wpcf7_password_messages( $messages ) {
132
+ $messages = array_merge(
133
+ $messages,
134
+ array(
135
+ 'invalid_email' => array(
136
+ 'description' =>
137
+ __( 'Email address that the sender entered is invalid', 'wpcf7-redirect' ),
138
+ 'default' =>
139
+ __( 'The e-mail address entered is invalid.', 'wpcf7-redirect' ),
140
+ ),
141
+ 'invalid_url' => array(
142
+ 'description' =>
143
+ __( 'URL that the sender entered is invalid', 'wpcf7-redirect' ),
144
+ 'default' =>
145
+ __( 'The URL is invalid.', 'wpcf7-redirect' ),
146
+ ),
147
+ 'invalid_tel' => array(
148
+ 'description' =>
149
+ __( 'Telephone number that the sender entered is invalid', 'wpcf7-redirect' ),
150
+ 'default' =>
151
+ __( 'The telephone number is invalid.', 'wpcf7-redirect' ),
152
+ ),
153
+ )
154
+ );
155
+ return $messages;
156
+ }
157
+
158
+ /**
159
+ * Tag generator
160
+ */
161
+ add_action( 'wpcf7_admin_init', 'wpcf7_add_tag_generator_password', 15, 0 );
162
+
163
+ function wpcf7_add_tag_generator_password() {
164
+ $tag_generator = WPCF7_TagGenerator::get_instance();
165
+ $tag_generator->add(
166
+ 'password',
167
+ __( 'password', 'wpcf7-redirect' ),
168
+ 'wpcf7_tag_generator_password'
169
+ );
170
+ }
171
+
172
+ function wpcf7_tag_generator_password( $contact_form, $args = '' ) {
173
+ $args = wp_parse_args( $args, array() );
174
+ $type = $args['id'];
175
+
176
+ if ( 'password' === $type ) {
177
+ $description = __( 'Generate a form-tag for a single-line plain password input field.', 'wpcf7-redirect' );
178
+ }
179
+
180
+ ?>
181
+ <div class="control-box">
182
+ <fieldset>
183
+ <table class="form-table">
184
+ <tbody>
185
+ <tr>
186
+ <th scope="row"><?php echo esc_html( __( 'Field type', 'wpcf7-redirect' ) ); ?></th>
187
+ <td>
188
+ <fieldset>
189
+ <legend class="screen-reader-text"><?php echo esc_html( __( 'Field type', 'wpcf7-redirect' ) ); ?></legend>
190
+ <label><input type="checkbox" name="required" /> <?php echo esc_html( __( 'Required field', 'wpcf7-redirect' ) ); ?></label>
191
+ </fieldset>
192
+ </td>
193
+ </tr>
194
+ <tr>
195
+ <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-name' ); ?>"><?php echo esc_html( __( 'Name', 'wpcf7-redirect' ) ); ?></label></th>
196
+ <td><input type="text" name="name" class="tg-name oneline" id="<?php echo esc_attr( $args['content'] . '-name' ); ?>" /></td>
197
+ </tr>
198
+ <tr>
199
+ <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-values' ); ?>"><?php echo esc_html( __( 'Default value', 'wpcf7-redirect' ) ); ?></label></th>
200
+ <td><input type="text" name="values" class="oneline" id="<?php echo esc_attr( $args['content'] . '-values' ); ?>" /><br />
201
+ <label><input type="checkbox" name="placeholder" class="option" /> <?php echo esc_html( __( 'Use this text as the placeholder of the field', 'wpcf7-redirect' ) ); ?></label></td>
202
+ </tr>
203
+ <tr>
204
+ <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-id' ); ?>"><?php echo esc_html( __( 'Id attribute', 'wpcf7-redirect' ) ); ?></label></th>
205
+ <td><input type="text" name="id" class="idvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-id' ); ?>" /></td>
206
+ </tr>
207
+ <tr>
208
+ <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-class' ); ?>"><?php echo esc_html( __( 'Class attribute', 'wpcf7-redirect' ) ); ?></label></th>
209
+ <td><input type="text" name="class" class="classvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-class' ); ?>" /></td>
210
+ </tr>
211
+ </tbody>
212
+ </table>
213
+ </fieldset>
214
+ </div>
215
+ <div class="insert-box">
216
+ <input type="text" name="<?php echo $type; ?>" class="tag code" readonly="readonly" onfocus="this.select()" />
217
+ <div class="submitbox">
218
+ <input type="button" class="button button-primary insert-tag" value="<?php echo esc_attr( __( 'Insert Tag', 'wpcf7-redirect' ) ); ?>" />
219
+ </div>
220
+ <br class="clear" />
221
+ <p class="description mail-tag"><label for="<?php echo esc_attr( $args['content'] . '-mailtag' ); ?>"><?php echo sprintf( esc_html( __( 'To use the value input through this field in a mail field, you need to insert the corresponding mail-tag into the field on the Mail tab.', 'wpcf7-redirect' ) ), '<strong><span class="mail-tag"></span></strong>' ); ?><input type="text" class="mail-tag code hidden" readonly="readonly" id="<?php echo esc_attr( $args['content'] . '-mailtag' ); ?>" /></label></p>
222
+ </div>
223
+ <?php
224
+ }
modules/cf7r-shortcode-get-param-field.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Get params from the redirect page
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ add_shortcode( 'get_param', 'wpcf7r_get_param' );
9
+ add_shortcode( 'wpcf7r_posted_param', 'wpcf7r_get_param' );
10
+
11
+ /**
12
+ * Collect the data from the query string by parameter
13
+ */
14
+ function wpcf7r_get_param( $atts ) {
15
+ $atts = shortcode_atts(
16
+ array(
17
+ 'param' => '',
18
+ ),
19
+ $atts,
20
+ 'wpcf7-redirect'
21
+ );
22
+ $param = '';
23
+
24
+ if ( isset( $_GET[ $atts['param'] ] ) && $_GET[ $atts['param'] ] ) {
25
+ $param = esc_attr( wp_kses( $_GET[ $atts['param'] ], array( '' ) ) );
26
+ }
27
+
28
+ return $param;
29
+ }
modules/index.php ADDED
File without changes
readme.txt CHANGED
@@ -1,17 +1,17 @@
1
  === Redirection for Contact Form 7 ===
2
- Tags: contact form 7 redirect, contact form 7 thank you page, redirect cf7, redirect contact form 7, contact form 7 success page, cf7 redirect
3
- Contributors: yuvalsabar
4
  Requires at least: 4.7.0
5
  Tested up to: 5.5.1
6
- Stable tag: 1.3.7
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
10
- A simple add-on for Contact Form 7 that adds a redirect option after form sent successfully.
11
 
12
  == Description ==
13
 
14
- A straightforward add-on plugin for Contact Form 7 - adds the option to redirect to any page you choose after mail sent successfully, with DOM Events and without AJAX being disabled.
15
  NOTE: This plugin requires Contact Form 7 version 4.8 or later.
16
 
17
  == Usage ==
@@ -24,24 +24,27 @@ Simply go to your form settings, choose the "Redirect Settings" tab and set the
24
  * Open page in a new tab
25
  * Run JavaScript after form submission (great for conversion management)
26
  * Pass fields from the form as URL query parameters
27
-
28
- * **[Pro]** Create new posts from submitted forms
29
- * **[Pro]** Create registration forms
30
- * **[Pro]** Create login forms
31
- * **[Pro]** Add to Mailchimp list
32
- * **[Pro]** Conditional error managment
33
- * **[Pro]** Redirect rules
34
- * **[Pro]** Conditional logic for each action
35
- * **[Pro]** Manage email notifications by conditional logic
36
- * **[Pro]** Fire custom JavaScript events by conditional logic
37
- * **[Pro]** Send data to remote servers (3rd-party integration)
38
- * **[Pro]** Send RESTful Json/XML to remote servers
39
- * **[Pro]** Send RESTful POST/GET to remote servers
40
- * **[Pro]** Manage Facebook conversion pixels
41
- * **[Pro]** Manage Google Adwords conversion pixels
42
- * **[Pro]** Leads Manager - save leads to database
43
- * **[Pro]** PayPal Integration
44
-
 
 
 
45
 
46
  > Note: some features are availible only in the Pro version. Which means you need Redirection for Contact Form 7 Pro to unlock those features. You can [get Redirection for Contact Form 7 Pro here](http://querysol.com/product/contact-form-7-redirection/)!
47
 
@@ -66,10 +69,44 @@ No. One of the reasons we developed this plugin, is because on_send_ok is now de
66
 
67
  == Screenshots ==
68
 
69
- 1. Redirect Settings tab
 
 
 
 
70
 
71
  == Changelog ==
72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  = 1.3.7 =
74
  * Show pages hierarchy in page select dropdown.
75
 
1
  === Redirection for Contact Form 7 ===
2
+ Tags: contact form 7 redirect, contact form 7 thank you page, redirect cf7, redirect contact form 7, contact form 7 success page, cf7 redirect, registration form, mailchimp, login form, conditional redirect, cms integration, conversions, save leads, paypal
3
+ Contributors: yuvalsabar, regevlio
4
  Requires at least: 4.7.0
5
  Tested up to: 5.5.1
6
+ Stable tag: 2.2.7
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
10
+ The ultimate add-on for Contact Form 7 - redirect to any page you choose after mail sent successfully, firing scripts after submission, save submissions in database, and much more options to make Contact Form 7 poweful then ever.
11
 
12
  == Description ==
13
 
14
+ The ultimate add-on for Contact Form 7 - redirect to any page you choose after mail sent successfully, firing scripts after submission, save submissions in database, and much more options to make Contact Form 7 poweful then ever.
15
  NOTE: This plugin requires Contact Form 7 version 4.8 or later.
16
 
17
  == Usage ==
24
  * Open page in a new tab
25
  * Run JavaScript after form submission (great for conversion management)
26
  * Pass fields from the form as URL query parameters
27
+ * Add Honeypot to minimize spam
28
+ * Save form submissions to your database
29
+
30
+ == New and Exciting ==
31
+ Cooperation with a world leading web accessibility solution - you can try it for free and make your website accessible to people with disabilities.
32
+
33
+ == Our Extensions ==
34
+ * **[Extension]** Conditional logic for each action
35
+ * **[Extension]** Integrate your forms with your Salesforce CRM
36
+ * **[Extension]** Integrate your forms with your Hubspot CRM
37
+ * **[Extension]** Frontend Publishing - Allow your visitors to submit post types
38
+ * **[Extension]** Frontend Registration - Use contact form 7 as a registration form
39
+ * **[Extension]** Frontend Login - Use contact form 7 to login users to your website
40
+ * **[Extension]** Automatically add form submissions to your predefined list
41
+ * **[Extension]** Conditional error managment
42
+ * **[Extension]** Manage email notifications by conditional logic
43
+ * **[Extension]** Fire custom JavaScript events by conditional logic
44
+ * **[Extension]** Send data to remote servers (3rd-party integration)
45
+ * **[Extension]** Send RESTful Json/XML to remote servers
46
+ * **[Extension]** Send RESTful POST/GET to remote servers
47
+ * **[Extension]** PayPal Integration
48
 
49
  > Note: some features are availible only in the Pro version. Which means you need Redirection for Contact Form 7 Pro to unlock those features. You can [get Redirection for Contact Form 7 Pro here](http://querysol.com/product/contact-form-7-redirection/)!
50
 
69
 
70
  == Screenshots ==
71
 
72
+ 1. Actions tab
73
+ 2. Redirect Action
74
+ 3. Fire JavaScript Action
75
+ 4. Save Lead Actions
76
+ 5. Extensions tab
77
 
78
  == Changelog ==
79
 
80
+ = 2.2.7 =
81
+ * Minor styling changes.
82
+
83
+ = 2.2.6 =
84
+ * Fixed support for non-ajax redirection action.
85
+
86
+ = 2.2.5 =
87
+ * Fixed compatibility issues with "Contact Form 7 - Conditional Fields" Plugin.
88
+
89
+ = 2.2.4 =
90
+ * Fixed a bug with jQuery.noConflict()
91
+
92
+ = 2.2.3 =
93
+ * Fixed compatability issue with "Contact Form 7 - Conditional Fields" Plugin.
94
+
95
+ = 2.2.2 =
96
+ * Fixed a bug with jQuery.noConflict()
97
+ * jQuery migrate compatibility changes
98
+ * Added debug options
99
+
100
+ = 2.2.1 =
101
+ * Fixed a bug in extension class
102
+ * Fixed a bug - accessiBe turned off by default
103
+
104
+ = 2.2.0 =
105
+ * New feature: Saving form leads in database.
106
+ * New actions system.
107
+ * Easy installation of plugin extensions.
108
+ * Complete code refactoring.
109
+
110
  = 1.3.7 =
111
  * Show pages hierarchy in page select dropdown.
112
 
templates/banner.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Display banner
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="wpcfr-banner">
10
+ <div class="wpcfr-banner-holder">
11
+ <span class="dashicons dashicons-no close-banner" title="<?php _e( 'Close', 'wpcf7-redirect' ); ?>"></span>
12
+ <a href="https://redirection-for-contact-form7.com/" target="_blank">
13
+ <img src="<?php echo wpcf7r_get_redirect_plugin_url(); ?>/assets/images/banner.png" alt="Get pro version" />
14
+ </a>
15
+ </div>
16
+ </div>
templates/blank-popup-template.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Popup template
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ $file_name = str_replace( 'php', 'css', basename( $template ) );
9
+ if ( file_exists( WPCF7_PRO_REDIRECT_POPUP_TEMPLATES_PATH . $file_name ) ) {
10
+ $css_file_url = WPCF7_PRO_REDIRECT_POPUP_TEMPLATES_URL . $file_name;
11
+ } elseif ( file_exists( get_stylesheet_directory() . $file_name ) ) {
12
+ $css_file_url = get_stylesheet_directory_uri() . $file_name;
13
+ }
14
+ ?>
15
+
16
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
17
+ <html lang="en">
18
+ <head>
19
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
20
+ <link id="popup-template-css" rel="stylesheet" href="<?php echo $css_file_url; ?>">
21
+ <title></title>
22
+ <?php wp_head(); ?>
23
+ </head>
24
+ <body <?php body_class( 'popup-template' ); ?>>
25
+
26
+ <div class="modal fade is-open" tabindex="-1" role="dialog" aria-labelledby="staticBackdrop" aria-hidden="true">
27
+ <?php echo $template_html; ?>
28
+ </div>
29
+
30
+ <?php wp_footer(); ?>
31
+ </body>
32
+ </html>
33
+
templates/block-html.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Displays a condition logic HTML block
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ self::conditional_groups_display( $group_block, $prefix );
templates/block-title.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Displays a conditional block title
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="block-title <?php echo $active_tab_title; ?>" data-rel="<?php echo $group_block_key; ?>">
10
+ <?php $active_tab_title = ''; ?>
11
+ <span class="dashicons dashicons-edit"></span>
12
+ <span class="dashicons dashicons-yes show-on-edit" data-rel="<?php echo $group_block_key; ?>"></span>
13
+ <span class="dashicons dashicons-no show-on-edit" data-rel="<?php echo $group_block_key; ?>"></span>
14
+ <span class="dashicons dashicons-minus show-on-edit remove-block"></span>
15
+ <input type="text" name="wpcf7-redirect<?php echo $prefix; ?>[blocks][<?php echo $group_block_key; ?>][block_title]" value="<?php echo $group_block['block_title']; ?>" data-original="<?php echo $group_block['block_title']; ?>" readonly="readonly">
16
+ </div>
templates/default-settings.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Displays the list of actions
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ $rule_id = 'default';
9
+ $actions = $this->get_actions( $rule_id );
10
+ ?>
11
+
12
+ <h2>
13
+ <?php _e( 'Submission Actions', 'wpcf7-redirect' ); ?>
14
+ </h2>
15
+
16
+ <legend>
17
+ <?php _e( 'You can add actions that will be fired on submission. For details and support check', 'wpcf7-redirect' ); ?> <a href="https://redirection-for-contact-form7.com/" target="_blank"><?php _e( 'official website', 'wpcf7-redirect' ); ?></a>.
18
+ </legend>
19
+
20
+ <div class="actions-list">
21
+ <div class="actions">
22
+ <table class="wp-list-table widefat fixed striped pages" data-wrapid="<?php echo $rule_id; ?>">
23
+ <thead>
24
+ <tr>
25
+ <th class="manage-column check-column">
26
+ <a href="#"><?php _e( 'No.', 'wpcf7-redirect' ); ?></a>
27
+ </th>
28
+ <th class="manage-column column-title column-primary sortable desc">
29
+ <a href="#"><?php _e( 'Title', 'wpcf7-redirect' ); ?></a>
30
+ </th>
31
+ <th class="manage-column column-primary sortable desc">
32
+ <a href="#"><?php _e( 'Type', 'wpcf7-redirect' ); ?></a>
33
+ </th>
34
+ <th class="manage-column column-primary sortable desc">
35
+ <a href="#"><?php _e( 'Active', 'wpcf7-redirect' ); ?></a>
36
+ </th>
37
+ <th class="manage-column check-column">
38
+ </th>
39
+ </tr>
40
+ </thead>
41
+ <tbody id="the_list">
42
+ <?php if ( $actions ) : ?>
43
+ <?php foreach ( $actions as $action ) : ?>
44
+ <?php echo $action->get_action_row(); ?>
45
+ <?php endforeach; ?>
46
+ <?php endif; ?>
47
+ </tbody>
48
+ </table>
49
+ </div>
50
+ <div class="add-new-action-wrap">
51
+ <select class="new-action-selector" name="new-action-selector">
52
+ <option value="" selected="selected"><?php _e( 'Choose Action', 'wpcf7-redirect' ); ?></option>
53
+ <?php foreach ( wpcf7r_get_available_actions() as $available_action_key => $available_action_label ) : ?>
54
+ <option value="<?php echo $available_action_key; ?>" <?php echo $available_action_label['attr']; ?>><?php echo $available_action_label['label']; ?></option>
55
+ <?php endforeach; ?>
56
+
57
+ <?php foreach ( wpcf7_get_extensions() as $extension ) : ?>
58
+ <?php if ( ! isset( $extension['active'] ) || ! $extension['active'] ) : ?>
59
+ <option value="<?php echo WPCF7_PRO_REDIRECT_PLUGIN_PAGE_URL . $extension['name']; ?>" data-action="purchase">
60
+ <?php echo $extension['title']; ?> (<?php _e( 'Purchase', 'wpcf7-redirect' ); ?>)
61
+ </option>
62
+ <?php endif; ?>
63
+ <?php endforeach; ?>
64
+ </select>
65
+ <a type="button" name="button" class="button-primary wpcf7-add-new-action" data-ruleid="<?php echo $rule_id; ?>" data-id="<?php echo $this->get_id(); ?>">
66
+ <?php _e( 'Add Action', 'wpcf7-redirect' ); ?>
67
+ </a>
68
+ </div>
69
+ </div>
templates/extensions.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Displays the extensions panel
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ wp_nonce_field( 'wpcf7_redirect_page_extensions', 'wpcf7_redirect_page_extensions_nonce' );
9
+
10
+ do_action( 'before_extensions_settings_tab_title', $this );
11
+ ?>
12
+
13
+ <fieldset>
14
+ <div class="fields-wrap field-wrap-page-id">
15
+ <div class="tab-wrap">
16
+ <div class="wpcf7r-tab-wrap-inner">
17
+ <div data-tab-inner>
18
+ <?php include( 'extensions/extensions-table.php' ); ?>
19
+ </div>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ </fieldset>
24
+
25
+ <?php
26
+ do_action( 'after_extensions_settings_tab_title', $this );
templates/extensions/extension-promo-box.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render extension promo box
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ $ver = $this->get_extension_ver();
9
+ $badge = method_exists( $this, 'get_badge' ) ? $this->get_badge() : '';
10
+ ?>
11
+
12
+ <div class="promo-box <?php echo $this->get_name(); ?> <?php echo $this->needs_activation() ? 'needs-activation' : ''; ?> <?php echo $this->has_update() ? 'has-update' : ''; ?> <?php echo $this->get_name(); ?> <?php echo $this->is_active() ? 'active-ext' : ''; ?>" data-extension="<?php echo $this->get_name(); ?>">
13
+ <div class="promo-box-inner">
14
+ <div class="promo-bot-title">
15
+ <div class="promo-version">
16
+ <?php if ( $ver && ! $badge ) : ?>
17
+ <small>v.<?php echo $this->get_extension_ver(); ?></small> <span class="dashicons dashicons-editor-code"></span>
18
+ <?php elseif ( $badge ) : ?>
19
+ <?php echo $badge; ?>
20
+ <?php endif; ?>
21
+ </div>
22
+
23
+ <?php if ( ! $this->is_active() ) : ?>
24
+ <div class="promo-purchase-link">
25
+ <?php if ( $this->get_aff_url() ) : ?>
26
+ <a href="<?php echo $this->get_aff_url(); ?>" class=""><?php _e( 'Activate', 'wpcf7-redirect' ); ?></a>
27
+ <?php else : ?>
28
+ <span type="button" class="btn-activate"><?php _e( 'Activate', 'wpcf7-redirect' ); ?></span>
29
+ <?php endif; ?>
30
+ </div>
31
+ <?php endif; ?>
32
+
33
+ </div>
34
+ <div class="promo-box-content">
35
+ <div class="promo-box-thumb">
36
+ <img src="<?php echo $this->get_icon(); ?>" alt="<?php $this->get_name(); ?>">
37
+ </div>
38
+ <div class="promo-box-description">
39
+ <h3><?php echo $this->get_title(); ?></h3>
40
+
41
+ <div class="description">
42
+ <?php echo $this->get_description(); ?>
43
+ </div>
44
+
45
+ <div class="promo-actions-box">
46
+ <div class="actions">
47
+ <?php if ( $this->get_aff_url() ) : ?>
48
+ <a href="<?php echo $this->get_aff_url(); ?>" class="button-primary"><?php echo $this->get_btn_text(); ?></a>
49
+ <?php else : ?>
50
+ <?php if ( ! $this->is_active() ) : ?>
51
+ <?php if ( $this->extension_file_exists() ) : ?>
52
+ <span type="button" class="btn-activate"><?php _e( 'Activate' ); ?></span>
53
+ <?php else : ?>
54
+ <a href="<?php echo $this->get_purchase_link(); ?>" class="btn-getit" target="_blank">
55
+ <span class="get-it-label"><?php _e( 'Get It', 'wpcf7-redirect' ); ?></span><span class="dashicons dashicons-arrow-down-alt"></span>
56
+ </a>
57
+ <?php endif; ?>
58
+ <?php else : ?>
59
+ <span type="button" class="button-primary btn-deactivate" ><?php _e( 'Deactivate' ); ?></span>
60
+ <?php endif; ?>
61
+
62
+ <?php if ( $this->is_active() && $this->has_update() ) : ?>
63
+ <span type="button" class="button-primary btn-update"><?php _e( 'Update' ); ?></span>
64
+ <?php endif; ?>
65
+
66
+ <div class="serial">
67
+ <input type="text" class="serial-number" value="<?php echo $this->get_serial(); ?>" placeholder="<?php _e( 'License Key', 'wpcf7-redirect' ); ?>">
68
+ <span class="button-primary btn-activate-serial" value="<?php _e( 'Save', 'wpcf7-redirect' ); ?>">
69
+ <span class="dashicons dashicons-yes"></span>
70
+ </span>
71
+ <span class="button-primary btn-close" title="<?php _e( 'Cancel', 'wpcf7-redirect' ); ?>">
72
+ <span class="dashicons dashicons-no"></span>
73
+ </span>
74
+ </div>
75
+ <?php endif; ?>
76
+ </div>
77
+ </div>
78
+ </div>
79
+ </div>
80
+ </div>
81
+ </div>
templates/extensions/extensions-table.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render extensions table
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ $extensions = $this->get_extensions();
9
+ ?>
10
+
11
+ <div class="extensions-list">
12
+ <div class="extensions">
13
+ <?php if ( $extensions ) : ?>
14
+ <?php foreach ( $extensions as $extension_slug => $extension ) : ?>
15
+ <div class="extension">
16
+ <?php echo $extension->get_action_promo(); ?>
17
+ </div>
18
+ <?php endforeach; ?>
19
+ <?php endif; ?>
20
+ </div>
21
+ </div>
templates/fields/field-button.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render button field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> wpcf7r-button <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>" data-toggle="<?php echo isset( $field['show_selector'] ) ? $field['show_selector'] : ''; ?>">
10
+ <?php if ( isset( $field['label'] ) && $field['label'] ) : ?>
11
+ <label class="wpcf7-redirect-<?php echo $field['name']; ?>"><?php echo $field['label']; ?></label>
12
+ <?php endif; ?>
13
+ <input type="button" class="button-primary wpcf7-redirect-<?php echo $field['name']; ?>-fields"
14
+ name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]"
15
+ <?php echo isset( $field['attr'] ) ? wpcf7r_implode_attributes( $field['attr'] ) : ''; ?>
16
+ value="<?php echo esc_html( $field['label'] ); ?>"
17
+ />
18
+ </div>
templates/fields/field-checkbox.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render checkbox field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?> wpcf7r-checkbox" data-toggle="<?php echo isset( $field['show_selector'] ) ? $field['show_selector'] : ''; ?>">
10
+ <label>
11
+ <input type="checkbox" class="wpcf7-redirect-<?php echo $field['name']; ?>-fields"
12
+ name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]"
13
+ <?php checked( $field['value'], 'on', true ); ?>
14
+ data-toggle-label="<?php echo isset( $field['toggle-label'] ) ? esc_html( $field['toggle-label'] ) : ''; ?>"
15
+ />
16
+ <span class="wpcf7r-on-off-button">
17
+ <span class="wpcf7r-toggle-button">
18
+ </span>
19
+ </span>
20
+ <strong class="checkbox-label"><?php echo esc_html( $field['label'] ); ?></strong>
21
+ <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
22
+ </label>
23
+ </div>
templates/fields/field-debug-log.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render debug log by requested fields
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
10
+ <div class="debug-log-wrap">
11
+ <?php foreach ( $field['fields'] as $debug_field_name => $debug_field_value ) : ?>
12
+ <div class="debug_log">
13
+ <h4><?php echo $debug_field_name; ?>:</h4>
14
+ <textarea rows="10">
15
+ <?php
16
+ $debug_field_value = maybe_unserialize( $debug_field_value );
17
+
18
+ if ( is_array( $debug_field_value ) || is_object( $debug_field_value ) ) {
19
+ print_r( $debug_field_value );
20
+ } else {
21
+ echo trim( esc_attr( $debug_field_value ) );
22
+ }
23
+ ?>
24
+ </textarea>
25
+ </div>
26
+ <?php endforeach; ?>
27
+ </div>
28
+ </div>
templates/fields/field-download.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Display download field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
9
+ <?php if ( isset( $field['label'] ) && $field['label'] ) : ?>
10
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
11
+ <strong><?php echo esc_html( $field['label'] ); ?></strong>
12
+ <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
13
+ </label>
14
+ <?php endif; ?>
15
+
16
+ <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
17
+
18
+ <div class="wpcf7-subtitle">
19
+ <?php echo $field['sub_title']; ?>
20
+ </div>
21
+
22
+ <?php endif; ?>
23
+
24
+ <a href="data:application/octet-stream;base64,<?php echo esc_html( $field['value'] ); ?>" download="<?php echo $field['filename']; ?>"><?php echo $field['filename']; ?></a>
25
+
26
+ <div class="field-footer">
27
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
28
+ </div>
29
+ </div>
templates/fields/field-editor.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render editor field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ $field_name = "wpcf7-redirect{$prefix}[{$field['name']}]";
9
+ $css_class = "wpcf7-redirect-{$field['name']}-fields";
10
+ ?>
11
+
12
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
13
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
14
+ <strong><?php echo esc_html( $field['label'] ); ?></strong>
15
+ </label>
16
+ <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
17
+ <div class="wpcf7-subtitle">
18
+ <?php echo $field['sub_title']; ?>
19
+ </div>
20
+ <?php endif; ?>
21
+
22
+ <?php
23
+ wp_editor(
24
+ $field['value'],
25
+ 'editor-' . md5( $field_name ),
26
+ $settings = array(
27
+ 'textarea_name' => $field_name,
28
+ 'editor_class' => $css_class,
29
+ )
30
+ );
31
+ ?>
32
+
33
+ <div class="field-footer">
34
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
35
+ </div>
36
+
37
+ </div>
templates/fields/field-json-editor.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render json editor field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
10
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
11
+ <strong><?php echo esc_html( $field['label'] ); ?></strong>
12
+ </label>
13
+ <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
14
+ <div class="wpcf7-subtitle">
15
+ <?php echo $field['sub_title']; ?>
16
+ </div>
17
+ <?php endif; ?>
18
+ <textarea rows="10" class="json-container wpcf7-redirect-<?php echo $field['name']; ?>-fields" placeholder="<?php echo $field['placeholder']; ?>" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]"><?php echo esc_html( $field['value'] ); ?></textarea>
19
+ <div class="field-footer">
20
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
21
+ </div>
22
+ </div>
templates/fields/field-leads-mapping.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render mapping leads field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
10
+ <?php if ( isset( $field['title'] ) && $field['title'] ) : ?>
11
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
12
+ <h3><?php echo esc_html( $field['label'] ); ?></h3>
13
+ &nbsp;
14
+ <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
15
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>"><?php echo esc_html( $field['sub_title'] ); ?></label>
16
+ <br/>&nbsp;
17
+ <?php endif; ?>
18
+ </label>
19
+ <?php endif; ?>
20
+
21
+ <div class="cf7_row">
22
+ <table class="wp-list-table widefat fixed striped pages wp-list-table-inner">
23
+ <tr>
24
+ <td>
25
+ <strong>
26
+ <?php _e( 'Form fields', 'wpcf7-redirect' ); ?>
27
+ </strong>
28
+ </td>
29
+ <td class="tags-map-api-key">
30
+ <strong>
31
+ <?php _e( 'Field Label', 'wpcf7-redirect' ); ?>
32
+ </strong>
33
+ <?php echo cf7r_tooltip( __( 'The field label', 'wpcf7-redirect' ) ); ?>
34
+ </td>
35
+ <?php
36
+ /* <td>
37
+ <strong>
38
+ <?php _e( 'Save Field', 'wpcf7-redirect' ); ?>
39
+ </strong>
40
+ <?php echo cf7r_tooltip( __( 'Should this field be saved to the database', 'wpcf7-redirect' ) ); ?>
41
+ </td> */
42
+ ?>
43
+ </tr>
44
+ <?php
45
+ foreach ( $field['tags'] as $mail_tag ) :
46
+ if ( 'lead_id' === $mail_tag->name ) {
47
+ continue;
48
+ }
49
+ $save = isset( $field['value'][ $mail_tag->name ]['save'] ) ? esc_html( $field['value'][ $mail_tag->name ]['save'] ) : '';
50
+ $tag_value = isset( $field['value'][ $mail_tag->name ]['tag'] ) ? esc_html( $field['value'][ $mail_tag->name ]['tag'] ) : '';
51
+ ?>
52
+ <tr>
53
+ <td class="<?php echo $mail_tag->name; ?>"><?php echo $mail_tag->name; ?></td>
54
+ <td class="tags-map-api-key">
55
+ <input type="text" id="sf-<?php echo $mail_tag->name; ?>"
56
+ name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>][<?php echo $mail_tag->name; ?>][tag]"
57
+ class="large-text"
58
+ value="<?php echo $tag_value; ?>" />
59
+ </td>
60
+ <?php
61
+ /* <td>
62
+ <input type="checkbox"
63
+ name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>][<?php echo $mail_tag->name; ?>][save]"
64
+ value="1"
65
+ <?php checked( $save, 1 ); ?> />
66
+ </td> */
67
+ ?>
68
+ </tr>
69
+ <?php endforeach; ?>
70
+ </table>
71
+ </div>
72
+ </div>
templates/fields/field-media.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render image field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ ?>
9
+
10
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
11
+ <?php if ( isset( $field['label'] ) && $field['label'] ) : ?>
12
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
13
+ <strong><?php echo esc_html( $field['label'] ); ?></strong>
14
+ <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
15
+ </label>
16
+ <?php endif; ?>
17
+ <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
18
+ <div class="wpcf7-subtitle">
19
+ <?php echo $field['sub_title']; ?>
20
+ </div>
21
+ <?php endif; ?>
22
+ <div class="image-container">
23
+ <img src="<?php echo esc_html( $field['value'] ); ?>" alt="" style="max-width:100px;" class="popup-image" />
24
+ <a title="Set Image" href="javascript:;" class="image-uploader-btn browser button button-hero"><?php _e( 'Select Image', 'wpcf7-redirect' ); ?></a>
25
+ <input type="hidden" class="wpcf7-redirect-<?php echo $field['name']; ?>-fields" placeholder="<?php echo esc_html( $field['placeholder'] ); ?>" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]" value="<?php echo esc_html( $field['value'] ); ?>" <?php echo isset( $field['input_attr'] ) ? $field['input_attr'] : ''; ?>>
26
+ </div>
27
+ <div class="field-footer">
28
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
29
+ </div>
30
+ </div>
templates/fields/field-notice.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render notice block
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="field-wrap">
10
+ <div class="field-notice field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
11
+ <strong>
12
+ <?php echo $field['label']; ?>
13
+ </strong>
14
+ <?php echo $field['sub_title']; ?>
15
+ </div>
16
+
17
+ </div>
templates/fields/field-number.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render number field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
10
+ <?php if ( isset( $field['label'] ) && $field['label'] ) : ?>
11
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
12
+ <strong><?php echo esc_html( $field['label'] ); ?></strong>
13
+ <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
14
+ </label>
15
+ <?php endif; ?>
16
+ <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
17
+ <div class="wpcf7-subtitle">
18
+ <?php echo $field['sub_title']; ?>
19
+ </div>
20
+ <?php endif; ?>
21
+ <input type="number" class="wpcf7-redirect-<?php echo $field['name']; ?>-fields" placeholder="<?php echo esc_html( $field['placeholder'] ); ?>" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]" value="<?php echo esc_html( $field['value'] ); ?>" <?php echo isset( $field['input_attr'] ) ? $field['input_attr'] : ''; ?>>
22
+ <div class="field-footer">
23
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
24
+ </div>
25
+ </div>
templates/fields/field-page-select.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render page select field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ $field_id = $field['name'] . '-' . rand( 0, 1000 );
9
+ ?>
10
+
11
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
12
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
13
+ <strong><?php echo esc_html( $field['label'] ); ?></strong>
14
+ </label>
15
+ <?php
16
+ echo wp_dropdown_pages(
17
+ array(
18
+ 'echo' => 0,
19
+ 'name' => 'wpcf7-redirect' . $prefix . '[' . $field['name'] . ']',
20
+ 'show_option_none' => $field['placeholder'],
21
+ 'option_none_value' => '',
22
+ 'selected' => $field['value'] ? $field['value'] : '',
23
+ 'id' => $field_id,
24
+ 'class' => 'wpcf7-redirect-' . $field['name'] . '-fields',
25
+ )
26
+ );
27
+ ?>
28
+ <script>
29
+ var element = document.getElementById('<?php echo $field_id; ?>');
30
+
31
+ if ( ! element.value ) {
32
+ element.options[0].setAttribute('selected','selected');
33
+ }
34
+ </script>
35
+ </div>
templates/fields/field-password.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render a password field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
10
+ <?php if ( isset( $field['label'] ) && $field['label'] ) : ?>
11
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
12
+ <strong><?php echo esc_html( $field['label'] ); ?></strong>
13
+ <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
14
+ </label>
15
+ <?php endif; ?>
16
+
17
+ <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
18
+ <div class="wpcf7-subtitle">
19
+ <?php echo $field['sub_title']; ?>
20
+ </div>
21
+ <?php endif; ?>
22
+
23
+ <input type="password" class="wpcf7-redirect-<?php echo $field['name']; ?>-fields <?php echo isset( $field['input_class'] ) ? $field['input_class'] : ''; ?>" placeholder="<?php echo esc_html( $field['placeholder'] ); ?>" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]" value="<?php echo esc_html( $field['value'] ); ?>" <?php echo isset( $field['input_attr'] ) ? $field['input_attr'] : ''; ?>>
24
+
25
+ <div class="field-footer">
26
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
27
+ </div>
28
+ </div>
templates/fields/field-post-author-select.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render post author select field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-select.php';
9
+
10
+ $args = array(
11
+ 'role__in' => array( 'administrator', 'editor', 'author' ),
12
+ );
13
+
14
+ $author_args = apply_filters( 'wpcf7r_get_authors_args', $args );
15
+
16
+ $authors = get_users( $author_args );
17
+
18
+ $field['options']['current_user'] = __( 'Current Logged In User', 'wpcf7-redirect' );
19
+
20
+ foreach ( $authors as $author ) {
21
+ $field['options'][ $author->ID ] = $author->data->user_nicename;
22
+ }
23
+
24
+
25
+ include $template;
templates/fields/field-post-type-select.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render post type select field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ $post_types = get_post_types();
9
+ ?>
10
+
11
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
12
+ <?php if ( $field['label'] ) : ?>
13
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
14
+ <strong><?php echo esc_html( $field['label'] ); ?></strong>
15
+ <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
16
+ </label>
17
+ <?php endif; ?>
18
+
19
+ <select class="" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]">
20
+ <?php foreach ( $post_types as $option_key => $option_label ) : ?>
21
+ <option value="<?php echo $option_key; ?>" <?php selected( $field['value'], $option_key ); ?>><?php echo $option_label; ?></option>
22
+ <?php endforeach; ?>
23
+ </select>
24
+
25
+ <div class="field-footer">
26
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
27
+ </div>
28
+ </div>
templates/fields/field-preview.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render preview iFrame
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
10
+ <iframe data-name="preview" class="preview-iframe" src="<?php echo add_query_arg( $field['value'], admin_url() ); ?>" scrolling="no" style=" width: 100%; height: 500px; overflow: hidden;" ></iframe>
11
+ </div>
templates/fields/field-repeater.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render a repater field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ $values = isset( $field['value'] ) && ! empty( $field['value'] ) > 0 ? $field['value'] : array( 'default' );
9
+ $base_prefix = $prefix;
10
+ $repeater_row_template = array();
11
+ ?>
12
+
13
+ <?php ob_start(); ?>
14
+
15
+ <tr class="qs-repeater-row <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>" data-repeater-row-count="new_row">
16
+ <?php $prefix = $base_prefix . '[' . $field['name'] . ']' . '[new_row]'; ?>
17
+ <?php foreach ( $field['fields'] as $child_field ) : ?>
18
+ <td>
19
+ <?php
20
+ $child_field['value'] = isset( $value[ $child_field['name'] ] ) ? $value[ $child_field['name'] ] : '';
21
+ $child_field['label'] = '';
22
+ WPCF7R_Html::render_field( $child_field, $prefix );
23
+ ?>
24
+ </td>
25
+ <?php endforeach; ?>
26
+ <td>
27
+ <div class="qs-repeater-action">
28
+ <span class="dashicons dashicons-plus"></span>
29
+ <span class="dashicons dashicons-minus"></span>
30
+ </div>
31
+ </td>
32
+ </tr>
33
+
34
+ <?php $repeater_single_row_template['template'] = ob_get_clean(); ?>
35
+
36
+ <div class="qs-row">
37
+ <div class="qs-col qs-col-12">
38
+ <?php if ( isset( $field['sub_title'] ) ) : ?>
39
+ <h2><?php echo esc_html( $field['sub_title'] ); ?></h2>
40
+ <?php endif; ?>
41
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
42
+ <h3><?php echo esc_html( $field['label'] ); ?> <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?></h3>
43
+ </label>
44
+ <div>
45
+ <div class="actions">
46
+ <table class="wp-list-table widefat fixed striped pages repeater-table leads-list">
47
+ <thead>
48
+ <tr>
49
+ <?php foreach ( $values as $value_row => $value ) : ?>
50
+ <?php foreach ( $field['fields'] as $child_field ) : ?>
51
+ <th class="manage-column column-primary sortable desc">
52
+ <a href="#"><?php echo $child_field['label']; ?></a>
53
+ </th>
54
+ <?php endforeach; ?>
55
+ <th><?php _e( 'Actions', 'wpcf7-redirect' ); ?></th>
56
+ <?php break; ?>
57
+ <?php endforeach; ?>
58
+ </tr>
59
+ </thead>
60
+
61
+ <tbody id="the_list" data-repeater-template="<?php echo htmlspecialchars( wp_json_encode( $repeater_single_row_template ) ); ?>">
62
+ <?php foreach ( $values as $value_row => $value ) : ?>
63
+ <tr class="qs-repeater-row" data-repeater-row-count="<?php echo $value_row; ?>">
64
+ <?php $prefix = $base_prefix . '[' . $field['name'] . ']' . '[' . $value_row . ']'; ?>
65
+ <?php foreach ( $field['fields'] as $child_field ) : ?>
66
+ <td>
67
+ <?php
68
+ $child_field['value'] = isset( $value[ $child_field['name'] ] ) ? $value[ $child_field['name'] ] : '';
69
+ $child_field['label'] = '';
70
+ WPCF7R_Html::render_field( $child_field, $prefix );
71
+ ?>
72
+ </td>
73
+ <?php endforeach; ?>
74
+ <td>
75
+ <div class="qs-repeater-action">
76
+ <span class="dashicons dashicons-plus"></span>
77
+ <span class="dashicons dashicons-minus"></span>
78
+ </div>
79
+ </td>
80
+ </tr>
81
+ <?php endforeach; ?>
82
+ </tbody>
83
+ </table>
84
+ </div>
85
+ </div>
86
+ <div class="field-footer">
87
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
88
+ </div>
89
+ </div>
90
+ </div>
templates/fields/field-rule-blocks.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render a block of rules
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ if ( ! conditional_logic_enabled() ) {
9
+ return;
10
+ }
11
+ ?>
12
+
13
+ <div class="conditional-logic-blocks <?php echo $field['has_conditional_logic'] ? 'active' : ''; ?>">
14
+ <div class="conditional-groups-wrap">
15
+ <div class="conditional-groups-tabs">
16
+ <div class="conditional-group-blocks">
17
+ <div class="qs-row">
18
+ <div class="qs-col qs-col-12">
19
+ <div class="wpcfr-rule-groups">
20
+ <?php
21
+ $active_tab = 'active';
22
+ foreach ( $field['blocks'] as $group_block ) :
23
+ WPCF7R_Html::get_block_html( 'block_1', $group_block, $active_tab, true, $prefix );
24
+ $active_tab = false;
25
+ endforeach;
26
+ ?>
27
+ </div>
28
+ </div>
29
+ <div class="qs-col qs-col-12">
30
+ <div class="groups-actions">
31
+ <a href="#" class="button-primary wpcfr-add-group"><?php _e( 'OR', 'wpcf7-redirect' ); ?></a>
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ </div>
templates/fields/field-select.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render a select field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>" >
10
+ <?php if ( $field['label'] ) : ?>
11
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
12
+ <strong><?php echo esc_html( $field['label'] ); ?></strong>
13
+ <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
14
+ </label>
15
+ <?php endif; ?>
16
+ <select class="" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]">
17
+ <?php foreach ( $field['options'] as $option_key => $option_label ) : ?>
18
+ <?php
19
+ $selected = $option_key ? selected( $field['value'], $option_key, false ) : "selected='selected'";
20
+ ?>
21
+ <option value="<?php echo $option_key; ?>" <?php echo $selected; ?>><?php echo $option_label; ?></option>
22
+ <?php endforeach; ?>
23
+ </select>
24
+ <div class="field-footer">
25
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
26
+ </div>
27
+ </div>
templates/fields/field-tags-map.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render tags mapping for API field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ $defaults_name = isset( $field['defaults_name'] ) ? $field['defaults_name'] : 'tags_defaults';
9
+ ?>
10
+
11
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
12
+ <?php if ( isset( $field['title'] ) && $field['title'] ) : ?>
13
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
14
+ <h3><?php echo esc_html( $field['label'] ); ?></h3>
15
+ &nbsp;
16
+ <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
17
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>"><?php echo esc_html( $field['sub_title'] ); ?></label>
18
+ <br/>&nbsp;
19
+ <?php endif; ?>
20
+ </label>
21
+ <?php endif; ?>
22
+
23
+ <div class="cf7_row">
24
+ <table class="wp-list-table widefat fixed striped pages wp-list-table-inner">
25
+ <tr>
26
+ <td><strong><?php _e( 'Form Field Name', 'wpcf7-redirect' ); ?></strong></td>
27
+ <?php if ( 'test_tags_map' !== $field['name'] ) : ?>
28
+ <td class="tags-map-api-key"><strong><?php _e( 'Matching 3rd-Party Field Name', 'wpcf7-redirect' ); ?></strong><?php echo cf7r_tooltip( __( 'The Matching 3rd-Party field name as your api provider required', 'wpcf7-redirect' ) ); ?></td>
29
+ <?php endif; ?>
30
+ <?php if ( 'test_tags_map' !== $field['name'] ) : ?>
31
+ <td><strong><?php _e( 'Defaults', 'wpcf7-redirect' ); ?></strong><?php echo cf7r_tooltip( __( 'Send default values if not selected by the user', 'wpcf7-redirect' ) ); ?></td>
32
+ <?php else : ?>
33
+ <td><strong><?php _e( 'Value', 'wpcf7-redirect' ); ?></strong><?php echo cf7r_tooltip( __( 'Which value to send', 'wpcf7-redirect' ) ); ?></td>
34
+ <?php endif; ?>
35
+ <?php if ( 'test_tags_map' !== $field['name'] && isset( $field['tags_functions'] ) ) : ?>
36
+ <td><strong><?php _e( 'Function', 'wpcf7-redirect' ); ?></strong><?php echo cf7r_tooltip( __( 'Perform actions on the submitted value', 'wpcf7-redirect' ) ); ?></td>
37
+ <?php endif; ?>
38
+ </tr>
39
+ <?php foreach ( $field['tags'] as $mail_tag ) : ?>
40
+ <tr>
41
+ <td class="<?php echo $mail_tag->name; ?>"><?php echo $mail_tag->name; ?></td>
42
+ <?php if ( 'test_tags_map' !== $field['name'] ) : ?>
43
+ <td class="tags-map-api-key">
44
+ <input type="text" id="sf-<?php echo $mail_tag->name; ?>"
45
+ name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>][<?php echo $mail_tag->name; ?>]"
46
+ class="large-text"
47
+ value="<?php echo isset( $field['value'][ $mail_tag->name ] ) ? esc_html( $field['value'][ $mail_tag->name ] ) : ''; ?>" />
48
+ </td>
49
+ <?php endif; ?>
50
+ <td>
51
+ <?php $selected_value = isset( $field[ $defaults_name ][ "{$mail_tag->name}" ] ) ? $field[ $defaults_name ][ "{$mail_tag->name}" ] : ''; ?>
52
+ <input type="text" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $defaults_name; ?>][<?php echo $mail_tag->name; ?>]" value="<?php echo $selected_value; ?>" />
53
+ </td>
54
+ <?php if ( 'test_tags_map' !== $field['name'] && isset( $field['tags_functions'] ) ) : ?>
55
+ <td>
56
+ <?php $selected_function = isset( $field['tags_functions'][ "{$mail_tag->name}" ] ) ? $field['tags_functions'][ "{$mail_tag->name}" ] : ''; ?>
57
+ <select class="" name="wpcf7-redirect<?php echo $prefix; ?>[tags_functions][<?php echo $mail_tag->name; ?>]">
58
+ <?php $functions = WPCF7r_Utils::get_available_text_functions( '', $mail_tag->type ); ?>
59
+ <option value=""><?php _e( 'Select' ); ?></option>
60
+ <?php foreach ( array_keys( $functions ) as $function_name ) : ?>
61
+ <option value="<?php echo $function_name; ?>" <?php selected( $selected_function, $function_name ); ?>><?php echo $function_name; ?></option>
62
+ <?php endforeach; ?>
63
+ </select>
64
+ </td>
65
+ <?php endif; ?>
66
+ </tr>
67
+ <?php endforeach; ?>
68
+ </table>
69
+ </div>
70
+ </div>
templates/fields/field-taxonomy.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render taxonomy select field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ $taxonomiies = get_taxonomies();
9
+ ?>
10
+
11
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
12
+ <?php if ( $field['label'] ) : ?>
13
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
14
+ <strong><?php echo esc_html( $field['label'] ); ?></strong>
15
+ <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
16
+ </label>
17
+ <?php endif; ?>
18
+ <select class="" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]">
19
+ <?php foreach ( $taxonomiies as $option_key => $option_label ) : ?>
20
+ <option value="<?php echo $option_key; ?>" <?php selected( $field['value'], $option_key ); ?>><?php echo $option_label; ?></option>
21
+ <?php endforeach; ?>
22
+ </select>
23
+ <div class="field-footer">
24
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
25
+ </div>
26
+ </div>
templates/fields/field-text.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Display text field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
9
+ <?php if ( isset( $field['label'] ) && $field['label'] ) : ?>
10
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
11
+ <strong><?php echo esc_html( $field['label'] ); ?></strong>
12
+ <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
13
+ </label>
14
+ <?php endif; ?>
15
+
16
+ <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
17
+
18
+ <div class="wpcf7-subtitle">
19
+ <?php echo $field['sub_title']; ?>
20
+ </div>
21
+
22
+ <?php endif; ?>
23
+
24
+ <input type="text" class="wpcf7-redirect-<?php echo $field['name']; ?>-fields <?php echo isset( $field['input_class'] ) ? $field['input_class'] : ''; ?>" placeholder="<?php echo esc_html( $field['placeholder'] ); ?>" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]" value="<?php echo esc_html( $field['value'] ); ?>" <?php echo isset( $field['input_attr'] ) ? $field['input_attr'] : ''; ?>>
25
+
26
+ <div class="field-footer">
27
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
28
+ </div>
29
+ </div>
templates/fields/field-textarea.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render a textarea field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
9
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
10
+ <strong><?php echo esc_html( $field['label'] ); ?></strong>
11
+ </label>
12
+ <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
13
+ <div class="wpcf7-subtitle">
14
+ <?php echo $field['sub_title']; ?>
15
+ </div>
16
+ <?php endif; ?>
17
+ <textarea rows="10" class="wpcf7-redirect-<?php echo $field['name']; ?>-fields" placeholder="<?php echo $field['placeholder']; ?>" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]"><?php echo esc_html( $field['value'] ); ?></textarea>
18
+ <div class="field-footer">
19
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
20
+ </div>
21
+ </div>
templates/fields/field-url.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render url field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
10
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
11
+ <strong><?php echo esc_html( $field['label'] ); ?></strong>
12
+ <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
13
+ </label>
14
+ <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
15
+ <div class="wpcf7-subtitle">
16
+ <?php echo $field['sub_title']; ?>
17
+ </div>
18
+ <?php endif; ?>
19
+ <input type="url" class="wpcf7-redirect-<?php echo $field['name']; ?>-fields" placeholder="<?php echo esc_html( $field['placeholder'] ); ?>" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]" value="<?php echo esc_html( $field['value'] ); ?>">
20
+ <div class="field-footer">
21
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
22
+ </div>
23
+ </div>
templates/fields/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit;
templates/fields/section.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Wrapper for each field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?> qs-section clearfix" <?php echo isset( $field['attr'] ) ? $field['attr'] : ''; ?>>
10
+ <?php if ( isset( $field['title'] ) && $field['title'] ) : ?>
11
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
12
+ <h3 class="" data-tab-target="section-inner-wrap-<?php echo $field['name']; ?>"><span class="dashicons dashicons-plus-alt"></span> <?php echo esc_html( $field['title'] ); ?></h3>
13
+ </label>
14
+ <?php endif; ?>
15
+
16
+ <div class="section-inner-wrap" data-tab="section-inner-wrap-<?php echo $field['name']; ?>">
17
+ <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
18
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
19
+ <h4><?php echo $field['sub_title']; ?></h4>
20
+ </label>
21
+ <?php endif; ?>
22
+ <div>&nbsp;</div>
23
+
24
+ <?php foreach ( $field['fields'] as $child_field ) : ?>
25
+ <?php WPCF7R_Html::render_field( $child_field, $prefix ); ?>
26
+ <?php endforeach; ?>
27
+
28
+ <div class="field-footer">
29
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
30
+ </div>
31
+ </div>
32
+ </div>
templates/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit;
templates/popup-api-test.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit;
3
+ ?>
4
+
5
+ <div class="wpcfr-popup-wrap wpcfr-popup-hidden <?php echo $template; ?> middle-center">
6
+ <div class="wpcfr-popup-wrap-inner">
7
+ <span class="dashicons dashicons-no-alt wpcfr-close-popup top-right"></span>
8
+ <div class="wpcfr-popup-wrap-content">
9
+ <h3>
10
+ <?php _e( 'Record', 'wpcf7-redirect' ); ?>
11
+ </h3>
12
+ <div class="wrapper">
13
+ <textarea name="name" rows="8" cols="80">
14
+ <?php
15
+ ob_start();
16
+
17
+ print_r( $this->record );
18
+
19
+ echo esc_html( ob_get_clean() );
20
+ ?>
21
+ </textarea>
22
+ </div>
23
+ <h3>
24
+ <?php _e( 'Request', 'wpcf7-redirect' ); ?>
25
+ </h3>
26
+ <div class="wrapper">
27
+ <textarea name="name" rows="8" cols="80">
28
+ <?php
29
+ ob_start();
30
+
31
+ print_r( $this->request );
32
+
33
+ echo esc_html( ob_get_clean() );
34
+ ?>
35
+ </textarea>
36
+ </div>
37
+ <h3>
38
+ <?php _e( 'Response', 'wpcf7-redirect' ); ?>
39
+ </h3>
40
+ <div class="wrapper">
41
+ <?php if ( is_wp_error( $this->results ) ) : ?>
42
+ <span class="err"><?php _e( 'Error!' ); ?></span>
43
+ <textarea name="name" rows="8" cols="80">
44
+ <?php
45
+ ob_start();
46
+
47
+ print_r( $this->results );
48
+
49
+ echo esc_html( ob_get_clean() );
50
+ ?>
51
+ </textarea>
52
+ <?php else : ?>
53
+ <div class="field-wrap">
54
+ <div class="label">
55
+ <label>
56
+ <?php _e( 'Response code', 'wpcf7-redirect' ); ?>
57
+ </label>
58
+ <span><?php echo $this->results['response']['message']; ?>(<?php echo $this->results['response']['code']; ?>)</span>
59
+ </div>
60
+ <textarea name="name" rows="8" cols="80">
61
+ <?php
62
+ ob_start();
63
+
64
+ print_r( $this->results );
65
+
66
+ echo esc_html( ob_get_clean() );
67
+ ?>
68
+ </textarea>
69
+ </div>
70
+ <?php endif; ?>
71
+ </div>
72
+ </div>
73
+ </div>
74
+ </div>
templates/popups/template-1.css ADDED
@@ -0,0 +1 @@
 
1
+ .popup-template .modal{position:fixed;left:0;bottom:0;width:100%;opacity:0;z-index:-1;visibility:hidden;background:rgba(0,0,0,.9);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;height:100%;z-index:999;-webkit-transition:all 0s;-o-transition:all 0s;transition:all 0s}.popup-template .modal-container{display:-webkit-box;display:-ms-flexbox;display:flex;max-width:720px;width:100%;border-radius:10px;overflow:hidden;position:absolute;opacity:0;pointer-events:none;-webkit-transition-duration:.3s;-o-transition-duration:.3s;transition-duration:.3s;background:#fff;-webkit-transform:translateY(100px) scale(.4);-ms-transform:translateY(100px) scale(.4);transform:translateY(100px) scale(.4)}.popup-template .modal-title{font-size:26px;margin:0;font-weight:400;color:#55311c}.popup-template .modal-desc{margin:6px 0 30px 0}.popup-template .modal-left{padding:40px 30px;background:#fff;-webkit-box-flex:1.5;-ms-flex:1.5;flex:1.5;-webkit-transition-duration:.5s;-o-transition-duration:.5s;transition-duration:.5s;-webkit-transform:translateY(80px);-ms-transform:translateY(80px);transform:translateY(80px);opacity:0}.popup-template .modal-button{color:#7d695e;font-family:Nunito,sans-serif;font-size:18px;cursor:pointer;border:0;outline:0;padding:10px 40px;border-radius:30px;background:#fff;-webkit-box-shadow:0 10px 40px rgba(0,0,0,.16);box-shadow:0 10px 40px rgba(0,0,0,.16);-webkit-transition:.3s;-o-transition:.3s;transition:.3s}.popup-template .modal-button:hover{border-color:rgba(255,255,255,.2);background:rgba(255,255,255,.8)}.popup-template .modal-right{-webkit-box-flex:2;-ms-flex:2;flex:2;font-size:0;-webkit-transition:.3s;-o-transition:.3s;transition:.3s;overflow:hidden}.popup-template .modal-right img{width:100%;height:100%;-webkit-transform:scale(2);-ms-transform:scale(2);transform:scale(2);-o-object-fit:cover;object-fit:cover;-webkit-transition-duration:1.2s;-o-transition-duration:1.2s;transition-duration:1.2s}.popup-template .modal.is-open{background:rgba(51,51,51,.85);opacity:1;z-index:9999;visibility:visible}.popup-template .modal.is-open .modal-button{opacity:0}.popup-template .modal.is-open .modal-container{opacity:1;-webkit-transition-duration:.6s;-o-transition-duration:.6s;transition-duration:.6s;pointer-events:auto;-webkit-transform:translateY(0) scale(1);-ms-transform:translateY(0) scale(1);transform:translateY(0) scale(1)}.popup-template .modal.is-open .modal-right img{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.popup-template .modal.is-open .modal-left{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);opacity:1;-webkit-transition-delay:.1s;-o-transition-delay:.1s;transition-delay:.1s}.popup-template .modal-buttons{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.popup-template .modal-buttons a{color:rgba(51,51,51,.6);font-size:14px}.popup-template .modal .icon-button{outline:0;position:absolute;right:10px;top:12px;width:32px;height:32px;border:0;background:0;padding:0;cursor:pointer}@media (max-width:750px){.popup-template .modal-container{width:90%}.popup-template .modal-right{display:none}}
templates/popups/template-1.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Popup Template Name: 50-50 With Image Template
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="modal-container">
10
+ <div class="modal-left">
11
+ <h1 class="modal-title" style="color:{{template_title_color.color}}">{{template_title.text}}</h1>
12
+ <p class="modal-desc">{{template_description.description}}</p>
13
+ <div class="modal-buttons">
14
+ <a href="{{template_button1_link.url}}" class="" style="color:{{template_button1_color.color}}">{{template_button1.text}}</a>
15
+ </div>
16
+
17
+ <p class="sign-up"><span style="color:{{template_footer_text_color.color}}">{{template_footer_text.text}}</span> <a href="{{template_footer_button_link.url}}" style="color:{{template_footer_button_link_color.color}}">{{template_footer_button_text.text}}</a></p>
18
+ </div>
19
+ <div class="modal-right">
20
+ <img src="{{template_image.media}}" alt="">
21
+ </div>
22
+ <button class="icon-button close-button">
23
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
24
+ <path d="M 25 3 C 12.86158 3 3 12.86158 3 25 C 3 37.13842 12.86158 47 25 47 C 37.13842 47 47 37.13842 47 25 C 47 12.86158 37.13842 3 25 3 z M 25 5 C 36.05754 5 45 13.94246 45 25 C 45 36.05754 36.05754 45 25 45 C 13.94246 45 5 36.05754 5 25 C 5 13.94246 13.94246 5 25 5 z M 16.990234 15.990234 A 1.0001 1.0001 0 0 0 16.292969 17.707031 L 23.585938 25 L 16.292969 32.292969 A 1.0001 1.0001 0 1 0 17.707031 33.707031 L 25 26.414062 L 32.292969 33.707031 A 1.0001 1.0001 0 1 0 33.707031 32.292969 L 26.414062 25 L 33.707031 17.707031 A 1.0001 1.0001 0 0 0 32.980469 15.990234 A 1.0001 1.0001 0 0 0 32.292969 16.292969 L 25 23.585938 L 17.707031 16.292969 A 1.0001 1.0001 0 0 0 16.990234 15.990234 z"></path>
25
+ </svg>
26
+ </button>
27
+ </div>
templates/popups/template-1.scss ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // out: template-1.css, compress: true, sourceMap: false, autoprefixer: last 5 versions, groupmedia: true
2
+ .popup-template {
3
+ .modal {
4
+ position: fixed;
5
+ left: 0;
6
+ bottom: 0;
7
+ width: 100%;
8
+ opacity:0;
9
+ z-index: -1;
10
+ visibility:hidden;
11
+ background: rgba(#000, 0.9);
12
+ display: flex;
13
+ flex-direction: column;
14
+ align-items: center;
15
+ justify-content: center;
16
+ height:100%;
17
+ z-index: 999;
18
+ transition:all 0.8ms;
19
+
20
+ &-container {
21
+ display: flex;
22
+ max-width: 720px;
23
+ width: 100%;
24
+ border-radius: 10px;
25
+ overflow: hidden;
26
+ position: absolute;
27
+ opacity: 0;
28
+ pointer-events: none;
29
+ transition-duration: 0.3s;
30
+ background: #fff;
31
+ transform: translateY(100px) scale(0.4);
32
+ }
33
+
34
+ &-title {
35
+ font-size: 26px;
36
+ margin: 0;
37
+ font-weight: 400;
38
+ color: #55311c;
39
+ }
40
+
41
+ &-desc {
42
+ margin: 6px 0 30px 0;
43
+ }
44
+
45
+ &-left {
46
+ padding: 40px 30px;
47
+ background: #fff;
48
+ flex: 1.5;
49
+ transition-duration: 0.5s;
50
+ transform: translateY(80px);
51
+ opacity: 0;
52
+ }
53
+
54
+ &-button {
55
+ color: darken(#8c7569, 5%);
56
+ font-family: "Nunito", sans-serif;
57
+ font-size: 18px;
58
+ cursor: pointer;
59
+ border: 0;
60
+ outline: 0;
61
+ padding: 10px 40px;
62
+ border-radius: 30px;
63
+ background: rgb(255, 255, 255);
64
+ box-shadow: 0 10px 40px rgba(0, 0, 0, 0.16);
65
+ transition: 0.3s;
66
+
67
+ &:hover {
68
+ border-color: rgba(255, 255, 255, 0.2);
69
+ background: rgba(#fff, 0.8);
70
+ }
71
+ }
72
+
73
+ &-right {
74
+ flex: 2;
75
+ font-size: 0;
76
+ transition: 0.3s;
77
+ overflow: hidden;
78
+
79
+ img {
80
+ width: 100%;
81
+ height: 100%;
82
+ transform: scale(2);
83
+ object-fit: cover;
84
+ transition-duration: 1.2s;
85
+ }
86
+ }
87
+
88
+ &.is-open {
89
+ background: rgba(#333, 0.85);
90
+ opacity:1;
91
+ z-index: 9999;
92
+ visibility:visible;
93
+ .modal-button {
94
+ opacity: 0;
95
+ }
96
+
97
+ .modal-container {
98
+ opacity: 1;
99
+ transition-duration: 0.6s;
100
+ pointer-events: auto;
101
+ transform: translateY(0) scale(1);
102
+ }
103
+
104
+ .modal-right img {
105
+ transform: scale(1);
106
+ }
107
+
108
+ .modal-left {
109
+ transform: translateY(0);
110
+ opacity: 1;
111
+ transition-delay: 0.1s;
112
+ }
113
+ }
114
+
115
+ &-buttons {
116
+ display: flex;
117
+ justify-content: space-between;
118
+ align-items: center;
119
+
120
+ a {
121
+ color: rgba(#333, 0.6);
122
+ font-size: 14px;
123
+ }
124
+ }
125
+ .icon-button {
126
+ outline: 0;
127
+ position: absolute;
128
+ right: 10px;
129
+ top: 12px;
130
+ width: 32px;
131
+ height: 32px;
132
+ border: 0;
133
+ background: 0;
134
+ padding: 0;
135
+ cursor: pointer;
136
+ }
137
+ }
138
+
139
+ @media (max-width: 750px) {
140
+ .modal-container {
141
+ width: 90%;
142
+ }
143
+
144
+ .modal-right {
145
+ display: none;
146
+ }
147
+ }
148
+ }
templates/popups/template-2.css ADDED
@@ -0,0 +1 @@
 
1
+ .popup-template .modal{position:fixed;left:0;bottom:0;width:100%;opacity:0;z-index:-1;visibility:hidden;background:rgba(0,0,0,.9);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;height:100%;z-index:999;-webkit-transition:all 0s;-o-transition:all 0s;transition:all 0s}.popup-template .modal-container{display:-webkit-box;display:-ms-flexbox;display:flex;max-width:720px;width:100%;border-radius:10px;overflow:hidden;position:absolute;opacity:0;pointer-events:none;-webkit-transition-duration:.3s;-o-transition-duration:.3s;transition-duration:.3s;background:#fff;-webkit-transform:translateY(100px) scale(.4);-ms-transform:translateY(100px) scale(.4);transform:translateY(100px) scale(.4)}.popup-template .modal-title{font-size:26px;margin:0;font-weight:400;color:#55311c}.popup-template .modal-desc{margin:6px 0 30px 0}.popup-template .modal-left,.popup-template .modal-right{padding:40px 30px;background:#fff;-webkit-box-flex:1.5;-ms-flex:1.5;flex:1.5;-webkit-transition-duration:.5s;-o-transition-duration:.5s;transition-duration:.5s;-webkit-transform:translateY(80px);-ms-transform:translateY(80px);transform:translateY(80px);opacity:0}.popup-template .modal-button{color:#7d695e;font-family:Nunito,sans-serif;font-size:18px;cursor:pointer;border:0;outline:0;padding:10px 40px;border-radius:30px;background:#fff;-webkit-box-shadow:0 10px 40px rgba(0,0,0,.16);box-shadow:0 10px 40px rgba(0,0,0,.16);-webkit-transition:.3s;-o-transition:.3s;transition:.3s}.popup-template .modal-button:hover{border-color:rgba(255,255,255,.2);background:rgba(255,255,255,.8)}.popup-template .modal.is-open{background:rgba(51,51,51,.85);opacity:1;z-index:9999;visibility:visible}.popup-template .modal.is-open .modal-button{opacity:0}.popup-template .modal.is-open .modal-container{opacity:1;-webkit-transition-duration:.6s;-o-transition-duration:.6s;transition-duration:.6s;pointer-events:auto;-webkit-transform:translateY(0) scale(1);-ms-transform:translateY(0) scale(1);transform:translateY(0) scale(1)}.popup-template .modal.is-open .modal-left,.popup-template .modal.is-open .modal-right{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);opacity:1;-webkit-transition-delay:.1s;-o-transition-delay:.1s;transition-delay:.1s}.popup-template .modal-buttons{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.popup-template .modal-buttons a{color:rgba(51,51,51,.6);font-size:14px}.popup-template .modal .icon-button{outline:0;position:absolute;right:10px;top:12px;width:32px;height:32px;border:0;background:0;padding:0;cursor:pointer}@media (max-width:750px){.popup-template .modal-container{width:90%}}
templates/popups/template-2.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Popup Template Name: 50-50 Text
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="modal-container">
10
+ <div class="modal-left">
11
+ <h2 class="modal-title">{{template_title_left.text}}</h2>
12
+ <p class="modal-desc">{{template_description_left.description}}</p>
13
+ <div class="modal-buttons">
14
+ <a href="{{template_button1_link.url}}" class="">{{template_button1_left.text}}</a>
15
+ </div>
16
+
17
+ <p class="sign-up">{{template_footer_text.text}} <a href="{{template_footer_button_link.url}}">{{template_footer_button_text_left.text}}</a></p>
18
+ </div>
19
+ <div class="modal-right">
20
+ <h2 class="modal-title">{{template_title_right.text}}</h2>
21
+ <p class="modal-desc">{{template_description_right.description}}</p>
22
+ <div class="modal-buttons">
23
+ <a href="{{template_button1_link.url}}" class="">{{template_button1_right.text}}</a>
24
+ </div>
25
+
26
+ <p class="sign-up">{{template_footer_text_right.text}} <a href="{{template_footer_button_link.url}}">{{template_footer_button_text_right.text}}</a></p>
27
+ </div>
28
+ <button class="icon-button close-button">
29
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
30
+ <path d="M 25 3 C 12.86158 3 3 12.86158 3 25 C 3 37.13842 12.86158 47 25 47 C 37.13842 47 47 37.13842 47 25 C 47 12.86158 37.13842 3 25 3 z M 25 5 C 36.05754 5 45 13.94246 45 25 C 45 36.05754 36.05754 45 25 45 C 13.94246 45 5 36.05754 5 25 C 5 13.94246 13.94246 5 25 5 z M 16.990234 15.990234 A 1.0001 1.0001 0 0 0 16.292969 17.707031 L 23.585938 25 L 16.292969 32.292969 A 1.0001 1.0001 0 1 0 17.707031 33.707031 L 25 26.414062 L 32.292969 33.707031 A 1.0001 1.0001 0 1 0 33.707031 32.292969 L 26.414062 25 L 33.707031 17.707031 A 1.0001 1.0001 0 0 0 32.980469 15.990234 A 1.0001 1.0001 0 0 0 32.292969 16.292969 L 25 23.585938 L 17.707031 16.292969 A 1.0001 1.0001 0 0 0 16.990234 15.990234 z"></path>
31
+ </svg>
32
+ </button>
33
+ </div>
templates/popups/template-2.scss ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // out: template-2.css, compress: true, sourceMap: false, autoprefixer: last 5 versions, groupmedia: true
2
+ .popup-template {
3
+ .modal {
4
+ position: fixed;
5
+ left: 0;
6
+ bottom: 0;
7
+ width: 100%;
8
+ opacity:0;
9
+ z-index: -1;
10
+ visibility:hidden;
11
+ background: rgba(#000, 0.9);
12
+ display: flex;
13
+ flex-direction: column;
14
+ align-items: center;
15
+ justify-content: center;
16
+ height:100%;
17
+ z-index: 999;
18
+ transition:all 0.8ms;
19
+
20
+ &-container {
21
+ display: flex;
22
+ max-width: 720px;
23
+ width: 100%;
24
+ border-radius: 10px;
25
+ overflow: hidden;
26
+ position: absolute;
27
+ opacity: 0;
28
+ pointer-events: none;
29
+ transition-duration: 0.3s;
30
+ background: #fff;
31
+ transform: translateY(100px) scale(0.4);
32
+ }
33
+
34
+ &-title {
35
+ font-size: 26px;
36
+ margin: 0;
37
+ font-weight: 400;
38
+ color: #55311c;
39
+ }
40
+
41
+ &-desc {
42
+ margin: 6px 0 30px 0;
43
+ }
44
+ &-right,
45
+ &-left {
46
+ padding: 40px 30px;
47
+ background: #fff;
48
+ flex: 1.5;
49
+ transition-duration: 0.5s;
50
+ transform: translateY(80px);
51
+ opacity: 0;
52
+ }
53
+
54
+ &-button {
55
+ color: darken(#8c7569, 5%);
56
+ font-family: "Nunito", sans-serif;
57
+ font-size: 18px;
58
+ cursor: pointer;
59
+ border: 0;
60
+ outline: 0;
61
+ padding: 10px 40px;
62
+ border-radius: 30px;
63
+ background: rgb(255, 255, 255);
64
+ box-shadow: 0 10px 40px rgba(0, 0, 0, 0.16);
65
+ transition: 0.3s;
66
+
67
+ &:hover {
68
+ border-color: rgba(255, 255, 255, 0.2);
69
+ background: rgba(#fff, 0.8);
70
+ }
71
+ }
72
+
73
+ &.is-open {
74
+ background: rgba(#333, 0.85);
75
+ opacity:1;
76
+ z-index: 9999;
77
+ visibility:visible;
78
+ .modal-button {
79
+ opacity: 0;
80
+ }
81
+
82
+ .modal-container {
83
+ opacity: 1;
84
+ transition-duration: 0.6s;
85
+ pointer-events: auto;
86
+ transform: translateY(0) scale(1);
87
+ }
88
+ .modal-right,
89
+ .modal-left {
90
+ transform: translateY(0);
91
+ opacity: 1;
92
+ transition-delay: 0.1s;
93
+ }
94
+ }
95
+
96
+ &-buttons {
97
+ display: flex;
98
+ justify-content: space-between;
99
+ align-items: center;
100
+
101
+ a {
102
+ color: rgba(#333, 0.6);
103
+ font-size: 14px;
104
+ }
105
+ }
106
+ .icon-button {
107
+ outline: 0;
108
+ position: absolute;
109
+ right: 10px;
110
+ top: 12px;
111
+ width: 32px;
112
+ height: 32px;
113
+ border: 0;
114
+ background: 0;
115
+ padding: 0;
116
+ cursor: pointer;
117
+ }
118
+ }
119
+
120
+ @media (max-width: 750px) {
121
+ .modal-container {
122
+ width: 90%;
123
+ }
124
+ }
125
+ }
templates/popups/template-3.css ADDED
@@ -0,0 +1 @@
 
1
+ .popup-template .modal{position:fixed;left:0;bottom:0;width:100%;opacity:0;z-index:-1;visibility:hidden;background:rgba(0,0,0,.9);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;height:100%;z-index:999;-webkit-transition:all 0s;-o-transition:all 0s;transition:all 0s}.popup-template .modal .modal-middle{background:rgba(255,255,255,.7);padding:10px;border-radius:10px}.popup-template .modal-container{display:-webkit-box;display:-ms-flexbox;display:flex;max-width:720px;width:100%;border-radius:10px;overflow:hidden;position:absolute;opacity:0;pointer-events:none;-webkit-transition-duration:.3s;-o-transition-duration:.3s;transition-duration:.3s;background:#fff;-webkit-transform:translateY(100px) scale(.4);-ms-transform:translateY(100px) scale(.4);transform:translateY(100px) scale(.4)}.popup-template .modal-title{font-size:26px;margin:0;font-weight:400;color:#55311c}.popup-template .modal-desc{margin:6px 0 30px 0}.popup-template .modal-button{color:#7d695e;font-family:Nunito,sans-serif;font-size:18px;cursor:pointer;border:0;outline:0;padding:10px 40px;border-radius:30px;background:#fff;-webkit-box-shadow:0 10px 40px rgba(0,0,0,.16);box-shadow:0 10px 40px rgba(0,0,0,.16);-webkit-transition:.3s;-o-transition:.3s;transition:.3s}.popup-template .modal-button:hover{border-color:rgba(255,255,255,.2);background:rgba(255,255,255,.8)}.popup-template .modal.is-open{background:rgba(51,51,51,.85);opacity:1;z-index:9999;visibility:visible}.popup-template .modal.is-open .modal-button{opacity:0}.popup-template .modal.is-open .modal-container{opacity:1;-webkit-transition-duration:.6s;-o-transition-duration:.6s;transition-duration:.6s;pointer-events:auto;-webkit-transform:translateY(0) scale(1);-ms-transform:translateY(0) scale(1);transform:translateY(0) scale(1);padding:40px}.popup-template .modal-buttons{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.popup-template .modal-buttons a{color:rgba(51,51,51,.6);font-size:14px}.popup-template .modal .icon-button{outline:0;position:absolute;right:10px;top:12px;width:32px;height:32px;border:0;background:0;padding:0;cursor:pointer}@media (max-width:750px){.popup-template .modal-container{width:90%}}
templates/popups/template-3.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Popup Template Name: Background Image
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <!-- Modal-->
10
+
11
+ <div class="modal-container" style="background-image:url('{{template_background_image.media}}')">
12
+ <div class="modal-middle">
13
+ <h2 class="modal-title">{{template_title_right.text}}</h2>
14
+ <p class="modal-desc">{{template_description_right.description}}</p>
15
+ <div class="modal-buttons">
16
+ <a href="{{template_button1_link.url}}" class="">{{template_button1_right.text}}</a>
17
+ </div>
18
+
19
+ <p class="sign-up">{{template_footer_text_right.text}} <a href="{{template_footer_button_link.url}}">{{template_footer_button_text_right.text}}</a></p>
20
+ </div>
21
+ <button class="icon-button close-button">
22
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
23
+ <path d="M 25 3 C 12.86158 3 3 12.86158 3 25 C 3 37.13842 12.86158 47 25 47 C 37.13842 47 47 37.13842 47 25 C 47 12.86158 37.13842 3 25 3 z M 25 5 C 36.05754 5 45 13.94246 45 25 C 45 36.05754 36.05754 45 25 45 C 13.94246 45 5 36.05754 5 25 C 5 13.94246 13.94246 5 25 5 z M 16.990234 15.990234 A 1.0001 1.0001 0 0 0 16.292969 17.707031 L 23.585938 25 L 16.292969 32.292969 A 1.0001 1.0001 0 1 0 17.707031 33.707031 L 25 26.414062 L 32.292969 33.707031 A 1.0001 1.0001 0 1 0 33.707031 32.292969 L 26.414062 25 L 33.707031 17.707031 A 1.0001 1.0001 0 0 0 32.980469 15.990234 A 1.0001 1.0001 0 0 0 32.292969 16.292969 L 25 23.585938 L 17.707031 16.292969 A 1.0001 1.0001 0 0 0 16.990234 15.990234 z"></path>
24
+ </svg>
25
+ </button>
26
+ </div>
27
+
28
+ <!--End of Modal -->
templates/popups/template-3.scss ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // out: template-3.css, compress: true, sourceMap: false, autoprefixer: last 5 versions, groupmedia: true
2
+ .popup-template {
3
+ .modal {
4
+ position: fixed;
5
+ left: 0;
6
+ bottom: 0;
7
+ width: 100%;
8
+ opacity:0;
9
+ z-index: -1;
10
+ visibility:hidden;
11
+ background: rgba(#000, 0.9);
12
+ display: flex;
13
+ flex-direction: column;
14
+ align-items: center;
15
+ justify-content: center;
16
+ height:100%;
17
+ z-index: 999;
18
+ transition:all 0.8ms;
19
+
20
+ .modal-middle {
21
+ background: rgba(255,255,255,0.7);
22
+ padding: 10px;
23
+ border-radius: 10px;
24
+ }
25
+
26
+ &-container {
27
+ display: flex;
28
+ max-width: 720px;
29
+ width: 100%;
30
+ border-radius: 10px;
31
+ overflow: hidden;
32
+ position: absolute;
33
+ opacity: 0;
34
+ pointer-events: none;
35
+ transition-duration: 0.3s;
36
+ background: #fff;
37
+ transform: translateY(100px) scale(0.4);
38
+ }
39
+
40
+ &-title {
41
+ font-size: 26px;
42
+ margin: 0;
43
+ font-weight: 400;
44
+ color: #55311c;
45
+ }
46
+
47
+ &-desc {
48
+ margin: 6px 0 30px 0;
49
+ }
50
+ &-button {
51
+ color: darken(#8c7569, 5%);
52
+ font-family: "Nunito", sans-serif;
53
+ font-size: 18px;
54
+ cursor: pointer;
55
+ border: 0;
56
+ outline: 0;
57
+ padding: 10px 40px;
58
+ border-radius: 30px;
59
+ background: rgb(255, 255, 255);
60
+ box-shadow: 0 10px 40px rgba(0, 0, 0, 0.16);
61
+ transition: 0.3s;
62
+
63
+ &:hover {
64
+ border-color: rgba(255, 255, 255, 0.2);
65
+ background: rgba(#fff, 0.8);
66
+ }
67
+ }
68
+ &.is-open {
69
+ background: rgba(#333, 0.85);
70
+ opacity:1;
71
+ z-index: 9999;
72
+ visibility:visible;
73
+ .modal-button {
74
+ opacity: 0;
75
+ }
76
+
77
+ .modal-container {
78
+ opacity: 1;
79
+ transition-duration: 0.6s;
80
+ pointer-events: auto;
81
+ transform: translateY(0) scale(1);
82
+ padding:40px;
83
+ }
84
+ }
85
+
86
+ &-buttons {
87
+ display: flex;
88
+ justify-content: space-between;
89
+ align-items: center;
90
+
91
+ a {
92
+ color: rgba(#333, 0.6);
93
+ font-size: 14px;
94
+ }
95
+ }
96
+ .icon-button {
97
+ outline: 0;
98
+ position: absolute;
99
+ right: 10px;
100
+ top: 12px;
101
+ width: 32px;
102
+ height: 32px;
103
+ border: 0;
104
+ background: 0;
105
+ padding: 0;
106
+ cursor: pointer;
107
+ }
108
+ }
109
+
110
+ @media (max-width: 750px) {
111
+ .modal-container {
112
+ width: 90%;
113
+ }
114
+ }
115
+ }
templates/popups/template-4.css ADDED
@@ -0,0 +1,289 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .template-4 .is-open {
2
+ overflow: hidden;
3
+ }
4
+
5
+ .template-4 .is-open .modal {
6
+ overflow-x: hidden;
7
+ overflow-y: auto;
8
+ }
9
+
10
+ .template-4 .btn.btn-primary {
11
+ color: #FFFFFF;
12
+ background-color: #3699FF;
13
+ border-color: #3699FF;
14
+ }
15
+
16
+ .template-4 .modal {
17
+ position: fixed;
18
+ top: 0;
19
+ left: 0;
20
+ z-index: 1050;
21
+ display: none;
22
+ width: 100%;
23
+ height: 100%;
24
+ overflow: hidden;
25
+ outline: 0;
26
+ background: rgba(0, 0, 0, 0.9);
27
+ z-index: 999;
28
+ }
29
+
30
+ .template-4 .modal.is-open {
31
+ display: block;
32
+ }
33
+
34
+ .template-4 .icon-button {
35
+ outline: 0;
36
+ position: absolute;
37
+ right: 10px;
38
+ top: 12px;
39
+ width: 32px;
40
+ height: 32px;
41
+ border: 0;
42
+ background: 0;
43
+ padding: 0;
44
+ cursor: pointer;
45
+ }
46
+
47
+ .template-4 .modal-dialog {
48
+ position: relative;
49
+ width: auto;
50
+ margin: 0.5rem;
51
+ pointer-events: none;
52
+ }
53
+
54
+ .template-4 .modal.fade .modal-dialog {
55
+ -webkit-transition: -webkit-transform 0.3s ease-out;
56
+ transition: -webkit-transform 0.3s ease-out;
57
+ transition: transform 0.3s ease-out;
58
+ transition: transform 0.3s ease-out, -webkit-transform 0.3s ease-out;
59
+ -webkit-transform: translate(0, -50px);
60
+ transform: translate(0, -50px);
61
+ }
62
+
63
+ .template-4 .modal.is-open .modal-dialog {
64
+ -webkit-transform: none;
65
+ transform: none;
66
+ }
67
+
68
+ .template-4 .modal.modal-static .modal-dialog {
69
+ -webkit-transform: scale(1.02);
70
+ transform: scale(1.02);
71
+ }
72
+
73
+ .template-4 .modal-dialog-scrollable {
74
+ display: -webkit-box;
75
+ display: -ms-flexbox;
76
+ display: flex;
77
+ max-height: calc(100% - 1rem);
78
+ }
79
+
80
+ .template-4 .modal-dialog-scrollable .modal-content {
81
+ max-height: calc(100vh - 1rem);
82
+ overflow: hidden;
83
+ }
84
+
85
+ .template-4 .modal-dialog-scrollable .modal-header {
86
+ -ms-flex-negative: 0;
87
+ flex-shrink: 0;
88
+ }
89
+
90
+ .template-4 .modal-dialog-scrollable .modal-footer {
91
+ -ms-flex-negative: 0;
92
+ flex-shrink: 0;
93
+ }
94
+
95
+ .template-4 .modal-dialog-scrollable .modal-body {
96
+ overflow-y: auto;
97
+ }
98
+
99
+ .template-4 .modal-dialog-centered {
100
+ display: -webkit-box;
101
+ display: -ms-flexbox;
102
+ display: flex;
103
+ -webkit-box-align: center;
104
+ -ms-flex-align: center;
105
+ align-items: center;
106
+ min-height: calc(100% - 1rem);
107
+ }
108
+
109
+ .template-4 .modal-dialog-centered::before {
110
+ display: block;
111
+ height: calc(100vh - 1rem);
112
+ height: -webkit-min-content;
113
+ height: -moz-min-content;
114
+ height: min-content;
115
+ content: "";
116
+ }
117
+
118
+ .template-4 .modal-dialog-centered.modal-dialog-scrollable {
119
+ -webkit-box-orient: vertical;
120
+ -webkit-box-direction: normal;
121
+ -ms-flex-direction: column;
122
+ flex-direction: column;
123
+ -webkit-box-pack: center;
124
+ -ms-flex-pack: center;
125
+ justify-content: center;
126
+ height: 100%;
127
+ }
128
+
129
+ .template-4 .modal-dialog-centered.modal-dialog-scrollable .modal-content {
130
+ max-height: none;
131
+ }
132
+
133
+ .template-4 .modal-dialog-centered.modal-dialog-scrollable::before {
134
+ content: none;
135
+ }
136
+
137
+ .template-4 .modal-content {
138
+ position: relative;
139
+ display: -webkit-box;
140
+ display: -ms-flexbox;
141
+ display: flex;
142
+ -webkit-box-orient: vertical;
143
+ -webkit-box-direction: normal;
144
+ -ms-flex-direction: column;
145
+ flex-direction: column;
146
+ width: 100%;
147
+ pointer-events: auto;
148
+ background-color: #ffffff;
149
+ background-clip: padding-box;
150
+ border: 0 solid rgba(0, 0, 0, 0.2);
151
+ border-radius: 0.42rem;
152
+ -webkit-box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
153
+ box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
154
+ outline: 0;
155
+ }
156
+
157
+ .template-4 .modal-backdrop {
158
+ position: fixed;
159
+ top: 0;
160
+ left: 0;
161
+ z-index: 1040;
162
+ width: 100vw;
163
+ height: 100vh;
164
+ background-color: #000000;
165
+ }
166
+
167
+ .template-4 .modal-backdrop.fade {
168
+ opacity: 0;
169
+ }
170
+
171
+ .template-4 .modal-backdrop.is-open {
172
+ opacity: 0.2;
173
+ }
174
+
175
+ .template-4 .modal-header {
176
+ display: -webkit-box;
177
+ display: -ms-flexbox;
178
+ display: flex;
179
+ -webkit-box-align: start;
180
+ -ms-flex-align: start;
181
+ align-items: flex-start;
182
+ -webkit-box-pack: justify;
183
+ -ms-flex-pack: justify;
184
+ justify-content: space-between;
185
+ padding: 1.5rem 1.75rem;
186
+ border-bottom: 1px solid #EBEDF3;
187
+ border-top-left-radius: 0.42rem;
188
+ border-top-right-radius: 0.42rem;
189
+ }
190
+
191
+ .template-4 .modal-header .close {
192
+ padding: 1.5rem 1.75rem;
193
+ margin: -1.5rem -1.75rem -1.5rem auto;
194
+ }
195
+
196
+ .template-4 .modal-title {
197
+ margin-bottom: 0;
198
+ line-height: 1.5;
199
+ font-weight: bold;
200
+ }
201
+
202
+ .template-4 .modal-body {
203
+ position: relative;
204
+ -webkit-box-flex: 1;
205
+ -ms-flex: 1 1 auto;
206
+ flex: 1 1 auto;
207
+ padding: 1.75rem;
208
+ }
209
+
210
+ .template-4 .modal-footer {
211
+ display: -webkit-box;
212
+ display: -ms-flexbox;
213
+ display: flex;
214
+ -ms-flex-wrap: wrap;
215
+ flex-wrap: wrap;
216
+ -webkit-box-align: center;
217
+ -ms-flex-align: center;
218
+ align-items: center;
219
+ -webkit-box-pack: end;
220
+ -ms-flex-pack: end;
221
+ justify-content: flex-end;
222
+ padding: 1.5rem;
223
+ border-top: 1px solid #EBEDF3;
224
+ border-bottom-right-radius: 0.42rem;
225
+ border-bottom-left-radius: 0.42rem;
226
+ }
227
+
228
+ .template-4 .modal-footer > * {
229
+ margin: 0.25rem;
230
+ }
231
+
232
+ .template-4 .modal-scrollbar-measure {
233
+ position: absolute;
234
+ top: -9999px;
235
+ width: 50px;
236
+ height: 50px;
237
+ overflow: scroll;
238
+ }
239
+
240
+ @media (prefers-reduced-motion: reduce) {
241
+ .template-4 .modal.fade .modal-dialog {
242
+ -webkit-transition: none;
243
+ transition: none;
244
+ }
245
+ }
246
+
247
+ @media (min-width: 576px) {
248
+ .template-4 .modal-dialog {
249
+ max-width: 500px;
250
+ margin: 1.75rem auto;
251
+ }
252
+ .template-4 .modal-dialog-scrollable {
253
+ max-height: calc(100% - 3.5rem);
254
+ }
255
+ .template-4 .modal-dialog-scrollable .modal-content {
256
+ max-height: calc(100vh - 3.5rem);
257
+ }
258
+ .template-4 .modal-dialog-centered {
259
+ min-height: calc(100% - 3.5rem);
260
+ }
261
+ .template-4 .modal-dialog-centered::before {
262
+ height: calc(100vh - 3.5rem);
263
+ height: -webkit-min-content;
264
+ height: -moz-min-content;
265
+ height: min-content;
266
+ }
267
+ .template-4 .modal-content {
268
+ -webkit-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
269
+ box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
270
+ }
271
+ .template-4 .modal-sm {
272
+ max-width: 300px;
273
+ }
274
+ }
275
+
276
+ @media (min-width: 992px) {
277
+ .template-4 .modal-lg {
278
+ max-width: 800px;
279
+ }
280
+ .template-4 .modal-xl {
281
+ max-width: 800px;
282
+ }
283
+ }
284
+
285
+ @media (min-width: 1200px) {
286
+ .template-4 .modal-xl {
287
+ max-width: 1140px;
288
+ }
289
+ }
templates/popups/template-4.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Popup Template Name: Blank Template
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <!-- Modal-->
10
+
11
+ <div class="modal-dialog modal-dialog-scrollable" role="document">
12
+ <div class="modal-content">
13
+ <div class="modal-header">
14
+ <button class="icon-button close-button">
15
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
16
+ <path d="M 25 3 C 12.86158 3 3 12.86158 3 25 C 3 37.13842 12.86158 47 25 47 C 37.13842 47 47 37.13842 47 25 C 47 12.86158 37.13842 3 25 3 z M 25 5 C 36.05754 5 45 13.94246 45 25 C 45 36.05754 36.05754 45 25 45 C 13.94246 45 5 36.05754 5 25 C 5 13.94246 13.94246 5 25 5 z M 16.990234 15.990234 A 1.0001 1.0001 0 0 0 16.292969 17.707031 L 23.585938 25 L 16.292969 32.292969 A 1.0001 1.0001 0 1 0 17.707031 33.707031 L 25 26.414062 L 32.292969 33.707031 A 1.0001 1.0001 0 1 0 33.707031 32.292969 L 26.414062 25 L 33.707031 17.707031 A 1.0001 1.0001 0 0 0 32.980469 15.990234 A 1.0001 1.0001 0 0 0 32.292969 16.292969 L 25 23.585938 L 17.707031 16.292969 A 1.0001 1.0001 0 0 0 16.990234 15.990234 z"></path>
17
+ </svg>
18
+ </button>
19
+ </div>
20
+ <div class="modal-body" style="height: 300px;">
21
+ {{template_content.description}}
22
+ </div>
23
+ </div>
24
+ </div>
25
+
26
+ <!--End of Modal -->
templates/popups/template-4.scss ADDED
@@ -0,0 +1,301 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .template-4 {
2
+ .is-open {
3
+ overflow: hidden;
4
+ .modal {
5
+ overflow-x: hidden;
6
+ overflow-y: auto;
7
+ }
8
+ }
9
+ .btn.btn-primary {
10
+ color: #FFFFFF;
11
+ background-color: #3699FF;
12
+ border-color: #3699FF;
13
+ }
14
+ .modal {
15
+ position: fixed;
16
+ top: 0;
17
+ left: 0;
18
+ z-index: 1050;
19
+ display: none;
20
+ width: 100%;
21
+ height: 100%;
22
+ overflow: hidden;
23
+ outline: 0;
24
+ background:rgba(0,0,0,0.9);
25
+ z-index: 999;
26
+ &.is-open{
27
+ display:block;
28
+ }
29
+ }
30
+ .icon-button {
31
+ outline: 0;
32
+ position: absolute;
33
+ right: 10px;
34
+ top: 12px;
35
+ width: 32px;
36
+ height: 32px;
37
+ border: 0;
38
+ background: 0;
39
+ padding: 0;
40
+ cursor: pointer;
41
+ }
42
+ .modal-dialog {
43
+ position: relative;
44
+ width: auto;
45
+ margin: 0.5rem;
46
+ pointer-events: none;
47
+ }
48
+
49
+ .modal.fade {
50
+ .modal-dialog {
51
+ -webkit-transition: -webkit-transform 0.3s ease-out;
52
+ transition: -webkit-transform 0.3s ease-out;
53
+ transition: transform 0.3s ease-out;
54
+ transition: transform 0.3s ease-out, -webkit-transform 0.3s ease-out;
55
+ -webkit-transform: translate(0, -50px);
56
+ transform: translate(0, -50px);
57
+ }
58
+ }
59
+
60
+ .modal.is-open {
61
+ .modal-dialog {
62
+ -webkit-transform: none;
63
+ transform: none;
64
+ }
65
+ }
66
+
67
+ .modal.modal-static {
68
+ .modal-dialog {
69
+ -webkit-transform: scale(1.02);
70
+ transform: scale(1.02);
71
+ }
72
+ }
73
+
74
+ .modal-dialog-scrollable {
75
+ display: -webkit-box;
76
+ display: -ms-flexbox;
77
+ display: flex;
78
+ max-height: calc(100% - 1rem);
79
+
80
+ .modal-content {
81
+ max-height: calc(100vh - 1rem);
82
+ overflow: hidden;
83
+ }
84
+
85
+ .modal-header {
86
+ -ms-flex-negative: 0;
87
+ flex-shrink: 0;
88
+ }
89
+
90
+ .modal-footer {
91
+ -ms-flex-negative: 0;
92
+ flex-shrink: 0;
93
+ }
94
+
95
+ .modal-body {
96
+ overflow-y: auto;
97
+ }
98
+ }
99
+
100
+ .modal-dialog-centered {
101
+ display: -webkit-box;
102
+ display: -ms-flexbox;
103
+ display: flex;
104
+ -webkit-box-align: center;
105
+ -ms-flex-align: center;
106
+ align-items: center;
107
+ min-height: calc(100% - 1rem);
108
+
109
+ &::before {
110
+ display: block;
111
+ height: calc(100vh - 1rem);
112
+ height: -webkit-min-content;
113
+ height: -moz-min-content;
114
+ height: min-content;
115
+ content: "";
116
+ }
117
+ }
118
+
119
+ .modal-dialog-centered.modal-dialog-scrollable {
120
+ -webkit-box-orient: vertical;
121
+ -webkit-box-direction: normal;
122
+ -ms-flex-direction: column;
123
+ flex-direction: column;
124
+ -webkit-box-pack: center;
125
+ -ms-flex-pack: center;
126
+ justify-content: center;
127
+ height: 100%;
128
+
129
+ .modal-content {
130
+ max-height: none;
131
+ }
132
+
133
+ &::before {
134
+ content: none;
135
+ }
136
+ }
137
+
138
+ .modal-content {
139
+ position: relative;
140
+ display: -webkit-box;
141
+ display: -ms-flexbox;
142
+ display: flex;
143
+ -webkit-box-orient: vertical;
144
+ -webkit-box-direction: normal;
145
+ -ms-flex-direction: column;
146
+ flex-direction: column;
147
+ width: 100%;
148
+ pointer-events: auto;
149
+ background-color: #ffffff;
150
+ background-clip: padding-box;
151
+ border: 0 solid rgba(0, 0, 0, 0.2);
152
+ border-radius: 0.42rem;
153
+ -webkit-box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
154
+ box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
155
+ outline: 0;
156
+ }
157
+
158
+ .modal-backdrop {
159
+ position: fixed;
160
+ top: 0;
161
+ left: 0;
162
+ z-index: 1040;
163
+ width: 100vw;
164
+ height: 100vh;
165
+ background-color: #000000;
166
+ }
167
+
168
+ .modal-backdrop.fade {
169
+ opacity: 0;
170
+ }
171
+
172
+ .modal-backdrop.is-open {
173
+ opacity: 0.2;
174
+ }
175
+
176
+ .modal-header {
177
+ display: -webkit-box;
178
+ display: -ms-flexbox;
179
+ display: flex;
180
+ -webkit-box-align: start;
181
+ -ms-flex-align: start;
182
+ align-items: flex-start;
183
+ -webkit-box-pack: justify;
184
+ -ms-flex-pack: justify;
185
+ justify-content: space-between;
186
+ padding: 1.5rem 1.75rem;
187
+ border-bottom: 1px solid #EBEDF3;
188
+ border-top-left-radius: 0.42rem;
189
+ border-top-right-radius: 0.42rem;
190
+
191
+ .close {
192
+ padding: 1.5rem 1.75rem;
193
+ margin: -1.5rem -1.75rem -1.5rem auto;
194
+ }
195
+ }
196
+
197
+ .modal-title {
198
+ margin-bottom: 0;
199
+ line-height: 1.5;
200
+ font-weight: bold;
201
+ }
202
+
203
+ .modal-body {
204
+ position: relative;
205
+ -webkit-box-flex: 1;
206
+ -ms-flex: 1 1 auto;
207
+ flex: 1 1 auto;
208
+ padding: 1.75rem;
209
+ }
210
+
211
+ .modal-footer {
212
+ display: -webkit-box;
213
+ display: -ms-flexbox;
214
+ display: flex;
215
+ -ms-flex-wrap: wrap;
216
+ flex-wrap: wrap;
217
+ -webkit-box-align: center;
218
+ -ms-flex-align: center;
219
+ align-items: center;
220
+ -webkit-box-pack: end;
221
+ -ms-flex-pack: end;
222
+ justify-content: flex-end;
223
+ padding: 1.5rem;
224
+ border-top: 1px solid #EBEDF3;
225
+ border-bottom-right-radius: 0.42rem;
226
+ border-bottom-left-radius: 0.42rem;
227
+
228
+ >* {
229
+ margin: 0.25rem;
230
+ }
231
+ }
232
+
233
+ .modal-scrollbar-measure {
234
+ position: absolute;
235
+ top: -9999px;
236
+ width: 50px;
237
+ height: 50px;
238
+ overflow: scroll;
239
+ }
240
+
241
+ @media (prefers-reduced-motion: reduce) {
242
+ .modal.fade {
243
+ .modal-dialog {
244
+ -webkit-transition: none;
245
+ transition: none;
246
+ }
247
+ }
248
+ }
249
+
250
+ @media (min-width: 576px) {
251
+ .modal-dialog {
252
+ max-width: 500px;
253
+ margin: 1.75rem auto;
254
+ }
255
+
256
+ .modal-dialog-scrollable {
257
+ max-height: calc(100% - 3.5rem);
258
+
259
+ .modal-content {
260
+ max-height: calc(100vh - 3.5rem);
261
+ }
262
+ }
263
+
264
+ .modal-dialog-centered {
265
+ min-height: calc(100% - 3.5rem);
266
+
267
+ &::before {
268
+ height: calc(100vh - 3.5rem);
269
+ height: -webkit-min-content;
270
+ height: -moz-min-content;
271
+ height: min-content;
272
+ }
273
+ }
274
+
275
+ .modal-content {
276
+ -webkit-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
277
+ box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
278
+ }
279
+
280
+ .modal-sm {
281
+ max-width: 300px;
282
+ }
283
+ }
284
+
285
+ @media (min-width: 992px) {
286
+ .modal-lg {
287
+ max-width: 800px;
288
+ }
289
+
290
+ .modal-xl {
291
+ max-width: 800px;
292
+ }
293
+ }
294
+
295
+ @media (min-width: 1200px) {
296
+ .modal-xl {
297
+ max-width: 1140px;
298
+ }
299
+ }
300
+
301
+ }
templates/popups/wpcfr-popup-wrap-default.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+ ?>
6
+ <div class="wpcfr-2-rows">
7
+ <div class="wpcfr-row">
8
+ Our team is processing your request!
9
+ </div>
10
+ <div class="wpcfr-row">
11
+ Some content
12
+ </div>
13
+ </div>
templates/save-form.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Please save your form message
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <fieldset>
10
+ <div class="fields-wrap field-wrap-page-id">
11
+ <div class="tab-wrap">
12
+ <div class="wpcf7r-tab-wrap-inner">
13
+ <div data-tab-inner>
14
+ <h3>
15
+ <?php _e( 'Please save your form', 'wpcf7-redirect' ); ?>
16
+ </h3>
17
+ </div>
18
+ </div>
19
+ </div>
20
+ </div>
21
+ </fieldset>
templates/settings.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Displays the settings panel
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ wp_nonce_field( 'wpcf7_redirect_page_metaboxes', 'wpcf7_redirect_page_metaboxes_nonce' );
9
+
10
+ do_action( 'before_redirect_settings_tab_title', $this->cf7_post );
11
+ ?>
12
+
13
+ <fieldset>
14
+ <div class="fields-wrap field-wrap-page-id">
15
+ <div class="tab-wrap">
16
+ <div class="wpcf7r-tab-wrap-inner">
17
+ <div data-tab-inner>
18
+ <div class="qs-row">
19
+ <?php include( 'default-settings.php' ); ?>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ </fieldset>
26
+
27
+ <?php
28
+ do_action( 'after_redirect_settings_tab_form', $this->cf7_post );
vendor/autoload.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload.php @generated by Composer
4
+
5
+ require_once __DIR__ . '/composer/autoload_real.php';
6
+
7
+ return ComposerAutoloaderInitdd4fead45e0fa114c2c94d387fded5f6::getLoader();
vendor/composer/ClassLoader.php ADDED
@@ -0,0 +1,445 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of Composer.
5
+ *
6
+ * (c) Nils Adermann <naderman@naderman.de>
7
+ * Jordi Boggiano <j.boggiano@seld.be>
8
+ *
9
+ * For the full copyright and license information, please view the LICENSE
10
+ * file that was distributed with this source code.
11
+ */
12
+
13
+ namespace Composer\Autoload;
14
+
15
+ /**
16
+ * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
17
+ *
18
+ * $loader = new \Composer\Autoload\ClassLoader();
19
+ *
20
+ * // register classes with namespaces
21
+ * $loader->add('Symfony\Component', __DIR__.'/component');
22
+ * $loader->add('Symfony', __DIR__.'/framework');
23
+ *
24
+ * // activate the autoloader
25
+ * $loader->register();
26
+ *
27
+ * // to enable searching the include path (eg. for PEAR packages)
28
+ * $loader->setUseIncludePath(true);
29
+ *
30
+ * In this example, if you try to use a class in the Symfony\Component
31
+ * namespace or one of its children (Symfony\Component\Console for instance),
32
+ * the autoloader will first look for the class under the component/
33
+ * directory, and it will then fallback to the framework/ directory if not
34
+ * found before giving up.
35
+ *
36
+ * This class is loosely based on the Symfony UniversalClassLoader.
37
+ *
38
+ * @author Fabien Potencier <fabien@symfony.com>
39
+ * @author Jordi Boggiano <j.boggiano@seld.be>
40
+ * @see http://www.php-fig.org/psr/psr-0/
41
+ * @see http://www.php-fig.org/psr/psr-4/
42
+ */
43
+ class ClassLoader
44
+ {
45
+ // PSR-4
46
+ private $prefixLengthsPsr4 = array();
47
+ private $prefixDirsPsr4 = array();
48
+ private $fallbackDirsPsr4 = array();
49
+
50
+ // PSR-0
51
+ private $prefixesPsr0 = array();
52
+ private $fallbackDirsPsr0 = array();
53
+
54
+ private $useIncludePath = false;
55
+ private $classMap = array();
56
+ private $classMapAuthoritative = false;
57
+ private $missingClasses = array();
58
+ private $apcuPrefix;
59
+
60
+ public function getPrefixes()
61
+ {
62
+ if (!empty($this->prefixesPsr0)) {
63
+ return call_user_func_array('array_merge', $this->prefixesPsr0);
64
+ }
65
+
66
+ return array();
67
+ }
68
+
69
+ public function getPrefixesPsr4()
70
+ {
71
+ return $this->prefixDirsPsr4;
72
+ }
73
+
74
+ public function getFallbackDirs()
75
+ {
76
+ return $this->fallbackDirsPsr0;
77
+ }
78
+
79
+ public function getFallbackDirsPsr4()
80
+ {
81
+ return $this->fallbackDirsPsr4;
82
+ }
83
+
84
+ public function getClassMap()
85
+ {
86
+ return $this->classMap;
87
+ }
88
+
89
+ /**
90
+ * @param array $classMap Class to filename map
91
+ */
92
+ public function addClassMap(array $classMap)
93
+ {
94
+ if ($this->classMap) {
95
+ $this->classMap = array_merge($this->classMap, $classMap);
96
+ } else {
97
+ $this->classMap = $classMap;
98
+ }
99
+ }
100
+
101
+ /**
102
+ * Registers a set of PSR-0 directories for a given prefix, either
103
+ * appending or prepending to the ones previously set for this prefix.
104
+ *
105
+ * @param string $prefix The prefix
106
+ * @param array|string $paths The PSR-0 root directories
107
+ * @param bool $prepend Whether to prepend the directories
108
+ */
109
+ public function add($prefix, $paths, $prepend = false)
110
+ {
111
+ if (!$prefix) {
112
+ if ($prepend) {
113
+ $this->fallbackDirsPsr0 = array_merge(
114
+ (array) $paths,
115
+ $this->fallbackDirsPsr0
116
+ );
117
+ } else {
118
+ $this->fallbackDirsPsr0 = array_merge(
119
+ $this->fallbackDirsPsr0,
120
+ (array) $paths
121
+ );
122
+ }
123
+
124
+ return;
125
+ }
126
+
127
+ $first = $prefix[0];
128
+ if (!isset($this->prefixesPsr0[$first][$prefix])) {
129
+ $this->prefixesPsr0[$first][$prefix] = (array) $paths;
130
+
131
+ return;
132
+ }
133
+ if ($prepend) {
134
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
135
+ (array) $paths,
136
+ $this->prefixesPsr0[$first][$prefix]
137
+ );
138
+ } else {
139
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
140
+ $this->prefixesPsr0[$first][$prefix],
141
+ (array) $paths
142
+ );
143
+ }
144
+ }
145
+
146
+ /**
147
+ * Registers a set of PSR-4 directories for a given namespace, either
148
+ * appending or prepending to the ones previously set for this namespace.
149
+ *
150
+ * @param string $prefix The prefix/namespace, with trailing '\\'
151
+ * @param array|string $paths The PSR-4 base directories
152
+ * @param bool $prepend Whether to prepend the directories
153
+ *
154
+ * @throws \InvalidArgumentException
155
+ */
156
+ public function addPsr4($prefix, $paths, $prepend = false)
157
+ {
158
+ if (!$prefix) {
159
+ // Register directories for the root namespace.
160
+ if ($prepend) {
161
+ $this->fallbackDirsPsr4 = array_merge(
162
+ (array) $paths,
163
+ $this->fallbackDirsPsr4
164
+ );
165
+ } else {
166
+ $this->fallbackDirsPsr4 = array_merge(
167
+ $this->fallbackDirsPsr4,
168
+ (array) $paths
169
+ );
170
+ }
171
+ } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
172
+ // Register directories for a new namespace.
173
+ $length = strlen($prefix);
174
+ if ('\\' !== $prefix[$length - 1]) {
175
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
176
+ }
177
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
178
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
179
+ } elseif ($prepend) {
180
+ // Prepend directories for an already registered namespace.
181
+ $this->prefixDirsPsr4[$prefix] = array_merge(
182
+ (array) $paths,
183
+ $this->prefixDirsPsr4[$prefix]
184
+ );
185
+ } else {
186
+ // Append directories for an already registered namespace.
187
+ $this->prefixDirsPsr4[$prefix] = array_merge(
188
+ $this->prefixDirsPsr4[$prefix],
189
+ (array) $paths
190
+ );
191
+ }
192
+ }
193
+
194
+ /**
195
+ * Registers a set of PSR-0 directories for a given prefix,
196
+ * replacing any others previously set for this prefix.
197
+ *
198
+ * @param string $prefix The prefix
199
+ * @param array|string $paths The PSR-0 base directories
200
+ */
201
+ public function set($prefix, $paths)
202
+ {
203
+ if (!$prefix) {
204
+ $this->fallbackDirsPsr0 = (array) $paths;
205
+ } else {
206
+ $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
207
+ }
208
+ }
209
+
210
+ /**
211
+ * Registers a set of PSR-4 directories for a given namespace,
212
+ * replacing any others previously set for this namespace.
213
+ *
214
+ * @param string $prefix The prefix/namespace, with trailing '\\'
215
+ * @param array|string $paths The PSR-4 base directories
216
+ *
217
+ * @throws \InvalidArgumentException
218
+ */
219
+ public function setPsr4($prefix, $paths)
220
+ {
221
+ if (!$prefix) {
222
+ $this->fallbackDirsPsr4 = (array) $paths;
223
+ } else {
224
+ $length = strlen($prefix);
225
+ if ('\\' !== $prefix[$length - 1]) {
226
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
227
+ }
228
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
229
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
230
+ }
231
+ }
232
+
233
+ /**
234
+ * Turns on searching the include path for class files.
235
+ *
236
+ * @param bool $useIncludePath
237
+ */
238
+ public function setUseIncludePath($useIncludePath)
239
+ {
240
+ $this->useIncludePath = $useIncludePath;
241
+ }
242
+
243
+ /**
244
+ * Can be used to check if the autoloader uses the include path to check
245
+ * for classes.
246
+ *
247
+ * @return bool
248
+ */
249
+ public function getUseIncludePath()
250
+ {
251
+ return $this->useIncludePath;
252
+ }
253
+
254
+ /**
255
+ * Turns off searching the prefix and fallback directories for classes
256
+ * that have not been registered with the class map.
257
+ *
258
+ * @param bool $classMapAuthoritative
259
+ */
260
+ public function setClassMapAuthoritative($classMapAuthoritative)
261
+ {
262
+ $this->classMapAuthoritative = $classMapAuthoritative;
263
+ }
264
+
265
+ /**
266
+ * Should class lookup fail if not found in the current class map?
267
+ *
268
+ * @return bool
269
+ */
270
+ public function isClassMapAuthoritative()
271
+ {
272
+ return $this->classMapAuthoritative;
273
+ }
274
+
275
+ /**
276
+ * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
277
+ *
278
+ * @param string|null $apcuPrefix
279
+ */
280
+ public function setApcuPrefix($apcuPrefix)
281
+ {
282
+ $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
283
+ }
284
+
285
+ /**
286
+ * The APCu prefix in use, or null if APCu caching is not enabled.
287
+ *
288
+ * @return string|null
289
+ */
290
+ public function getApcuPrefix()
291
+ {
292
+ return $this->apcuPrefix;
293
+ }
294
+
295
+ /**
296
+ * Registers this instance as an autoloader.
297
+ *
298
+ * @param bool $prepend Whether to prepend the autoloader or not
299
+ */
300
+ public function register($prepend = false)
301
+ {
302
+ spl_autoload_register(array($this, 'loadClass'), true, $prepend);
303
+ }
304
+
305
+ /**
306
+ * Unregisters this instance as an autoloader.
307
+ */
308
+ public function unregister()
309
+ {
310
+ spl_autoload_unregister(array($this, 'loadClass'));
311
+ }
312
+
313
+ /**
314
+ * Loads the given class or interface.
315
+ *
316
+ * @param string $class The name of the class
317
+ * @return bool|null True if loaded, null otherwise
318
+ */
319
+ public function loadClass($class)
320
+ {
321
+ if ($file = $this->findFile($class)) {
322
+ includeFile($file);
323
+
324
+ return true;
325
+ }
326
+ }
327
+
328
+ /**
329
+ * Finds the path to the file where the class is defined.
330
+ *
331
+ * @param string $class The name of the class
332
+ *
333
+ * @return string|false The path if found, false otherwise
334
+ */
335
+ public function findFile($class)
336
+ {
337
+ // class map lookup
338
+ if (isset($this->classMap[$class])) {
339
+ return $this->classMap[$class];
340
+ }
341
+ if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
342
+ return false;
343
+ }
344
+ if (null !== $this->apcuPrefix) {
345
+ $file = apcu_fetch($this->apcuPrefix.$class, $hit);
346
+ if ($hit) {
347
+ return $file;
348
+ }
349
+ }
350
+
351
+ $file = $this->findFileWithExtension($class, '.php');
352
+
353
+ // Search for Hack files if we are running on HHVM
354
+ if (false === $file && defined('HHVM_VERSION')) {
355
+ $file = $this->findFileWithExtension($class, '.hh');
356
+ }
357
+
358
+ if (null !== $this->apcuPrefix) {
359
+ apcu_add($this->apcuPrefix.$class, $file);
360
+ }
361
+
362
+ if (false === $file) {
363
+ // Remember that this class does not exist.
364
+ $this->missingClasses[$class] = true;
365
+ }
366
+
367
+ return $file;
368
+ }
369
+
370
+ private function findFileWithExtension($class, $ext)
371
+ {
372
+ // PSR-4 lookup
373
+ $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
374
+
375
+ $first = $class[0];
376
+ if (isset($this->prefixLengthsPsr4[$first])) {
377
+ $subPath = $class;
378
+ while (false !== $lastPos = strrpos($subPath, '\\')) {
379
+ $subPath = substr($subPath, 0, $lastPos);
380
+ $search = $subPath . '\\';
381
+ if (isset($this->prefixDirsPsr4[$search])) {
382
+ $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
383
+ foreach ($this->prefixDirsPsr4[$search] as $dir) {
384
+ if (file_exists($file = $dir . $pathEnd)) {
385
+ return $file;
386
+ }
387
+ }
388
+ }
389
+ }
390
+ }
391
+
392
+ // PSR-4 fallback dirs
393
+ foreach ($this->fallbackDirsPsr4 as $dir) {
394
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
395
+ return $file;
396
+ }
397
+ }
398
+
399
+ // PSR-0 lookup
400
+ if (false !== $pos = strrpos($class, '\\')) {
401
+ // namespaced class name
402
+ $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
403
+ . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
404
+ } else {
405
+ // PEAR-like class name
406
+ $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
407
+ }
408
+
409
+ if (isset($this->prefixesPsr0[$first])) {
410
+ foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
411
+ if (0 === strpos($class, $prefix)) {
412
+ foreach ($dirs as $dir) {
413
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
414
+ return $file;
415
+ }
416
+ }
417
+ }
418
+ }
419
+ }
420
+
421
+ // PSR-0 fallback dirs
422
+ foreach ($this->fallbackDirsPsr0 as $dir) {
423
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
424
+ return $file;
425
+ }
426
+ }
427
+
428
+ // PSR-0 include paths.
429
+ if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
430
+ return $file;
431
+ }
432
+
433
+ return false;
434
+ }
435
+ }
436
+
437
+ /**
438
+ * Scope isolated include.
439
+ *
440
+ * Prevents access to $this/self from included files.
441
+ */
442
+ function includeFile($file)
443
+ {
444
+ include $file;
445
+ }
vendor/composer/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Copyright (c) Nils Adermann, Jordi Boggiano
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is furnished
9
+ to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ THE SOFTWARE.
21
+
vendor/composer/autoload_classmap.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_classmap.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ );
vendor/composer/autoload_namespaces.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_namespaces.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ );
vendor/composer/autoload_psr4.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_psr4.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ 'MailchimpTests\\' => array($vendorDir . '/jhut89/mailchimp3php/tests'),
10
+ 'MailchimpAPI\\' => array($vendorDir . '/jhut89/mailchimp3php/src'),
11
+ );
vendor/composer/autoload_real.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_real.php @generated by Composer
4
+
5
+ class ComposerAutoloaderInitdd4fead45e0fa114c2c94d387fded5f6
6
+ {
7
+ private static $loader;
8
+
9
+ public static function loadClassLoader($class)
10
+ {
11
+ if ('Composer\Autoload\ClassLoader' === $class) {
12
+ require __DIR__ . '/ClassLoader.php';
13
+ }
14
+ }
15
+
16
+ public static function getLoader()
17
+ {
18
+ if (null !== self::$loader) {
19
+ return self::$loader;
20
+ }
21
+
22
+ spl_autoload_register(array('ComposerAutoloaderInitdd4fead45e0fa114c2c94d387fded5f6', 'loadClassLoader'), true, true);
23
+ self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitdd4fead45e0fa114c2c94d387fded5f6', 'loadClassLoader'));
25
+
26
+ $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
+ if ($useStaticLoader) {
28
+ require_once __DIR__ . '/autoload_static.php';
29
+
30
+ call_user_func(\Composer\Autoload\ComposerStaticInitdd4fead45e0fa114c2c94d387fded5f6::getInitializer($loader));
31
+ } else {
32
+ $map = require __DIR__ . '/autoload_namespaces.php';
33
+ foreach ($map as $namespace => $path) {
34
+ $loader->set($namespace, $path);
35
+ }
36
+
37
+ $map = require __DIR__ . '/autoload_psr4.php';
38
+ foreach ($map as $namespace => $path) {
39
+ $loader->setPsr4($namespace, $path);
40
+ }
41
+
42
+ $classMap = require __DIR__ . '/autoload_classmap.php';
43
+ if ($classMap) {
44
+ $loader->addClassMap($classMap);
45
+ }
46
+ }
47
+
48
+ $loader->register(true);
49
+
50
+ return $loader;
51
+ }
52
+ }
vendor/composer/autoload_static.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_static.php @generated by Composer
4
+
5
+ namespace Composer\Autoload;
6
+
7
+ class ComposerStaticInitdd4fead45e0fa114c2c94d387fded5f6
8
+ {
9
+ public static $prefixLengthsPsr4 = array (
10
+ 'M' =>
11
+ array (
12
+ 'MailchimpTests\\' => 15,
13
+ 'MailchimpAPI\\' => 13,
14
+ ),
15
+ );
16
+
17
+ public static $prefixDirsPsr4 = array (
18
+ 'MailchimpTests\\' =>
19
+ array (
20
+ 0 => __DIR__ . '/..' . '/jhut89/mailchimp3php/tests',
21
+ ),
22
+ 'MailchimpAPI\\' =>
23
+ array (
24
+ 0 => __DIR__ . '/..' . '/jhut89/mailchimp3php/src',
25
+ ),
26
+ );
27
+
28
+ public static function getInitializer(ClassLoader $loader)
29
+ {
30
+ return \Closure::bind(function () use ($loader) {
31
+ $loader->prefixLengthsPsr4 = ComposerStaticInitdd4fead45e0fa114c2c94d387fded5f6::$prefixLengthsPsr4;
32
+ $loader->prefixDirsPsr4 = ComposerStaticInitdd4fead45e0fa114c2c94d387fded5f6::$prefixDirsPsr4;
33
+
34
+ }, null, ClassLoader::class);
35
+ }
36
+ }
vendor/composer/installed.json ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "name": "jhut89/mailchimp3php",
4
+ "version": "3.2.3",
5
+ "version_normalized": "3.2.3.0",
6
+ "source": {
7
+ "type": "git",
8
+ "url": "https://github.com/Jhut89/Mailchimp-API-3.0-PHP.git",
9
+ "reference": "dc05359b68e1f12864f5119f6fbc0b1421dcc2d1"
10
+ },
11
+ "dist": {
12
+ "type": "zip",
13
+ "url": "https://api.github.com/repos/Jhut89/Mailchimp-API-3.0-PHP/zipball/dc05359b68e1f12864f5119f6fbc0b1421dcc2d1",
14
+ "reference": "dc05359b68e1f12864f5119f6fbc0b1421dcc2d1",
15
+ "shasum": ""
16
+ },
17
+ "require": {
18
+ "ext-curl": "*",
19
+ "ext-json": "*",
20
+ "php": ">=5.5.0"
21
+ },
22
+ "require-dev": {
23
+ "php": ">=7.2.0",
24
+ "phpunit/phpunit": "^5",
25
+ "squizlabs/php_codesniffer": "3.*"
26
+ },
27
+ "time": "2020-08-24T15:17:54+00:00",
28
+ "type": "library",
29
+ "installation-source": "dist",
30
+ "autoload": {
31
+ "psr-4": {
32
+ "MailchimpAPI\\": "src/",
33
+ "MailchimpTests\\": "tests/"
34
+ }
35
+ },
36
+ "notification-url": "https://packagist.org/downloads/",
37
+ "license": [
38
+ "MIT"
39
+ ],
40
+ "authors": [
41
+ {
42
+ "name": "John Hutcheson",
43
+ "email": "hutch@theresearchgrp.com"
44
+ }
45
+ ],
46
+ "description": "A php library for version 3.0 of MailChimp's API",
47
+ "homepage": "https://github.com/Jhut89/Mailchimp-API-3.0-PHP"
48
+ }
49
+ ]
vendor/jhut89/mailchimp3php/CODE_OF_CONDUCT.md ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ ## Our Standards
8
+
9
+ Examples of behavior that contributes to creating a positive environment include:
10
+
11
+ * Using welcoming and inclusive language
12
+ * Being respectful of differing viewpoints and experiences
13
+ * Gracefully accepting constructive criticism
14
+ * Focusing on what is best for the community
15
+ * Showing empathy towards other community members
16
+
17
+ Examples of unacceptable behavior by participants include:
18
+
19
+ * The use of sexualized language or imagery and unwelcome sexual attention or advances
20
+ * Trolling, insulting/derogatory comments, and personal or political attacks
21
+ * Public or private harassment
22
+ * Publishing others' private information, such as a physical or electronic address, without explicit permission
23
+ * Other conduct which could reasonably be considered inappropriate in a professional setting
24
+
25
+ ## Our Responsibilities
26
+
27
+ Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28
+
29
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30
+
31
+ ## Scope
32
+
33
+ This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34
+
35
+ ## Enforcement
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at j.d.hutcheson4@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38
+
39
+ Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40
+
41
+ ## Attribution
42
+
43
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44
+
45
+ [homepage]: http://contributor-covenant.org
46
+ [version]: http://contributor-covenant.org/version/1/4/
vendor/jhut89/mailchimp3php/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2017 John Hutcheson
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
vendor/jhut89/mailchimp3php/PULL_REQUEST_TEMPLATE.md ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### __**Description of change:**__
2
+
3
+
4
+
5
+
6
+ #### __**Description of implementation:**__
7
+
8
+
9
+
10
+
11
+ #### __**Risks & Mitigation:**__
12
+
vendor/jhut89/mailchimp3php/README.md ADDED
@@ -0,0 +1,401 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Table Of Contents
2
+ <!-- START doctoc generated TOC please keep comment here to allow auto update -->
3
+ <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
4
+
5
+ - [MAILCHIMP API 3.0 PHP](#mailchimp-api-3.0-php)
6
+ - [Installation](#installation)
7
+ - [Instantiation](#instantiation)
8
+ - [Oauth](#oauth)
9
+ - [Constructing a Request](#constructing-a-request)
10
+ - [GET](#get)
11
+ - [POST](#post)
12
+ - [PATCH &amp; PUT](#patch-put-heading)
13
+ - [DELETE](#delete)
14
+ - [Handling A Response](https://github.com/Jhut89/Mailchimp-API-3.0-PHP/wiki/Handling-A-Response)
15
+ - [Callbacks](https://github.com/Jhut89/Mailchimp-API-3.0-PHP/wiki/Callbacks)
16
+ - [Method Chart (\*excluding verbs)](#method-chart-heading)
17
+ - [Wiki](https://github.com/Jhut89/Mailchimp-API-3.0-PHP/wiki) - See for more in depth documentation
18
+
19
+ <!-- END doctoc generated TOC please keep comment here to allow auto update -->
20
+
21
+ # MAILCHIMP API 3.0 PHP
22
+ [![GitHub license](https://img.shields.io/github/license/Jhut89/Mailchimp-API-3.0-PHP.svg)](https://github.com/Jhut89/Mailchimp-API-3.0-PHP/blob/master/LICENSE)
23
+ [![Build Status](https://travis-ci.com/Jhut89/Mailchimp-API-3.0-PHP.svg?branch=master)](https://travis-ci.com/Jhut89/Mailchimp-API-3.0-PHP)
24
+ [![Latest Stable Version](https://poser.pugx.org/jhut89/mailchimp3php/v/stable?format=flat)](https://packagist.org/packages/jhut89/mailchimp3php)
25
+ [![Total Downloads](https://poser.pugx.org/jhut89/mailchimp3php/downloads?format=flat)](https://packagist.org/packages/jhut89/mailchimp3php)
26
+ [![Slack Workspace](https://img.shields.io/badge/slack%20workspace-join-blue.svg?style=flat)](https://join.slack.com/t/mailchimp-api-30-php/shared_invite/enQtMzkwNTg3Mzc5NzI5LTdhOWE2ZGE1NzJmZGRjNDg2Mzg1MDYwZmVhNGM0MGJmMDY3NGVkOWQyZTI1Zjg1YTA2YjdkMDMxNjIyZjg5MGM)
27
+ [![Trello Board](https://img.shields.io/badge/trello-view%20board-blue.svg?style=flat)](https://trello.com/b/N5DRSTgL/mailchimp-api-30-sdk)
28
+
29
+
30
+ This is a PHP library for interacting with [version 3.0 of MailChimp's API](https://developer.mailchimp.com)
31
+
32
+ This library assumes a basic understanding of the MailChimp application and its associated functions.
33
+
34
+ ## Installation
35
+
36
+ For Composer run:
37
+
38
+ ```php
39
+ composer require jhut89/mailchimp3php
40
+ ```
41
+
42
+ Alternatively you may add a require line to your projects `composer.json` for the package `jhut89/mailchimp3php`.
43
+
44
+ Then run `composer update` and add the composer autoloader to your project with:
45
+
46
+ ```php
47
+ require "vendor/autoload.php";
48
+ ```
49
+
50
+ You can then use a use statement to pull in the Mailchimp class:
51
+ ```php
52
+ use MailchimpAPI\Mailchimp;
53
+ ```
54
+ ## Instantiation
55
+
56
+ ```php
57
+ $mailchimp = new Mailchimp('123abc123abc123abc123abc-us0');
58
+ ```
59
+
60
+ To instantiate you will need a new instance of the `Mailchimp` class with your MailChimp account's API key as its only argument.
61
+
62
+ ## Oauth
63
+
64
+ If you are using [Oauth](http://developer.mailchimp.com/documentation/mailchimp/guides/how-to-use-oauth2/) to obtain an access token, this library can handle the "handshake" for you.
65
+
66
+ You must first send the user to your applications `authorize_uri`. You can get this url by calling the `Mailchimp::getAuthUrl()` statically:
67
+
68
+ ```php
69
+ $client_id = '12345676543';
70
+ $redirect_url = 'https://www.some-domain.com/callback_file.php';
71
+
72
+ Mailchimp::getAuthUrl($client_id, $redirect_url);
73
+ ```
74
+
75
+ From there the user will input their username and password to approve your application and will be redirected to the `redirect_uri` you set along with a `code`.
76
+
77
+ With that `code` you can now request an access token from mailchimp. For this you will need to call the `Mailchimp::oauthExchange()` method statically like this:
78
+
79
+ ```php
80
+ $code = 'abc123abc123abc123abc123';
81
+ $client_id = '12345676543';
82
+ $client_secret = '789xyz789xyz789xyz789xyz';
83
+ $redirect_url = 'https://www.some-domain.com/callback_file.php';
84
+
85
+ Mailchimp::oauthExchange($code, $client_id, $client_secret, $redirect_url);
86
+ ```
87
+
88
+ If the handshake is successful, then this method will return a string containing your API key like this: `123abc123abc123abc123abc123abc-us0`. This API key can now be used to instantiate your `Mailchimp` class as we have above.
89
+
90
+
91
+ ## Constructing a Request
92
+
93
+ Once you have instantiated the `Mailchimp` class you can start constructing requests. Constructing requests is done by 'chaining' methods to the `$mailchimp` instance. In most cases this 'chain' will end with the HTTP verb for your request.
94
+
95
+ ### GET
96
+
97
+ An Example of how to retrieve a list collection:
98
+ ```php
99
+ $mailchimp
100
+ ->lists()
101
+ ->get();
102
+ ```
103
+
104
+ Retrieving an instance can be accomplished by giving a unique identifier for the instance you want as an argument to the appropriate method. For example if I wanted to retrieve a list instance from the above example I would simply pass a `list_id`, as the only argument for the `lists()` method. Like this:
105
+
106
+ ```php
107
+ $mailchimp
108
+ ->lists('1a2b3c4d')
109
+ ->get();
110
+ ```
111
+
112
+ Methods available for each position in the chain depend on what the prior method returns. For example if I wanted to retrieve subscribers from a list in my account I would:
113
+
114
+ ```php
115
+ $mailchimp
116
+ ->lists('1a2b3c4d')
117
+ ->members()
118
+ ->get();
119
+ ```
120
+
121
+ Notice that I provided a `list_id` to the `lists()` method, as there would be no way to retrieve a list of subscribers from a lists collection. The above request however will only return 10 subscriber instances from the members collection. This is because MailChimp's API uses pagination (documented [HERE](http://developer.mailchimp.com/documentation/mailchimp/guides/get-started-with-mailchimp-api-3/#parameters)) that defaults to `count=10` and `offset=0`. This library allows you to alter query string parameters by passing them as an argument to the `GET()` method. We do this by providing an array of key-value pairs where the keys are the query parameter you wish to provide/alter and its value is the parameter's value. As an example if I wanted to retrieve the second 100 subscribers from my list I could:
122
+
123
+ ```php
124
+ $mailchimp
125
+ ->lists('1a2b3c4d')
126
+ ->members()
127
+ ->get([
128
+ "count" => "100",
129
+ "offset" => "100"
130
+ ]);
131
+ ```
132
+
133
+ This would be equivalent to making a get request against:
134
+
135
+ ```
136
+ Https://us0.api.mailchimp.com/3.0/lists/1a2b3c4d/members?count=100&offset=100
137
+ ```
138
+
139
+ Going a little further we can retrieve a single list member by giving the `members_hash` (md5 hash of lower-case address) to the `members()` method. Like this:
140
+
141
+ ```php
142
+ $mailchimp
143
+ ->lists('1a2b3c4d')
144
+ ->members('8bdbf060209f35b52087992a3cbdf4d7')
145
+ ->get();
146
+ ```
147
+
148
+ Alternatively, in place of providing an md5 hash as the identifier to the `members()` function you can provide a contact's email address as a string and this library will do the hashing for you. Like this:
149
+
150
+ ```php
151
+ $mailchimp
152
+ ->lists('1a2b3c4d')
153
+ ->members('example@domain.com')
154
+ ->get();
155
+ ```
156
+
157
+ > You can read about `GET` requests in depth here: https://github.com/Jhut89/Mailchimp-API-3.0-PHP/wiki/Get-Requests
158
+ ### POST
159
+
160
+ While being able to retrieve data from your account is great we also need to be able to post new data. This can be done by calling the `POST()` method at the end of a chain. As an example subscribing an address to a list would look like this:
161
+
162
+ ```php
163
+ $post_params = [
164
+ 'email_address'=>'example@domain.com',
165
+ 'status'=>'subscribed'
166
+ ];
167
+
168
+ $mailchimp
169
+ ->lists('1a2b3c4d')
170
+ ->members()
171
+ ->post($post_params);
172
+ ```
173
+
174
+ In this case I would not provide `members()` with an identifier as I want to post to its collection. Also notice that the post data is an array of key-value pairs representing what parameters I want to pass to the MailChimp API. Be sure that you provide all required fields for the endpoint you are posting to. Check [MailChimp's documentation](http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#create-post_lists_list_id_members) for what parameters are required. Non-required parameters can just be added to the post data, and MailChimp will ignore any that are unusable. To illustrate here is an example of adding a subscriber to a list with some non-required parameters:
175
+
176
+ ```php
177
+ $merge_values = [
178
+ "FNAME" => "John",
179
+ "LNAME" => "Doe"
180
+ ];
181
+
182
+ $post_params = [
183
+ "email_address" => "example@domain.com",
184
+ "status" => "subscribed",
185
+ "email_type" => "html",
186
+ "merge_fields" => $merge_values
187
+ ]
188
+
189
+ $mailchimp
190
+ ->lists('1a2b3c4d')
191
+ ->members()
192
+ ->post($post_params);
193
+ ```
194
+ > You can read about `POST` requests in depth here: https://github.com/Jhut89/Mailchimp-API-3.0-PHP/wiki/Post-Requests
195
+
196
+ ### <a name="patch-put-heading"></a> PATCH &amp; PUT
197
+
198
+ This library handles PUT and PATCH request similar to that of POST requests. Meaning that `PUT()` & `PATCH()` both accept an array of key-value pairs that represent the data you wish altered/provided to MailChimp. As an example if I was patching the subscriber that we subscribed above, to have a new first name, that would look like this.
199
+
200
+ ```php
201
+ $mailchimp
202
+ ->lists('1a2b3c4d')
203
+ ->members('a1167f5be2df7113beb69c95ebcdb2fd')
204
+ ->patch([
205
+ "merge_fields" => ["FNAME" => "Jane"]
206
+ ]);
207
+ ```
208
+ > You can read about `PATCH` & `PUT` requests in depth here: https://github.com/Jhut89/Mailchimp-API-3.0-PHP/wiki/Patch-&-Put-Requests
209
+
210
+ ### DELETE
211
+
212
+ Deleting a record from MailChimp is performed with the `DELETE()` method and is constructed similar to GET requests. If I wanted to delete the above subscriber I would:
213
+
214
+ ```php
215
+ $mailchimp
216
+ ->lists('1a2b3c4d')
217
+ ->members('a1167f5be2df7113beb69c95ebcdb2fd')
218
+ ->delete();
219
+ ```
220
+ > You can read about `DELETE` requests in depth here: https://github.com/Jhut89/Mailchimp-API-3.0-PHP/wiki/Delete-Requests
221
+ ## Handling A Response
222
+
223
+ Methods named for http verbs such as `get()` ,`post()`, `patch()`, `put()`, or `delete()` kick off an over the wire request to MailChimp's A.P.I. Given a successful request these methods return an instance of a `MailchimpResponse`.
224
+ I suggest you become familiar with this class as there are a number of modifiers and getters for different pieces of a response.
225
+
226
+ There are a number of getters we can use to interact with pieces our `MailchimpResponse` instance. Some of the more commonly used ones are:
227
+
228
+ ```php
229
+ $response->deserialize(); // returns a deserialized (to php object) resource returned by API
230
+ $response->getHttpCode(); // returns an integer representation of the HTTP response code
231
+ $response->getHeaders(); // returns response headers as an array of key => value pairs
232
+ $response->getBody(); // return the raw text body of the response
233
+ ```
234
+
235
+ As an example, if I posses an API key but want the contact email associated with its account:
236
+
237
+ ```php
238
+ $mailchimp = new Mailchimp('123abc123abc123abc123abc-us0');
239
+ $account = $mailchimp
240
+ ->account()
241
+ ->get()
242
+
243
+ $contact_email = $account
244
+ ->deserialize()
245
+ ->email
246
+
247
+ print $contact_email; // outputs something like "example@domain.com"
248
+ ```
249
+
250
+ > You can read about how to work with responses in depth here: https://github.com/Jhut89/Mailchimp-API-3.0-PHP/wiki/Handling-A-Response
251
+
252
+ ## <a name="method-chart-heading"></a>Method Chart (\*excluding verbs)
253
+
254
+
255
+ mailchimp()
256
+ |
257
+ |----account()
258
+ |
259
+ |----apps()
260
+ |
261
+ |----automations()
262
+ | |
263
+ | |----removedSubscribers()
264
+ | |----emails()
265
+ | |
266
+ | |---queue()*
267
+ | |---pauseAll()*
268
+ | |---startAll()*
269
+ |
270
+ |----batches()
271
+ |
272
+ |----batchWebhooks()
273
+ |
274
+ |----campaignFolders()
275
+ |
276
+ |----campaigns()
277
+ | |
278
+ | |----cancel()*
279
+ | |----pause()*
280
+ | |----replicate()*
281
+ | |----resume()*
282
+ | |----scedule()*
283
+ | |----send()*
284
+ | |----test()*
285
+ | |----unschedule()*
286
+ | |----checklist()
287
+ | |----feedback()
288
+ | |----content()
289
+ |
290
+ |----connectedSites()
291
+ | |
292
+ | |----verifyScriptInstallation()*
293
+ |
294
+ |----conversations()
295
+ | |
296
+ | |----messages()
297
+ |
298
+ |----ecommStores()
299
+ | |
300
+ | |----customers()
301
+ | |----products()
302
+ | | |
303
+ | | |----variants()
304
+ | | |----images()
305
+ | |
306
+ | |----promoRules()
307
+ | | |
308
+ | | |----promoCodes()
309
+ | |
310
+ | |----orders()
311
+ | | |
312
+ | | |----lines()
313
+ | |
314
+ | |----carts()
315
+ | |
316
+ | |----lines()
317
+ |
318
+ |----facebookAds()
319
+ |
320
+ |----fileManagerFiles()
321
+ |
322
+ |----fileManagerFolders()
323
+ |
324
+ |----googleAds()
325
+ |
326
+ |----landingPages()
327
+ | |
328
+ | |----publish()*
329
+ | |----unpublish()*
330
+ | |----content()
331
+ |
332
+ |----lists()
333
+ | |
334
+ | |----batchSubscribe()*
335
+ | |----webhooks()
336
+ | |----signupForms()
337
+ | |----mergeFields()
338
+ | |----growthHistory()
339
+ | |----clients()
340
+ | |----activity()
341
+ | |----abuseReports()
342
+ | |----segments()
343
+ | | |
344
+ | | |----batch()*
345
+ | | |----members()
346
+ | |
347
+ | |----members()
348
+ | | |
349
+ | | |---notes()
350
+ | | |---goals()
351
+ | | |---activity()
352
+ | | |---tags()
353
+ | |
354
+ | |----interestCategories()
355
+ | |
356
+ | |----interests()
357
+ |
358
+ |----ping()
359
+ |
360
+ |----reports()
361
+ | |
362
+ | |----unsubscribes()
363
+ | |----subReports()
364
+ | |----sentTo()
365
+ | |----locations()
366
+ | |----emailActivity()
367
+ | |----googleAnalytics()
368
+ | |----openDetails()
369
+ | |----eepurl()
370
+ | |----domainPerformance()
371
+ | |----advice()
372
+ | |----abuse()
373
+ | |----clickReports()
374
+ | |
375
+ | |----members()
376
+ |
377
+ |----searchCampaigns()
378
+ |
379
+ |----searchMembers()
380
+ |
381
+ |----templateFolders()
382
+ |
383
+ |----templates()
384
+ | |
385
+ | |----defaultContent()
386
+ |
387
+ |----verifiedDomains()
388
+ |
389
+ |----verify()
390
+
391
+
392
+
393
+ \*Please see [MailChimp's API Documentation](http://developer.mailchimp.com/documentation/mailchimp/reference/overview/) for what verbs are appropriate where.
394
+
395
+ \** Methods marked with a `*` make a network request
396
+
397
+ \*\*Please watch for updates, and feel free to Fork or Pull Request. Check out the Wiki for a little more info on contributing.
398
+
399
+
400
+
401
+
vendor/jhut89/mailchimp3php/_config.yml ADDED
@@ -0,0 +1 @@
 
1
+ theme: jekyll-theme-hacker
vendor/jhut89/mailchimp3php/composer.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "jhut89/mailchimp3php",
3
+ "description": "A php library for version 3.0 of MailChimp's API",
4
+ "license": "MIT",
5
+ "authors": [
6
+ {
7
+ "name": "John Hutcheson",
8
+ "email": "hutch@theresearchgrp.com"
9
+ }
10
+ ],
11
+ "autoload":{
12
+ "psr-4": {
13
+ "MailchimpAPI\\" : "src/",
14
+ "MailchimpTests\\" : "tests/"
15
+ }
16
+ },
17
+ "require": {
18
+ "php": ">=5.5.0",
19
+ "ext-curl": "*",
20
+ "ext-json": "*"
21
+ },
22
+ "homepage": "https://github.com/Jhut89/Mailchimp-API-3.0-PHP",
23
+ "require-dev": {
24
+ "php": ">=7.2.0",
25
+ "phpunit/phpunit": "^5",
26
+ "squizlabs/php_codesniffer": "3.*"
27
+ }
28
+ }
vendor/jhut89/mailchimp3php/composer.lock ADDED
@@ -0,0 +1,1460 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_readme": [
3
+ "This file locks the dependencies of your project to a known state",
4
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5
+ "This file is @generated automatically"
6
+ ],
7
+ "content-hash": "db604eedfdb2b905992cd201cf0a5b34",
8
+ "packages": [],
9
+ "packages-dev": [
10
+ {
11
+ "name": "doctrine/instantiator",
12
+ "version": "1.3.0",
13
+ "source": {
14
+ "type": "git",
15
+ "url": "https://github.com/doctrine/instantiator.git",
16
+ "reference": "ae466f726242e637cebdd526a7d991b9433bacf1"
17
+ },
18
+ "dist": {
19
+ "type": "zip",
20
+ "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1",
21
+ "reference": "ae466f726242e637cebdd526a7d991b9433bacf1",
22
+ "shasum": ""
23
+ },
24
+ "require": {
25
+ "php": "^7.1"
26
+ },
27
+ "require-dev": {
28
+ "doctrine/coding-standard": "^6.0",
29
+ "ext-pdo": "*",
30
+ "ext-phar": "*",
31
+ "phpbench/phpbench": "^0.13",
32
+ "phpstan/phpstan-phpunit": "^0.11",
33
+ "phpstan/phpstan-shim": "^0.11",
34
+ "phpunit/phpunit": "^7.0"
35
+ },
36
+ "type": "library",
37
+ "extra": {
38
+ "branch-alias": {
39
+ "dev-master": "1.2.x-dev"
40
+ }
41
+ },
42
+ "autoload": {
43
+ "psr-4": {
44
+ "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
45
+ }
46
+ },
47
+ "notification-url": "https://packagist.org/downloads/",
48
+ "license": [
49
+ "MIT"
50
+ ],
51
+ "authors": [
52
+ {
53
+ "name": "Marco Pivetta",
54
+ "email": "ocramius@gmail.com",
55
+ "homepage": "http://ocramius.github.com/"
56
+ }
57
+ ],
58
+ "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
59
+ "homepage": "https://www.doctrine-project.org/projects/instantiator.html",
60
+ "keywords": [
61
+ "constructor",
62
+ "instantiate"
63
+ ],
64
+ "time": "2019-10-21T16:45:58+00:00"
65
+ },
66
+ {
67
+ "name": "myclabs/deep-copy",
68
+ "version": "1.9.5",
69
+ "source": {
70
+ "type": "git",
71
+ "url": "https://github.com/myclabs/DeepCopy.git",
72
+ "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef"
73
+ },
74
+ "dist": {
75
+ "type": "zip",
76
+ "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef",
77
+ "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef",
78
+ "shasum": ""
79
+ },
80
+ "require": {
81
+ "php": "^7.1"
82
+ },
83
+ "replace": {
84
+ "myclabs/deep-copy": "self.version"
85
+ },
86
+ "require-dev": {
87
+ "doctrine/collections": "^1.0",
88
+ "doctrine/common": "^2.6",
89
+ "phpunit/phpunit": "^7.1"
90
+ },
91
+ "type": "library",
92
+ "autoload": {
93
+ "psr-4": {
94
+ "DeepCopy\\": "src/DeepCopy/"
95
+ },
96
+ "files": [
97
+ "src/DeepCopy/deep_copy.php"
98
+ ]
99
+ },
100
+ "notification-url": "https://packagist.org/downloads/",
101
+ "license": [
102
+ "MIT"
103
+ ],
104
+ "description": "Create deep copies (clones) of your objects",
105
+ "keywords": [
106
+ "clone",
107
+ "copy",
108
+ "duplicate",
109
+ "object",
110
+ "object graph"
111
+ ],
112
+ "time": "2020-01-17T21:11:47+00:00"
113
+ },
114
+ {
115
+ "name": "phpdocumentor/reflection-common",
116
+ "version": "2.0.0",
117
+ "source": {
118
+ "type": "git",
119
+ "url": "https://github.com/phpDocumentor/ReflectionCommon.git",
120
+ "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a"
121
+ },
122
+ "dist": {
123
+ "type": "zip",
124
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a",
125
+ "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a",
126
+ "shasum": ""
127
+ },
128
+ "require": {
129
+ "php": ">=7.1"
130
+ },
131
+ "require-dev": {
132
+ "phpunit/phpunit": "~6"
133
+ },
134
+ "type": "library",
135
+ "extra": {
136
+ "branch-alias": {
137
+ "dev-master": "2.x-dev"
138
+ }
139
+ },
140
+ "autoload": {
141
+ "psr-4": {
142
+ "phpDocumentor\\Reflection\\": "src/"
143
+ }
144
+ },
145
+ "notification-url": "https://packagist.org/downloads/",
146
+ "license": [
147
+ "MIT"
148
+ ],
149
+ "authors": [
150
+ {
151
+ "name": "Jaap van Otterdijk",
152
+ "email": "opensource@ijaap.nl"
153
+ }
154
+ ],
155
+ "description": "Common reflection classes used by phpdocumentor to reflect the code structure",
156
+ "homepage": "http://www.phpdoc.org",
157
+ "keywords": [
158
+ "FQSEN",
159
+ "phpDocumentor",
160
+ "phpdoc",
161
+ "reflection",
162
+ "static analysis"
163
+ ],
164
+ "time": "2018-08-07T13:53:10+00:00"
165
+ },
166
+ {
167
+ "name": "phpdocumentor/reflection-docblock",
168
+ "version": "4.3.4",
169
+ "source": {
170
+ "type": "git",
171
+ "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
172
+ "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c"
173
+ },
174
+ "dist": {
175
+ "type": "zip",
176
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/da3fd972d6bafd628114f7e7e036f45944b62e9c",
177
+ "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c",
178
+ "shasum": ""
179
+ },
180
+ "require": {
181
+ "php": "^7.0",
182
+ "phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0",
183
+ "phpdocumentor/type-resolver": "~0.4 || ^1.0.0",
184
+ "webmozart/assert": "^1.0"
185
+ },
186
+ "require-dev": {
187
+ "doctrine/instantiator": "^1.0.5",
188
+ "mockery/mockery": "^1.0",
189
+ "phpdocumentor/type-resolver": "0.4.*",
190
+ "phpunit/phpunit": "^6.4"
191
+ },
192
+ "type": "library",
193
+ "extra": {
194
+ "branch-alias": {
195
+ "dev-master": "4.x-dev"
196
+ }
197
+ },
198
+ "autoload": {
199
+ "psr-4": {
200
+ "phpDocumentor\\Reflection\\": [
201
+ "src/"
202
+ ]
203
+ }
204
+ },
205
+ "notification-url": "https://packagist.org/downloads/",
206
+ "license": [
207
+ "MIT"
208
+ ],
209
+ "authors": [
210
+ {
211
+ "name": "Mike van Riel",
212
+ "email": "me@mikevanriel.com"
213
+ }
214
+ ],
215
+ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
216
+ "time": "2019-12-28T18:55:12+00:00"
217
+ },
218
+ {
219
+ "name": "phpdocumentor/type-resolver",
220
+ "version": "1.0.1",
221
+ "source": {
222
+ "type": "git",
223
+ "url": "https://github.com/phpDocumentor/TypeResolver.git",
224
+ "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9"
225
+ },
226
+ "dist": {
227
+ "type": "zip",
228
+ "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9",
229
+ "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9",
230
+ "shasum": ""
231
+ },
232
+ "require": {
233
+ "php": "^7.1",
234
+ "phpdocumentor/reflection-common": "^2.0"
235
+ },
236
+ "require-dev": {
237
+ "ext-tokenizer": "^7.1",
238
+ "mockery/mockery": "~1",
239
+ "phpunit/phpunit": "^7.0"
240
+ },
241
+ "type": "library",
242
+ "extra": {
243
+ "branch-alias": {
244
+ "dev-master": "1.x-dev"
245
+ }
246
+ },
247
+ "autoload": {
248
+ "psr-4": {
249
+ "phpDocumentor\\Reflection\\": "src"
250
+ }
251
+ },
252
+ "notification-url": "https://packagist.org/downloads/",
253
+ "license": [
254
+ "MIT"
255
+ ],
256
+ "authors": [
257
+ {
258
+ "name": "Mike van Riel",
259
+ "email": "me@mikevanriel.com"
260
+ }
261
+ ],
262
+ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
263
+ "time": "2019-08-22T18:11:29+00:00"
264
+ },
265
+ {
266
+ "name": "phpspec/prophecy",
267
+ "version": "v1.10.2",
268
+ "source": {
269
+ "type": "git",
270
+ "url": "https://github.com/phpspec/prophecy.git",
271
+ "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9"
272
+ },
273
+ "dist": {
274
+ "type": "zip",
275
+ "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b4400efc9d206e83138e2bb97ed7f5b14b831cd9",
276
+ "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9",
277
+ "shasum": ""
278
+ },
279
+ "require": {
280
+ "doctrine/instantiator": "^1.0.2",
281
+ "php": "^5.3|^7.0",
282
+ "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0",
283
+ "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0",
284
+ "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0"
285
+ },
286
+ "require-dev": {
287
+ "phpspec/phpspec": "^2.5 || ^3.2",
288
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1"
289
+ },
290
+ "type": "library",
291
+ "extra": {
292
+ "branch-alias": {
293
+ "dev-master": "1.10.x-dev"
294
+ }
295
+ },
296
+ "autoload": {
297
+ "psr-4": {
298
+ "Prophecy\\": "src/Prophecy"
299
+ }
300
+ },
301
+ "notification-url": "https://packagist.org/downloads/",
302
+ "license": [
303
+ "MIT"
304
+ ],
305
+ "authors": [
306
+ {
307
+ "name": "Konstantin Kudryashov",
308
+ "email": "ever.zet@gmail.com",
309
+ "homepage": "http://everzet.com"
310
+ },
311
+ {
312
+ "name": "Marcello Duarte",
313
+ "email": "marcello.duarte@gmail.com"
314
+ }
315
+ ],
316
+ "description": "Highly opinionated mocking framework for PHP 5.3+",
317
+ "homepage": "https://github.com/phpspec/prophecy",
318
+ "keywords": [
319
+ "Double",
320
+ "Dummy",
321
+ "fake",
322
+ "mock",
323
+ "spy",
324
+ "stub"
325
+ ],
326
+ "time": "2020-01-20T15:57:02+00:00"
327
+ },
328
+ {
329
+ "name": "phpunit/php-code-coverage",
330
+ "version": "4.0.8",
331
+ "source": {
332
+ "type": "git",
333
+ "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
334
+ "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d"
335
+ },
336
+ "dist": {
337
+ "type": "zip",
338
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d",
339
+ "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d",
340
+ "shasum": ""
341
+ },
342
+ "require": {
343
+ "ext-dom": "*",
344
+ "ext-xmlwriter": "*",
345
+ "php": "^5.6 || ^7.0",
346
+ "phpunit/php-file-iterator": "^1.3",
347
+ "phpunit/php-text-template": "^1.2",
348
+ "phpunit/php-token-stream": "^1.4.2 || ^2.0",
349
+ "sebastian/code-unit-reverse-lookup": "^1.0",
350
+ "sebastian/environment": "^1.3.2 || ^2.0",
351
+ "sebastian/version": "^1.0 || ^2.0"
352
+ },
353
+ "require-dev": {
354
+ "ext-xdebug": "^2.1.4",
355
+ "phpunit/phpunit": "^5.7"
356
+ },
357
+ "suggest": {
358
+ "ext-xdebug": "^2.5.1"
359
+ },
360
+ "type": "library",
361
+ "extra": {
362
+ "branch-alias": {
363
+ "dev-master": "4.0.x-dev"
364
+ }
365
+ },
366
+ "autoload": {
367
+ "classmap": [
368
+ "src/"
369
+ ]
370
+ },
371
+ "notification-url": "https://packagist.org/downloads/",
372
+ "license": [
373
+ "BSD-3-Clause"
374
+ ],
375
+ "authors": [
376
+ {
377
+ "name": "Sebastian Bergmann",
378
+ "email": "sb@sebastian-bergmann.de",
379
+ "role": "lead"
380
+ }
381
+ ],
382
+ "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
383
+ "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
384
+ "keywords": [
385
+ "coverage",
386
+ "testing",
387
+ "xunit"
388
+ ],
389
+ "time": "2017-04-02T07:44:40+00:00"
390
+ },
391
+ {
392
+ "name": "phpunit/php-file-iterator",
393
+ "version": "1.4.5",
394
+ "source": {
395
+ "type": "git",
396
+ "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
397
+ "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4"
398
+ },
399
+ "dist": {
400
+ "type": "zip",
401
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4",
402
+ "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4",
403
+ "shasum": ""
404
+ },
405
+ "require": {
406
+ "php": ">=5.3.3"
407
+ },
408
+ "type": "library",
409
+ "extra": {
410
+ "branch-alias": {
411
+ "dev-master": "1.4.x-dev"
412
+ }
413
+ },
414
+ "autoload": {
415
+ "classmap": [
416
+ "src/"
417
+ ]
418
+ },
419
+ "notification-url": "https://packagist.org/downloads/",
420
+ "license": [
421
+ "BSD-3-Clause"
422
+ ],
423
+ "authors": [
424
+ {
425
+ "name": "Sebastian Bergmann",
426
+ "email": "sb@sebastian-bergmann.de",
427
+ "role": "lead"
428
+ }
429
+ ],
430
+ "description": "FilterIterator implementation that filters files based on a list of suffixes.",
431
+ "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
432
+ "keywords": [
433
+ "filesystem",
434
+ "iterator"
435
+ ],
436
+ "time": "2017-11-27T13:52:08+00:00"
437
+ },
438
+ {
439
+ "name": "phpunit/php-text-template",
440
+ "version": "1.2.1",
441
+ "source": {
442
+ "type": "git",
443
+ "url": "https://github.com/sebastianbergmann/php-text-template.git",
444
+ "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
445
+ },
446
+ "dist": {
447
+ "type": "zip",
448
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
449
+ "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
450
+ "shasum": ""
451
+ },
452
+ "require": {
453
+ "php": ">=5.3.3"
454
+ },
455
+ "type": "library",
456
+ "autoload": {
457
+ "classmap": [
458
+ "src/"
459
+ ]
460
+ },
461
+ "notification-url": "https://packagist.org/downloads/",
462
+ "license": [
463
+ "BSD-3-Clause"
464
+ ],
465
+ "authors": [
466
+ {
467
+ "name": "Sebastian Bergmann",
468
+ "email": "sebastian@phpunit.de",
469
+ "role": "lead"
470
+ }
471
+ ],
472
+ "description": "Simple template engine.",
473
+ "homepage": "https://github.com/sebastianbergmann/php-text-template/",
474
+ "keywords": [
475
+ "template"
476
+ ],
477
+ "time": "2015-06-21T13:50:34+00:00"
478
+ },
479
+ {
480
+ "name": "phpunit/php-timer",
481
+ "version": "1.0.9",
482
+ "source": {
483
+ "type": "git",
484
+ "url": "https://github.com/sebastianbergmann/php-timer.git",
485
+ "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f"
486
+ },
487
+ "dist": {
488
+ "type": "zip",
489
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
490
+ "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
491
+ "shasum": ""
492
+ },
493
+ "require": {
494
+ "php": "^5.3.3 || ^7.0"
495
+ },
496
+ "require-dev": {
497
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
498
+ },
499
+ "type": "library",
500
+ "extra": {
501
+ "branch-alias": {
502
+ "dev-master": "1.0-dev"
503
+ }
504
+ },
505
+ "autoload": {
506
+ "classmap": [
507
+ "src/"
508
+ ]
509
+ },
510
+ "notification-url": "https://packagist.org/downloads/",
511
+ "license": [
512
+ "BSD-3-Clause"
513
+ ],
514
+ "authors": [
515
+ {
516
+ "name": "Sebastian Bergmann",
517
+ "email": "sb@sebastian-bergmann.de",
518
+ "role": "lead"
519
+ }
520
+ ],
521
+ "description": "Utility class for timing",
522
+ "homepage": "https://github.com/sebastianbergmann/php-timer/",
523
+ "keywords": [
524
+ "timer"
525
+ ],
526
+ "time": "2017-02-26T11:10:40+00:00"
527
+ },
528
+ {
529
+ "name": "phpunit/php-token-stream",
530
+ "version": "2.0.2",
531
+ "source": {
532
+ "type": "git",
533
+ "url": "https://github.com/sebastianbergmann/php-token-stream.git",
534
+ "reference": "791198a2c6254db10131eecfe8c06670700904db"
535
+ },
536
+ "dist": {
537
+ "type": "zip",
538
+ "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db",
539
+ "reference": "791198a2c6254db10131eecfe8c06670700904db",
540
+ "shasum": ""
541
+ },
542
+ "require": {
543
+ "ext-tokenizer": "*",
544
+ "php": "^7.0"
545
+ },
546
+ "require-dev": {
547
+ "phpunit/phpunit": "^6.2.4"
548
+ },
549
+ "type": "library",
550
+ "extra": {
551
+ "branch-alias": {
552
+ "dev-master": "2.0-dev"
553
+ }
554
+ },
555
+ "autoload": {
556
+ "classmap": [
557
+ "src/"
558
+ ]
559
+ },
560
+ "notification-url": "https://packagist.org/downloads/",
561
+ "license": [
562
+ "BSD-3-Clause"
563
+ ],
564
+ "authors": [
565
+ {
566
+ "name": "Sebastian Bergmann",
567
+ "email": "sebastian@phpunit.de"
568
+ }
569
+ ],
570
+ "description": "Wrapper around PHP's tokenizer extension.",
571
+ "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
572
+ "keywords": [
573
+ "tokenizer"
574
+ ],
575
+ "time": "2017-11-27T05:48:46+00:00"
576
+ },
577
+ {
578
+ "name": "phpunit/phpunit",
579
+ "version": "5.7.27",
580
+ "source": {
581
+ "type": "git",
582
+ "url": "https://github.com/sebastianbergmann/phpunit.git",
583
+ "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c"
584
+ },
585
+ "dist": {
586
+ "type": "zip",
587
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c",
588
+ "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c",
589
+ "shasum": ""
590
+ },
591
+ "require": {
592
+ "ext-dom": "*",
593
+ "ext-json": "*",
594
+ "ext-libxml": "*",
595
+ "ext-mbstring": "*",
596
+ "ext-xml": "*",
597
+ "myclabs/deep-copy": "~1.3",
598
+ "php": "^5.6 || ^7.0",
599
+ "phpspec/prophecy": "^1.6.2",
600
+ "phpunit/php-code-coverage": "^4.0.4",
601
+ "phpunit/php-file-iterator": "~1.4",
602
+ "phpunit/php-text-template": "~1.2",
603
+ "phpunit/php-timer": "^1.0.6",
604
+ "phpunit/phpunit-mock-objects": "^3.2",
605
+ "sebastian/comparator": "^1.2.4",
606
+ "sebastian/diff": "^1.4.3",
607
+ "sebastian/environment": "^1.3.4 || ^2.0",
608
+ "sebastian/exporter": "~2.0",
609
+ "sebastian/global-state": "^1.1",
610
+ "sebastian/object-enumerator": "~2.0",
611
+ "sebastian/resource-operations": "~1.0",
612
+ "sebastian/version": "^1.0.6|^2.0.1",
613
+ "symfony/yaml": "~2.1|~3.0|~4.0"
614
+ },
615
+ "conflict": {
616
+ "phpdocumentor/reflection-docblock": "3.0.2"
617
+ },
618
+ "require-dev": {
619
+ "ext-pdo": "*"
620
+ },
621
+ "suggest": {
622
+ "ext-xdebug": "*",
623
+ "phpunit/php-invoker": "~1.1"
624
+ },
625
+ "bin": [
626
+ "phpunit"
627
+ ],
628
+ "type": "library",
629
+ "extra": {
630
+ "branch-alias": {
631
+ "dev-master": "5.7.x-dev"
632
+ }
633
+ },
634
+ "autoload": {
635
+ "classmap": [
636
+ "src/"
637
+ ]
638
+ },
639
+ "notification-url": "https://packagist.org/downloads/",
640
+ "license": [
641
+ "BSD-3-Clause"
642
+ ],
643
+ "authors": [
644
+ {
645
+ "name": "Sebastian Bergmann",
646
+ "email": "sebastian@phpunit.de",
647
+ "role": "lead"
648
+ }
649
+ ],
650
+ "description": "The PHP Unit Testing framework.",
651
+ "homepage": "https://phpunit.de/",
652
+ "keywords": [
653
+ "phpunit",
654
+ "testing",
655
+ "xunit"
656
+ ],
657
+ "time": "2018-02-01T05:50:59+00:00"
658
+ },
659
+ {
660
+ "name": "phpunit/phpunit-mock-objects",
661
+ "version": "3.4.4",
662
+ "source": {
663
+ "type": "git",
664
+ "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
665
+ "reference": "a23b761686d50a560cc56233b9ecf49597cc9118"
666
+ },
667
+ "dist": {
668
+ "type": "zip",
669
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118",
670
+ "reference": "a23b761686d50a560cc56233b9ecf49597cc9118",
671
+ "shasum": ""
672
+ },
673
+ "require": {
674
+ "doctrine/instantiator": "^1.0.2",
675
+ "php": "^5.6 || ^7.0",
676
+ "phpunit/php-text-template": "^1.2",
677
+ "sebastian/exporter": "^1.2 || ^2.0"
678
+ },
679
+ "conflict": {
680
+ "phpunit/phpunit": "<5.4.0"
681
+ },
682
+ "require-dev": {
683
+ "phpunit/phpunit": "^5.4"
684
+ },
685
+ "suggest": {
686
+ "ext-soap": "*"
687
+ },
688
+ "type": "library",
689
+ "extra": {
690
+ "branch-alias": {
691
+ "dev-master": "3.2.x-dev"
692
+ }
693
+ },
694
+ "autoload": {
695
+ "classmap": [
696
+ "src/"
697
+ ]
698
+ },
699
+ "notification-url": "https://packagist.org/downloads/",
700
+ "license": [
701
+ "BSD-3-Clause"
702
+ ],
703
+ "authors": [
704
+ {
705
+ "name": "Sebastian Bergmann",
706
+ "email": "sb@sebastian-bergmann.de",
707
+ "role": "lead"
708
+ }
709
+ ],
710
+ "description": "Mock Object library for PHPUnit",
711
+ "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
712
+ "keywords": [
713
+ "mock",
714
+ "xunit"
715
+ ],
716
+ "abandoned": true,
717
+ "time": "2017-06-30T09:13:00+00:00"
718
+ },
719
+ {
720
+ "name": "sebastian/code-unit-reverse-lookup",
721
+ "version": "1.0.1",
722
+ "source": {
723
+ "type": "git",
724
+ "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
725
+ "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18"
726
+ },
727
+ "dist": {
728
+ "type": "zip",
729
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18",
730
+ "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18",
731
+ "shasum": ""
732
+ },
733
+ "require": {
734
+ "php": "^5.6 || ^7.0"
735
+ },
736
+ "require-dev": {
737
+ "phpunit/phpunit": "^5.7 || ^6.0"
738
+ },
739
+ "type": "library",
740
+ "extra": {
741
+ "branch-alias": {
742
+ "dev-master": "1.0.x-dev"
743
+ }
744
+ },
745
+ "autoload": {
746
+ "classmap": [
747
+ "src/"
748
+ ]
749
+ },
750
+ "notification-url": "https://packagist.org/downloads/",
751
+ "license": [
752
+ "BSD-3-Clause"
753
+ ],
754
+ "authors": [
755
+ {
756
+ "name": "Sebastian Bergmann",
757
+ "email": "sebastian@phpunit.de"
758
+ }
759
+ ],
760
+ "description": "Looks up which function or method a line of code belongs to",
761
+ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
762
+ "time": "2017-03-04T06:30:41+00:00"
763
+ },
764
+ {
765
+ "name": "sebastian/comparator",
766
+ "version": "1.2.4",
767
+ "source": {
768
+ "type": "git",
769
+ "url": "https://github.com/sebastianbergmann/comparator.git",
770
+ "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be"
771
+ },
772
+ "dist": {
773
+ "type": "zip",
774
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
775
+ "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
776
+ "shasum": ""
777
+ },
778
+ "require": {
779
+ "php": ">=5.3.3",
780
+ "sebastian/diff": "~1.2",
781
+ "sebastian/exporter": "~1.2 || ~2.0"
782
+ },
783
+ "require-dev": {
784
+ "phpunit/phpunit": "~4.4"
785
+ },
786
+ "type": "library",
787
+ "extra": {
788
+ "branch-alias": {
789
+ "dev-master": "1.2.x-dev"
790
+ }
791
+ },
792
+ "autoload": {
793
+ "classmap": [
794
+ "src/"
795
+ ]
796
+ },
797
+ "notification-url": "https://packagist.org/downloads/",
798
+ "license": [
799
+ "BSD-3-Clause"
800
+ ],
801
+ "authors": [
802
+ {
803
+ "name": "Jeff Welch",
804
+ "email": "whatthejeff@gmail.com"
805
+ },
806
+ {
807
+ "name": "Volker Dusch",
808
+ "email": "github@wallbash.com"
809
+ },
810
+ {
811
+ "name": "Bernhard Schussek",
812
+ "email": "bschussek@2bepublished.at"
813
+ },
814
+ {
815
+ "name": "Sebastian Bergmann",
816
+ "email": "sebastian@phpunit.de"
817
+ }
818
+ ],
819
+ "description": "Provides the functionality to compare PHP values for equality",
820
+ "homepage": "http://www.github.com/sebastianbergmann/comparator",
821
+ "keywords": [
822
+ "comparator",
823
+ "compare",
824
+ "equality"
825
+ ],
826
+ "time": "2017-01-29T09:50:25+00:00"
827
+ },
828
+ {
829
+ "name": "sebastian/diff",
830
+ "version": "1.4.3",
831
+ "source": {
832
+ "type": "git",
833
+ "url": "https://github.com/sebastianbergmann/diff.git",
834
+ "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4"
835
+ },
836
+ "dist": {
837
+ "type": "zip",
838
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4",
839
+ "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4",
840
+ "shasum": ""
841
+ },
842
+ "require": {
843
+ "php": "^5.3.3 || ^7.0"
844
+ },
845
+ "require-dev": {
846
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
847
+ },
848
+ "type": "library",
849
+ "extra": {
850
+ "branch-alias": {
851
+ "dev-master": "1.4-dev"
852
+ }
853
+ },
854
+ "autoload": {
855
+ "classmap": [
856
+ "src/"
857
+ ]
858
+ },
859
+ "notification-url": "https://packagist.org/downloads/",
860
+ "license": [
861
+ "BSD-3-Clause"
862
+ ],
863
+ "authors": [
864
+ {
865
+ "name": "Kore Nordmann",
866
+ "email": "mail@kore-nordmann.de"
867
+ },
868
+ {
869
+ "name": "Sebastian Bergmann",
870
+ "email": "sebastian@phpunit.de"
871
+ }
872
+ ],
873
+ "description": "Diff implementation",
874
+ "homepage": "https://github.com/sebastianbergmann/diff",
875
+ "keywords": [
876
+ "diff"
877
+ ],
878
+ "time": "2017-05-22T07:24:03+00:00"
879
+ },
880
+ {
881
+ "name": "sebastian/environment",
882
+ "version": "2.0.0",
883
+ "source": {
884
+ "type": "git",
885
+ "url": "https://github.com/sebastianbergmann/environment.git",
886
+ "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac"
887
+ },
888
+ "dist": {
889
+ "type": "zip",
890
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
891
+ "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
892
+ "shasum": ""
893
+ },
894
+ "require": {
895
+ "php": "^5.6 || ^7.0"
896
+ },
897
+ "require-dev": {
898
+ "phpunit/phpunit": "^5.0"
899
+ },
900
+ "type": "library",
901
+ "extra": {
902
+ "branch-alias": {
903
+ "dev-master": "2.0.x-dev"
904
+ }
905
+ },
906
+ "autoload": {
907
+ "classmap": [
908
+ "src/"
909
+ ]
910
+ },
911
+ "notification-url": "https://packagist.org/downloads/",
912
+ "license": [
913
+ "BSD-3-Clause"
914
+ ],
915
+ "authors": [
916
+ {
917
+ "name": "Sebastian Bergmann",
918
+ "email": "sebastian@phpunit.de"
919
+ }
920
+ ],
921
+ "description": "Provides functionality to handle HHVM/PHP environments",
922
+ "homepage": "http://www.github.com/sebastianbergmann/environment",
923
+ "keywords": [
924
+ "Xdebug",
925
+ "environment",
926
+ "hhvm"
927
+ ],
928
+ "time": "2016-11-26T07:53:53+00:00"
929
+ },
930
+ {
931
+ "name": "sebastian/exporter",
932
+ "version": "2.0.0",
933
+ "source": {
934
+ "type": "git",
935
+ "url": "https://github.com/sebastianbergmann/exporter.git",
936
+ "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4"
937
+ },
938
+ "dist": {
939
+ "type": "zip",
940
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4",
941
+ "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4",
942
+ "shasum": ""
943
+ },
944
+ "require": {
945
+ "php": ">=5.3.3",
946
+ "sebastian/recursion-context": "~2.0"
947
+ },
948
+ "require-dev": {
949
+ "ext-mbstring": "*",
950
+ "phpunit/phpunit": "~4.4"
951
+ },
952
+ "type": "library",
953
+ "extra": {
954
+ "branch-alias": {
955
+ "dev-master": "2.0.x-dev"
956
+ }
957
+ },
958
+ "autoload": {
959
+ "classmap": [
960
+ "src/"
961
+ ]
962
+ },
963
+ "notification-url": "https://packagist.org/downloads/",
964
+ "license": [
965
+ "BSD-3-Clause"
966
+ ],
967
+ "authors": [
968
+ {
969
+ "name": "Jeff Welch",
970
+ "email": "whatthejeff@gmail.com"
971
+ },
972
+ {
973
+ "name": "Volker Dusch",
974
+ "email": "github@wallbash.com"
975
+ },
976
+ {
977
+ "name": "Bernhard Schussek",
978
+ "email": "bschussek@2bepublished.at"
979
+ },
980
+ {
981
+ "name": "Sebastian Bergmann",
982
+ "email": "sebastian@phpunit.de"
983
+ },
984
+ {
985
+ "name": "Adam Harvey",
986
+ "email": "aharvey@php.net"
987
+ }
988
+ ],
989
+ "description": "Provides the functionality to export PHP variables for visualization",
990
+ "homepage": "http://www.github.com/sebastianbergmann/exporter",
991
+ "keywords": [
992
+ "export",
993
+ "exporter"
994
+ ],
995
+ "time": "2016-11-19T08:54:04+00:00"
996
+ },
997
+ {
998
+ "name": "sebastian/global-state",
999
+ "version": "1.1.1",
1000
+ "source": {
1001
+ "type": "git",
1002
+ "url": "https://github.com/sebastianbergmann/global-state.git",
1003
+ "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
1004
+ },
1005
+ "dist": {
1006
+ "type": "zip",
1007
+ "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
1008
+ "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
1009
+ "shasum": ""
1010
+ },
1011
+ "require": {
1012
+ "php": ">=5.3.3"
1013
+ },
1014
+ "require-dev": {
1015
+ "phpunit/phpunit": "~4.2"
1016
+ },
1017
+ "suggest": {
1018
+ "ext-uopz": "*"
1019
+ },
1020
+ "type": "library",
1021
+ "extra": {
1022
+ "branch-alias": {
1023
+ "dev-master": "1.0-dev"
1024
+ }
1025
+ },
1026
+ "autoload": {
1027
+ "classmap": [
1028
+ "src/"
1029
+ ]
1030
+ },
1031
+ "notification-url": "https://packagist.org/downloads/",
1032
+ "license": [
1033
+ "BSD-3-Clause"
1034
+ ],
1035
+ "authors": [
1036
+ {
1037
+ "name": "Sebastian Bergmann",
1038
+ "email": "sebastian@phpunit.de"
1039
+ }
1040
+ ],
1041
+ "description": "Snapshotting of global state",
1042
+ "homepage": "http://www.github.com/sebastianbergmann/global-state",
1043
+ "keywords": [
1044
+ "global state"
1045
+ ],
1046
+ "time": "2015-10-12T03:26:01+00:00"
1047
+ },
1048
+ {
1049
+ "name": "sebastian/object-enumerator",
1050
+ "version": "2.0.1",
1051
+ "source": {
1052
+ "type": "git",
1053
+ "url": "https://github.com/sebastianbergmann/object-enumerator.git",
1054
+ "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7"
1055
+ },
1056
+ "dist": {
1057
+ "type": "zip",
1058
+ "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7",
1059
+ "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7",
1060
+ "shasum": ""
1061
+ },
1062
+ "require": {
1063
+ "php": ">=5.6",
1064
+ "sebastian/recursion-context": "~2.0"
1065
+ },
1066
+ "require-dev": {
1067
+ "phpunit/phpunit": "~5"
1068
+ },
1069
+ "type": "library",
1070
+ "extra": {
1071
+ "branch-alias": {
1072
+ "dev-master": "2.0.x-dev"
1073
+ }
1074
+ },
1075
+ "autoload": {
1076
+ "classmap": [
1077
+ "src/"
1078
+ ]
1079
+ },
1080
+ "notification-url": "https://packagist.org/downloads/",
1081
+ "license": [
1082
+ "BSD-3-Clause"
1083
+ ],
1084
+ "authors": [
1085
+ {
1086
+ "name": "Sebastian Bergmann",
1087
+ "email": "sebastian@phpunit.de"
1088
+ }
1089
+ ],
1090
+ "description": "Traverses array structures and object graphs to enumerate all referenced objects",
1091
+ "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
1092
+ "time": "2017-02-18T15:18:39+00:00"
1093
+ },
1094
+ {
1095
+ "name": "sebastian/recursion-context",
1096
+ "version": "2.0.0",
1097
+ "source": {
1098
+ "type": "git",
1099
+ "url": "https://github.com/sebastianbergmann/recursion-context.git",
1100
+ "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a"
1101
+ },
1102
+ "dist": {
1103
+ "type": "zip",
1104
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a",
1105
+ "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a",
1106
+ "shasum": ""
1107
+ },
1108
+ "require": {
1109
+ "php": ">=5.3.3"
1110
+ },
1111
+ "require-dev": {
1112
+ "phpunit/phpunit": "~4.4"
1113
+ },
1114
+ "type": "library",
1115
+ "extra": {
1116
+ "branch-alias": {
1117
+ "dev-master": "2.0.x-dev"
1118
+ }
1119
+ },
1120
+ "autoload": {
1121
+ "classmap": [
1122
+ "src/"
1123
+ ]
1124
+ },
1125
+ "notification-url": "https://packagist.org/downloads/",
1126
+ "license": [
1127
+ "BSD-3-Clause"
1128
+ ],
1129
+ "authors": [
1130
+ {
1131
+ "name": "Jeff Welch",
1132
+ "email": "whatthejeff@gmail.com"
1133
+ },
1134
+ {
1135
+ "name": "Sebastian Bergmann",
1136
+ "email": "sebastian@phpunit.de"
1137
+ },
1138
+ {
1139
+ "name": "Adam Harvey",
1140
+ "email": "aharvey@php.net"
1141
+ }
1142
+ ],
1143
+ "description": "Provides functionality to recursively process PHP variables",
1144
+ "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
1145
+ "time": "2016-11-19T07:33:16+00:00"
1146
+ },
1147
+ {
1148
+ "name": "sebastian/resource-operations",
1149
+ "version": "1.0.0",
1150
+ "source": {
1151
+ "type": "git",
1152
+ "url": "https://github.com/sebastianbergmann/resource-operations.git",
1153
+ "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52"
1154
+ },
1155
+ "dist": {
1156
+ "type": "zip",
1157
+ "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
1158
+ "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
1159
+ "shasum": ""
1160
+ },
1161
+ "require": {
1162
+ "php": ">=5.6.0"
1163
+ },
1164
+ "type": "library",
1165
+ "extra": {
1166
+ "branch-alias": {
1167
+ "dev-master": "1.0.x-dev"
1168
+ }
1169
+ },
1170
+ "autoload": {
1171
+ "classmap": [
1172
+ "src/"
1173
+ ]
1174
+ },
1175
+ "notification-url": "https://packagist.org/downloads/",
1176
+ "license": [
1177
+ "BSD-3-Clause"
1178
+ ],
1179
+ "authors": [
1180
+ {
1181
+ "name": "Sebastian Bergmann",
1182
+ "email": "sebastian@phpunit.de"
1183
+ }
1184
+ ],
1185
+ "description": "Provides a list of PHP built-in functions that operate on resources",
1186
+ "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
1187
+ "time": "2015-07-28T20:34:47+00:00"
1188
+ },
1189
+ {
1190
+ "name": "sebastian/version",
1191
+ "version": "2.0.1",
1192
+ "source": {
1193
+ "type": "git",
1194
+ "url": "https://github.com/sebastianbergmann/version.git",
1195
+ "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019"
1196
+ },
1197
+ "dist": {
1198
+ "type": "zip",
1199
+ "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019",
1200
+ "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019",
1201
+ "shasum": ""
1202
+ },
1203
+ "require": {
1204
+ "php": ">=5.6"
1205
+ },
1206
+ "type": "library",
1207
+ "extra": {
1208
+ "branch-alias": {
1209
+ "dev-master": "2.0.x-dev"
1210
+ }
1211
+ },
1212
+ "autoload": {
1213
+ "classmap": [
1214
+ "src/"
1215
+ ]
1216
+ },
1217
+ "notification-url": "https://packagist.org/downloads/",
1218
+ "license": [
1219
+ "BSD-3-Clause"
1220
+ ],
1221
+ "authors": [
1222
+ {
1223
+ "name": "Sebastian Bergmann",
1224
+ "email": "sebastian@phpunit.de",
1225
+ "role": "lead"
1226
+ }
1227
+ ],
1228
+ "description": "Library that helps with managing the version number of Git-hosted PHP projects",
1229
+ "homepage": "https://github.com/sebastianbergmann/version",
1230
+ "time": "2016-10-03T07:35:21+00:00"
1231
+ },
1232
+ {
1233
+ "name": "squizlabs/php_codesniffer",
1234
+ "version": "3.5.4",
1235
+ "source": {
1236
+ "type": "git",
1237
+ "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
1238
+ "reference": "dceec07328401de6211037abbb18bda423677e26"
1239
+ },
1240
+ "dist": {
1241
+ "type": "zip",
1242
+ "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dceec07328401de6211037abbb18bda423677e26",
1243
+ "reference": "dceec07328401de6211037abbb18bda423677e26",
1244
+ "shasum": ""
1245
+ },
1246
+ "require": {
1247
+ "ext-simplexml": "*",
1248
+ "ext-tokenizer": "*",
1249
+ "ext-xmlwriter": "*",
1250
+ "php": ">=5.4.0"
1251
+ },
1252
+ "require-dev": {
1253
+ "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
1254
+ },
1255
+ "bin": [
1256
+ "bin/phpcs",
1257
+ "bin/phpcbf"
1258
+ ],
1259
+ "type": "library",
1260
+ "extra": {
1261
+ "branch-alias": {
1262
+ "dev-master": "3.x-dev"
1263
+ }
1264
+ },
1265
+ "notification-url": "https://packagist.org/downloads/",
1266
+ "license": [
1267
+ "BSD-3-Clause"
1268
+ ],
1269
+ "authors": [
1270
+ {
1271
+ "name": "Greg Sherwood",
1272
+ "role": "lead"
1273
+ }
1274
+ ],
1275
+ "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
1276
+ "homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
1277
+ "keywords": [
1278
+ "phpcs",
1279
+ "standards"
1280
+ ],
1281
+ "time": "2020-01-30T22:20:29+00:00"
1282
+ },
1283
+ {
1284
+ "name": "symfony/polyfill-ctype",
1285
+ "version": "v1.13.1",
1286
+ "source": {
1287
+ "type": "git",
1288
+ "url": "https://github.com/symfony/polyfill-ctype.git",
1289
+ "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3"
1290
+ },
1291
+ "dist": {
1292
+ "type": "zip",
1293
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3",
1294
+ "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3",
1295
+ "shasum": ""
1296
+ },
1297
+ "require": {
1298
+ "php": ">=5.3.3"
1299
+ },
1300
+ "suggest": {
1301
+ "ext-ctype": "For best performance"
1302
+ },
1303
+ "type": "library",
1304
+ "extra": {
1305
+ "branch-alias": {
1306
+ "dev-master": "1.13-dev"
1307
+ }
1308
+ },
1309
+ "autoload": {
1310
+ "psr-4": {
1311
+ "Symfony\\Polyfill\\Ctype\\": ""
1312
+ },
1313
+ "files": [
1314
+ "bootstrap.php"
1315
+ ]
1316
+ },
1317
+ "notification-url": "https://packagist.org/downloads/",
1318
+ "license": [
1319
+ "MIT"
1320
+ ],
1321
+ "authors": [
1322
+ {
1323
+ "name": "Gert de Pagter",
1324
+ "email": "BackEndTea@gmail.com"
1325
+ },
1326
+ {
1327
+ "name": "Symfony Community",
1328
+ "homepage": "https://symfony.com/contributors"
1329
+ }
1330
+ ],
1331
+ "description": "Symfony polyfill for ctype functions",
1332
+ "homepage": "https://symfony.com",
1333
+ "keywords": [
1334
+ "compatibility",
1335
+ "ctype",
1336
+ "polyfill",
1337
+ "portable"
1338
+ ],
1339
+ "time": "2019-11-27T13:56:44+00:00"
1340
+ },
1341
+ {
1342
+ "name": "symfony/yaml",
1343
+ "version": "v4.4.4",
1344
+ "source": {
1345
+ "type": "git",
1346
+ "url": "https://github.com/symfony/yaml.git",
1347
+ "reference": "cd014e425b3668220adb865f53bff64b3ad21767"
1348
+ },
1349
+ "dist": {
1350
+ "type": "zip",
1351
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/cd014e425b3668220adb865f53bff64b3ad21767",
1352
+ "reference": "cd014e425b3668220adb865f53bff64b3ad21767",
1353
+ "shasum": ""
1354
+ },
1355
+ "require": {
1356
+ "php": "^7.1.3",
1357
+ "symfony/polyfill-ctype": "~1.8"
1358
+ },
1359
+ "conflict": {
1360
+ "symfony/console": "<3.4"
1361
+ },
1362
+ "require-dev": {
1363
+ "symfony/console": "^3.4|^4.0|^5.0"
1364
+ },
1365
+ "suggest": {
1366
+ "symfony/console": "For validating YAML files using the lint command"
1367
+ },
1368
+ "type": "library",
1369
+ "extra": {
1370
+ "branch-alias": {
1371
+ "dev-master": "4.4-dev"
1372
+ }
1373
+ },
1374
+ "autoload": {
1375
+ "psr-4": {
1376
+ "Symfony\\Component\\Yaml\\": ""
1377
+ },
1378
+ "exclude-from-classmap": [
1379
+ "/Tests/"
1380
+ ]
1381
+ },
1382
+ "notification-url": "https://packagist.org/downloads/",
1383
+ "license": [
1384
+ "MIT"
1385
+ ],
1386
+ "authors": [
1387
+ {
1388
+ "name": "Fabien Potencier",
1389
+ "email": "fabien@symfony.com"
1390
+ },
1391
+ {
1392
+ "name": "Symfony Community",
1393
+ "homepage": "https://symfony.com/contributors"
1394
+ }
1395
+ ],
1396
+ "description": "Symfony Yaml Component",
1397
+ "homepage": "https://symfony.com",
1398
+ "time": "2020-01-21T11:12:16+00:00"
1399
+ },
1400
+ {
1401
+ "name": "webmozart/assert",
1402
+ "version": "1.6.0",
1403
+ "source": {
1404
+ "type": "git",
1405
+ "url": "https://github.com/webmozart/assert.git",
1406
+ "reference": "573381c0a64f155a0d9a23f4b0c797194805b925"
1407
+ },
1408
+ "dist": {
1409
+ "type": "zip",
1410
+ "url": "https://api.github.com/repos/webmozart/assert/zipball/573381c0a64f155a0d9a23f4b0c797194805b925",
1411
+ "reference": "573381c0a64f155a0d9a23f4b0c797194805b925",
1412
+ "shasum": ""
1413
+ },
1414
+ "require": {
1415
+ "php": "^5.3.3 || ^7.0",
1416
+ "symfony/polyfill-ctype": "^1.8"
1417
+ },
1418
+ "conflict": {
1419
+ "vimeo/psalm": "<3.6.0"
1420
+ },
1421
+ "require-dev": {
1422
+ "phpunit/phpunit": "^4.8.36 || ^7.5.13"
1423
+ },
1424
+ "type": "library",
1425
+ "autoload": {
1426
+ "psr-4": {
1427
+ "Webmozart\\Assert\\": "src/"
1428
+ }
1429
+ },
1430
+ "notification-url": "https://packagist.org/downloads/",
1431
+ "license": [
1432
+ "MIT"
1433
+ ],
1434
+ "authors": [
1435
+ {
1436
+ "name": "Bernhard Schussek",
1437
+ "email": "bschussek@gmail.com"
1438
+ }
1439
+ ],
1440
+ "description": "Assertions to validate method input/output with nice error messages.",
1441
+ "keywords": [
1442
+ "assert",
1443
+ "check",
1444
+ "validate"
1445
+ ],
1446
+ "time": "2019-11-24T13:36:37+00:00"
1447
+ }
1448
+ ],
1449
+ "aliases": [],
1450
+ "minimum-stability": "stable",
1451
+ "stability-flags": [],
1452
+ "prefer-stable": false,
1453
+ "prefer-lowest": false,
1454
+ "platform": {
1455
+ "php": ">=5.5.0",
1456
+ "ext-curl": "*",
1457
+ "ext-json": "*"
1458
+ },
1459
+ "platform-dev": []
1460
+ }
vendor/jhut89/mailchimp3php/src/Mailchimp.php ADDED
@@ -0,0 +1,385 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI;
4
+
5
+ use MailchimpAPI\Requests\MailchimpConnection;
6
+ use MailchimpAPI\Requests\MailchimpRequest;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class Mailchimp
11
+ *
12
+ * @package Mailchimp_API
13
+ */
14
+ class Mailchimp
15
+ {
16
+ /**
17
+ * @var MailchimpRequest $request
18
+ */
19
+ public $request;
20
+
21
+ /**
22
+ * @var MailchimpSettings $settings
23
+ */
24
+ public $settings;
25
+
26
+ /**
27
+ * @var string
28
+ */
29
+ public $apikey;
30
+
31
+ /**
32
+ * Mailchimp constructor.
33
+ *
34
+ * @param string $apikey
35
+ *
36
+ * @throws MailchimpException
37
+ */
38
+ public function __construct($apikey)
39
+ {
40
+ $this->apikey = $apikey;
41
+ $this->request = new MailchimpRequest($this->apikey);
42
+ $this->settings = new MailchimpSettings();
43
+ }
44
+
45
+ /**
46
+ * Retrieves a new Account
47
+ * @return Resources\Account
48
+ */
49
+ public function account()
50
+ {
51
+ return new Resources\Account($this->request, $this->settings);
52
+ }
53
+
54
+ /**
55
+ * Retrieves a new AuthorizedApps instance.
56
+ *
57
+ * @param null $app_id The ID for an app if retrieving an instance
58
+ *
59
+ * @return Resources\AuthorizedApps
60
+ */
61
+ public function apps($app_id = null)
62
+ {
63
+ return new Resources\AuthorizedApps($this->request, $this->settings, $app_id);
64
+ }
65
+
66
+ /**
67
+ * @param null $workflow_id
68
+ *
69
+ * @return Resources\Automations
70
+ */
71
+ public function automations($workflow_id = null)
72
+ {
73
+ return new Resources\Automations($this->request, $this->settings, $workflow_id);
74
+ }
75
+
76
+ /**
77
+ * @param null $batch_id
78
+ *
79
+ * @return Resources\BatchOperations
80
+ */
81
+ public function batches($batch_id = null)
82
+ {
83
+ return new Resources\BatchOperations($this->request, $this->settings, $batch_id);
84
+ }
85
+
86
+ /**
87
+ * @param null $batch_webhook_id
88
+ *
89
+ * @return Resources\BatchWebhooks
90
+ */
91
+ public function batchWebhooks($batch_webhook_id = null)
92
+ {
93
+ return new Resources\BatchWebhooks($this->request, $this->settings, $batch_webhook_id);
94
+ }
95
+
96
+ /**
97
+ * @param null $folder_id
98
+ *
99
+ * @return Resources\CampaignFolders
100
+ */
101
+ public function campaignFolders($folder_id = null)
102
+ {
103
+ return new Resources\CampaignFolders($this->request, $this->settings, $folder_id);
104
+ }
105
+
106
+ /**
107
+ * @param null $campaign_id
108
+ *
109
+ * @return Resources\Campaigns
110
+ */
111
+ public function campaigns($campaign_id = null)
112
+ {
113
+ return new Resources\Campaigns($this->request, $this->settings, $campaign_id);
114
+ }
115
+
116
+ /**
117
+ * @param null $site_id
118
+ *
119
+ * @return Resources\ConnectedSites
120
+ */
121
+ public function connectedSites($site_id = null)
122
+ {
123
+ return new Resources\ConnectedSites($this->request, $this->settings, $site_id);
124
+ }
125
+
126
+ /**
127
+ * @param null $conversation_id
128
+ *
129
+ * @return Resources\Conversations
130
+ */
131
+ public function conversations($conversation_id = null)
132
+ {
133
+ return new Resources\Conversations($this->request, $this->settings, $conversation_id);
134
+ }
135
+
136
+
137
+ /**
138
+ * @param null $store_id
139
+ *
140
+ * @return Resources\EcommerceStores
141
+ */
142
+ public function ecommerceStores($store_id = null)
143
+ {
144
+ return new Resources\EcommerceStores($this->request, $this->settings, $store_id);
145
+ }
146
+
147
+ /**
148
+ * @param null $outreach_id
149
+ *
150
+ * @return Resources\FacebookAds
151
+ */
152
+ public function facebookAds($outreach_id = null)
153
+ {
154
+ return new Resources\FacebookAds($this->request, $this->settings, $outreach_id);
155
+ }
156
+
157
+ /**
158
+ * @param null $file_id
159
+ *
160
+ * @return Resources\FileManagerFiles
161
+ */
162
+ public function fileManagerFiles($file_id = null)
163
+ {
164
+ return new Resources\FileManagerFiles($this->request, $this->settings, $file_id);
165
+ }
166
+
167
+ /**
168
+ * @param null $folder_id
169
+ *
170
+ * @return Resources\FileManagerFolders
171
+ */
172
+ public function fileManagerFolders($folder_id = null)
173
+ {
174
+ return new Resources\FileManagerFolders($this->request, $this->settings, $folder_id);
175
+ }
176
+
177
+ /**
178
+ * @param null $outreach_id
179
+ *
180
+ * @return Resources\GoogleAds
181
+ */
182
+ public function googleAds($outreach_id = null)
183
+ {
184
+ return new Resources\GoogleAds($this->request, $this->settings, $outreach_id);
185
+ }
186
+
187
+ /**
188
+ * @param null $page_id
189
+ *
190
+ * @return Resources\LandingPages
191
+ */
192
+ public function landingPages($page_id = null)
193
+ {
194
+ return new Resources\LandingPages($this->request, $this->settings, $page_id);
195
+ }
196
+
197
+ /**
198
+ * @param null $list_id
199
+ *
200
+ * @return Resources\Lists
201
+ */
202
+ public function lists($list_id = null)
203
+ {
204
+ return new Resources\Lists($this->request, $this->settings, $list_id);
205
+ }
206
+
207
+ /**
208
+ * @return Resources\Ping
209
+ */
210
+ public function ping()
211
+ {
212
+ return new Resources\Ping($this->request, $this->settings);
213
+ }
214
+
215
+ /**
216
+ * @param null $campaign_id
217
+ *
218
+ * @return Resources\Reports
219
+ */
220
+ public function reports($campaign_id = null)
221
+ {
222
+ return new Resources\Reports($this->request, $this->settings, $campaign_id);
223
+ }
224
+
225
+ /**
226
+ * @return Resources\SearchCampaigns
227
+ */
228
+ public function searchCampaigns()
229
+ {
230
+ return new Resources\SearchCampaigns($this->request, $this->settings);
231
+ }
232
+
233
+ /**
234
+ * @return Resources\SearchMembers
235
+ */
236
+ public function searchMembers()
237
+ {
238
+ return new Resources\SearchMembers($this->request, $this->settings);
239
+ }
240
+
241
+ /**
242
+ * @param null $folder_id
243
+ *
244
+ * @return Resources\TemplateFolders
245
+ */
246
+ public function templateFolders($folder_id = null)
247
+ {
248
+ return new Resources\TemplateFolders($this->request, $this->settings, $folder_id);
249
+ }
250
+
251
+ /**
252
+ * @param null $template_id
253
+ *
254
+ * @return Resources\Templates
255
+ */
256
+ public function templates($template_id = null)
257
+ {
258
+ return new Resources\Templates($this->request, $this->settings, $template_id);
259
+ }
260
+
261
+ /**
262
+ * @param null $domain_name
263
+ *
264
+ * @return Resources\VerifiedDomains
265
+ */
266
+ public function verifiedDomains($domain_name = null)
267
+ {
268
+ return new Resources\VerifiedDomains($this->request, $this->settings, $domain_name);
269
+ }
270
+
271
+ /**
272
+ * Concatenate the auth URL given a client_id and redirect URI
273
+ *
274
+ * @param $client_id
275
+ * @param $redirect_uri
276
+ * @param $state
277
+ *
278
+ * @return string
279
+ */
280
+ public static function getAuthUrl(
281
+ $client_id,
282
+ $redirect_uri,
283
+ $state = null
284
+ ) {
285
+ $encoded_uri = urlencode($redirect_uri);
286
+
287
+ $authUrl = "https://login.mailchimp.com/oauth2/authorize";
288
+ $authUrl .= "?client_id=" . $client_id;
289
+ $authUrl .= "&redirect_uri=" . $encoded_uri;
290
+ $authUrl .= "&response_type=code";
291
+
292
+ if ($state !== null) {
293
+ $authUrl .= "&state=" . $state;
294
+ }
295
+
296
+ return $authUrl;
297
+ }
298
+
299
+ /**
300
+ * Handle the "handshake" to retrieve an api key via OAuth
301
+ *
302
+ * @param $code
303
+ * @param $client_id
304
+ * @param $client_sec
305
+ * @param $redirect_uri
306
+ *
307
+ * @return string
308
+ * @throws MailchimpException
309
+ */
310
+ public static function oauthExchange(
311
+ $code,
312
+ $client_id,
313
+ $client_sec,
314
+ $redirect_uri
315
+ ) {
316
+ $encoded_uri = urldecode($redirect_uri);
317
+
318
+ $oauth_string = "grant_type=authorization_code";
319
+ $oauth_string .= "&client_id=" . $client_id;
320
+ $oauth_string .= "&client_secret=" . $client_sec;
321
+ $oauth_string .= "&redirect_uri=" . $encoded_uri;
322
+ $oauth_string .= "&code=" . $code;
323
+
324
+ $request = new MailchimpRequest();
325
+
326
+ $access_token = self::requestAccessToken($oauth_string, $request);
327
+ $request->reset();
328
+
329
+ $apiKey = self::requestKeyFromToken($access_token, $request);
330
+
331
+ return $apiKey;
332
+ }
333
+
334
+ /**
335
+ * Request an access token from Mailchimp
336
+ *
337
+ * @param string $oauth_string
338
+ * @param MailchimpRequest $request
339
+ *
340
+ * @return mixed
341
+ * @throws MailchimpException
342
+ */
343
+ private static function requestAccessToken($oauth_string, MailchimpRequest $request)
344
+ {
345
+ $request->setMethod("POST");
346
+ $request->setPayload($oauth_string, false);
347
+ $request->setBaseUrl(MailchimpConnection::TOKEN_REQUEST_URL);
348
+
349
+ $connection = new MailchimpConnection($request);
350
+ $response = $connection->execute();
351
+
352
+ $access_token = $response->deserialize()->access_token;
353
+
354
+ if (!$access_token) {
355
+ throw new MailchimpException(
356
+ 'MailChimp did not return an access token'
357
+ );
358
+ }
359
+
360
+ return $access_token;
361
+ }
362
+
363
+ /**
364
+ * Construct an API key by requesting an access tokens data center
365
+ *
366
+ * @param string $access_token
367
+ * @param MailchimpRequest $request
368
+ *
369
+ * @return string
370
+ * @throws MailchimpException
371
+ */
372
+ private static function requestKeyFromToken($access_token, MailchimpRequest $request)
373
+ {
374
+ $request->setMethod("GET");
375
+ $request->setBaseUrl(MailchimpConnection::OAUTH_METADATA_URL);
376
+ $request->addHeader('Authorization: OAuth ' . $access_token);
377
+
378
+ $connection = new MailchimpConnection($request);
379
+ $response = $connection->execute();
380
+
381
+ $dc = $response->deserialize()->dc;
382
+
383
+ return $access_token . '-' . $dc;
384
+ }
385
+ }
vendor/jhut89/mailchimp3php/src/MailchimpException.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI;
4
+
5
+ /**
6
+ * Class MailchimpException
7
+ * @package MailchimpAPI
8
+ */
9
+ class MailchimpException extends \Exception
10
+ {
11
+ /**
12
+ * @var
13
+ */
14
+ public $message;
15
+ /**
16
+ * @var null
17
+ */
18
+ public $output;
19
+
20
+ /**
21
+ * MailchimpException constructor.
22
+ * @param $message
23
+ * @param null $output
24
+ */
25
+ public function __construct($message, $output = null)
26
+ {
27
+ $this->message = $message;
28
+ $this->output = $output;
29
+ }
30
+ }
vendor/jhut89/mailchimp3php/src/Requests/HttpRequest.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Requests;
4
+
5
+ /**
6
+ * Interface HttpRequest
7
+ * @package MailchimpAPI\Requests
8
+ */
9
+ interface HttpRequest
10
+ {
11
+
12
+ /**
13
+ * @param $name
14
+ * @param $value
15
+ *
16
+ * @return mixed
17
+ */
18
+ public function setOption($name, $value);
19
+
20
+ /**
21
+ * @return mixed
22
+ */
23
+ public function executeCurl();
24
+
25
+ /**
26
+ * @param $name
27
+ *
28
+ * @return mixed
29
+ */
30
+ public function getInfo($name);
31
+
32
+ /**
33
+ * @return string
34
+ */
35
+ public function getError();
36
+
37
+ /**
38
+ * @return mixed
39
+ */
40
+ public function close();
41
+ }
vendor/jhut89/mailchimp3php/src/Requests/MailchimpConnection.php ADDED
@@ -0,0 +1,328 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Requests;
4
+
5
+ use MailchimpAPI\MailchimpException;
6
+ use MailchimpAPI\Responses\FailureResponse;
7
+ use MailchimpAPI\Responses\MailchimpResponse;
8
+ use MailchimpAPI\Responses\SuccessResponse;
9
+ use MailchimpAPI\Settings\MailchimpSettings;
10
+
11
+ /**
12
+ * Class MailchimpConnection
13
+ * @package MailchimpAPI\Requests
14
+ */
15
+ class MailchimpConnection implements HttpRequest
16
+ {
17
+
18
+ /**
19
+ * Custom user agent for this library
20
+ */
21
+ const USER_AGENT = 'jhut89/Mailchimp-API-3.0-PHP (https://github.com/Jhut89/Mailchimp-API-3.0-PHP)';
22
+
23
+ /**
24
+ * The url used to request an access token from mailchimp
25
+ */
26
+ const TOKEN_REQUEST_URL = 'https://login.mailchimp.com/oauth2/token';
27
+
28
+ /**
29
+ * The url used to request metadata about an access token
30
+ */
31
+ const OAUTH_METADATA_URL = 'https://login.mailchimp.com/oauth2/metadata/';
32
+
33
+ /**
34
+ * The current request object passed into this connection
35
+ * @var MailchimpRequest
36
+ */
37
+ private $current_request;
38
+
39
+ /**
40
+ * The current settings object passed into this connection
41
+ * @var MailChimpSettings
42
+ */
43
+ private $current_settings;
44
+
45
+ /**
46
+ * Raw response from mailchimp api
47
+ * @var string
48
+ */
49
+ private $response;
50
+
51
+ /**
52
+ * Response body
53
+ * @var string
54
+ */
55
+ private $response_body;
56
+
57
+ /**
58
+ * An integer representation of the http response code
59
+ * @var int
60
+ */
61
+ private $http_code;
62
+
63
+ /**
64
+ * The parsed response headers from the request
65
+ * @var array
66
+ */
67
+ private $headers = [];
68
+
69
+ /**
70
+ * The curl handle for this connection
71
+ * @var resource
72
+ */
73
+ private $handle;
74
+
75
+ /**
76
+ * A holder for the option that are set on this connections handle
77
+ * @var array
78
+ */
79
+ private $current_options = [];
80
+
81
+
82
+ /**
83
+ * MailchimpConnection constructor.
84
+ *
85
+ * @param MailchimpRequest $request
86
+ * @param MailchimpSettings|null $settings
87
+ *
88
+ * @throws MailchimpException
89
+ */
90
+ public function __construct(MailchimpRequest &$request, MailchimpSettings &$settings = null)
91
+ {
92
+ $this->current_request = $request;
93
+
94
+ $settings ?
95
+ $this->current_settings = $settings :
96
+ $this->current_settings = new MailchimpSettings();
97
+
98
+ $this->handle = curl_init();
99
+
100
+ $this->prepareHandle();
101
+ $this->setHandlerOptionsForMethod();
102
+ }
103
+
104
+ /**
105
+ * Prepares this connections handle for execution
106
+ *
107
+ * @return void
108
+ *
109
+ * @throws MailchimpException
110
+ */
111
+ private function prepareHandle()
112
+ {
113
+ // set the URL for this request
114
+ $this->setOption(CURLOPT_URL, $this->current_request->getUrl());
115
+
116
+ // set headers to be sent
117
+ $this->setOption(CURLOPT_HTTPHEADER, $this->current_request->getHeaders());
118
+
119
+ // set custom user-agent
120
+ $this->setOption(CURLOPT_USERAGENT, self::USER_AGENT);
121
+
122
+ // make response returnable
123
+ $this->setOption(CURLOPT_RETURNTRANSFER, true);
124
+
125
+ // get headers in return
126
+ $this->setOption(CURLOPT_HEADER, true);
127
+
128
+ // set verify ssl
129
+ $this->setOption(CURLOPT_SSL_VERIFYPEER, $this->current_settings->shouldVerifySsl());
130
+
131
+ // set the callback to run against each of the response headers
132
+ $this->setOption(CURLOPT_HEADERFUNCTION, [&$this, "parseResponseHeader"]);
133
+
134
+ // if an custom curl settings are present set them now
135
+ $this->setCustomHandleOptions($this->current_settings->getCustomCurlSettings());
136
+ }
137
+
138
+ /**
139
+ * Set custom curl handler options
140
+ *
141
+ * @param array $options
142
+ */
143
+ private function setCustomHandleOptions(array $options)
144
+ {
145
+ if (!empty($options)) {
146
+ foreach ($options as $option => $value) {
147
+ $this->setOption($option, $value);
148
+ }
149
+ }
150
+ }
151
+
152
+ /**
153
+ * Prepares the handler for a request based on the requests method
154
+ * @return void
155
+ */
156
+ private function setHandlerOptionsForMethod()
157
+ {
158
+ $method = $this->current_request->getMethod();
159
+
160
+ switch ($method) {
161
+ case MailchimpRequest::POST:
162
+ $this->setOption(CURLOPT_POST, true);
163
+ $this->setOption(CURLOPT_POSTFIELDS, $this
164
+ ->current_request
165
+ ->getPayload());
166
+ break;
167
+ case MailchimpRequest::PUT:
168
+ case MailchimpRequest::PATCH:
169
+ $this->setOption(CURLOPT_CUSTOMREQUEST, $method);
170
+ $this->setOption(CURLOPT_POSTFIELDS, $this
171
+ ->current_request
172
+ ->getPayload());
173
+ break;
174
+ case MailchimpRequest::DELETE:
175
+ $this->setOption(CURLOPT_CUSTOMREQUEST, $method);
176
+ break;
177
+ }
178
+ }
179
+
180
+ /**
181
+ * Executes a connection with the current request and settings
182
+ *
183
+ * @param bool $close close this connection after execution
184
+ *
185
+ * @return MailchimpResponse
186
+ * @throws MailchimpException
187
+ */
188
+ public function execute($close = true)
189
+ {
190
+ $this->response = $this->executeCurl();
191
+ if (!$this->response) {
192
+ throw new MailchimpException("The curl request failed: " . $this->getError());
193
+ }
194
+
195
+ $this->http_code = $this->getInfo(CURLINFO_HTTP_CODE);
196
+ $head_len = $this->getInfo(CURLINFO_HEADER_SIZE);
197
+ $this->response_body = substr(
198
+ $this->response,
199
+ $head_len,
200
+ strlen($this->response)
201
+ );
202
+
203
+ if ($close) {
204
+ $this->close();
205
+ }
206
+
207
+ if ($this->isSuccess()) {
208
+ return new SuccessResponse(
209
+ $this->headers,
210
+ $this->response_body,
211
+ $this->http_code,
212
+ $this->current_request->getSuccessCallback()
213
+ );
214
+ } else {
215
+ return new FailureResponse(
216
+ $this->headers,
217
+ $this->response_body,
218
+ $this->http_code,
219
+ $this->current_request->getFailureCallback()
220
+ );
221
+ }
222
+ }
223
+
224
+ /**
225
+ * Gets the currently set curl options by key
226
+ *
227
+ * @param $key
228
+ *
229
+ * @return mixed
230
+ */
231
+ public function getCurrentOption($key)
232
+ {
233
+ return $this->current_options[$key];
234
+ }
235
+
236
+ /**
237
+ * Bulk set curl options
238
+ * Update current settings
239
+ *
240
+ * @param array $options
241
+ */
242
+ public function setCurrentOptions($options)
243
+ {
244
+ $this->current_options = [];
245
+ foreach ($options as $option_name => $option_value) {
246
+ $this->setOption($option_name, $option_value);
247
+ }
248
+ }
249
+
250
+ /**
251
+ * Sets a curl option on the handler
252
+ * Updates the current settings array with ne setting
253
+ * @inheritdoc
254
+ */
255
+ public function setOption($name, $value)
256
+ {
257
+ curl_setopt($this->handle, $name, $value);
258
+ $this->current_options[$name] = $value;
259
+ }
260
+
261
+ /**
262
+ * @inheritdoc
263
+ */
264
+ public function executeCurl()
265
+ {
266
+ return curl_exec($this->handle);
267
+ }
268
+
269
+ /**
270
+ * @inheritdoc
271
+ */
272
+ public function getInfo($name)
273
+ {
274
+ return curl_getinfo($this->handle, $name);
275
+ }
276
+
277
+ /**
278
+ * @return string
279
+ */
280
+ public function getError()
281
+ {
282
+ return curl_error($this->handle);
283
+ }
284
+
285
+ /**
286
+ * @inheritdoc
287
+ */
288
+ public function close()
289
+ {
290
+ curl_close($this->handle);
291
+ }
292
+
293
+ /**
294
+ * Called statically during prepareHandle();
295
+ *
296
+ * @param $handle
297
+ * @param $header
298
+ *
299
+ * @return int
300
+ */
301
+ private function parseResponseHeader($handle, $header)
302
+ {
303
+ $header_length = strlen($header);
304
+ $header_array = explode(':', $header, 2);
305
+ if (count($header_array) == 2) {
306
+ $this->pushToHeaders($header_array);
307
+ }
308
+
309
+ return $header_length;
310
+ }
311
+
312
+ /**
313
+ * @param array $header
314
+ */
315
+ private function pushToHeaders($header)
316
+ {
317
+ $this->headers[$header[0]] = trim($header[1]);
318
+ }
319
+
320
+ /**
321
+ * A function for evaluating if a connection was successful
322
+ * @return bool
323
+ */
324
+ private function isSuccess()
325
+ {
326
+ return ($this->http_code > 199 && $this->http_code < 300);
327
+ }
328
+ }
vendor/jhut89/mailchimp3php/src/Requests/MailchimpRequest.php ADDED
@@ -0,0 +1,465 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Requests;
4
+
5
+ use MailchimpAPI\MailchimpException;
6
+
7
+ /**
8
+ * Class MailchimpRequest
9
+ *
10
+ * A class for structuring a request for
11
+ * and MailChimp API
12
+ *
13
+ * @package Mailchimp_API\Requests
14
+ */
15
+ class MailchimpRequest
16
+ {
17
+ /**
18
+ * GET
19
+ */
20
+ const GET = "GET";
21
+
22
+ /**
23
+ * POST
24
+ */
25
+ const POST = "POST";
26
+
27
+ /**
28
+ * PUT
29
+ */
30
+ const PUT = "PUT";
31
+
32
+ /**
33
+ * PATCH
34
+ */
35
+ const PATCH = "PATCH";
36
+
37
+ /**
38
+ * DELETE
39
+ */
40
+ const DELETE = "DELETE";
41
+
42
+ /**
43
+ * An array of valid methods that can be used for a request
44
+ * @var array
45
+ */
46
+ private static $valid_methods = [self::GET, self::POST, self::PATCH, self::PUT, self::DELETE];
47
+
48
+ /*************************************
49
+ * Request Components
50
+ *************************************/
51
+
52
+ /**
53
+ * The base URL for a request
54
+ * @var string
55
+ */
56
+ private $base_url;
57
+
58
+ /**
59
+ * The endpoint portion of the URL
60
+ * @var string
61
+ */
62
+ private $endpoint;
63
+
64
+ /**
65
+ * The query string for the request URL
66
+ * @var string
67
+ */
68
+ private $query_string;
69
+
70
+
71
+ /**
72
+ * The exploded API key
73
+ * @var array
74
+ */
75
+ private $exp_apikey;
76
+
77
+ /**
78
+ * The API key used to set the auth header
79
+ * @var null
80
+ */
81
+ private $apikey;
82
+
83
+ /**
84
+ * The payload that is serialized and sent
85
+ * @var object
86
+ */
87
+ private $payload;
88
+
89
+ /**
90
+ * The method for this request
91
+ * @var string
92
+ */
93
+ private $method;
94
+
95
+ /**
96
+ * The headers for this request
97
+ * @var array
98
+ */
99
+ private $headers;
100
+
101
+ /**
102
+ * The success callback to be executed on a successful request
103
+ * @var callable
104
+ */
105
+ private $success_callback;
106
+
107
+ /**
108
+ * The failure callback to be executed on a failed request
109
+ * @var callable
110
+ */
111
+ private $failure_callback;
112
+
113
+ /**
114
+ * MailchimpRequest constructor.
115
+ *
116
+ * @param $apikey
117
+ *
118
+ * @throws MailchimpException
119
+ */
120
+ public function __construct($apikey = null)
121
+ {
122
+ if (!$apikey) {
123
+ $this->setHeaders([]);
124
+ return;
125
+ }
126
+
127
+ $this->apikey = $apikey;
128
+ $this->exp_apikey = explode('-', trim($apikey));
129
+ $this->setAuth();
130
+ $this->checkKey($this->exp_apikey);
131
+ $data_center = $this->exp_apikey[1];
132
+
133
+ $this->setBaseUrl("Https://" . $data_center . ".api.mailchimp.com/3.0");
134
+ }
135
+
136
+ /*************************************
137
+ * GETTERS
138
+ *************************************/
139
+
140
+ /**
141
+ * Get the APi key
142
+ * @return mixed
143
+ */
144
+ public function getApikey()
145
+ {
146
+ return $this->apikey;
147
+ }
148
+
149
+ /**
150
+ * Get the endpoint
151
+ * @return mixed
152
+ */
153
+ public function getEndpoint()
154
+ {
155
+ return $this->endpoint;
156
+ }
157
+
158
+ /**
159
+ * Get the exploded api key
160
+ * @return mixed
161
+ */
162
+ public function getExpApikey()
163
+ {
164
+ return $this->exp_apikey;
165
+ }
166
+
167
+ /**
168
+ * Get the payload
169
+ * @return mixed
170
+ */
171
+ public function getPayload()
172
+ {
173
+ return $this->payload;
174
+ }
175
+
176
+ /**
177
+ * Get the method
178
+ * @return mixed
179
+ */
180
+ public function getMethod()
181
+ {
182
+ return $this->method;
183
+ }
184
+
185
+ /**
186
+ * Get the base URL
187
+ * @return mixed
188
+ */
189
+ public function getBaseUrl()
190
+ {
191
+ return $this->base_url;
192
+ }
193
+
194
+ /**
195
+ * Get the valid methods
196
+ * @return array
197
+ */
198
+ public function getValidMethods()
199
+ {
200
+ return self::$valid_methods;
201
+ }
202
+
203
+ /**
204
+ * Get the headers
205
+ * @return array
206
+ * @throws MailchimpException
207
+ */
208
+ public function getHeaders()
209
+ {
210
+ if (!is_array($this->headers)) {
211
+ throw new MailchimpException("Request headers must be of type array");
212
+ }
213
+ return $this->headers;
214
+ }
215
+
216
+ /**
217
+ * Gets the entire request URI
218
+ * @return string
219
+ */
220
+ public function getUrl()
221
+ {
222
+ return $this->base_url . $this->endpoint . $this->query_string;
223
+ }
224
+
225
+ /**
226
+ * Get the success callback
227
+ * @return callable
228
+ */
229
+ public function getSuccessCallback()
230
+ {
231
+ return $this->success_callback;
232
+ }
233
+
234
+ /**
235
+ * Get the failure callback
236
+ * @return callable
237
+ */
238
+ public function getFailureCallback()
239
+ {
240
+ return $this->failure_callback;
241
+ }
242
+
243
+ /*************************************
244
+ * SETTERS
245
+ *************************************/
246
+
247
+ /**
248
+ * Set the api key
249
+ *
250
+ * @param mixed $apikey
251
+ */
252
+ public function setApikey($apikey)
253
+ {
254
+ $this->apikey = $apikey;
255
+ }
256
+
257
+ /**
258
+ * Sets the Authorization header for this request
259
+ */
260
+ public function setAuth()
261
+ {
262
+ if (!is_array($this->headers)) {
263
+ $this->setHeaders([]);
264
+ }
265
+ array_push($this->headers, 'Authorization: apikey ' . $this->apikey);
266
+ }
267
+
268
+ /**
269
+ * Sets the payload for a request
270
+ *
271
+ * @param mixed $payload
272
+ * @param boolean $shouldSerialize
273
+ *
274
+ * @throws MailchimpException when cant serialize payload
275
+ */
276
+ public function setPayload($payload, $shouldSerialize = true)
277
+ {
278
+ if ($shouldSerialize) {
279
+ $payload = $this->serializePayload($payload);
280
+ }
281
+ $this->payload = $payload;
282
+ }
283
+
284
+ /**
285
+ * Sets the endpoint for the request
286
+ *
287
+ * @param mixed $endpoint
288
+ */
289
+ public function setEndpoint($endpoint)
290
+ {
291
+ $this->endpoint = $endpoint;
292
+ }
293
+
294
+ /**
295
+ * Sets the request method
296
+ *
297
+ * @param mixed $method
298
+ *
299
+ * @throws MailchimpException
300
+ */
301
+ public function setMethod($method)
302
+ {
303
+ if (!in_array($method, self::$valid_methods)) {
304
+ throw new MailchimpException("Method not allowed");
305
+ }
306
+
307
+ $this->method = $method;
308
+ }
309
+
310
+ /**
311
+ * Sets the base URL
312
+ *
313
+ * @param mixed $base_url
314
+ */
315
+ public function setBaseUrl($base_url)
316
+ {
317
+ $this->base_url = $base_url;
318
+ }
319
+
320
+ /**
321
+ * Sets the query string from an array
322
+ *
323
+ * @param array $query_array
324
+ */
325
+ public function setQueryString($query_array)
326
+ {
327
+ $this->query_string = $this->constructQueryParams($query_array);
328
+ }
329
+
330
+ /**
331
+ * Sets the request headers
332
+ *
333
+ * @param array $headers
334
+ */
335
+ public function setHeaders($headers)
336
+ {
337
+ $this->headers = $headers;
338
+ }
339
+
340
+ /**
341
+ * Sets the success callback
342
+ *
343
+ * @param callable $success_callback
344
+ */
345
+ public function setSuccessCallback(callable $success_callback)
346
+ {
347
+ $this->success_callback = $success_callback;
348
+ }
349
+
350
+ /**
351
+ * Sets the failure callback
352
+ *
353
+ * @param callable $failure_callback
354
+ */
355
+ public function setFailureCallback(callable $failure_callback)
356
+ {
357
+ $this->failure_callback = $failure_callback;
358
+ }
359
+
360
+ /*************************************
361
+ * Helpers
362
+ *************************************/
363
+
364
+ /**
365
+ * JSON serializes the current payload
366
+ *
367
+ * @param $payload
368
+ *
369
+ * @return mixed
370
+ * @throws MailchimpException
371
+ */
372
+ public function serializePayload($payload)
373
+ {
374
+ $encoded = json_encode($payload);
375
+
376
+ if (!$encoded) {
377
+ throw new MailchimpException("Unable to serialize payload");
378
+ }
379
+
380
+ return $encoded;
381
+ }
382
+
383
+ /**
384
+ * Construct a query string from an array
385
+ *
386
+ * @param array $query_input
387
+ *
388
+ * @return string
389
+ */
390
+ public function constructQueryParams($query_input)
391
+ {
392
+ $query_string = '?';
393
+ foreach ($query_input as $parameter => $value) {
394
+ $encoded_value = urlencode($value);
395
+ $query_string .= $parameter . '=' . $encoded_value . '&';
396
+ }
397
+ $query_string = trim($query_string, '&');
398
+ return $query_string;
399
+ }
400
+
401
+ /**
402
+ * Adds a new header
403
+ *
404
+ * @param string $header_string
405
+ */
406
+ public function addHeader($header_string)
407
+ {
408
+ if (!is_array($this->headers)) {
409
+ $this->headers = [];
410
+ }
411
+ array_push($this->headers, $header_string);
412
+ }
413
+
414
+ /**
415
+ * Pushes a string to the end of the current endpoint
416
+ *
417
+ * @param string $string
418
+ */
419
+ public function appendToEndpoint($string)
420
+ {
421
+ $this->endpoint = $this->endpoint .= $string;
422
+ }
423
+
424
+ /**
425
+ * Checks for a valid API key
426
+ *
427
+ * @param $exp_apikey
428
+ *
429
+ * @throws MailchimpException
430
+ */
431
+ public function checkKey($exp_apikey)
432
+ {
433
+
434
+ if (strlen($exp_apikey[0]) < 10) {
435
+ throw new MailchimpException('You must provide a valid API key');
436
+ }
437
+
438
+ if (!isset($exp_apikey[1])) {
439
+ throw new MailchimpException(
440
+ 'You must provided the data-center at the end of your API key'
441
+ );
442
+ }
443
+ }
444
+
445
+ /**
446
+ * Returns a new request using the same APIkey
447
+ * @throws MailchimpException
448
+ */
449
+ public function reset()
450
+ {
451
+ $apikey = $this->apikey;
452
+ $request_vars = get_object_vars($this);
453
+ foreach ($request_vars as $key => $value) {
454
+ if (in_array($key, ['success_callback', 'failure_callback'], true)) {
455
+ continue;
456
+ }
457
+
458
+ $this->$key = null;
459
+ if ('headers' === $key) {
460
+ $this->$key = [];
461
+ }
462
+ }
463
+ self::__construct($apikey);
464
+ }
465
+ }
vendor/jhut89/mailchimp3php/src/Resources/Account.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Settings\MailchimpSettings;
7
+
8
+ /**
9
+ * Class Account
10
+ * is a representation of the root of the mailchimp api
11
+ * @package Mailchimp_API\Resources
12
+ */
13
+ class Account extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/';
19
+
20
+
21
+ /**
22
+ * Account constructor.
23
+ * @param MailchimpRequest $request
24
+ * @param MailchimpSettings $settings
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ $request->appendToEndpoint(self::URL_COMPONENT);
30
+ }
31
+ }
vendor/jhut89/mailchimp3php/src/Resources/ApiResource.php ADDED
@@ -0,0 +1,246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ namespace MailchimpAPI\Resources;
5
+
6
+
7
+ use MailchimpAPI\MailchimpException;
8
+ use MailchimpAPI\Requests\MailchimpConnection;
9
+ use MailchimpAPI\Requests\MailchimpRequest;
10
+ use MailchimpAPI\Responses\MailchimpResponse;
11
+ use MailchimpAPI\Settings\MailchimpSettings;
12
+
13
+ /**
14
+ * Class ApiResource
15
+ * @package MailchimpAPI\Resources
16
+ */
17
+ abstract class ApiResource
18
+ {
19
+ /**
20
+ * @var MailchimpRequest
21
+ */
22
+ private $request;
23
+
24
+ /**
25
+ * @var MailchimpSettings
26
+ */
27
+ private $settings;
28
+
29
+ /**
30
+ * ApiResource constructor.
31
+ *
32
+ * @param MailchimpRequest $request
33
+ * @param MailchimpSettings|null $settings
34
+ */
35
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings = null)
36
+ {
37
+ $this->setRequest($request);
38
+ $this->setSettings($settings);
39
+ }
40
+
41
+ /**
42
+ * @return MailchimpRequest
43
+ */
44
+ public function getRequest()
45
+ {
46
+ return $this->request;
47
+ }
48
+
49
+ /**
50
+ * @param mixed $request
51
+ */
52
+ public function setRequest($request)
53
+ {
54
+ $this->request = $request;
55
+ }
56
+
57
+ /**
58
+ * @return mixed
59
+ */
60
+ public function getSettings()
61
+ {
62
+ return $this->settings;
63
+ }
64
+
65
+ /**
66
+ * @param mixed $settings
67
+ */
68
+ public function setSettings($settings)
69
+ {
70
+ $this->settings = $settings;
71
+ }
72
+
73
+ /*************************************
74
+ * BEGIN METHOD FUNCTIONS
75
+ *************************************/
76
+
77
+ /**
78
+ * Makes a get request using the current request
79
+ *
80
+ * @param array $query_params an array of query parameters you want to send
81
+ *
82
+ * @return MailchimpResponse
83
+ * @throws MailchimpException
84
+ */
85
+ public function get($query_params = [])
86
+ {
87
+ $this->request->setMethod(MailchimpRequest::GET);
88
+ $this->request->setQueryString($query_params);
89
+
90
+ $connection = $this->getConnection($this->request, $this->settings);
91
+ $response = $connection->execute();
92
+ $this->resetRequest();
93
+
94
+ return $response;
95
+ }
96
+
97
+
98
+ /**
99
+ * Makes a post request using the current request
100
+ *
101
+ * @param array $params the payload you want to send
102
+ *
103
+ * @return MailchimpResponse
104
+ * @throws MailchimpException
105
+ */
106
+ public function post($params = [])
107
+ {
108
+ $this->request->setMethod(MailchimpRequest::POST);
109
+ $this->request->setPayload($params);
110
+
111
+ $connection = $this->getConnection($this->request, $this->settings);
112
+ $response = $connection->execute();
113
+ $this->resetRequest();
114
+
115
+ return $response;
116
+ }
117
+
118
+ /**
119
+ * Makes a patch request using the current request
120
+ *
121
+ * @param array $params the payload you want to send
122
+ *
123
+ * @return MailchimpResponse
124
+ * @throws MailchimpException
125
+ */
126
+ public function patch($params = [])
127
+ {
128
+ $this->request->setMethod(MailchimpRequest::PATCH);
129
+ $this->request->setPayload($params);
130
+
131
+ $connection = $this->getConnection($this->request, $this->settings);
132
+ $response = $connection->execute();
133
+ $this->resetRequest();
134
+
135
+ return $response;
136
+ }
137
+
138
+ /**
139
+ * Makes a put request using the current request
140
+ *
141
+ * @param array $params the payload you want to send
142
+ *
143
+ * @return MailchimpResponse
144
+ * @throws MailchimpException
145
+ */
146
+ public function put($params = [])
147
+ {
148
+ $this->request->setMethod(MailchimpRequest::PUT);
149
+ $this->request->setPayload($params);
150
+
151
+ $connection = $this->getConnection($this->request, $this->settings);
152
+ $response = $connection->execute();
153
+ $this->resetRequest();
154
+
155
+ return $response;
156
+ }
157
+
158
+ /**
159
+ * Makes a delete request using the current request
160
+ * @return MailchimpResponse
161
+ * @throws MailchimpException
162
+ */
163
+ public function delete()
164
+ {
165
+ $this->request->setMethod(MailchimpRequest::DELETE);
166
+
167
+ $connection = $this->getConnection($this->request, $this->settings);
168
+ $response = $connection->execute();
169
+ $this->resetRequest();
170
+
171
+ return $response;
172
+ }
173
+
174
+ /*************************************
175
+ * BEGIN HELPER METHODS
176
+ *************************************/
177
+
178
+ /**
179
+ * Returns a new connection from a request and settings
180
+ *
181
+ * @param MailchimpRequest $request
182
+ * @param MailchimpSettings $settings
183
+ *
184
+ * @return MailchimpConnection
185
+ * @throws MailchimpException
186
+ */
187
+ protected function getConnection(MailchimpRequest $request, MailchimpSettings $settings)
188
+ {
189
+ $connection = new MailchimpConnection($request, $settings);
190
+ return $connection;
191
+ }
192
+
193
+ /**
194
+ * Resets the request with the same API Key
195
+ * @throws MailchimpException
196
+ */
197
+ private function resetRequest()
198
+ {
199
+ $this->request->reset();
200
+ }
201
+
202
+ /**
203
+ * Throws an exception if $check evaluates false
204
+ *
205
+ * @param string $type the type of check
206
+ * @param mixed $check the variable under test
207
+ *
208
+ * @throws MailchimpException
209
+ */
210
+ protected function throwIfNot($type, $check)
211
+ {
212
+ if (!$check) {
213
+ switch ($type) {
214
+ case "id":
215
+ throw new MailchimpException("You must provide an ID to " . debug_backtrace()[1]['function']);
216
+ default:
217
+ throw new MailchimpException(
218
+ "An Exception was triggered in a check in " . debug_backtrace()[1]['function']
219
+ );
220
+ }
221
+ }
222
+ }
223
+
224
+ /**
225
+ * Makes a post request to an action endpoint on an API resource
226
+ *
227
+ * @param string $endpoint
228
+ * @param array $params
229
+ *
230
+ * @return MailchimpResponse
231
+ * @throws MailchimpException
232
+ */
233
+ protected function postToActionEndpoint($endpoint, $params = [])
234
+ {
235
+ $this->request->appendToEndpoint($endpoint);
236
+ $this->request->setMethod(MailchimpRequest::POST);
237
+ if (!empty($params)) {
238
+ $this->request->setPayload($params);
239
+ }
240
+
241
+ $connection = $this->getConnection($this->request, $this->settings);
242
+ $response = $connection->execute();
243
+ $this->resetRequest();
244
+ return $response;
245
+ }
246
+ }
vendor/jhut89/mailchimp3php/src/Resources/AuthorizedApps.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Settings\MailchimpSettings;
7
+
8
+ /**
9
+ * Class AuthorizedApps
10
+ * @package MailchimpAPI\Resources
11
+ */
12
+ class AuthorizedApps extends ApiResource
13
+ {
14
+ /**
15
+ * The url component for this endpoint
16
+ */
17
+ const URL_COMPONENT = '/authorized-apps/';
18
+
19
+
20
+ /**
21
+ * AuthorizedApps constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ * @param $app_id
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $app_id = null)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ $request->appendToEndpoint(self::URL_COMPONENT . $app_id);
30
+ }
31
+ }
vendor/jhut89/mailchimp3php/src/Resources/Automations.php ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources;
4
+
5
+ use MailchimpAPI\MailchimpException;
6
+ use MailchimpAPI\Resources\Automations\Emails;
7
+ use MailchimpAPI\Resources\Automations\RemovedSubscribers;
8
+ use MailchimpAPI\Requests\MailchimpRequest;
9
+ use MailchimpAPI\Responses\MailchimpResponse;
10
+ use MailchimpAPI\Settings\MailchimpSettings;
11
+
12
+
13
+ /**
14
+ * Class Automations
15
+ * @package MailchimpAPI\Resources
16
+ */
17
+ class Automations extends ApiResource
18
+ {
19
+ /**
20
+ * A workflow ID
21
+ */
22
+ private $workflow_id;
23
+
24
+ /**
25
+ * The url component for this endpoint
26
+ */
27
+ const URL_COMPONENT = '/automations/';
28
+
29
+ /**
30
+ * The URL component for pausing all emails in a workflow
31
+ */
32
+ const PAUSE_ALL_URL_COMPONENT = '/actions/pause-all-emails/';
33
+
34
+ /**
35
+ * The URL component for starting all emails in a workflow
36
+ */
37
+ const START_ALL_URL_COMPONENT = '/actions/start-all-emails/';
38
+
39
+
40
+ /**
41
+ * Automations constructor.
42
+ * @param MailchimpRequest $request
43
+ * @param MailchimpSettings $settings
44
+ * @param null $workflow_id
45
+ */
46
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $workflow_id = null)
47
+ {
48
+ parent::__construct($request, $settings);
49
+ $request->appendToEndpoint(self::URL_COMPONENT . $workflow_id);
50
+ $this->workflow_id = $workflow_id;
51
+ }
52
+
53
+ /**
54
+ * @return MailchimpResponse
55
+ * @throws MailchimpException
56
+ */
57
+ public function pauseAll()
58
+ {
59
+ $this->throwIfNot("id", $this->workflow_id);
60
+ return $this->postToActionEndpoint(self::PAUSE_ALL_URL_COMPONENT);
61
+ }
62
+
63
+ /**
64
+ * @return MailchimpResponse
65
+ * @throws MailchimpException
66
+ */
67
+ public function startAll()
68
+ {
69
+ $this->throwIfNot("id", $this->workflow_id);
70
+ return $this->postToActionEndpoint(self::START_ALL_URL_COMPONENT);
71
+ }
72
+
73
+ //SUBCLASS FUNCTIONS ------------------------------------------------------------
74
+
75
+ /**
76
+ * @return RemovedSubscribers
77
+ */
78
+ public function removedSubscribers()
79
+ {
80
+ return new RemovedSubscribers(
81
+ $this->getRequest(),
82
+ $this->getSettings()
83
+ );
84
+ }
85
+
86
+ /**
87
+ * @param null $email_id
88
+ * @return Emails
89
+ */
90
+ public function emails($email_id = null)
91
+ {
92
+ return new Emails(
93
+ $this->getRequest(),
94
+ $this->getSettings(),
95
+ $email_id
96
+ );
97
+ }
98
+ }
vendor/jhut89/mailchimp3php/src/Resources/Automations/Emails.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Automations;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Responses\MailchimpResponse;
8
+ use MailchimpAPI\Settings\MailchimpSettings;
9
+
10
+ /**
11
+ * Class Emails
12
+ * @package MailchimpAPI\Resources\Automations
13
+ */
14
+ class Emails extends ApiResource
15
+ {
16
+ /**
17
+ * An email ID
18
+ */
19
+ protected $email_id;
20
+
21
+ /**
22
+ * The url component for this endpoint
23
+ */
24
+ const URL_COMPONENT = '/emails/';
25
+
26
+ /**
27
+ * The URL component for pausing a workflow email
28
+ */
29
+ const PAUSE_URL_COMPONENT = '/actions/pause';
30
+
31
+ /**
32
+ * The URL component for starting a workflow email
33
+ */
34
+ const START_URL_COMPONENT = '/actions/start';
35
+
36
+
37
+ /**
38
+ * Emails constructor.
39
+ * @param MailchimpRequest $request
40
+ * @param MailchimpSettings $settings
41
+ * @param $email_id
42
+ */
43
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $email_id = null)
44
+ {
45
+ parent::__construct($request, $settings);
46
+ $request->appendToEndpoint(self::URL_COMPONENT . $email_id);
47
+ $this->email_id = $email_id;
48
+ }
49
+
50
+ /**
51
+ * @return MailchimpResponse
52
+ * @throws \MailchimpAPI\MailchimpException
53
+ */
54
+ public function pause()
55
+ {
56
+ $this->throwIfNot("id", $this->email_id);
57
+ return $this->postToActionEndpoint(self::PAUSE_URL_COMPONENT);
58
+ }
59
+
60
+ /**
61
+ * @return MailchimpResponse
62
+ * @throws \MailchimpAPI\MailchimpException
63
+ */
64
+ public function start()
65
+ {
66
+ $this->throwIfNot("id", $this->email_id);
67
+ return $this->postToActionEndpoint(self::START_URL_COMPONENT);
68
+ }
69
+
70
+ //SUBCLASS FUNCTIONS ------------------------------------------------------------
71
+
72
+ /**
73
+ * @param null $member
74
+ * @return Emails\Queue
75
+ */
76
+ public function queue($member = null)
77
+ {
78
+ return new Emails\Queue(
79
+ $this->getRequest(),
80
+ $this->getSettings(),
81
+ $member
82
+ );
83
+ }
84
+ }
vendor/jhut89/mailchimp3php/src/Resources/Automations/Emails/Queue.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Automations\Emails;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class Queue
11
+ * @package MailchimpAPI\Resources\Automations\Emails
12
+ */
13
+ class Queue extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/queue/';
19
+
20
+ /**
21
+ * Queue constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ * @param null $member
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $member = null)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ if ($member && strpos($member, "@")) {
30
+ $member = md5(strtolower($member));
31
+ }
32
+ $request->appendToEndpoint(self::URL_COMPONENT . $member);
33
+ }
34
+ }
vendor/jhut89/mailchimp3php/src/Resources/Automations/RemovedSubscribers.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Automations;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class RemovedSubscribers
11
+ * @package MailchimpAPI\Automations
12
+ */
13
+ class RemovedSubscribers extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/removed-subscribers/';
19
+
20
+ /**
21
+ * RemovedSubscribers constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ */
25
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings)
26
+ {
27
+ parent::__construct($request, $settings);
28
+ $request->appendToEndpoint(self::URL_COMPONENT);
29
+ }
30
+ }
vendor/jhut89/mailchimp3php/src/Resources/BatchOperations.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Settings\MailchimpSettings;
7
+
8
+ /**
9
+ * Class BatchOperations
10
+ * @package MailchimpAPI\Resources
11
+ */
12
+ class BatchOperations extends ApiResource
13
+ {
14
+ /**
15
+ * The url component for this endpoint
16
+ */
17
+ const URL_COMPONENT = '/batches/';
18
+
19
+ /**
20
+ * BatchOperations constructor.
21
+ * @param MailchimpRequest $request
22
+ * @param MailchimpSettings $settings
23
+ * @param $batch_id
24
+ */
25
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $batch_id)
26
+ {
27
+ parent::__construct($request, $settings);
28
+ $request->appendToEndpoint(self::URL_COMPONENT . $batch_id);
29
+ }
30
+ }
vendor/jhut89/mailchimp3php/src/Resources/BatchWebhooks.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources;
4
+ use MailchimpAPI\Requests\MailchimpRequest;
5
+ use MailchimpAPI\Settings\MailchimpSettings;
6
+
7
+ /**
8
+ * Class BatchWebhooks
9
+ * @package MailchimpAPI\Resources
10
+ */
11
+ class BatchWebhooks extends ApiResource
12
+ {
13
+ /**
14
+ * The url component for this endpoint
15
+ */
16
+ const URL_COMPONENT = '/batch-webhooks/';
17
+
18
+ /**
19
+ * BatchWebhooks constructor.
20
+ * @param MailchimpRequest $request
21
+ * @param MailchimpSettings $settings
22
+ * @param null $batch_webhook_id
23
+ */
24
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $batch_webhook_id = null)
25
+ {
26
+ parent::__construct($request, $settings);
27
+ $request->appendToEndpoint(self::URL_COMPONENT . $batch_webhook_id);
28
+ }
29
+ }
vendor/jhut89/mailchimp3php/src/Resources/CampaignFolders.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Settings\MailchimpSettings;
7
+
8
+ /**
9
+ * Class CampaignFolders
10
+ * @package MailchimpAPI\Resources
11
+ */
12
+ class CampaignFolders extends ApiResource
13
+ {
14
+ /**
15
+ * The url component for this endpoint
16
+ */
17
+ const URL_COMPONENT = '/campaign-folders/';
18
+
19
+ /**
20
+ * CampaignFolders constructor.
21
+ * @param MailchimpRequest $request
22
+ * @param MailchimpSettings $settings
23
+ * @param $folder_id
24
+ */
25
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $folder_id)
26
+ {
27
+ parent::__construct($request, $settings);
28
+ $request->appendToEndpoint(self::URL_COMPONENT . $folder_id);
29
+ }
30
+ }
vendor/jhut89/mailchimp3php/src/Resources/Campaigns.php ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources;
4
+
5
+ use MailchimpAPI\MailchimpException;
6
+ use MailchimpAPI\Resources\Campaigns\Content;
7
+ use MailchimpAPI\Resources\Campaigns\Feedback;
8
+ use MailchimpAPI\Resources\Campaigns\SendChecklist;
9
+ use MailchimpAPI\Requests\MailchimpRequest;
10
+ use MailchimpAPI\Responses\MailchimpResponse;
11
+ use MailchimpAPI\Settings\MailchimpSettings;
12
+
13
+ /**
14
+ * Class Campaigns
15
+ * @package Mailchimp_API\Resources
16
+ */
17
+ class Campaigns extends ApiResource
18
+ {
19
+
20
+ /**
21
+ * @var string The campaign id
22
+ */
23
+ private $campaign_id;
24
+
25
+ /**
26
+ * The url component for this endpoint
27
+ */
28
+ const URL_COMPONENT = '/campaigns/';
29
+
30
+ /**
31
+ * The url component for canceling a campaign send
32
+ */
33
+ const CANCEL_URL_COMPONENT = '/actions/cancel-send/';
34
+
35
+ /**
36
+ * The url component for pausing a campaign
37
+ */
38
+ const PAUSE_URL_COMPONENT = '/actions/pause';
39
+
40
+ /**
41
+ * The url component for replicating a campaign
42
+ */
43
+ const REPLICATE_URL_COMPONENT = '/actions/replicate';
44
+
45
+ /**
46
+ * The url component for resuming a paused campaign
47
+ */
48
+ const RESUME_URL_COMPONENT = '/actions/resume';
49
+
50
+ /**
51
+ * The url component for scheduling a campaign
52
+ */
53
+ const SCHEDULE_URL_COMPONENT = '/actions/schedule';
54
+
55
+ /**
56
+ * The url component for sending a campaign
57
+ */
58
+ const SEND_URL_COMPONENT = '/actions/send';
59
+
60
+ /**
61
+ * The url component for test sending a campaign
62
+ */
63
+ const TEST_URL_COMPONENT = '/actions/test';
64
+
65
+ /**
66
+ * The url component for un-scheduling a campaign
67
+ */
68
+ const UNSCHEDULE_URL_COMPONENT = '/actions/unschedule';
69
+
70
+
71
+ /**
72
+ * Campaigns constructor.
73
+ * @param MailchimpRequest $request
74
+ * @param MailchimpSettings $settings
75
+ * @param null $campaign_id
76
+ */
77
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $campaign_id = null)
78
+ {
79
+ parent::__construct($request, $settings);
80
+ $request->appendToEndpoint(self::URL_COMPONENT . $campaign_id);
81
+ $this->campaign_id = $campaign_id;
82
+ }
83
+
84
+ /**
85
+ * @return MailchimpResponse
86
+ * @throws MailchimpException
87
+ */
88
+ public function cancel()
89
+ {
90
+ $this->throwIfNot("id", $this->campaign_id);
91
+ return $this->postToActionEndpoint(self::CANCEL_URL_COMPONENT);
92
+ }
93
+
94
+ /**
95
+ * @return MailchimpResponse
96
+ * @throws MailchimpException
97
+ */
98
+ public function pause()
99
+ {
100
+ $this->throwIfNot("id", $this->campaign_id);
101
+ return $this->postToActionEndpoint(self::PAUSE_URL_COMPONENT);
102
+ }
103
+
104
+ /**
105
+ * @return MailchimpResponse
106
+ * @throws MailchimpException
107
+ */
108
+ public function replicate()
109
+ {
110
+ $this->throwIfNot("id", $this->campaign_id);
111
+ return $this->postToActionEndpoint(self::REPLICATE_URL_COMPONENT);
112
+ }
113
+
114
+ /**
115
+ * @return MailchimpResponse
116
+ * @throws MailchimpException
117
+ */
118
+ public function resume()
119
+ {
120
+ $this->throwIfNot("id", $this->campaign_id);
121
+ return $this->postToActionEndpoint(self::RESUME_URL_COMPONENT);
122
+ }
123
+
124
+ /**
125
+ * @param $schedule_time
126
+ * @param array $optional_parameters
127
+ * @return MailchimpResponse
128
+ * @throws MailchimpException
129
+ */
130
+ public function schedule($schedule_time, $optional_parameters = [])
131
+ {
132
+ $this->throwIfNot("id", $this->campaign_id);
133
+ $params = ["schedule_time" => $schedule_time];
134
+ $params = array_merge($params, $optional_parameters);
135
+
136
+ return $this->postToActionEndpoint(self::SCHEDULE_URL_COMPONENT, $params);
137
+ }
138
+
139
+ /**
140
+ * @return MailchimpResponse
141
+ * @throws MailchimpException
142
+ */
143
+ public function send()
144
+ {
145
+ $this->throwIfNot("id", $this->campaign_id);
146
+ return $this->postToActionEndpoint(self::SEND_URL_COMPONENT);
147
+ }
148
+
149
+ /**
150
+ * @param array $test_addresses
151
+ * @param string $send_type
152
+ * @return MailchimpResponse
153
+ * @throws MailchimpException
154
+ */
155
+ public function test($test_addresses, $send_type)
156
+ {
157
+ $this->throwIfNot("id", $this->campaign_id);
158
+ $params = ["test_emails" => $test_addresses, "send_type" => $send_type];
159
+
160
+ return $this->postToActionEndpoint(self::TEST_URL_COMPONENT, $params);
161
+ }
162
+
163
+ /**
164
+ * @return MailchimpResponse
165
+ * @throws MailchimpException
166
+ */
167
+ public function unschedule()
168
+ {
169
+ $this->throwIfNot("id", $this->campaign_id);
170
+ return $this->postToActionEndpoint(self::UNSCHEDULE_URL_COMPONENT);
171
+ }
172
+
173
+ //SUBCLASS FUNCTIONS ------------------------------------------------------------
174
+
175
+ /**
176
+ * @return SendChecklist
177
+ */
178
+ public function checklist()
179
+ {
180
+ return new SendChecklist(
181
+ $this->getRequest(),
182
+ $this->getSettings()
183
+ );
184
+ }
185
+
186
+ /**
187
+ * @param null $feedback_id
188
+ * @return Feedback
189
+ */
190
+ public function feedback($feedback_id = null)
191
+ {
192
+ return new Feedback(
193
+ $this->getRequest(),
194
+ $this->getSettings(),
195
+ $feedback_id
196
+ );
197
+ }
198
+
199
+ /**
200
+ * @return Content
201
+ */
202
+ public function content()
203
+ {
204
+ return new Content(
205
+ $this->getRequest(),
206
+ $this->getSettings()
207
+ );
208
+ }
209
+ }
vendor/jhut89/mailchimp3php/src/Resources/Campaigns/Content.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Campaigns;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class Content
11
+ * @package MailchimpAPI\Resources\Campaigns
12
+ */
13
+ class Content extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/content/';
19
+
20
+ /**
21
+ * Content constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ */
25
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings)
26
+ {
27
+ parent::__construct($request, $settings);
28
+ $request->appendToEndpoint(self::URL_COMPONENT);
29
+ }
30
+ }
vendor/jhut89/mailchimp3php/src/Resources/Campaigns/Feedback.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Campaigns;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class Feedback
11
+ * @package MailchimpAPI\Resources\Campaigns
12
+ */
13
+ class Feedback extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/feedback/';
19
+
20
+ /**
21
+ * Feedback constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ * @param null $feedback_id
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $feedback_id = null)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ $request->appendToEndpoint(self::URL_COMPONENT . $feedback_id);
30
+ }
31
+ }
vendor/jhut89/mailchimp3php/src/Resources/Campaigns/SendChecklist.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Campaigns;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class SendChecklist
11
+ * @package MailchimpAPI\Resources\Campaigns
12
+ */
13
+ class SendChecklist extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/send-checklist/';
19
+
20
+ /**
21
+ * SendChecklist constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ */
25
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings)
26
+ {
27
+ parent::__construct($request, $settings);
28
+ $request->appendToEndpoint(self::URL_COMPONENT);
29
+ }
30
+ }
vendor/jhut89/mailchimp3php/src/Resources/ConnectedSites.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ namespace MailchimpAPI\Resources;
5
+
6
+
7
+ use MailchimpAPI\Requests\MailchimpRequest;
8
+ use MailchimpAPI\Settings\MailchimpSettings;
9
+
10
+ /**
11
+ * Class ConnectedSites
12
+ * @package MailchimpAPI\Resources
13
+ */
14
+ class ConnectedSites extends ApiResource
15
+ {
16
+ /**
17
+ * @var null
18
+ */
19
+ private $site_id;
20
+
21
+ /**
22
+ * The connected sites endpoint url component
23
+ */
24
+ const URL_COMPONENT = "/connected-sites/";
25
+
26
+ /**
27
+ * The conversations url component for verifying a script install
28
+ */
29
+ const VERIFY_SCRIPT_INSTALL_URL_COMPONENT = "/actions/verify-script-installation/";
30
+
31
+ /**
32
+ * ConnectedSites constructor.
33
+ * @param MailchimpRequest $request
34
+ * @param MailchimpSettings $settings
35
+ * @param null $site_id
36
+ */
37
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $site_id = null)
38
+ {
39
+ parent::__construct($request, $settings);
40
+ $request->appendToEndpoint(self::URL_COMPONENT . $site_id);
41
+ $this->site_id = $site_id;
42
+ }
43
+
44
+ /**
45
+ * @throws \MailchimpAPI\MailchimpException
46
+ */
47
+ public function verifyScriptInstallation()
48
+ {
49
+ $this->throwIfNot("id", $this->site_id);
50
+ $this->postToActionEndpoint(self::VERIFY_SCRIPT_INSTALL_URL_COMPONENT);
51
+ }
52
+ }
vendor/jhut89/mailchimp3php/src/Resources/Conversations.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\Conversations\Messages;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class Conversations
11
+ * @package MailchimpAPI\Resources
12
+ */
13
+ class Conversations extends ApiResource
14
+ {
15
+ /**
16
+ * The conversations endpoint url component
17
+ */
18
+ const URL_COMPONENT = '/conversations/';
19
+
20
+
21
+ /**
22
+ * Conversations constructor.
23
+ * @param MailchimpRequest $request
24
+ * @param MailchimpSettings $settings
25
+ * @param null $conversation_id
26
+ */
27
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $conversation_id = null)
28
+ {
29
+ parent::__construct($request, $settings);
30
+ $request->appendToEndpoint(self::URL_COMPONENT . $conversation_id);
31
+ }
32
+
33
+ //SUBCLASS FUNCTIONS ------------------------------------------------------------
34
+
35
+
36
+ /**
37
+ * @param null $message_id
38
+ * @return Messages
39
+ */
40
+ public function messages($message_id = null)
41
+ {
42
+ return new Messages(
43
+ $this->getRequest(),
44
+ $this->getSettings(),
45
+ $message_id
46
+ );
47
+ }
48
+ }
vendor/jhut89/mailchimp3php/src/Resources/Conversations/Messages.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Conversations;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class Messages
11
+ * @package MailchimpAPI\Resource\Conversations
12
+ */
13
+ class Messages extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/messages/';
19
+
20
+ /**
21
+ * Messages constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ * @param null $message_id
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $message_id = null)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ $request->appendToEndpoint(self::URL_COMPONENT . $message_id);
30
+ }
31
+ }
vendor/jhut89/mailchimp3php/src/Resources/EcommerceStores.php ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\EcommerceStores\Carts;
7
+ use MailchimpAPI\Resources\EcommerceStores\Customers;
8
+ use MailchimpAPI\Resources\EcommerceStores\Orders;
9
+ use MailchimpAPI\Resources\EcommerceStores\Products;
10
+ use MailchimpAPI\Resources\EcommerceStores\PromoRules;
11
+ use MailchimpAPI\Settings\MailchimpSettings;
12
+
13
+ /**
14
+ * Class EcommerceStores
15
+ * @package MailchimpAPI\Resources
16
+ */
17
+ class EcommerceStores extends ApiResource
18
+ {
19
+ /**
20
+ * The url component for this endpoint
21
+ */
22
+ const URL_COMPONENT = '/ecommerce/stores/';
23
+
24
+ /**
25
+ * EcommerceStores constructor.
26
+ * @param MailchimpRequest $request
27
+ * @param MailchimpSettings $settings
28
+ * @param null $store_id
29
+ */
30
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $store_id = null)
31
+ {
32
+ parent::__construct($request, $settings);
33
+ $request->appendToEndpoint(self::URL_COMPONENT . $store_id);
34
+ }
35
+
36
+ //SUBCLASS FUNCTIONS ------------------------------------------------------------
37
+
38
+
39
+ /**
40
+ * @param null $customer_id
41
+ * @return Customers
42
+ */
43
+ public function customers($customer_id = null)
44
+ {
45
+ return new Customers(
46
+ $this->getRequest(),
47
+ $this->getSettings(),
48
+ $customer_id
49
+ );
50
+ }
51
+
52
+ /**
53
+ * @param null $product_id
54
+ * @return Products
55
+ */
56
+ public function products($product_id = null)
57
+ {
58
+ return new Products(
59
+ $this->getRequest(),
60
+ $this->getSettings(),
61
+ $product_id
62
+ );
63
+ }
64
+
65
+
66
+ /**
67
+ * @param null $order_id
68
+ * @return Orders
69
+ */
70
+ public function orders($order_id = null)
71
+ {
72
+ return new Orders(
73
+ $this->getRequest(),
74
+ $this->getSettings(),
75
+ $order_id
76
+ );
77
+ }
78
+
79
+ /**
80
+ * @param null $cart_id
81
+ * @return Carts
82
+ */
83
+ public function carts($cart_id = null)
84
+ {
85
+ return new Carts(
86
+ $this->getRequest(),
87
+ $this->getSettings(),
88
+ $cart_id
89
+ );
90
+ }
91
+
92
+ /**
93
+ * @param null $promo_rule_id
94
+ * @return PromoRules
95
+ */
96
+ public function promoRules($promo_rule_id = null)
97
+ {
98
+ return new PromoRules(
99
+ $this->getRequest(),
100
+ $this->getSettings(),
101
+ $promo_rule_id
102
+ );
103
+ }
104
+ }
vendor/jhut89/mailchimp3php/src/Resources/EcommerceStores/Carts.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\EcommerceStores;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\EcommerceStores\Carts\Lines;
7
+ use MailchimpAPI\Resources\ApiResource;
8
+ use MailchimpAPI\Settings\MailchimpSettings;
9
+
10
+ /**
11
+ * Class Carts
12
+ * @package MailchimpAPI\Resources\EcommerceStores
13
+ */
14
+ class Carts extends ApiResource
15
+ {
16
+ /**
17
+ * The url component for this endpoint
18
+ */
19
+ const URL_COMPONENT = '/carts/';
20
+
21
+ /**
22
+ * Carts constructor.
23
+ * @param MailchimpRequest $request
24
+ * @param MailchimpSettings $settings
25
+ * @param null $cart_id
26
+ */
27
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $cart_id = null)
28
+ {
29
+ parent::__construct($request, $settings);
30
+ $request->appendToEndpoint(self::URL_COMPONENT . $cart_id);
31
+ }
32
+
33
+ //SUBCLASS FUNCTIONS ------------------------------------------------------------
34
+
35
+ /**
36
+ * @param null $line_id
37
+ * @return Lines
38
+ */
39
+ public function lines($line_id = null)
40
+ {
41
+ return new Lines(
42
+ $this->getRequest(),
43
+ $this->getSettings(),
44
+ $line_id
45
+ );
46
+ }
47
+ }
vendor/jhut89/mailchimp3php/src/Resources/EcommerceStores/Carts/Lines.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\EcommerceStores\Carts;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class Lines
11
+ * @package MailchimpAPI\Resources\EcommerceStores\Carts
12
+ */
13
+ class Lines extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/lines/';
19
+
20
+ /**
21
+ * Lines constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ * @param null $line_id
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $line_id = null)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ $request->appendToEndpoint(self::URL_COMPONENT . $line_id);
30
+ }
31
+ }
vendor/jhut89/mailchimp3php/src/Resources/EcommerceStores/Customers.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\EcommerceStores;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class Customers
11
+ * @package MailchimpAPI\Resources\EcommerceStores
12
+ */
13
+ class Customers extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/customers/';
19
+
20
+ /**
21
+ * Customers constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ * @param null $customer_id
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $customer_id = null)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ $request->appendToEndpoint(self::URL_COMPONENT . $customer_id);
30
+ }
31
+ }
vendor/jhut89/mailchimp3php/src/Resources/EcommerceStores/Orders.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\EcommerceStores;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\EcommerceStores\Orders\Lines;
7
+ use MailchimpAPI\Resources\ApiResource;
8
+ use MailchimpAPI\Settings\MailchimpSettings;
9
+
10
+ /**
11
+ * Class Orders
12
+ * @package MailchimpAPI\Resources\EcommerceStores
13
+ */
14
+ class Orders extends ApiResource
15
+ {
16
+ /**
17
+ * The url component for this endpoint
18
+ */
19
+ const URL_COMPONENT = '/orders/';
20
+
21
+ /**
22
+ * Orders constructor.
23
+ * @param MailchimpRequest $request
24
+ * @param MailchimpSettings $settings
25
+ * @param null $order_id
26
+ */
27
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $order_id = null)
28
+ {
29
+ parent::__construct($request, $settings);
30
+ $request->appendToEndpoint(self::URL_COMPONENT . $order_id);
31
+ }
32
+
33
+ //SUBCLASS FUNCTIONS ------------------------------------------------------------
34
+
35
+ /**
36
+ * @param null $line_id
37
+ * @return Lines
38
+ */
39
+ public function lines($line_id = null)
40
+ {
41
+ return new Lines(
42
+ $this->getRequest(),
43
+ $this->getSettings(),
44
+ $line_id
45
+ );
46
+ }
47
+ }
vendor/jhut89/mailchimp3php/src/Resources/EcommerceStores/Orders/Lines.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\EcommerceStores\Orders;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class Lines
11
+ * @package MailchimpAPI\Resources\EcommerceStores\Orders
12
+ */
13
+ class Lines extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/lines/';
19
+
20
+ /**
21
+ * Lines constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ * @param $line_id
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $line_id)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ $request->appendToEndpoint(self::URL_COMPONENT . $line_id);
30
+ }
31
+ }
vendor/jhut89/mailchimp3php/src/Resources/EcommerceStores/Products.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\EcommerceStores;
4
+
5
+ use MailchimpAPI\Resources\EcommerceStores\Products\Variants;
6
+ use MailchimpAPI\Resources\EcommerceStores\Products\Images;
7
+ use MailchimpAPI\Requests\MailchimpRequest;
8
+ use MailchimpAPI\Resources\ApiResource;
9
+ use MailchimpAPI\Settings\MailchimpSettings;
10
+
11
+ /**
12
+ * Class Products
13
+ * @package MailchimpAPI\Resources\EcommerceStores
14
+ */
15
+ class Products extends ApiResource
16
+ {
17
+ /**
18
+ * The url component for this endpoint
19
+ */
20
+ const URL_COMPONENT = '/products/';
21
+
22
+
23
+ /**
24
+ * Products constructor.
25
+ * @param MailchimpRequest $request
26
+ * @param MailchimpSettings $settings
27
+ * @param null $product_id
28
+ */
29
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $product_id = null)
30
+ {
31
+ parent::__construct($request, $settings);
32
+ $request->appendToEndpoint(self::URL_COMPONENT . $product_id);
33
+ }
34
+
35
+ //SUBCLASS FUNCTIONS ------------------------------------------------------------
36
+
37
+
38
+ /**
39
+ * @param null $variant_id
40
+ * @return Variants
41
+ */
42
+ public function variants($variant_id = null)
43
+ {
44
+ return new Variants(
45
+ $this->getRequest(),
46
+ $this->getSettings(),
47
+ $variant_id
48
+ );
49
+ }
50
+
51
+ /**
52
+ * @param null $image_id
53
+ * @return Images
54
+ */
55
+ public function images($image_id = null)
56
+ {
57
+ return new Images(
58
+ $this->getRequest(),
59
+ $this->getSettings(),
60
+ $image_id
61
+ );
62
+ }
63
+ }
vendor/jhut89/mailchimp3php/src/Resources/EcommerceStores/Products/Images.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\EcommerceStores\Products;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class Images
11
+ * @package MailchimpAPI\Resources\EcommerceStores\Products
12
+ */
13
+ class Images extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/images/';
19
+
20
+ /**
21
+ * Images constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ * @param null $image_id
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $image_id = null)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ $request->appendToEndpoint(self::URL_COMPONENT . $image_id);
30
+ }
31
+ }
vendor/jhut89/mailchimp3php/src/Resources/EcommerceStores/Products/Variants.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\EcommerceStores\Products;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class Variants
11
+ * @package MailchimpAPI\Resources\EcommerceStores\Products
12
+ */
13
+ class Variants extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/variants/';
19
+
20
+ /**
21
+ * Variants constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ * @param null $variant_id
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $variant_id = null)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ $request->appendToEndpoint(self::URL_COMPONENT . $variant_id);
30
+ }
31
+ }
vendor/jhut89/mailchimp3php/src/Resources/EcommerceStores/PromoRules.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace MailchimpAPI\Resources\EcommerceStores;
3
+
4
+ use MailchimpAPI\Requests\MailchimpRequest;
5
+ use MailchimpAPI\Resources\ApiResource;
6
+ use MailchimpAPI\Resources\EcommerceStores\PromoRules\PromoCodes;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class PromoRules
11
+ * @package MailchimpAPI\Resources\EcommerceStores
12
+ */
13
+ class PromoRules extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/promo-rules/';
19
+
20
+ /**
21
+ * PromoRules constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ * @param null $promo_rule_id
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $promo_rule_id = null)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ $request->appendToEndpoint(self::URL_COMPONENT . $promo_rule_id);
30
+ }
31
+
32
+ //SUBCLASS FUNCTIONS ------------------------------------------------------------
33
+
34
+
35
+ /**
36
+ * @param null $promo_code_id
37
+ * @return PromoCodes
38
+ */
39
+ public function promoCodes($promo_code_id = null)
40
+ {
41
+ return new PromoCodes(
42
+ $this->getRequest(),
43
+ $this->getSettings(),
44
+ $promo_code_id
45
+ );
46
+ }
47
+ }
vendor/jhut89/mailchimp3php/src/Resources/EcommerceStores/PromoRules/PromoCodes.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ namespace MailchimpAPI\Resources\EcommerceStores\PromoRules;
5
+
6
+ use MailchimpAPI\Requests\MailchimpRequest;
7
+ use MailchimpAPI\Resources\ApiResource;
8
+ use MailchimpAPI\Settings\MailchimpSettings;
9
+
10
+ /**
11
+ * Class PromoCodes
12
+ * @package MailchimpAPI\Resources\EcommerceStores\PromoRules
13
+ */
14
+ class PromoCodes extends ApiResource
15
+ {
16
+ /**
17
+ * The url component for this endpoint
18
+ */
19
+ const URL_COMPONENT = '/promo-codes/';
20
+
21
+ /**
22
+ * PromoCodes constructor.
23
+ * @param MailchimpRequest $request
24
+ * @param MailchimpSettings $settings
25
+ * @param null $promo_code_id
26
+ */
27
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $promo_code_id = null)
28
+ {
29
+ parent::__construct($request, $settings);
30
+ $request->appendToEndpoint(self::URL_COMPONENT . $promo_code_id);
31
+ }
32
+ }
vendor/jhut89/mailchimp3php/src/Resources/FacebookAds.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ namespace MailchimpAPI\Resources;
5
+
6
+
7
+ use MailchimpAPI\Requests\MailchimpRequest;
8
+ use MailchimpAPI\Settings\MailchimpSettings;
9
+
10
+ /**
11
+ * Class FacebookAds
12
+ * @package MailchimpAPI\Resources
13
+ */
14
+ class FacebookAds extends ApiResource
15
+ {
16
+ /**
17
+ * The url component for this endpoint
18
+ */
19
+ const URL_COMPONENT = "/facebook-ads/";
20
+
21
+ /**
22
+ * FacebookAds constructor.
23
+ * @param MailchimpRequest $request
24
+ * @param MailchimpSettings $settings
25
+ * @param null $outreach_id
26
+ */
27
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $outreach_id = null)
28
+ {
29
+ parent::__construct($request, $settings);
30
+ $request->appendToEndpoint(self::URL_COMPONENT . $outreach_id);
31
+ }
32
+ }
vendor/jhut89/mailchimp3php/src/Resources/FileManagerFiles.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Settings\MailchimpSettings;
7
+
8
+ /**
9
+ * Class FileManagerFiles
10
+ * @package MailchimpAPI\Resources
11
+ */
12
+ class FileManagerFiles extends ApiResource
13
+ {
14
+ /**
15
+ * The url component for this endpoint
16
+ */
17
+ const URL_COMPONENT = '/file-manager/files/';
18
+
19
+ /**
20
+ * FileManagerFiles constructor.
21
+ * @param MailchimpRequest $request
22
+ * @param MailchimpSettings $settings
23
+ * @param null $file_id
24
+ */
25
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $file_id = null)
26
+ {
27
+ parent::__construct($request, $settings);
28
+ $request->appendToEndpoint(self::URL_COMPONENT . $file_id);
29
+ }
30
+ }
vendor/jhut89/mailchimp3php/src/Resources/FileManagerFolders.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Settings\MailchimpSettings;
7
+
8
+ /**
9
+ * Class FileManagerFolders
10
+ * @package MailchimpAPI\Resources
11
+ */
12
+ class FileManagerFolders extends ApiResource
13
+ {
14
+ /**
15
+ * The url component for this endpoint
16
+ */
17
+ const URL_COMPONENT = '/file-manager/folders/';
18
+
19
+ /**
20
+ * FileManagerFolders constructor.
21
+ * @param MailchimpRequest $request
22
+ * @param MailchimpSettings $settings
23
+ * @param null $folder_id
24
+ */
25
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $folder_id = null)
26
+ {
27
+ parent::__construct($request, $settings);
28
+ $request->appendToEndpoint(self::URL_COMPONENT . $folder_id);
29
+ }
30
+ }
vendor/jhut89/mailchimp3php/src/Resources/GoogleAds.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ namespace MailchimpAPI\Resources;
5
+
6
+
7
+ use MailchimpAPI\Requests\MailchimpRequest;
8
+ use MailchimpAPI\Settings\MailchimpSettings;
9
+
10
+ /**
11
+ * Class GoogleAds
12
+ * @package MailchimpAPI\Resources
13
+ */
14
+ class GoogleAds extends ApiResource
15
+ {
16
+ /**
17
+ * The url component for this endpoint
18
+ */
19
+ const URL_COMPONENT = "/google-ads/";
20
+
21
+ /**
22
+ * GoogleAds constructor.
23
+ * @param MailchimpRequest $request
24
+ * @param MailchimpSettings $settings
25
+ * @param null $outreach_id
26
+ */
27
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $outreach_id = null)
28
+ {
29
+ parent::__construct($request, $settings);
30
+ $request->appendToEndpoint(self::URL_COMPONENT . $outreach_id);
31
+ }
32
+ }
vendor/jhut89/mailchimp3php/src/Resources/LandingPages.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ namespace MailchimpAPI\Resources;
5
+
6
+
7
+ use MailchimpAPI\Requests\MailchimpRequest;
8
+ use MailchimpAPI\Settings\MailchimpSettings;
9
+
10
+ /**
11
+ * Class LandingPages
12
+ * @package MailchimpAPI\Resources
13
+ */
14
+ class LandingPages extends ApiResource
15
+ {
16
+ /**
17
+ * @var null The landing page id
18
+ */
19
+ private $page_id;
20
+
21
+ /**
22
+ * The url component for this endpoint
23
+ */
24
+ const URL_COMPONENT = "/landing-pages/";
25
+
26
+ /**
27
+ * the url component for publishing a landing page
28
+ */
29
+ const PUBLISH_URL_COMPONENT = "/actions/publish/";
30
+
31
+ /**
32
+ * the url component for unpublishing a landing page
33
+ */
34
+ const UNPUBLISH_URL_COMPONENT = "/actions/unpublish/";
35
+
36
+ /**
37
+ * LandingPages constructor.
38
+ * @param MailchimpRequest $request
39
+ * @param MailchimpSettings $settings
40
+ * @param null $page_id
41
+ */
42
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $page_id = null)
43
+ {
44
+ parent::__construct($request, $settings);
45
+ $request->appendToEndpoint(self::URL_COMPONENT . $page_id);
46
+ $this->page_id = $page_id;
47
+ }
48
+
49
+ /**
50
+ * @return \MailchimpAPI\Responses\MailchimpResponse
51
+ * @throws \MailchimpAPI\MailchimpException
52
+ */
53
+ public function publish()
54
+ {
55
+ $this->throwIfNot("id", $this->page_id);
56
+ return $this->postToActionEndpoint(self::PUBLISH_URL_COMPONENT);
57
+ }
58
+
59
+ /**
60
+ * @return \MailchimpAPI\Responses\MailchimpResponse
61
+ * @throws \MailchimpAPI\MailchimpException
62
+ */
63
+ public function unpublish()
64
+ {
65
+ $this->throwIfNot("id", $this->page_id);
66
+ return $this->postToActionEndpoint(self::UNPUBLISH_URL_COMPONENT);
67
+ }
68
+
69
+ /**
70
+ * @return LandingPages\Content
71
+ */
72
+ public function content()
73
+ {
74
+ return new LandingPages\Content(
75
+ $this->getRequest(),
76
+ $this->getSettings()
77
+ );
78
+ }
79
+ }
vendor/jhut89/mailchimp3php/src/Resources/LandingPages/Content.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ namespace MailchimpAPI\Resources\LandingPages;
5
+
6
+ use MailchimpAPI\Requests\MailchimpRequest;
7
+ use MailchimpAPI\Resources\ApiResource;
8
+ use MailchimpAPI\Settings\MailchimpSettings;
9
+
10
+ /**
11
+ * Class Content
12
+ * @package MailchimpAPI\Resources\LandingPages
13
+ */
14
+ class Content extends ApiResource
15
+ {
16
+ /**
17
+ *
18
+ */
19
+ const URL_COMPONENT = "/content/";
20
+
21
+ /**
22
+ * Content constructor.
23
+ * @param MailchimpRequest $request
24
+ * @param MailchimpSettings $settings
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ $request->appendToEndpoint(self::URL_COMPONENT);
30
+ }
31
+ }
vendor/jhut89/mailchimp3php/src/Resources/Lists.php ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\Lists\AbuseReports;
7
+ use MailchimpAPI\Resources\Lists\Clients;
8
+ use MailchimpAPI\Resources\Lists\GrowthHistory;
9
+ use MailchimpAPI\Resources\Lists\InterestCategories;
10
+ use MailchimpAPI\Resources\Lists\MergeFields;
11
+ use MailchimpAPI\Resources\Lists\Segments;
12
+ use MailchimpAPI\Resources\Lists\SignupForms;
13
+ use MailchimpAPI\Resources\Lists\Webhooks;
14
+ use MailchimpAPI\Settings\MailchimpSettings;
15
+
16
+ /**
17
+ * Class Lists
18
+ * @package MailchimpAPI\Resources
19
+ */
20
+ class Lists extends ApiResource
21
+ {
22
+ /**
23
+ * @var null The id for a list instance
24
+ */
25
+ private $list_id;
26
+
27
+ /**
28
+ * The url component for this endpoint
29
+ */
30
+ const URL_COMPONENT = '/lists/';
31
+
32
+ /**
33
+ * Lists constructor.
34
+ * @param MailchimpRequest $request
35
+ * @param MailchimpSettings $settings
36
+ * @param null $list_id
37
+ */
38
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $list_id = null)
39
+ {
40
+ parent::__construct($request, $settings);
41
+ $request->appendToEndpoint(self::URL_COMPONENT . $list_id);
42
+ $this->list_id = $list_id;
43
+ }
44
+
45
+ /**
46
+ * @param array $members
47
+ * @param bool $update_existing
48
+ * @return \MailchimpAPI\Responses\MailchimpResponse
49
+ * @throws \MailchimpAPI\MailchimpException
50
+ */
51
+ public function batchSubscribe($members = [], $update_existing = false)
52
+ {
53
+ $this->throwIfNot("id", $this->list_id);
54
+ $params = [
55
+ 'members' => $members,
56
+ 'update_existing' => $update_existing
57
+ ];
58
+
59
+ return $this->postToActionEndpoint('', $params);
60
+ }
61
+
62
+ //SUBCLASS FUNCTIONS ------------------------------------------------------------
63
+
64
+ /**
65
+ * @param null $webhook_id
66
+ * @return Webhooks
67
+ */
68
+ public function webhooks($webhook_id = null)
69
+ {
70
+ return new Webhooks(
71
+ $this->getRequest(),
72
+ $this->getSettings(),
73
+ $webhook_id
74
+ );
75
+ }
76
+
77
+ /**
78
+ * @param null $form_id
79
+ * @return SignupForms
80
+ */
81
+ public function signupForms($form_id = null)
82
+ {
83
+ return new SignupForms(
84
+ $this->getRequest(),
85
+ $this->getSettings(),
86
+ $form_id
87
+ );
88
+ }
89
+
90
+ /**
91
+ * @param null $merge_field_id
92
+ * @return MergeFields
93
+ */
94
+ public function mergeFields($merge_field_id = null)
95
+ {
96
+ return new MergeFields(
97
+ $this->getRequest(),
98
+ $this->getSettings(),
99
+ $merge_field_id
100
+ );
101
+ }
102
+
103
+ /**
104
+ * @param null $month
105
+ * @return GrowthHistory
106
+ */
107
+ public function growthHistory($month = null)
108
+ {
109
+ return new GrowthHistory(
110
+ $this->getRequest(),
111
+ $this->getSettings(),
112
+ $month
113
+ );
114
+ }
115
+
116
+
117
+ /**
118
+ * @return Clients
119
+ */
120
+ public function clients()
121
+ {
122
+ return new Clients(
123
+ $this->getRequest(),
124
+ $this->getSettings()
125
+ );
126
+ }
127
+
128
+ /**
129
+ * @return Lists\Activity
130
+ */
131
+ public function activity()
132
+ {
133
+ return new Lists\Activity(
134
+ $this->getRequest(),
135
+ $this->getSettings()
136
+ );
137
+ }
138
+
139
+ /**
140
+ * @param null $report_id
141
+ * @return AbuseReports
142
+ */
143
+ public function abuseReports($report_id = null)
144
+ {
145
+ return new AbuseReports(
146
+ $this->getRequest(),
147
+ $this->getSettings(),
148
+ $report_id
149
+ );
150
+ }
151
+
152
+ /**
153
+ * @param null $segment_id
154
+ * @return Segments
155
+ */
156
+ public function segments($segment_id = null)
157
+ {
158
+ return new Segments(
159
+ $this->getRequest(),
160
+ $this->getSettings(),
161
+ $segment_id
162
+ );
163
+ }
164
+
165
+ /**
166
+ * @param null $member
167
+ * @return Lists\Members
168
+ */
169
+ public function members($member = null)
170
+ {
171
+ return new Lists\Members(
172
+ $this->getRequest(),
173
+ $this->getSettings(),
174
+ $member
175
+ );
176
+ }
177
+
178
+ /**
179
+ * @param null $interest_category_id
180
+ * @return InterestCategories
181
+ */
182
+ public function interestCategories($interest_category_id = null)
183
+ {
184
+ return new InterestCategories(
185
+ $this->getRequest(),
186
+ $this->getSettings(),
187
+ $interest_category_id
188
+ );
189
+ }
190
+ }
vendor/jhut89/mailchimp3php/src/Resources/Lists/AbuseReports.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Lists;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class AbuseReports
11
+ * @package MailchimpAPI\Resources\Lists
12
+ */
13
+ class AbuseReports extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/abuse-reports/';
19
+
20
+ /**
21
+ * AbuseReports constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ * @param $report_id
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $report_id)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ $request->appendToEndpoint(self::URL_COMPONENT . $report_id);
30
+ }
31
+ }
vendor/jhut89/mailchimp3php/src/Resources/Lists/Activity.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Lists;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+
10
+ /**
11
+ * Class Activity
12
+ * @package MailchimpAPI\Resources\Lists
13
+ */
14
+ class Activity extends ApiResource
15
+ {
16
+ /**
17
+ * The url component for this endpoint
18
+ */
19
+ const URL_COMPONENT = '/activity/';
20
+
21
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings)
22
+ {
23
+ parent::__construct($request, $settings);
24
+ $request->appendToEndpoint(self::URL_COMPONENT);
25
+ }
26
+ }
vendor/jhut89/mailchimp3php/src/Resources/Lists/Clients.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Lists;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class Clients
11
+ * @package MailchimpAPI\Resources\Lists
12
+ */
13
+ class Clients extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/clients/';
19
+
20
+ /**
21
+ * Clients constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ */
25
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings)
26
+ {
27
+ parent::__construct($request, $settings);
28
+ $request->appendToEndpoint(self::URL_COMPONENT);
29
+ }
30
+ }
vendor/jhut89/mailchimp3php/src/Resources/Lists/GrowthHistory.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Lists;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class GrowthHistory
11
+ * @package MailchimpAPI\Resources\Lists
12
+ */
13
+ class GrowthHistory extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/growth-history/';
19
+
20
+ /**
21
+ * GrowthHistory constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ * @param null $month
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $month = null)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ $request->appendToEndpoint(self::URL_COMPONENT . $month);
30
+ }
31
+ }
vendor/jhut89/mailchimp3php/src/Resources/Lists/InterestCategories.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Lists;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\Lists\InterestCategories\Interest;
7
+ use MailchimpAPI\Resources\ApiResource;
8
+ use MailchimpAPI\Settings\MailchimpSettings;
9
+
10
+
11
+ /**
12
+ * Class InterestCategories
13
+ * @package MailchimpAPI\Resources\Lists
14
+ */
15
+ class InterestCategories extends ApiResource
16
+ {
17
+ /**
18
+ * The url component for this endpoint
19
+ */
20
+ const URL_COMPONENT = '/interest-categories/';
21
+
22
+ /**
23
+ * InterestCategories constructor.
24
+ * @param MailchimpRequest $request
25
+ * @param MailchimpSettings $settings
26
+ * @param $interest_category_id
27
+ */
28
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $interest_category_id)
29
+ {
30
+ parent::__construct($request, $settings);
31
+ $request->appendToEndpoint(self::URL_COMPONENT . $interest_category_id);
32
+ }
33
+
34
+ //SUBCLASS FUNCTIONS ------------------------------------------------------------
35
+
36
+ /**
37
+ * @param null $interest_id
38
+ * @return Interest
39
+ */
40
+ public function interests($interest_id = null)
41
+ {
42
+ return new Interest(
43
+ $this->getRequest(),
44
+ $this->getSettings(),
45
+ $interest_id
46
+ );
47
+ }
48
+ }
vendor/jhut89/mailchimp3php/src/Resources/Lists/InterestCategories/Interest.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Lists\InterestCategories;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class Interest
11
+ * @package MailchimpAPI\Resources\Lists\InterestCategories
12
+ */
13
+ class Interest extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/interests/';
19
+
20
+ /**
21
+ * Interest constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ * @param null $interest_id
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $interest_id = null)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ $request->appendToEndpoint(self::URL_COMPONENT . $interest_id);
30
+ }
31
+ }
vendor/jhut89/mailchimp3php/src/Resources/Lists/Members.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Lists;
4
+
5
+
6
+ use MailchimpAPI\Requests\MailchimpRequest;
7
+ use MailchimpAPI\Resources\Lists\Members\Notes;
8
+ use MailchimpAPI\Resources\Lists\Members\Goals;
9
+ use MailchimpAPI\Resources\ApiResource;
10
+ use MailchimpAPI\Settings\MailchimpSettings;
11
+
12
+ /**
13
+ * Class Members
14
+ * @package MailchimpAPI\Resources\Lists
15
+ */
16
+ class Members extends ApiResource
17
+ {
18
+ /**
19
+ * The url component for this endpoint
20
+ */
21
+ const URL_COMPONENT = '/members/';
22
+
23
+ /**
24
+ * Members constructor.
25
+ * @param MailchimpRequest $request
26
+ * @param MailchimpSettings $settings
27
+ * @param $member
28
+ */
29
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $member)
30
+ {
31
+ parent::__construct($request, $settings);
32
+ if ($member && strpos($member, "@")) {
33
+ $member = md5(strtolower($member));
34
+ }
35
+ $request->appendToEndpoint(self::URL_COMPONENT . $member);
36
+ }
37
+
38
+ //SUBCLASS FUNCTIONS ------------------------------------------------------------
39
+
40
+ /**
41
+ * @param null $note_id
42
+ * @return Notes
43
+ */
44
+ public function notes($note_id = null)
45
+ {
46
+ return new Notes(
47
+ $this->getRequest(),
48
+ $this->getSettings(),
49
+ $note_id
50
+ );
51
+ }
52
+
53
+ /**
54
+ * @return Goals
55
+ */
56
+ public function goals()
57
+ {
58
+ return new Goals(
59
+ $this->getRequest(),
60
+ $this->getSettings()
61
+ );
62
+ }
63
+
64
+ /**
65
+ * @return Members\Activity
66
+ */
67
+ public function activity()
68
+ {
69
+ return new Members\Activity(
70
+ $this->getRequest(),
71
+ $this->getSettings()
72
+ );
73
+ }
74
+
75
+ /**
76
+ * @return Members\Tags
77
+ */
78
+ public function tags()
79
+ {
80
+ return new Members\Tags(
81
+ $this->getRequest(),
82
+ $this->getSettings()
83
+ );
84
+ }
85
+
86
+ /**
87
+ * @return Members\Events
88
+ */
89
+ public function events()
90
+ {
91
+ return new Members\Events(
92
+ $this->getRequest(),
93
+ $this->getSettings()
94
+ );
95
+ }
96
+ }
vendor/jhut89/mailchimp3php/src/Resources/Lists/Members/Activity.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Lists\Members;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class Activity
11
+ * @package MailchimpAPI\Resources\Lists\Members
12
+ */
13
+ class Activity extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/activity/';
19
+
20
+ /**
21
+ * Activity constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ */
25
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings)
26
+ {
27
+ parent::__construct($request, $settings);
28
+ $request->appendToEndpoint(self::URL_COMPONENT);
29
+ }
30
+ }
vendor/jhut89/mailchimp3php/src/Resources/Lists/Members/Events.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Lists\Members;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class Events
11
+ * @package MailchimpAPI\Resources\Lists\Members
12
+ */
13
+ class Events extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this resource
17
+ */
18
+ const URL_COMPONENT = '/events/';
19
+
20
+ /**
21
+ * Events constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings|null $settings
24
+ */
25
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings = null)
26
+ {
27
+ parent::__construct($request, $settings);
28
+ $request->appendToEndpoint(self::URL_COMPONENT);
29
+ }
30
+ }
vendor/jhut89/mailchimp3php/src/Resources/Lists/Members/Goals.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Lists\Members;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class Goals
11
+ * @package MailchimpAPI\Resources\Lists\Members
12
+ */
13
+ class Goals extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/goals/';
19
+
20
+ /**
21
+ * Goals constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ */
25
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings)
26
+ {
27
+ parent::__construct($request, $settings);
28
+ $request->appendToEndpoint(self::URL_COMPONENT);
29
+ }
30
+ }
vendor/jhut89/mailchimp3php/src/Resources/Lists/Members/Notes.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Lists\Members;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class Notes
11
+ * @package MailchimpAPI\Resources\Lists\Members
12
+ */
13
+ class Notes extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/notes/';
19
+
20
+ /**
21
+ * Notes constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ * @param null $note_id
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $note_id = null)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ $request->appendToEndpoint(self::URL_COMPONENT . $note_id);
30
+ }
31
+ }
vendor/jhut89/mailchimp3php/src/Resources/Lists/Members/Tags.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Lists\Members;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class Tags
11
+ * @package MailchimpAPI\Resources\Lists\Members
12
+ */
13
+ class Tags extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this resource
17
+ */
18
+ const URL_COMPONENT = '/tags/';
19
+
20
+ /**
21
+ * Tags constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings|null $settings
24
+ */
25
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings = null)
26
+ {
27
+ parent::__construct($request, $settings);
28
+ $request->appendToEndpoint(self::URL_COMPONENT);
29
+ }
30
+ }
vendor/jhut89/mailchimp3php/src/Resources/Lists/MergeFields.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Lists;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class MergeFields
11
+ * @package MailchimpAPI\Resources\Lists
12
+ */
13
+ class MergeFields extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/merge-fields/';
19
+
20
+ /**
21
+ * MergeFields constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ * @param $merge_field_id
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $merge_field_id)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ $request->appendToEndpoint(self::URL_COMPONENT . $merge_field_id);
30
+ }
31
+ }
vendor/jhut89/mailchimp3php/src/Resources/Lists/Segments.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Lists;
4
+
5
+ use MailchimpAPI\MailchimpException;
6
+ use MailchimpAPI\Requests\MailchimpRequest;
7
+ use MailchimpAPI\Resources\ApiResource;
8
+ use MailchimpAPI\Settings\MailchimpSettings;
9
+
10
+ /**
11
+ * Class Segments
12
+ * @package MailchimpAPI\Resources\Lists
13
+ */
14
+ class Segments extends ApiResource
15
+ {
16
+ /**
17
+ * @var string
18
+ */
19
+ private $segment_id;
20
+
21
+ /**
22
+ * The url component for this endpoint
23
+ */
24
+ const URL_COMPONENT = '/segments/';
25
+
26
+ /**
27
+ * Segments constructor.
28
+ * @param MailchimpRequest $request
29
+ * @param MailchimpSettings $settings
30
+ * @param null $segment_id
31
+ */
32
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $segment_id = null)
33
+ {
34
+ parent::__construct($request, $settings);
35
+ $request->appendToEndpoint(self::URL_COMPONENT . $segment_id);
36
+ $this->segment_id = $segment_id;
37
+ }
38
+
39
+ /**
40
+ * @param array $add
41
+ * @param array $remove
42
+ * @return \MailchimpAPI\Responses\MailchimpResponse
43
+ * @throws MailchimpException
44
+ */
45
+ public function batch($add = [], $remove = [])
46
+ {
47
+ $this->throwIfNot("id", $this->segment_id);
48
+ $params = ['members_to_add' => $add, 'members_to_remove' => $remove];
49
+
50
+ return $this->postToActionEndpoint('', $params);
51
+ }
52
+
53
+
54
+ //SUBCLASS FUNCTIONS ------------------------------------------------------------
55
+
56
+ /**
57
+ * @param null $member
58
+ * @return Segments\Members
59
+ */
60
+ public function members($member = null)
61
+ {
62
+ return new Segments\Members(
63
+ $this->getRequest(),
64
+ $this->getSettings(),
65
+ $member
66
+ );
67
+ }
68
+ }
vendor/jhut89/mailchimp3php/src/Resources/Lists/Segments/Members.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Lists\Segments;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class Members
11
+ * @package MailchimpAPI\Resources\Lists\Segments
12
+ */
13
+ class Members extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/members/';
19
+
20
+ /**
21
+ * Members constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ * @param null $member
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $member = null)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ if ($member && strpos($member, "@")) {
30
+ $member = md5(strtolower($member));
31
+ }
32
+ $request->appendToEndpoint(self::URL_COMPONENT . $member);
33
+ }
34
+ }
vendor/jhut89/mailchimp3php/src/Resources/Lists/SignupForms.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Lists;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class SignupForms
11
+ * @package MailchimpAPI\Resources\Lists
12
+ */
13
+ class SignupForms extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/signup-forms/';
19
+
20
+ /**
21
+ * SignupForms constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ * @param null $form_id
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $form_id = null)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ $request->appendToEndpoint(self::URL_COMPONENT . $form_id);
30
+ }
31
+ }
vendor/jhut89/mailchimp3php/src/Resources/Lists/Webhooks.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Lists;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class Webhooks
11
+ * @package MailchimpAPI\Resources\Lists
12
+ */
13
+ class Webhooks extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/webhooks/';
19
+
20
+ /**
21
+ * Webhooks constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ * @param $webhook_id
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $webhook_id)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ $request->appendToEndpoint(self::URL_COMPONENT . $webhook_id);
30
+ }
31
+ }
vendor/jhut89/mailchimp3php/src/Resources/Ping.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ namespace MailchimpAPI\Resources;
5
+
6
+ use MailchimpAPI\Requests\MailchimpRequest;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class Ping
11
+ * @package MailchimpAPI\Resources
12
+ */
13
+ class Ping extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/ping';
19
+
20
+ /**
21
+ * Ping constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ */
25
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings)
26
+ {
27
+ parent::__construct($request, $settings);
28
+ $request->appendToEndpoint(self::URL_COMPONENT);
29
+ }
30
+ }
vendor/jhut89/mailchimp3php/src/Resources/Reports.php ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\Reports\CampaignAbuse;
7
+ use MailchimpAPI\Resources\Reports\CampaignAdvice;
8
+ use MailchimpAPI\Resources\Reports\ClickReports;
9
+ use MailchimpAPI\Resources\Reports\DomainPerformance;
10
+ use MailchimpAPI\Resources\Reports\EepurlReports;
11
+ use MailchimpAPI\Resources\Reports\EmailActivity;
12
+ use MailchimpAPI\Resources\Reports\GoogleAnalytics;
13
+ use MailchimpAPI\Resources\Reports\OpenDetails;
14
+ use MailchimpAPI\Resources\Reports\SentTo;
15
+ use MailchimpAPI\Resources\Reports\SubReports;
16
+ use MailchimpAPI\Resources\Reports\TopLocations;
17
+ use MailchimpAPI\Resources\Reports\Unsubscribes;
18
+ use MailchimpAPI\Settings\MailchimpSettings;
19
+
20
+ /**
21
+ * Class Reports
22
+ * @package MailchimpAPI\Resources
23
+ */
24
+ class Reports extends ApiResource
25
+ {
26
+ /**
27
+ * The url component for this endpoint
28
+ */
29
+ const URL_COMPONENT = '/reports/';
30
+
31
+ /**
32
+ * Reports constructor.
33
+ * @param MailchimpRequest $request
34
+ * @param MailchimpSettings $settings
35
+ * @param null $campaign_id
36
+ */
37
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $campaign_id = null)
38
+ {
39
+ parent::__construct($request, $settings);
40
+ $request->appendToEndpoint(self::URL_COMPONENT . $campaign_id);
41
+ }
42
+
43
+ //SUBCLASS FUNCTIONS ------------------------------------------------------------
44
+
45
+ /**
46
+ * @param null $member
47
+ * @return Unsubscribes
48
+ */
49
+ public function unsubscribes($member = null)
50
+ {
51
+ return new Unsubscribes(
52
+ $this->getRequest(),
53
+ $this->getSettings(),
54
+ $member
55
+ );
56
+ }
57
+
58
+ /**
59
+ * @return SubReports
60
+ */
61
+ public function subReports()
62
+ {
63
+ return new SubReports(
64
+ $this->getRequest(),
65
+ $this->getSettings()
66
+ );
67
+ }
68
+
69
+ /**
70
+ * @param null $member
71
+ * @return SentTo
72
+ */
73
+ public function sentTo($member = null)
74
+ {
75
+ return new SentTo(
76
+ $this->getRequest(),
77
+ $this->getSettings(),
78
+ $member
79
+ );
80
+ }
81
+
82
+ /**
83
+ * @return TopLocations
84
+ */
85
+ public function locations()
86
+ {
87
+ return new TopLocations(
88
+ $this->getRequest(),
89
+ $this->getSettings()
90
+ );
91
+ }
92
+
93
+ /**
94
+ * @param null $member
95
+ * @return EmailActivity
96
+ */
97
+ public function emailActivity($member = null)
98
+ {
99
+ return new EmailActivity(
100
+ $this->getRequest(),
101
+ $this->getSettings(),
102
+ $member
103
+ );
104
+ }
105
+
106
+ /**
107
+ * @return EepurlReports
108
+ */
109
+ public function eepurlReports()
110
+ {
111
+ return new EepurlReports(
112
+ $this->getRequest(),
113
+ $this->getSettings()
114
+ );
115
+ }
116
+
117
+ /**
118
+ * @return DomainPerformance
119
+ */
120
+ public function domainPerformance()
121
+ {
122
+ return new DomainPerformance(
123
+ $this->getRequest(),
124
+ $this->getSettings()
125
+ );
126
+ }
127
+
128
+ /**
129
+ * @return CampaignAdvice
130
+ */
131
+ public function advice()
132
+ {
133
+ return new CampaignAdvice(
134
+ $this->getRequest(),
135
+ $this->getSettings()
136
+ );
137
+ }
138
+
139
+ /**
140
+ * @param null $report_id
141
+ * @return CampaignAbuse
142
+ */
143
+ public function abuse($report_id = null)
144
+ {
145
+ return new CampaignAbuse(
146
+ $this->getRequest(),
147
+ $this->getSettings(),
148
+ $report_id
149
+ );
150
+ }
151
+
152
+ /**
153
+ * @param null $link_id
154
+ * @return ClickReports
155
+ */
156
+ public function clickReports($link_id = null)
157
+ {
158
+ return new ClickReports(
159
+ $this->getRequest(),
160
+ $this->getSettings(),
161
+ $link_id
162
+ );
163
+ }
164
+
165
+ /**
166
+ * @return OpenDetails
167
+ */
168
+ public function openReports()
169
+ {
170
+ return new OpenDetails(
171
+ $this->getRequest(),
172
+ $this->getSettings()
173
+ );
174
+ }
175
+
176
+ /**
177
+ * @param null $profile_id
178
+ * @return GoogleAnalytics
179
+ */
180
+ public function googleAnalytics($profile_id = null)
181
+ {
182
+ return new GoogleAnalytics(
183
+ $this->getRequest(),
184
+ $this->getSettings(),
185
+ $profile_id
186
+ );
187
+ }
188
+ }
vendor/jhut89/mailchimp3php/src/Resources/Reports/CampaignAbuse.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Reports;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class CampaignAbuse
11
+ * @package MailchimpAPI\Resources\Reports
12
+ */
13
+ class CampaignAbuse extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/abuse-reports/';
19
+
20
+ /**
21
+ * CampaignAbuse constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ * @param null $report_id
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $report_id = null)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ $request->appendToEndpoint(self::URL_COMPONENT . $report_id);
30
+ }
31
+ }
vendor/jhut89/mailchimp3php/src/Resources/Reports/CampaignAdvice.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Reports;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class CampaignAdvice
11
+ * @package MailchimpAPI\Resources\Reports
12
+ */
13
+ class CampaignAdvice extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/advice/';
19
+
20
+ /**
21
+ * CampaignAdvice constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ */
25
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings)
26
+ {
27
+ parent::__construct($request, $settings);
28
+ $request->appendToEndpoint(self::URL_COMPONENT);
29
+ }
30
+ }
vendor/jhut89/mailchimp3php/src/Resources/Reports/ClickReports.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Reports;
4
+
5
+ use MailchimpAPI\Resources\Reports\ClickReports\Members;
6
+ use MailchimpAPI\Requests\MailchimpRequest;
7
+ use MailchimpAPI\Resources\ApiResource;
8
+ use MailchimpAPI\Settings\MailchimpSettings;
9
+
10
+ /**
11
+ * Class ClickReports
12
+ * @package MailchimpAPI\Resources\Reports
13
+ */
14
+ class ClickReports extends ApiResource
15
+ {
16
+ /**
17
+ * The url component for this endpoint
18
+ */
19
+ const URL_COMPONENT = '/click-details/';
20
+
21
+ /**
22
+ * ClickReports constructor.
23
+ * @param MailchimpRequest $request
24
+ * @param MailchimpSettings $settings
25
+ * @param null $link_id
26
+ */
27
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $link_id = null)
28
+ {
29
+ parent::__construct($request, $settings);
30
+ $request->appendToEndpoint(self::URL_COMPONENT . $link_id);
31
+ }
32
+
33
+ //SUBCLASS FUNCTIONS ------------------------------------------------------------
34
+
35
+ /**
36
+ * @param null $member
37
+ * @return Members
38
+ */
39
+ public function members($member = null)
40
+ {
41
+ return new Members(
42
+ $this->getRequest(),
43
+ $this->getSettings(),
44
+ $member
45
+ );
46
+ }
47
+ }
vendor/jhut89/mailchimp3php/src/Resources/Reports/ClickReports/Members.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Reports\ClickReports;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class Members
11
+ * @package MailchimpAPI\Resources\Reports\ClickReports
12
+ */
13
+ class Members extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/members/';
19
+
20
+ /**
21
+ * Members constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ * @param null $member
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $member = null)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ if ($member && strpos($member, "@")) {
30
+ $member = md5(strtolower($member));
31
+ }
32
+ $request->appendToEndpoint(self::URL_COMPONENT . $member);
33
+ }
34
+ }
vendor/jhut89/mailchimp3php/src/Resources/Reports/DomainPerformance.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Reports;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class DomainPerformance
11
+ * @package MailchimpAPI\Resources\Reports
12
+ */
13
+ class DomainPerformance extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/domain-performance/';
19
+
20
+ /**
21
+ * DomainPerformance constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ */
25
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings)
26
+ {
27
+ parent::__construct($request, $settings);
28
+ $request->appendToEndpoint(self::URL_COMPONENT);
29
+ }
30
+ }
vendor/jhut89/mailchimp3php/src/Resources/Reports/EepurlReports.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Reports;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class EepurlReports
11
+ * @package MailchimpAPI\Resources\Reports
12
+ */
13
+ class EepurlReports extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/eepurl/';
19
+
20
+ /**
21
+ * EepurlReports constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ */
25
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings)
26
+ {
27
+ parent::__construct($request, $settings);
28
+ $request->appendToEndpoint(self::URL_COMPONENT);
29
+ }
30
+ }
vendor/jhut89/mailchimp3php/src/Resources/Reports/EmailActivity.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Reports;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class EmailActivity
11
+ * @package MailchimpAPI\Resources\Reports
12
+ */
13
+ class EmailActivity extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/email-activity/';
19
+
20
+ /**
21
+ * EmailActivity constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ * @param null $member
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $member = null)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ if ($member && strpos($member, "@")) {
30
+ $member = md5(strtolower($member));
31
+ }
32
+ $request->appendToEndpoint(self::URL_COMPONENT . $member);
33
+ }
34
+ }
vendor/jhut89/mailchimp3php/src/Resources/Reports/GoogleAnalytics.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ namespace MailchimpAPI\Resources\Reports;
5
+
6
+ use MailchimpAPI\Requests\MailchimpRequest;
7
+ use MailchimpAPI\Resources\ApiResource;
8
+ use MailchimpAPI\Settings\MailchimpSettings;
9
+
10
+ /**
11
+ * Class GoogleAnalytics
12
+ * @package MailchimpAPI\Resources\Reports
13
+ */
14
+ class GoogleAnalytics extends ApiResource
15
+ {
16
+ /**
17
+ * The url component for this endpoint
18
+ */
19
+ const URL_COMPONENT = '/google-analytics/';
20
+
21
+ /**
22
+ * GoogleAnalytics constructor.
23
+ * @param MailchimpRequest $request
24
+ * @param MailchimpSettings $settings
25
+ * @param null $profile_id
26
+ */
27
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $profile_id = null)
28
+ {
29
+ parent::__construct($request, $settings);
30
+ $request->appendToEndpoint(self::URL_COMPONENT . $profile_id);
31
+ }
32
+ }
vendor/jhut89/mailchimp3php/src/Resources/Reports/OpenDetails.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ namespace MailchimpAPI\Resources\Reports;
5
+
6
+ use MailchimpAPI\Requests\MailchimpRequest;
7
+ use MailchimpAPI\Resources\ApiResource;
8
+ use MailchimpAPI\Settings\MailchimpSettings;
9
+
10
+ /**
11
+ * Class OpenDetails
12
+ * @package MailchimpAPI\Resources\Reports
13
+ */
14
+ class OpenDetails extends ApiResource
15
+ {
16
+ /**
17
+ * The url component for this endpoint
18
+ */
19
+ const URL_COMPONENT = '/open-details/';
20
+
21
+ /**
22
+ * OpenDetails constructor.
23
+ * @param MailchimpRequest $request
24
+ * @param MailchimpSettings $settings
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ $request->appendToEndpoint(self::URL_COMPONENT);
30
+ }
31
+ }
vendor/jhut89/mailchimp3php/src/Resources/Reports/SentTo.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Reports;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class SentTo
11
+ * @package MailchimpAPI\Resources\Reports
12
+ */
13
+ class SentTo extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/sent-to/';
19
+
20
+ /**
21
+ * SentTo constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ * @param $member
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $member)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ if ($member && strpos($member, "@")) {
30
+ $member = md5(strtolower($member));
31
+ }
32
+ $request->appendToEndpoint(self::URL_COMPONENT . $member);
33
+ }
34
+ }
vendor/jhut89/mailchimp3php/src/Resources/Reports/SubReports.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Reports;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class SubReports
11
+ * @package MailchimpAPI\Resources\Reports
12
+ */
13
+ class SubReports extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/sub-reports/';
19
+
20
+ /**
21
+ * SubReports constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ */
25
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings)
26
+ {
27
+ parent::__construct($request, $settings);
28
+ $request->appendToEndpoint(self::URL_COMPONENT);
29
+ }
30
+ }
vendor/jhut89/mailchimp3php/src/Resources/Reports/TopLocations.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Reports;
4
+
5
+
6
+ use MailchimpAPI\Requests\MailchimpRequest;
7
+ use MailchimpAPI\Resources\ApiResource;
8
+ use MailchimpAPI\Settings\MailchimpSettings;
9
+
10
+ /**
11
+ * Class TopLocations
12
+ * @package MailchimpAPI\Resources\Reports
13
+ */
14
+ class TopLocations extends ApiResource
15
+ {
16
+ /**
17
+ * The url component for this endpoint
18
+ */
19
+ const URL_COMPONENT = '/locations/';
20
+
21
+ /**
22
+ * TopLocations constructor.
23
+ * @param MailchimpRequest $request
24
+ * @param MailchimpSettings $settings
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ $request->appendToEndpoint(self::URL_COMPONENT);
30
+ }
31
+ }
vendor/jhut89/mailchimp3php/src/Resources/Reports/Unsubscribes.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Reports;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class Unsubscribes
11
+ * @package MailchimpAPI\Resources\Reports
12
+ */
13
+ class Unsubscribes extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/unsubscribed/';
19
+
20
+ /**
21
+ * Unsubscribes constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ * @param null $member
25
+ */
26
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $member = null)
27
+ {
28
+ parent::__construct($request, $settings);
29
+ if ($member && strpos($member, "@")) {
30
+ $member = md5(strtolower($member));
31
+ }
32
+ $request->appendToEndpoint(self::URL_COMPONENT . $member);
33
+ }
34
+ }
vendor/jhut89/mailchimp3php/src/Resources/SearchCampaigns.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Settings\MailchimpSettings;
7
+
8
+ /**
9
+ * Class SearchCampaigns
10
+ * @package MailchimpAPI\Resources
11
+ */
12
+ class SearchCampaigns extends ApiResource
13
+ {
14
+ /**
15
+ * The url component for this endpoint
16
+ */
17
+ const URL_COMPONENT = '/search-campaigns/';
18
+
19
+ /**
20
+ * SearchCampaigns constructor.
21
+ * @param MailchimpRequest $request
22
+ * @param MailchimpSettings $settings
23
+ */
24
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings)
25
+ {
26
+ parent::__construct($request, $settings);
27
+ $request->appendToEndpoint(self::URL_COMPONENT);
28
+ }
29
+ }
vendor/jhut89/mailchimp3php/src/Resources/SearchMembers.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Settings\MailchimpSettings;
7
+
8
+ /**
9
+ * Class SearchMembers
10
+ * @package MailchimpAPI\Resources
11
+ */
12
+ class SearchMembers extends ApiResource
13
+ {
14
+ /**
15
+ * The url component for this endpoint
16
+ */
17
+ const URL_COMPONENT = '/search-members/';
18
+
19
+ /**
20
+ * SearchMembers constructor.
21
+ * @param MailchimpRequest $request
22
+ * @param MailchimpSettings $settings
23
+ */
24
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings)
25
+ {
26
+ parent::__construct($request, $settings);
27
+ $request->appendToEndpoint(self::URL_COMPONENT);
28
+ }
29
+ }
vendor/jhut89/mailchimp3php/src/Resources/TemplateFolders.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Settings\MailchimpSettings;
7
+
8
+ /**
9
+ * Class TemplateFolders
10
+ * @package MailchimpAPI\Resources
11
+ */
12
+ class TemplateFolders extends ApiResource
13
+ {
14
+ /**
15
+ * The url component for this endpoint
16
+ */
17
+ const URL_COMPONENT = '/template-folders/';
18
+
19
+ /**
20
+ * TemplateFolders constructor.
21
+ * @param MailchimpRequest $request
22
+ * @param MailchimpSettings $settings
23
+ * @param null $folder_id
24
+ */
25
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $folder_id = null)
26
+ {
27
+ parent::__construct($request, $settings);
28
+ $request->appendToEndpoint(self::URL_COMPONENT . $folder_id);
29
+ }
30
+ }
vendor/jhut89/mailchimp3php/src/Resources/Templates.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\Templates\DefaultContent;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+
10
+ /**
11
+ * Class Templates
12
+ * @package MailchimpAPI\Resources
13
+ */
14
+ class Templates extends ApiResource
15
+ {
16
+ /**
17
+ * The url component for this endpoint
18
+ */
19
+ const URL_COMPONENT = '/templates/';
20
+
21
+ /**
22
+ * Templates constructor.
23
+ * @param MailchimpRequest $request
24
+ * @param MailchimpSettings $settings
25
+ * @param $template_id
26
+ */
27
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $template_id)
28
+ {
29
+ parent::__construct($request, $settings);
30
+ $request->appendToEndpoint(self::URL_COMPONENT . $template_id);
31
+ }
32
+
33
+ //SUBCLASS FUNCTIONS ------------------------------------------------------------
34
+
35
+ /**
36
+ * @return DefaultContent
37
+ */
38
+ public function defaultContent()
39
+ {
40
+ return new DefaultContent(
41
+ $this->getRequest(),
42
+ $this->getSettings()
43
+ );
44
+ }
45
+ }
vendor/jhut89/mailchimp3php/src/Resources/Templates/DefaultContent.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources\Templates;
4
+
5
+ use MailchimpAPI\Requests\MailchimpRequest;
6
+ use MailchimpAPI\Resources\ApiResource;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class DefaultContent
11
+ * @package MailchimpAPI\Resources\Templates
12
+ */
13
+ class DefaultContent extends ApiResource
14
+ {
15
+ /**
16
+ * The url component for this endpoint
17
+ */
18
+ const URL_COMPONENT = '/default-content/';
19
+
20
+ /**
21
+ * DefaultContent constructor.
22
+ * @param MailchimpRequest $request
23
+ * @param MailchimpSettings $settings
24
+ */
25
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings)
26
+ {
27
+ parent::__construct($request, $settings);
28
+ $request->appendToEndpoint(self::URL_COMPONENT);
29
+ }
30
+ }
vendor/jhut89/mailchimp3php/src/Resources/VerifiedDomains.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Resources;
4
+
5
+
6
+ use MailchimpAPI\Requests\MailchimpRequest;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+
9
+ /**
10
+ * Class VerifiedDomains
11
+ * Represents the Verified Domains Mailchimp API endpoint
12
+ * @package MailchimpAPI\Resources
13
+ */
14
+ class VerifiedDomains extends ApiResource
15
+ {
16
+ /* @var string */
17
+ private $domain_name;
18
+
19
+ /**
20
+ * The url component for this endpoint
21
+ */
22
+ const URL_COMPONENT = '/verified-domains/';
23
+
24
+ const VERIFY_URL_COMPONENT = '/actions/verify';
25
+
26
+ /**
27
+ * VerifiedDomains constructor.
28
+ *
29
+ * @param MailchimpRequest $request
30
+ * @param MailchimpSettings $settings
31
+ * @param null $domain_name
32
+ */
33
+ public function __construct(MailchimpRequest $request, MailchimpSettings $settings, $domain_name = null)
34
+ {
35
+ parent::__construct($request, $settings);
36
+ $request->appendToEndpoint(self::URL_COMPONENT . $domain_name);
37
+ $this->domain_name = $domain_name;
38
+ }
39
+
40
+ /**
41
+ * @return \MailchimpAPI\Responses\MailchimpResponse
42
+ * @throws \MailchimpAPI\MailchimpException
43
+ */
44
+ public function verify()
45
+ {
46
+ $this->throwIfNot("domain-name", $this->domain_name);
47
+ return $this->postToActionEndpoint(self::VERIFY_URL_COMPONENT);
48
+ }
49
+ }
vendor/jhut89/mailchimp3php/src/Responses/FailureResponse.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Responses;
4
+
5
+ /**
6
+ * Class FailureResponse
7
+ * @package MailchimpAPI\Responses
8
+ */
9
+ class FailureResponse extends MailchimpResponse
10
+ {
11
+ /**
12
+ * FailureResponse constructor.
13
+ *
14
+ * @param array $headers
15
+ * @param string $body
16
+ * @param int $http_code
17
+ * @param callable|null $failure_callback
18
+ */
19
+ public function __construct($headers, $body, $http_code, callable $failure_callback = null)
20
+ {
21
+ parent::__construct($headers, $body, $http_code);
22
+
23
+ if ($failure_callback) {
24
+ call_user_func($failure_callback, $this);
25
+ }
26
+ }
27
+ }
vendor/jhut89/mailchimp3php/src/Responses/MailchimpResponse.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Responses;
4
+
5
+ use MailchimpAPI\MailchimpException;
6
+
7
+ /**
8
+ * Class MailchimpResponse
9
+ * @package MailchimpAPI\Responses
10
+ */
11
+ abstract class MailchimpResponse
12
+ {
13
+ /**
14
+ * The headers returned from a request
15
+ * @var array
16
+ */
17
+ private $headers = [];
18
+
19
+ /**
20
+ * The body returned from a request
21
+ * @var string
22
+ */
23
+ private $body;
24
+
25
+ /**
26
+ * The http response code for a request
27
+ * @var int
28
+ */
29
+ private $http_code;
30
+
31
+ /**
32
+ * MailchimpResponse constructor.
33
+ *
34
+ * @param $headers
35
+ * @param $body
36
+ * @param $http_code
37
+ */
38
+ public function __construct($headers, $body, $http_code)
39
+ {
40
+ $this->setHeaders($headers);
41
+ $this->setBody($body);
42
+ $this->setHttpCode($http_code);
43
+ }
44
+
45
+ /**
46
+ * Get the response headers
47
+ * @return array
48
+ */
49
+ public function getHeaders()
50
+ {
51
+ return $this->headers;
52
+ }
53
+
54
+ /**
55
+ * Sets the headers on this response object
56
+ *
57
+ * @param array $headers
58
+ */
59
+ public function setHeaders($headers)
60
+ {
61
+ $this->headers = $headers;
62
+ }
63
+
64
+ /**
65
+ * Gets the http code for this response object
66
+ * @return mixed
67
+ */
68
+ public function getHttpCode()
69
+ {
70
+ return $this->http_code;
71
+ }
72
+
73
+ /**
74
+ * Sets the http response code for this response object
75
+ *
76
+ * @param mixed $http_code
77
+ */
78
+ public function setHttpCode($http_code)
79
+ {
80
+ $this->http_code = $http_code;
81
+ }
82
+
83
+ /**
84
+ * Sets the body for this response object
85
+ *
86
+ * @param mixed $body
87
+ */
88
+ public function setBody($body)
89
+ {
90
+ $this->body = $body;
91
+ }
92
+
93
+ /**
94
+ * Gets the body for this response object
95
+ * @return mixed
96
+ */
97
+ public function getBody()
98
+ {
99
+ return $this->body;
100
+ }
101
+
102
+ /**
103
+ * Deserializes the response body to PHP object or array
104
+ *
105
+ * @param bool $to_array should we deserialize to an array
106
+ *
107
+ * @return mixed
108
+ * @throws MailchimpException when cant deserialize response
109
+ */
110
+ public function deserialize($to_array = false)
111
+ {
112
+ $decoded = json_decode($this->body, (bool)$to_array);
113
+ if (!$decoded) {
114
+ throw new MailchimpException("Unable to deserialize response");
115
+ }
116
+ return $decoded;
117
+ }
118
+
119
+ /**
120
+ * Return whether $this is a SuccessResponse
121
+ * @return bool
122
+ */
123
+ public function wasSuccess()
124
+ {
125
+ return $this instanceof SuccessResponse;
126
+ }
127
+
128
+ /**
129
+ * Return whether $this is a SuccessResponse
130
+ * @return bool
131
+ */
132
+ public function wasFailure()
133
+ {
134
+ return $this instanceof FailureResponse;
135
+ }
136
+ }
vendor/jhut89/mailchimp3php/src/Responses/SuccessResponse.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Responses;
4
+
5
+ /**
6
+ * Class SuccessResponse
7
+ * @package MailchimpAPI\Responses
8
+ */
9
+ class SuccessResponse extends MailchimpResponse
10
+ {
11
+ /**
12
+ * SuccessResponse constructor.
13
+ *
14
+ * @param array $headers
15
+ * @param string $body
16
+ * @param int $http_code
17
+ * @param callable|null $success_callback
18
+ */
19
+ public function __construct($headers, $body, $http_code, callable $success_callback = null)
20
+ {
21
+ parent::__construct($headers, $body, $http_code);
22
+
23
+ if ($success_callback) {
24
+ call_user_func($success_callback, $this);
25
+ }
26
+ }
27
+ }
vendor/jhut89/mailchimp3php/src/Settings/MailchimpSettings.php ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpAPI\Settings;
4
+
5
+ use MailchimpAPI\MailchimpException;
6
+
7
+ /**
8
+ * Class MailchimpSettings
9
+ * @package MailchimpAPI\Settings
10
+ */
11
+ class MailchimpSettings
12
+ {
13
+ /**
14
+ * @var bool
15
+ */
16
+ private $debug = false;
17
+ /**
18
+ * @var null
19
+ */
20
+ private $log_file = null;
21
+ /**
22
+ * @var bool
23
+ */
24
+ private $verify_ssl = true;
25
+ /**
26
+ * @var array
27
+ */
28
+ private $custom_curl_settings = [];
29
+
30
+
31
+ /*************************************
32
+ * GETTERS
33
+ *************************************/
34
+
35
+ /**
36
+ * @return bool
37
+ */
38
+ public function shouldDebug()
39
+ {
40
+ return $this->debug;
41
+ }
42
+
43
+ /**
44
+ * @return null
45
+ */
46
+ public function getLogFile()
47
+ {
48
+ return $this->log_file;
49
+ }
50
+
51
+ /**
52
+ * @return bool
53
+ */
54
+ public function shouldVerifySsl()
55
+ {
56
+ return $this->verify_ssl;
57
+ }
58
+
59
+ /**
60
+ * @return bool
61
+ */
62
+ public function shouldDebugAndLog()
63
+ {
64
+ return ($this->shouldDebug() && $this->getLogFile());
65
+ }
66
+
67
+
68
+ /**
69
+ * @return array
70
+ */
71
+ public function getCustomCurlSettings()
72
+ {
73
+ return $this->custom_curl_settings;
74
+ }
75
+
76
+ /*************************************
77
+ * SETTERS
78
+ *************************************/
79
+
80
+ /**
81
+ * @param bool $debug
82
+ */
83
+ public function setDebug($debug)
84
+ {
85
+ $this->debug = (bool)$debug;
86
+ }
87
+
88
+ /**
89
+ * Set the log file from an absolute path to a writable file
90
+ * log file must already exist to be writable
91
+ *
92
+ * @param null $log_file
93
+ *
94
+ * @throws MailchimpException
95
+ */
96
+ public function setLogFile($log_file)
97
+ {
98
+ if (is_writable($log_file)) {
99
+ $this->log_file = $log_file;
100
+ } else {
101
+ throw new MailchimpException("Cannot write to provided log file");
102
+ }
103
+ }
104
+
105
+ /**
106
+ * @param bool $verify_ssl
107
+ */
108
+ public function setVerifySsl($verify_ssl)
109
+ {
110
+ $this->verify_ssl = (bool)$verify_ssl;
111
+ }
112
+
113
+ /**
114
+ * Set custom curl options by providing a map of
115
+ * option => value
116
+ *
117
+ * @param array $options
118
+ */
119
+ public function setCustomCurlSettings(array $options)
120
+ {
121
+ foreach ($options as $option => $value) {
122
+ $this->custom_curl_settings[$option] = $value;
123
+ }
124
+ }
125
+ }
vendor/jhut89/mailchimp3php/tests/AccountTest.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests;
4
+
5
+ use MailchimpAPI\Resources\Account;
6
+
7
+ /**
8
+ * Class AccountTest
9
+ * @package MailchimpTests
10
+ */
11
+ final class AccountTest extends MailChimpTestCase
12
+ {
13
+ /**
14
+ * @throws \MailchimpAPI\MailchimpException
15
+ */
16
+ public function testRootUrl()
17
+ {
18
+ $this->endpointUrlBuildTest(
19
+ Account::URL_COMPONENT,
20
+ $this->mailchimp->account(),
21
+ "The root url should be constructed correctly"
22
+ );
23
+ }
24
+ }
vendor/jhut89/mailchimp3php/tests/AuthorizedAppsTest.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests;
4
+
5
+ use MailchimpAPI\Resources\AuthorizedApps;
6
+
7
+ /**
8
+ * Class AuthorizedAppsTest
9
+ * @package MailchimpTests
10
+ */
11
+ final class AuthorizedAppsTest extends MailChimpTestCase
12
+ {
13
+ /**
14
+ * @throws \MailchimpAPI\MailchimpException
15
+ */
16
+ public function testAuthorizedAppsCollectionUrl()
17
+ {
18
+ $this->endpointUrlBuildTest(
19
+ AuthorizedApps::URL_COMPONENT,
20
+ $this->mailchimp->apps(),
21
+ "The authorized apps url should be constructed correctly"
22
+ );
23
+ }
24
+
25
+ /**
26
+ * @throws \MailchimpAPI\MailchimpException
27
+ */
28
+ public function testAuthorizedAppsInstanceUrl()
29
+ {
30
+ $this->endpointUrlBuildTest(
31
+ AuthorizedApps::URL_COMPONENT . 1,
32
+ $this->mailchimp->apps(1),
33
+ "The authorized apps url should be constructed correctly"
34
+ );
35
+ }
36
+ }
vendor/jhut89/mailchimp3php/tests/Automations/Emails/QueueTest.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Automations\Emails;
4
+
5
+ use MailchimpAPI\Resources\Automations;
6
+ use MailchimpAPI\Resources\Automations\Emails;
7
+ use MailchimpAPI\Resources\Automations\Emails\Queue;
8
+ use MailchimpTests\MailChimpTestCase;
9
+
10
+ /**
11
+ * Class QueueTest
12
+ * @package MailchimpTests\Automations\Emails
13
+ */
14
+ class QueueTest extends MailChimpTestCase
15
+ {
16
+ /**
17
+ * @throws \MailchimpAPI\MailchimpException
18
+ */
19
+ public function testCollectionUrl()
20
+ {
21
+ $this->endpointUrlBuildTest(
22
+ Automations::URL_COMPONENT . 1 . Emails::URL_COMPONENT . 1 . Queue::URL_COMPONENT,
23
+ $this->mailchimp->automations(1)->emails(1)->queue(),
24
+ "The Queue collection endpoint should be constructed correctly"
25
+ );
26
+ }
27
+
28
+ /**
29
+ * @throws \MailchimpAPI\MailchimpException
30
+ */
31
+ public function testInstanceUrl()
32
+ {
33
+ $this->endpointUrlBuildTest(
34
+ Automations::URL_COMPONENT . 1 . Emails::URL_COMPONENT . 1 . Queue::URL_COMPONENT . 1,
35
+ $this->mailchimp->automations(1)->emails(1)->queue(1),
36
+ "The Queue instance endpoint should be constructed correctly"
37
+ );
38
+ }
39
+ }
vendor/jhut89/mailchimp3php/tests/Automations/EmailsTest.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Automations;
4
+
5
+ use MailchimpAPI\Resources\Automations;
6
+ use MailchimpAPI\Resources\Automations\Emails;
7
+ use MailchimpTests\MailChimpTestCase;
8
+
9
+ /**
10
+ * Class EmailsTest
11
+ * @package MailchimpTests\Automations
12
+ */
13
+ class EmailsTest extends MailChimpTestCase
14
+ {
15
+ /**
16
+ * @throws \MailchimpAPI\MailchimpException
17
+ */
18
+ public function testCollectionUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ Automations::URL_COMPONENT . 1 . Emails::URL_COMPONENT,
22
+ $this->mailchimp->automations(1)->emails(),
23
+ "The Emails collection endpoint should be constructed correctly"
24
+ );
25
+ }
26
+
27
+ /**
28
+ * @throws \MailchimpAPI\MailchimpException
29
+ */
30
+ public function testInstanceUrl()
31
+ {
32
+ $this->endpointUrlBuildTest(
33
+ Automations::URL_COMPONENT . 1 . Emails::URL_COMPONENT . 1,
34
+ $this->mailchimp->automations(1)->emails(1),
35
+ "The Emails instance endpoint should be constructed correctly"
36
+ );
37
+ }
38
+ }
vendor/jhut89/mailchimp3php/tests/Automations/RemovedSubscribersTest.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Automations;
4
+
5
+ use MailchimpAPI\Resources\Automations;
6
+ use MailchimpAPI\Resources\Automations\RemovedSubscribers;
7
+ use MailchimpTests\MailChimpTestCase;
8
+
9
+ /**
10
+ * Class RemovedSubscribersTest
11
+ * @package MailchimpTests\Automations
12
+ */
13
+ class RemovedSubscribersTest extends MailChimpTestCase
14
+ {
15
+ /**
16
+ * @throws \MailchimpAPI\MailchimpException
17
+ */
18
+ public function testCollectionUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ Automations::URL_COMPONENT . 1 . RemovedSubscribers::URL_COMPONENT,
22
+ $this->mailchimp->automations(1)->removedSubscribers(),
23
+ "The Removed Subscribers collection endpoint should be constructed correctly"
24
+ );
25
+ }
26
+ }
vendor/jhut89/mailchimp3php/tests/AutomationsTest.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests;
4
+
5
+ use MailchimpAPI\Resources\Automations;
6
+ use MailchimpAPI\MailchimpException;
7
+
8
+ /**
9
+ * Class AutomationsTest
10
+ * @package MailchimpTests
11
+ */
12
+ final class AutomationsTest extends MailChimpTestCase
13
+ {
14
+ /**
15
+ * @throws MailchimpException
16
+ */
17
+ public function testAutomationsCollectionUrl()
18
+ {
19
+ $this->endpointUrlBuildTest(
20
+ Automations::URL_COMPONENT,
21
+ $this->mailchimp->automations(),
22
+ "The automations collection url should be constructed correctly"
23
+ );
24
+ }
25
+
26
+ /**
27
+ * @throws MailchimpException
28
+ */
29
+ public function testAutomationsInstanceUrl()
30
+ {
31
+ $this->endpointUrlBuildTest(
32
+ Automations::URL_COMPONENT . 1,
33
+ $this->mailchimp->automations(1),
34
+ "The automations instance url should be constructed correctly"
35
+ );
36
+ }
37
+
38
+ /**
39
+ *
40
+ */
41
+ public function testAutomationsPauseAllWithoutId()
42
+ {
43
+ $error = null;
44
+ try {
45
+ $this->stub_mailchimp
46
+ ->automations()
47
+ ->pauseAll();
48
+ } catch (MailchimpException $e) {
49
+ $error = $e;
50
+ }
51
+
52
+ self::assertInstanceOf(MailchimpException::class, $error);
53
+ }
54
+
55
+ /**
56
+ *
57
+ */
58
+ public function testAutomationsStartAllWithoutId()
59
+ {
60
+ $error = null;
61
+ try {
62
+ $this->stub_mailchimp
63
+ ->automations()
64
+ ->startAll();
65
+ } catch (MailchimpException $e) {
66
+ $error = $e;
67
+ }
68
+
69
+ self::assertInstanceOf(MailchimpException::class, $error);
70
+ }
71
+ }
vendor/jhut89/mailchimp3php/tests/BatchOperationsTest.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests;
4
+
5
+ use MailchimpAPI\Resources\BatchOperations;
6
+
7
+ /**
8
+ * Class BatchOperationsTest
9
+ * @package MailchimpTests
10
+ */
11
+ class BatchOperationsTest extends MailChimpTestCase
12
+ {
13
+ /**
14
+ * @throws \MailchimpAPI\MailchimpException
15
+ */
16
+ public function testBatchOperationsCollectionUrl()
17
+ {
18
+ $this->endpointUrlBuildTest(
19
+ BatchOperations::URL_COMPONENT,
20
+ $this->mailchimp->batches(),
21
+ "The batch operations collection url should be constructed correctly"
22
+ );
23
+ }
24
+
25
+ /**
26
+ * @throws \MailchimpAPI\MailchimpException
27
+ */
28
+ public function testBatchOperationsInstanceUrl()
29
+ {
30
+ $this->endpointUrlBuildTest(
31
+ BatchOperations::URL_COMPONENT . 1,
32
+ $this->mailchimp->batches(1),
33
+ "The batch operations instance url should be constructed correctly"
34
+ );
35
+ }
36
+ }
vendor/jhut89/mailchimp3php/tests/BatchWebhooksTest.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests;
4
+
5
+
6
+ use MailchimpAPI\Resources\BatchWebhooks;
7
+
8
+ /**
9
+ * Class BatchWebhooksTest
10
+ * @package MailchimpTests
11
+ */
12
+ class BatchWebhooksTest extends MailChimpTestCase
13
+ {
14
+ /**
15
+ * @throws \MailchimpAPI\MailchimpException
16
+ */
17
+ public function testBatchWebhookCollectionUrl()
18
+ {
19
+ $this->endpointUrlBuildTest(
20
+ BatchWebhooks::URL_COMPONENT,
21
+ $this->mailchimp->batchWebhooks(),
22
+ "The batch webhooks collection url should be constructed correctly"
23
+ );
24
+ }
25
+
26
+ /**
27
+ * @throws \MailchimpAPI\MailchimpException
28
+ */
29
+ public function testBatchWebhooksInstanceUrl()
30
+ {
31
+ $this->endpointUrlBuildTest(
32
+ BatchWebhooks::URL_COMPONENT . 1,
33
+ $this->mailchimp->batchWebhooks(1),
34
+ "The batch webhooks instance url should be constructed correctly"
35
+ );
36
+ }
37
+ }
vendor/jhut89/mailchimp3php/tests/CampaignFoldersTest.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests;
4
+
5
+
6
+ use MailchimpAPI\Resources\CampaignFolders;
7
+
8
+ /**
9
+ * Class CampaignFoldersTest
10
+ * @package MailchimpTests
11
+ */
12
+ class CampaignFoldersTest extends MailChimpTestCase
13
+ {
14
+ /**
15
+ * @throws \MailchimpAPI\MailchimpException
16
+ */
17
+ public function testCampaignFoldersCollectionUrl()
18
+ {
19
+ $this->endpointUrlBuildTest(
20
+ CampaignFolders::URL_COMPONENT,
21
+ $this->mailchimp->campaignFolders(),
22
+ "The campaign folders collection url should be constructed correctly"
23
+ );
24
+ }
25
+
26
+ /**
27
+ * @throws \MailchimpAPI\MailchimpException
28
+ */
29
+ public function testCampaignFoldersInstanceUrl()
30
+ {
31
+ $this->endpointUrlBuildTest(
32
+ CampaignFolders::URL_COMPONENT . 1,
33
+ $this->mailchimp->campaignFolders(1),
34
+ "The campaign folders instance url should be constructed correctly"
35
+ );
36
+ }
37
+ }
vendor/jhut89/mailchimp3php/tests/Campaigns/ContentTest.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Campaigns;
4
+
5
+ use MailchimpAPI\Resources\Campaigns;
6
+ use MailchimpAPI\Resources\Campaigns\Content;
7
+ use MailchimpTests\MailChimpTestCase;
8
+
9
+ /**
10
+ * Class ContentTest
11
+ * @package MailchimpTests\Campaigns
12
+ */
13
+ class ContentTest extends MailChimpTestCase
14
+ {
15
+ /**
16
+ * @throws \MailchimpAPI\MailchimpException
17
+ */
18
+ public function testCollectionUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ Campaigns::URL_COMPONENT . 1 . Content::URL_COMPONENT,
22
+ $this->mailchimp->campaigns(1)->content(),
23
+ "The Content endpoint should be constructed correctly"
24
+ );
25
+ }
26
+ }
vendor/jhut89/mailchimp3php/tests/Campaigns/FeedbackTest.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Campaigns;
4
+
5
+ use MailchimpAPI\Resources\Campaigns;
6
+ use MailchimpAPI\Resources\Campaigns\Feedback;
7
+ use MailchimpTests\MailChimpTestCase;
8
+
9
+
10
+ /**
11
+ * Class FeedbackTest
12
+ * @package MailchimpTests\Campaigns
13
+ */
14
+ class FeedbackTest extends MailChimpTestCase
15
+ {
16
+ /**
17
+ * @throws \MailchimpAPI\MailchimpException
18
+ */
19
+ public function testCollectionUrl()
20
+ {
21
+ $this->endpointUrlBuildTest(
22
+ Campaigns::URL_COMPONENT . 1 . Feedback::URL_COMPONENT,
23
+ $this->mailchimp->campaigns(1)->feedback(),
24
+ "The Feedback collection endpoint should be constructed correctly"
25
+ );
26
+ }
27
+
28
+ /**
29
+ * @throws \MailchimpAPI\MailchimpException
30
+ */
31
+ public function testInstanceUrl()
32
+ {
33
+ $this->endpointUrlBuildTest(
34
+ Campaigns::URL_COMPONENT . 1 . Feedback::URL_COMPONENT . 1,
35
+ $this->mailchimp->campaigns(1)->feedback(1),
36
+ "The Feedback instance endpoint should be constructed correctly"
37
+ );
38
+ }
39
+ }
vendor/jhut89/mailchimp3php/tests/Campaigns/SendChecklistTest.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Campaigns;
4
+
5
+ use MailchimpAPI\Resources\Campaigns;
6
+ use MailchimpAPI\Resources\Campaigns\SendChecklist;
7
+ use MailchimpTests\MailChimpTestCase;
8
+
9
+ /**
10
+ * Class SendChecklistTest
11
+ * @package MailchimpTests\Campaigns
12
+ */
13
+ class SendChecklistTest extends MailChimpTestCase
14
+ {
15
+ /**
16
+ * @throws \MailchimpAPI\MailchimpException
17
+ */
18
+ public function testCollectionUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ Campaigns::URL_COMPONENT . 1 . SendChecklist::URL_COMPONENT,
22
+ $this->mailchimp->campaigns(1)->checklist(),
23
+ "The Checklist endpoint should be constructed correctly"
24
+ );
25
+ }
26
+ }
vendor/jhut89/mailchimp3php/tests/CampaignsTest.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests;
4
+
5
+ use MailchimpAPI\Resources\Campaigns;
6
+ use MailchimpAPI\MailchimpException;
7
+
8
+ /**
9
+ * Class CampaignsTest
10
+ * @package MailchimpTests
11
+ */
12
+ class CampaignsTest extends MailChimpTestCase
13
+ {
14
+ /**
15
+ * @throws MailchimpException
16
+ */
17
+ public function testCampaignFoldersCollectionUrl()
18
+ {
19
+ $this->endpointUrlBuildTest(
20
+ Campaigns::URL_COMPONENT,
21
+ $this->mailchimp->campaigns(),
22
+ "The campaigns collection url should be constructed correctly"
23
+ );
24
+ }
25
+
26
+ /**
27
+ * @throws MailchimpException
28
+ */
29
+ public function testCampaignFoldersInstanceUrl()
30
+ {
31
+ $this->endpointUrlBuildTest(
32
+ Campaigns::URL_COMPONENT . 1,
33
+ $this->mailchimp->campaigns(1),
34
+ "The campaigns instance url should be constructed correctly"
35
+ );
36
+ }
37
+ }
vendor/jhut89/mailchimp3php/tests/ConnectedSitesTest.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests;
4
+
5
+ use MailchimpAPI\Resources\ConnectedSites;
6
+
7
+ class ConnectedSitesTest extends MailChimpTestCase
8
+ {
9
+ public function testCollectionUrl()
10
+ {
11
+ $this->endpointUrlBuildTest(
12
+ ConnectedSites::URL_COMPONENT,
13
+ $this->mailchimp->connectedSites(),
14
+ "The Connected Sites url should be constructed correctly"
15
+ );
16
+ }
17
+
18
+ public function testInstanceUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ ConnectedSites::URL_COMPONENT . 1,
22
+ $this->mailchimp->connectedSites(1),
23
+ "The Connected Sites url should be constructed correctly"
24
+ );
25
+ }
26
+ }
vendor/jhut89/mailchimp3php/tests/Conversations/MessagesTest.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Conversations;
4
+
5
+ use MailchimpAPI\Resources\Conversations;
6
+ use MailchimpAPI\Resources\Conversations\Messages;
7
+ use MailchimpTests\MailChimpTestCase;
8
+
9
+ /**
10
+ * Class MessagesTest
11
+ * @package MailchimpTests\Conversations
12
+ */
13
+ class MessagesTest extends MailChimpTestCase
14
+ {
15
+ /**
16
+ * @throws \MailchimpAPI\MailchimpException
17
+ */
18
+ public function testCollectionUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ Conversations::URL_COMPONENT . 1 . Messages::URL_COMPONENT,
22
+ $this->mailchimp->conversations(1)->messages(),
23
+ "The Messages collection endpoint should be constructed correctly"
24
+ );
25
+ }
26
+
27
+ /**
28
+ * @throws \MailchimpAPI\MailchimpException
29
+ */
30
+ public function testInstanceUrl()
31
+ {
32
+ $this->endpointUrlBuildTest(
33
+ Conversations::URL_COMPONENT . 1 . Messages::URL_COMPONENT . 1,
34
+ $this->mailchimp->conversations(1)->messages(1),
35
+ "The Messages instance endpoint should be constructed correctly"
36
+ );
37
+ }
38
+ }
vendor/jhut89/mailchimp3php/tests/ConversationsTest.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests;
4
+
5
+ use MailchimpAPI\Resources\Conversations;
6
+
7
+ class ConversationsTest extends MailChimpTestCase
8
+ {
9
+ public function testConversationsCollectionUrl()
10
+ {
11
+ $this->endpointUrlBuildTest(
12
+ Conversations::URL_COMPONENT,
13
+ $this->mailchimp->conversations(),
14
+ "The conversations collection endpoint should be constructed correctly"
15
+ );
16
+ }
17
+
18
+ public function testConversationsInstanceUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ Conversations::URL_COMPONENT . '1',
22
+ $this->mailchimp->conversations(1),
23
+ "The conversations instance endpoint should be constructed correctly"
24
+ );
25
+ }
26
+ }
vendor/jhut89/mailchimp3php/tests/EcommerceStores/Carts/LinesTest.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\EcommerceStores\Carts;
4
+
5
+ use MailchimpAPI\Resources\EcommerceStores;
6
+ use MailchimpAPI\Resources\EcommerceStores\Carts;
7
+ use MailchimpAPI\Resources\EcommerceStores\Carts\Lines;
8
+ use MailchimpTests\MailChimpTestCase;
9
+
10
+ /**
11
+ * Class LinesTest
12
+ * @package MailchimpTests\EcommerceStores\Carts
13
+ */
14
+ class LinesTest extends MailChimpTestCase
15
+ {
16
+ /**
17
+ * @throws \MailchimpAPI\MailchimpException
18
+ */
19
+ public function testCollectionUrl()
20
+ {
21
+ $this->endpointUrlBuildTest(
22
+ EcommerceStores::URL_COMPONENT . 1 . Carts::URL_COMPONENT . 1 . Lines::URL_COMPONENT,
23
+ $this->mailchimp->ecommerceStores(1)->carts(1)->lines(),
24
+ "The Lines collection endpoint should be constructed correctly"
25
+ );
26
+ }
27
+
28
+ /**
29
+ * @throws \MailchimpAPI\MailchimpException
30
+ */
31
+ public function testInstanceUrl()
32
+ {
33
+ $this->endpointUrlBuildTest(
34
+ EcommerceStores::URL_COMPONENT . 1 . Carts::URL_COMPONENT . 1 . Lines::URL_COMPONENT . 1,
35
+ $this->mailchimp->ecommerceStores(1)->carts(1)->lines(1),
36
+ "The Lines instance endpoint should be constructed correctly"
37
+ );
38
+ }
39
+ }
vendor/jhut89/mailchimp3php/tests/EcommerceStores/CartsTest.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by IntelliJ IDEA.
4
+ * User: hutch
5
+ * Date: 7/2/18
6
+ * Time: 4:36 PM
7
+ */
8
+
9
+ namespace MailchimpTests\EcommerceStores;
10
+
11
+ use MailchimpAPI\Resources\EcommerceStores;
12
+ use MailchimpAPI\Resources\EcommerceStores\Carts;
13
+ use MailchimpTests\MailChimpTestCase;
14
+
15
+ /**
16
+ * Class CartsTest
17
+ * @package MailchimpTests\EcommerceStores
18
+ */
19
+ class CartsTest extends MailChimpTestCase
20
+ {
21
+ /**
22
+ * @throws \MailchimpAPI\MailchimpException
23
+ */
24
+ public function testCollectionUrl()
25
+ {
26
+ $this->endpointUrlBuildTest(
27
+ EcommerceStores::URL_COMPONENT . 1 . Carts::URL_COMPONENT,
28
+ $this->mailchimp->ecommerceStores(1)->carts(),
29
+ "The Carts collection endpoint should be constructed correctly"
30
+ );
31
+ }
32
+
33
+ /**
34
+ * @throws \MailchimpAPI\MailchimpException
35
+ */
36
+ public function testInstanceUrl()
37
+ {
38
+ $this->endpointUrlBuildTest(
39
+ EcommerceStores::URL_COMPONENT . 1 . Carts::URL_COMPONENT . 1,
40
+ $this->mailchimp->ecommerceStores(1)->carts(1),
41
+ "The Carts instance endpoint should be constructed correctly"
42
+ );
43
+ }
44
+ }
vendor/jhut89/mailchimp3php/tests/EcommerceStores/CustomersTest.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by IntelliJ IDEA.
4
+ * User: hutch
5
+ * Date: 7/2/18
6
+ * Time: 4:40 PM
7
+ */
8
+
9
+ namespace MailchimpTests\EcommerceStores;
10
+
11
+ use MailchimpAPI\Resources\EcommerceStores;
12
+ use MailchimpAPI\Resources\EcommerceStores\Customers;
13
+ use MailchimpTests\MailChimpTestCase;
14
+
15
+ /**
16
+ * Class CustomersTest
17
+ * @package MailchimpTests\EcommerceStores
18
+ */
19
+ class CustomersTest extends MailChimpTestCase
20
+ {
21
+ /**
22
+ * @throws \MailchimpAPI\MailchimpException
23
+ */
24
+ public function testCollectionUrl()
25
+ {
26
+ $this->endpointUrlBuildTest(
27
+ EcommerceStores::URL_COMPONENT . 1 . Customers::URL_COMPONENT,
28
+ $this->mailchimp->ecommerceStores(1)->customers(),
29
+ "The Customers collection endpoint should be constructed correctly"
30
+ );
31
+ }
32
+
33
+ /**
34
+ * @throws \MailchimpAPI\MailchimpException
35
+ */
36
+ public function testInstanceUrl()
37
+ {
38
+ $this->endpointUrlBuildTest(
39
+ EcommerceStores::URL_COMPONENT . 1 . Customers::URL_COMPONENT . 1,
40
+ $this->mailchimp->ecommerceStores(1)->customers(1),
41
+ "The Customers instance endpoint should be constructed correctly"
42
+ );
43
+ }
44
+ }
vendor/jhut89/mailchimp3php/tests/EcommerceStores/Orders/LinesTest.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\EcommerceStores\Orders;
4
+
5
+ use MailchimpAPI\Resources\EcommerceStores;
6
+ use MailchimpAPI\Resources\EcommerceStores\Orders;
7
+ use MailchimpAPI\Resources\EcommerceStores\Orders\Lines;
8
+ use MailchimpTests\MailChimpTestCase;
9
+
10
+ /**
11
+ * Class LinesTest
12
+ * @package MailchimpTests\EcommerceStores\Orders
13
+ */
14
+ class LinesTest extends MailChimpTestCase
15
+ {
16
+ /**
17
+ * @throws \MailchimpAPI\MailchimpException
18
+ */
19
+ public function testCollectionUrl()
20
+ {
21
+ $this->endpointUrlBuildTest(
22
+ EcommerceStores::URL_COMPONENT . 1 . Orders::URL_COMPONENT . 1 . Lines::URL_COMPONENT,
23
+ $this->mailchimp->ecommerceStores(1)->orders(1)->lines(),
24
+ "The Lines collection endpoint should be constructed correctly"
25
+ );
26
+ }
27
+
28
+ /**
29
+ * @throws \MailchimpAPI\MailchimpException
30
+ */
31
+ public function testInstanceUrl()
32
+ {
33
+ $this->endpointUrlBuildTest(
34
+ EcommerceStores::URL_COMPONENT . 1 . Orders::URL_COMPONENT . 1 . Lines::URL_COMPONENT . 1,
35
+ $this->mailchimp->ecommerceStores(1)->orders(1)->lines(1),
36
+ "The Lines instance endpoint should be constructed correctly"
37
+ );
38
+ }
39
+ }
vendor/jhut89/mailchimp3php/tests/EcommerceStores/OrdersTest.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\EcommerceStores;
4
+
5
+ use MailchimpAPI\Resources\EcommerceStores;
6
+ use MailchimpAPI\Resources\EcommerceStores\Orders;
7
+ use MailchimpTests\MailChimpTestCase;
8
+
9
+ /**
10
+ * Class OrdersTest
11
+ * @package MailchimpTests\EcommerceStores
12
+ */
13
+ class OrdersTest extends MailChimpTestCase
14
+ {
15
+ /**
16
+ * @throws \MailchimpAPI\MailchimpException
17
+ */
18
+ public function testCollectionUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ EcommerceStores::URL_COMPONENT . 1 . Orders::URL_COMPONENT,
22
+ $this->mailchimp->ecommerceStores(1)->orders(),
23
+ "The Orders collection endpoint should be constructed correctly"
24
+ );
25
+ }
26
+
27
+ /**
28
+ * @throws \MailchimpAPI\MailchimpException
29
+ */
30
+ public function testInstanceUrl()
31
+ {
32
+ $this->endpointUrlBuildTest(
33
+ EcommerceStores::URL_COMPONENT . 1 . Orders::URL_COMPONENT . 1,
34
+ $this->mailchimp->ecommerceStores(1)->orders(1),
35
+ "The Orders instance endpoint should be constructed correctly"
36
+ );
37
+ }
38
+ }
vendor/jhut89/mailchimp3php/tests/EcommerceStores/Products/ImagesTest.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\EcommerceStores\Products;
4
+
5
+ use MailchimpAPI\Resources\EcommerceStores;
6
+ use MailchimpAPI\Resources\EcommerceStores\Products;
7
+ use MailchimpAPI\Resources\EcommerceStores\Products\Images;
8
+ use MailchimpTests\MailChimpTestCase;
9
+
10
+
11
+ /**
12
+ * Class ImagesTest
13
+ * @package MailchimpTests\EcommerceStores\Products
14
+ */
15
+ class ImagesTest extends MailChimpTestCase
16
+ {
17
+ /**
18
+ * @throws \MailchimpAPI\MailchimpException
19
+ */
20
+ public function testCollectionUrl()
21
+ {
22
+ $this->endpointUrlBuildTest(
23
+ EcommerceStores::URL_COMPONENT . 1 . Products::URL_COMPONENT . 1 . Images::URL_COMPONENT,
24
+ $this->mailchimp->ecommerceStores(1)->products(1)->images(),
25
+ "The Images collection endpoint should be constructed correctly"
26
+ );
27
+ }
28
+
29
+ /**
30
+ * @throws \MailchimpAPI\MailchimpException
31
+ */
32
+ public function testInstanceUrl()
33
+ {
34
+ $this->endpointUrlBuildTest(
35
+ EcommerceStores::URL_COMPONENT . 1 . Products::URL_COMPONENT . 1 . Images::URL_COMPONENT . 1,
36
+ $this->mailchimp->ecommerceStores(1)->products(1)->images(1),
37
+ "The Images instance endpoint should be constructed correctly"
38
+ );
39
+ }
40
+ }
vendor/jhut89/mailchimp3php/tests/EcommerceStores/Products/VariantsTest.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\EcommerceStores\Products;
4
+
5
+ use MailchimpAPI\Resources\EcommerceStores\Products\Variants;
6
+ use MailchimpAPI\Resources\EcommerceStores;
7
+ use MailchimpAPI\Resources\EcommerceStores\Products;
8
+ use MailchimpTests\MailChimpTestCase;
9
+
10
+ /**
11
+ * Class VariantsTest
12
+ * @package MailchimpTests\EcommerceStores\Products
13
+ */
14
+ class VariantsTest extends MailChimpTestCase
15
+ {
16
+ /**
17
+ * @throws \MailchimpAPI\MailchimpException
18
+ */
19
+ public function testCollectionUrl()
20
+ {
21
+ $this->endpointUrlBuildTest(
22
+ EcommerceStores::URL_COMPONENT . 1 . Products::URL_COMPONENT . 1 . Variants::URL_COMPONENT,
23
+ $this->mailchimp->ecommerceStores(1)->products(1)->variants(),
24
+ "The Variants collection endpoint should be constructed correctly"
25
+ );
26
+ }
27
+
28
+ /**
29
+ * @throws \MailchimpAPI\MailchimpException
30
+ */
31
+ public function testInstanceUrl()
32
+ {
33
+ $this->endpointUrlBuildTest(
34
+ EcommerceStores::URL_COMPONENT . 1 . Products::URL_COMPONENT . 1 . Variants::URL_COMPONENT . 1,
35
+ $this->mailchimp->ecommerceStores(1)->products(1)->variants(1),
36
+ "The Variants instance endpoint should be constructed correctly"
37
+ );
38
+ }
39
+ }
vendor/jhut89/mailchimp3php/tests/EcommerceStores/ProductsTest.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\EcommerceStores;
4
+
5
+ use MailchimpAPI\Resources\EcommerceStores;
6
+ use MailchimpAPI\Resources\EcommerceStores\Products;
7
+ use MailchimpTests\MailChimpTestCase;
8
+
9
+ /**
10
+ * Class ProductsTest
11
+ * @package MailchimpTests\EcommerceStores
12
+ */
13
+ class ProductsTest extends MailChimpTestCase
14
+ {
15
+ /**
16
+ * @throws \MailchimpAPI\MailchimpException
17
+ */
18
+ public function testCollectionUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ EcommerceStores::URL_COMPONENT . 1 . Products::URL_COMPONENT,
22
+ $this->mailchimp->ecommerceStores(1)->products(),
23
+ "The Products collection endpoint should be constructed correctly"
24
+ );
25
+ }
26
+
27
+ /**
28
+ * @throws \MailchimpAPI\MailchimpException
29
+ */
30
+ public function testInstanceUrl()
31
+ {
32
+ $this->endpointUrlBuildTest(
33
+ EcommerceStores::URL_COMPONENT . 1 . Products::URL_COMPONENT . 1,
34
+ $this->mailchimp->ecommerceStores(1)->products(1),
35
+ "The Products instance endpoint should be constructed correctly"
36
+ );
37
+ }
38
+ }
vendor/jhut89/mailchimp3php/tests/EcommerceStores/PromoRules/PromoCodesTest.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\EcommerceStores\PromoRules;
4
+
5
+ use MailchimpAPI\Resources\EcommerceStores;
6
+ use MailchimpAPI\Resources\EcommerceStores\PromoRules;
7
+ use MailchimpAPI\Resources\EcommerceStores\PromoRules\PromoCodes;
8
+ use MailchimpTests\MailChimpTestCase;
9
+
10
+ class PromoCodesTest extends MailChimpTestCase
11
+ {
12
+ /**
13
+ * @throws \MailchimpAPI\MailchimpException
14
+ */
15
+ public function testCollectionUrl()
16
+ {
17
+ $this->endpointUrlBuildTest(
18
+ EcommerceStores::URL_COMPONENT . 1 . PromoRules::URL_COMPONENT . 1 . PromoCodes::URL_COMPONENT,
19
+ $this->mailchimp->ecommerceStores(1)->promoRules(1)->promoCodes(),
20
+ "The Promo Codes collection endpoint should be constructed correctly"
21
+ );
22
+ }
23
+
24
+ /**
25
+ * @throws \MailchimpAPI\MailchimpException
26
+ */
27
+ public function testInstanceUrl()
28
+ {
29
+ $this->endpointUrlBuildTest(
30
+ EcommerceStores::URL_COMPONENT . 1 . PromoRules::URL_COMPONENT . 1 . PromoCodes::URL_COMPONENT . 1,
31
+ $this->mailchimp->ecommerceStores(1)->promoRules(1)->promoCodes(1),
32
+ "The Promo Codes instance endpoint should be constructed correctly"
33
+ );
34
+ }
35
+ }
vendor/jhut89/mailchimp3php/tests/EcommerceStores/PromoRulesTest.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\EcommerceStores;
4
+
5
+ use MailchimpAPI\Resources\EcommerceStores;
6
+ use MailchimpAPI\Resources\EcommerceStores\PromoRules;
7
+ use MailchimpTests\MailChimpTestCase;
8
+
9
+ class PromoRulesTest extends MailChimpTestCase
10
+ {
11
+ /**
12
+ * @throws \MailchimpAPI\MailchimpException
13
+ */
14
+ public function testCollectionUrl()
15
+ {
16
+ $this->endpointUrlBuildTest(
17
+ EcommerceStores::URL_COMPONENT . 1 . PromoRules::URL_COMPONENT,
18
+ $this->mailchimp->ecommerceStores(1)->promoRules(),
19
+ "The Promo Rules collection endpoint should be constructed correctly"
20
+ );
21
+ }
22
+
23
+ /**
24
+ * @throws \MailchimpAPI\MailchimpException
25
+ */
26
+ public function testInstanceUrl()
27
+ {
28
+ $this->endpointUrlBuildTest(
29
+ EcommerceStores::URL_COMPONENT . 1 . PromoRules::URL_COMPONENT . 1,
30
+ $this->mailchimp->ecommerceStores(1)->promoRules(1),
31
+ "The Promo Rules instance endpoint should be constructed correctly"
32
+ );
33
+ }
34
+ }
vendor/jhut89/mailchimp3php/tests/EcommerceStoresTest.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests;
4
+
5
+
6
+ use MailchimpAPI\Resources\EcommerceStores;
7
+
8
+ /**
9
+ * Class EcommerceStoresTest
10
+ * @package MailchimpTests
11
+ */
12
+ class EcommerceStoresTest extends MailChimpTestCase
13
+ {
14
+ /**
15
+ * @throws \MailchimpAPI\MailchimpException
16
+ */
17
+ public function testEcommerceStoresCollectionUrl()
18
+ {
19
+ $this->endpointUrlBuildTest(
20
+ EcommerceStores::URL_COMPONENT,
21
+ $this->mailchimp->ecommerceStores(),
22
+ "The Ecommerce Stores collection endpoint should be constructed correctly"
23
+ );
24
+ }
25
+
26
+ /**
27
+ * @throws \MailchimpAPI\MailchimpException
28
+ */
29
+ public function testEcommerceStoresInstanceUrl()
30
+ {
31
+ $this->endpointUrlBuildTest(
32
+ EcommerceStores::URL_COMPONENT . 1,
33
+ $this->mailchimp->ecommerceStores(1),
34
+ "The Ecommerce Stores instance endpoint should be constructed correctly"
35
+ );
36
+ }
37
+ }
vendor/jhut89/mailchimp3php/tests/FacebookAdsTest.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests;
4
+
5
+ use MailchimpAPI\Resources\FacebookAds;
6
+
7
+ class FacebookAdsTest extends MailChimpTestCase
8
+ {
9
+
10
+ /**
11
+ * @throws \MailchimpAPI\MailchimpException
12
+ */
13
+ public function testFacebookAdsCollectionUrl()
14
+ {
15
+ $this->endpointUrlBuildTest(
16
+ FacebookAds::URL_COMPONENT,
17
+ $this->mailchimp->facebookAds(),
18
+ "The Facebook Ads collection endpoint should be constructed correctly"
19
+ );
20
+ }
21
+
22
+ /**
23
+ * @throws \MailchimpAPI\MailchimpException
24
+ */
25
+ public function testFacebookAdsInstanceUrl()
26
+ {
27
+ $this->endpointUrlBuildTest(
28
+ FacebookAds::URL_COMPONENT . 1,
29
+ $this->mailchimp->facebookAds(1),
30
+ "The Facebook Ads instance endpoint should be constructed correctly"
31
+ );
32
+ }
33
+ }
vendor/jhut89/mailchimp3php/tests/FileManagerFilesTest.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests;
4
+
5
+ use MailchimpAPI\Resources\FileManagerFiles;
6
+
7
+ class FileManagerFilesTest extends MailChimpTestCase
8
+ {
9
+ public function testFileManagerFilesCollectionUrl()
10
+ {
11
+ $this->endpointUrlBuildTest(
12
+ FileManagerFiles::URL_COMPONENT,
13
+ $this->mailchimp->fileManagerFiles(),
14
+ "The File Manager Files collection endpoint should be constructed correctly"
15
+ );
16
+ }
17
+
18
+ public function testFileManagerFilesInstanceUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ FileManagerFiles::URL_COMPONENT . 1,
22
+ $this->mailchimp->fileManagerFiles(1),
23
+ "The File Manager Files instance endpoint should be constructed correctly"
24
+ );
25
+ }
26
+ }
vendor/jhut89/mailchimp3php/tests/FileManagerFoldersTest.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests;
4
+
5
+ use MailchimpAPI\Resources\FileManagerFolders;
6
+
7
+ class FileManagerFoldersTest extends MailChimpTestCase
8
+ {
9
+ public function testFileManagerFoldersCollectionUrl()
10
+ {
11
+ $this->endpointUrlBuildTest(
12
+ FileManagerFolders::URL_COMPONENT,
13
+ $this->mailchimp->fileManagerFolders(),
14
+ "The File Manager Folders collection endpoint should be constructed correctly"
15
+ );
16
+ }
17
+
18
+ public function testFileManagerFoldersInstanceUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ FileManagerFolders::URL_COMPONENT . 1,
22
+ $this->mailchimp->fileManagerFolders(1),
23
+ "The File Manager Folders instance endpoint should be constructed correctly"
24
+ );
25
+ }
26
+ }
vendor/jhut89/mailchimp3php/tests/GoogleAdsTest.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests;
4
+
5
+ use MailchimpAPI\Resources\GoogleAds;
6
+
7
+ class GoogleAdsTest extends MailChimpTestCase
8
+ {
9
+ public function testGoogleAdsCollectionUrl()
10
+ {
11
+ $this->endpointUrlBuildTest(
12
+ GoogleAds::URL_COMPONENT,
13
+ $this->mailchimp->googleAds(),
14
+ "The Facebook Ads collection endpoint should be constructed correctly"
15
+ );
16
+ }
17
+
18
+ public function testGoogleAdsInstanceUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ GoogleAds::URL_COMPONENT . 1,
22
+ $this->mailchimp->googleAds(1),
23
+ "The Facebook Ads instance endpoint should be constructed correctly"
24
+ );
25
+ }
26
+ }
vendor/jhut89/mailchimp3php/tests/LandingPages/ContentTest.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\LandingPages;
4
+
5
+ use MailchimpAPI\Resources\LandingPages;
6
+ use MailchimpAPI\Resources\LandingPages\Content;
7
+ use MailchimpTests\MailChimpTestCase;
8
+
9
+ class ContentTest extends MailChimpTestCase
10
+ {
11
+ public function testCollectionUrl()
12
+ {
13
+ $this->endpointUrlBuildTest(
14
+ LandingPages::URL_COMPONENT . 1 . Content::URL_COMPONENT,
15
+ $this->mailchimp->landingPages(1)->content(),
16
+ "The Landing Pages Content endpoint should be constructed correctly"
17
+ );
18
+ }
19
+ }
vendor/jhut89/mailchimp3php/tests/LandingPagesTest.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests;
4
+
5
+ use MailchimpAPI\Resources\LandingPages;
6
+
7
+ class LandingPagesTest extends MailChimpTestCase
8
+ {
9
+ public function testLandingPagesCollectionUrl()
10
+ {
11
+ $this->endpointUrlBuildTest(
12
+ LandingPages::URL_COMPONENT,
13
+ $this->mailchimp->landingPages(),
14
+ "The Landing Pages collection endpoint should be constructed correctly"
15
+ );
16
+ }
17
+
18
+ public function testLandingPagesInstanceUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ LandingPages::URL_COMPONENT . 1,
22
+ $this->mailchimp->landingPages(1),
23
+ "The Landing Pages instance endpoint should be constructed correctly"
24
+ );
25
+ }
26
+ }
vendor/jhut89/mailchimp3php/tests/Lists/AbuseReportsTest.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Lists;
4
+
5
+ use MailchimpAPI\Resources\Lists;
6
+ use MailchimpAPI\Resources\Lists\AbuseReports;
7
+ use MailchimpTests\MailChimpTestCase;
8
+
9
+ /**
10
+ * Class AbuseReportsTest
11
+ * @package MailchimpTests\Lists
12
+ */
13
+ class AbuseReportsTest extends MailChimpTestCase
14
+ {
15
+ /**
16
+ * @throws \MailchimpAPI\MailchimpException
17
+ */
18
+ public function testCollectionUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ Lists::URL_COMPONENT . 1 . AbuseReports::URL_COMPONENT,
22
+ $this->mailchimp->lists(1)->abuseReports(),
23
+ "The Abuse Reports collection endpoint should be constructed correctly"
24
+ );
25
+ }
26
+
27
+ /**
28
+ * @throws \MailchimpAPI\MailchimpException
29
+ */
30
+ public function testInstanceUrl()
31
+ {
32
+ $this->endpointUrlBuildTest(
33
+ Lists::URL_COMPONENT . 1 . AbuseReports::URL_COMPONENT . 1,
34
+ $this->mailchimp->lists(1)->abuseReports(1),
35
+ "The Abuse Reports instance endpoint should be constructed correctly"
36
+ );
37
+ }
38
+ }
vendor/jhut89/mailchimp3php/tests/Lists/ActivityTest.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by IntelliJ IDEA.
4
+ * User: hutch
5
+ * Date: 7/2/18
6
+ * Time: 5:11 PM
7
+ */
8
+
9
+ namespace MailchimpTests\Lists;
10
+
11
+ use MailchimpAPI\Resources\Lists\Activity;
12
+ use MailchimpTests\MailChimpTestCase;
13
+ use MailchimpAPI\Resources\Lists;
14
+
15
+ /**
16
+ * Class ActivityTest
17
+ * @package MailchimpTests\Lists
18
+ */
19
+ class ActivityTest extends MailChimpTestCase
20
+ {
21
+ /**
22
+ * @throws \MailchimpAPI\MailchimpException
23
+ */
24
+ public function testCollectionUrl()
25
+ {
26
+ $this->endpointUrlBuildTest(
27
+ Lists::URL_COMPONENT . 1 . Activity::URL_COMPONENT,
28
+ $this->mailchimp->lists(1)->activity(),
29
+ "The Activity collection endpoint should be constructed correctly"
30
+ );
31
+ }
32
+ }
vendor/jhut89/mailchimp3php/tests/Lists/ClientsTest.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by IntelliJ IDEA.
4
+ * User: hutch
5
+ * Date: 7/2/18
6
+ * Time: 5:13 PM
7
+ */
8
+
9
+ namespace MailchimpTests\Lists;
10
+
11
+ use MailchimpAPI\Resources\Lists\Clients;
12
+ use MailchimpTests\MailChimpTestCase;
13
+ use MailchimpAPI\Resources\Lists;
14
+
15
+ /**
16
+ * Class ClientsTest
17
+ * @package MailchimpTests\Lists
18
+ */
19
+ class ClientsTest extends MailChimpTestCase
20
+ {
21
+ /**
22
+ * @throws \MailchimpAPI\MailchimpException
23
+ */
24
+ public function testCollectionUrl()
25
+ {
26
+ $this->endpointUrlBuildTest(
27
+ Lists::URL_COMPONENT . 1 . Clients::URL_COMPONENT,
28
+ $this->mailchimp->lists(1)->clients(),
29
+ "The Clients collection endpoint should be constructed correctly"
30
+ );
31
+ }
32
+ }
vendor/jhut89/mailchimp3php/tests/Lists/GrowthHistoryTest.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by IntelliJ IDEA.
4
+ * User: hutch
5
+ * Date: 7/2/18
6
+ * Time: 5:15 PM
7
+ */
8
+
9
+ namespace MailchimpTests\Lists;
10
+
11
+ use MailchimpAPI\Resources\Lists\GrowthHistory;
12
+ use MailchimpTests\MailChimpTestCase;
13
+ use MailchimpAPI\Resources\Lists;
14
+
15
+ /**
16
+ * Class GrowthHistoryTest
17
+ * @package MailchimpTests\Lists
18
+ */
19
+ class GrowthHistoryTest extends MailChimpTestCase
20
+ {
21
+ /**
22
+ * @throws \MailchimpAPI\MailchimpException
23
+ */
24
+ public function testCollectionUrl()
25
+ {
26
+ $this->endpointUrlBuildTest(
27
+ Lists::URL_COMPONENT . 1 . GrowthHistory::URL_COMPONENT,
28
+ $this->mailchimp->lists(1)->growthHistory(),
29
+ "The Growth History collection endpoint should be constructed correctly"
30
+ );
31
+ }
32
+
33
+ /**
34
+ * @throws \MailchimpAPI\MailchimpException
35
+ */
36
+ public function testInstanceUrl()
37
+ {
38
+ $this->endpointUrlBuildTest(
39
+ Lists::URL_COMPONENT . 1 . GrowthHistory::URL_COMPONENT . 1,
40
+ $this->mailchimp->lists(1)->growthHistory(1),
41
+ "The Growth History instance endpoint should be constructed correctly"
42
+ );
43
+ }
44
+ }
vendor/jhut89/mailchimp3php/tests/Lists/InterestCategories/InterestsTest.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Lists\InterestCategories;
4
+
5
+ use MailchimpAPI\Resources\Lists\InterestCategories\Interest;
6
+ use MailchimpTests\MailChimpTestCase;
7
+ use MailchimpAPI\Resources\Lists;
8
+ use MailchimpAPI\Resources\Lists\InterestCategories;
9
+
10
+ /**
11
+ * Class InterestsTest
12
+ * @package MailchimpTests\Lists\InterestCategories
13
+ */
14
+ class InterestsTest extends MailChimpTestCase
15
+ {
16
+ /**
17
+ * @throws \MailchimpAPI\MailchimpException
18
+ */
19
+ public function testCollectionUrl()
20
+ {
21
+ $this->endpointUrlBuildTest(
22
+ Lists::URL_COMPONENT . 1 . InterestCategories::URL_COMPONENT . 1 . Interest::URL_COMPONENT,
23
+ $this->mailchimp->lists(1)->interestCategories(1)->interests(),
24
+ "The Interest collection endpoint should be constructed correctly"
25
+ );
26
+ }
27
+
28
+ /**
29
+ * @throws \MailchimpAPI\MailchimpException
30
+ */
31
+ public function testInstanceUrl()
32
+ {
33
+ $this->endpointUrlBuildTest(
34
+ Lists::URL_COMPONENT . 1 . InterestCategories::URL_COMPONENT . 1 . Interest::URL_COMPONENT . 1,
35
+ $this->mailchimp->lists(1)->interestCategories(1)->interests(1),
36
+ "The Interest instance endpoint should be constructed correctly"
37
+ );
38
+ }
39
+ }
vendor/jhut89/mailchimp3php/tests/Lists/InterestCategoriesTest.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by IntelliJ IDEA.
4
+ * User: hutch
5
+ * Date: 7/2/18
6
+ * Time: 5:19 PM
7
+ */
8
+
9
+ namespace MailchimpTests\Lists;
10
+
11
+ use MailchimpAPI\Resources\Lists\InterestCategories;
12
+ use MailchimpTests\MailChimpTestCase;
13
+ use MailchimpAPI\Resources\Lists;
14
+
15
+ /**
16
+ * Class InterestCategoriesTest
17
+ * @package MailchimpTests\Lists
18
+ */
19
+ class InterestCategoriesTest extends MailChimpTestCase
20
+ {
21
+ /**
22
+ * @throws \MailchimpAPI\MailchimpException
23
+ */
24
+ public function testCollectionUrl()
25
+ {
26
+ $this->endpointUrlBuildTest(
27
+ Lists::URL_COMPONENT . 1 . InterestCategories::URL_COMPONENT,
28
+ $this->mailchimp->lists(1)->interestCategories(),
29
+ "The Interest Categories collection endpoint should be constructed correctly"
30
+ );
31
+ }
32
+
33
+ /**
34
+ * @throws \MailchimpAPI\MailchimpException
35
+ */
36
+ public function testInstanceUrl()
37
+ {
38
+ $this->endpointUrlBuildTest(
39
+ Lists::URL_COMPONENT . 1 . InterestCategories::URL_COMPONENT . 1,
40
+ $this->mailchimp->lists(1)->interestCategories(1),
41
+ "The Interest Categories instance endpoint should be constructed correctly"
42
+ );
43
+ }
44
+ }
vendor/jhut89/mailchimp3php/tests/Lists/Members/ActivityTest.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Lists\Members;
4
+
5
+ use MailchimpAPI\Resources\Lists\Members\Activity;
6
+ use MailchimpAPI\Resources\Lists;
7
+ use MailchimpAPI\Resources\Lists\Members;
8
+ use MailchimpTests\MailChimpTestCase;
9
+
10
+ /**
11
+ * Class ActivityTest
12
+ * @package MailchimpTests\Lists\Members
13
+ */
14
+ class ActivityTest extends MailChimpTestCase
15
+ {
16
+ /**
17
+ * @throws \MailchimpAPI\MailchimpException
18
+ */
19
+ public function testCollectionUrl()
20
+ {
21
+ $this->endpointUrlBuildTest(
22
+ Lists::URL_COMPONENT . 1 . Members::URL_COMPONENT . 1 . Activity::URL_COMPONENT,
23
+ $this->mailchimp->lists(1)->members(1)->activity(),
24
+ "The Activity collection endpoint should be constructed correctly"
25
+ );
26
+ }
27
+ }
vendor/jhut89/mailchimp3php/tests/Lists/Members/EventsTest.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace MailchimpTests\Lists\Members;
3
+
4
+ use MailchimpAPI\Resources\Lists\Members\Events;
5
+ use MailchimpAPI\Resources\Lists;
6
+ use MailchimpAPI\Resources\Lists\Members;
7
+ use MailchimpTests\MailChimpTestCase;
8
+
9
+ /**
10
+ * Class EventsTest
11
+ * @package MailchimpTests\Lists\Members
12
+ */
13
+ class EventsTest extends MailChimpTestCase
14
+ {
15
+ public function testCollectionUrl()
16
+ {
17
+ $this->endpointUrlBuildTest(
18
+ Lists::URL_COMPONENT . 1 . Members::URL_COMPONENT . 1 . Events::URL_COMPONENT,
19
+ $this->mailchimp->lists(1)->members(1)->events(),
20
+ "The Member Events collection endpoint should be constructed correctly"
21
+ );
22
+ }
23
+ }
vendor/jhut89/mailchimp3php/tests/Lists/Members/GoalsTest.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Lists\Members;
4
+
5
+ use MailchimpAPI\Resources\Lists\Members\Goals;
6
+ use MailchimpTests\MailChimpTestCase;
7
+ use MailchimpAPI\Resources\Lists;
8
+ use MailchimpAPI\Resources\Lists\Members;
9
+
10
+ /**
11
+ * Class GoalsTest
12
+ * @package MailchimpTests\Lists\Members
13
+ */
14
+ class GoalsTest extends MailChimpTestCase
15
+ {
16
+ /**
17
+ * @throws \MailchimpAPI\MailchimpException
18
+ */
19
+ public function testCollectionUrl()
20
+ {
21
+ $this->endpointUrlBuildTest(
22
+ Lists::URL_COMPONENT . 1 . Members::URL_COMPONENT . 1 . Goals::URL_COMPONENT,
23
+ $this->mailchimp->lists(1)->members(1)->goals(),
24
+ "The Goals collection endpoint should be constructed correctly"
25
+ );
26
+ }
27
+ }
vendor/jhut89/mailchimp3php/tests/Lists/Members/NotesTest.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Lists\Members;
4
+
5
+ use MailchimpAPI\Resources\Lists\Members\Notes;
6
+ use MailchimpAPI\Resources\Lists;
7
+ use MailchimpAPI\Resources\Lists\Members;
8
+ use MailchimpTests\MailChimpTestCase;
9
+
10
+ /**
11
+ * Class NotesTest
12
+ * @package MailchimpTests\Lists\Members
13
+ */
14
+ class NotesTest extends MailChimpTestCase
15
+ {
16
+ /**
17
+ * @throws \MailchimpAPI\MailchimpException
18
+ */
19
+ public function testCollectionUrl()
20
+ {
21
+ $this->endpointUrlBuildTest(
22
+ Lists::URL_COMPONENT . 1 . Members::URL_COMPONENT . 1 . Notes::URL_COMPONENT,
23
+ $this->mailchimp->lists(1)->members(1)->notes(),
24
+ "The Notes collection endpoint should be constructed correctly"
25
+ );
26
+ }
27
+
28
+ /**
29
+ * @throws \MailchimpAPI\MailchimpException
30
+ */
31
+ public function testInstanceUrl()
32
+ {
33
+ $this->endpointUrlBuildTest(
34
+ Lists::URL_COMPONENT . 1 . Members::URL_COMPONENT . 1 . Notes::URL_COMPONENT . 1,
35
+ $this->mailchimp->lists(1)->members(1)->notes(1),
36
+ "The Notes instance endpoint should be constructed correctly"
37
+ );
38
+ }
39
+ }
vendor/jhut89/mailchimp3php/tests/Lists/Members/TagsTest.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace MailchimpTests\Lists\Members;
3
+
4
+ use MailchimpAPI\Resources\Lists\Members\Tags;
5
+ use MailchimpAPI\Resources\Lists;
6
+ use MailchimpAPI\Resources\Lists\Members;
7
+ use MailchimpTests\MailChimpTestCase;
8
+
9
+ /**
10
+ * Class TagsTest
11
+ * @package MailchimpTests\Lists\Members
12
+ */
13
+ class TagsTest extends MailChimpTestCase
14
+ {
15
+ public function testCollectionUrl()
16
+ {
17
+ $this->endpointUrlBuildTest(
18
+ Lists::URL_COMPONENT . 1 . Members::URL_COMPONENT . 1 . Tags::URL_COMPONENT,
19
+ $this->mailchimp->lists(1)->members(1)->tags(),
20
+ "The Member Tags collection endpoint should be constructed correctly"
21
+ );
22
+ }
23
+ }
vendor/jhut89/mailchimp3php/tests/Lists/MembersTest.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by IntelliJ IDEA.
4
+ * User: hutch
5
+ * Date: 7/2/18
6
+ * Time: 5:22 PM
7
+ */
8
+
9
+ namespace MailchimpTests\Lists;
10
+
11
+ use MailchimpAPI\Resources\Lists\Members;
12
+ use MailchimpTests\MailChimpTestCase;
13
+ use MailchimpAPI\Resources\Lists;
14
+
15
+ /**
16
+ * Class MembersTest
17
+ * @package MailchimpTests\Lists
18
+ */
19
+ class MembersTest extends MailChimpTestCase
20
+ {
21
+ /**
22
+ * @throws \MailchimpAPI\MailchimpException
23
+ */
24
+ public function testCollectionUrl()
25
+ {
26
+ $this->endpointUrlBuildTest(
27
+ Lists::URL_COMPONENT . 1 . Members::URL_COMPONENT,
28
+ $this->mailchimp->lists(1)->members(),
29
+ "The Members collection endpoint should be constructed correctly"
30
+ );
31
+ }
32
+
33
+ /**
34
+ * @throws \MailchimpAPI\MailchimpException
35
+ */
36
+ public function testInstanceUrl()
37
+ {
38
+ $this->endpointUrlBuildTest(
39
+ Lists::URL_COMPONENT . 1 . Members::URL_COMPONENT . 1,
40
+ $this->mailchimp->lists(1)->members(1),
41
+ "The Members instance endpoint should be constructed correctly"
42
+ );
43
+ }
44
+ }
vendor/jhut89/mailchimp3php/tests/Lists/MergeFieldsTest.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Lists;
4
+
5
+ use MailchimpAPI\Resources\Lists\MergeFields;
6
+ use MailchimpTests\MailChimpTestCase;
7
+ use MailchimpAPI\Resources\Lists;
8
+
9
+ /**
10
+ * Class MergeFieldsTest
11
+ * @package MailchimpTests\Lists
12
+ */
13
+ class MergeFieldsTest extends MailChimpTestCase
14
+ {
15
+ /**
16
+ * @throws \MailchimpAPI\MailchimpException
17
+ */
18
+ public function testCollectionUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ Lists::URL_COMPONENT . 1 . MergeFields::URL_COMPONENT,
22
+ $this->mailchimp->lists(1)->mergeFields(),
23
+ "The Merge Fields collection endpoint should be constructed correctly"
24
+ );
25
+ }
26
+
27
+ /**
28
+ * @throws \MailchimpAPI\MailchimpException
29
+ */
30
+ public function testInstanceUrl()
31
+ {
32
+ $this->endpointUrlBuildTest(
33
+ Lists::URL_COMPONENT . 1 . MergeFields::URL_COMPONENT . 1,
34
+ $this->mailchimp->lists(1)->mergeFields(1),
35
+ "The Merge Fields instance endpoint should be constructed correctly"
36
+ );
37
+ }
38
+ }
vendor/jhut89/mailchimp3php/tests/Lists/Segments/MembersTest.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Lists\Segments;
4
+
5
+ use MailchimpAPI\Resources\Lists\Segments\Members;
6
+ use MailchimpAPI\Resources\Lists\Segments;
7
+ use MailchimpTests\MailChimpTestCase;
8
+ use MailchimpAPI\Resources\Lists;
9
+
10
+ /**
11
+ * Class MembersTest
12
+ * @package MailchimpTests\Lists\Segments
13
+ */
14
+ class MembersTest extends MailChimpTestCase
15
+ {
16
+ /**
17
+ * @throws \MailchimpAPI\MailchimpException
18
+ */
19
+ public function testCollectionUrl()
20
+ {
21
+ $this->endpointUrlBuildTest(
22
+ Lists::URL_COMPONENT . 1 . Segments::URL_COMPONENT . 1 . Members::URL_COMPONENT,
23
+ $this->mailchimp->lists(1)->segments(1)->members(),
24
+ "The Members collection endpoint should be constructed correctly"
25
+ );
26
+ }
27
+
28
+ /**
29
+ * @throws \MailchimpAPI\MailchimpException
30
+ */
31
+ public function testInstanceUrl()
32
+ {
33
+ $this->endpointUrlBuildTest(
34
+ Lists::URL_COMPONENT . 1 . Segments::URL_COMPONENT . 1 . Members::URL_COMPONENT . 1,
35
+ $this->mailchimp->lists(1)->segments(1)->members(1),
36
+ "The Members instance endpoint should be constructed correctly"
37
+ );
38
+ }
39
+ }
vendor/jhut89/mailchimp3php/tests/Lists/SegmentsTest.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Lists;
4
+
5
+ use MailchimpAPI\Resources\Lists\Segments;
6
+ use MailchimpTests\MailChimpTestCase;
7
+ use MailchimpAPI\Resources\Lists;
8
+
9
+ /**
10
+ * Class SegmentsTest
11
+ * @package MailchimpTests\Lists
12
+ */
13
+ class SegmentsTest extends MailChimpTestCase
14
+ {
15
+ /**
16
+ * @throws \MailchimpAPI\MailchimpException
17
+ */
18
+ public function testCollectionUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ Lists::URL_COMPONENT . 1 . Segments::URL_COMPONENT,
22
+ $this->mailchimp->lists(1)->segments(),
23
+ "The Segments collection endpoint should be constructed correctly"
24
+ );
25
+ }
26
+
27
+ /**
28
+ * @throws \MailchimpAPI\MailchimpException
29
+ */
30
+ public function testInstanceUrl()
31
+ {
32
+ $this->endpointUrlBuildTest(
33
+ Lists::URL_COMPONENT . 1 . Segments::URL_COMPONENT . 1,
34
+ $this->mailchimp->lists(1)->segments(1),
35
+ "The Segments instance endpoint should be constructed correctly"
36
+ );
37
+ }
38
+ }
vendor/jhut89/mailchimp3php/tests/Lists/SignupFormsTest.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Lists;
4
+
5
+ use MailchimpAPI\Resources\Lists\SignupForms;
6
+ use MailchimpAPI\Resources\Lists;
7
+ use MailchimpTests\MailChimpTestCase;
8
+
9
+ /**
10
+ * Class SignupFormsTest
11
+ * @package MailchimpTests\Lists
12
+ */
13
+ class SignupFormsTest extends MailChimpTestCase
14
+ {
15
+ /**
16
+ * @throws \MailchimpAPI\MailchimpException
17
+ */
18
+ public function testCollectionUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ Lists::URL_COMPONENT . 1 . SignupForms::URL_COMPONENT,
22
+ $this->mailchimp->lists(1)->signupForms(),
23
+ "The Signup Forms collection endpoint should be constructed correctly"
24
+ );
25
+ }
26
+
27
+ /**
28
+ * @throws \MailchimpAPI\MailchimpException
29
+ */
30
+ public function testInstanceUrl()
31
+ {
32
+ $this->endpointUrlBuildTest(
33
+ Lists::URL_COMPONENT . 1 . SignupForms::URL_COMPONENT . 1,
34
+ $this->mailchimp->lists(1)->signupForms(1),
35
+ "The Signup Forms instance endpoint should be constructed correctly"
36
+ );
37
+ }
38
+ }
vendor/jhut89/mailchimp3php/tests/Lists/WebhooksTest.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Lists;
4
+
5
+ use MailchimpAPI\Resources\Lists\Webhooks;
6
+ use MailchimpTests\MailChimpTestCase;
7
+ use MailchimpAPI\Resources\Lists;
8
+
9
+ /**
10
+ * Class WebhooksTest
11
+ * @package MailchimpTests\Lists
12
+ */
13
+ class WebhooksTest extends MailChimpTestCase
14
+ {
15
+ /**
16
+ * @throws \MailchimpAPI\MailchimpException
17
+ */
18
+ public function testCollectionUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ Lists::URL_COMPONENT . 1 . Webhooks::URL_COMPONENT,
22
+ $this->mailchimp->lists(1)->webhooks(),
23
+ "The Webhooks collection endpoint should be constructed correctly"
24
+ );
25
+ }
26
+
27
+ /**
28
+ * @throws \MailchimpAPI\MailchimpException
29
+ */
30
+ public function testInstanceUrl()
31
+ {
32
+ $this->endpointUrlBuildTest(
33
+ Lists::URL_COMPONENT . 1 . Webhooks::URL_COMPONENT . 1,
34
+ $this->mailchimp->lists(1)->webhooks(1),
35
+ "The Webhooks instance endpoint should be constructed correctly"
36
+ );
37
+ }
38
+ }
vendor/jhut89/mailchimp3php/tests/ListsTest.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests;
4
+
5
+ use MailchimpAPI\Resources\Lists;
6
+
7
+ /**
8
+ * Class ListsTest
9
+ * @package MailchimpTests
10
+ */
11
+ class ListsTest extends MailChimpTestCase
12
+ {
13
+ /**
14
+ * @throws \MailchimpAPI\MailchimpException
15
+ */
16
+ public function testListsCollectionUrl()
17
+ {
18
+ $this->endpointUrlBuildTest(
19
+ Lists::URL_COMPONENT,
20
+ $this->mailchimp->lists(),
21
+ "The Lists collection endpoint should be constructed correctly"
22
+ );
23
+ }
24
+
25
+ /**
26
+ * @throws \MailchimpAPI\MailchimpException
27
+ */
28
+ public function testListsInstanceUrl()
29
+ {
30
+ $this->endpointUrlBuildTest(
31
+ Lists::URL_COMPONENT . 1,
32
+ $this->mailchimp->lists(1),
33
+ "The Lists instance endpoint should be constructed correctly"
34
+ );
35
+ }
36
+ }
vendor/jhut89/mailchimp3php/tests/MailChimpTestCase.php ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests;
4
+
5
+ use MailchimpAPI\MailchimpException;
6
+ use MailchimpAPI\Requests\MailchimpConnection;
7
+ use MailchimpTests\TestingUtilities\StubbableMailchimp;
8
+ use PHPUnit\Framework\TestCase;
9
+ use MailchimpAPI\Mailchimp;
10
+
11
+ /**
12
+ * Class MailChimpTestCase
13
+ * @package MailchimpTests
14
+ */
15
+ class MailChimpTestCase extends TestCase
16
+ {
17
+ /**
18
+ * @var string
19
+ */
20
+ protected $apikey;
21
+ /**
22
+ * @var Mailchimp
23
+ */
24
+ protected $mailchimp;
25
+ /**
26
+ * @var StubbableMailchimp
27
+ */
28
+ protected $stub_mailchimp;
29
+ /**
30
+ * @var string
31
+ */
32
+ protected $client_id;
33
+ /**
34
+ * @var string
35
+ */
36
+ protected $redirect_uri;
37
+ /**
38
+ * @var \MailchimpAPI\Requests\MailchimpRequest
39
+ */
40
+ protected $request;
41
+ /**
42
+ * @var \MailchimpAPI\Settings\MailchimpSettings
43
+ */
44
+ protected $settings;
45
+
46
+ /**
47
+ * MailChimpTestCase constructor.
48
+ * @param null $name
49
+ * @param array $data
50
+ * @param string $dataName
51
+ * @throws \MailchimpAPI\MailchimpException
52
+ */
53
+ public function __construct($name = null, array $data = [], $dataName = '')
54
+ {
55
+ parent::__construct($name, $data, $dataName);
56
+ $this->apikey = "123abc123abc123abc123abc123abc12-us0";
57
+ $this->mailchimp = new Mailchimp($this->apikey);
58
+ $this->stub_mailchimp = $this->getStubMailchimp();
59
+ $this->client_id = '12345676543';
60
+ $this->redirect_uri = 'https://www.some-domain.com/callback_file.php';
61
+ $this->request = $this->mailchimp->request;
62
+ $this->settings = $this->mailchimp->settings;
63
+ }
64
+
65
+ /**
66
+ * @return string
67
+ */
68
+ public function getApikey()
69
+ {
70
+ return $this->apikey;
71
+ }
72
+
73
+ /**
74
+ * @return StubbableMailchimp
75
+ * @throws MailchimpException
76
+ */
77
+ public function getStubMailchimp()
78
+ {
79
+ $mockConnection = $this->createMock(MailchimpConnection::class);
80
+ $mockConnection
81
+ ->method("execute")
82
+ ->willReturn("not a response");
83
+ return new StubbableMailchimp($this->apikey, $mockConnection);
84
+ }
85
+
86
+ /**
87
+ * @param $expected_endpoint
88
+ * @param $chain_to_be_tested
89
+ * @param $message
90
+ */
91
+ protected function endpointUrlBuildTest($expected_endpoint, $chain_to_be_tested, $message)
92
+ {
93
+ $expected_url = $this->expectedUrl($expected_endpoint);
94
+ $mc = $chain_to_be_tested;
95
+ self::assertEquals(
96
+ $expected_url,
97
+ $mc->getRequest()->getUrl(),
98
+ $message
99
+ );
100
+ }
101
+
102
+ /**
103
+ * @param $endpoint
104
+ * @return string
105
+ */
106
+ private function expectedUrl($endpoint)
107
+ {
108
+ return $this->request->getBaseUrl() . $endpoint;
109
+ }
110
+ }
vendor/jhut89/mailchimp3php/tests/MailchimpTest.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests;
4
+
5
+ use MailchimpAPI\Settings\MailchimpSettings;
6
+ use MailchimpAPI\Requests\MailchimpRequest;
7
+
8
+ final class MailchimpTest extends MailChimpTestCase
9
+ {
10
+ public function testAuthKeysSet()
11
+ {
12
+ $expected_auth_string = "Authorization: apikey " . $this->apikey;
13
+ $mc = $this->mailchimp;
14
+ $auth = $mc->request->getHeaders()[0];
15
+
16
+ //ASSERTIONS
17
+ self::assertEquals($this->apikey, $mc->apikey, "The apikey must be set on the parent mailchimp class");
18
+ self::assertEquals(
19
+ $expected_auth_string,
20
+ $auth,
21
+ "The auth string must be correctly set"
22
+ );
23
+ }
24
+
25
+ public function testGetAuthUrl()
26
+ {
27
+ $mc = $this->mailchimp;
28
+ $url = $mc::getAuthUrl($this->client_id, $this->redirect_uri);
29
+
30
+ $expected_uri = "https://login.mailchimp.com/oauth2/authorize";
31
+ $expected_uri .= "?client_id=12345676543";
32
+ $expected_uri .= "&redirect_uri=" . urlencode($this->redirect_uri);
33
+ $expected_uri .= "&response_type=code";
34
+
35
+ //ASSERTION
36
+ $this->assertEquals($expected_uri, $url, "oAuth URI should be correctly constructed");
37
+ }
38
+
39
+ public function testApikeySet()
40
+ {
41
+ self::assertTrue(isset($this->mailchimp->apikey));
42
+ }
43
+
44
+ public function testRequestSet()
45
+ {
46
+ self::assertTrue(
47
+ $this->mailchimp->request instanceof MailchimpRequest,
48
+ "The request must be an instance of a MailChimpRequest"
49
+ );
50
+ }
51
+
52
+ public function testSettingsSet()
53
+ {
54
+ self::assertTrue(
55
+ $this->mailchimp->settings instanceof MailchimpSettings,
56
+ "The settings must be an instance of a MailChimpSettings"
57
+ );
58
+ }
59
+ }
vendor/jhut89/mailchimp3php/tests/PingTest.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests;
4
+
5
+ use MailchimpAPI\Resources\Ping;
6
+
7
+ class PingTest extends MailChimpTestCase
8
+ {
9
+ /**
10
+ * @throws \MailchimpAPI\MailchimpException
11
+ */
12
+ public function testListsCollectionUrl()
13
+ {
14
+ $this->endpointUrlBuildTest(
15
+ Ping::URL_COMPONENT,
16
+ $this->mailchimp->ping(),
17
+ "The Ping endpoint should be constructed correctly"
18
+ );
19
+ }
20
+ }
vendor/jhut89/mailchimp3php/tests/Reports/CampaignAbuseTest.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Reports;
4
+
5
+ use MailchimpAPI\Resources\Reports\CampaignAbuse;
6
+ use MailchimpTests\MailChimpTestCase;
7
+ use MailchimpAPI\Resources\Reports;
8
+
9
+ /**
10
+ * Class CampaignAbuseTest
11
+ * @package MailchimpTests\Reports
12
+ */
13
+ class CampaignAbuseTest extends MailChimpTestCase
14
+ {
15
+ /**
16
+ * @throws \MailchimpAPI\MailchimpException
17
+ */
18
+ public function testCollectionUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ Reports::URL_COMPONENT . 1 . CampaignAbuse::URL_COMPONENT,
22
+ $this->mailchimp->reports(1)->abuse(),
23
+ "The Campaign Abuse collection endpoint should be constructed correctly"
24
+ );
25
+ }
26
+
27
+ /**
28
+ * @throws \MailchimpAPI\MailchimpException
29
+ */
30
+ public function testInstanceUrl()
31
+ {
32
+ $this->endpointUrlBuildTest(
33
+ Reports::URL_COMPONENT . 1 . CampaignAbuse::URL_COMPONENT . 1,
34
+ $this->mailchimp->reports(1)->abuse(1),
35
+ "The Campaign Abuse instance endpoint should be constructed correctly"
36
+ );
37
+ }
38
+ }
vendor/jhut89/mailchimp3php/tests/Reports/CampaignAdviceTest.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Reports;
4
+
5
+ use MailchimpAPI\Resources\Reports\CampaignAdvice;
6
+ use MailchimpTests\MailChimpTestCase;
7
+ use MailchimpAPI\Resources\Reports;
8
+
9
+ /**
10
+ * Class CampaignAdviceTest
11
+ * @package MailchimpTests\Reports
12
+ */
13
+ class CampaignAdviceTest extends MailChimpTestCase
14
+ {
15
+ /**
16
+ * @throws \MailchimpAPI\MailchimpException
17
+ */
18
+ public function testCollectionUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ Reports::URL_COMPONENT . 1 . CampaignAdvice::URL_COMPONENT,
22
+ $this->mailchimp->reports(1)->advice(),
23
+ "The Campaign Advice collection endpoint should be constructed correctly"
24
+ );
25
+ }
26
+ }
vendor/jhut89/mailchimp3php/tests/Reports/ClickReports/MembersTest.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Reports\ClickReports;
4
+
5
+ use MailchimpAPI\Resources\Reports\ClickReports\Members;
6
+ use MailchimpTests\MailChimpTestCase;
7
+ use MailchimpAPI\Resources\Reports;
8
+ use MailchimpAPI\Resources\Reports\ClickReports;
9
+
10
+ class MembersTest extends MailChimpTestCase
11
+ {
12
+ public function testCollectionUrl()
13
+ {
14
+ $this->endpointUrlBuildTest(
15
+ Reports::URL_COMPONENT . 1 . ClickReports::URL_COMPONENT . 1 . Members::URL_COMPONENT,
16
+ $this->mailchimp->reports(1)->clickReports(1)->members(),
17
+ "The Click Reports Members collection endpoint should be constructed correctly"
18
+ );
19
+ }
20
+
21
+ public function testInstanceUrl()
22
+ {
23
+ $this->endpointUrlBuildTest(
24
+ Reports::URL_COMPONENT . 1 . ClickReports::URL_COMPONENT . 1 . Members::URL_COMPONENT . 1,
25
+ $this->mailchimp->reports(1)->clickReports(1)->members(1),
26
+ "The Click Reports Members instance endpoint should be constructed correctly"
27
+ );
28
+ }
29
+ }
vendor/jhut89/mailchimp3php/tests/Reports/ClickReportsTest.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Reports;
4
+
5
+ use MailchimpAPI\Resources\Reports;
6
+ use MailchimpAPI\Resources\Reports\ClickReports;
7
+ use MailchimpTests\MailChimpTestCase;
8
+
9
+ /**
10
+ * Class ClickReportsTest
11
+ * @package MailchimpTests\Reports
12
+ */
13
+ class ClickReportsTest extends MailChimpTestCase
14
+ {
15
+ /**
16
+ * @throws \MailchimpAPI\MailchimpException
17
+ */
18
+ public function testCollectionUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ Reports::URL_COMPONENT . 1 . ClickReports::URL_COMPONENT,
22
+ $this->mailchimp->reports(1)->clickReports(),
23
+ "The Click Reports collection endpoint should be constructed correctly"
24
+ );
25
+ }
26
+
27
+ /**
28
+ * @throws \MailchimpAPI\MailchimpException
29
+ */
30
+ public function testInstanceUrl()
31
+ {
32
+ $this->endpointUrlBuildTest(
33
+ Reports::URL_COMPONENT . 1 . ClickReports::URL_COMPONENT . 1,
34
+ $this->mailchimp->reports(1)->clickReports(1),
35
+ "The Click Reports instance endpoint should be constructed correctly"
36
+ );
37
+ }
38
+ }
vendor/jhut89/mailchimp3php/tests/Reports/DomainPerformanceTest.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Reports;
4
+
5
+ use MailchimpAPI\Resources\Reports;
6
+ use MailchimpAPI\Resources\Reports\DomainPerformance;
7
+ use MailchimpTests\MailChimpTestCase;
8
+
9
+ /**
10
+ * Class DomainPerformanceTest
11
+ * @package MailchimpTests\Reports
12
+ */
13
+ class DomainPerformanceTest extends MailChimpTestCase
14
+ {
15
+ /**
16
+ * @throws \MailchimpAPI\MailchimpException
17
+ */
18
+ public function testCollectionUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ Reports::URL_COMPONENT . 1 . DomainPerformance::URL_COMPONENT,
22
+ $this->mailchimp->reports(1)->domainPerformance(),
23
+ "The Domain Performance collection endpoint should be constructed correctly"
24
+ );
25
+ }
26
+ }
vendor/jhut89/mailchimp3php/tests/Reports/EepurlReportsTest.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Reports;
4
+
5
+ use MailchimpAPI\Resources\Reports;
6
+ use MailchimpAPI\Resources\Reports\EepurlReports;
7
+ use MailchimpTests\MailChimpTestCase;
8
+
9
+ /**
10
+ * Class EepurlReportsTest
11
+ * @package MailchimpTests\Reports
12
+ */
13
+ class EepurlReportsTest extends MailChimpTestCase
14
+ {
15
+ /**
16
+ * @throws \MailchimpAPI\MailchimpException
17
+ */
18
+ public function testCollectionUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ Reports::URL_COMPONENT . 1 . EepurlReports::URL_COMPONENT,
22
+ $this->mailchimp->reports(1)->eepurlReports(),
23
+ "The Eepurl Reports collection endpoint should be constructed correctly"
24
+ );
25
+ }
26
+ }
vendor/jhut89/mailchimp3php/tests/Reports/EmailActivityTest.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Reports;
4
+
5
+ use MailchimpAPI\Resources\Reports;
6
+ use MailchimpAPI\Resources\Reports\EmailActivity;
7
+ use MailchimpTests\MailChimpTestCase;
8
+
9
+ /**
10
+ * Class EmailActivityTest
11
+ * @package MailchimpTests\Reports
12
+ */
13
+ class EmailActivityTest extends MailChimpTestCase
14
+ {
15
+ /**
16
+ * @throws \MailchimpAPI\MailchimpException
17
+ */
18
+ public function testCollectionUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ Reports::URL_COMPONENT . 1 . EmailActivity::URL_COMPONENT,
22
+ $this->mailchimp->reports(1)->emailActivity(),
23
+ "The Email Activity collection endpoint should be constructed correctly"
24
+ );
25
+ }
26
+
27
+ /**
28
+ * @throws \MailchimpAPI\MailchimpException
29
+ */
30
+ public function testInstanceUrl()
31
+ {
32
+ $this->endpointUrlBuildTest(
33
+ Reports::URL_COMPONENT . 1 . EmailActivity::URL_COMPONENT . 1,
34
+ $this->mailchimp->reports(1)->emailActivity(1),
35
+ "The Email Activity instance endpoint should be constructed correctly"
36
+ );
37
+ }
38
+ }
vendor/jhut89/mailchimp3php/tests/Reports/GoogleAnalyticsTest.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Reports;
4
+
5
+ use MailchimpAPI\Resources\Reports;
6
+ use MailchimpAPI\Resources\Reports\GoogleAnalytics;
7
+ use MailchimpTests\MailChimpTestCase;
8
+
9
+ class GoogleAnalyticsTest extends MailChimpTestCase
10
+ {
11
+ /**
12
+ * @throws \MailchimpAPI\MailchimpException
13
+ */
14
+ public function testCollectionUrl()
15
+ {
16
+ $this->endpointUrlBuildTest(
17
+ Reports::URL_COMPONENT . 1 . GoogleAnalytics::URL_COMPONENT,
18
+ $this->mailchimp->reports(1)->googleAnalytics(),
19
+ "The Google Analytics collection endpoint should be constructed correctly"
20
+ );
21
+ }
22
+
23
+ /**
24
+ * @throws \MailchimpAPI\MailchimpException
25
+ */
26
+ public function testInstanceUrl()
27
+ {
28
+ $this->endpointUrlBuildTest(
29
+ Reports::URL_COMPONENT . 1 . GoogleAnalytics::URL_COMPONENT . 1,
30
+ $this->mailchimp->reports(1)->googleAnalytics(1),
31
+ "The Google Analytics instance endpoint should be constructed correctly"
32
+ );
33
+ }
34
+ }
vendor/jhut89/mailchimp3php/tests/Reports/OpenDetailsTest.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Reports;
4
+
5
+ use MailchimpAPI\Resources\Reports;
6
+ use MailchimpAPI\Resources\Reports\OpenDetails;
7
+ use MailchimpTests\MailChimpTestCase;
8
+
9
+ class OpenDetailsTest extends MailChimpTestCase
10
+ {
11
+ /**
12
+ * @throws \MailchimpAPI\MailchimpException
13
+ */
14
+ public function testCollectionUrl()
15
+ {
16
+ $this->endpointUrlBuildTest(
17
+ Reports::URL_COMPONENT . 1 . OpenDetails::URL_COMPONENT,
18
+ $this->mailchimp->reports(1)->openReports(),
19
+ "The Open Details collection endpoint should be constructed correctly"
20
+ );
21
+ }
22
+ }
vendor/jhut89/mailchimp3php/tests/Reports/SentToTest.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Reports;
4
+
5
+ use MailchimpAPI\Resources\Reports;
6
+ use MailchimpAPI\Resources\Reports\SentTo;
7
+ use MailchimpTests\MailChimpTestCase;
8
+
9
+ /**
10
+ * Class SentToTest
11
+ * @package MailchimpTests\Reports
12
+ */
13
+ class SentToTest extends MailChimpTestCase
14
+ {
15
+ /**
16
+ * @throws \MailchimpAPI\MailchimpException
17
+ */
18
+ public function testCollectionUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ Reports::URL_COMPONENT . 1 . SentTo::URL_COMPONENT,
22
+ $this->mailchimp->reports(1)->sentTo(),
23
+ "The Sent To collection endpoint should be constructed correctly"
24
+ );
25
+ }
26
+
27
+ /**
28
+ * @throws \MailchimpAPI\MailchimpException
29
+ */
30
+ public function testInstanceUrl()
31
+ {
32
+ $this->endpointUrlBuildTest(
33
+ Reports::URL_COMPONENT . 1 . SentTo::URL_COMPONENT . 1,
34
+ $this->mailchimp->reports(1)->sentTo(1),
35
+ "The Sent To instance endpoint should be constructed correctly"
36
+ );
37
+ }
38
+ }
vendor/jhut89/mailchimp3php/tests/Reports/SubReportsTest.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Reports;
4
+
5
+ use MailchimpAPI\Resources\Reports\SubReports;
6
+ use MailchimpTests\MailChimpTestCase;
7
+ use MailchimpAPI\Resources\Reports;
8
+
9
+ /**
10
+ * Class SubReportsTest
11
+ * @package MailchimpTests\Reports
12
+ */
13
+ class SubReportsTest extends MailChimpTestCase
14
+ {
15
+ /**
16
+ * @throws \MailchimpAPI\MailchimpException
17
+ */
18
+ public function testCollectionUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ Reports::URL_COMPONENT . 1 . SubReports::URL_COMPONENT,
22
+ $this->mailchimp->reports(1)->subReports(),
23
+ "The SubReports collection endpoint should be constructed correctly"
24
+ );
25
+ }
26
+ }
vendor/jhut89/mailchimp3php/tests/Reports/TopLocationsTest.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Reports;
4
+
5
+ use MailchimpAPI\Resources\Reports\TopLocations;
6
+ use MailchimpTests\MailChimpTestCase;
7
+ use MailchimpAPI\Resources\Reports;
8
+
9
+ /**
10
+ * Class TopLocationsTest
11
+ * @package MailchimpTests\Reports
12
+ */
13
+ class TopLocationsTest extends MailChimpTestCase
14
+ {
15
+ /**
16
+ * @throws \MailchimpAPI\MailchimpException
17
+ */
18
+ public function testCollectionUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ Reports::URL_COMPONENT . 1 . TopLocations::URL_COMPONENT,
22
+ $this->mailchimp->reports(1)->locations(),
23
+ "The Top Locations collection endpoint should be constructed correctly"
24
+ );
25
+ }
26
+ }
vendor/jhut89/mailchimp3php/tests/Reports/UnsubscribesTest.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Reports;
4
+
5
+ use MailchimpAPI\Resources\Reports\Unsubscribes;
6
+ use MailchimpTests\MailChimpTestCase;
7
+ use MailchimpAPI\Resources\Reports;
8
+
9
+ class UnsubscribesTest extends MailChimpTestCase
10
+ {
11
+ /**
12
+ * @throws \MailchimpAPI\MailchimpException
13
+ */
14
+ public function testCollectionUrl()
15
+ {
16
+ $this->endpointUrlBuildTest(
17
+ Reports::URL_COMPONENT . 1 . Unsubscribes::URL_COMPONENT,
18
+ $this->mailchimp->reports(1)->unsubscribes(),
19
+ "The Unsubscribes collection endpoint should be constructed correctly"
20
+ );
21
+ }
22
+
23
+ /**
24
+ * @throws \MailchimpAPI\MailchimpException
25
+ */
26
+ public function testInstanceUrl()
27
+ {
28
+ $this->endpointUrlBuildTest(
29
+ Reports::URL_COMPONENT . 1 . Unsubscribes::URL_COMPONENT . 1,
30
+ $this->mailchimp->reports(1)->unsubscribes(1),
31
+ "The Unsubscribes instance endpoint should be constructed correctly"
32
+ );
33
+ }
34
+ }
vendor/jhut89/mailchimp3php/tests/ReportsTest.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests;
4
+
5
+ use MailchimpAPI\Resources\Reports;
6
+
7
+ /**
8
+ * Class ReportsTest
9
+ * @package MailchimpTests
10
+ */
11
+ class ReportsTest extends MailChimpTestCase
12
+ {
13
+ /**
14
+ * @throws \MailchimpAPI\MailchimpException
15
+ */
16
+ public function testReportsCollectionUrl()
17
+ {
18
+ $this->endpointUrlBuildTest(
19
+ Reports::URL_COMPONENT,
20
+ $this->mailchimp->reports(),
21
+ "The Reports collection endpoint should be constructed correctly"
22
+ );
23
+ }
24
+
25
+ /**
26
+ * @throws \MailchimpAPI\MailchimpException
27
+ */
28
+ public function testReportsInstanceUrl()
29
+ {
30
+ $this->endpointUrlBuildTest(
31
+ Reports::URL_COMPONENT . 1,
32
+ $this->mailchimp->reports(1),
33
+ "The Reports instance endpoint should be constructed correctly"
34
+ );
35
+ }
36
+ }
vendor/jhut89/mailchimp3php/tests/Responses/FailureResponseTest.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ namespace MailchimpTests\Responses;
5
+
6
+
7
+ use MailchimpAPI\Responses\FailureResponse;
8
+ use PHPUnit\Framework\TestCase;
9
+
10
+ class FailureResponseTest extends TestCase
11
+ {
12
+ public function testFailureCallback()
13
+ {
14
+ $called = false;
15
+
16
+ $callback = function () use (&$called) {
17
+ $called = true;
18
+ };
19
+
20
+ (new FailureResponse([], '', 200, $callback));
21
+ $this->assertTrue($called == true, 'The callback should be called by FailureResponse');
22
+ }
23
+ }
vendor/jhut89/mailchimp3php/tests/Responses/SuccessResponseTest.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ namespace MailchimpTests\Responses;
5
+
6
+
7
+ use MailchimpAPI\Responses\SuccessResponse;
8
+ use PHPUnit\Framework\TestCase;
9
+
10
+ class SuccessResponseTest extends TestCase
11
+ {
12
+ public function testSuccessCallback()
13
+ {
14
+ $called = false;
15
+
16
+ $callback = function () use (&$called) {
17
+ $called = true;
18
+ };
19
+
20
+ (new SuccessResponse([], '', 200, $callback));
21
+ $this->assertTrue($called == true, 'The callback should be called by SuccessResponse');
22
+ }
23
+ }
vendor/jhut89/mailchimp3php/tests/SearchCampaignsTest.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests;
4
+
5
+ use MailchimpAPI\Resources\SearchCampaigns;
6
+
7
+ /**
8
+ * Class SearchCampaignsTest
9
+ * @package MailchimpTests
10
+ */
11
+ class SearchCampaignsTest extends MailChimpTestCase
12
+ {
13
+ /**
14
+ * @throws \MailchimpAPI\MailchimpException
15
+ */
16
+ public function testSearchCampaignsCollectionUrl()
17
+ {
18
+ $this->endpointUrlBuildTest(
19
+ SearchCampaigns::URL_COMPONENT,
20
+ $this->mailchimp->searchCampaigns(),
21
+ "The Search Campaigns collection endpoint should be constructed correctly"
22
+ );
23
+ }
24
+ }
vendor/jhut89/mailchimp3php/tests/SearchMembersTest.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests;
4
+
5
+ use MailchimpAPI\Resources\SearchMembers;
6
+
7
+ /**
8
+ * Class SearchMembersTest
9
+ * @package MailchimpTests
10
+ */
11
+ class SearchMembersTest extends MailChimpTestCase
12
+ {
13
+ /**
14
+ * @throws \MailchimpAPI\MailchimpException
15
+ */
16
+ public function testSearchMembersCollectionUrl()
17
+ {
18
+ $this->endpointUrlBuildTest(
19
+ SearchMembers::URL_COMPONENT,
20
+ $this->mailchimp->searchMembers(),
21
+ "The Search Members collection endpoint should be constructed correctly"
22
+ );
23
+ }
24
+ }
vendor/jhut89/mailchimp3php/tests/Settings/MailchimpSettingsTest.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Settings;
4
+
5
+ use MailchimpAPI\Requests\MailchimpConnection;
6
+ use MailchimpAPI\Requests\MailchimpRequest;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+ use MailchimpTests\MailChimpTestCase;
9
+
10
+ class MailchimpSettingsTest extends MailChimpTestCase
11
+ {
12
+ public function test_set_custom_curl_opts()
13
+ {
14
+ $mailchimp_request = new MailchimpRequest();
15
+ $mailchimp_settings = $this->getMockBuilder(MailchimpSettings::class)
16
+ ->setMethods(['getCustomCurlSettings', 'shouldVerifySsl'])
17
+ ->getMock();
18
+
19
+ $mailchimp_settings->method('shouldVerifySsl')
20
+ ->willReturn(true);
21
+
22
+ $mailchimp_settings->method('getCustomCurlSettings')
23
+ ->willReturn([]);
24
+
25
+ $mailchimp_settings->expects($this->once())
26
+ ->method('getCustomCurlSettings');
27
+
28
+ new MailchimpConnection($mailchimp_request, $mailchimp_settings);
29
+ }
30
+ }
vendor/jhut89/mailchimp3php/tests/TemplateFoldersTest.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests;
4
+
5
+ use MailchimpAPI\Resources\TemplateFolders;
6
+
7
+ /**
8
+ * Class TemplateFoldersTest
9
+ * @package MailchimpTests
10
+ */
11
+ class TemplateFoldersTest extends MailChimpTestCase
12
+ {
13
+ /**
14
+ * @throws \MailchimpAPI\MailchimpException
15
+ */
16
+ public function testTemplateFoldersCollectionUrl()
17
+ {
18
+ $this->endpointUrlBuildTest(
19
+ TemplateFolders::URL_COMPONENT,
20
+ $this->mailchimp->templateFolders(),
21
+ "The Template Folders collection endpoint should be constructed correctly"
22
+ );
23
+ }
24
+
25
+ /**
26
+ * @throws \MailchimpAPI\MailchimpException
27
+ */
28
+ public function testTemplateFoldersInstanceUrl()
29
+ {
30
+ $this->endpointUrlBuildTest(
31
+ TemplateFolders::URL_COMPONENT . 1,
32
+ $this->mailchimp->templateFolders(1),
33
+ "The Template Folders instance endpoint should be constructed correctly"
34
+ );
35
+ }
36
+ }
vendor/jhut89/mailchimp3php/tests/Templates/DefaultContentTest.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\Templates;
4
+
5
+ use MailchimpAPI\Resources\Templates\DefaultContent;
6
+ use MailchimpTests\MailChimpTestCase;
7
+ use MailchimpAPI\Resources\Templates;
8
+
9
+ /**
10
+ * Class DefaultContentTest
11
+ * @package MailchimpTests\Templates
12
+ */
13
+ class DefaultContentTest extends MailChimpTestCase
14
+ {
15
+ /**
16
+ * @throws \MailchimpAPI\MailchimpException
17
+ */
18
+ public function testCollectionUrl()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ Templates::URL_COMPONENT . 1 . DefaultContent::URL_COMPONENT,
22
+ $this->mailchimp->templates(1)->defaultContent(),
23
+ "The Default Content collection endpoint should be constructed correctly"
24
+ );
25
+ }
26
+ }
vendor/jhut89/mailchimp3php/tests/TemplatesTest.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests;
4
+
5
+ use MailchimpAPI\Resources\Templates;
6
+
7
+ /**
8
+ * Class TemplatesTest
9
+ * @package MailchimpTests
10
+ */
11
+ class TemplatesTest extends MailChimpTestCase
12
+ {
13
+ /**
14
+ * @throws \MailchimpAPI\MailchimpException
15
+ */
16
+ public function testTemplatesCollectionUrl()
17
+ {
18
+ $this->endpointUrlBuildTest(
19
+ Templates::URL_COMPONENT,
20
+ $this->mailchimp->templates(),
21
+ "The Templates collection endpoint should be constructed correctly"
22
+ );
23
+ }
24
+
25
+ /**
26
+ * @throws \MailchimpAPI\MailchimpException
27
+ */
28
+ public function testTemplatesInstanceUrl()
29
+ {
30
+ $this->endpointUrlBuildTest(
31
+ Templates::URL_COMPONENT . 1,
32
+ $this->mailchimp->templates(1),
33
+ "The Templates instance endpoint should be constructed correctly"
34
+ );
35
+ }
36
+ }
vendor/jhut89/mailchimp3php/tests/TestingUtilities/StubbableMailchimp.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\TestingUtilities;
4
+
5
+
6
+ use MailchimpAPI\Mailchimp;
7
+ use MailchimpAPI\Requests\MailchimpRequest;
8
+ use MailchimpAPI\Settings\MailchimpSettings;
9
+ use MailchimpAPI\Requests\MailchimpConnection;
10
+ use PHPUnit_Framework_MockObject_MockBuilder as MockBuilder;
11
+ use PHPUnit_Framework_MockObject_MockObject;
12
+
13
+ /**
14
+ * Class StubbableMailchimp
15
+ *
16
+ * Used when stubs are needed for testing without network requests
17
+ *
18
+ * @package MailchimpTests
19
+ */
20
+ class StubbableMailchimp extends Mailchimp
21
+ {
22
+
23
+ /**
24
+ * @var PHPUnit_Framework_MockObject_MockObject
25
+ */
26
+ private $mocked_connection;
27
+
28
+
29
+ /**
30
+ * StubableMailchimp constructor.
31
+ * @param $request
32
+ * @param $mocked_connection
33
+ * @throws \MailchimpAPI\MailchimpException
34
+ */
35
+ public function __construct($request, $mocked_connection)
36
+ {
37
+ parent::__construct($request);
38
+ $this->mocked_connection = $mocked_connection;
39
+ }
40
+
41
+
42
+ /**
43
+ * Overrides getConnection() in order to return a mocked connection
44
+ *
45
+ * @param MailchimpRequest $request
46
+ * @param MailchimpSettings $settings
47
+ * @return MailchimpConnection|PHPUnit_Framework_MockObject_MockObject|\PHPUnit_Framework_MockObject_MockObject
48
+ */
49
+ protected function getConnection(MailchimpRequest $request, MailchimpSettings $settings)
50
+ {
51
+ return $this->mocked_connection;
52
+ }
53
+
54
+
55
+ /**
56
+ * Overrides getStaticConnection() in order to return a mocked connection
57
+ *
58
+ * @param MailchimpRequest $request
59
+ * @return MailchimpConnection|PHPUnit_Framework_MockObject_MockObject
60
+ */
61
+ protected static function getStaticConnection(MailchimpRequest $request)
62
+ {
63
+ $test_case = new MailChimpTestCase();
64
+ $mock_builder = new MockBuilder($test_case, MailchimpConnection::class);
65
+ $mocked_connection = $mock_builder
66
+ ->disableOriginalConstructor()
67
+ ->disableOriginalClone()
68
+ ->disableArgumentCloning()
69
+ ->disallowMockingUnknownTypes()
70
+ ->getMock();
71
+ $mocked_connection
72
+ ->method('execute')
73
+ ->willReturn('not a response');
74
+ return $mocked_connection;
75
+ }
76
+ }
vendor/jhut89/mailchimp3php/tests/UtilityTests/MailchimpConnectionTest.php ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\UtilityTests;
4
+
5
+ use MailchimpAPI\Requests\MailchimpConnection;
6
+ use MailchimpAPI\Requests\MailchimpRequest;
7
+ use MailchimpAPI\Settings\MailchimpSettings;
8
+ use MailchimpTests\MailChimpTestCase;
9
+
10
+ /**
11
+ * Class MailchimpConnectionTest
12
+ * @package MailchimpTests\UtilityTests
13
+ */
14
+ final class MailchimpConnectionTest extends MailChimpTestCase
15
+ {
16
+ /**
17
+ * @var MailchimpSettings
18
+ */
19
+ protected $settings;
20
+ /**
21
+ * @var MailchimpRequest
22
+ */
23
+ protected $request;
24
+
25
+ /**
26
+ * testable header string
27
+ */
28
+ const HEADER_STRING = "Foo: Bar";
29
+
30
+ /**
31
+ * @var array
32
+ */
33
+ private static $post_params = [
34
+ "email_address" => "example@domain.com",
35
+ "merge_fields" => [
36
+ "FNAME" => "Jane"
37
+ ]
38
+ ];
39
+
40
+ /**
41
+ * MailchimpConnectionTest constructor.
42
+ * @param null $name
43
+ * @param array $data
44
+ * @param string $dataName
45
+ * @throws \MailchimpAPI\MailchimpException
46
+ */
47
+ public function __construct($name = null, array $data = [], $dataName = '')
48
+ {
49
+ parent::__construct($name, $data, $dataName);
50
+
51
+
52
+ $this->settings = new MailchimpSettings();
53
+ $this->request = new MailchimpRequest();
54
+ $this->request->setBaseUrl('http://some.domain.com');
55
+ $this->request->addHeader(self::HEADER_STRING);
56
+ }
57
+
58
+ public function testGetConnection()
59
+ {
60
+
61
+ $expected_url = $this->request->getBaseUrl() . "?foo=bar&bim=baz";
62
+
63
+ $request = $this->request;
64
+ $request->setQueryString([
65
+ "foo" => "bar",
66
+ "bim" => "baz"
67
+ ]);
68
+
69
+
70
+ $connection = new MailchimpConnection($this->request);
71
+
72
+ //Begin Assertions
73
+ self::assertEquals(
74
+ $expected_url,
75
+ $connection->getCurrentOption(CURLOPT_URL),
76
+ "The get URL should be constructed correctly with params"
77
+ );
78
+
79
+ self::assertEquals(
80
+ self::HEADER_STRING,
81
+ $connection->getCurrentOption(CURLOPT_HTTPHEADER)[0],
82
+ "The headers for a get request should be set"
83
+ );
84
+ }
85
+
86
+ /**
87
+ * @throws \MailchimpAPI\MailchimpException
88
+ */
89
+ public function testPostConnection()
90
+ {
91
+ $request = $this->request;
92
+ $request->setMethod(MailchimpRequest::POST);
93
+ $request->setPayload(self::$post_params);
94
+
95
+ $connection = new MailchimpConnection($this->request);
96
+
97
+ //Begin Assertions
98
+ self::assertTrue($connection->getCurrentOption(CURLOPT_POST));
99
+
100
+ self::assertEquals(
101
+ '{"email_address":"example@domain.com","merge_fields":{"FNAME":"Jane"}}',
102
+ $connection->getCurrentOption(CURLOPT_POSTFIELDS),
103
+ "The post fields should be properly constructed json object"
104
+ );
105
+ }
106
+
107
+ /**
108
+ * @throws \MailchimpAPI\MailchimpException
109
+ */
110
+ public function testPatchConnection()
111
+ {
112
+ $request = $this->request;
113
+ $request->setMethod(MailchimpRequest::PATCH);
114
+ $request->setPayload(self::$post_params);
115
+
116
+ $connection = new MailchimpConnection($this->request);
117
+
118
+ //Begin Assertions
119
+ self::assertEquals(
120
+ MailchimpRequest::PATCH,
121
+ $connection->getCurrentOption(CURLOPT_CUSTOMREQUEST),
122
+ "The custom request option should be set to PATCH"
123
+ );
124
+
125
+ self::assertEquals(
126
+ '{"email_address":"example@domain.com","merge_fields":{"FNAME":"Jane"}}',
127
+ $connection->getCurrentOption(CURLOPT_POSTFIELDS),
128
+ "The post fields should be properly constructed json object"
129
+ );
130
+ }
131
+
132
+ /**
133
+ * @throws \MailchimpAPI\MailchimpException
134
+ */
135
+ public function testPutConnection()
136
+ {
137
+ $request = $this->request;
138
+ $request->setMethod(MailchimpRequest::PUT);
139
+ $request->setPayload(self::$post_params);
140
+
141
+ $connection = new MailchimpConnection($this->request);
142
+
143
+ //Begin Assertions
144
+ self::assertEquals(
145
+ MailchimpRequest::PUT,
146
+ $connection->getCurrentOption(CURLOPT_CUSTOMREQUEST),
147
+ "The custom request option should be set to PUT"
148
+ );
149
+
150
+ self::assertEquals(
151
+ '{"email_address":"example@domain.com","merge_fields":{"FNAME":"Jane"}}',
152
+ $connection->getCurrentOption(CURLOPT_POSTFIELDS),
153
+ "The post fields should be properly constructed json object"
154
+ );
155
+ }
156
+
157
+ /**
158
+ * @throws \MailchimpAPI\MailchimpException
159
+ */
160
+ public function testDeleteConnection()
161
+ {
162
+ $request = $this->request;
163
+ $request->setMethod(MailchimpRequest::DELETE);
164
+
165
+ $connection = new MailchimpConnection($this->request);
166
+
167
+ //Begin Assertions
168
+ self::assertEquals(
169
+ MailchimpRequest::DELETE,
170
+ $connection->getCurrentOption(CURLOPT_CUSTOMREQUEST),
171
+ "The custom request option should be set to DELETE"
172
+ );
173
+ }
174
+ }
vendor/jhut89/mailchimp3php/tests/UtilityTests/MailchimpRequestTest.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests\UtilityTests;
4
+
5
+ use MailchimpAPI\MailchimpException;
6
+ use MailchimpAPI\Requests\MailchimpRequest;
7
+ use MailchimpTests\MailChimpTestCase;
8
+
9
+ final class MailchimpRequestTest extends MailChimpTestCase
10
+ {
11
+ private $requestInstance;
12
+
13
+ public function __construct($name = null, array $data = [], $dataName = '')
14
+ {
15
+ parent::__construct($name, $data, $dataName);
16
+ $this->requestInstance = new MailchimpRequest($this->apikey);
17
+ }
18
+
19
+ public function testAuthHeadersSet()
20
+ {
21
+ $expected = 'Authorization: apikey ' . $this->apikey;
22
+ $actual = $this->requestInstance->getHeaders()[0];
23
+
24
+ self::assertEquals($expected, $actual, "Auth Header should be appropriately set");
25
+ }
26
+
27
+ public function testApikeySet()
28
+ {
29
+ self::assertEquals(
30
+ $this->apikey,
31
+ $this->requestInstance->getApikey(),
32
+ "The request API Key should be set correctly"
33
+ );
34
+ }
35
+
36
+ public function testBaseUrlSet()
37
+ {
38
+ $expected = "Https://" . explode('-', trim($this->apikey))[1] . ".api.mailchimp.com/3.0";
39
+ $actual = $this->requestInstance->getBaseUrl();
40
+
41
+ self::assertEquals($expected, $actual, "Base Url should be appropriately set");
42
+ }
43
+
44
+ /**
45
+ * @expectedException
46
+ * @throws \MailchimpAPI\MailchimpException
47
+ */
48
+ public function testCheckKeyFailure()
49
+ {
50
+ $this->expectException(MailchimpException::class);
51
+ $this->requestInstance->checkKey('not an API key');
52
+ }
53
+
54
+ public function testPersistentCallbacks()
55
+ {
56
+ $foo = function () {
57
+ // do stuff
58
+ };
59
+
60
+ // set success callback
61
+ $this->mailchimp->request->setSuccessCallback($foo);
62
+ // set failure callback
63
+ $this->mailchimp->request->setFailureCallback($foo);
64
+
65
+ // from same request make a new AuthorizedApps
66
+ $apps = $this->mailchimp->apps();
67
+
68
+ self::assertEquals(
69
+ $foo,
70
+ $apps->getRequest()->getSuccessCallback(),
71
+ "the success callback after making a chain should be the same as when it was set"
72
+ );
73
+
74
+ self::assertEquals(
75
+ $foo,
76
+ $apps->getRequest()->getFailureCallback(),
77
+ "the failure callback after making a chain should be the same as when it was set"
78
+ );
79
+ }
80
+ }
vendor/jhut89/mailchimp3php/tests/VerifiedDomainsTest.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace MailchimpTests;
4
+
5
+ use MailchimpAPI\Resources\VerifiedDomains;
6
+
7
+ class VerifiedDomainsTest extends MailChimpTestCase
8
+ {
9
+ public function testVerifiedDomainsCollectionEndpoint()
10
+ {
11
+ $this->endpointUrlBuildTest(
12
+ VerifiedDomains::URL_COMPONENT,
13
+ $this->mailchimp->verifiedDomains(),
14
+ "The verified domains collection endpoint should be constructed correctly"
15
+ );
16
+ }
17
+
18
+ public function testVerifiedDomainsInstanceEndpoint()
19
+ {
20
+ $this->endpointUrlBuildTest(
21
+ VerifiedDomains::URL_COMPONENT . 'my-domain',
22
+ $this->mailchimp->verifiedDomains('my-domain'),
23
+ "The verified domains instance endpoint should be constructed correctly"
24
+ );
25
+ }
26
+ }
wpcf7-redirect.php CHANGED
@@ -1,521 +1,83 @@
1
  <?php
2
  /**
3
  * Plugin Name: Redirection for Contact Form 7
4
- * Plugin URI: http://querysol.com
5
- * Description: Contact Form 7 Add-on - Redirect after mail sent.
6
- * Version: 1.3.7
7
  * Author: Query Solutions
8
- * Author URI: http://querysol.com
9
- * Contributors: querysolutions, yuvalsabar
10
  * Requires at least: 4.7.0
11
  *
12
  * Text Domain: wpcf7-redirect
13
  * Domain Path: /lang
14
  *
15
  * @package Redirection for Contact Form 7
16
- * @category Contact Form 7 Addon
17
  * @author Query Solutions
18
  */
19
 
20
- if ( ! defined( 'ABSPATH' ) ) {
21
- exit;
22
- }
23
-
24
- /**
25
- * Main WPCF7_Redirect Class
26
- */
27
- class WPCF7_Redirect {
28
- /**
29
- * Construct class
30
- */
31
- public function __construct() {
32
- $this->plugin_url = plugin_dir_url( __FILE__ );
33
- $this->plugin_path = plugin_dir_path( __FILE__ );
34
- $this->version = '1.3.7';
35
- $this->add_actions();
36
- }
37
-
38
- static function plugin_activated( $file ) {
39
- update_option( 'wpcf7_redirect_admin_notice_ver_dismiss', 0 );
40
- update_option( 'wpcf7_redirect_banner_dismiss', 0 );
41
- }
42
 
43
- public function dismiss_ads() {
44
- if ( isset( $_GET['wpcf7_redirect_dismiss_notice'] ) && 1 == $_GET['wpcf7_redirect_dismiss_notice'] ) {
45
- update_option( 'wpcf7_redirect_admin_notice_ver_dismiss', 1 );
46
- }
47
-
48
- if ( isset( $_GET['wpcf7_redirect_dismiss_banner'] ) && 1 == $_GET['wpcf7_redirect_dismiss_banner'] ) {
49
- update_option( 'wpcf7_redirect_banner_dismiss', 1 );
50
- }
51
- }
52
 
53
- /**
54
- * Add Actions
55
- */
56
- private function add_actions() {
57
- add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
58
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_backend' ) );
59
- add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_frontend' ) );
60
- add_action( 'wpcf7_editor_panels', array( $this, 'add_panel' ) );
61
- add_action( 'wpcf7_after_save', array( $this, 'store_meta' ) );
62
- add_action( 'wpcf7_after_create', array( $this, 'duplicate_form_support' ) );
63
- add_action( 'wpcf7_submit', array( $this, 'non_ajax_redirection' ) );
64
- add_action( 'admin_init', array( $this, 'dismiss_ads' ) );
65
- add_action( 'admin_notices', array( $this, 'dependencies_notice' ) );
66
- add_action( 'admin_notices', array( $this, 'pro_notice' ) );
67
- }
68
 
69
- /**
70
- * Load plugin textdomain.
71
- */
72
- public function load_textdomain() {
73
- load_plugin_textdomain( 'wpcf7-redirect', false, basename( dirname( __FILE__ ) ) . '/lang' );
74
- }
75
 
76
- /**
77
- * Enqueue theme styles and scripts - back-end
78
- */
79
- public function enqueue_backend() {
80
- wp_enqueue_style( 'wpcf7-redirect-admin-style', $this->plugin_url . 'admin/wpcf7-redirect-admin-style.css' );
81
- wp_enqueue_script( 'wpcf7-redirect-admin-script', $this->plugin_url . 'admin/wpcf7-redirect-admin-script.js', array(), null, true );
82
- }
83
 
84
- /**
85
- * Enqueue theme styles and scripts - front-end
86
- */
87
- public function enqueue_frontend() {
88
- wp_enqueue_script( 'wpcf7-redirect-script', $this->plugin_url . 'js/wpcf7-redirect-script.js', array(), null, true );
89
- wp_localize_script( 'wpcf7-redirect-script', 'wpcf7_redirect_forms', $this->get_forms() );
90
 
91
- if ( isset( $this->enqueue_new_tab_script ) && $this->enqueue_new_tab_script ) {
92
- wp_add_inline_script( 'wpcf7-redirect-script', 'window.open("' . $this->redirect_url . '");' );
93
- }
94
- }
95
 
96
- /**
97
- * Adds a tab to the editor on the form edit page
98
- *
99
- * @param array $panels An array of panels. Each panel has a callback function.
100
- */
101
- public function add_panel( $panels ) {
102
- $panels['redirect-panel'] = array(
103
- 'title' => __( 'Redirect Settings', 'wpcf7-redirect' ),
104
- 'callback' => array( $this, 'create_panel_inputs' ),
105
- );
106
- return $panels;
107
- }
108
 
109
- /**
110
- * Create plugin fields
111
- *
112
- * @return array of plugin fields: name and type (type is for validation)
113
- */
114
- public function get_plugin_fields() {
115
- $fields = array(
116
- array(
117
- 'name' => 'page_id',
118
- 'type' => 'number',
119
- ),
120
- array(
121
- 'name' => 'external_url',
122
- 'type' => 'url',
123
- ),
124
- array(
125
- 'name' => 'use_external_url',
126
- 'type' => 'checkbox',
127
- ),
128
- array(
129
- 'name' => 'open_in_new_tab',
130
- 'type' => 'checkbox',
131
- ),
132
- array(
133
- 'name' => 'http_build_query',
134
- 'type' => 'checkbox',
135
- ),
136
- array(
137
- 'name' => 'http_build_query_selectively',
138
- 'type' => 'checkbox',
139
- ),
140
- array(
141
- 'name' => 'http_build_query_selectively_fields',
142
- 'type' => 'text',
143
- ),
144
- array(
145
- 'name' => 'delay_redirect',
146
- 'type' => 'number',
147
- ),
148
  array(
149
- 'name' => 'after_sent_script',
150
- 'type' => 'textarea',
151
- ),
152
  );
153
-
154
- return $fields;
155
- }
156
-
157
- /**
158
- * Get all fields values
159
- *
160
- * @param integer $post_id Form ID.
161
- * @return array of fields values keyed by fields name
162
- */
163
- public function get_fields_values( $post_id ) {
164
- $fields = $this->get_plugin_fields();
165
-
166
- foreach ( $fields as $field ) {
167
- $values[ $field['name'] ] = get_post_meta( $post_id, '_wpcf7_redirect_' . $field['name'], true );
168
- }
169
-
170
- return $values;
171
- }
172
-
173
- /**
174
- * Validate and store meta data
175
- *
176
- * @param object $contact_form WPCF7_ContactForm Object - All data that is related to the form.
177
- */
178
- public function store_meta( $contact_form ) {
179
- if ( ! isset( $_POST ) || empty( $_POST ) ) {
180
- return;
181
- } else {
182
- if ( ! wp_verify_nonce( $_POST['wpcf7_redirect_page_metaboxes_nonce'], 'wpcf7_redirect_page_metaboxes' ) ) {
183
- return;
184
- }
185
-
186
- $form_id = $contact_form->id();
187
- $fields = $this->get_plugin_fields( $form_id );
188
- $data = $_POST['wpcf7-redirect'];
189
-
190
- foreach ( $fields as $field ) {
191
- $value = isset( $data[ $field['name'] ] ) ? $data[ $field['name'] ] : '';
192
-
193
- switch ( $field['type'] ) {
194
- case 'text':
195
- case 'checkbox':
196
- $value = sanitize_text_field( $value );
197
- break;
198
-
199
- case 'textarea':
200
- $value = htmlspecialchars( $value );
201
- break;
202
-
203
- case 'number':
204
- $value = intval( $value );
205
- break;
206
-
207
- case 'url':
208
- $value = esc_url_raw( $value );
209
- break;
210
- }
211
-
212
- update_post_meta( $form_id, '_wpcf7_redirect_' . $field['name'], $value );
213
- }
214
- }
215
- }
216
-
217
- /**
218
- * Push all forms redirect settings data into an array.
219
- *
220
- * @return array Form redirect settings data
221
- */
222
- public function get_forms() {
223
- $args = array(
224
- 'post_type' => 'wpcf7_contact_form',
225
- 'posts_per_page' => -1,
226
- 'suppress_filters' => true,
227
- );
228
- $query = new WP_Query( $args );
229
-
230
- $forms = array();
231
-
232
- if ( $query->have_posts() ) :
233
-
234
- $fields = $this->get_plugin_fields();
235
-
236
- while ( $query->have_posts() ) :
237
- $query->the_post();
238
-
239
- $post_id = get_the_ID();
240
-
241
- foreach ( $fields as $field ) {
242
- $forms[ $post_id ][ $field['name'] ] = get_post_meta( $post_id, '_wpcf7_redirect_' . $field['name'], true );
243
-
244
- if ( 'textarea' === $field['type'] ) {
245
- $forms[ $post_id ][ $field['name'] ] = $forms[ $post_id ][ $field['name'] ];
246
- }
247
- }
248
-
249
- // Thank you page URL is a little bit different...
250
- $forms[ $post_id ]['thankyou_page_url'] = $forms[ $post_id ]['page_id'] ? get_permalink( $forms[ $post_id ]['page_id'] ) : '';
251
- endwhile;
252
- wp_reset_postdata();
253
- endif;
254
-
255
- return $forms;
256
  }
257
 
258
- /**
259
- * Copy Redirect page key and assign it to duplicate form
260
- *
261
- * @param object $contact_form WPCF7_ContactForm Object - All data that is related to the form.
262
- */
263
- public function duplicate_form_support( $contact_form ) {
264
- $contact_form_id = $contact_form->id();
265
 
266
- if ( ! empty( $_REQUEST['post'] ) && ! empty( $_REQUEST['_wpnonce'] ) ) {
267
- $post_id = intval( $_REQUEST['post'] );
268
-
269
- $fields = $this->get_plugin_fields();
270
-
271
- foreach ( $fields as $field ) {
272
- update_post_meta( $contact_form_id, '_wpcf7_redirect_' . $field['name'], get_post_meta( $post_id, '_wpcf7_redirect_' . $field['name'], true ) );
273
- }
274
- }
275
  }
276
 
277
- /**
278
- * Verify CF7 dependencies.
279
- */
280
- public function dependencies_notice() {
281
- if ( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) {
282
- $wpcf7_path = plugin_dir_path( dirname( __FILE__ ) ) . 'contact-form-7/wp-contact-form-7.php';
283
- $wpcf7_data = get_plugin_data( $wpcf7_path, false, false );
284
-
285
- // If CF7 version is < 4.8.
286
- if ( $wpcf7_data['Version'] < 4.8 ) {
287
- ?>
288
-
289
- <div class="wpcf7-redirect-error error notice">
290
- <h3>
291
- <?php esc_html_e( 'Redirection for Contact Form 7', 'wpcf7-redirect' ); ?>
292
- </h3>
293
- <p>
294
- <?php esc_html_e( 'Error: Contact Form 7 version is too old. Redirection for Contact Form 7 is compatible from version 4.8 and above. Please update Contact Form 7.', 'wpcf7-redirect' ); ?>
295
- </p>
296
- </div>
297
-
298
- <?php
299
- }
300
- } else {
301
- // If CF7 isn't installed and activated, throw an error.
302
- ?>
303
- <div class="wpcf7-redirect-error error notice">
304
- <h3>
305
- <?php esc_html_e( 'Redirection for Contact Form 7', 'wpcf7-redirect' ); ?>
306
- </h3>
307
- <p>
308
- <?php esc_html_e( 'Error: Please install and activate Contact Form 7.', 'wpcf7-redirect' ); ?>
309
- </p>
310
- </div>
311
-
312
- <?php
313
- }
314
- }
315
-
316
- public function pro_notice() {
317
- if ( ! get_option( 'wpcf7_redirect_admin_notice_ver_dismiss' ) ) :
318
- ?>
319
-
320
- <div class="wpcf7-redirect-pro-admin-notice updated notice is-dismissible">
321
- <h3>IMPORTANT NOTICE!</h3>
322
- <p>
323
- The next update of Redirection for Contact Form 7 will be a major update, and so <a href="https://querysol.com/product/contact-form-7-redirection/beta-testers/" target="_blank">we need beta-testers for the next update.</a> The first 20 people who are willing to help, will get <strong>one year of free updates</strong> of <a href="https://querysol.com/product/contact-form-7-redirection/" target="_blank">Redirection for Contact Form 7 Pro</a> (standard plan).
324
- </p>
325
- <p>
326
- Also, we will be happy if you can take a few moments and <a href="https://wordpress.org/support/plugin/wpcf7-redirect/reviews/" target="_blank">rate our plugin</a>.
327
- </p>
328
- </div>
329
-
330
- <?php
331
- endif;
332
- }
333
-
334
- /**
335
- * Add plugin support to browsers that don't support ajax
336
- */
337
- public function non_ajax_redirection( $contact_form ) {
338
- $this->fields = $this->get_fields_values( $contact_form->id() );
339
-
340
- if ( isset( $this->fields ) && ! WPCF7_Submission::is_restful() ) {
341
- $submission = WPCF7_Submission::get_instance();
342
-
343
- if ( $submission->get_status() === 'mail_sent' ) {
344
 
345
- // Use extrnal url
346
- if ( 'on' === $this->fields['use_external_url'] && $this->fields['external_url'] ) {
347
- $this->redirect_url = $this->fields['external_url'];
348
- } else {
349
- $this->redirect_url = get_permalink( $this->fields['page_id'] );
350
- }
351
 
352
- // Pass all fields from the form as URL query parameters
353
- if ( isset( $this->redirect_url ) && $this->redirect_url ) {
354
- if ( 'on' === $this->fields['http_build_query'] ) {
355
- $posted_data = $submission->get_posted_data();
356
- // Remove WPCF7 keys from posted data
357
- $remove_keys = array( '_wpcf7', '_wpcf7_version', '_wpcf7_locale', '_wpcf7_unit_tag', '_wpcf7_container_post' );
358
- $posted_data = array_diff_key( $posted_data, array_flip( $remove_keys ) );
359
- $this->redirect_url = add_query_arg( $posted_data, $this->redirect_url );
360
- }
361
- }
362
 
363
- // Open link in a new tab
364
- if ( isset( $this->redirect_url ) && $this->redirect_url ) {
365
- if ( 'on' === $this->fields['open_in_new_tab'] ) {
366
- $this->enqueue_new_tab_script = true;
367
- } else {
368
- wp_redirect( $this->redirect_url );
369
- exit;
370
- }
371
- }
372
- }
373
- }
374
  }
375
 
376
- /**
377
- * Create the panel inputs
378
- *
379
- * @param object $post Post object.
380
- */
381
- public function create_panel_inputs( $post ) {
382
- wp_nonce_field( 'wpcf7_redirect_page_metaboxes', 'wpcf7_redirect_page_metaboxes_nonce' );
383
-
384
- $fields = $this->get_fields_values( $post->id() );
385
- ?>
386
-
387
- <?php if ( ! get_option( 'wpcf7_redirect_banner_dismiss' ) ) : ?>
388
-
389
- <div class="banner-wrap">
390
- <button type="button" class="notice-dismiss" aria-label="<?php _e( 'Close Banner', 'wpcf7-redirect' ); ?>" title="<?php _e( 'Close Banner', 'wpcf7-redirect' ); ?>"></button>
391
-
392
- <a href="https://querysol.com/product/contact-form-7-redirection/" target="_blank">
393
- <img src="<?php echo $this->plugin_url; ?>/img/banner-pro.png" alt="<?php _e( 'Banner - Redirection Pro For Contact Form 7', 'wpcf7-redirect' ); ?>">
394
- </a>
395
- </div>
396
-
397
- <?php endif; ?>
398
-
399
- <h2>
400
- <?php esc_html_e( 'Redirect Settings', 'wpcf7-redirect' ); ?>
401
- </h2>
402
-
403
- <fieldset>
404
- <div class="field-wrap field-wrap-page-id">
405
- <label for="wpcf7-redirect-page-id">
406
- <?php esc_html_e( 'Select a page to redirect to on successful form submission.', 'wpcf7-redirect' ); ?>
407
- </label>
408
-
409
- <?php
410
- wp_dropdown_pages(
411
- array(
412
- 'name' => 'wpcf7-redirect[page_id]',
413
- 'show_option_none' => __( 'Choose Page', 'wpcf7-redirect' ),
414
- 'option_none_value' => '0',
415
- 'selected' => $fields['page_id'],
416
- 'id' => 'wpcf7-redirect-page-id',
417
- )
418
- );
419
- ?>
420
- </div>
421
-
422
- <div class="field-wrap field-wrap-external-url">
423
- <input type="url" id="wpcf7-redirect-external-url" placeholder="<?php esc_html_e( 'External URL', 'wpcf7-redirect' ); ?>" name="wpcf7-redirect[external_url]" value="<?php echo $fields['external_url']; ?>">
424
- </div>
425
-
426
- <div class="field-wrap field-wrap-use-external-url">
427
- <input type="checkbox" id="wpcf7-redirect-use-external-url" name="wpcf7-redirect[use_external_url]" <?php checked( $fields['use_external_url'], 'on', true ); ?>/>
428
-
429
- <label for="wpcf7-redirect-use-external-url">
430
- <?php esc_html_e( 'Use external URL', 'wpcf7-redirect' ); ?>
431
- </label>
432
- </div>
433
-
434
- <div class="field-wrap field-wrap-open-in-new-tab">
435
- <input type="checkbox" id="wpcf7-redirect-open-in-new-tab" name="wpcf7-redirect[open_in_new_tab]" <?php checked( $fields['open_in_new_tab'], 'on', true ); ?>/>
436
-
437
- <label for="wpcf7-redirect-open-in-new-tab"><?php esc_html_e( 'Open page in a new tab', 'wpcf7-redirect' ); ?></label>
438
-
439
- <div class="field-notice field-notice-alert field-notice-hidden">
440
- <strong>
441
- <?php esc_html_e( 'Notice!', 'wpcf7-redirect' ); ?>
442
- </strong>
443
-
444
- <?php esc_html_e( 'This option might not work as expected, since browsers often block popup windows. This option depends on the browser settings.', 'wpcf7-redirect' ); ?>
445
- </div>
446
- </div>
447
-
448
- <div class="field-wrap field-wrap-http-build-query">
449
- <input type="checkbox" id="wpcf7-redirect-http-build-query" class="checkbox-radio-1" name="wpcf7-redirect[http_build_query]" <?php checked( $fields['http_build_query'], 'on', true ); ?>/>
450
-
451
- <label for="wpcf7-redirect-http-build-query">
452
- <?php esc_html_e( 'Pass all the fields from the form as URL query parameters', 'wpcf7-redirect' ); ?>
453
- </label>
454
- </div>
455
-
456
- <div class="field-wrap field-wrap-http-build-query-selectively">
457
- <input type="checkbox" id="wpcf7-redirect-http-build-query-selectively" class="checkbox-radio-1" name="wpcf7-redirect[http_build_query_selectively]" <?php checked( $fields['http_build_query_selectively'], 'on', true ); ?>/>
458
-
459
- <label for="wpcf7-redirect-http-build-query-selectively">
460
- <?php esc_html_e( 'Pass specific fields from the form as URL query parameters', 'wpcf7-redirect' ); ?>
461
- </label>
462
-
463
- <input type="text" id="wpcf7-redirect-http-build-query-selectively-fields" class="field-hidden" placeholder="<?php esc_html_e( 'Fields to pass, separated by commas', 'wpcf7-redirect' ); ?>" name="wpcf7-redirect[http_build_query_selectively_fields]" value="<?php echo $fields['http_build_query_selectively_fields']; ?>">
464
- </div>
465
-
466
- <div class="field-wrap field-wrap-delay-redirect">
467
- <label for="wpcf7-redirect-delay-redirect">
468
- <?php esc_html_e( 'Delay redirect (in milliseconds)', 'wpcf7-redirect' ); ?>
469
- </label>
470
-
471
- <input type="number" id="wpcf7-redirect-delay-redirect" name="wpcf7-redirect[delay_redirect]" value="<?php echo $fields['delay_redirect']; ?>">
472
- </div>
473
-
474
- <hr />
475
-
476
- <div class="field-wrap field-wrap-after-sent-script">
477
- <label for="wpcf7-redirect-after-sent-script">
478
- <?php esc_html_e( 'Here you can add scripts to run after form sent successfully.', 'wpcf7-redirect' ); ?>
479
- </label>
480
-
481
- <div class="field-message">
482
- <?php esc_html_e( 'Do not include <script> tags.', 'wpcf7-redirect' ); ?>
483
- </div>
484
-
485
- <textarea id="wpcf7-redirect-after-sent-script" name="wpcf7-redirect[after_sent_script]" rows="8" cols="100"><?php echo $fields['after_sent_script']; ?></textarea>
486
-
487
- <div class="field-notice field-warning-alert field-notice-hidden">
488
- <strong>
489
- <?php esc_html_e( 'Warning!', 'wpcf7-redirect' ); ?>
490
- </strong>
491
-
492
- <?php esc_html_e( 'This option is for developers only - use with caution. If the plugin does not redirect after you have added scripts, it means you have a problem with your script. Either fix the script, or remove it.', 'wpcf7-redirect' ); ?>
493
- </div>
494
- </div>
495
- </fieldset>
496
-
497
- <div class="get-pro-wrap">
498
- <div class="get-pro">
499
- <div class="get-pro-text">
500
- <span class="dashicons dashicons-star-filled"></span>
501
-
502
- <a href="https://querysol.com/product/contact-form-7-redirection/" target="_blank">
503
- Redirection Pro For Contact Form 7 - We've added exciting new features!
504
- </a>
505
-
506
- <span class="dashicons dashicons-star-filled"></span>
507
- </div>
508
-
509
- <div class="rate-text">
510
- <a href="https://wordpress.org/support/plugin/wpcf7-redirect/reviews/" target="_blank">We will be happy if you can take a few moments and rate our plugin.</a>
511
- </div>
512
- </div>
513
- </div>
514
-
515
- <?php
516
- }
517
  }
518
 
519
- register_activation_hook( __FILE__, array( 'WPCF7_Redirect', 'plugin_activated' ) );
520
-
521
- $cf7_redirect = new WPCF7_Redirect();
1
  <?php
2
  /**
3
  * Plugin Name: Redirection for Contact Form 7
4
+ * Plugin URI: https://redirection-for-contact-form7.com/
5
+ * Description: The ultimate add-on for Contact Form 7 - redirect to any page after submission, fire scripts, save submissions in database, and much more options to make Contact Form 7 poweful than ever.
6
+ * Version: 2.2.7
7
  * Author: Query Solutions
8
+ * Author URI: https://redirection-for-contact-form7.com/
9
+ * Contributors: querysolutions, yuvalsabar, regevlio
10
  * Requires at least: 4.7.0
11
  *
12
  * Text Domain: wpcf7-redirect
13
  * Domain Path: /lang
14
  *
15
  * @package Redirection for Contact Form 7
16
+ * @category Contact Form 7 Add-on
17
  * @author Query Solutions
18
  */
19
 
20
+ defined( 'ABSPATH' ) || exit;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
+ if ( ! defined( 'CF7_REDIRECT_DEBUG' ) ) {
23
+ define( 'CF7_REDIRECT_DEBUG', get_option( 'wpcf_debug' ) ? true : false );
24
+ }
 
 
 
 
 
 
25
 
26
+ define( 'WPCF7_PRO_REDIRECT_PLUGIN_VERSION', '2.2' );
27
+ define( 'WPCF7_PRO_MIGRATION_VERSION', '1' );
28
+ define( 'WPCF7_PRO_REDIRECT_CLASSES_PATH', plugin_dir_path( __FILE__ ) . 'classes/' );
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
+ require_once( WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-wpcf7r-action.php' );
31
+ require_once( WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-wpcf7r-utils.php' );
32
+ require_once( WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-wpcf7r-actions.php' );
33
+ require_once( 'class-wpcf7-redirect.php' );
 
 
34
 
35
+ add_action( 'admin_init', 'wpcf7r_activation_process' );
 
 
 
 
 
 
36
 
37
+ /**
38
+ * Handle plugin upgrade migration
39
+ */
40
+ function wpcf7r_activation_process() {
41
+ if ( get_option( 'wpcf7_redirect_version' ) !== WPCF7_PRO_REDIRECT_PLUGIN_VERSION ) {
42
+ $extensions_url = admin_url( 'admin.php?page=wpc7_redirect' );
43
 
44
+ update_option( 'wpcf7_redirect_dismiss_banner', 0 );
 
 
 
45
 
46
+ update_option( 'wpcf7_redirect_version', WPCF7_PRO_REDIRECT_PLUGIN_VERSION );
 
 
 
 
 
 
 
 
 
 
 
47
 
48
+ update_option(
49
+ 'wpcf7_redirect_notifications',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  array(
51
+ 'notice-success wpcf7r-notice' => '<p><span class="dashicons dashicons-feedback"></span> <a href="' . $extensions_url . '"> Redirection for Contact Form 7 - check out our new forms extensions - don\'t miss it!</a></p><p>Also, we will be happy if you can take a few moments and <a href="https://wordpress.org/support/plugin/wpcf7-redirect/reviews/" target="_blank">rate our plugin</a>.</p>',
52
+ )
 
53
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  }
55
 
56
+ if ( get_option( 'wpcf7_migration_completed' ) !== WPCF7_PRO_MIGRATION_VERSION ) {
57
+ WPCF7r_Utils::auto_migrate( 'migrate_from_cf7_redirect' );
 
 
 
 
 
58
 
59
+ update_option( 'wpcf7_migration_completed', WPCF7_PRO_MIGRATION_VERSION );
 
 
 
 
 
 
 
 
60
  }
61
 
62
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
 
64
+ require_once( plugin_dir_path( __FILE__ ) . 'wpcf7r-functions.php' );
 
 
 
 
 
65
 
66
+ /**
67
+ * WPCF7R initialization
68
+ */
69
+ function wpcf7_redirect_pro_init() {
70
+ // globals
71
+ global $cf7_redirect;
 
 
 
 
72
 
73
+ // initialize
74
+ if ( ! isset( $cf7_redirect ) ) {
75
+ $cf7_redirect = new Wpcf7_Redirect();
76
+ $cf7_redirect->init();
 
 
 
 
 
 
 
77
  }
78
 
79
+ // return
80
+ return $cf7_redirect;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  }
82
 
83
+ wpcf7_redirect_pro_init();
 
 
wpcf7r-functions.php ADDED
@@ -0,0 +1,722 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Functions file
4
+ *
5
+ * @package Redirection for Contact Form 7
6
+ * @category Contact Form 7 Add-on
7
+ * @author Query Solutions
8
+ * @version 0.1.0
9
+ */
10
+
11
+ defined( 'ABSPATH' ) || exit;
12
+
13
+ /**
14
+ * Get the list of available Extensions
15
+ *
16
+ * @return array - $extensions - extensions array.
17
+ */
18
+ function wpcf7_get_extensions() {
19
+ $extensions = array(
20
+ 'special-offer' => array(
21
+ 'name' => 'accessibie-plugin',
22
+ 'title' => __( 'Website Accessibility', 'wpcf7-redirect' ),
23
+ 'description' => __( 'Get an immediate and accurate answer to whether or not your site is compliant with web accessibility legislation for free!', 'wpcf7-redirect' ),
24
+ 'icon' => WPCF7_PRO_REDIRECT_BUILD_PATH . 'images/accessibe-full-logo.svg',
25
+ 'external_url' => admin_url( '/admin.php?page=' . qs_get_plugin_display_name() ),
26
+ 'btn_text' => __( 'Scan for Problems!', 'wpcf7-redirect' ),
27
+ 'type' => 'affiliate',
28
+ 'target' => '',
29
+ 'badge' => __( 'New', 'wpcf7-redirect' ),
30
+ 'classname' => '',
31
+ ),
32
+ 'wpcf7r-conditional-logic' => array(
33
+ 'name' => 'wpcf7r-conditional-logic',
34
+ 'filename' => 'class-wpcf7r-conditions.php',
35
+ 'title' => __( 'Conditional Logic', 'wpcf7-redirect' ),
36
+ 'description' => __( 'Powerful conditional rules management. Set if/or rules for each of your actions.', 'wpcf7-redirect' ),
37
+ 'icon' => WPCF7_PRO_REDIRECT_BUILD_PATH . 'images/icon7.png',
38
+ 'classname' => 'WPCF7_Redirect_Conditional_Logic',
39
+ ),
40
+ 'wpcf7r-paypal' => array(
41
+ 'name' => 'wpcf7r-paypal',
42
+ 'filename' => 'class-wpcf7r-action-paypal.php',
43
+ 'title' => __( 'PayPal Integration', 'wpcf7-redirect' ),
44
+ 'description' => __( 'Collect payments with your Contact Form 7 form. Setup product details and custom paypal fields.', 'wpcf7-redirect' ),
45
+ 'icon' => WPCF7_PRO_REDIRECT_BUILD_PATH . 'images/paypal.png',
46
+ 'classname' => 'WPCF7R_Action_redirect_to_paypal',
47
+ ),
48
+ 'wpcf7r-api' => array(
49
+ 'name' => 'wpcf7r-api',
50
+ 'filename' => 'class-wpcf7r-action-api-url.php',
51
+ 'title' => __( 'RESTful Web Services', 'wpcf7-redirect' ),
52
+ 'description' => __( 'RESTful POST/GET/PUT/DELETE send to remote server (json/xml/params)', 'wpcf7-redirect' ),
53
+ 'icon' => WPCF7_PRO_REDIRECT_BUILD_PATH . 'images/icon7.png',
54
+ 'classname' => 'WPCF7R_Action_api_url_request',
55
+ ),
56
+ 'wpcf7r-custom-errors' => array(
57
+ 'name' => 'wpcf7r-custom-errors',
58
+ 'filename' => 'class-wpcf7r-action-custom-errors.php',
59
+ 'title' => __( 'Custom Error Messages', 'wpcf7-redirect' ),
60
+ 'description' => __( 'Manage your form error messages by defining each field with its own message.', 'wpcf7-redirect' ),
61
+ 'icon' => WPCF7_PRO_REDIRECT_BUILD_PATH . 'images/icon11.png',
62
+ 'classname' => 'WPCF7R_Action_custom_errors',
63
+ ),
64
+ 'wpcf7r-popup' => array(
65
+ 'name' => 'wpcf7r-popup',
66
+ 'filename' => 'class-wpcf7r-action-popup.php',
67
+ 'title' => __( 'Thank You Popup', 'wpcf7-redirect' ),
68
+ 'description' => __( 'Display popup message after form submission success.', 'wpcf7-redirect' ),
69
+ 'icon' => WPCF7_PRO_REDIRECT_BUILD_PATH . 'images/icon3.png',
70
+ 'classname' => 'WPCF7R_Action_popup',
71
+ ),
72
+ 'wpcf7r-create-post' => array(
73
+ 'name' => 'wpcf7r-create-post',
74
+ 'filename' => 'class-wpcf7r-action-create-post.php',
75
+ 'title' => __( 'Create Posts', 'wpcf7-redirect' ),
76
+ 'description' => __( 'Create any post with post meta and taxonomy assigments.', 'wpcf7-redirect' ),
77
+ 'icon' => WPCF7_PRO_REDIRECT_BUILD_PATH . 'images/icon12.png',
78
+ 'classname' => 'WPCF7R_Action_create_post',
79
+ ),
80
+ 'wpcf7r-login' => array(
81
+ 'name' => 'wpcf7r-login',
82
+ 'filename' => 'class-wpcf7r-action-login.php',
83
+ 'title' => __( 'Custom Login Forms', 'wpcf7-redirect' ),
84
+ 'description' => __( 'Create custom login forms.', 'wpcf7-redirect' ),
85
+ 'icon' => WPCF7_PRO_REDIRECT_BUILD_PATH . 'images/icon13.png',
86
+ 'classname' => 'WPCF7R_Action_login',
87
+ ),
88
+ 'wpcf7r-register' => array(
89
+ 'name' => 'wpcf7r-register',
90
+ 'filename' => 'class-wpcf7r-action-register.php',
91
+ 'title' => __( 'Custom Registration Forms', 'wpcf7-redirect' ),
92
+ 'description' => __( 'Create registration form instead of WordPress default registration screen.', 'wpcf7-redirect' ),
93
+ 'icon' => WPCF7_PRO_REDIRECT_BUILD_PATH . 'images/icon8.png',
94
+ 'classname' => 'WPCF7R_Action_Register',
95
+ ),
96
+ 'wpcf7r-mailchimp' => array(
97
+ 'name' => 'wpcf7r-mailchimp',
98
+ 'filename' => 'class-wpcf7r-action-mailchimp.php',
99
+ 'title' => __( 'Subscribe to Mailchimp', 'wpcf7-redirect' ),
100
+ 'description' => __( 'Subscribe users to Mailchimp. Auto subscribe submitted forms.', 'wpcf7-redirect' ),
101
+ 'icon' => WPCF7_PRO_REDIRECT_BUILD_PATH . 'images/icon1.png',
102
+ 'classname' => 'WPCF7R_Action_Mailchimp',
103
+ ),
104
+ 'wpcf7r-salesforce' => array(
105
+ 'name' => 'wpcf7r-salesforce',
106
+ 'filename' => 'class-wpcf7r-action-salesforce.php',
107
+ 'title' => __( 'Salesforce Integration', 'wpcf7-redirect' ),
108
+ 'description' => __( 'Send your leads to Salesforce.', 'wpcf7-redirect' ),
109
+ 'icon' => WPCF7_PRO_REDIRECT_BUILD_PATH . 'images/salesforce.png',
110
+ 'classname' => 'WPCF7R_Action_Salesforce',
111
+ ),
112
+ 'wpcf7r-hubspot' => array(
113
+ 'name' => 'wpcf7r-hubspot',
114
+ 'filename' => 'class-wpcf7r-action-hubspot.php',
115
+ 'title' => __( 'Hubspot Integration', 'wpcf7-redirect' ),
116
+ 'description' => __( 'Send your leads to hubspot.', 'wpcf7-redirect' ),
117
+ 'icon' => WPCF7_PRO_REDIRECT_BUILD_PATH . 'images/hubspot.png',
118
+ 'classname' => 'WPCF7R_Action_Hubspot',
119
+ ),
120
+ 'wpcf7r-actions-bundle' => array(
121
+ 'name' => 'wpcf7r-actions-bundle',
122
+ 'filename' => 'wpcf7r-action-bundle.php',
123
+ 'title' => __( 'Actions Bundle', 'wpcf7-redirect' ),
124
+ 'description' => __( 'Get it all.', 'wpcf7-redirect' ),
125
+ 'icon' => WPCF7_PRO_REDIRECT_BUILD_PATH . 'images/bundle.png',
126
+ 'classname' => 'WPCF7R_Action_Bundle',
127
+ ),
128
+ );
129
+
130
+ $installed_extensions = wpcf7r_get_available_actions();
131
+
132
+ foreach ( $extensions as $key => $extension ) {
133
+ foreach ( $installed_extensions as $installed_extension ) {
134
+ if ( class_exists( $extension['classname'] ) || $installed_extension['handler'] === $extension['classname'] || ( isset( $extension['type'] ) && 'affiliate' === $extension['type'] ) ) {
135
+ $extensions[ $key ]['active'] = true;
136
+ }
137
+ }
138
+ }
139
+
140
+ return apply_filters( 'wpcf7_get_extensions', $extensions );
141
+ }
142
+
143
+ /**
144
+ * Turn file path into base64 file.
145
+ *
146
+ * @param [string] $path - the path of the file to encode.
147
+ * @return string $base64 - encoded file.
148
+ */
149
+ function wpcf7r_base_64_file( $path ) {
150
+
151
+ $data = file_get_contents( $path );
152
+ $base64 = base64_encode( $data );
153
+
154
+ return $base64;
155
+ }
156
+
157
+ /**
158
+ * Geberal function for getting form actions
159
+ *
160
+ * @param [string] $post_type - the type of the action.
161
+ * @param [string] $count - how many actions to return.
162
+ * @param [string] $post_id - the contact form 7 id.
163
+ * @param [string] $rule_id - the action rule id.
164
+ * @param [string] $extra_args - extra arguments to filter the results.
165
+ * @param [bool] $active - active actions or non active actions.
166
+ *
167
+ * @return [array] - $actions - an array containing actions posts.
168
+ */
169
+ function wpcf7r_get_actions( $post_type, $count, $post_id, $rule_id, $extra_args, $active ) {
170
+ $actions = array();
171
+
172
+ $args = array(
173
+ 'post_type' => $post_type,
174
+ 'posts_per_page' => $count,
175
+ 'post_status' => 'private',
176
+ 'orderby' => 'menu_order',
177
+ 'order' => 'ASC',
178
+ 'meta_query' => array(
179
+ array(
180
+ 'key' => 'wpcf7_id',
181
+ 'value' => $post_id,
182
+ ),
183
+ array(
184
+ 'key' => 'wpcf7_rule_id',
185
+ 'value' => $rule_id,
186
+ ),
187
+ ),
188
+ );
189
+
190
+ $args = array_merge( $args, $extra_args );
191
+
192
+ if ( $active ) {
193
+ $args['meta_query'][] = array(
194
+ 'key' => 'action_status',
195
+ 'value' => 'on',
196
+ );
197
+ }
198
+
199
+ $actions = get_posts( $args );
200
+
201
+ return $actions;
202
+ }
203
+
204
+ /**
205
+ * Check if conditional logic extention is enabled
206
+ */
207
+ function conditional_logic_enabled() {
208
+ return class_exists( 'WPCF7_Redirect_Conditional_Logic' );
209
+ }
210
+
211
+ /**
212
+ * Serach for the file in the available directories
213
+ *
214
+ * @param $filename - the name of the fle to return;
215
+ * @return [mixed] - path if the file exists/fals if not.
216
+ */
217
+ function wpcf7r_get_addon_path( $filename ) {
218
+ if ( file_exists( WPCF7_PRO_REDIRECT_ACTIONS_PATH . $filename ) ) {
219
+ return WPCF7_PRO_REDIRECT_ACTIONS_PATH . $filename;
220
+ } elseif ( file_exists( WPCF7_PRO_REDIRECT_ADDONS_PATH . $filename ) ) {
221
+ return WPCF7_PRO_REDIRECT_ADDONS_PATH . $filename;
222
+ }
223
+
224
+ return false;
225
+ }
226
+
227
+ /**
228
+ * Get an array and transform it to html attributes
229
+ *
230
+ * @param $attributes
231
+ */
232
+ function wpcf7r_implode_attributes( $attributes ) {
233
+ $result = join(
234
+ ' ',
235
+ array_map(
236
+ function( $key ) use ( $attributes ) {
237
+ if ( is_bool( $attributes[ $key ] ) ) {
238
+ return $attributes[ $key ] ? $key : '';
239
+ }
240
+ return $key . '="' . $attributes[ $key ] . '"';
241
+ },
242
+ array_keys( $attributes )
243
+ )
244
+ );
245
+
246
+ return $result;
247
+ }
248
+
249
+ /**
250
+ * Send emails as HTML
251
+ */
252
+ function wpcf7r_send_emails_as_html() {
253
+ return 'text/html';
254
+ }
255
+
256
+ /**
257
+ * Helper function
258
+ *
259
+ * @param $name
260
+ * @param $title
261
+ * @param $class
262
+ * @param $order
263
+ */
264
+ function register_wpcf7r_actions( $name, $title, $class, $order = 0 ) {
265
+ WPCF7r_Utils::register_wpcf7r_actions( $name, $title, $class, $order );
266
+ }
267
+
268
+ /**
269
+ * Get a list of available actions
270
+ */
271
+ function wpcf7r_get_available_actions() {
272
+ $actions = WPCF7r_Utils::get_wpcf7r_actions();
273
+
274
+ array_multisort( array_column( $actions, 'order' ), SORT_ASC, $actions );
275
+
276
+ return apply_filters( 'wpcf7r_get_available_actions', $actions );
277
+ }
278
+
279
+ /**
280
+ * Get an instance of contact form 7 redirect form
281
+ *
282
+ * @param $form_id
283
+ * @param $submission
284
+ * @param $validation_obj
285
+ */
286
+ function get_cf7r_form( $form_id, $submission = '', $validation_obj = '' ) {
287
+ return new WPCF7R_Form( $form_id, $submission, $validation_obj );
288
+ }
289
+
290
+ /**
291
+ * Create HTML tooltip
292
+ *
293
+ * @param $tip
294
+ */
295
+ function cf7r_tooltip( $tip ) {
296
+ $tip = esc_attr( $tip );
297
+
298
+ return '<i class="dashicons dashicons-editor-help qs-tooltip"><span class="qs-tooltip-inner">' . $tip . '</span></i>';
299
+ }
300
+
301
+ /**
302
+ * Get plugin base url
303
+ */
304
+ function wpcf7r_get_redirect_plugin_url() {
305
+ return WPCF7_PRO_REDIRECT_BASE_URL;
306
+ }
307
+
308
+ /**
309
+ * Get the value of a single block field
310
+ *
311
+ * @param $key
312
+ * @param $block_key
313
+ * @param $fields
314
+ */
315
+ function block_field_value( $key, $block_key, $fields ) {
316
+ return isset( $fields['blocks'][ $block_key ][ $key ] ) ? $fields['blocks'][ $block_key ][ $key ] : '';
317
+ }
318
+
319
+ /**
320
+ * Remove old plugin notice
321
+ */
322
+ function wpcf7_remove_old_plugin_notice() {
323
+ ?>
324
+
325
+ <div class="wpcf7-redirect-error error notice">
326
+ <h3>
327
+ <?php esc_html_e( 'Redirection for Contact Form 7', 'wpcf7-redirect' ); ?>
328
+ </h3>
329
+ <p>
330
+ <?php esc_html_e( 'Error: It is recommended to deactivate and remove Redirection for Contact Form 7 plugin for the PRO version to work.', 'wpcf7-redirect' ); ?>
331
+ </p>
332
+ </div>
333
+
334
+ <?php
335
+ }
336
+
337
+ /**
338
+ * A notice to remove the free plugin
339
+ */
340
+ function wpcf7_remove_contact_form_7_to_api() {
341
+ ?>
342
+
343
+ <div class="wpcf7-redirect-error error notice">
344
+ <h3>
345
+ <?php esc_html_e( 'Redirection for Contact Form 7', 'wpcf7-redirect' ); ?>
346
+ </h3>
347
+ <p>
348
+ <?php esc_html_e( 'Error: It is recommended to deactivate and remove Contact Form 7 to API plugin.', 'wpcf7-redirect' ); ?>
349
+ </p>
350
+ </div>
351
+
352
+ <?php
353
+ }
354
+
355
+ /**
356
+ * Get CF7 version
357
+ */
358
+ function wpcf7_get_cf7_ver() {
359
+ if ( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) {
360
+ $wpcf7_path = WPCF7_PRO_REDIRECT_PLUGINS_PATH . 'contact-form-7/wp-contact-form-7.php';
361
+ $wpcf7_data = get_plugin_data( $wpcf7_path, false, false );
362
+
363
+ return $wpcf7_data['Version'];
364
+ }
365
+
366
+ return false;
367
+ }
368
+
369
+ /**
370
+ * Show admin notices
371
+ */
372
+ function wpcf7r_admin_notice() {
373
+ $ver = wpcf7_get_cf7_ver() ? wpcf7_get_cf7_ver() : '';
374
+
375
+ if ( $ver < 4.8 ) {
376
+ ?>
377
+
378
+ <div class="wpcf7-redirect-error error notice">
379
+ <h3>
380
+ <?php esc_html_e( 'Redirection for Contact Form 7', 'wpcf7-redirect' ); ?>
381
+ </h3>
382
+ <p>
383
+ <?php esc_html_e( 'Error: Contact Form 7 version is too old. Redirection for Contact Form 7 is compatible from version 4.8 and above. Please update Contact Form 7.', 'wpcf7-redirect' ); ?>
384
+ </p>
385
+ </div>
386
+
387
+ <?php
388
+ } else {
389
+ // If CF7 isn't installed and activated, throw an error.
390
+ ?>
391
+ <div class="wpcf7-redirect-error error notice">
392
+ <h3>
393
+ <?php esc_html_e( 'Contact Form Redirection', 'wpcf7-redirect' ); ?>
394
+ </h3>
395
+ <p>
396
+ <?php esc_html_e( 'Error: Please install and activate Contact Form 7.', 'wpcf7-redirect' ); ?>
397
+ </p>
398
+ </div>
399
+
400
+ <?php
401
+ }
402
+ }
403
+
404
+ add_shortcode( 'qs_date', 'qs_date' );
405
+
406
+ /**
407
+ * Shortcode for creating date
408
+ */
409
+ function qs_date( $atts ) {
410
+ $atts = shortcode_atts(
411
+ array(
412
+ 'format' => 'Ydm',
413
+ ),
414
+ $atts,
415
+ 'wpcf7-redirect'
416
+ );
417
+
418
+ return gmdate( $atts['format'], time() );
419
+ }
420
+
421
+ /**
422
+ * Check if WPCF7 Debug
423
+ *
424
+ * @return boolean
425
+ */
426
+ function is_wpcf7r_debug() {
427
+ return defined( 'CF7_REDIRECT_DEBUG' ) && CF7_REDIRECT_DEBUG ? true : false;
428
+ }
429
+
430
+ /**
431
+ * Get an array of available countries
432
+ */
433
+ function wpcf73_get_country_list() {
434
+ $country_array = array(
435
+ 'AF' => __( 'Afghanistan', 'wpcf7-redirect' ),
436
+ 'AL' => __( 'Albania', 'wpcf7-redirect' ),
437
+ 'DZ' => __( 'Algeria', 'wpcf7-redirect' ),
438
+ 'AS' => __( 'American Samoa', 'wpcf7-redirect' ),
439
+ 'AD' => __( 'Andorra', 'wpcf7-redirect' ),
440
+ 'AO' => __( 'Angola', 'wpcf7-redirect' ),
441
+ 'AI' => __( 'Anguilla', 'wpcf7-redirect' ),
442
+ 'AQ' => __( 'Antarctica', 'wpcf7-redirect' ),
443
+ 'AG' => __( 'Antigua and Barbuda', 'wpcf7-redirect' ),
444
+ 'AR' => __( 'Argentina', 'wpcf7-redirect' ),
445
+ 'AM' => __( 'Armenia', 'wpcf7-redirect' ),
446
+ 'AW' => __( 'Aruba', 'wpcf7-redirect' ),
447
+ 'AU' => __( 'Australia', 'wpcf7-redirect' ),
448
+ 'AT' => __( 'Austria', 'wpcf7-redirect' ),
449
+ 'AZ' => __( 'Azerbaijan', 'wpcf7-redirect' ),
450
+ 'BS' => __( 'Bahamas', 'wpcf7-redirect' ),
451
+ 'BH' => __( 'Bahrain', 'wpcf7-redirect' ),
452
+ 'BD' => __( 'Bangladesh', 'wpcf7-redirect' ),
453
+ 'BB' => __( 'Barbados', 'wpcf7-redirect' ),
454
+ 'BY' => __( 'Belarus', 'wpcf7-redirect' ),
455
+ 'BE' => __( 'Belgium', 'wpcf7-redirect' ),
456
+ 'BZ' => __( 'Belize', 'wpcf7-redirect' ),
457
+ 'BJ' => __( 'Benin', 'wpcf7-redirect' ),
458
+ 'BM' => __( 'Bermuda', 'wpcf7-redirect' ),
459
+ 'BT' => __( 'Bhutan', 'wpcf7-redirect' ),
460
+ 'BO' => __( 'Bolivia', 'wpcf7-redirect' ),
461
+ 'BA' => __( 'Bosnia and Herzegovina', 'wpcf7-redirect' ),
462
+ 'BW' => __( 'Botswana', 'wpcf7-redirect' ),
463
+ 'BV' => __( 'Bouvet Island', 'wpcf7-redirect' ),
464
+ 'BR' => __( 'Brazil', 'wpcf7-redirect' ),
465
+ 'BQ' => __( 'British Antarctic Territory', 'wpcf7-redirect' ),
466
+ 'IO' => __( 'British Indian Ocean Territory', 'wpcf7-redirect' ),
467
+ 'VG' => __( 'British Virgin Islands', 'wpcf7-redirect' ),
468
+ 'BN' => __( 'Brunei', 'wpcf7-redirect' ),
469
+ 'BG' => __( 'Bulgaria', 'wpcf7-redirect' ),
470
+ 'BF' => __( 'Burkina Faso', 'wpcf7-redirect' ),
471
+ 'BI' => __( 'Burundi', 'wpcf7-redirect' ),
472
+ 'KH' => __( 'Cambodia', 'wpcf7-redirect' ),
473
+ 'CM' => __( 'Cameroon', 'wpcf7-redirect' ),
474
+ 'CA' => __( 'Canada', 'wpcf7-redirect' ),
475
+ 'CT' => __( 'Canton and Enderbury Islands', 'wpcf7-redirect' ),
476
+ 'CV' => __( 'Cape Verde', 'wpcf7-redirect' ),
477
+ 'KY' => __( 'Cayman Islands', 'wpcf7-redirect' ),
478
+ 'CF' => __( 'Central African Republic', 'wpcf7-redirect' ),
479
+ 'TD' => __( 'Chad', 'wpcf7-redirect' ),
480
+ 'CL' => __( 'Chile', 'wpcf7-redirect' ),
481
+ 'CN' => __( 'China', 'wpcf7-redirect' ),
482
+ 'CX' => __( 'Christmas Island', 'wpcf7-redirect' ),
483
+ 'CC' => __( 'Cocos [Keeling] Islands', 'wpcf7-redirect' ),
484
+ 'CO' => __( 'Colombia', 'wpcf7-redirect' ),
485
+ 'KM' => __( 'Comoros', 'wpcf7-redirect' ),
486
+ 'CG' => __( 'Congo - Brazzaville', 'wpcf7-redirect' ),
487
+ 'CD' => __( 'Congo - Kinshasa', 'wpcf7-redirect' ),
488
+ 'CK' => __( 'Cook Islands', 'wpcf7-redirect' ),
489
+ 'CR' => __( 'Costa Rica', 'wpcf7-redirect' ),
490
+ 'HR' => __( 'Croatia', 'wpcf7-redirect' ),
491
+ 'CU' => __( 'Cuba', 'wpcf7-redirect' ),
492
+ 'CY' => __( 'Cyprus', 'wpcf7-redirect' ),
493
+ 'CZ' => __( 'Czech Republic', 'wpcf7-redirect' ),
494
+ 'CI' => __( 'Côte d’Ivoire', 'wpcf7-redirect' ),
495
+ 'DK' => __( 'Denmark', 'wpcf7-redirect' ),
496
+ 'DJ' => __( 'Djibouti', 'wpcf7-redirect' ),
497
+ 'DM' => __( 'Dominica', 'wpcf7-redirect' ),
498
+ 'DO' => __( 'Dominican Republic', 'wpcf7-redirect' ),
499
+ 'NQ' => __( 'Dronning Maud Land', 'wpcf7-redirect' ),
500
+ 'DD' => __( 'East Germany', 'wpcf7-redirect' ),
501
+ 'EC' => __( 'Ecuador', 'wpcf7-redirect' ),
502
+ 'EG' => __( 'Egypt', 'wpcf7-redirect' ),
503
+ 'SV' => __( 'El Salvador', 'wpcf7-redirect' ),
504
+ 'GQ' => __( 'Equatorial Guinea', 'wpcf7-redirect' ),
505
+ 'ER' => __( 'Eritrea', 'wpcf7-redirect' ),
506
+ 'EE' => __( 'Estonia', 'wpcf7-redirect' ),
507
+ 'ET' => __( 'Ethiopia', 'wpcf7-redirect' ),
508
+ 'FK' => __( 'Falkland Islands', 'wpcf7-redirect' ),
509
+ 'FO' => __( 'Faroe Islands', 'wpcf7-redirect' ),
510
+ 'FJ' => __( 'Fiji', 'wpcf7-redirect' ),
511
+ 'FI' => __( 'Finland', 'wpcf7-redirect' ),
512
+ 'FR' => __( 'France', 'wpcf7-redirect' ),
513
+ 'GF' => __( 'French Guiana', 'wpcf7-redirect' ),
514
+ 'PF' => __( 'French Polynesia', 'wpcf7-redirect' ),
515
+ 'TF' => __( 'French Southern Territories', 'wpcf7-redirect' ),
516
+ 'FQ' => __( 'French Southern and Antarctic Territories', 'wpcf7-redirect' ),
517
+ 'GA' => __( 'Gabon', 'wpcf7-redirect' ),
518
+ 'GM' => __( 'Gambia', 'wpcf7-redirect' ),
519
+ 'GE' => __( 'Georgia', 'wpcf7-redirect' ),
520
+ 'DE' => __( 'Germany', 'wpcf7-redirect' ),
521
+ 'GH' => __( 'Ghana', 'wpcf7-redirect' ),
522
+ 'GI' => __( 'Gibraltar', 'wpcf7-redirect' ),
523
+ 'GR' => __( 'Greece', 'wpcf7-redirect' ),
524
+ 'GL' => __( 'Greenland', 'wpcf7-redirect' ),
525
+ 'GD' => __( 'Grenada', 'wpcf7-redirect' ),
526
+ 'GP' => __( 'Guadeloupe', 'wpcf7-redirect' ),
527
+ 'GU' => __( 'Guam', 'wpcf7-redirect' ),
528
+ 'GT' => __( 'Guatemala', 'wpcf7-redirect' ),
529
+ 'GG' => __( 'Guernsey', 'wpcf7-redirect' ),
530
+ 'GN' => __( 'Guinea', 'wpcf7-redirect' ),
531
+ 'GW' => __( 'Guinea-Bissau', 'wpcf7-redirect' ),
532
+ 'GY' => __( 'Guyana', 'wpcf7-redirect' ),
533
+ 'HT' => __( 'Haiti', 'wpcf7-redirect' ),
534
+ 'HM' => __( 'Heard Island and McDonald Islands', 'wpcf7-redirect' ),
535
+ 'HN' => __( 'Honduras', 'wpcf7-redirect' ),
536
+ 'HK' => __( 'Hong Kong SAR China', 'wpcf7-redirect' ),
537
+ 'HU' => __( 'Hungary', 'wpcf7-redirect' ),
538
+ 'IS' => __( 'Iceland', 'wpcf7-redirect' ),
539
+ 'IN' => __( 'India', 'wpcf7-redirect' ),
540
+ 'ID' => __( 'Indonesia', 'wpcf7-redirect' ),
541
+ 'IR' => __( 'Iran', 'wpcf7-redirect' ),
542
+ 'IQ' => __( 'Iraq', 'wpcf7-redirect' ),
543
+ 'IE' => __( 'Ireland', 'wpcf7-redirect' ),
544
+ 'IM' => __( 'Isle of Man', 'wpcf7-redirect' ),
545
+ 'IL' => __( 'Israel', 'wpcf7-redirect' ),
546
+ 'IT' => __( 'Italy', 'wpcf7-redirect' ),
547
+ 'JM' => __( 'Jamaica', 'wpcf7-redirect' ),
548
+ 'JP' => __( 'Japan', 'wpcf7-redirect' ),
549
+ 'JE' => __( 'Jersey', 'wpcf7-redirect' ),
550
+ 'JT' => __( 'Johnston Island', 'wpcf7-redirect' ),
551
+ 'JO' => __( 'Jordan', 'wpcf7-redirect' ),
552
+ 'KZ' => __( 'Kazakhstan', 'wpcf7-redirect' ),
553
+ 'KE' => __( 'Kenya', 'wpcf7-redirect' ),
554
+ 'KI' => __( 'Kiribati', 'wpcf7-redirect' ),
555
+ 'KW' => __( 'Kuwait', 'wpcf7-redirect' ),
556
+ 'KG' => __( 'Kyrgyzstan', 'wpcf7-redirect' ),
557
+ 'LA' => __( 'Laos', 'wpcf7-redirect' ),
558
+ 'LV' => __( 'Latvia', 'wpcf7-redirect' ),
559
+ 'LB' => __( 'Lebanon', 'wpcf7-redirect' ),
560
+ 'LS' => __( 'Lesotho', 'wpcf7-redirect' ),
561
+ 'LR' => __( 'Liberia', 'wpcf7-redirect' ),
562
+ 'LY' => __( 'Libya', 'wpcf7-redirect' ),
563
+ 'LI' => __( 'Liechtenstein', 'wpcf7-redirect' ),
564
+ 'LT' => __( 'Lithuania', 'wpcf7-redirect' ),
565
+ 'LU' => __( 'Luxembourg', 'wpcf7-redirect' ),
566
+ 'MO' => __( 'Macau SAR China', 'wpcf7-redirect' ),
567
+ 'MK' => __( 'Macedonia', 'wpcf7-redirect' ),
568
+ 'MG' => __( 'Madagascar', 'wpcf7-redirect' ),
569
+ 'MW' => __( 'Malawi', 'wpcf7-redirect' ),
570
+ 'MY' => __( 'Malaysia', 'wpcf7-redirect' ),
571
+ 'MV' => __( 'Maldives', 'wpcf7-redirect' ),
572
+ 'ML' => __( 'Mali', 'wpcf7-redirect' ),
573
+ 'MT' => __( 'Malta', 'wpcf7-redirect' ),
574
+ 'MH' => __( 'Marshall Islands', 'wpcf7-redirect' ),
575
+ 'MQ' => __( 'Martinique', 'wpcf7-redirect' ),
576
+ 'MR' => __( 'Mauritania', 'wpcf7-redirect' ),
577
+ 'MU' => __( 'Mauritius', 'wpcf7-redirect' ),
578
+ 'YT' => __( 'Mayotte', 'wpcf7-redirect' ),
579
+ 'FX' => __( 'Metropolitan France', 'wpcf7-redirect' ),
580
+ 'MX' => __( 'Mexico', 'wpcf7-redirect' ),
581
+ 'FM' => __( 'Micronesia', 'wpcf7-redirect' ),
582
+ 'MI' => __( 'Midway Islands', 'wpcf7-redirect' ),
583
+ 'MD' => __( 'Moldova', 'wpcf7-redirect' ),
584
+ 'MC' => __( 'Monaco', 'wpcf7-redirect' ),
585
+ 'MN' => __( 'Mongolia', 'wpcf7-redirect' ),
586
+ 'ME' => __( 'Montenegro', 'wpcf7-redirect' ),
587
+ 'MS' => __( 'Montserrat', 'wpcf7-redirect' ),
588
+ 'MA' => __( 'Morocco', 'wpcf7-redirect' ),
589
+ 'MZ' => __( 'Mozambique', 'wpcf7-redirect' ),
590
+ 'MM' => __( 'Myanmar [Burma]', 'wpcf7-redirect' ),
591
+ 'NA' => __( 'Namibia', 'wpcf7-redirect' ),
592
+ 'NR' => __( 'Nauru', 'wpcf7-redirect' ),
593
+ 'NP' => __( 'Nepal', 'wpcf7-redirect' ),
594
+ 'NL' => __( 'Netherlands', 'wpcf7-redirect' ),
595
+ 'AN' => __( 'Netherlands Antilles', 'wpcf7-redirect' ),
596
+ 'NT' => __( 'Neutral Zone', 'wpcf7-redirect' ),
597
+ 'NC' => __( 'New Caledonia', 'wpcf7-redirect' ),
598
+ 'NZ' => __( 'New Zealand', 'wpcf7-redirect' ),
599
+ 'NI' => __( 'Nicaragua', 'wpcf7-redirect' ),
600
+ 'NE' => __( 'Niger', 'wpcf7-redirect' ),
601
+ 'NG' => __( 'Nigeria', 'wpcf7-redirect' ),
602
+ 'NU' => __( 'Niue', 'wpcf7-redirect' ),
603
+ 'NF' => __( 'Norfolk Island', 'wpcf7-redirect' ),
604
+ 'KP' => __( 'North Korea', 'wpcf7-redirect' ),
605
+ 'VD' => __( 'North Vietnam', 'wpcf7-redirect' ),
606
+ 'MP' => __( 'Northern Mariana Islands', 'wpcf7-redirect' ),
607
+ 'NO' => __( 'Norway', 'wpcf7-redirect' ),
608
+ 'OM' => __( 'Oman', 'wpcf7-redirect' ),
609
+ 'PC' => __( 'Pacific Islands Trust Territory', 'wpcf7-redirect' ),
610
+ 'PK' => __( 'Pakistan', 'wpcf7-redirect' ),
611
+ 'PW' => __( 'Palau', 'wpcf7-redirect' ),
612
+ 'PS' => __( 'Palestinian Territories', 'wpcf7-redirect' ),
613
+ 'PA' => __( 'Panama', 'wpcf7-redirect' ),
614
+ 'PZ' => __( 'Panama Canal Zone', 'wpcf7-redirect' ),
615
+ 'PG' => __( 'Papua New Guinea', 'wpcf7-redirect' ),
616
+ 'PY' => __( 'Paraguay', 'wpcf7-redirect' ),
617
+ 'YD' => __( 'Yemen, Democratic', 'wpcf7-redirect' ),
618
+ 'PE' => __( 'Peru', 'wpcf7-redirect' ),
619
+ 'PH' => __( 'Philippines', 'wpcf7-redirect' ),
620
+ 'PN' => __( 'Pitcairn Islands', 'wpcf7-redirect' ),
621
+ 'PL' => __( 'Poland', 'wpcf7-redirect' ),
622
+ 'PT' => __( 'Portugal', 'wpcf7-redirect' ),
623
+ 'PR' => __( 'Puerto Rico', 'wpcf7-redirect' ),
624
+ 'QA' => __( 'Qatar', 'wpcf7-redirect' ),
625
+ 'RO' => __( 'Romania', 'wpcf7-redirect' ),
626
+ 'RU' => __( 'Russia', 'wpcf7-redirect' ),
627
+ 'RW' => __( 'Rwanda', 'wpcf7-redirect' ),
628
+ 'RE' => __( 'Réunion', 'wpcf7-redirect' ),
629
+ 'BL' => __( 'Saint Barthélemy', 'wpcf7-redirect' ),
630
+ 'SH' => __( 'Saint Helena', 'wpcf7-redirect' ),
631
+ 'KN' => __( 'Saint Kitts and Nevis', 'wpcf7-redirect' ),
632
+ 'LC' => __( 'Saint Lucia', 'wpcf7-redirect' ),
633
+ 'MF' => __( 'Saint Martin', 'wpcf7-redirect' ),
634
+ 'PM' => __( 'Saint Pierre and Miquelon', 'wpcf7-redirect' ),
635
+ 'VC' => __( 'Saint Vincent and the Grenadines', 'wpcf7-redirect' ),
636
+ 'WS' => __( 'Samoa', 'wpcf7-redirect' ),
637
+ 'SM' => __( 'San Marino', 'wpcf7-redirect' ),
638
+ 'SA' => __( 'Saudi Arabia', 'wpcf7-redirect' ),
639
+ 'SN' => __( 'Senegal', 'wpcf7-redirect' ),
640
+ 'RS' => __( 'Serbia', 'wpcf7-redirect' ),
641
+ 'CS' => __( 'Serbia and Montenegro', 'wpcf7-redirect' ),
642
+ 'SC' => __( 'Seychelles', 'wpcf7-redirect' ),
643
+ 'SL' => __( 'Sierra Leone', 'wpcf7-redirect' ),
644
+ 'SG' => __( 'Singapore', 'wpcf7-redirect' ),
645
+ 'SK' => __( 'Slovakia', 'wpcf7-redirect' ),
646
+ 'SI' => __( 'Slovenia', 'wpcf7-redirect' ),
647
+ 'SB' => __( 'Solomon Islands', 'wpcf7-redirect' ),
648
+ 'SO' => __( 'Somalia', 'wpcf7-redirect' ),
649
+ 'ZA' => __( 'South Africa', 'wpcf7-redirect' ),
650
+ 'GS' => __( 'South Georgia and the South Sandwich Islands', 'wpcf7-redirect' ),
651
+ 'KR' => __( 'South Korea', 'wpcf7-redirect' ),
652
+ 'ES' => __( 'Spain', 'wpcf7-redirect' ),
653
+ 'LK' => __( 'Sri Lanka', 'wpcf7-redirect' ),
654
+ 'SD' => __( 'Sudan', 'wpcf7-redirect' ),
655
+ 'SR' => __( 'Suriname', 'wpcf7-redirect' ),
656
+ 'SJ' => __( 'Svalbard and Jan Mayen', 'wpcf7-redirect' ),
657
+ 'SZ' => __( 'Swaziland', 'wpcf7-redirect'