├── .gitattributes ├── .distignore ├── assets ├── img │ ├── logo.png │ ├── logo-wide.png │ ├── fen-pro-promo.png │ ├── logo-sm-trans.png │ └── logo-wide-color.png ├── js │ ├── wpf-bb-themer.js │ ├── wpf-admin-bar.js │ ├── wpf-apply-tags.js │ ├── wpf-async-checkout.js │ ├── wpfgutenberg.build.js │ ├── wpf-thrive-api-connection.js │ ├── jquery-tiptip │ │ └── jquery.tipTip.min.js │ ├── wpf-leadsource-tracking.js │ ├── wpf-elementor-forms.js │ ├── wpf-holler-box.js │ └── wpf-elementor.js └── css │ ├── wpf-gforms.css │ └── wpf-admin-bar.css ├── .wordpress-org ├── icon-128x128.png ├── icon-256x256.png ├── screenshot-1.jpg ├── screenshot-2.jpg ├── screenshot-3.jpg ├── screenshot-4.jpg ├── banner-772x250.png └── banner-1544x500.png ├── includes ├── crms │ ├── activecampaign │ │ ├── includes │ │ │ ├── Subscriber.class.php │ │ │ ├── config.php │ │ │ ├── Auth.class.php │ │ │ ├── Settings.class.php │ │ │ ├── Design.class.php │ │ │ ├── Automation.class.php │ │ │ ├── Group.class.php │ │ │ ├── User.class.php │ │ │ ├── Account.class.php │ │ │ ├── Webhook.class.php │ │ │ ├── List.class.php │ │ │ ├── README.md │ │ │ ├── Message.class.php │ │ │ ├── ActiveCampaign.class.php │ │ │ ├── Tracking.class.php │ │ │ └── Contact.class.php │ │ └── admin │ │ │ └── activecampaign-fields.php │ ├── mailjet │ │ └── admin │ │ │ └── mailjet-fields.php │ ├── getresponse │ │ └── admin │ │ │ └── getresponse-fields.php │ ├── convertkit │ │ └── admin │ │ │ └── convertkit-fields.php │ ├── customer-io │ │ └── admin │ │ │ └── customer-io-fields.php │ ├── customerly │ │ └── admin │ │ │ └── customerly-fields.php │ ├── birdsend │ │ └── admin │ │ │ └── birdsend-fields.php │ ├── mailpoet │ │ └── admin │ │ │ └── mailpoet-fields.php │ ├── dynamics-365 │ │ └── dynamics-365-fields.php │ ├── emercury │ │ └── emercury-fields.php │ ├── bento │ │ └── bento-fields.php │ ├── sendlane │ │ └── sendlane-fields.php │ ├── sendinblue │ │ └── admin │ │ │ └── sendinblue-fields.php │ ├── klick-tipp │ │ └── admin │ │ │ └── klick-tipp-fields.php │ ├── emailoctopus │ │ └── admin │ │ │ └── emailoctopus-fields.php │ ├── moosend │ │ └── moosend-fields.php │ ├── sendfox │ │ └── admin │ │ │ └── sendfox-fields.php │ ├── drift │ │ └── admin │ │ │ └── drift-fields.php │ ├── maropost │ │ └── admin │ │ │ └── maropost-fields.php │ ├── userengage │ │ └── admin │ │ │ └── userengage-fields.php │ ├── ortto │ │ └── ortto-fields.php │ ├── copper │ │ └── admin │ │ │ └── copper-fields.php │ ├── growmatik │ │ └── admin │ │ │ └── growmatik-fields.php │ ├── drip │ │ ├── includes │ │ │ └── README.md │ │ └── admin │ │ │ └── drip-fields.php │ ├── pipedrive │ │ └── pipedrive-fields.php │ ├── intercom │ │ └── admin │ │ │ └── intercom-fields.php │ ├── mailchimp │ │ └── admin │ │ │ └── mailchimp-fields.php │ ├── zoho │ │ └── admin │ │ │ └── zoho-fields.php │ ├── loopify │ │ └── admin │ │ │ └── loopify-fields.php │ ├── hubspot │ │ └── admin │ │ │ └── hubspot-fields.php │ ├── wp-erp │ │ └── admin │ │ │ ├── wp-erp-fields.php │ │ │ └── class-admin.php │ ├── mailerlite │ │ └── admin │ │ │ └── mailerlite-fields.php │ ├── salesforce │ │ └── admin │ │ │ └── salesforce-fields.php │ ├── mautic │ │ └── includes │ │ │ └── states.php │ ├── ontraport │ │ └── admin │ │ │ └── ontraport-fields.php │ ├── klaviyo │ │ └── admin │ │ │ └── klaviyo-fields.php │ ├── platformly │ │ └── admin │ │ │ └── platformly-fields.php │ ├── quentn │ │ └── admin │ │ │ └── quentn-fields.php │ ├── highlevel │ │ └── admin │ │ │ └── highlevel-fields.php │ ├── tubular │ │ └── admin │ │ │ ├── tubular-fields.php │ │ │ └── class-admin.php │ ├── autopilot │ │ └── admin │ │ │ └── autopilot-fields.php │ ├── zerobscrm │ │ └── admin │ │ │ └── zerobscrm-fields.php │ ├── salesflare │ │ └── admin │ │ │ ├── salesflare-fields.php │ │ │ └── class-admin.php │ ├── kartra │ │ └── admin │ │ │ └── kartra-fields.php │ ├── vtiger │ │ └── admin │ │ │ └── vtiger-fields.php │ ├── staging │ │ └── admin │ │ │ └── class-admin.php │ ├── agilecrm │ │ └── admin │ │ │ └── agilecrm-fields.php │ ├── groundhogg │ │ └── admin │ │ │ └── groundhogg-fields.php │ ├── convertfox │ │ └── admin │ │ │ ├── convertfox-fields.php │ │ │ └── class-admin.php │ ├── engagebay │ │ └── admin │ │ │ └── engagebay-fields.php │ └── capsule │ │ └── admin │ │ └── class-admin.php └── admin │ ├── options │ ├── fonts │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.ttf │ │ └── fontawesome-webfont.woff │ └── README.md │ ├── gutenberg │ ├── src │ │ ├── index.js │ │ ├── secure-block-inner-secure │ │ │ ├── js │ │ │ │ ├── icons.js │ │ │ │ └── index.js │ │ │ └── scss │ │ │ │ └── editor.scss │ │ ├── secure-block-inner-unsecure │ │ │ ├── js │ │ │ │ ├── icons.js │ │ │ │ └── index.js │ │ │ └── scss │ │ │ │ └── editor.scss │ │ └── secure-block │ │ │ ├── scss │ │ │ └── editor.scss │ │ │ ├── js │ │ │ └── index.js │ │ │ └── php │ │ │ └── class-secure-block.php │ └── class-gutenberg.php │ ├── wordpress-fields.php │ └── class-notices.php ├── .cursorignore ├── .gitignore ├── phpstan.neon ├── .github └── workflows │ └── deploy.yml ├── package.json ├── .cursor └── rules │ ├── agent-workflow.mdc │ ├── task-directives.mdc │ ├── wordpress.mdc │ ├── core.mdc │ └── crm-integration.mdc ├── phpcs.xml └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.distignore: -------------------------------------------------------------------------------- 1 | /.wordpress-org 2 | /.git 3 | /.github 4 | /node_modules 5 | 6 | .distignore 7 | .gitignore -------------------------------------------------------------------------------- /assets/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verygoodplugins/wp-fusion-lite/HEAD/assets/img/logo.png -------------------------------------------------------------------------------- /assets/img/logo-wide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verygoodplugins/wp-fusion-lite/HEAD/assets/img/logo-wide.png -------------------------------------------------------------------------------- /assets/img/fen-pro-promo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verygoodplugins/wp-fusion-lite/HEAD/assets/img/fen-pro-promo.png -------------------------------------------------------------------------------- /assets/img/logo-sm-trans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verygoodplugins/wp-fusion-lite/HEAD/assets/img/logo-sm-trans.png -------------------------------------------------------------------------------- /.wordpress-org/icon-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verygoodplugins/wp-fusion-lite/HEAD/.wordpress-org/icon-128x128.png -------------------------------------------------------------------------------- /.wordpress-org/icon-256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verygoodplugins/wp-fusion-lite/HEAD/.wordpress-org/icon-256x256.png -------------------------------------------------------------------------------- /.wordpress-org/screenshot-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verygoodplugins/wp-fusion-lite/HEAD/.wordpress-org/screenshot-1.jpg -------------------------------------------------------------------------------- /.wordpress-org/screenshot-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verygoodplugins/wp-fusion-lite/HEAD/.wordpress-org/screenshot-2.jpg -------------------------------------------------------------------------------- /.wordpress-org/screenshot-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verygoodplugins/wp-fusion-lite/HEAD/.wordpress-org/screenshot-3.jpg -------------------------------------------------------------------------------- /.wordpress-org/screenshot-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verygoodplugins/wp-fusion-lite/HEAD/.wordpress-org/screenshot-4.jpg -------------------------------------------------------------------------------- /assets/img/logo-wide-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verygoodplugins/wp-fusion-lite/HEAD/assets/img/logo-wide-color.png -------------------------------------------------------------------------------- /includes/crms/activecampaign/includes/Subscriber.class.php: -------------------------------------------------------------------------------- 1 | 'Name', 7 | 'crm_field' => 'Name', 8 | ); 9 | 10 | $mailjet_fields['user_email'] = array( 11 | 'crm_label' => 'Email', 12 | 'crm_field' => 'Email', 13 | ); 14 | -------------------------------------------------------------------------------- /includes/crms/getresponse/admin/getresponse-fields.php: -------------------------------------------------------------------------------- 1 | 'Name', 7 | 'crm_field' => 'name', 8 | ); 9 | 10 | $getresponse_fields['user_email'] = array( 11 | 'crm_label' => 'Email', 12 | 'crm_field' => 'email', 13 | ); 14 | -------------------------------------------------------------------------------- /includes/crms/convertkit/admin/convertkit-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'first_name', 8 | ); 9 | 10 | $convertkit_fields['user_email'] = array( 11 | 'crm_label' => 'Email', 12 | 'crm_field' => 'email_address', 13 | ); 14 | -------------------------------------------------------------------------------- /includes/crms/customer-io/admin/customer-io-fields.php: -------------------------------------------------------------------------------- 1 | 'Email Address', 7 | 'crm_field' => 'email', 8 | ); 9 | 10 | $customer_io_fields['user_registered'] = array( 11 | 'crm_label' => 'Created At', 12 | 'crm_field' => 'created_at', 13 | ); 14 | -------------------------------------------------------------------------------- /phpstan.neon: -------------------------------------------------------------------------------- 1 | includes: 2 | - phpstan-baseline.neon 3 | 4 | parameters: 5 | level: 5 6 | checkExplicitMixedMissingReturn: false 7 | reportUnmatchedIgnoredErrors: false 8 | bootstrapFiles: 9 | - ./stubs.php 10 | excludePaths: 11 | - **/node_modules/* 12 | - **/vendor/* 13 | - **/tests/* 14 | - !**/*.php 15 | paths: 16 | - ./ 17 | -------------------------------------------------------------------------------- /includes/crms/customerly/admin/customerly-fields.php: -------------------------------------------------------------------------------- 1 | 'Name', 7 | 'crm_field' => 'name', 8 | ); 9 | 10 | $customerly_fields['user_email'] = array( 11 | 'crm_label' => 'Email', 12 | 'crm_field' => 'email', 13 | ); 14 | 15 | $customerly_fields['user_id'] = array( 16 | 'crm_label' => 'User ID', 17 | 'crm_field' => 'user_id', 18 | ); 19 | -------------------------------------------------------------------------------- /includes/crms/birdsend/admin/birdsend-fields.php: -------------------------------------------------------------------------------- 1 | 'first_name', 7 | 'crm_label' => 'First Name', 8 | ); 9 | 10 | $birdsend_fields['last_name'] = array( 11 | 'crm_field' => 'last_name', 12 | 'crm_label' => 'Last Name', 13 | ); 14 | 15 | $birdsend_fields['user_email'] = array( 16 | 'crm_field' => 'email', 17 | 'crm_label' => 'Email', 18 | ); 19 | -------------------------------------------------------------------------------- /includes/crms/mailpoet/admin/mailpoet-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'first_name', 8 | ); 9 | 10 | $mailpoet_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'last_name', 13 | ); 14 | 15 | $mailpoet_fields['user_email'] = array( 16 | 'crm_label' => 'Email', 17 | 'crm_field' => 'email', 18 | ); 19 | -------------------------------------------------------------------------------- /includes/crms/dynamics-365/dynamics-365-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'firstname', 8 | ); 9 | 10 | $dynamics_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'lastname', 13 | ); 14 | 15 | $dynamics_fields['user_email'] = array( 16 | 'crm_label' => 'Email', 17 | 'crm_field' => 'emailaddress1', 18 | ); 19 | -------------------------------------------------------------------------------- /assets/js/wpf-bb-themer.js: -------------------------------------------------------------------------------- 1 | var addRuleType = BBLogic.api.addRuleType 2 | var __ = BBLogic.i18n.__ 3 | 4 | addRuleType( 'wp-fusion/user-tags', { 5 | label: __( 'User\'s CRM Tags' ), 6 | category: 'user', 7 | form: { 8 | operator: { 9 | type: 'operator', 10 | operators: [ 11 | 'contains', 12 | 'does_not_contain', 13 | ], 14 | }, 15 | compare: { 16 | type: 'select', 17 | route: 'wp-fusion/available-tags', 18 | }, 19 | }, 20 | } ); -------------------------------------------------------------------------------- /includes/admin/gutenberg/src/secure-block-inner-secure/js/icons.js: -------------------------------------------------------------------------------- 1 | const icons = {}; 2 | 3 | icons.lock = ( 4 | 11 | 12 | 13 | ); 14 | 15 | export default icons; 16 | -------------------------------------------------------------------------------- /includes/crms/emercury/emercury-fields.php: -------------------------------------------------------------------------------- 1 | 'Email', 6 | 'crm_field' => 'email', 7 | ); 8 | 9 | $emercury_fields['first_name'] = array( 10 | 'crm_label' => 'First Name', 11 | 'crm_field' => 'first_name', 12 | 'crm_field_2' => 'user_field_1', 13 | ); 14 | 15 | $emercury_fields['last_name'] = array( 16 | 'crm_label' => 'Last Name', 17 | 'crm_field' => 'last_name', 18 | 'crm_field_2' => 'user_field_2', 19 | ); 20 | -------------------------------------------------------------------------------- /includes/crms/bento/bento-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'first_name', 8 | ); 9 | 10 | $bento_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'last_name', 13 | ); 14 | 15 | $bento_fields['user_email'] = array( 16 | 'crm_label' => 'Email', 17 | 'crm_field' => 'email', 18 | ); 19 | 20 | $bento_fields['phone_number'] = array( 21 | 'crm_label' => 'Phone', 22 | 'crm_field' => 'phone', 23 | ); 24 | -------------------------------------------------------------------------------- /assets/js/wpf-admin-bar.js: -------------------------------------------------------------------------------- 1 | jQuery(document).ready(function($){ 2 | $(document).on("input propertychange paste change", '.wpf_search_preview_tag', function(e) { 3 | var value = $(this).val().toLowerCase(); 4 | var index = $(this).parent().index() + 1; 5 | var $li = $('#wp-admin-bar-wpf-default > li').slice(index); 6 | $li.hide(); 7 | $li.filter(function() { 8 | var text = $(this).text().toLowerCase(); 9 | return text.indexOf(value)>=0; 10 | }).show(); 11 | 12 | }); 13 | }); -------------------------------------------------------------------------------- /includes/crms/sendlane/sendlane-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'first_name', 8 | ); 9 | 10 | $sendlane_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'last_name', 13 | ); 14 | 15 | $sendlane_fields['user_email'] = array( 16 | 'crm_label' => 'Email', 17 | 'crm_field' => 'email', 18 | ); 19 | 20 | $sendlane_fields['billing_phone'] = array( 21 | 'crm_label' => 'Phone', 22 | 'crm_field' => 'phone', 23 | ); 24 | -------------------------------------------------------------------------------- /includes/crms/sendinblue/admin/sendinblue-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'FIRSTNAME', 8 | ); 9 | 10 | $sendinblue_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'LASTNAME', 13 | ); 14 | 15 | $sendinblue_fields['user_email'] = array( 16 | 'crm_label' => 'Email', 17 | 'crm_field' => 'email', 18 | ); 19 | 20 | $sendinblue_fields[] = array( 21 | 'crm_label' => 'WhatsApp', 22 | 'crm_field' => 'WHATSAPP', 23 | ); 24 | -------------------------------------------------------------------------------- /includes/crms/klick-tipp/admin/klick-tipp-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'fieldFirstName', 8 | ); 9 | 10 | $klicktipp_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'fieldLastName', 13 | ); 14 | 15 | $klicktipp_fields['user_email'] = array( 16 | 'crm_label' => 'Email', 17 | 'crm_field' => 'email', 18 | ); 19 | 20 | $klicktipp_fields['phone_number'] = array( 21 | 'crm_label' => 'Phone', 22 | 'crm_field' => 'fieldPhone', 23 | ); 24 | -------------------------------------------------------------------------------- /includes/crms/emailoctopus/admin/emailoctopus-fields.php: -------------------------------------------------------------------------------- 1 | 'Name', 7 | 'crm_field' => 'FirstName', 8 | ); 9 | 10 | $emailoctopus_fields['first_name'] = array( 11 | 'crm_label' => 'First Name', 12 | 'crm_field' => 'FirstName', 13 | ); 14 | 15 | $emailoctopus_fields['last_name'] = array( 16 | 'crm_label' => 'Last Name', 17 | 'crm_field' => 'LastName', 18 | ); 19 | 20 | $emailoctopus_fields['user_email'] = array( 21 | 'crm_label' => 'Email Address', 22 | 'crm_field' => 'email_address', 23 | ); 24 | -------------------------------------------------------------------------------- /includes/crms/activecampaign/includes/Auth.class.php: -------------------------------------------------------------------------------- 1 | version = $version; 12 | $this->url_base = $url_base; 13 | $this->url = $url; 14 | $this->api_key = $api_key; 15 | } 16 | 17 | function singlesignon( $params ) { 18 | $request_url = "{$this->url}&api_action=singlesignon&api_output={$this->output}&{$params}"; 19 | $response = $this->curl( $request_url ); 20 | 21 | return $response; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /includes/admin/gutenberg/src/secure-block-inner-unsecure/js/icons.js: -------------------------------------------------------------------------------- 1 | const icons = {}; 2 | 3 | icons.unlocked = ( 4 | 5 | 6 | 7 | ); 8 | 9 | export default icons; 10 | -------------------------------------------------------------------------------- /includes/crms/activecampaign/includes/Settings.class.php: -------------------------------------------------------------------------------- 1 | version = $version; 12 | $this->url_base = $url_base; 13 | $this->url = $url; 14 | $this->api_key = $api_key; 15 | } 16 | 17 | function edit( $params, $post_data ) { 18 | $request_url = "{$this->url}&api_action=settings_edit&api_output={$this->output}"; 19 | $response = $this->curl( $request_url, $post_data ); 20 | 21 | return $response; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /includes/crms/moosend/moosend-fields.php: -------------------------------------------------------------------------------- 1 | 'Name', 8 | 'crm_field' => 'name', 9 | ); 10 | 11 | $moosend_fields['first_name'] = array( 12 | 'crm_label' => 'First Name', 13 | 'crm_field' => 'firstname', 14 | ); 15 | 16 | $moosend_fields['last_name'] = array( 17 | 'crm_label' => 'Last Name', 18 | 'crm_field' => 'lastname', 19 | ); 20 | 21 | $moosend_fields[] = array( 22 | 'crm_label' => 'Name', 23 | 'crm_field' => 'name', 24 | ); 25 | 26 | $moosend_fields['user_email'] = array( 27 | 'crm_label' => 'Email', 28 | 'crm_field' => 'email', 29 | ); 30 | 31 | $moosend_fields['phone_number'] = array( 32 | 'crm_label' => 'Mobile', 33 | 'crm_field' => 'mobile', 34 | ); 35 | -------------------------------------------------------------------------------- /includes/admin/gutenberg/src/secure-block-inner-unsecure/scss/editor.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /** 4 | * Variables 5 | **/ 6 | $wp_fusion_color_primary: #6c2a22; 7 | $wp_fusion_color_gutenberg_grey: #f3f3f4; 8 | $wp_fusion_color_gutenberg_black: #32373c; 9 | 10 | /** 11 | * Default Styles 12 | * 13 | * The default styles for the block in the editor. 14 | */ 15 | .wp-block-wp-fusion-secure-block-inner-unsecure { 16 | 17 | &__handle { 18 | position: relative; 19 | background-color: $wp_fusion_color_gutenberg_grey; 20 | color: $wp_fusion_color_gutenberg_black; 21 | padding: 5px 20px 5px 10px; 22 | font-size: 12px; 23 | } 24 | 25 | &__icon { 26 | position: absolute !important; 27 | top: 8px; 28 | right: 8px; 29 | opacity: 0.8; 30 | margin-top: 0; 31 | margin-bottom: 0; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /includes/crms/sendfox/admin/sendfox-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'first_name', 8 | ); 9 | 10 | $sendfox_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'last_name', 13 | ); 14 | 15 | $sendfox_fields['user_email'] = array( 16 | 'crm_label' => 'Email', 17 | 'crm_field' => 'email', 18 | ); 19 | 20 | $sendfox_fields['billing_first_name'] = array( 21 | 'crm_label' => 'First Name', 22 | 'crm_field' => 'first_name', 23 | ); 24 | 25 | $sendfox_fields['billing_last_name'] = array( 26 | 'crm_label' => 'Last Name', 27 | 'crm_field' => 'last_name', 28 | ); 29 | 30 | $sendfox_fields['billing_email'] = array( 31 | 'crm_label' => 'Email', 32 | 'crm_field' => 'email', 33 | ); 34 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Deploy and Release Plugin 2 | on: 3 | push: 4 | tags: 5 | - "*" 6 | 7 | permissions: 8 | contents: write 9 | 10 | jobs: 11 | tag: 12 | name: New tag 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout code 16 | uses: actions/checkout@v2 17 | - name: WordPress Plugin Deploy 18 | id: deploy 19 | uses: 10up/action-wordpress-plugin-deploy@stable 20 | with: 21 | generate-zip: true 22 | env: 23 | SVN_USERNAME: ${{ secrets.SVN_USERNAME }} 24 | SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} 25 | - name: Create GitHub release 26 | uses: softprops/action-gh-release@v1 27 | with: 28 | files: ${{github.workspace}}/${{ github.event.repository.name }}.zip 29 | env: 30 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -------------------------------------------------------------------------------- /includes/crms/drift/admin/drift-fields.php: -------------------------------------------------------------------------------- 1 | 'first_name', 7 | ); 8 | 9 | $drift_fields['last_name'] = array( 10 | 'crm_field' => 'last_name', 11 | ); 12 | 13 | $drift_fields['user_email'] = array( 14 | 'crm_field' => 'email', 15 | ); 16 | 17 | $drift_fields['billing_city'] = array( 18 | 'crm_field' => 'city', 19 | ); 20 | 21 | $drift_fields['billing_state'] = array( 22 | 'crm_field' => 'state', 23 | ); 24 | 25 | $drift_fields['billing_postcode'] = array( 26 | 'crm_field' => 'postal_code', 27 | ); 28 | 29 | $drift_fields['billing_country'] = array( 30 | 'crm_field' => 'country', 31 | ); 32 | 33 | $drift_fields['phone_number'] = array( 34 | 'crm_field' => 'phone', 35 | ); 36 | 37 | $drift_fields['billing_phone'] = array( 38 | 'crm_field' => 'phone', 39 | ); 40 | -------------------------------------------------------------------------------- /includes/crms/activecampaign/includes/Design.class.php: -------------------------------------------------------------------------------- 1 | version = $version; 12 | $this->url_base = $url_base; 13 | $this->url = $url; 14 | $this->api_key = $api_key; 15 | } 16 | 17 | function edit( $params, $post_data ) { 18 | $request_url = "{$this->url}&api_action=branding_edit&api_output={$this->output}"; 19 | $response = $this->curl( $request_url, $post_data ); 20 | 21 | return $response; 22 | } 23 | 24 | function view( $params, $post_data ) { 25 | $request_url = "{$this->url}&api_action=branding_view&api_output={$this->output}"; 26 | $response = $this->curl( $request_url, $post_data ); 27 | 28 | return $response; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wp-fusion-lite", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "build": "wp-scripts build", 6 | "dev": "wp-scripts start", 7 | "lint:js": "wp-scripts lint-js", 8 | "lint:js:fix": "wp-scripts lint-js --fix" 9 | }, 10 | "dependencies": { 11 | "@codeamp/block-components": "0.0.1-beta.9", 12 | "@verygoodplugins/wpfselect": "^1.1.3" 13 | }, 14 | "devDependencies": { 15 | "@wordpress/api-fetch": "^7.16.0", 16 | "@wordpress/components": "^29.2.0", 17 | "@wordpress/compose": "^7.16.0", 18 | "@wordpress/element": "^6.16.0", 19 | "@wordpress/hooks": "^4.16.0", 20 | "@wordpress/i18n": "^4.47.0", 21 | "@wordpress/scripts": "^30.9.0", 22 | "classnames": "^2.5.1", 23 | "gulp": "^5.0.0", 24 | "gulp-replace": "^1.1.4", 25 | "lodash.assign": "^4.2.0" 26 | }, 27 | "engines": { 28 | "node": "20" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /includes/admin/options/README.md: -------------------------------------------------------------------------------- 1 | Options 2 | =========================== 3 | ###### for WordPress 4 | 5 | ### An options framework for your plugin or theme, without all the fuss. 6 | 7 | * Up and running in 30 lines of code or less 8 | * Lightweight: use only the fields you need 9 | * Extensible: create as many custom fields, page layouts, and validation functions as you need… all without modifying the core files 10 | * Modern: built on Bootstrap, Bootstrap Formhelpers, and Font Awesome. Fully supports the new MP6 WordPress admin styles 11 | * Excellent documentation 12 | 13 | See [options.mindsharelabs.com](http://options.mindsharelabs.com) for tutorials and documentation. 14 | 15 | ### v2.2 16 | * Suppressed PHP notices 17 | * Added support for overrides for specific fields 18 | * Updated select field to use Select2 library 19 | * Added multi-select field type 20 | * Made $options variable protected (instead of private) 21 | -------------------------------------------------------------------------------- /includes/crms/maropost/admin/maropost-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'first_name', 8 | ); 9 | 10 | $maropost_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'last_name', 13 | ); 14 | 15 | $maropost_fields['user_email'] = array( 16 | 'crm_label' => 'Email', 17 | 'crm_field' => 'email', 18 | ); 19 | 20 | $maropost_fields['phone_number'] = array( 21 | 'crm_label' => 'Phone', 22 | 'crm_field' => 'phone_number', 23 | ); 24 | 25 | $maropost_fields['billing_city'] = array( 26 | 'crm_label' => 'City', 27 | 'crm_field' => 'city', 28 | ); 29 | 30 | $maropost_fields['website'] = array( 31 | 'crm_label' => 'Website', 32 | 'crm_field' => 'website', 33 | ); 34 | 35 | $maropost_fields['billing_country'] = array( 36 | 'crm_label' => 'Country', 37 | 'crm_field' => 'country', 38 | ); 39 | -------------------------------------------------------------------------------- /includes/crms/userengage/admin/userengage-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'first_name', 8 | ); 9 | 10 | $userengage_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'last_name', 13 | ); 14 | 15 | $userengage_fields['user_email'] = array( 16 | 'crm_label' => 'Email', 17 | 'crm_field' => 'email', 18 | ); 19 | 20 | $userengage_fields['phone_number'] = array( 21 | 'crm_label' => 'Phone', 22 | 'crm_field' => 'phone_number', 23 | ); 24 | 25 | $userengage_fields['billing_city'] = array( 26 | 'crm_label' => 'City', 27 | 'crm_field' => 'city', 28 | ); 29 | 30 | $userengage_fields['website'] = array( 31 | 'crm_label' => 'Website', 32 | 'crm_field' => 'website', 33 | ); 34 | 35 | $userengage_fields['billing_country'] = array( 36 | 'crm_label' => 'Country', 37 | 'crm_field' => 'country', 38 | ); 39 | -------------------------------------------------------------------------------- /includes/crms/activecampaign/admin/activecampaign-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'first_name', 8 | ); 9 | 10 | $activecampaign_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'last_name', 13 | ); 14 | 15 | $activecampaign_fields['user_email'] = array( 16 | 'crm_label' => 'Email', 17 | 'crm_field' => 'email', 18 | ); 19 | 20 | $activecampaign_fields['phone_number'] = array( 21 | 'crm_label' => 'Phone', 22 | 'crm_field' => 'phone', 23 | ); 24 | 25 | $activecampaign_fields['billing_company'] = array( 26 | 'crm_label' => 'Account Name', 27 | 'crm_field' => 'orgname', 28 | ); 29 | 30 | // $activecampaign_fields[] = array( 31 | // 'crm_label' => 'Job Title', 32 | // 'crm_field' => 'jobtitle', 33 | // ); 34 | 35 | // Can't be updated over the API (https://testpublic.ideas.aha.io/ideas/AC-I-13844) 36 | -------------------------------------------------------------------------------- /includes/admin/gutenberg/src/secure-block/scss/editor.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /** 4 | * Variables 5 | **/ 6 | $wp_fusion_color_primary: #6c2a22; 7 | $wp_fusion_color_gutenberg_grey: #f3f3f4; 8 | $wp_fusion_color_gutenberg_black: #32373c; 9 | 10 | /** 11 | * Default Styles 12 | * 13 | * The default styles for the block in the editor. 14 | */ 15 | .wp-block-wp-fusion-secure-block { 16 | &__footer { 17 | background-color: $wp_fusion_color_gutenberg_grey; 18 | color: $wp_fusion_color_gutenberg_black; 19 | padding: 5px 10px 5px 10px; 20 | font-size: 12px; 21 | text-align: right; 22 | font-style: italic; 23 | } 24 | } 25 | 26 | /** 27 | * Inspector 28 | * 29 | * Styles for the secure block inspector 30 | */ 31 | .secure-block-inspector { 32 | label.secure-block-inspector__label { 33 | max-width: 100%; 34 | } 35 | 36 | .secure-block-inspector__control { 37 | width: 100%; 38 | 39 | > div > div { 40 | margin-top: 0px; 41 | } 42 | } 43 | 44 | .muted { 45 | opacity: .6; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /.cursor/rules/agent-workflow.mdc: -------------------------------------------------------------------------------- 1 | --- 2 | description: Description: High-level guidance for AI agents on how to prioritize rules and manage workflows. This is a meta-rule that helps organize the application of other rules. 3 | globs: 4 | alwaysApply: true 5 | --- 6 | # Agent Workflow Guidelines 7 | 8 | ## Priority Order 9 | 1. "TASK:" directives (see [task-directives.mdc](mdc:wp-fusion-lite/.cursor/rules/task-directives.mdc)) 10 | 2. Code generation requests (follow patterns in relevant rule files) 11 | 3. General inquiries (reference [instructions.md](mdc:wp-fusion-lite/instructions.md) ) 12 | 13 | ## Scratchpad Management 14 | Always maintain the scratchpad at [scratchpad.md](mdc:wp-fusion-lite/.cursor/scratchpad.md) for any non-trivial task. 15 | 16 | ## Documentation References 17 | - For WordPress standards: See [wordpress.mdc](mdc:wp-fusion-lite/.cursor/rules/wordpress.mdc) 18 | - For CRM integrations: See [crm-integration.mdc](mdc:wp-fusion-lite/.cursor/rules/crm-integration.mdc) 19 | - For core functionality: See [core.mdc](mdc:wp-fusion-lite/.cursor/rules/core.mdc) -------------------------------------------------------------------------------- /includes/crms/ortto/ortto-fields.php: -------------------------------------------------------------------------------- 1 | 'Name', 7 | 'crm_field' => 'str::first', 8 | ); 9 | 10 | $ortto_fields['first_name'] = array( 11 | 'crm_label' => 'First Name', 12 | 'crm_field' => 'str::first', 13 | ); 14 | 15 | $ortto_fields['last_name'] = array( 16 | 'crm_label' => 'Last Name', 17 | 'crm_field' => 'str::last', 18 | ); 19 | 20 | $ortto_fields['user_email'] = array( 21 | 'crm_label' => 'Email Address', 22 | 'crm_field' => 'str::email', 23 | ); 24 | 25 | 26 | $ortto_fields['phone_number'] = array( 27 | 'crm_label' => 'Phone number', 28 | 'crm_field' => 'phn::phone', 29 | ); 30 | 31 | 32 | $ortto_fields['billing_city'] = array( 33 | 'crm_label' => 'City', 34 | 'crm_field' => 'geo::city', 35 | ); 36 | 37 | $ortto_fields['billing_postcode'] = array( 38 | 'crm_label' => 'Postal Code', 39 | 'crm_field' => 'str::postal', 40 | ); 41 | 42 | $ortto_fields['billing_country'] = array( 43 | 'crm_label' => 'Country', 44 | 'crm_field' => 'geo::country', 45 | ); 46 | -------------------------------------------------------------------------------- /includes/crms/copper/admin/copper-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'first_name', 8 | ); 9 | 10 | $copper_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'last_name', 13 | ); 14 | 15 | $copper_fields['user_email'] = array( 16 | 'crm_label' => 'Email', 17 | 'crm_field' => 'email', 18 | ); 19 | 20 | $copper_fields['billing_address_1'] = array( 21 | 'crm_label' => 'Street Address', 22 | 'crm_field' => 'street', 23 | ); 24 | 25 | $copper_fields['billing_city'] = array( 26 | 'crm_label' => 'City', 27 | 'crm_field' => 'city', 28 | ); 29 | 30 | $copper_fields['billing_state'] = array( 31 | 'crm_label' => 'State', 32 | 'crm_field' => 'state', 33 | ); 34 | 35 | $copper_fields['billing_postcode'] = array( 36 | 'crm_label' => 'Postal Code', 37 | 'crm_field' => 'postal_code', 38 | ); 39 | 40 | $copper_fields['billing_country'] = array( 41 | 'crm_label' => 'Country', 42 | 'crm_field' => 'country', 43 | ); 44 | 45 | $copper_fields['billing_phone'] = array( 46 | 'crm_label' => 'Phone', 47 | 'crm_field' => 'number', 48 | ); 49 | -------------------------------------------------------------------------------- /includes/crms/growmatik/admin/growmatik-fields.php: -------------------------------------------------------------------------------- 1 | 'Email', 7 | 'crm_field' => 'email', 8 | ); 9 | 10 | $growmatik_fields['first_name'] = array( 11 | 'crm_label' => 'First Name', 12 | 'crm_field' => 'firstName', 13 | ); 14 | 15 | $growmatik_fields['last_name'] = array( 16 | 'crm_label' => 'Last Name', 17 | 'crm_field' => 'lastName', 18 | ); 19 | 20 | $growmatik_fields['billing_address_1'] = array( 21 | 'crm_label' => 'Address', 22 | 'crm_field' => 'address', 23 | ); 24 | 25 | $growmatik_fields['phone_number'] = array( 26 | 'crm_label' => 'Phone Number', 27 | 'crm_field' => 'phoneNumber', 28 | ); 29 | 30 | $growmatik_fields['billing_country'] = array( 31 | 'crm_label' => 'Country', 32 | 'crm_field' => 'country', 33 | ); 34 | 35 | $growmatik_fields['billing_state'] = array( 36 | 'crm_label' => 'State', 37 | 'crm_field' => 'region', 38 | ); 39 | 40 | $growmatik_fields['billing_city'] = array( 41 | 'crm_label' => 'City', 42 | 'crm_field' => 'city', 43 | ); 44 | 45 | $growmatik_fields[''] = array( 46 | 'crm_label' => 'Gender', 47 | 'crm_field' => 'gender', 48 | ); 49 | -------------------------------------------------------------------------------- /includes/crms/drip/includes/README.md: -------------------------------------------------------------------------------- 1 | # Drip API Wrapper - PHP 2 | 3 | An object-oriented PHP wrapper for Drip's REST API v2.0 4 | 5 | [![Build Status](https://travis-ci.org/DripEmail/drip-php.svg?branch=master)](https://travis-ci.org/DripEmail/drip-php) 6 | 7 | ## Installation 8 | 9 | Run `composer require dripemail/drip-php` 10 | 11 | ## Authentication 12 | 13 | For private integrations, you may use your personal API Token (found 14 | [here](https://www.getdrip.com/user/edit)) via the `api_key` setting: 15 | 16 | ```php 17 | $client = new \Drip\Client("YOUR_API_KEY", "YOUR_ACCOUNT_ID"); 18 | ``` 19 | 20 | For public integrations, pass in the user's OAuth token via the `access_token` 21 | setting: 22 | 23 | ```php 24 | $client = new \Drip\Client("YOUR_ACCESS_TOKEN", "YOUR_ACCOUNT_ID"); 25 | ``` 26 | 27 | Your account ID can be found [here](https://www.getdrip.com/settings/site). 28 | Most API actions require an account ID, with the exception of methods like 29 | the "list accounts" endpoint. 30 | 31 | 32 | ## PHP version support 33 | 34 | We attempt to support versions of PHP that are supported upstream: http://php.net/supported-versions.php 35 | 36 | For the actual supported list, see `.travis.yml`. -------------------------------------------------------------------------------- /assets/css/wpf-gforms.css: -------------------------------------------------------------------------------- 1 | #tab_wpfgforms .select4.select4-container { 2 | min-width: 400px; 3 | max-width: 400px; 4 | } 5 | 6 | #tab_wpfgforms .select4-container .select4-search--inline .select4-search__field { 7 | margin-top: 3px; 8 | } 9 | 10 | #tab_wpfgforms .select4-container .select4-selection { 11 | outline: none; 12 | } 13 | 14 | table.wpf-field-map th { 15 | padding-left: 0px !important; 16 | } 17 | 18 | table.wpf-field-map .select4-container { 19 | max-width: 300px; 20 | } 21 | 22 | table.wpf-field-map i.fa { 23 | padding: 0 20px; 24 | } 25 | 26 | #tab_wpfgforms .alert.danger { 27 | padding: 15px; 28 | border: 1px solid transparent; 29 | border-radius: 4px; 30 | background-color: #f2dede; 31 | border-color: #ebccd1; 32 | color: #b94a48; 33 | display: inline-block; 34 | } 35 | 36 | #tab_wpfgforms span.label { 37 | display: inline; 38 | padding: .2em .6em .3em; 39 | font-size: 75%; 40 | font-weight: bold; 41 | line-height: 1; 42 | color: #fff; 43 | text-align: center; 44 | white-space: nowrap; 45 | vertical-align: baseline; 46 | border-radius: .25em; 47 | } 48 | 49 | #tab_wpfgforms span.label.label-default { 50 | background-color: #999; 51 | } 52 | 53 | #tab_wpfgforms span.label.label-danger { 54 | background-color: #d9534f; 55 | } -------------------------------------------------------------------------------- /assets/css/wpf-admin-bar.css: -------------------------------------------------------------------------------- 1 | #wpadminbar .wpf-category-header:hover { 2 | background: rgba(255,255,255,0.1); 3 | } 4 | 5 | #wp-admin-bar-wpf > .ab-sub-wrapper { 6 | position: fixed !important; 7 | background: transparent !important; 8 | box-shadow: none !important; 9 | overflow-y: scroll; 10 | bottom: 0px; 11 | top: 32px; 12 | } 13 | 14 | #wp-admin-bar-wpf > .ab-sub-wrapper > ul { 15 | width: 250px; 16 | background: #32373c; 17 | -webkit-box-shadow: 0 3px 5px rgba(0,0,0,.2); 18 | box-shadow: 0 3px 5px rgba(0,0,0,.2); 19 | } 20 | 21 | #wp-admin-bar-wpf > .ab-sub-wrapper > ul > li > .ab-item { 22 | white-space: normal !important; 23 | height: auto !important; 24 | padding-top: 3px; 25 | padding-bottom: 3px; 26 | line-height: 22px !important; 27 | } 28 | #wp-admin-bar-wpf > .ab-sub-wrapper > ul input.wpf_search_preview_tag{ 29 | margin-left: 10px; 30 | padding: 0 10px; 31 | width: 200px; 32 | background: #33373b; 33 | border: 1px solid #666; 34 | margin-bottom: 5px; 35 | color: #fff; 36 | } 37 | 38 | #wp-admin-bar-wpf > .ab-sub-wrapper > ul input.wpf_search_preview_tag::placeholder { 39 | color: #fff 40 | } 41 | 42 | .wpf-visibility-hidden{ 43 | outline: 1px dashed #E55B10 !important; 44 | outline-offset: -1px; 45 | } -------------------------------------------------------------------------------- /includes/crms/pipedrive/pipedrive-fields.php: -------------------------------------------------------------------------------- 1 | 'Name', 7 | 'crm_field' => 'name', 8 | ); 9 | 10 | $pipedrive_fields['first_name'] = array( 11 | 'crm_label' => 'First Name', 12 | 'crm_field' => 'first_name', 13 | ); 14 | 15 | $pipedrive_fields['last_name'] = array( 16 | 'crm_label' => 'Last Name', 17 | 'crm_field' => 'last_name', 18 | ); 19 | 20 | $pipedrive_fields['user_email'] = array( 21 | 'crm_label' => 'Email (Work)', 22 | 'crm_field' => 'email+work', 23 | ); 24 | 25 | $pipedrive_fields[] = array( 26 | 'crm_label' => 'Email (Home)', 27 | 'crm_field' => 'email+home', 28 | ); 29 | 30 | $pipedrive_fields[] = array( 31 | 'crm_label' => 'Email (Other)', 32 | 'crm_field' => 'email+other', 33 | ); 34 | 35 | $pipedrive_fields['phone_number'] = array( 36 | 'crm_label' => 'Phone (Work)', 37 | 'crm_field' => 'phone+work', 38 | ); 39 | 40 | $pipedrive_fields[] = array( 41 | 'crm_label' => 'Phone (Home)', 42 | 'crm_field' => 'phone+home', 43 | ); 44 | 45 | $pipedrive_fields[] = array( 46 | 'crm_label' => 'Phone (Mobile)', 47 | 'crm_field' => 'phone+mobile', 48 | ); 49 | 50 | $pipedrive_fields[] = array( 51 | 'crm_label' => 'Phone (Other)', 52 | 'crm_field' => 'phone+other', 53 | ); 54 | -------------------------------------------------------------------------------- /includes/crms/intercom/admin/intercom-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'firstname', 8 | ); 9 | 10 | $intercom_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'lastname', 13 | ); 14 | 15 | $intercom_fields['user_email'] = array( 16 | 'crm_label' => 'Email', 17 | 'crm_field' => 'email', 18 | ); 19 | 20 | $intercom_fields['phone_number'] = array( 21 | 'crm_label' => 'Phone', 22 | 'crm_field' => 'phone', 23 | ); 24 | 25 | $intercom_fields[] = array( 26 | 'crm_label' => 'Owner ID', 27 | 'crm_field' => 'owner_id', 28 | ); 29 | 30 | $intercom_fields['utm_campaign'] = array( 31 | 'crm_label' => 'UTM Campaign', 32 | 'crm_field' => 'utm_campaign', 33 | ); 34 | 35 | $intercom_fields['utm_content'] = array( 36 | 'crm_label' => 'UTM Content', 37 | 'crm_field' => 'utm_content', 38 | ); 39 | 40 | $intercom_fields['utm_medium'] = array( 41 | 'crm_label' => 'UTM Medium', 42 | 'crm_field' => 'utm_medium', 43 | ); 44 | 45 | $intercom_fields['utm_source'] = array( 46 | 'crm_label' => 'UTM Source', 47 | 'crm_field' => 'utm_source', 48 | ); 49 | 50 | $intercom_fields['utm_term'] = array( 51 | 'crm_label' => 'UTM Term', 52 | 'crm_field' => 'utm_term', 53 | ); 54 | -------------------------------------------------------------------------------- /assets/js/wpf-apply-tags.js: -------------------------------------------------------------------------------- 1 | jQuery(document).ready(function($){ 2 | 3 | if(wpf_ajax.hasOwnProperty('delay')) { 4 | 5 | setTimeout(function() { 6 | 7 | if( wpf_ajax.hasOwnProperty( 'tags' ) ) { 8 | 9 | var data = { 10 | 'action' : 'apply_tags', 11 | 'tags' : wpf_ajax.tags, 12 | }; 13 | 14 | $.post(wpf_ajax.ajaxurl, data); 15 | 16 | } 17 | 18 | if( wpf_ajax.hasOwnProperty( 'remove' ) ) { 19 | 20 | var data = { 21 | 'action' : 'remove_tags', 22 | 'tags' : wpf_ajax.remove, 23 | }; 24 | 25 | $.post(wpf_ajax.ajaxurl, data); 26 | 27 | } 28 | 29 | }, wpf_ajax.delay); 30 | 31 | } 32 | 33 | $(document).on('mousedown', '[data-apply-tags]', function(e) { 34 | 35 | if( e.which <= 2 ) { 36 | 37 | var tags = $(this).attr('data-apply-tags'); 38 | 39 | var data = { 40 | 'action' : 'apply_tags', 41 | 'tags' : tags.split(','), 42 | }; 43 | 44 | $.post(wpf_ajax.ajaxurl, data); 45 | 46 | } 47 | }); 48 | 49 | $(document).on('mousedown', '[data-remove-tags]', function(e) { 50 | 51 | if( e.which <= 2 ) { 52 | 53 | var tags = $(this).attr('data-remove-tags'); 54 | 55 | var data = { 56 | 'action' : 'remove_tags', 57 | 'tags' : tags.split(','), 58 | }; 59 | 60 | $.post(wpf_ajax.ajaxurl, data); 61 | 62 | } 63 | }); 64 | 65 | }); -------------------------------------------------------------------------------- /includes/admin/gutenberg/src/secure-block-inner-secure/scss/editor.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /** 4 | * Variables 5 | **/ 6 | $wp_fusion_color_primary: #6c2a22; 7 | $wp_fusion_color_gutenberg_grey: #f3f3f4; 8 | $wp_fusion_color_gutenberg_black: #32373c; 9 | 10 | /** 11 | * Default Styles 12 | * 13 | * The default styles for the block frontend. 14 | */ 15 | 16 | .wp-block-wp-fusion-secure-block-inner-secure { 17 | &__handle { 18 | position: relative; 19 | background-color: $wp_fusion_color_gutenberg_grey; 20 | color: $wp_fusion_color_gutenberg_black; 21 | padding: 5px 30px 5px 10px; 22 | font-size: 12px; 23 | } 24 | 25 | &__tags { 26 | 27 | .tag:after { 28 | content: ", "; 29 | } 30 | .tag:last-of-type:after { 31 | content: ""; 32 | } 33 | .tag__name { 34 | font-family: monospace; 35 | background: white; 36 | padding: 2px 4px 2px 4px; 37 | opacity: .8; 38 | } 39 | } 40 | 41 | &__icon { 42 | position: absolute !important; 43 | top: 8px; 44 | right: 8px; 45 | opacity: 0.8; 46 | margin-top: 0; 47 | margin-bottom: 0; 48 | } 49 | 50 | &__description { 51 | display: block; 52 | margin-top: 0; 53 | margin-bottom: 0; 54 | strong { 55 | font-family: monospace; 56 | background: white; 57 | padding: 2px 4px 2px 4px; 58 | opacity: .8; 59 | font-weight: normal; 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /includes/crms/mailchimp/admin/mailchimp-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'FNAME', 8 | ); 9 | 10 | $mailchimp_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'LNAME', 13 | ); 14 | 15 | $mailchimp_fields['user_email'] = array( 16 | 'crm_label' => 'Email', 17 | 'crm_field' => 'email_address', 18 | ); 19 | 20 | $mailchimp_fields['phone_number'] = array( 21 | 'crm_label' => 'Phone', 22 | 'crm_field' => 'PHONE', 23 | ); 24 | 25 | $mailchimp_fields['billing_address_1'] = array( 26 | 'crm_label' => 'Address 1', 27 | 'crm_field' => 'ADDRESS+addr1', 28 | ); 29 | 30 | $mailchimp_fields['billing_address_2'] = array( 31 | 'crm_label' => 'Address 2', 32 | 'crm_field' => 'ADDRESS+addr2', 33 | ); 34 | 35 | $mailchimp_fields['billing_city'] = array( 36 | 'crm_label' => 'City', 37 | 'crm_field' => 'ADDRESS+city', 38 | ); 39 | 40 | $mailchimp_fields['billing_state'] = array( 41 | 'crm_label' => 'State', 42 | 'crm_field' => 'ADDRESS+state', 43 | ); 44 | 45 | $mailchimp_fields['billing_postcode'] = array( 46 | 'crm_label' => 'Zip', 47 | 'crm_field' => 'ADDRESS+zip', 48 | ); 49 | 50 | $mailchimp_fields['billing_country'] = array( 51 | 'crm_label' => 'Country', 52 | 'crm_field' => 'ADDRESS+country', 53 | ); 54 | -------------------------------------------------------------------------------- /includes/crms/zoho/admin/zoho-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'First_Name', 8 | ); 9 | 10 | $zoho_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'Last_Name', 13 | ); 14 | 15 | $zoho_fields['user_email'] = array( 16 | 'crm_label' => 'Email', 17 | 'crm_field' => 'Email', 18 | ); 19 | 20 | $zoho_fields['billing_address_1'] = array( 21 | 'crm_label' => 'Mailing Street', 22 | 'crm_field' => 'Mailing_Street', 23 | ); 24 | 25 | $zoho_fields['billing_city'] = array( 26 | 'crm_label' => 'Mailing City', 27 | 'crm_field' => 'Mailing_City', 28 | ); 29 | 30 | $zoho_fields['billing_state'] = array( 31 | 'crm_label' => 'Mailing State', 32 | 'crm_field' => 'Mailing_State', 33 | ); 34 | 35 | $zoho_fields['billing_postcode'] = array( 36 | 'crm_label' => 'Mailing Postal Code', 37 | 'crm_field' => 'Mailing_Zip', 38 | ); 39 | 40 | $zoho_fields['billing_country'] = array( 41 | 'crm_label' => 'Mailing Country', 42 | 'crm_field' => 'Mailing_Country', 43 | ); 44 | 45 | $zoho_fields['phone_number'] = array( 46 | 'crm_label' => 'Home Phone', 47 | 'crm_field' => 'Home_Phone', 48 | ); 49 | 50 | $zoho_fields['billing_phone'] = array( 51 | 'crm_label' => 'Home Phone', 52 | 'crm_field' => 'Home_Phone', 53 | ); 54 | 55 | $zoho_fields['gclid'] = array( 56 | 'crm_label' => 'GCLID', 57 | 'crm_field' => '$gclid', 58 | ); -------------------------------------------------------------------------------- /includes/crms/drip/admin/drip-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'first_name', 8 | ); 9 | 10 | $drip_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'last_name', 13 | ); 14 | 15 | $drip_fields['user_email'] = array( 16 | 'crm_label' => 'Email', 17 | 'crm_field' => 'email', 18 | ); 19 | 20 | $drip_fields['billing_address_1'] = array( 21 | 'crm_label' => 'Address 1', 22 | 'crm_field' => 'address1', 23 | ); 24 | 25 | $drip_fields['billing_address_2'] = array( 26 | 'crm_label' => 'Address 2', 27 | 'crm_field' => 'address2', 28 | ); 29 | 30 | $drip_fields['billing_city'] = array( 31 | 'crm_label' => 'City', 32 | 'crm_field' => 'city', 33 | ); 34 | 35 | $drip_fields['billing_state'] = array( 36 | 'crm_label' => 'State', 37 | 'crm_field' => 'state', 38 | ); 39 | 40 | $drip_fields['billing_postcode'] = array( 41 | 'crm_label' => 'Zip', 42 | 'crm_field' => 'zip', 43 | ); 44 | 45 | $drip_fields['billing_country'] = array( 46 | 'crm_label' => 'Country', 47 | 'crm_field' => 'country', 48 | ); 49 | 50 | $drip_fields['phone_number'] = array( 51 | 'crm_label' => 'Phone', 52 | 'crm_field' => 'phone', 53 | ); 54 | 55 | $drip_fields['billing_phone'] = array( 56 | 'crm_label' => 'Phone', 57 | 'crm_field' => 'phone', 58 | ); 59 | 60 | $drip_fields[] = array( 61 | 'crm_label' => 'Status', 62 | 'crm_field' => 'status', 63 | ); 64 | -------------------------------------------------------------------------------- /includes/admin/gutenberg/src/secure-block-inner-unsecure/js/index.js: -------------------------------------------------------------------------------- 1 | import { __ } from '@wordpress/i18n'; 2 | import { registerBlockType } from '@wordpress/blocks'; 3 | import { InnerBlocks, useBlockProps } from '@wordpress/block-editor'; 4 | import icons from './icons'; 5 | import '../scss/editor.scss'; 6 | 7 | const Edit = () => { 8 | const blockProps = useBlockProps(); 9 | 10 | const { className } = blockProps; 11 | 12 | return ( 13 |
14 |
15 | 16 | 17 | { __( 18 | 'Content shown if the conditions are not met.', 19 | 'secure-blocks-for-gutenberg' 20 | ) } 21 | 22 | 23 | 24 | { icons.unlocked } 25 | 26 |
27 | 28 | 32 |
33 | ); 34 | }; 35 | 36 | const Save = () => { 37 | const blockProps = useBlockProps.save(); 38 | 39 | return ( 40 |
41 | 42 |
43 | ); 44 | }; 45 | 46 | export default registerBlockType( 'wp-fusion/secure-block-inner-unsecure', { 47 | apiVersion: 3, 48 | title: __( 'Unsecure', 'secure-blocks-for-gutenberg' ), 49 | category: 'layout', 50 | attributes: {}, 51 | parent: [ 'wp-fusion/secure-block' ], 52 | edit: Edit, 53 | save: Save, 54 | } ); 55 | -------------------------------------------------------------------------------- /includes/crms/loopify/admin/loopify-fields.php: -------------------------------------------------------------------------------- 1 | 'firstName', 7 | 'crm_label' => 'First Name', 8 | ); 9 | 10 | $loopify_fields['last_name'] = array( 11 | 'crm_field' => 'lastName', 12 | 'crm_label' => 'Last Name', 13 | ); 14 | 15 | $loopify_fields['user_email'] = array( 16 | 'crm_field' => 'email', 17 | 'crm_label' => 'Email', 18 | ); 19 | 20 | $loopify_fields['user_id'] = array( 21 | 'crm_field' => 'externalId', 22 | 'crm_label' => 'User ID', 23 | ); 24 | 25 | $loopify_fields['billing_phone'] = array( 26 | 'crm_field' => 'mobile', 27 | 'crm_label' => 'Mobile Phone', 28 | ); 29 | 30 | $loopify_fields[] = array( 31 | 'crm_field' => 'title', 32 | 'crm_label' => 'Title', 33 | ); 34 | 35 | $loopify_fields['billing_company'] = array( 36 | 'crm_field' => 'companyName', 37 | 'crm_label' => 'Company Name', 38 | ); 39 | 40 | $loopify_fields['billing_address_1'] = array( 41 | 'crm_field' => 'address', 42 | 'crm_label' => 'Address', 43 | ); 44 | 45 | $loopify_fields['billing_postcode'] = array( 46 | 'crm_field' => 'zip', 47 | 'crm_label' => 'Postcode', 48 | ); 49 | 50 | $loopify_fields['billing_city'] = array( 51 | 'crm_field' => 'city', 52 | 'crm_label' => 'City', 53 | ); 54 | 55 | $loopify_fields['billing_state'] = array( 56 | 'crm_field' => 'state', 57 | 'crm_label' => 'State', 58 | ); 59 | 60 | $loopify_fields['billing_country'] = array( 61 | 'crm_field' => 'country', 62 | 'crm_label' => 'Country', 63 | ); 64 | -------------------------------------------------------------------------------- /includes/crms/hubspot/admin/hubspot-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'firstname', 8 | ); 9 | 10 | $hubspot_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'lastname', 13 | ); 14 | 15 | $hubspot_fields['user_email'] = array( 16 | 'crm_label' => 'Email', 17 | 'crm_field' => 'email', 18 | ); 19 | 20 | $hubspot_fields['billing_address_1'] = array( 21 | 'crm_label' => 'Address', 22 | 'crm_field' => 'address', 23 | ); 24 | 25 | $hubspot_fields['billing_city'] = array( 26 | 'crm_label' => 'City', 27 | 'crm_field' => 'city', 28 | ); 29 | 30 | $hubspot_fields['billing_state'] = array( 31 | 'crm_label' => 'Mailing State', 32 | 'crm_field' => 'Mailing_State', 33 | ); 34 | 35 | $hubspot_fields['billing_postcode'] = array( 36 | 'crm_label' => 'Postal Code', 37 | 'crm_field' => 'zip', 38 | ); 39 | 40 | $hubspot_fields['billing_country'] = array( 41 | 'crm_label' => 'Country', 42 | 'crm_field' => 'country', 43 | ); 44 | 45 | $hubspot_fields['phone_number'] = array( 46 | 'crm_label' => 'Phone', 47 | 'crm_field' => 'phone', 48 | ); 49 | 50 | $hubspot_fields['billing_phone'] = array( 51 | 'crm_label' => 'Phone', 52 | 'crm_field' => 'phone', 53 | ); 54 | 55 | $hubspot_fields['billing_company'] = array( 56 | 'crm_label' => 'Company', 57 | 'crm_field' => 'company', 58 | ); 59 | 60 | $hubspot_fields['user_url'] = array( 61 | 'crm_label' => 'Website', 62 | 'crm_field' => 'website', 63 | ); 64 | -------------------------------------------------------------------------------- /includes/crms/wp-erp/admin/wp-erp-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'first_name', 8 | ); 9 | 10 | $fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'last_name', 13 | ); 14 | 15 | $fields['user_email'] = array( 16 | 'crm_label' => 'Email', 17 | 'crm_field' => 'email', 18 | ); 19 | 20 | $fields['phone_number'] = array( 21 | 'crm_label' => 'Home Phone', 22 | 'crm_field' => 'phone', 23 | ); 24 | 25 | $fields['billing_company'] = array( 26 | 'crm_label' => 'Company', 27 | 'crm_field' => 'company', 28 | ); 29 | 30 | $fields['billing_address_1'] = array( 31 | 'crm_label' => 'Address 1', 32 | 'crm_field' => 'street_1', 33 | ); 34 | 35 | $fields['billing_address_2'] = array( 36 | 'crm_label' => 'Address 2', 37 | 'crm_field' => 'street_2', 38 | ); 39 | 40 | $fields['billing_city'] = array( 41 | 'crm_label' => 'City', 42 | 'crm_field' => 'city', 43 | ); 44 | 45 | $fields['billing_state'] = array( 46 | 'crm_label' => 'State', 47 | 'crm_field' => 'state', 48 | ); 49 | 50 | $fields['billing_postcode'] = array( 51 | 'crm_label' => 'Postcode', 52 | 'crm_field' => 'postal_code', 53 | ); 54 | 55 | $fields['billing_country'] = array( 56 | 'crm_label' => 'Country', 57 | 'crm_field' => 'country', 58 | ); 59 | 60 | $fields['billing_country'] = array( 61 | 'crm_label' => 'Country', 62 | 'crm_field' => 'country', 63 | ); 64 | 65 | $fields['user_url'] = array( 66 | 'crm_label' => 'Website', 67 | 'crm_field' => 'website', 68 | ); 69 | -------------------------------------------------------------------------------- /includes/crms/mailerlite/admin/mailerlite-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'name', 8 | ); 9 | 10 | $mailerlite_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'last_name', 13 | ); 14 | 15 | $mailerlite_fields['user_email'] = array( 16 | 'crm_label' => 'Email', 17 | 'crm_field' => 'email', 18 | ); 19 | 20 | $mailerlite_fields['phone_number'] = array( 21 | 'crm_label' => 'Phone Number', 22 | 'crm_field' => 'phone', 23 | ); 24 | 25 | $mailerlite_fields['billing_company'] = array( 26 | 'crm_label' => 'Company', 27 | 'crm_field' => 'company', 28 | ); 29 | 30 | $mailerlite_fields['billing_city'] = array( 31 | 'crm_label' => 'City', 32 | 'crm_field' => 'city', 33 | ); 34 | 35 | $mailerlite_fields['billing_state'] = array( 36 | 'crm_label' => 'State', 37 | 'crm_field' => 'state', 38 | ); 39 | 40 | $mailerlite_fields['billing_country'] = array( 41 | 'crm_label' => 'Country', 42 | 'crm_field' => 'country', 43 | ); 44 | 45 | $mailerlite_fields['billing_postcode'] = array( 46 | 'crm_label' => 'Zip', 47 | 'crm_field' => 'zip', 48 | ); 49 | 50 | $mailerlite_fields['email_optin'] = array( 51 | 'crm_label' => 'Optin Status', 52 | 'crm_field' => 'type', 53 | ); 54 | 55 | $mailerlite_fields['edd_email_optin'] = array( 56 | 'crm_label' => 'Optin Status', 57 | 'crm_field' => 'type', 58 | ); 59 | 60 | $mailerlite_fields['give_email_optin'] = array( 61 | 'crm_label' => 'Optin Status', 62 | 'crm_field' => 'type', 63 | ); 64 | -------------------------------------------------------------------------------- /includes/crms/salesforce/admin/salesforce-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'FirstName', 8 | ); 9 | 10 | $salesforce_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'LastName', 13 | ); 14 | 15 | $salesforce_fields['user_email'] = array( 16 | 'crm_label' => 'Email', 17 | 'crm_field' => 'Email', 18 | ); 19 | 20 | $salesforce_fields['phone_number'] = array( 21 | 'crm_label' => 'Phone', 22 | 'crm_field' => 'HomePhone', 23 | ); 24 | 25 | $salesforce_fields['billing_address_1'] = array( 26 | 'crm_label' => 'Street Address', 27 | 'crm_field' => 'MailingStreet', 28 | ); 29 | 30 | $salesforce_fields['billing_city'] = array( 31 | 'crm_label' => 'City', 32 | 'crm_field' => 'MailingCity', 33 | ); 34 | 35 | $salesforce_fields['billing_state'] = array( 36 | 'crm_label' => 'State', 37 | 'crm_field' => 'MailingState', 38 | ); 39 | 40 | $salesforce_fields['billing_postcode'] = array( 41 | 'crm_label' => 'Postal Code', 42 | 'crm_field' => 'MailingPostalCode', 43 | ); 44 | 45 | $salesforce_fields['company'] = array( 46 | 'crm_label' => 'Company', 47 | 'crm_field' => 'company', 48 | ); 49 | 50 | $salesforce_fields['website'] = array( 51 | 'crm_label' => 'Website', 52 | 'crm_field' => 'website', 53 | ); 54 | 55 | $salesforce_fields['user_url'] = array( 56 | 'crm_label' => 'Website', 57 | 'crm_field' => 'website', 58 | ); 59 | 60 | $salesforce_fields['billing_country'] = array( 61 | 'crm_label' => 'Country', 62 | 'crm_field' => 'MailingCountry', 63 | ); 64 | -------------------------------------------------------------------------------- /includes/crms/mautic/includes/states.php: -------------------------------------------------------------------------------- 1 | 'Alabama', 14 | 'AK' => 'Alaska', 15 | 'AZ' => 'Arizona', 16 | 'AR' => 'Arkansas', 17 | 'CA' => 'California', 18 | 'CO' => 'Colorado', 19 | 'CT' => 'Connecticut', 20 | 'DE' => 'Delaware', 21 | 'DC' => 'District Of Columbia', 22 | 'FL' => 'Florida', 23 | 'GA' => 'Georgia', 24 | 'HI' => 'Hawaii', 25 | 'ID' => 'Idaho', 26 | 'IL' => 'Illinois', 27 | 'IN' => 'Indiana', 28 | 'IA' => 'Iowa', 29 | 'KS' => 'Kansas', 30 | 'KY' => 'Kentucky', 31 | 'LA' => 'Louisiana', 32 | 'ME' => 'Maine', 33 | 'MD' => 'Maryland', 34 | 'MA' => 'Massachusetts', 35 | 'MI' => 'Michigan', 36 | 'MN' => 'Minnesota', 37 | 'MS' => 'Mississippi', 38 | 'MO' => 'Missouri', 39 | 'MT' => 'Montana', 40 | 'NE' => 'Nebraska', 41 | 'NV' => 'Nevada', 42 | 'NH' => 'New Hampshire', 43 | 'NJ' => 'New Jersey', 44 | 'NM' => 'New Mexico', 45 | 'NY' => 'New York', 46 | 'NC' => 'North Carolina', 47 | 'ND' => 'North Dakota', 48 | 'OH' => 'Ohio', 49 | 'OK' => 'Oklahoma', 50 | 'OR' => 'Oregon', 51 | 'PA' => 'Pennsylvania', 52 | 'RI' => 'Rhode Island', 53 | 'SC' => 'South Carolina', 54 | 'SD' => 'South Dakota', 55 | 'TN' => 'Tennessee', 56 | 'TX' => 'Texas', 57 | 'UT' => 'Utah', 58 | 'VT' => 'Vermont', 59 | 'VA' => 'Virginia', 60 | 'WA' => 'Washington', 61 | 'WV' => 'West Virginia', 62 | 'WI' => 'Wisconsin', 63 | 'WY' => 'Wyoming', 64 | 'AA' => 'Armed Forces (AA)', 65 | 'AE' => 'Armed Forces (AE)', 66 | 'AP' => 'Armed Forces (AP)', 67 | ); 68 | -------------------------------------------------------------------------------- /includes/crms/ontraport/admin/ontraport-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'firstname', 8 | ); 9 | 10 | $ontraport_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'lastname', 13 | ); 14 | 15 | $ontraport_fields['user_email'] = array( 16 | 'crm_label' => 'Email', 17 | 'crm_field' => 'email', 18 | ); 19 | 20 | $ontraport_fields['phone_number'] = array( 21 | 'crm_label' => 'Phone', 22 | 'crm_field' => 'office_phone', 23 | ); 24 | 25 | $ontraport_fields['billing_address_1'] = array( 26 | 'crm_label' => 'Address 1', 27 | 'crm_field' => 'address', 28 | ); 29 | 30 | $ontraport_fields['billing_address_2'] = array( 31 | 'crm_label' => 'Address 2', 32 | 'crm_field' => 'address2', 33 | ); 34 | 35 | $ontraport_fields['billing_city'] = array( 36 | 'crm_label' => 'City', 37 | 'crm_field' => 'city', 38 | ); 39 | 40 | $ontraport_fields['billing_state'] = array( 41 | 'crm_label' => 'City', 42 | 'crm_field' => 'city', 43 | ); 44 | 45 | $ontraport_fields['billing_postcode'] = array( 46 | 'crm_label' => 'Zip', 47 | 'crm_field' => 'zip', 48 | ); 49 | 50 | $ontraport_fields['company'] = array( 51 | 'crm_label' => 'Company', 52 | 'crm_field' => 'company', 53 | ); 54 | 55 | $ontraport_fields['website'] = array( 56 | 'crm_label' => 'Website', 57 | 'crm_field' => 'website', 58 | ); 59 | 60 | $ontraport_fields['user_url'] = array( 61 | 'crm_label' => 'Website', 62 | 'crm_field' => 'website', 63 | ); 64 | 65 | $ontraport_fields['billing_country'] = array( 66 | 'crm_label' => 'Country', 67 | 'crm_field' => 'country', 68 | ); 69 | -------------------------------------------------------------------------------- /includes/crms/klaviyo/admin/klaviyo-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'first_name', 8 | ); 9 | 10 | $klaviyo_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'last_name', 13 | ); 14 | 15 | $klaviyo_fields['user_email'] = array( 16 | 'crm_label' => 'Email', 17 | 'crm_field' => '$email', 18 | ); 19 | 20 | $klaviyo_fields['phone_number'] = array( 21 | 'crm_label' => 'Phone Number', 22 | 'crm_field' => '$phone_number', 23 | ); 24 | 25 | $klaviyo_fields[] = array( 26 | 'crm_label' => 'Title', 27 | 'crm_field' => '$title', 28 | ); 29 | 30 | $klaviyo_fields[] = array( 31 | 'crm_label' => 'Organization', 32 | 'crm_field' => '$organization', 33 | ); 34 | 35 | $klaviyo_fields['billing_address_1'] = array( 36 | 'crm_label' => 'Billing Address 1', 37 | 'crm_field' => 'location+address1', 38 | ); 39 | 40 | $klaviyo_fields['billing_address_2'] = array( 41 | 'crm_label' => 'Billing Address 2', 42 | 'crm_field' => 'location+address2', 43 | ); 44 | 45 | $klaviyo_fields['billing_city'] = array( 46 | 'crm_label' => 'City', 47 | 'crm_field' => 'location+city', 48 | ); 49 | 50 | $klaviyo_fields['billing_state'] = array( 51 | 'crm_label' => 'Region', 52 | 'crm_field' => 'location+region', 53 | ); 54 | 55 | $klaviyo_fields['billing_country'] = array( 56 | 'crm_label' => 'Country', 57 | 'crm_field' => 'location+country', 58 | ); 59 | 60 | $klaviyo_fields['billing_postcode'] = array( 61 | 'crm_label' => 'Zip', 62 | 'crm_field' => 'location+zip', 63 | ); 64 | 65 | $klaviyo_fields[] = array( 66 | 'crm_label' => 'Time Zone', 67 | 'crm_field' => 'location+timezone', 68 | ); 69 | -------------------------------------------------------------------------------- /assets/js/wpf-async-checkout.js: -------------------------------------------------------------------------------- 1 | jQuery(document).ready(function($) { 2 | 3 | var sent = false; 4 | 5 | // console.log( 'WPF DEBUG: Async checkout script loaded.' ); 6 | 7 | var handleAsyncOrder = function ( event, request, settings ) { 8 | 9 | // console.log( 'WPF DEBUG: handleAsyncOrder running with request:' ); 10 | // console.log( JSON.stringify( request ) ); 11 | 12 | $( document ).unbind( 'ajaxSuccess', handleAsyncOrder ); 13 | 14 | if ( request.responseJSON && 'success' == request.responseJSON.result && false == sent ) { 15 | 16 | sent = true; 17 | 18 | var data = { 19 | 'action' : 'wpf_async_woocommerce_checkout', 20 | 'order_id' : request.responseJSON.order_id 21 | }; 22 | 23 | $.post( wpf_async.ajaxurl, data ); 24 | 25 | } 26 | } 27 | 28 | $('form.checkout').on( 'checkout_place_order', function( e ) { 29 | 30 | // console.log( 'WPF DEBUG: Binding to ajaxsuccess.' ); 31 | 32 | $( document ).on( 'ajaxSuccess', handleAsyncOrder ); 33 | }); 34 | 35 | // This is a fallback for cases where it got missed on placing the order, we'll send the data again on the order received page. 36 | 37 | // pendingOrderID will be set by enqueue_async_checkout_script() in WPF_WooCommerce if we've reached the Order Received page 38 | // and the order hasn't yet been processed by WP Fusion. 39 | 40 | if ( typeof wpf_async.pendingOrderID !== 'undefined' ) { 41 | 42 | // console.log('WPF DEBUG: not undefined! proceed'); 43 | 44 | sent = true; 45 | 46 | var data = { 47 | 'action' : 'wpf_async_woocommerce_checkout', 48 | 'order_id' : wpf_async.pendingOrderID, 49 | }; 50 | 51 | // console.dir( data ); 52 | 53 | $.post( wpf_async.ajaxurl, data ); 54 | 55 | } 56 | 57 | }); -------------------------------------------------------------------------------- /assets/js/wpfgutenberg.build.js: -------------------------------------------------------------------------------- 1 | !function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(1)},function(e,t,n){"use strict";function r(e){return e.attributes=u(e.attributes,{scheduledStart:{type:"string"}}),e}function o(e,t,n){return e.scheduledStart=n.scheduledStart,e}var l=lodash,u=l.assign,c=wp.i18n.__,a=wp.element.Fragment,i=wp.hooks.addFilter,d=wp.components,s=d.TextControl,p=d.PanelBody,m=wp.compose.createHigherOrderComponent,f=wp.editor.InspectorControls;i("blocks.registerBlockType","my-plugin/add-attr",r),i("blocks.getSaveContent.extraProps","my-plugin/add-props",o),i("editor.BlockEdit","my-plugin/my-control",m(function(e){return function(t){return t.isSelected?wp.element.createElement(a,null,wp.element.createElement(e,t),wp.element.createElement(f,null,wp.element.createElement(p,{title:c("WP Fusion")},wp.element.createElement(ToggleControl,{label:"Fixed Background",help:hasFixedBackground?"Has fixed background.":"No fixed background.",checked:hasFixedBackground,onChange:function(){return setState(function(e){return{hasFixedBackground:!e.hasFixedBackground}})}}),wp.element.createElement(s,{label:c("I done it"),help:c("Some help text for my custom control."),value:t.attributes.scheduledStart||"",onChange:function(e){t.setAttributes({scheduledStart:e})}})))):wp.element.createElement(e,t)}},"addMyCustomBlockControls"))}]); -------------------------------------------------------------------------------- /includes/crms/activecampaign/includes/Automation.class.php: -------------------------------------------------------------------------------- 1 | version = $version; 12 | $this->url_base = $url_base; 13 | $this->url = $url; 14 | $this->api_key = $api_key; 15 | } 16 | 17 | function list_( $params ) { 18 | $request_url = "{$this->url}&api_action=automation_list&api_output={$this->output}&{$params}"; 19 | $response = $this->curl( $request_url ); 20 | 21 | return $response; 22 | } 23 | 24 | function contact_add( $params, $post_data ) { 25 | $request_url = "{$this->url}&api_action=automation_contact_add&api_output={$this->output}"; 26 | if ( $params ) { 27 | $request_url .= "&{$params}"; 28 | } 29 | $response = $this->curl( $request_url, $post_data ); 30 | 31 | return $response; 32 | } 33 | 34 | function contact_remove( $params, $post_data ) { 35 | $request_url = "{$this->url}&api_action=automation_contact_remove&api_output={$this->output}"; 36 | if ( $params ) { 37 | $request_url .= "&{$params}"; 38 | } 39 | $response = $this->curl( $request_url, $post_data ); 40 | 41 | return $response; 42 | } 43 | 44 | function contact_list( $params ) { 45 | $request_url = "{$this->url}&api_action=automation_contact_list&api_output={$this->output}&{$params}"; 46 | $response = $this->curl( $request_url ); 47 | 48 | return $response; 49 | } 50 | 51 | function contact_view( $params ) { 52 | $request_url = "{$this->url}&api_action=automation_contact_view&api_output={$this->output}&{$params}"; 53 | $response = $this->curl( $request_url ); 54 | 55 | return $response; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /includes/crms/activecampaign/includes/Group.class.php: -------------------------------------------------------------------------------- 1 | version = $version; 12 | $this->url_base = $url_base; 13 | $this->url = $url; 14 | $this->api_key = $api_key; 15 | } 16 | 17 | function add( $params, $post_data ) { 18 | $request_url = "{$this->url}&api_action=group_add&api_output={$this->output}"; 19 | $response = $this->curl( $request_url, $post_data ); 20 | 21 | return $response; 22 | } 23 | 24 | function delete_list( $params ) { 25 | $request_url = "{$this->url}&api_action=group_delete_list&api_output={$this->output}&{$params}"; 26 | $response = $this->curl( $request_url ); 27 | 28 | return $response; 29 | } 30 | 31 | function delete( $params ) { 32 | $request_url = "{$this->url}&api_action=group_delete&api_output={$this->output}&{$params}"; 33 | $response = $this->curl( $request_url ); 34 | 35 | return $response; 36 | } 37 | 38 | function edit( $params, $post_data ) { 39 | $request_url = "{$this->url}&api_action=group_edit&api_output={$this->output}"; 40 | $response = $this->curl( $request_url, $post_data ); 41 | 42 | return $response; 43 | } 44 | 45 | function list_( $params ) { 46 | $request_url = "{$this->url}&api_action=group_list&api_output={$this->output}&{$params}"; 47 | $response = $this->curl( $request_url ); 48 | 49 | return $response; 50 | } 51 | 52 | function view( $params ) { 53 | $request_url = "{$this->url}&api_action=group_view&api_output={$this->output}&{$params}"; 54 | $response = $this->curl( $request_url ); 55 | 56 | return $response; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /includes/crms/platformly/admin/platformly-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'first_name', 8 | ); 9 | 10 | $platformly_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'last_name', 13 | ); 14 | 15 | $platformly_fields['user_email'] = array( 16 | 'crm_label' => 'Email', 17 | 'crm_field' => 'email', 18 | ); 19 | 20 | $platformly_fields['phone_number'] = array( 21 | 'crm_label' => 'Phone', 22 | 'crm_field' => 'phone', 23 | ); 24 | 25 | $platformly_fields['billing_address_1'] = array( 26 | 'crm_label' => 'Address 1', 27 | 'crm_field' => 'address', 28 | ); 29 | 30 | $platformly_fields['billing_address_2'] = array( 31 | 'crm_label' => 'Address 2', 32 | 'crm_field' => 'address2', 33 | ); 34 | 35 | $platformly_fields['billing_city'] = array( 36 | 'crm_label' => 'City', 37 | 'crm_field' => 'city', 38 | ); 39 | 40 | $platformly_fields['billing_state'] = array( 41 | 'crm_label' => 'State', 42 | 'crm_field' => 'state', 43 | ); 44 | 45 | $platformly_fields['billing_postcode'] = array( 46 | 'crm_label' => 'Zip', 47 | 'crm_field' => 'zip', 48 | ); 49 | 50 | $platformly_fields['billing_country'] = array( 51 | 'crm_label' => 'Country', 52 | 'crm_field' => 'country', 53 | ); 54 | 55 | $platformly_fields['company'] = array( 56 | 'crm_label' => 'Company', 57 | 'crm_field' => 'company', 58 | ); 59 | 60 | $platformly_fields['website'] = array( 61 | 'crm_label' => 'Website', 62 | 'crm_field' => 'website', 63 | ); 64 | 65 | $platformly_fields['user_url'] = array( 66 | 'crm_label' => 'Website', 67 | 'crm_field' => 'website', 68 | ); 69 | 70 | $platformly_fields['billing_country'] = array( 71 | 'crm_label' => 'Country', 72 | 'crm_field' => 'country', 73 | ); 74 | -------------------------------------------------------------------------------- /assets/js/wpf-thrive-api-connection.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This contains functionality that allows the tags and form settings to show in the Thrive Architect editor in the Lead Generation API settings. 3 | */ 4 | 5 | if ( typeof TVE !== 'undefined' ) { 6 | /* if you re-use this for another API, everything should still work :) */ 7 | const WPF_API_KEY = wpf_thrive_api.api_key, 8 | $mainEditorContainer = TVE.$( TVE.main ); 9 | 10 | /** 11 | * In order to add the API Tag functionality, we must add the tag controls to the API controls template. 12 | * Same thing for adding the Forms selector. 13 | * @param {jQuery} $template 14 | * @param {String} apiKey 15 | * @param {Object} model 16 | */ 17 | TVE.add_action( 'tcb.lead_generation.api_settings_template', ( $template, apiKey, model ) => { 18 | if ( apiKey === WPF_API_KEY ) { 19 | /* Functionality for tags */ 20 | $template.append( TVE.tpl( 'lead-generation/apis/default-tag-controls' )( {api: model} ) ); 21 | } 22 | } ); 23 | 24 | 25 | /** 26 | * Functionality for tags and forms. 27 | * When the API settings are saved, also save the selected tags and the selected form. 28 | */ 29 | $mainEditorContainer.on( `tve-api-options-${WPF_API_KEY}.tcb`, ( event, params ) => { 30 | /* 'get_inputs_value' is a Thrive Architect function that reads the selected values */ 31 | params.api.setConfig( TVE.get_inputs_value( params.$container, '.tve-api-extra' ) ); 32 | } ); 33 | 34 | /** 35 | * Adds the clever-reach logo in the Thrive Architect API list 36 | * @param {String} logo 37 | * @param {String} apiKey 38 | * @returns {String} logo 39 | */ 40 | TVE.add_filter( 'tcb.lead_generation.api_logo', ( logo, apiKey ) => { 41 | 42 | if ( apiKey === WPF_API_KEY ) { 43 | logo = wpf_thrive_api.api_logo; 44 | } 45 | 46 | return logo; 47 | } ); 48 | } 49 | -------------------------------------------------------------------------------- /includes/crms/quentn/admin/quentn-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'first_name', 8 | ); 9 | 10 | $quentn_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'family_name', 13 | ); 14 | 15 | $quentn_fields['user_email'] = array( 16 | 'crm_label' => 'Email', 17 | 'crm_field' => 'mail', 18 | ); 19 | 20 | $quentn_fields['billing_first_name'] = array( 21 | 'crm_label' => 'First Name', 22 | 'crm_field' => 'first_name', 23 | ); 24 | 25 | $quentn_fields['billing_last_name'] = array( 26 | 'crm_label' => 'Last Name', 27 | 'crm_field' => 'family_name', 28 | ); 29 | 30 | $quentn_fields['billing_email'] = array( 31 | 'crm_label' => 'Email', 32 | 'crm_field' => 'mail', 33 | ); 34 | 35 | $quentn_fields['billing_company'] = array( 36 | 'crm_label' => 'Company', 37 | 'crm_field' => 'company', 38 | ); 39 | 40 | $quentn_fields['billing_phone'] = array( 41 | 'crm_label' => 'Phone', 42 | 'crm_field' => 'phone', 43 | ); 44 | 45 | $quentn_fields['billing_address_1'] = array( 46 | 'crm_label' => 'Billing Address 1', 47 | 'crm_field' => 'ba_street', 48 | ); 49 | 50 | $quentn_fields['billing_address_2'] = array( 51 | 'crm_label' => 'Billing Address 2', 52 | 'crm_field' => 'ba_street2', 53 | ); 54 | 55 | $quentn_fields['billing_city'] = array( 56 | 'crm_label' => 'Billing City', 57 | 'crm_field' => 'ba_city', 58 | ); 59 | 60 | $quentn_fields['billing_postcode'] = array( 61 | 'crm_label' => 'Billing Postcode', 62 | 'crm_field' => 'ba_postal_code', 63 | ); 64 | 65 | $quentn_fields['billing_state'] = array( 66 | 'crm_label' => 'Billing State', 67 | 'crm_field' => 'ba_state', 68 | ); 69 | 70 | $quentn_fields['billing_country'] = array( 71 | 'crm_label' => 'Billing Country', 72 | 'crm_field' => 'ba_country', 73 | ); 74 | 75 | $quentn_fields[] = array( 76 | 'crm_label' => 'Date of Birth', 77 | 'crm_field' => 'date_of_birth', 78 | ); 79 | -------------------------------------------------------------------------------- /includes/crms/highlevel/admin/highlevel-fields.php: -------------------------------------------------------------------------------- 1 | 'Email', 7 | 'crm_field' => 'email', 8 | ); 9 | 10 | $highlevel_fields['first_name'] = array( 11 | 'crm_label' => 'First Name', 12 | 'crm_field' => 'firstName', 13 | ); 14 | 15 | $highlevel_fields['last_name'] = array( 16 | 'crm_label' => 'Last Name', 17 | 'crm_field' => 'lastName', 18 | ); 19 | 20 | $highlevel_fields['phone_number'] = array( 21 | 'crm_label' => 'Phone Number', 22 | 'crm_field' => 'phone', 23 | ); 24 | 25 | $highlevel_fields['billing_address_1'] = array( 26 | 'crm_label' => 'Address', 27 | 'crm_field' => 'address1', 28 | ); 29 | 30 | $highlevel_fields['billing_city'] = array( 31 | 'crm_label' => 'City', 32 | 'crm_field' => 'city', 33 | ); 34 | 35 | $highlevel_fields['billing_state'] = array( 36 | 'crm_label' => 'State', 37 | 'crm_field' => 'state', 38 | ); 39 | 40 | $highlevel_fields['billing_country'] = array( 41 | 'crm_label' => 'Country', 42 | 'crm_field' => 'country', 43 | ); 44 | 45 | $highlevel_fields['billing_postcode'] = array( 46 | 'crm_label' => 'Postal Code', 47 | 'crm_field' => 'postalCode', 48 | ); 49 | 50 | $highlevel_fields['billing_company'] = array( 51 | 'crm_label' => 'Company Name', 52 | 'crm_field' => 'companyName', 53 | ); 54 | 55 | $highlevel_fields['user_url'] = array( 56 | 'crm_label' => 'Website', 57 | 'crm_field' => 'website', 58 | ); 59 | 60 | $highlevel_fields[] = array( 61 | 'crm_label' => 'Gender', 62 | 'crm_field' => 'gender', 63 | ); 64 | 65 | $highlevel_fields[] = array( 66 | 'crm_label' => 'Source', 67 | 'crm_field' => 'source', 68 | ); 69 | 70 | $highlevel_fields[] = array( 71 | 'crm_label' => 'Time Zone', 72 | 'crm_field' => 'timezone', 73 | ); 74 | 75 | $highlevel_fields[] = array( 76 | 'crm_label' => 'Company Name', 77 | 'crm_field' => 'companyName', 78 | ); 79 | 80 | $highlevel_fields[] = array( 81 | 'crm_label' => 'Date of Birth', 82 | 'crm_field' => 'dateOfBirth', 83 | ); 84 | -------------------------------------------------------------------------------- /includes/crms/tubular/admin/tubular-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'first_name', 8 | ); 9 | 10 | $tubular_fields[] = array( 11 | 'crm_label' => 'Middle Name', 12 | 'crm_field' => 'middle_name', 13 | ); 14 | 15 | $tubular_fields['last_name'] = array( 16 | 'crm_label' => 'Last Name', 17 | 'crm_field' => 'last_name', 18 | ); 19 | 20 | $tubular_fields['display_name'] = array( 21 | 'crm_label' => 'Full Name', 22 | 'crm_field' => 'full_name', 23 | ); 24 | 25 | $tubular_fields['user_email'] = array( 26 | 'crm_label' => 'Email', 27 | 'crm_field' => 'email', 28 | ); 29 | 30 | $tubular_fields['phone_number'] = array( 31 | 'crm_label' => 'Home Phone', 32 | 'crm_field' => 'home_phone', 33 | ); 34 | 35 | $tubular_fields[] = array( 36 | 'crm_label' => 'Mobile Phone', 37 | 'crm_field' => 'mobile_phone', 38 | ); 39 | 40 | $tubular_fields['user_url'] = array( 41 | 'crm_label' => 'Website', 42 | 'crm_field' => 'website', 43 | ); 44 | 45 | $tubular_fields['billing_company'] = array( 46 | 'crm_label' => 'Company Name', 47 | 'crm_field' => 'company_name', 48 | ); 49 | 50 | $tubular_fields['billing_address_1'] = array( 51 | 'crm_label' => 'Address 1', 52 | 'crm_field' => 'address_1', 53 | ); 54 | 55 | $tubular_fields['billing_address_2'] = array( 56 | 'crm_label' => 'Address 2', 57 | 'crm_field' => 'address_2', 58 | ); 59 | 60 | $tubular_fields['billing_city'] = array( 61 | 'crm_label' => 'City', 62 | 'crm_field' => 'city', 63 | ); 64 | 65 | $tubular_fields['billing_state'] = array( 66 | 'crm_label' => 'State', 67 | 'crm_field' => 'state', 68 | ); 69 | 70 | $tubular_fields['billing_postcode'] = array( 71 | 'crm_label' => 'Zip', 72 | 'crm_field' => 'zip', 73 | ); 74 | 75 | $tubular_fields['billing_country'] = array( 76 | 'crm_label' => 'Country', 77 | 'crm_field' => 'country', 78 | ); 79 | 80 | $tubular_fields[] = array( 81 | 'crm_label' => 'Job Title', 82 | 'crm_field' => 'job_title', 83 | ); 84 | -------------------------------------------------------------------------------- /includes/crms/autopilot/admin/autopilot-fields.php: -------------------------------------------------------------------------------- 1 | 'Title', 7 | 'crm_field' => 'Title', 8 | ); 9 | 10 | $autopilot_fields['first_name'] = array( 11 | 'crm_label' => 'First Name', 12 | 'crm_field' => 'FirstName', 13 | ); 14 | 15 | $autopilot_fields['last_name'] = array( 16 | 'crm_label' => 'Last Name', 17 | 'crm_field' => 'LastName', 18 | ); 19 | 20 | $autopilot_fields['user_email'] = array( 21 | 'crm_label' => 'Email', 22 | 'crm_field' => 'Email', 23 | ); 24 | 25 | $autopilot_fields['street_address_1'] = array( 26 | 'crm_label' => 'Street Address', 27 | 'crm_field' => 'MailingStreet', 28 | ); 29 | 30 | $autopilot_fields['billing_city'] = array( 31 | 'crm_label' => 'City', 32 | 'crm_field' => 'MailingCity', 33 | ); 34 | 35 | $autopilot_fields['billing_state'] = array( 36 | 'crm_label' => 'State', 37 | 'crm_field' => 'MailingState', 38 | ); 39 | 40 | $autopilot_fields['billing_postcode'] = array( 41 | 'crm_label' => 'Postal Code', 42 | 'crm_field' => 'MailingPostalCode', 43 | ); 44 | 45 | $autopilot_fields['billing_country'] = array( 46 | 'crm_label' => 'Country', 47 | 'crm_field' => 'MailingCountry', 48 | ); 49 | 50 | $autopilot_fields['phone_number'] = array( 51 | 'crm_label' => 'Phone', 52 | 'crm_field' => 'Phone', 53 | ); 54 | 55 | $autopilot_fields[] = array( 56 | 'crm_label' => 'MobilePhone', 57 | 'crm_field' => 'MobilePhone', 58 | ); 59 | 60 | $autopilot_fields['user_url'] = array( 61 | 'crm_label' => 'Website', 62 | 'crm_field' => 'Website', 63 | ); 64 | 65 | $autopilot_fields[] = array( 66 | 'crm_label' => 'Industry', 67 | 'crm_field' => 'Industry', 68 | ); 69 | 70 | $autopilot_fields[] = array( 71 | 'crm_label' => 'Number of Employees', 72 | 'crm_field' => 'NumberOfEmployees', 73 | ); 74 | 75 | $autopilot_fields[] = array( 76 | 'crm_label' => 'Twitter', 77 | 'crm_field' => 'Twitter', 78 | ); 79 | 80 | $autopilot_fields[] = array( 81 | 'crm_label' => 'LinkedIn', 82 | 'crm_field' => 'LinkedIn', 83 | ); 84 | 85 | $autopilot_fields[] = array( 86 | 'crm_label' => 'Company', 87 | 'crm_field' => 'Company', 88 | ); 89 | -------------------------------------------------------------------------------- /includes/crms/activecampaign/includes/User.class.php: -------------------------------------------------------------------------------- 1 | version = $version; 12 | $this->url_base = $url_base; 13 | $this->url = $url; 14 | $this->api_key = $api_key; 15 | } 16 | 17 | function add( $params, $post_data ) { 18 | $request_url = "{$this->url}&api_action=user_add&api_output={$this->output}"; 19 | $response = $this->curl( $request_url, $post_data ); 20 | 21 | return $response; 22 | } 23 | 24 | function delete_list( $params ) { 25 | $request_url = "{$this->url}&api_action=user_delete_list&api_output={$this->output}&{$params}"; 26 | $response = $this->curl( $request_url ); 27 | 28 | return $response; 29 | } 30 | 31 | function delete( $params ) { 32 | $request_url = "{$this->url}&api_action=user_delete&api_output={$this->output}&{$params}"; 33 | $response = $this->curl( $request_url ); 34 | 35 | return $response; 36 | } 37 | 38 | function edit( $params, $post_data ) { 39 | $request_url = "{$this->url}&api_action=user_edit&api_output={$this->output}"; 40 | $response = $this->curl( $request_url, $post_data ); 41 | 42 | return $response; 43 | } 44 | 45 | function list_( $params ) { 46 | $request_url = "{$this->url}&api_action=user_list&api_output={$this->output}&{$params}"; 47 | $response = $this->curl( $request_url ); 48 | 49 | return $response; 50 | } 51 | 52 | function me() { 53 | $request_url = "{$this->url}&api_action=user_me&api_output={$this->output}"; 54 | $response = $this->curl( $request_url ); 55 | 56 | return $response; 57 | } 58 | 59 | function view( $params ) { 60 | // can be a user ID, email, or username 61 | if ( preg_match( '/^email=/', $params ) ) { 62 | $action = 'user_view_email'; 63 | } elseif ( preg_match( '/^username=/', $params ) ) { 64 | $action = 'user_view_username'; 65 | } elseif ( preg_match( '/^id=/', $params ) ) { 66 | $action = 'user_view'; 67 | } 68 | $request_url = "{$this->url}&api_action={$action}&api_output={$this->output}&{$params}"; 69 | $response = $this->curl( $request_url ); 70 | 71 | return $response; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /includes/crms/activecampaign/includes/Account.class.php: -------------------------------------------------------------------------------- 1 | version = $version; 12 | $this->url_base = $url_base; 13 | $this->url = $url; 14 | $this->api_key = $api_key; 15 | } 16 | 17 | function add( $params, $post_data ) { 18 | $request_url = "{$this->url}&api_action=account_add&api_output={$this->output}"; 19 | $response = $this->curl( $request_url, $post_data ); 20 | 21 | return $response; 22 | } 23 | 24 | function cancel( $params ) { 25 | $request_url = "{$this->url}&api_action=account_cancel&api_output={$this->output}&{$params}"; 26 | $response = $this->curl( $request_url ); 27 | 28 | return $response; 29 | } 30 | 31 | function edit( $params, $post_data ) { 32 | $request_url = "{$this->url}&api_action=account_edit&api_output={$this->output}"; 33 | $response = $this->curl( $request_url, $post_data ); 34 | 35 | return $response; 36 | } 37 | 38 | function list_( $params ) { 39 | $request_url = "{$this->url}&api_action=account_list&api_output={$this->output}&{$params}"; 40 | $response = $this->curl( $request_url ); 41 | 42 | return $response; 43 | } 44 | 45 | function name_check( $params ) { 46 | $request_url = "{$this->url}&api_action=account_name_check&api_output={$this->output}&{$params}"; 47 | $response = $this->curl( $request_url ); 48 | 49 | return $response; 50 | } 51 | 52 | function plans( $params ) { 53 | $request_url = "{$this->url}&api_action=account_plans&api_output={$this->output}&{$params}"; 54 | $response = $this->curl( $request_url ); 55 | 56 | return $response; 57 | } 58 | 59 | function status( $params ) { 60 | $request_url = "{$this->url}&api_action=account_status&api_output={$this->output}&{$params}"; 61 | $response = $this->curl( $request_url ); 62 | 63 | return $response; 64 | } 65 | 66 | function status_set( $params ) { 67 | $request_url = "{$this->url}&api_action=account_status_set&api_output={$this->output}&{$params}"; 68 | $response = $this->curl( $request_url ); 69 | 70 | return $response; 71 | } 72 | 73 | function view() { 74 | $request_url = "{$this->url}&api_action=account_view&api_output={$this->output}"; 75 | $response = $this->curl( $request_url ); 76 | 77 | return $response; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /phpcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | A custom set of rules to check for a WPized WordPress project 5 | 6 | . 7 | 8 | 9 | /docroot/wp-admin/* 10 | /docroot/wp-includes/* 11 | /docroot/wp-*.php 12 | /docroot/index.php 13 | /docroot/xmlrpc.php 14 | /docroot/wp-content/plugins/* 15 | 16 | 17 | **/vendor/* 18 | 19 | 20 | **/node_modules/* 21 | 22 | 23 | **/tests/* 24 | 25 | 26 | *.min.js 27 | *.js 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /includes/admin/gutenberg/class-gutenberg.php: -------------------------------------------------------------------------------- 1 | asset_map = wpf_get_asset_meta( WPF_DIR_PATH . 'build/secure-block.asset.php' ); 38 | 39 | // Load Assets 40 | add_action( 'enqueue_block_editor_assets', array( $this, 'editor_assets' ) ); // Load Editor Assets 41 | 42 | // Load Classes 43 | add_action( 'init', array( $this, 'includes' ) ); 44 | } 45 | 46 | /** 47 | * Enqueue editor scripts and styles 48 | * 49 | * @since unknown 50 | * 51 | * @access public 52 | * 53 | * @return void 54 | */ 55 | public function editor_assets() { 56 | // Enqueue editor JS. 57 | wp_enqueue_script( 58 | 'wpf-secure-blocks-for-gutenberg-editor-js', 59 | WPF_DIR_URL . 'build/secure-block.js', 60 | $this->asset_map['dependencies'], 61 | $this->asset_map['version'], 62 | true 63 | ); 64 | 65 | wp_enqueue_style( 66 | 'wpf-secure-blocks-for-gutenberg-admin-css', 67 | WPF_DIR_URL . 'build/secure-block.css', 68 | array(), 69 | $this->asset_map['version'], 70 | ); 71 | } 72 | 73 | /** 74 | * Enqueue admin styles 75 | * 76 | * @deprecated 3.44.25 Use editor_assets() instead. 77 | * 78 | * @access public 79 | * @return void 80 | */ 81 | public function admin_assets() { 82 | _deprecated_function( __METHOD__, '3.44.25', 'Main::editor_assets()' ); 83 | } 84 | 85 | /** 86 | * Include block classes 87 | * 88 | * @access public 89 | * @return void 90 | */ 91 | public function includes() { 92 | 93 | // Load Classes 94 | require_once plugin_dir_path( __FILE__ ) . 'src/secure-block/php/class-secure-block.php'; 95 | $secure_block = new Secure_Block(); 96 | $secure_block->run(); 97 | } 98 | } 99 | 100 | $main = new Main(); 101 | -------------------------------------------------------------------------------- /includes/admin/wordpress-fields.php: -------------------------------------------------------------------------------- 1 | 'text', 6 | 'label' => __( 'First Name', 'wp-fusion-lite' ), 7 | ); 8 | 9 | $wp_fields['last_name'] = array( 10 | 'type' => 'text', 11 | 'label' => __( 'Last Name', 'wp-fusion-lite' ), 12 | ); 13 | 14 | $wp_fields['user_email'] = array( 15 | 'type' => 'text', 16 | 'label' => __( 'E-mail Address', 'wp-fusion-lite' ), 17 | ); 18 | 19 | $wp_fields['previous_user_email'] = array( 20 | 'type' => 'text', 21 | 'label' => __( 'Previous E-mail Address', 'wp-fusion-lite' ), 22 | 'pseudo' => true, 23 | ); 24 | 25 | $wp_fields['display_name'] = array( 26 | 'type' => 'text', 27 | 'label' => __( 'Profile Display Name', 'wp-fusion-lite' ), 28 | ); 29 | 30 | $wp_fields['user_nicename'] = array( 31 | 'type' => 'text', 32 | 'label' => __( 'Nicename', 'wp-fusion-lite' ), 33 | ); 34 | 35 | $wp_fields['nickname'] = array( 36 | 'type' => 'text', 37 | 'label' => __( 'Nickname', 'wp-fusion-lite' ), 38 | ); 39 | 40 | $wp_fields['user_login'] = array( 41 | 'type' => 'text', 42 | 'label' => __( 'Username', 'wp-fusion-lite' ), 43 | ); 44 | 45 | $wp_fields['user_id'] = array( 46 | 'type' => 'integer', 47 | 'label' => __( 'User ID', 'wp-fusion-lite' ), 48 | 'pseudo' => true, 49 | ); 50 | 51 | $wp_fields['locale'] = array( 52 | 'type' => 'text', 53 | 'label' => __( 'Language', 'wp-fusion-lite' ), 54 | ); 55 | 56 | $wp_fields['role'] = array( 57 | 'type' => 'text', 58 | 'label' => __( 'User Role', 'wp-fusion-lite' ), 59 | ); 60 | 61 | // Add the capabilities key. Usually wp_capabilities but sometimes 62 | // different if the table prefix has been changed. 63 | 64 | $user = wp_get_current_user(); 65 | 66 | $wp_fields[ $user->cap_key ] = array( 67 | 'type' => 'multiselect', 68 | 'label' => __( 'User Capabilities', 'wp-fusion-lite' ), 69 | ); 70 | 71 | $wp_fields['user_pass'] = array( 72 | 'type' => 'text', 73 | 'label' => __( 'Password', 'wp-fusion-lite' ), 74 | ); 75 | 76 | $wp_fields['user_registered'] = array( 77 | 'type' => 'date', 78 | 'label' => __( 'User Registered', 'wp-fusion-lite' ), 79 | 'pseudo' => true, 80 | ); 81 | 82 | $wp_fields['description'] = array( 83 | 'type' => 'textarea', 84 | 'label' => __( 'Biography', 'wp-fusion-lite' ), 85 | ); 86 | 87 | $wp_fields['user_url'] = array( 88 | 'type' => 'text', 89 | 'label' => __( 'Website (URL)', 'wp-fusion-lite' ), 90 | ); 91 | 92 | $wp_fields['ip'] = array( 93 | 'type' => 'text', 94 | 'label' => __( 'IP Address', 'wp-fusion-lite' ), 95 | 'pseudo' => true, 96 | ); 97 | -------------------------------------------------------------------------------- /includes/crms/activecampaign/includes/Webhook.class.php: -------------------------------------------------------------------------------- 1 | version = $version; 12 | $this->url_base = $url_base; 13 | $this->url = $url; 14 | $this->api_key = $api_key; 15 | } 16 | 17 | function add( $params, $post_data ) { 18 | $request_url = "{$this->url}&api_action=webhook_add&api_output={$this->output}"; 19 | $response = $this->curl( $request_url, $post_data ); 20 | 21 | return $response; 22 | } 23 | 24 | function delete( $params ) { 25 | $request_url = "{$this->url}&api_action=webhook_delete&api_output={$this->output}&{$params}"; 26 | $response = $this->curl( $request_url ); 27 | 28 | return $response; 29 | } 30 | 31 | function delete_list( $params ) { 32 | $request_url = "{$this->url}&api_action=webhook_delete_list&api_output={$this->output}&{$params}"; 33 | $response = $this->curl( $request_url ); 34 | 35 | return $response; 36 | } 37 | 38 | function edit( $params, $post_data ) { 39 | $request_url = "{$this->url}&api_action=webhook_edit&api_output={$this->output}"; 40 | $response = $this->curl( $request_url, $post_data ); 41 | 42 | return $response; 43 | } 44 | 45 | function list_( $params ) { 46 | $request_url = "{$this->url}&api_action=webhook_list&api_output={$this->output}&{$params}"; 47 | $response = $this->curl( $request_url ); 48 | 49 | return $response; 50 | } 51 | 52 | function view( $params ) { 53 | $request_url = "{$this->url}&api_action=webhook_view&api_output={$this->output}&{$params}"; 54 | $response = $this->curl( $request_url ); 55 | 56 | return $response; 57 | } 58 | 59 | function events( $params ) { 60 | $request_url = "{$this->url}&api_action=webhook_events&api_output={$this->output}&{$params}"; 61 | $response = $this->curl( $request_url ); 62 | 63 | return $response; 64 | } 65 | 66 | function process( $params ) { 67 | // process an incoming webhook payload (from ActiveCampaign), and format it (or do something with it) 68 | 69 | $r = array(); 70 | if ( $_SERVER['REQUEST_METHOD'] != 'POST' ) { 71 | return $r; 72 | } 73 | 74 | $params_array = explode( '&', $params ); 75 | $params_ = array(); 76 | foreach ( $params_array as $expression ) { 77 | // IE: css=1 78 | list( $var, $val ) = explode( '=', $expression ); 79 | $params_[ $var ] = $val; 80 | } 81 | 82 | $event = $params_['event']; 83 | $format = $params_['output']; 84 | 85 | if ( $format == 'json' ) { 86 | return wp_json_encode( $_POST ); 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /includes/crms/zerobscrm/admin/zerobscrm-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'fname', 8 | ); 9 | 10 | $zerobscrm_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'lname', 13 | ); 14 | 15 | $zerobscrm_fields['user_email'] = array( 16 | 'crm_label' => 'Email', 17 | 'crm_field' => 'email', 18 | ); 19 | 20 | $zerobscrm_fields['phone_number'] = array( 21 | 'crm_label' => 'Home Phone', 22 | 'crm_field' => 'hometel', 23 | ); 24 | 25 | $zerobscrm_fields[] = array( 26 | 'crm_label' => 'Mobile Phone', 27 | 'crm_field' => 'mobtel', 28 | ); 29 | 30 | $zerobscrm_fields[] = array( 31 | 'crm_label' => 'Work Phone', 32 | 'crm_field' => 'worktel', 33 | ); 34 | 35 | $zerobscrm_fields['billing_address_1'] = array( 36 | 'crm_label' => 'Address 1', 37 | 'crm_field' => 'addr1', 38 | ); 39 | 40 | $zerobscrm_fields['billing_address_2'] = array( 41 | 'crm_label' => 'Address 2', 42 | 'crm_field' => 'addr2', 43 | ); 44 | 45 | $zerobscrm_fields['billing_city'] = array( 46 | 'crm_label' => 'City', 47 | 'crm_field' => 'city', 48 | ); 49 | 50 | $zerobscrm_fields['billing_state'] = array( 51 | 'crm_label' => 'County', 52 | 'crm_field' => 'county', 53 | ); 54 | 55 | $zerobscrm_fields['billing_postcode'] = array( 56 | 'crm_label' => 'Postcode', 57 | 'crm_field' => 'postcode', 58 | ); 59 | 60 | $zerobscrm_fields['billing_country'] = array( 61 | 'crm_label' => 'Country', 62 | 'crm_field' => 'country', 63 | ); 64 | 65 | 66 | $zerobscrm_fields['shipping_address_1'] = array( 67 | 'crm_label' => 'Secondary Address 1', 68 | 'crm_field' => 'secaddr1', 69 | ); 70 | 71 | $zerobscrm_fields['shipping_address_2'] = array( 72 | 'crm_label' => 'Secondary Address 2', 73 | 'crm_field' => 'secaddr2', 74 | ); 75 | 76 | $zerobscrm_fields['shipping_city'] = array( 77 | 'crm_label' => 'Secondary City', 78 | 'crm_field' => 'seccity', 79 | ); 80 | 81 | $zerobscrm_fields['shipping_state'] = array( 82 | 'crm_label' => 'Secondary County', 83 | 'crm_field' => 'seccounty', 84 | ); 85 | 86 | $zerobscrm_fields['shipping_postcode'] = array( 87 | 'crm_label' => 'Secondary Postcode', 88 | 'crm_field' => 'secpostcode', 89 | ); 90 | 91 | $zerobscrm_fields['shipping_country'] = array( 92 | 'crm_label' => 'Secondary Country', 93 | 'crm_field' => 'seccountry', 94 | ); 95 | 96 | $zerobscrm_fields[] = array( 97 | 'crm_label' => 'Avatar', 98 | 'crm_field' => 'avatar', 99 | ); 100 | 101 | $zerobscrm_fields[] = array( 102 | 'crm_label' => 'Status', 103 | 'crm_field' => 'status', 104 | ); 105 | -------------------------------------------------------------------------------- /assets/js/jquery-tiptip/jquery.tipTip.min.js: -------------------------------------------------------------------------------- 1 | !function(t){t.fn.tipTip=function(e){var o={activation:"hover",keepAlive:!1,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:!1,enter:function(){},exit:function(){}},i=t.extend(o,e);if(t("#tiptip_holder").length<=0){var n=t('
'),r=t('
'),a=t('
');t("body").append(n.html(r).prepend(a.html('
')))}else var n=t("#tiptip_holder"),r=t("#tiptip_content"),a=t("#tiptip_arrow");return this.each(function(){function e(){i.enter.call(this),r.html(d),n.hide().removeAttr("class").css("margin","0"),a.removeAttr("style");var e=parseInt(f.offset().top),o=parseInt(f.offset().left),p=parseInt(f.outerWidth()),l=parseInt(f.outerHeight()),h=n.outerWidth(),c=n.outerHeight(),s=Math.round((p-h)/2),_=Math.round((l-c)/2),v=Math.round(o+s),m=Math.round(e+l+i.edgeOffset),g="",b="",M=Math.round(h-12)/2;"bottom"==i.defaultPosition?g="_bottom":"top"==i.defaultPosition?g="_top":"left"==i.defaultPosition?g="_left":"right"==i.defaultPosition&&(g="_right");var w=s+oparseInt(t(window).width());w&&s<0||"_right"==g&&!O||"_left"==g&&oparseInt(t(window).height()+t(window).scrollTop()),I=e+l-(i.edgeOffset+c+8)<0;x||"_bottom"==g&&x||"_top"==g&&!I?("_top"==g||"_bottom"==g?g="_top":g+="_top",b=c,m=Math.round(e-(c+5+i.edgeOffset))):(I|("_top"==g&&I)||"_bottom"==g&&!x)&&("_top"==g||"_bottom"==g?g="_bottom":g+="_bottom",b=-12,m=Math.round(e+l+i.edgeOffset)),"_right_top"==g||"_left_top"==g?m+=5:"_right_bottom"!=g&&"_left_bottom"!=g||(m-=5),"_left_top"!=g&&"_left_bottom"!=g||(v+=5),a.css({"margin-left":M+"px","margin-top":b+"px"}),n.css({"margin-left":v+"px","margin-top":m+"px"}).attr("class","tip"+g),u&&clearTimeout(u),u=setTimeout(function(){n.stop(!0,!0).fadeIn(i.fadeIn)},i.delay)}function o(){i.exit.call(this),u&&clearTimeout(u),n.fadeOut(i.fadeOut)}var f=t(this);if(i.content)d=i.content;else var d=f.attr(i.attribute);if(""!=d){i.content||f.removeAttr(i.attribute);var u=!1;"hover"==i.activation?(f.hover(function(){e()},function(){i.keepAlive||o()}),i.keepAlive&&n.hover(function(){},function(){o()})):"focus"==i.activation?f.focus(function(){e()}).blur(function(){o()}):"click"==i.activation&&(f.click(function(){return e(),!1}).hover(function(){},function(){i.keepAlive||o()}),i.keepAlive&&n.hover(function(){},function(){o()}))}})}}(jQuery); -------------------------------------------------------------------------------- /assets/js/wpf-leadsource-tracking.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * JavaScript Cookie v2.2.1 3 | * https://github.com/js-cookie/js-cookie 4 | * Copyright 2006, 2015 Klaus Hartl & Fagner Brack 5 | * Released under the MIT license 6 | * Update plugin name to CookiesWPF 7 | * @preserve 8 | */ 9 | !function(e){var t,i,_;"function"==typeof define&&define.amd&&(define(e),t=!0),"object"==typeof exports&&(module.exports=e(),t=!0),t||(i=window.CookiesWPF,(_=window.CookiesWPF=e()).noConflict=function(){return window.CookiesWPF=i,_})}(function(){function a(){for(var e=0,t={};e 0) { 34 | CookiesWPF.set('wpf_leadsource', cookie); 35 | } 36 | 37 | }); 38 | -------------------------------------------------------------------------------- /includes/crms/salesflare/admin/salesflare-fields.php: -------------------------------------------------------------------------------- 1 | 'Name', 7 | 'crm_field' => 'name', 8 | ); 9 | 10 | $salesflare_fields['first_name'] = array( 11 | 'crm_label' => 'First Name', 12 | 'crm_field' => 'firstname', 13 | ); 14 | 15 | $salesflare_fields['last_name'] = array( 16 | 'crm_label' => 'Last Name', 17 | 'crm_field' => 'lastname', 18 | ); 19 | 20 | $salesflare_fields['user_email'] = array( 21 | 'crm_label' => 'Email', 22 | 'crm_field' => 'email', 23 | ); 24 | 25 | $salesflare_fields['billing_first_name'] = array( 26 | 'crm_label' => 'First Name', 27 | 'crm_field' => 'firstname', 28 | ); 29 | 30 | $salesflare_fields['billing_last_name'] = array( 31 | 'crm_label' => 'Last Name', 32 | 'crm_field' => 'lastname', 33 | ); 34 | 35 | $salesflare_fields['billing_email'] = array( 36 | 'crm_label' => 'Email', 37 | 'crm_field' => 'email', 38 | ); 39 | 40 | $salesflare_fields['billing_phone'] = array( 41 | 'crm_label' => 'Phone Number', 42 | 'crm_field' => 'phone_number', 43 | ); 44 | 45 | $salesflare_fields['billing_address_1'] = array( 46 | 'crm_label' => 'Street Address (Work)', 47 | 'crm_field' => 'addresses+work+street', 48 | ); 49 | 50 | $salesflare_fields['billing_city'] = array( 51 | 'crm_label' => 'City (Work)', 52 | 'crm_field' => 'addresses+work+city', 53 | ); 54 | 55 | $salesflare_fields['billing_country'] = array( 56 | 'crm_label' => 'Country (Work)', 57 | 'crm_field' => 'addresses+work+country', 58 | ); 59 | 60 | $salesflare_fields['billing_state'] = array( 61 | 'crm_label' => 'State (Work)', 62 | 'crm_field' => 'addresses+work+state_region', 63 | ); 64 | 65 | $salesflare_fields['billing_postcode'] = array( 66 | 'crm_label' => 'Zip (Work)', 67 | 'crm_field' => 'addresses+work+zip', 68 | ); 69 | 70 | $salesflare_fields['shipping_address_1'] = array( 71 | 'crm_label' => 'Street Address (Home)', 72 | 'crm_field' => 'addresses+home+street', 73 | ); 74 | 75 | 76 | $salesflare_fields['shipping_city'] = array( 77 | 'crm_label' => 'City (Home)', 78 | 'crm_field' => 'addresses+home+city', 79 | ); 80 | 81 | $salesflare_fields['shipping_country'] = array( 82 | 'crm_label' => 'Country (Home)', 83 | 'crm_field' => 'addresses+home+country', 84 | ); 85 | 86 | $salesflare_fields['shipping_state'] = array( 87 | 'crm_label' => 'State (Home)', 88 | 'crm_field' => 'addresses+home+state_region', 89 | ); 90 | 91 | $salesflare_fields['shipping_street'] = array( 92 | 93 | 'crm_label' => 'Street (Home)', 94 | 'crm_field' => 'addresses+home+street', 95 | ); 96 | 97 | $salesflare_fields['shipping_zip'] = array( 98 | 'crm_label' => 'City (Home)', 99 | 'crm_field' => 'addresses+home+zip', 100 | ); 101 | -------------------------------------------------------------------------------- /includes/crms/kartra/admin/kartra-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'first_name', 8 | ); 9 | 10 | $kartra_fields[] = array( 11 | 'crm_label' => 'Middle Name', 12 | 'crm_field' => 'middle_name', 13 | ); 14 | 15 | $kartra_fields['last_name'] = array( 16 | 'crm_label' => 'Last Name', 17 | 'crm_field' => 'last_name', 18 | ); 19 | 20 | $kartra_fields[] = array( 21 | 'crm_label' => 'Last Name 2', 22 | 'crm_field' => 'last_name2', 23 | ); 24 | 25 | $kartra_fields['user_email'] = array( 26 | 'crm_label' => 'Email', 27 | 'crm_field' => 'email', 28 | ); 29 | 30 | $kartra_fields[] = array( 31 | 'crm_label' => 'Date Joined', 32 | 'crm_field' => 'date_joined', 33 | ); 34 | 35 | $kartra_fields['billing_address_1'] = array( 36 | 'crm_label' => 'Address', 37 | 'crm_field' => 'address', 38 | ); 39 | 40 | $kartra_fields['billing_city'] = array( 41 | 'crm_label' => 'City', 42 | 'crm_field' => 'city', 43 | ); 44 | 45 | $kartra_fields['billing_state'] = array( 46 | 'crm_label' => 'State', 47 | 'crm_field' => 'state', 48 | ); 49 | 50 | $kartra_fields['billing_postcode'] = array( 51 | 'crm_label' => 'Postcode', 52 | 'crm_field' => 'zip', 53 | ); 54 | 55 | $kartra_fields['billing_country'] = array( 56 | 'crm_label' => 'Country', 57 | 'crm_field' => 'country', 58 | ); 59 | 60 | $kartra_fields['country'] = array( 61 | 'crm_label' => 'Country', 62 | 'crm_field' => 'country', 63 | ); 64 | 65 | $kartra_fields[] = array( 66 | 'crm_label' => 'IP', 67 | 'crm_field' => 'ip', 68 | ); 69 | 70 | $kartra_fields['phone_number'] = array( 71 | 'crm_label' => 'Phone', 72 | 'crm_field' => 'phone', 73 | ); 74 | 75 | $kartra_fields['billing_phone'] = array( 76 | 'crm_label' => 'Phone', 77 | 'crm_field' => 'phone', 78 | ); 79 | 80 | $kartra_fields[] = array( 81 | 'crm_label' => 'Company', 82 | 'crm_field' => 'company', 83 | ); 84 | 85 | $kartra_fields[] = array( 86 | 'crm_label' => 'Source', 87 | 'crm_field' => 'source', 88 | ); 89 | 90 | $kartra_fields['user_url'] = array( 91 | 'crm_label' => 'Website', 92 | 'crm_field' => 'website', 93 | ); 94 | 95 | $kartra_fields['facebook'] = array( 96 | 'crm_label' => 'Facebook', 97 | 'crm_field' => 'facebook', 98 | ); 99 | 100 | $kartra_fields['twitter'] = array( 101 | 'crm_label' => 'Twitter', 102 | 'crm_field' => 'twitter', 103 | ); 104 | 105 | $kartra_fields[] = array( 106 | 'crm_label' => 'Google Plus', 107 | 'crm_field' => 'google_plus', 108 | ); 109 | 110 | $kartra_fields[] = array( 111 | 'crm_label' => 'Linkedin', 112 | 'crm_field' => 'linkedin', 113 | ); 114 | 115 | $kartra_fields[] = array( 116 | 'crm_label' => 'Username (Read Only)', 117 | 'crm_field' => 'username', 118 | ); 119 | -------------------------------------------------------------------------------- /includes/crms/vtiger/admin/vtiger-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'first_name', 8 | ); 9 | 10 | $vtiger_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'last_name', 13 | ); 14 | 15 | // Email 16 | 17 | $vtiger_fields['user_email'] = array( 18 | 'crm_label' => 'Email', 19 | 'crm_field' => 'email', 20 | ); 21 | 22 | $vtiger_fields['billing_email'] = array( 23 | 'crm_label' => 'Email (Work)', 24 | 'crm_field' => 'email+work', 25 | ); 26 | 27 | $vtiger_fields['user_email_personal'] = array( 28 | 'crm_label' => 'Email (Personal)', 29 | 'crm_field' => 'email+personal', 30 | ); 31 | 32 | $vtiger_fields['company'] = array( 33 | 'crm_label' => 'Company', 34 | 'crm_field' => 'company', 35 | ); 36 | 37 | // Phone 38 | 39 | $vtiger_fields['phone_number'] = array( 40 | 'crm_label' => 'Phone', 41 | 'crm_field' => 'phone', 42 | ); 43 | 44 | $vtiger_fields['billing_phone'] = array( 45 | 'crm_label' => 'Phone (Work)', 46 | 'crm_field' => 'phone+work', 47 | ); 48 | 49 | $vtiger_fields['phone_number_home'] = array( 50 | 'crm_label' => 'Phone (Home)', 51 | 'crm_field' => 'phone+home', 52 | ); 53 | 54 | $vtiger_fields['phone_number_mobile'] = array( 55 | 'crm_label' => 'Phone (Mobile)', 56 | 'crm_field' => 'phone+mobile', 57 | ); 58 | 59 | $vtiger_fields['phone_number_main'] = array( 60 | 'crm_label' => 'Phone (Main)', 61 | 'crm_field' => 'phone+main', 62 | ); 63 | 64 | 65 | // URL / social 66 | 67 | $vtiger_fields['website'] = array( 68 | 'crm_label' => 'Website', 69 | 'crm_field' => 'website+URL', 70 | ); 71 | 72 | $vtiger_fields['user_url'] = array( 73 | 'crm_label' => 'Website', 74 | 'crm_field' => 'website+URL', 75 | ); 76 | 77 | $vtiger_fields['facebook'] = array( 78 | 'crm_label' => 'Facebook', 79 | 'crm_field' => 'website+FACEBOOK', 80 | ); 81 | 82 | $vtiger_fields['twitter'] = array( 83 | 'crm_label' => 'Twitter', 84 | 'crm_field' => 'website+TWITTER', 85 | ); 86 | 87 | $vtiger_fields['google_plus'] = array( 88 | 'crm_label' => 'Google+', 89 | 'crm_field' => 'website+GOOGLE-PLUS', 90 | ); 91 | 92 | // Address 93 | 94 | $vtiger_fields['billing_address_1'] = array( 95 | 'crm_label' => 'Address 1', 96 | 'crm_field' => 'address+address', 97 | ); 98 | 99 | $vtiger_fields['billing_city'] = array( 100 | 'crm_label' => 'City', 101 | 'crm_field' => 'address+city', 102 | ); 103 | 104 | $vtiger_fields['billing_state'] = array( 105 | 'crm_label' => 'State', 106 | 'crm_field' => 'address+state', 107 | ); 108 | 109 | $vtiger_fields['billing_postcode'] = array( 110 | 'crm_label' => 'Zip', 111 | 'crm_field' => 'address+zip', 112 | ); 113 | 114 | $vtiger_fields['billing_country'] = array( 115 | 'crm_label' => 'Country', 116 | 'crm_field' => 'address+country', 117 | ); 118 | -------------------------------------------------------------------------------- /includes/crms/staging/admin/class-admin.php: -------------------------------------------------------------------------------- 1 | slug = $slug; 18 | $this->name = $name; 19 | $this->crm = $crm; 20 | 21 | // Settings. 22 | add_filter( 'wpf_configure_settings', array( $this, 'register_connection_settings' ), 15, 2 ); 23 | add_action( 'show_field_staging_header_begin', array( $this, 'show_field_staging_header_begin' ) ); 24 | add_action( 'show_field_staging_header_end', array( $this, 'show_field_staging_header_end' ) ); 25 | 26 | if ( wpf_get_option( 'crm' ) == $this->slug ) { 27 | add_filter( 'wpf_initialize_options_contact_fields', array( $this, 'add_default_fields' ) ); 28 | } 29 | } 30 | 31 | 32 | /** 33 | * Loads Staging connection information on settings page 34 | * 35 | * @access public 36 | * @since 1.0 37 | */ 38 | public function register_connection_settings( $settings, $options ) { 39 | 40 | $new_settings = array(); 41 | 42 | $new_settings['staging_header'] = array( 43 | 'title' => __( 'Staging', 'wp-fusion-lite' ), 44 | 'type' => 'heading', 45 | 'section' => 'setup', 46 | 'desc' => __( 'In "Staging Mode" WP Fusion will function as normal, but no API calls will be sent.

Tags and other actions will be applied to a local buffer, and will be erased when staging mode is disabled.', 'wp-fusion-lite' ), 47 | ); 48 | 49 | $settings = wp_fusion()->settings->insert_setting_after( 'crm', $settings, $new_settings ); 50 | 51 | return $settings; 52 | } 53 | 54 | /** 55 | * Puts a div around the Infusionsoft configuration section so it can be toggled 56 | * 57 | * @access public 58 | * @since 1.0 59 | */ 60 | public function show_field_staging_header_begin() { 61 | 62 | echo ''; 63 | $crm = wpf_get_option( 'crm' ); 64 | echo '

'; 65 | } 66 | 67 | /** 68 | * Puts a div around the Infusionsoft configuration section so it can be toggled 69 | * 70 | * @access public 71 | * @since 1.0 72 | */ 73 | public function show_field_staging_header_end() { 74 | 75 | echo '
'; 76 | } 77 | 78 | /** 79 | * Make sure email is enabled and mapped. 80 | * 81 | * @since 3.41.26 82 | * @param array $options The options 83 | * @return array The options. 84 | */ 85 | public function add_default_fields( $options ) { 86 | 87 | if ( $options['connection_configured'] ) { 88 | 89 | $options['contact_fields']['user_email'] = array( 90 | 'crm_field' => 'email', 91 | ); 92 | 93 | } 94 | 95 | return $options; 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /includes/crms/agilecrm/admin/agilecrm-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'first_name', 8 | ); 9 | 10 | $agilecrm_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'last_name', 13 | ); 14 | 15 | // Email 16 | 17 | $agilecrm_fields['user_email'] = array( 18 | 'crm_label' => 'Email', 19 | 'crm_field' => 'email', 20 | ); 21 | 22 | $agilecrm_fields['billing_email'] = array( 23 | 'crm_label' => 'Email (Work)', 24 | 'crm_field' => 'email+work', 25 | ); 26 | 27 | $agilecrm_fields['user_email_personal'] = array( 28 | 'crm_label' => 'Email (Personal)', 29 | 'crm_field' => 'email+personal', 30 | ); 31 | 32 | $agilecrm_fields['company'] = array( 33 | 'crm_label' => 'Company', 34 | 'crm_field' => 'company', 35 | ); 36 | 37 | // Phone 38 | 39 | $agilecrm_fields['phone_number'] = array( 40 | 'crm_label' => 'Phone', 41 | 'crm_field' => 'phone', 42 | ); 43 | 44 | $agilecrm_fields['billing_phone'] = array( 45 | 'crm_label' => 'Phone (Work)', 46 | 'crm_field' => 'phone+work', 47 | ); 48 | 49 | $agilecrm_fields['phone_number_home'] = array( 50 | 'crm_label' => 'Phone (Home)', 51 | 'crm_field' => 'phone+home', 52 | ); 53 | 54 | $agilecrm_fields['phone_number_mobile'] = array( 55 | 'crm_label' => 'Phone (Mobile)', 56 | 'crm_field' => 'phone+mobile', 57 | ); 58 | 59 | $agilecrm_fields['phone_number_main'] = array( 60 | 'crm_label' => 'Phone (Main)', 61 | 'crm_field' => 'phone+main', 62 | ); 63 | 64 | 65 | // URL / social 66 | 67 | $agilecrm_fields['website'] = array( 68 | 'crm_label' => 'Website', 69 | 'crm_field' => 'website+URL', 70 | ); 71 | 72 | $agilecrm_fields['user_url'] = array( 73 | 'crm_label' => 'Website', 74 | 'crm_field' => 'website+URL', 75 | ); 76 | 77 | $agilecrm_fields['facebook'] = array( 78 | 'crm_label' => 'Facebook', 79 | 'crm_field' => 'website+FACEBOOK', 80 | ); 81 | 82 | $agilecrm_fields['twitter'] = array( 83 | 'crm_label' => 'Twitter', 84 | 'crm_field' => 'website+TWITTER', 85 | ); 86 | 87 | $agilecrm_fields['google_plus'] = array( 88 | 'crm_label' => 'Google+', 89 | 'crm_field' => 'website+GOOGLE-PLUS', 90 | ); 91 | 92 | // Address 93 | 94 | $agilecrm_fields['billing_address_1'] = array( 95 | 'crm_label' => 'Address 1', 96 | 'crm_field' => 'address+address', 97 | ); 98 | 99 | $agilecrm_fields['billing_city'] = array( 100 | 'crm_label' => 'City', 101 | 'crm_field' => 'address+city', 102 | ); 103 | 104 | $agilecrm_fields['billing_state'] = array( 105 | 'crm_label' => 'State', 106 | 'crm_field' => 'address+state', 107 | ); 108 | 109 | $agilecrm_fields['billing_postcode'] = array( 110 | 'crm_label' => 'Zip', 111 | 'crm_field' => 'address+zip', 112 | ); 113 | 114 | $agilecrm_fields['billing_country'] = array( 115 | 'crm_label' => 'Country', 116 | 'crm_field' => 'address+country', 117 | ); 118 | -------------------------------------------------------------------------------- /includes/crms/groundhogg/admin/groundhogg-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 7 | 'crm_field' => 'first_name', 8 | ); 9 | 10 | $groundhogg_fields['last_name'] = array( 11 | 'crm_label' => 'Last Name', 12 | 'crm_field' => 'last_name', 13 | ); 14 | 15 | $groundhogg_fields['user_email'] = array( 16 | 'crm_label' => 'Email', 17 | 'crm_field' => 'email', 18 | ); 19 | 20 | $groundhogg_fields['phone_number'] = array( 21 | 'crm_label' => 'Phone', 22 | 'crm_field' => 'primary_phone', 23 | ); 24 | 25 | $groundhogg_fields['billing_address_1'] = array( 26 | 'crm_label' => 'Address 1', 27 | 'crm_field' => 'street_address_1', 28 | ); 29 | 30 | $groundhogg_fields['billing_address_2'] = array( 31 | 'crm_label' => 'Address 2', 32 | 'crm_field' => 'street_address_2', 33 | ); 34 | 35 | $groundhogg_fields['billing_city'] = array( 36 | 'crm_label' => 'City', 37 | 'crm_field' => 'city', 38 | ); 39 | 40 | $groundhogg_fields['billing_state'] = array( 41 | 'crm_label' => 'State', 42 | 'crm_field' => 'region', 43 | ); 44 | 45 | $groundhogg_fields['billing_postcode'] = array( 46 | 'crm_label' => 'Zip', 47 | 'crm_field' => 'postal_zip', 48 | ); 49 | 50 | $groundhogg_fields['billing_country'] = array( 51 | 'crm_label' => 'Country', 52 | 'crm_field' => 'country', 53 | ); 54 | 55 | $groundhogg_fields['company'] = array( 56 | 'crm_label' => 'Company Name', 57 | 'crm_field' => 'company_name', 58 | ); 59 | 60 | $groundhogg_fields[] = array( 61 | 'crm_label' => 'Job Title', 62 | 'crm_field' => 'job_title', 63 | ); 64 | 65 | $groundhogg_fields[] = array( 66 | 'crm_label' => 'Full Company Address', 67 | 'crm_field' => 'company_address', 68 | ); 69 | 70 | $groundhogg_fields['website'] = array( 71 | 'crm_label' => 'Website', 72 | 'crm_field' => 'website', 73 | ); 74 | 75 | $groundhogg_fields['user_url'] = array( 76 | 'crm_label' => 'Website', 77 | 'crm_field' => 'website', 78 | ); 79 | 80 | $groundhogg_fields['billing_country'] = array( 81 | 'crm_label' => 'Country', 82 | 'crm_field' => 'country', 83 | ); 84 | 85 | $groundhogg_fields[] = array( 86 | 'crm_label' => 'Birthday', 87 | 'crm_field' => 'birthday', 88 | ); 89 | 90 | $groundhogg_fields[] = array( 91 | 'crm_label' => 'GDPR Consent', 92 | 'crm_field' => 'gdpr_consent', 93 | ); 94 | 95 | $groundhogg_fields[] = array( 96 | 'crm_label' => 'Agreed to Terms', 97 | 'crm_field' => 'terms_agreement', 98 | ); 99 | 100 | $groundhogg_fields[] = array( 101 | 'crm_label' => 'Consented to Marketing', 102 | 'crm_field' => 'marketing_consent', 103 | ); 104 | 105 | $groundhogg_fields[] = array( 106 | 'crm_label' => 'Optin Status', 107 | 'crm_field' => 'optin_status', 108 | ); 109 | 110 | $groundhogg_fields[] = array( 111 | 'crm_label' => 'Profile Picture', 112 | 'crm_field' => 'profile_picture', 113 | ); 114 | 115 | $groundhogg_fields[] = array( 116 | 'crm_label' => 'Owner ID', 117 | 'crm_field' => 'owner_id', 118 | ); 119 | -------------------------------------------------------------------------------- /includes/crms/activecampaign/includes/List.class.php: -------------------------------------------------------------------------------- 1 | version = $version; 12 | $this->url_base = $url_base; 13 | $this->url = $url; 14 | $this->api_key = $api_key; 15 | } 16 | 17 | function add( $params, $post_data ) { 18 | $request_url = "{$this->url}&api_action=list_add&api_output={$this->output}"; 19 | $response = $this->curl( $request_url, $post_data ); 20 | 21 | return $response; 22 | } 23 | 24 | function delete_list( $params ) { 25 | $request_url = "{$this->url}&api_action=list_delete_list&api_output={$this->output}&{$params}"; 26 | $response = $this->curl( $request_url ); 27 | 28 | return $response; 29 | } 30 | 31 | function delete( $params ) { 32 | $request_url = "{$this->url}&api_action=list_delete&api_output={$this->output}&{$params}"; 33 | $response = $this->curl( $request_url ); 34 | 35 | return $response; 36 | } 37 | 38 | function edit( $params, $post_data ) { 39 | $request_url = "{$this->url}&api_action=list_edit&api_output={$this->output}"; 40 | $response = $this->curl( $request_url, $post_data ); 41 | 42 | return $response; 43 | } 44 | 45 | function field_add( $params, $post_data ) { 46 | $request_url = "{$this->url}&api_action=list_field_add&api_output={$this->output}"; 47 | $response = $this->curl( $request_url, $post_data ); 48 | 49 | return $response; 50 | } 51 | 52 | function field_delete( $params ) { 53 | $request_url = "{$this->url}&api_action=list_field_delete&api_output={$this->output}&{$params}"; 54 | $response = $this->curl( $request_url ); 55 | 56 | return $response; 57 | } 58 | 59 | function field_edit( $params, $post_data ) { 60 | $request_url = "{$this->url}&api_action=list_field_edit&api_output={$this->output}"; 61 | $response = $this->curl( $request_url, $post_data ); 62 | 63 | return $response; 64 | } 65 | 66 | function field_view( $params ) { 67 | $request_url = "{$this->url}&api_action=list_field_view&api_output={$this->output}&{$params}"; 68 | $response = $this->curl( $request_url ); 69 | 70 | return $response; 71 | } 72 | 73 | function list_( $params, $post_data ) { 74 | if ( $post_data ) { 75 | if ( isset( $post_data['ids'] ) && is_array( $post_data['ids'] ) ) { 76 | // make them comma-separated. 77 | $post_data['ids'] = implode( ',', $post_data['ids'] ); 78 | } 79 | } 80 | $request_url = "{$this->url}&api_action=list_list&api_output={$this->output}&{$params}"; 81 | $response = $this->curl( $request_url, $post_data ); 82 | 83 | return $response; 84 | } 85 | 86 | function paginator( $params ) { 87 | $request_url = "{$this->url}&api_action=list_paginator&api_output={$this->output}&{$params}"; 88 | $response = $this->curl( $request_url ); 89 | 90 | return $response; 91 | } 92 | 93 | function view( $params ) { 94 | $request_url = "{$this->url}&api_action=list_view&api_output={$this->output}&{$params}"; 95 | $response = $this->curl( $request_url ); 96 | 97 | return $response; 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /includes/crms/convertfox/admin/convertfox-fields.php: -------------------------------------------------------------------------------- 1 | 'Full Name', 7 | 'crm_field' => 'name', 8 | ); 9 | 10 | $convertfox_fields['first_name'] = array( 11 | 'crm_label' => 'First Name', 12 | 'crm_field' => 'first_name', 13 | ); 14 | 15 | $convertfox_fields['last_name'] = array( 16 | 'crm_label' => 'Last Name', 17 | 'crm_field' => 'last_name', 18 | ); 19 | 20 | $convertfox_fields['user_email'] = array( 21 | 'crm_label' => 'Email', 22 | 'crm_field' => 'email', 23 | ); 24 | 25 | $convertfox_fields['billing_phone'] = array( 26 | 'crm_label' => 'Phone', 27 | 'crm_field' => 'phone', 28 | ); 29 | 30 | $convertfox_fields['phone'] = array( 31 | 'crm_label' => 'Phone', 32 | 'crm_field' => 'phone', 33 | ); 34 | 35 | $convertfox_fields['user_url'] = array( 36 | 'crm_label' => 'Website URL', 37 | 'crm_field' => 'website_url', 38 | ); 39 | 40 | // Lead tracking 41 | 42 | $convertfox_fields['landing_page'] = array( 43 | 'crm_label' => 'Landing URL', 44 | 'crm_field' => 'landing_url', 45 | ); 46 | 47 | $convertfox_fields['original_ref'] = array( 48 | 'crm_label' => 'Original Referrer', 49 | 'crm_field' => 'original_referrer', 50 | ); 51 | 52 | 53 | 54 | // Location data is read only 55 | 56 | // $convertfox_fields['billing_city'] = array( 57 | // 'crm_label' => 'City', 58 | // 'crm_field' => 'location+city_name', 59 | // ); 60 | 61 | // $convertfox_fields['billing_state'] = array( 62 | // 'crm_label' => 'State', 63 | // 'crm_field' => 'location+region_name', 64 | // ); 65 | 66 | // $convertfox_fields['billing_country'] = array( 67 | // 'crm_label' => 'Country', 68 | // 'crm_field' => 'location+country_code', 69 | // ); 70 | 71 | // $convertfox_fields['billing_postcode'] = array( 72 | // 'crm_label' => 'Postcode', 73 | // 'crm_field' => 'location+postal_code', 74 | // ); 75 | 76 | // Misc. 77 | 78 | $convertfox_fields[] = array( 79 | 'crm_label' => 'Job Title', 80 | 'crm_field' => 'job_title', 81 | ); 82 | 83 | $convertfox_fields[] = array( 84 | 'crm_label' => 'Company Name', 85 | 'crm_field' => 'company_name', 86 | ); 87 | 88 | $convertfox_fields[] = array( 89 | 'crm_label' => 'Mobile Phone', 90 | 'crm_field' => 'mobile_phone_number', 91 | ); 92 | 93 | $convertfox_fields[] = array( 94 | 'crm_label' => 'Fax Number', 95 | 'crm_field' => 'fax_number', 96 | ); 97 | 98 | $convertfox_fields[] = array( 99 | 'crm_label' => 'Preferred Language', 100 | 'crm_field' => 'preferred_language', 101 | ); 102 | 103 | $convertfox_fields[] = array( 104 | 'crm_label' => 'Fax Number', 105 | 'crm_field' => 'fax_number', 106 | ); 107 | 108 | $convertfox_fields[] = array( 109 | 'crm_label' => 'Industry', 110 | 'crm_field' => 'industry', 111 | ); 112 | 113 | $convertfox_fields[] = array( 114 | 'crm_label' => 'Date of Birth', 115 | 'crm_field' => 'date_of_birth', 116 | ); 117 | 118 | $convertfox_fields[] = array( 119 | 'crm_label' => 'Fax Number', 120 | 'crm_field' => 'fax_number', 121 | ); 122 | 123 | $convertfox_fields[] = array( 124 | 'crm_label' => 'Gender', 125 | 'crm_field' => 'gender', 126 | ); 127 | 128 | $convertfox_fields[] = array( 129 | 'crm_label' => 'Fax Number', 130 | 'crm_field' => 'fax_number', 131 | ); 132 | -------------------------------------------------------------------------------- /.cursor/rules/task-directives.mdc: -------------------------------------------------------------------------------- 1 | --- 2 | description: When a user request begins with "TASK:" (including the colon), this is a signal to follow a specific structured workflow. This is a high-priority directive that overrides other patterns. 3 | globs: *.php 4 | alwaysApply: true 5 | --- 6 | # TASK: Directive Handler 7 | 8 | When a user request begins with "TASK:", follow this structured workflow: 9 | 10 | ## 1. Initial Analysis 11 | 12 | - Analyze the provided context and task requirements 13 | - Search the codebase for relevant files and patterns 14 | - Look for similar implementations or examples 15 | - Understand the scope and requirements of the task 16 | 17 | ## 2. Scratchpad Management 18 | 19 | - Update [scratchpad.md](mdc:wp-fusion-lite/.cursor/scratchpad.md) with the following structure: 20 | ``` 21 | current_task: "Clear description of the task" 22 | status: in_progress 23 | description: Detailed explanation of what needs to be done 24 | 25 | steps: 26 | [ ] Step 1 with specific action 27 | [ ] Step 2 with specific action 28 | ... 29 | 30 | blockers: 31 | - Any potential issues or unknowns 32 | 33 | reflections: 34 | - Technical considerations 35 | - Implementation notes 36 | - Design decisions 37 | 38 | decisions: 39 | - Key decisions made during implementation 40 | ``` 41 | 42 | ## 3. Branch Creation 43 | 44 | - Create a new git branch from `master` using one of these prefixes: 45 | - `feature/` for new functionality 46 | - `fix/` for bug fixes 47 | - Follow the prefix with a short, descriptive name related to the task 48 | - Example: 49 | 50 | ``` 51 | git checkout -b feature/[TASK_IDENTIFIER] 52 | ``` 53 | 54 | ## 4. Implementation Process 55 | 56 | - Work through the steps in the scratchpad systematically 57 | - Update the scratchpad as progress is made (mark completed steps with [X]) 58 | - Add any new blockers, reflections, or decisions as they arise 59 | - Stop and ask for clarification when needed 60 | - Follow all coding standards in [instructions.md](mdc:wp-fusion-lite/wp-fusion/wp-fusion/wp-fusion/instructions.md) 61 | 62 | ## 5. Task Completion 63 | 64 | - Ensure all steps in the scratchpad are marked as complete 65 | - Update the scratchpad status to "complete" 66 | - Add a line to [readme.txt](mdc:wp-fusion-lite/wp-fusion/wp-fusion/wp-fusion/readme.txt) in the appropriate section (typically under the next version number) 67 | - Follow the existing writing style (concise, action-oriented) 68 | - Format should match: "Added/Improved/Fixed - Description of the change" 69 | - Summarize the changes made and any follow-up actions needed 70 | 71 | ## Example Workflow 72 | 73 | 1. Receive task: "TASK: Fix the Infusionsoft order notes functionality" 74 | 2. Update scratchpad with task details and steps 75 | 3. Create branch: `git checkout -b fix/infusionsoft-order-notes` 76 | 4. Implement the solution, updating scratchpad as you go 77 | 5. Add to readme.txt: "Fixed - Infusionsoft order notes not being properly synced with the CRM" 78 | 6. Summarize the changes and mark task as complete 79 | 80 | ## Important Guidelines 81 | 82 | - Always follow WordPress coding standards 83 | - Maintain backward compatibility 84 | - Add proper error handling and logging 85 | - Include appropriate documentation 86 | - Test thoroughly before marking complete 87 | - Ask for clarification rather than making assumptions -------------------------------------------------------------------------------- /includes/admin/gutenberg/src/secure-block-inner-secure/js/index.js: -------------------------------------------------------------------------------- 1 | import { __ } from '@wordpress/i18n'; 2 | import { registerBlockType } from '@wordpress/blocks'; 3 | import { InnerBlocks, useBlockProps } from '@wordpress/block-editor'; 4 | import { useSelect } from '@wordpress/data'; 5 | import { useState, useEffect } from '@wordpress/element'; 6 | import '../scss/editor.scss'; 7 | import icons from './icons'; 8 | 9 | const Edit = ( { clientId } ) => { 10 | const [ selectedTags, setSelectedTags ] = useState( [] ); 11 | const blockProps = useBlockProps(); 12 | 13 | const parentBlock = useSelect( 14 | ( select ) => { 15 | const { getBlockParents, getBlock } = select( 'core/block-editor' ); 16 | const parentIds = getBlockParents( clientId ); 17 | const parent = parentIds.filter( 18 | ( id ) => getBlock( id ).name === 'wp-fusion/secure-block' 19 | ); 20 | 21 | return parent.length ? getBlock( parent[ 0 ] ) : null; 22 | }, 23 | [ clientId ] 24 | ); 25 | const parentAttributes = parentBlock ? parentBlock.attributes : {}; 26 | 27 | const { className } = blockProps; 28 | const { tag } = parentAttributes; 29 | 30 | useEffect( () => { 31 | if ( tag ) { 32 | setSelectedTags( JSON.parse( tag ) ); 33 | } 34 | }, [ tag, setSelectedTags ] ); 35 | 36 | return ( 37 |
38 |
39 | { icons.lock } 40 | 41 | 42 | { __( 43 | 'Content shown to users that are', 44 | 'secure-blocks-for-gutenberg' 45 | ) } 46 | 47 | 48 | { __( 'logged-in', 'secure-blocks-for-gutenberg' ) } 49 | 50 | { selectedTags.length === 0 ? ( 51 | . 52 | ) : ( 53 | 54 | { 1 === selectedTags.length ? ( 55 | 56 | { __( 57 | 'and have the following tag:', 58 | 'secure-blocks-for-gutenberg' 59 | ) } 60 | 61 | ) : ( 62 | 63 | { __( 64 | 'and have any of the following tags:', 65 | 'secure-blocks-for-gutenberg' 66 | ) } 67 | 68 | ) } 69 | 70 | { Object( selectedTags ).map( 71 | ( value, key ) => ( 72 | 76 | 77 | { value.label } 78 | 79 | 80 | ) 81 | ) } 82 | 83 | 84 | ) } 85 | 86 |
87 | 88 | 92 |
93 | ); 94 | }; 95 | 96 | const Save = () => { 97 | const blockProps = useBlockProps.save(); 98 | return ( 99 |
100 | 101 |
102 | ); 103 | }; 104 | 105 | export default registerBlockType( 'wp-fusion/secure-block-inner-secure', { 106 | apiVersion: 3, 107 | title: __( 'Inner', 'secure-blocks-for-gutenberg' ), 108 | category: 'layout', 109 | attributes: {}, 110 | parent: [ 'wp-fusion/secure-block' ], 111 | edit: Edit, 112 | save: Save, 113 | } ); 114 | -------------------------------------------------------------------------------- /includes/crms/activecampaign/includes/README.md: -------------------------------------------------------------------------------- 1 | # ActiveCampaign PHP API Wrapper 2 | 3 | This is the official PHP wrapper for the ActiveCampaign API. The purpose of these files is to provide a simple interface to the ActiveCampaign API. You are **not** required to use these files (in order to use the ActiveCampaign API), but it's recommended for a few reasons: 4 | 5 | 1. It's a lot easier to get set up and use (as opposed to coding everything from scratch on your own). 6 | 2. It's fully supported by ActiveCampaign, meaning we fix any issues immediately, as well as continually improve the wrapper as the software changes and evolves. 7 | 3. It's often the standard approach for demonstrating API requests when using ActiveCampaign support. 8 | 9 | Both customers of our hosted platform and On-Site edition can use these files. On-Site customers should clone the source and switch to the "onsite" branch, as that is geared towards the On-Site edition. Many features of the hosted platform are not available in the On-Site edition. 10 | 11 | ## Installation 12 | 13 | You can install **activecampaign-api-php** by [downloading (.zip)](https://github.com/ActiveCampaign/activecampaign-api-php/zipball/master) or cloning the source: 14 | 15 | `git clone git@github.com:ActiveCampaign/activecampaign-api-php.git` 16 | 17 | ### Composer 18 | 19 | If you are using Composer, create your `composer.json` file ([example here](examples-composer/composer.json)). 20 | 21 | Then load the `composer.phar` file in that directory: 22 | 23 | `curl -sS https://getcomposer.org/installer | php` 24 | 25 | Next, run install to load the ActiveCampaign library: 26 | 27 | `php composer.phar install` 28 | 29 | You should then see the `activecampaign` folder inside `vendor`. 30 | 31 | [Read more about using Composer](https://getcomposer.org/doc/). 32 | 33 | ## Example Usage 34 | 35 | ### Composer 36 | 37 | In your script just include the `autoload.php` file to load all classes: 38 | 39 | `require "vendor/autoload.php";` 40 | 41 | Next, create a class instance of `ActiveCampaign`: 42 | 43 | `$ac = new ActiveCampaign("API_URL", "API_KEY");` 44 | 45 | That's it! 46 | 47 | ### includes/config.php 48 | 49 | define("ACTIVECAMPAIGN_URL", "API_URL"); 50 | define("ACTIVECAMPAIGN_API_KEY", "API_KEY"); 51 | 52 | ### examples.php 53 | 54 | require_once("includes/ActiveCampaign.class.php"); 55 | 56 | $ac = new ActiveCampaign(ACTIVECAMPAIGN_URL, ACTIVECAMPAIGN_API_KEY); 57 | 58 | // Adjust the default cURL timeout 59 | $ac->set_curl_timeout(10); 60 | 61 | $account = $ac->api("account/view"); 62 | 63 | Or just include everything in the same PHP file: 64 | 65 | define("ACTIVECAMPAIGN_URL", "API_URL"); 66 | define("ACTIVECAMPAIGN_API_KEY", "API_KEY"); 67 | require_once("includes/ActiveCampaign.class.php"); 68 | $ac = new ActiveCampaign(ACTIVECAMPAIGN_URL, ACTIVECAMPAIGN_API_KEY); 69 | 70 | // Adjust the default cURL timeout 71 | $ac->set_curl_timeout(10); 72 | 73 | $account = $ac->api("account/view"); 74 | 75 | See our [examples file](examples.php) for more in-depth samples. 76 | 77 | ## Full Documentation 78 | 79 | [Click here to view our full API documentation.](http://activecampaign.com/api) 80 | 81 | ## Reporting Issues 82 | 83 | We'd love to help if you have questions or problems. Report issues using the [Github Issue Tracker](https://github.com/ActiveCampaign/activecampaign-api-php/issues) or email help@activecampaign.com. -------------------------------------------------------------------------------- /includes/admin/gutenberg/src/secure-block/js/index.js: -------------------------------------------------------------------------------- 1 | import { __ } from '@wordpress/i18n'; 2 | import { registerBlockType } from '@wordpress/blocks'; 3 | import { 4 | InnerBlocks, 5 | InspectorControls, 6 | useBlockProps, 7 | } from '@wordpress/block-editor'; 8 | import { useState, useEffect } from '@wordpress/element'; 9 | import { PanelBody, PanelRow } from '@wordpress/components'; 10 | import WpfSelect from '@verygoodplugins/wpfselect'; 11 | import '../scss/editor.scss'; 12 | 13 | const Edit = ( { attributes: { tag }, setAttributes } ) => { 14 | const [ selectedTags, setSelectedTags ] = useState( [] ); 15 | const blockProps = useBlockProps(); 16 | 17 | useEffect( () => { 18 | if ( tag ) { 19 | setSelectedTags( JSON.parse( tag ) ); 20 | } 21 | }, [ tag, setSelectedTags ] ); 22 | 23 | const { className } = blockProps; 24 | 25 | const handleTagChange = ( innerTag ) => { 26 | setAttributes( { tag: JSON.stringify( innerTag ) } ); 27 | }; 28 | 29 | return ( 30 | <> 31 | 32 | 39 | 40 | 49 | 50 | 51 | 56 | 57 | 58 | 59 | { __( 60 | 'No selected tags mean that restricted content will be presented to all logged-in users.', 61 | 'secure-blocks-for-gutenberg' 62 | ) } 63 | 64 | 65 | 66 | 67 | 68 |
69 | 80 |
81 | { __( 'End: WP Fusion', 'wp-fusion-lite' ) } 82 |
83 |
84 | 85 | ); 86 | }; 87 | 88 | const Save = () => { 89 | const blockProps = useBlockProps.save(); 90 | 91 | return ( 92 |
93 | 94 |
95 | ); 96 | }; 97 | 98 | export default registerBlockType( 'wp-fusion/secure-block', { 99 | apiVersion: 3, 100 | title: __( 'WP Fusion', 'secure-blocks-for-gutenberg' ), 101 | description: __( 102 | 'By default the secure content is only shown if a user is logged in. You can also restrict the block to be visible to users with certain tags.', 103 | 'wp-fusion-lite' 104 | ), 105 | category: 'layout', 106 | icon: 'lock', 107 | keywords: [ 108 | __( 'Secure Block' ), 109 | __( 'Permissions' ), 110 | __( 'Password Protected' ), 111 | ], 112 | attributes: { 113 | tag: { 114 | type: 'string', 115 | default: null, 116 | }, 117 | }, 118 | edit: Edit, 119 | save: Save, 120 | } ); 121 | -------------------------------------------------------------------------------- /.cursor/rules/wordpress.mdc: -------------------------------------------------------------------------------- 1 | --- 2 | description: Base WordPress coding standards and patterns. Apply these rules to all PHP files in the project. 3 | globs: *.php 4 | alwaysApply: true 5 | --- 6 | # WordPress Development Rules 7 | 8 | ## File Documentation 9 | Every PHP file must start with: 10 | ```php 11 | /** 12 | * WP Fusion - Component Description 13 | * 14 | * @package WP Fusion 15 | * @copyright Copyright (c) 2024, Very Good Plugins, https://verygoodplugins.com 16 | * @license GPL-3.0+ 17 | * @since 3.37.14 18 | */ 19 | ``` 20 | 21 | ## Code Style 22 | - Use tabs for indentation 23 | - Keep lines under 100 characters 24 | - Use Yoda conditions 25 | - Add spaces after opening parentheses 26 | - Follow WordPress.org PHP Coding Standards 27 | 28 | ## Naming Conventions 29 | ``` 30 | files/ 31 | ├── class-example.php # Classes 32 | ├── interface-example.php # Interfaces 33 | └── trait-example.php # Traits 34 | 35 | WPF_Example # Class names (StudlyCaps) 36 | wpf_function_name() # Function names (lowercase_with_underscores) 37 | $descriptive_var # Variable names (clear purpose) 38 | ``` 39 | 40 | ## String Localization 41 | ```php 42 | // Simple strings 43 | __( 'Text', 'wp-fusion-lite' ) 44 | _e( 'Text', 'wp-fusion-lite' ) 45 | 46 | // With variables 47 | // translators: %1$s is the field name, %2$s is the error message 48 | sprintf( __( 'Error in %1$s: %2$s', 'wp-fusion-lite' ), $field, $message ) 49 | 50 | // Escaping translations 51 | esc_html__( 'Text', 'wp-fusion-lite' ) 52 | esc_attr__( 'Text', 'wp-fusion-lite' ) 53 | ``` 54 | 55 | ## Data Handling 56 | ```php 57 | // Input sanitization 58 | $clean_text = sanitize_text_field( $_POST['text'] ); 59 | $clean_email = sanitize_email( $_POST['email'] ); 60 | $clean_int = absint( $_GET['number'] ); 61 | $clean_html = wp_kses_post( $_POST['content'] ); 62 | 63 | // Output escaping 64 | echo esc_html( $text ); 65 | echo esc_url( $url ); 66 | echo esc_attr( $attribute ); 67 | echo wp_kses_post( $html ); 68 | 69 | // Data validation 70 | if ( ! is_email( $email ) ) { 71 | return new WP_Error( 'invalid_email', __( 'Invalid email address', 'wp-fusion-lite' ) ); 72 | } 73 | ``` 74 | 75 | ## Database Operations 76 | ```php 77 | global $wpdb; 78 | 79 | // Prepared statements 80 | $wpdb->get_row( $wpdb->prepare( 81 | "SELECT * FROM {$wpdb->prefix}table WHERE id = %d", 82 | $id 83 | ) ); 84 | 85 | // Insert/update 86 | $wpdb->insert( 87 | $wpdb->prefix . 'table', 88 | array( 'column' => $value ), 89 | array( '%s' ) 90 | ); 91 | ``` 92 | 93 | ## Action/Filter Usage 94 | ```php 95 | // Adding hooks 96 | add_action( 'init', array( $this, 'init' ), 10, 1 ); 97 | add_filter( 'wpf_example', array( $this, 'filter' ), 10, 2 ); 98 | 99 | // Running hooks 100 | do_action( 'wpf_event', $arg1, $arg2 ); 101 | $value = apply_filters( 'wpf_filter', $value, $arg ); 102 | ``` 103 | 104 | ## Documentation Standards 105 | - Only use `@access` tags for non-public methods and properties 106 | - Public methods and properties should not include `@access` tags 107 | 108 | 1. Class docblocks: 109 | ```php 110 | /** 111 | * Class description. 112 | * 113 | * @package WP Fusion 114 | * @since x.x.x 115 | */ 116 | ``` 117 | 118 | 2. Method docblocks: 119 | ```php 120 | /** 121 | * Method description. 122 | * 123 | * @since x.x.x 124 | * 125 | * @param string $param Description. 126 | * @return mixed Description. 127 | */ 128 | ``` 129 | 130 | 3. Complex logic needs inline comments: 131 | ```php 132 | // Check if user has required capability before proceeding 133 | if ( ! current_user_can( 'manage_options' ) ) { 134 | return new WP_Error( 'unauthorized', __( 'You do not have permission to perform this action.', 'wp-fusion-lite' ) ); 135 | } 136 | ``` -------------------------------------------------------------------------------- /includes/crms/activecampaign/includes/Message.class.php: -------------------------------------------------------------------------------- 1 | version = $version; 12 | $this->url_base = $url_base; 13 | $this->url = $url; 14 | $this->api_key = $api_key; 15 | } 16 | 17 | function add( $params, $post_data ) { 18 | $request_url = "{$this->url}&api_action=message_add&api_output={$this->output}"; 19 | $response = $this->curl( $request_url, $post_data ); 20 | 21 | return $response; 22 | } 23 | 24 | function delete_list( $params ) { 25 | $request_url = "{$this->url}&api_action=message_delete_list&api_output={$this->output}&{$params}"; 26 | $response = $this->curl( $request_url ); 27 | 28 | return $response; 29 | } 30 | 31 | function delete( $params ) { 32 | $request_url = "{$this->url}&api_action=message_delete&api_output={$this->output}&{$params}"; 33 | $response = $this->curl( $request_url ); 34 | 35 | return $response; 36 | } 37 | 38 | function edit( $params, $post_data ) { 39 | $request_url = "{$this->url}&api_action=message_edit&api_output={$this->output}"; 40 | $response = $this->curl( $request_url, $post_data ); 41 | 42 | return $response; 43 | } 44 | 45 | function list_( $params ) { 46 | $request_url = "{$this->url}&api_action=message_list&api_output={$this->output}&{$params}"; 47 | $response = $this->curl( $request_url ); 48 | 49 | return $response; 50 | } 51 | 52 | function template_add( $params, $post_data ) { 53 | $request_url = "{$this->url}&api_action=message_template_add&api_output={$this->output}"; 54 | $response = $this->curl( $request_url, $post_data ); 55 | 56 | return $response; 57 | } 58 | 59 | function template_delete_list( $params ) { 60 | $request_url = "{$this->url}&api_action=message_template_delete_list&api_output={$this->output}&{$params}"; 61 | $response = $this->curl( $request_url ); 62 | 63 | return $response; 64 | } 65 | 66 | function template_delete( $params ) { 67 | $request_url = "{$this->url}&api_action=message_template_delete&api_output={$this->output}&{$params}"; 68 | $response = $this->curl( $request_url ); 69 | 70 | return $response; 71 | } 72 | 73 | function template_edit( $params, $post_data ) { 74 | $request_url = "{$this->url}&api_action=message_template_edit&api_output={$this->output}"; 75 | $response = $this->curl( $request_url, $post_data ); 76 | 77 | return $response; 78 | } 79 | 80 | function template_export( $params ) { 81 | $request_url = "{$this->url}&api_action=message_template_export&api_output={$this->output}&{$params}"; 82 | $response = $this->curl( $request_url ); 83 | 84 | return $response; 85 | } 86 | 87 | function template_import( $params, $post_data ) { 88 | $request_url = "{$this->url}&api_action=message_template_import&api_output={$this->output}"; 89 | $response = $this->curl( $request_url, $post_data ); 90 | 91 | return $response; 92 | } 93 | 94 | function template_list( $params ) { 95 | $request_url = "{$this->url}&api_action=message_template_list&api_output={$this->output}&{$params}"; 96 | $response = $this->curl( $request_url ); 97 | 98 | return $response; 99 | } 100 | 101 | function template_view( $params ) { 102 | $request_url = "{$this->url}&api_action=message_template_view&api_output={$this->output}&{$params}"; 103 | $response = $this->curl( $request_url ); 104 | 105 | return $response; 106 | } 107 | 108 | function view( $params ) { 109 | $request_url = "{$this->url}&api_action=message_view&api_output={$this->output}&{$params}"; 110 | $response = $this->curl( $request_url ); 111 | 112 | return $response; 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /includes/crms/activecampaign/includes/ActiveCampaign.class.php: -------------------------------------------------------------------------------- 1 | url_base = $this->url = $url; 22 | $this->api_key = $api_key; 23 | parent::__construct( $url, $api_key, $api_user, $api_pass ); 24 | } 25 | 26 | function version( $version ) { 27 | $this->version = (int) $version; 28 | if ( $version == 2 ) { 29 | $this->url_base = $this->url_base . '/2'; 30 | } 31 | } 32 | 33 | function api( $path, $post_data = array() ) { 34 | // IE: "contact/view" 35 | $components = explode( '/', $path ); 36 | $component = $components[0]; 37 | 38 | if ( count( $components ) > 2 ) { 39 | // IE: "contact/tag/add?whatever" 40 | // shift off the first item (the component, IE: "contact"). 41 | array_shift( $components ); 42 | // IE: convert to "tag_add?whatever" 43 | $method_str = implode( '_', $components ); 44 | $components = array( $component, $method_str ); 45 | } 46 | 47 | if ( preg_match( '/\?/', $components[1] ) ) { 48 | // query params appended to method 49 | // IE: contact/edit?overwrite=0 50 | $method_arr = explode( '?', $components[1] ); 51 | $method = $method_arr[0]; 52 | $params = $method_arr[1]; 53 | } else { 54 | // just a method provided 55 | // IE: "contact/view 56 | if ( isset( $components[1] ) ) { 57 | $method = $components[1]; 58 | $params = ''; 59 | } else { 60 | return 'Invalid method.'; 61 | } 62 | } 63 | 64 | // adjustments 65 | if ( $component == 'list' ) { 66 | // reserved word 67 | $component = 'list_'; 68 | } elseif ( $component == 'branding' ) { 69 | $component = 'design'; 70 | } elseif ( $component == 'sync' ) { 71 | $component = 'contact'; 72 | $method = 'sync'; 73 | } elseif ( $component == 'singlesignon' ) { 74 | $component = 'auth'; 75 | } 76 | 77 | $class = ucwords( $component ); // IE: "contact" becomes "Contact" 78 | $class = 'AC_' . $class; 79 | // IE: new Contact(); 80 | 81 | $add_tracking = false; 82 | if ( $class == 'AC_Tracking' ) { 83 | $add_tracking = true; 84 | } 85 | 86 | $class = new $class( $this->version, $this->url_base, $this->url, $this->api_key ); 87 | // IE: $contact->view() 88 | 89 | if ( $add_tracking ) { 90 | $class->track_email = $this->track_email; 91 | $class->track_actid = $this->track_actid; 92 | $class->track_key = $this->track_key; 93 | } 94 | 95 | if ( $method == 'list' ) { 96 | // reserved word 97 | $method = 'list_'; 98 | } 99 | 100 | $class->debug = $this->debug; 101 | 102 | $response = $class->$method( $params, $post_data ); 103 | 104 | return $response; 105 | } 106 | } 107 | 108 | require_once 'Account.class.php'; 109 | require_once 'Auth.class.php'; 110 | require_once 'Automation.class.php'; 111 | require_once 'Campaign.class.php'; 112 | require_once 'Contact.class.php'; 113 | require_once 'Deal.class.php'; 114 | require_once 'Design.class.php'; 115 | require_once 'Form.class.php'; 116 | require_once 'Group.class.php'; 117 | require_once 'List.class.php'; 118 | require_once 'Message.class.php'; 119 | require_once 'Settings.class.php'; 120 | require_once 'Subscriber.class.php'; 121 | require_once 'Tracking.class.php'; 122 | require_once 'User.class.php'; 123 | require_once 'Webhook.class.php'; 124 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WP Fusion Lite # 2 | 3 | WP Fusion connects your WordPress website to your CRM or marketing automation system. 4 | 5 | This is the Lite version of [WP Fusion](https://wpfusion.com/). It interfaces with WordPress core, but does not include any plugin-specific integrations. 6 | 7 | 8 | ### For end users 9 | 10 | All new users who register on your site will be synced to your CRM of choice, with support for any number of custom fields. Tags and/or lists can also be assigned at time of registration. 11 | 12 | After registration, future profile updates are kept in sync with their CRM contact records. 13 | 14 | ### For developers 15 | 16 | WP Fusion provides an extensible framework for connecting WordPress to leading CRMs and marketing automation tools. 17 | 18 | WP Fusion handles authentication, sanitization of data, and error reporting. 19 | 20 | WP Fusion also standardizes many common API operations. For example: 21 | 22 | ```php 23 | $args = array( 24 | 'user_email' => 'newuser@example.com', 25 | 'first_name' => 'First Name' 26 | ); 27 | 28 | $contact_id = wp_fusion()->crm->add_contact( $args ); 29 | ``` 30 | 31 | This code will add a new contact to the active CRM and return the contact ID. 32 | 33 | For more information see [the WP Fusion User Class](https://wpfusion.com/documentation/advanced-developer-tutorials/wp-fusion-user-class/), the [CRM Class](https://wpfusion.com/documentation/advanced-developer-tutorials/how-wp-fusion-interfaces-with-multiple-crms/) and the [Developer Reference](https://wpfusion.com/documentation/#developer). 34 | 35 | ### Supported CRMs 36 | 37 | * ActiveCampaign 38 | * AgileCRM 39 | * Autonami 40 | * Autopilot 41 | * BirdSend 42 | * Bento 43 | * Capsule 44 | * Constant Contact 45 | * ConvertKit 46 | * Copper 47 | * Customerly 48 | * Customer.io 49 | * Drift 50 | * Drip 51 | * EmailOctopus 52 | * Emercury 53 | * Encharge 54 | * Engage 55 | * EngageBay 56 | * Flexie 57 | * FluentCRM (Same site or REST API) 58 | * GetResponse 59 | * Gist 60 | * Groundhogg (Same site or REST API) 61 | * Growmatik 62 | * HighLevel 63 | * HubSpot 64 | * Infusionsoft 65 | * Intercom 66 | * Jetpack CRM 67 | * Kartra 68 | * Klaviyo 69 | * Klick-Tipp 70 | * Loopify 71 | * MailChimp 72 | * MailEngine 73 | * MailerLite 74 | * Mailjet 75 | * MailPoet 76 | * Maropost 77 | * Microsoft Dynamics 365 78 | * Moosend 79 | * Mautic 80 | * NationBuilder 81 | * Omnisend 82 | * Ontraport 83 | * Ortto 84 | * Pipedrive 85 | * Platform.ly 86 | * PulseTechnologyCRM 87 | * Quentn 88 | * Salesflare 89 | * Salesforce 90 | * Sender.net 91 | * SendFox 92 | * SendinBlue 93 | * Sendlane 94 | * Tubular 95 | * UserEngage 96 | * WP ERP 97 | * Zoho 98 | 99 | ## Installation ## 100 | 101 | For detailed setup instructions for each CRM, visit the official [Documentation](https://wpfusion.com/documentation/getting-started/installation-guide/) page. 102 | 103 | 1. You can clone the GitHub repository: `https://github.com/verygoodplugins/wp-fusion-lite.git` 104 | 2. Or download it directly as a ZIP file: `https://github.com/verygoodplugins/wp-fusion-lite/archive/master.zip` 105 | 106 | This will download the latest copy of WP Fusion Lite. 107 | 108 | ## Changelog ## 109 | 110 | See readme.txt. 111 | 112 | ## Bugs ## 113 | If you find an issue, let us know [here](https://github.com/verygoodplugins/wp-fusion-lite/issues?state=open)! 114 | 115 | ## How can I report security bugs? ## 116 | 117 | You can report security bugs through the Patchstack Vulnerability Disclosure Program. The Patchstack team help validate, triage and handle any security vulnerabilities. [Report a security vulnerability.](https://patchstack.com/database/vdp/wp-fusion-lite) 118 | 119 | ## Support ## 120 | This is a developer's portal for WP Fusion Lite and should _not_ be used for support. Please visit the [support page](https://wpfusion.com/support/contact) if you need to submit a support request. 121 | -------------------------------------------------------------------------------- /includes/crms/activecampaign/includes/Tracking.class.php: -------------------------------------------------------------------------------- 1 | version = $version; 12 | $this->url_base = $url_base; 13 | $this->url = $url; 14 | $this->api_key = $api_key; 15 | } 16 | 17 | /* 18 | * Update the status (enabled or disabled) for site tracking. 19 | */ 20 | function site_status( $params, $post_data ) { 21 | // version 2 only. 22 | $request_url = "{$this->url_base}/track/site"; 23 | $response = $this->curl( $request_url, $post_data, 'POST', 'tracking_site_status' ); 24 | 25 | return $response; 26 | } 27 | 28 | /* 29 | * Update the status (enabled or disabled) for event tracking. 30 | */ 31 | function event_status( $params, $post_data ) { 32 | // version 2 only. 33 | $request_url = "{$this->url_base}/track/event"; 34 | $response = $this->curl( $request_url, $post_data, 'POST', 'tracking_event_status' ); 35 | 36 | return $response; 37 | } 38 | 39 | /* 40 | * Returns existing whitelisted domains. 41 | */ 42 | function site_list( $params ) { 43 | if ( $this->version == 1 ) { 44 | // not supported currently. 45 | // $request_url = "{$this->url}&api_action=contact_delete_list&api_output={$this->output}&{$params}"; 46 | } elseif ( $this->version == 2 ) { 47 | $request_url = "{$this->url_base}/track/site"; 48 | } 49 | $response = $this->curl( $request_url, array(), 'GET', 'tracking_site_list' ); 50 | 51 | return $response; 52 | } 53 | 54 | /* 55 | * Returns existing tracked events. 56 | */ 57 | function event_list( $params ) { 58 | if ( $this->version == 1 ) { 59 | // not supported currently. 60 | // $request_url = "{$this->url}&api_action=contact_delete_list&api_output={$this->output}&{$params}"; 61 | } elseif ( $this->version == 2 ) { 62 | $request_url = "{$this->url_base}/track/event"; 63 | } 64 | $response = $this->curl( $request_url, array(), 'GET', 'tracking_event_list' ); 65 | 66 | return $response; 67 | } 68 | 69 | /* 70 | * Adds a domain to the site tracking whitelist. 71 | */ 72 | function whitelist( $params, $post_data ) { 73 | // version 2 only. 74 | $request_url = "{$this->url_base}/track/site"; 75 | $response = $this->curl( $request_url, $post_data, 'PUT', 'tracking_whitelist' ); 76 | 77 | return $response; 78 | } 79 | 80 | /* 81 | * Removes a domain from the site tracking whitelist. 82 | */ 83 | function whitelist_remove( $params, $post_data ) { 84 | // version 2 only. 85 | $request_url = "{$this->url_base}/track/site"; 86 | $response = $this->curl( $request_url, $post_data, 'DELETE', 'tracking_whitelist' ); 87 | 88 | return $response; 89 | } 90 | 91 | /* 92 | * Removes an event. 93 | */ 94 | function event_remove( $params, $post_data ) { 95 | // version 2 only. 96 | $request_url = "{$this->url_base}/track/event"; 97 | $response = $this->curl( $request_url, $post_data, 'DELETE', 'tracking_event_remove' ); 98 | 99 | return $response; 100 | } 101 | 102 | /* 103 | * Adds a new event. 104 | */ 105 | function log( $params, $post_data ) { 106 | $request_url = 'https://trackcmp.net/event'; 107 | $post_data['actid'] = $this->track_actid; 108 | $post_data['key'] = $this->track_key; 109 | $visit_data = array(); 110 | if ( $this->track_email ) { 111 | $visit_data['email'] = $this->track_email; 112 | } 113 | if ( isset( $post_data['visit'] ) ) { 114 | $visit_data = array_merge( $visit_data, $post_data['visit'] ); 115 | } 116 | if ( $visit_data ) { 117 | $post_data['visit'] = wp_json_encode( $visit_data ); 118 | } 119 | $response = $this->curl( $request_url, $post_data, 'POST', 'tracking_log' ); 120 | 121 | return $response; 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /includes/crms/engagebay/admin/engagebay-fields.php: -------------------------------------------------------------------------------- 1 | 'First Name', 10 | 'crm_field' => 'name', 11 | ); 12 | 13 | $engagebay_fields['last_name'] = array( 14 | 'crm_label' => 'Last Name', 15 | 'crm_field' => 'last_name', 16 | ); 17 | 18 | $engagebay_fields['user_email'] = array( 19 | 'crm_label' => 'Email', 20 | 'crm_field' => 'email+primary', 21 | ); 22 | 23 | $engagebay_fields['crm_role'] = array( 24 | 'crm_label' => 'CRM Role', 25 | 'crm_field' => 'role', 26 | ); 27 | 28 | // PHONE FIELDS 29 | $engagebay_fields['billing_phone'] = array( 30 | 'crm_label' => 'Phone (Work)', 31 | 'crm_field' => 'phone+work', 32 | ); 33 | 34 | $engagebay_fields['phone_number_home'] = array( 35 | 'crm_label' => 'Phone (Home)', 36 | 'crm_field' => 'phone+home', 37 | ); 38 | 39 | $engagebay_fields['phone_number_mobile'] = array( 40 | 'crm_label' => 'Phone (Mobile)', 41 | 'crm_field' => 'phone+mobile', 42 | ); 43 | 44 | $engagebay_fields['phone_number_main'] = array( 45 | 'crm_label' => 'Phone (Main)', 46 | 'crm_field' => 'phone+main', 47 | ); 48 | 49 | $engagebay_fields['phone_number_fax'] = array( 50 | 'crm_label' => 'Phone (Home Fax)', 51 | 'crm_field' => 'phone+home_fax', 52 | ); 53 | 54 | $engagebay_fields['phone_number_work_fax'] = array( 55 | 'crm_label' => 'Phone (Work Fax)', 56 | 'crm_field' => 'phone+work_fax', 57 | ); 58 | 59 | $engagebay_fields['phone_number_other'] = array( 60 | 'crm_label' => 'Phone (Other)', 61 | 'crm_field' => 'phone+other', 62 | ); 63 | 64 | 65 | // URL FIELDS 66 | 67 | $engagebay_fields['website'] = array( 68 | 'crm_label' => 'Website (Personal)', 69 | 'crm_field' => 'website+URL', 70 | ); 71 | 72 | $engagebay_fields['linkedin'] = array( 73 | 'crm_label' => 'Website (LinkedIn)', 74 | 'crm_field' => 'website+LINKEDIN', 75 | ); 76 | 77 | $engagebay_fields['skype'] = array( 78 | 'crm_label' => 'Website (Skype URL)', 79 | 'crm_field' => 'website+SKYPE', 80 | ); 81 | 82 | $engagebay_fields['twitter'] = array( 83 | 'crm_label' => 'Website (Twitter)', 84 | 'crm_field' => 'website+TWITTER', 85 | ); 86 | 87 | $engagebay_fields['facebook'] = array( 88 | 'crm_label' => 'Website (Facebook)', 89 | 'crm_field' => 'website+FACEBOOK', 90 | ); 91 | 92 | $engagebay_fields['xing'] = array( 93 | 'crm_label' => 'Website (XING)', 94 | 'crm_field' => 'website+XING', 95 | ); 96 | 97 | $engagebay_fields['blog'] = array( 98 | 'crm_label' => 'Website (Your Blog)', 99 | 'crm_field' => 'website+FEED', 100 | ); 101 | 102 | $engagebay_fields['google_plus'] = array( 103 | 'crm_label' => 'Website (Google+)', 104 | 'crm_field' => 'website+GOOGLE-PLUS', 105 | ); 106 | 107 | $engagebay_fields['flikr'] = array( 108 | 'crm_label' => 'Website (Flikr)', 109 | 'crm_field' => 'website+FLIKR', 110 | ); 111 | 112 | $engagebay_fields['github'] = array( 113 | 'crm_label' => 'Website (github)', 114 | 'crm_field' => 'website+GITHUB', 115 | ); 116 | 117 | $engagebay_fields['youtube'] = array( 118 | 'crm_label' => 'Website (YouTube)', 119 | 'crm_field' => 'website+YOUTUBE', 120 | ); 121 | 122 | // Address 123 | 124 | $engagebay_fields['billing_address_1'] = array( 125 | 'crm_label' => 'Address 1', 126 | 'crm_field' => 'address+address', 127 | ); 128 | 129 | $engagebay_fields['billing_city'] = array( 130 | 'crm_label' => 'City', 131 | 'crm_field' => 'address+city', 132 | ); 133 | 134 | $engagebay_fields['billing_state'] = array( 135 | 'crm_label' => 'State', 136 | 'crm_field' => 'address+state', 137 | ); 138 | 139 | $engagebay_fields['billing_postcode'] = array( 140 | 'crm_label' => 'Zip', 141 | 'crm_field' => 'address+zip', 142 | ); 143 | 144 | $engagebay_fields['billing_country'] = array( 145 | 'crm_label' => 'Country', 146 | 'crm_field' => 'address+country', 147 | ); 148 | -------------------------------------------------------------------------------- /includes/admin/class-notices.php: -------------------------------------------------------------------------------- 1 | id || 'users' === $screen->id || 'woocommerce_page_wc-orders' === $screen->id ) ) { 47 | do_action( 'wpf_settings_notices' ); 48 | } 49 | } 50 | 51 | /** 52 | * Shows a notice on first activation 53 | * 54 | * @access public 55 | * @return mixed 56 | */ 57 | public function plugin_activation() { 58 | 59 | if ( ! wpf_get_option( 'connection_configured' ) && 'settings_page_wpf-settings' !== get_current_screen()->id ) { 60 | 61 | echo '
'; 62 | echo '

'; 63 | printf( esc_html__( 'To finish setting up WP Fusion, please go to the %1$sWP Fusion settings page%2$s.', 'wp-fusion-lite' ), '', '' ); 64 | echo '

'; 65 | echo '
'; 66 | 67 | } 68 | } 69 | 70 | /** 71 | * Shows compatibility notices with other plugins, on the WPF settings page 72 | * 73 | * @since 3.33.4 74 | * @return mixed HTML output 75 | */ 76 | public function show_compatibility_notices() { 77 | 78 | $notices = apply_filters( 'wpf_compatibility_notices', array() ); 79 | 80 | foreach ( $notices as $id => $message ) { 81 | 82 | if ( wpf_get_option( "dismissed_{$id}" ) ) { 83 | continue; 84 | } 85 | 86 | echo '

' . wp_kses_post( $message ) . '

'; 87 | 88 | } 89 | } 90 | 91 | /** 92 | * Shows notices that were queued up on init (connection issues, etc). 93 | * 94 | * @since 3.42.12 95 | * @return mixed HTML output 96 | */ 97 | public function show_session_notices() { 98 | 99 | foreach ( $this->settings_notices as $message ) { 100 | 101 | echo '

' . wp_kses_post( $message ) . '

'; 102 | 103 | } 104 | } 105 | 106 | /** 107 | * Adds a notice to be displayed 108 | * 109 | * @since 3.42.2 110 | * @param string $message The message. 111 | */ 112 | public function add_notice( $message ) { 113 | 114 | $this->settings_notices[] = $message; 115 | } 116 | 117 | /** 118 | * Saves option that notice has been dismissed 119 | * 120 | * @access public 121 | * @return void 122 | */ 123 | public function dismiss_notice() { 124 | 125 | check_ajax_referer( 'wpf_settings_nonce' ); 126 | 127 | if ( isset( $_POST['id'] ) ) { 128 | 129 | $id = sanitize_text_field( wp_unslash( $_POST['id'] ) ); 130 | wp_fusion()->settings->set( "dismissed_{$id}", true ); 131 | 132 | } 133 | 134 | wp_die(); 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /assets/js/wpf-elementor-forms.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | var wpfElementorFormsIntegration = { 3 | fields: wpfElementorObject.fields, 4 | 5 | getName() { 6 | return "wpfusion"; 7 | }, 8 | 9 | onElementChange(setting) { 10 | if (setting.indexOf("wpfusion") !== -1) { 11 | this.updateFieldsMap(); 12 | } 13 | }, 14 | 15 | onSectionActive() { 16 | this.updateFieldsMap(); 17 | }, 18 | 19 | updateFieldsMap() { 20 | this.getEditorControlView("wpfusion_fields_map").updateMap(); 21 | }, 22 | }; 23 | 24 | /** 25 | * Gh Fields Map. 26 | */ 27 | var FieldsMap = { 28 | onBeforeRender() { 29 | 30 | this.$el.hide(); 31 | }, 32 | 33 | updateMap() { 34 | const savedMapObject = {}; 35 | this.collection.each((model) => { 36 | savedMapObject[model.get("local_id")] = model.get("remote_id"); 37 | }); 38 | 39 | const collectionLength = this.collection.length; 40 | for (let i = collectionLength - 1; i >= 0; i--) { 41 | $e.run('document/repeater/remove', { 42 | container: this.container, 43 | name: this.model.get('name'), 44 | index: i 45 | }); 46 | } 47 | 48 | var fields = this.container.settings.get("form_fields").models; 49 | 50 | _.each(fields, (field) => { 51 | const model = { 52 | local_id: field.get("custom_id"), 53 | local_label: field.get("field_label"), 54 | remote_id: savedMapObject[field.get("custom_id")] 55 | ? savedMapObject[field.get("custom_id")] 56 | : "", 57 | }; 58 | 59 | $e.run('document/repeater/insert', { 60 | container: this.container, 61 | name: this.model.get('name'), 62 | model: model 63 | }); 64 | }); 65 | 66 | this.render(); 67 | }, 68 | 69 | getFieldOptions() { 70 | return elementorPro.modules.forms.wpfusion.fields; 71 | }, 72 | 73 | onRender() { 74 | this.children.each((view) => { 75 | var localFieldsControl = view.children.last(), 76 | options = { 77 | "": "- " + elementor.translate("None") + " -", 78 | }, 79 | label = view.model.get("local_label"); 80 | 81 | _.each(this.getFieldOptions(), (model, index) => { 82 | options[model.remote_id] = 83 | model.remote_label || "Field #" + (index + 1); 84 | }); 85 | 86 | localFieldsControl.model.set("label", label); 87 | localFieldsControl.model.set("options", options); 88 | 89 | localFieldsControl.render(); 90 | 91 | view.$el.find(".elementor-repeater-row-tools").hide(); 92 | view.$el 93 | .find(".elementor-repeater-row-controls") 94 | .removeClass("elementor-repeater-row-controls") 95 | .find(".elementor-control") 96 | .css({ 97 | padding: "10px 0", 98 | }); 99 | }); 100 | 101 | this.$el.find(".elementor-button-wrapper").remove(); 102 | 103 | if (this.children.length) { 104 | this.$el.show(); 105 | } 106 | }, 107 | }; 108 | 109 | var wpfElementorForms = { 110 | init: function () { 111 | 112 | elementor.addControlView( 113 | "wpf_fields_map", 114 | elementor.modules.controls.Fields_map.extend(FieldsMap) 115 | ); 116 | 117 | elementorPro.modules.forms.wpfusion = { 118 | ...elementorPro.modules.forms.activecampaign, 119 | ...wpfElementorFormsIntegration, 120 | }; 121 | 122 | elementorPro.modules.forms.wpfusion.addSectionListener( 123 | "section_wpfusion", 124 | () => { 125 | elementorPro.modules.forms.wpfusion.onSectionActive(); 126 | } 127 | ); 128 | 129 | }, 130 | }; 131 | 132 | setTimeout(() => { 133 | wpfElementorForms.init(); 134 | }, 3000); 135 | })(jQuery); 136 | -------------------------------------------------------------------------------- /.cursor/rules/core.mdc: -------------------------------------------------------------------------------- 1 | --- 2 | description: Core WP Fusion architectural patterns and development guidelines. Use when working with core plugin functionality. 3 | globs: *php 4 | alwaysApply: false 5 | --- 6 | # Core Development Rules 7 | 8 | ## Architecture Principles 9 | - Maintain backward compatibility 10 | - Follow WordPress coding standards 11 | - Use dependency injection where possible 12 | - Keep classes focused and single-purpose 13 | - Use interfaces for standardization 14 | 15 | ## Directory Structure 16 | ``` 17 | wp-fusion/ 18 | ├── includes/ 19 | │ ├── admin/ # Admin interfaces 20 | │ ├── crm/ # CRM handlers 21 | │ ├── integrations/ # Plugin integrations 22 | │ └── class-*.php # Core classes 23 | ├── assets/ # JS, CSS, images 24 | └── tests/ # PHPUnit tests 25 | ``` 26 | 27 | ## Coding Patterns 28 | ```php 29 | // Singleton pattern 30 | class WPF_Example { 31 | private static $instance; 32 | 33 | public static function instance() { 34 | if ( ! isset( self::$instance ) ) { 35 | self::$instance = new self(); 36 | } 37 | return self::$instance; 38 | } 39 | } 40 | 41 | // Hook registration 42 | class WPF_Feature { 43 | public function __construct() { 44 | add_action( 'init', array( $this, 'init' ) ); 45 | add_filter( 'wpf_example', array( $this, 'filter_example' ) ); 46 | } 47 | } 48 | 49 | /** 50 | * Handles the HTTP Response 51 | * 52 | * @since x.x.x 53 | * 54 | * @param HTTP_Response $response The HTTP response data. 55 | * @return HTTP_Response|WP_Error Response on success, error on failure. 56 | */ 57 | public function handle_response( $response ) { 58 | if ( is_wp_error( $response ) ) { 59 | wpf_log( 'error', 0, 'Error: ' . $response->get_error_message() ); 60 | return false; 61 | } 62 | 63 | $body = json_decode( wp_remote_retrieve_body( $response ) ); 64 | 65 | if ( ! $body ) { 66 | wpf_log( 'error', 0, 'Invalid response: ' . wp_remote_retrieve_body( $response ) ); 67 | return false; 68 | } 69 | 70 | return $body; 71 | } 72 | ``` 73 | 74 | ## Performance Guidelines 75 | - Cache expensive operations 76 | - Use transients appropriately 77 | - Batch process large operations 78 | - Minimize database queries 79 | - Use WordPress object cache 80 | 81 | ## Security Requirements 82 | - Validate and sanitize all inputs 83 | - Use prepared SQL statements 84 | - Check capabilities and nonces 85 | - Escape output 86 | - Follow WordPress security best practices 87 | 88 | ## Common Functions 89 | ```php 90 | // Logging 91 | wpf_log( 'notice', $user_id, $message ); 92 | 93 | // Options 94 | wpf_get_option( 'option_name' ); 95 | 96 | // User meta 97 | wp_fusion()->user->get_tags( $user_id ); 98 | wp_fusion()->user->apply_tags( $tags, $user_id ); 99 | 100 | // CRM operations 101 | wp_fusion()->crm->add_contact( $data ); 102 | ``` 103 | 104 | ## Error Handling 105 | - Use wp_error for WordPress-style errors 106 | - Log meaningful error messages 107 | - Provide user-friendly notices 108 | - Handle API failures gracefully 109 | - Implement retry mechanisms 110 | 111 | ## Documentation Requirements 112 | - PHPDoc blocks for classes/methods 113 | - Inline comments for complex logic 114 | - Document all filters/actions 115 | - Update changelog 116 | - Keep README.md current 117 | 118 | ## Versioning & @since Tags 119 | - Every new class must include a `@since x.x.x` tag 120 | - Every new method must include a `@since x.x.x` tag 121 | - Every new property must include a `@since x.x.x` tag 122 | - Use `x.x.x` placeholder which will be replaced at release time 123 | - Example format: 124 | ```php 125 | /** 126 | * The plugin name for WP Fusion's module tracking. 127 | * 128 | * @since x.x.x 129 | * @var string 130 | */ 131 | public $name = 'Example Plugin'; 132 | 133 | /** 134 | * Handles the form submission. 135 | * 136 | * @since x.x.x 137 | * 138 | * @param array $data The form data. 139 | * @return bool True on success. 140 | */ 141 | public function handle_form( $data ) { 142 | // Method implementation 143 | } 144 | ``` -------------------------------------------------------------------------------- /.cursor/rules/crm-integration.mdc: -------------------------------------------------------------------------------- 1 | --- 2 | description: Guidelines for creating new CRM integrations. Apply when developing or modifying CRM modules in /includes/crms/* 3 | globs: includes/crms/**/*.php 4 | alwaysApply: false 5 | --- 6 | # CRM Integration Development Rules 7 | 8 | ## File Structure 9 | - Place new CRM classes in `includes/crms/{crm-slug}/` 10 | - Main CRM class: `includes/crms/{crm-slug}/class-{crm-slug}.php` 11 | - Admin class: `includes/crms/{crm-slug}/class-{crm-slug}-admin.php` 12 | - Follow naming convention: lowercase with hyphens 13 | 14 | ## Class Properties 15 | ```php 16 | class WPF_Example extends WPF_CRM_Base { 17 | /** 18 | * The CRM slug 19 | */ 20 | public $slug = 'example'; 21 | 22 | /** 23 | * The CRM name 24 | */ 25 | public $name = 'Example CRM'; 26 | 27 | /** 28 | * API URL 29 | */ 30 | public $url = 'https://api.example.com/v1'; 31 | 32 | /** 33 | * HTTP API parameters 34 | */ 35 | public $params = array(); 36 | 37 | /** 38 | * Declares how this CRM handles tags and fields 39 | */ 40 | public $supports = array( 'add_tags', 'add_fields' ); 41 | } 42 | ``` 43 | 44 | ## Required Methods 45 | ```php 46 | abstract class WPF_CRM_Base { 47 | public function get_contact_id( $email_address ); 48 | public function add_contact( $data ); 49 | public function update_contact( $contact_id, $data ); 50 | public function load_contact( $contact_id ); 51 | public function get_tags( $$contact_id ); 52 | public function apply_tags( $tags, $contact_id ); 53 | public function remove_tags( $tags, $contact_id ); 54 | 55 | // Required filter for handling API responses 56 | public function handle_http_response( $response, $args, $url ) { 57 | $body = json_decode( wp_remote_retrieve_body( $response ) ); 58 | 59 | if ( wp_remote_retrieve_response_code( $response ) !== 200 ) { 60 | if ( ! empty( $body->error ) ) { 61 | return new WP_Error( 'error', $body->error ); 62 | } else { 63 | return new WP_Error( 'error', __( 'Unknown error', 'wp-fusion-lite' ) ); 64 | } 65 | } 66 | 67 | return $response; 68 | } 69 | } 70 | ``` 71 | 72 | ## Initialization 73 | ```php 74 | public function __construct() { 75 | // Add HTTP response handler 76 | add_filter( 'http_response', array( $this, 'handle_http_response' ), 10, 3 ); 77 | } 78 | 79 | public function init() { 80 | // Only initialize admin UI 81 | if ( is_admin() ) { 82 | require_once dirname( __FILE__ ) . '/class-' . $this->slug . '-admin.php'; 83 | new WPF_' . ucwords( $this->slug ) . '_Admin( $this ); 84 | } 85 | } 86 | ``` 87 | 88 | ## Common Patterns 89 | - Use `wp_remote_*()` for API calls 90 | - Implement proper error handling 91 | - Use `wpf_log()` for debugging 92 | - Cache API responses when appropriate 93 | - Sanitize all data before sending to API 94 | 95 | ## Testing Requirements 96 | - Test all abstract methods 97 | - Verify error handling 98 | - Check rate limiting 99 | - Test field mapping 100 | - Validate tag sync 101 | - Test HTTP response handler 102 | 103 | ## Examples 104 | ```php 105 | // API call pattern 106 | public function add_contact( $data ) { 107 | $params = array( 108 | 'method' => 'POST', 109 | 'headers' => $this->get_headers(), 110 | 'body' => wp_json_encode( $data ), 111 | ); 112 | 113 | $response = wp_remote_post( $this->url . '/contacts', $params ); 114 | 115 | if ( is_wp_error( $response ) ) { 116 | return $response; 117 | } 118 | 119 | $body = json_decode( wp_remote_retrieve_body( $response ) ); 120 | 121 | return $body->contact_id; 122 | } 123 | ``` 124 | 125 | ## Common Issues 126 | - Rate limiting 127 | - API version compatibility 128 | - Field type mismatches 129 | - Authentication errors 130 | - SSL certificate issues 131 | 132 | ## Directory Structure Example 133 | ``` 134 | includes/crms/examplecrm/ 135 | ├── class-examplecrm.php # Main CRM class 136 | ├── class-examplecrm-admin.php # Admin settings 137 | ``` -------------------------------------------------------------------------------- /includes/crms/wp-erp/admin/class-admin.php: -------------------------------------------------------------------------------- 1 | slug = $slug; 18 | $this->name = $name; 19 | $this->crm = $crm; 20 | 21 | add_filter( 'wpf_configure_settings', array( $this, 'register_connection_settings' ), 15, 2 ); 22 | add_action( 'show_field_wp_erp_header_begin', array( $this, 'show_field_wp_erp_header_begin' ), 10, 2 ); 23 | 24 | // AJAX 25 | add_action( 'wp_ajax_wpf_test_connection_' . $this->slug, array( $this, 'test_connection' ) ); 26 | 27 | if ( wpf_get_option( 'crm' ) == $this->slug ) { 28 | $this->init(); 29 | } 30 | } 31 | 32 | /** 33 | * Hooks to run when this CRM is selected as active 34 | * 35 | * @access public 36 | * @return void 37 | */ 38 | public function init() { 39 | 40 | add_filter( 'wpf_initialize_options_contact_fields', array( $this, 'add_default_fields' ), 10 ); 41 | } 42 | 43 | /** 44 | * Loads wp-erp connection information on settings page 45 | * 46 | * @access public 47 | * @return array Settings 48 | */ 49 | public function register_connection_settings( $settings, $options ) { 50 | 51 | $new_settings = array(); 52 | 53 | $new_settings['wp_erp_header'] = array( 54 | // translators: %s is the name of the CRM. 55 | 'title' => sprintf( __( '%s Configuration', 'wp-fusion-lite' ), $this->name ), 56 | 'std' => 0, 57 | 'type' => 'heading', 58 | 'section' => 'setup', 59 | ); 60 | 61 | $new_settings['wp_erp_connect'] = array( 62 | 'title' => __( 'Connect', 'wp-fusion-lite' ), 63 | 'type' => 'api_validate', 64 | 'section' => 'setup', 65 | 'class' => 'api_key', 66 | 'post_fields' => array( 'wp_erp_connect' ), 67 | ); 68 | 69 | $settings = wp_fusion()->settings->insert_setting_after( 'crm', $settings, $new_settings ); 70 | 71 | return $settings; 72 | } 73 | 74 | /** 75 | * Loads standard WP_ERP field names and attempts to match them up with standard local ones 76 | * 77 | * @access public 78 | * @return array Options 79 | */ 80 | public function add_default_fields( $options ) { 81 | 82 | if ( true == $options['connection_configured'] ) { 83 | 84 | require_once __DIR__ . '/wp-erp-fields.php'; 85 | 86 | foreach ( $options['contact_fields'] as $field => $data ) { 87 | 88 | if ( isset( $fields[ $field ] ) && empty( $options['contact_fields'][ $field ]['crm_field'] ) ) { 89 | $options['contact_fields'][ $field ] = array_merge( $options['contact_fields'][ $field ], $fields[ $field ] ); 90 | } 91 | } 92 | } 93 | 94 | return $options; 95 | } 96 | 97 | /** 98 | * Puts a div around the wp-erp configuration section so it can be toggled 99 | * 100 | * @access public 101 | * @return mixed HTML Output 102 | */ 103 | public function show_field_wp_erp_header_begin( $id, $field ) { 104 | 105 | echo ''; 106 | $crm = wpf_get_option( 'crm' ); 107 | echo '
'; 108 | echo ''; 109 | } 110 | 111 | 112 | /** 113 | * Verify connection credentials 114 | * 115 | * @access public 116 | * @return void 117 | */ 118 | public function test_connection() { 119 | 120 | check_ajax_referer( 'wpf_settings_nonce' ); 121 | 122 | $connection = $this->crm->connect( true ); 123 | 124 | if ( is_wp_error( $connection ) ) { 125 | 126 | wp_send_json_error( $connection->get_error_message() ); 127 | 128 | } else { 129 | 130 | $options = array(); 131 | $options['crm'] = $this->slug; 132 | $options['connection_configured'] = true; 133 | 134 | wp_fusion()->settings->set_multiple( $options ); 135 | 136 | wp_send_json_success(); 137 | 138 | } 139 | 140 | die(); 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /assets/js/wpf-holler-box.js: -------------------------------------------------------------------------------- 1 | (($) => { 2 | const { input, select } = HollerBox.elements 3 | const { __ } = wp.i18n 4 | 5 | // Add WPFusion control 6 | HollerBox._editor.AdvancedDisplayRules.wpf_visibility_button = { 7 | name: wpf_holler_object.wpf_visibility.label, 8 | controls: ({ 9 | wpf_visibility = '', 10 | }) => { 11 | 12 | var wpf_vis_html = ''; 13 | for(var key in wpf_holler_object.wpf_visibility.options) { 14 | let val = wpf_holler_object.wpf_visibility.options[key]; 15 | wpf_vis_html+= ''; 16 | } 17 | 18 | return ` 19 | 22 | `; 23 | }, 24 | onMount: (trigger, updateTrigger) => { 25 | var wpf_val = $('#wpf_visibility').val(); 26 | if(wpf_val === 'loggedout'){ 27 | $('[data-id=wpf_show_any]').hide(); 28 | $('[data-id=wpf_hide_any]').hide(); 29 | } 30 | 31 | $('#wpf_visibility').on('change', e => { 32 | if($('#wpf_visibility').val() === 'loggedout'){ 33 | $('[data-id=wpf_show_any]').hide(); 34 | $('[data-id=wpf_hide_any]').hide(); 35 | }else{ 36 | $('[data-id=wpf_show_any]').show(); 37 | $('[data-id=wpf_hide_any]').show(); 38 | } 39 | }); 40 | 41 | $('#wpf_visibility').on('change', e => { 42 | updateTrigger({ 43 | wpf_visibility: e.target.value, 44 | }) 45 | }); 46 | 47 | }, 48 | }; 49 | 50 | HollerBox._editor.AdvancedDisplayRules.wpf_show_any = { 51 | name: wpf_holler_object.wpf_show_any, 52 | controls: ({ 53 | wpf_show_any = '' 54 | }) => { 55 | 56 | var wpf_tags_html = ''; 57 | for(var key in wpf_holler_object.tags) { 58 | let val = wpf_holler_object.tags[key]; 59 | wpf_tags_html+= ''; 60 | } 61 | 62 | 63 | return ` 64 |
65 | 68 |
69 | `; 70 | }, 71 | onMount: (popup, updateSetting) => { 72 | initializeTagsSelect('.wpf-holler-box'); 73 | $('#wpf_show_any').on('change', e => { 74 | 75 | updateSetting({ 76 | wpf_show_any: $(e.target).select4("val"), 77 | }) 78 | }); 79 | }, 80 | }; 81 | 82 | HollerBox._editor.AdvancedDisplayRules.wpf_hide_any = { 83 | name: wpf_holler_object.wpf_hide_any, 84 | controls: ({ 85 | wpf_hide_any = '' 86 | }) => { 87 | 88 | var wpf_tags_html = ''; 89 | for(var key in wpf_holler_object.tags) { 90 | let val = wpf_holler_object.tags[key]; 91 | wpf_tags_html+= ''; 92 | } 93 | 94 | 95 | return ` 96 |
97 | 100 |
101 | `; 102 | }, 103 | onMount: (popup, updateSetting) => { 104 | initializeTagsSelect('.wpf-holler-box'); 105 | $('#wpf_hide_any').on('change', e => { 106 | 107 | updateSetting({ 108 | wpf_hide_any: $(e.target).select4("val"), 109 | }) 110 | }); 111 | }, 112 | }; 113 | 114 | 115 | })(jQuery) 116 | -------------------------------------------------------------------------------- /assets/js/wpf-elementor.js: -------------------------------------------------------------------------------- 1 | var wpfElementor = { 2 | init: function () { 3 | jQuery(window).on('elementor:init', function () { 4 | elementor.on('frontend:init', () => { 5 | elementorFrontend.on('components:init', () => { 6 | var iFrameDOM = jQuery('iframe#elementor-preview-iframe').contents(); 7 | if (window.elementorFrontend) { 8 | // Add classes when elements are first loaded. 9 | jQuery.each(elementorFrontend.config.elements.data, function (cid, element) { 10 | var eid = wpfElementor.getElementFromCid(cid); 11 | if (wpfElementor.visibilityIsHidden(cid)) { 12 | return iFrameDOM 13 | .find('.elementor-element[data-id=' + eid + ']') 14 | .addClass('wpf-visibility-hidden'); 15 | } 16 | }); 17 | 18 | // Re add classes when elements are moved. 19 | // There's no hook to know when sortable has be initialized so we wait until it does. 20 | var interval = setInterval(function () { 21 | if (iFrameDOM.find('.ui-sortable').length > 0) { 22 | wpfElementor.attachSortStopEvent(iFrameDOM); 23 | clearInterval(interval); 24 | } 25 | }, 1000); 26 | } 27 | }); 28 | }); 29 | 30 | elementor.hooks.addAction('panel/open_editor/section', wpfElementor.setModelCID); 31 | elementor.hooks.addAction('panel/open_editor/column', wpfElementor.setModelCID); 32 | elementor.hooks.addAction('panel/open_editor/widget', wpfElementor.setModelCID); 33 | 34 | jQuery(document).on('change', '.elementor-control-wpf_visibility select', function () { 35 | wpfElementor.toggleVisibilityClass(); 36 | }); 37 | 38 | jQuery(document).on( 39 | 'change', 40 | '.elementor-control-wpf_tags select,.elementor-control-wpf_tags_all select,.elementor-control-wpf_tags_not select', 41 | function () { 42 | wpfElementor.toggleVisibilityClass(); 43 | } 44 | ); 45 | }); 46 | }, 47 | 48 | attachSortStopEvent: function (iFrameDOM) { 49 | iFrameDOM.find('.ui-sortable').on('sortstop', function (event, ui) { 50 | jQuery.each(jQuery(this).find('.elementor-element'), function () { 51 | if (wpfElementor.visibilityIsHidden(jQuery(this).attr('data-model-cid'))) { 52 | jQuery(this).addClass('wpf-visibility-hidden'); 53 | } 54 | }); 55 | }); 56 | }, 57 | 58 | setModelCID: function (panel, model, view) { 59 | wpf_model_cid = model.cid; 60 | }, 61 | 62 | toggleVisibilityClass: function () { 63 | var cid = wpf_model_cid; 64 | var eid = wpfElementor.getElementFromCid(cid); 65 | var iFrameDOM = jQuery('iframe#elementor-preview-iframe').contents(); 66 | var visibility_field_value = jQuery('.elementor-control-wpf_visibility select').val(); 67 | 68 | if (visibility_field_value == 'everyone' && wpfElementor.tagFieldsHasValue()) { 69 | return iFrameDOM.find('.elementor-element[data-id=' + eid + ']').addClass('wpf-visibility-hidden'); 70 | } 71 | 72 | if (visibility_field_value != 'everyone') { 73 | return iFrameDOM.find('.elementor-element[data-id=' + eid + ']').addClass('wpf-visibility-hidden'); 74 | } 75 | 76 | iFrameDOM.find('.elementor-element[data-id=' + eid + ']').removeClass('wpf-visibility-hidden'); 77 | }, 78 | 79 | tagFieldsHasValue: function () { 80 | let has_value = true; 81 | if ( 82 | jQuery('.elementor-control-wpf_tags select').val().length < 1 && 83 | jQuery('.elementor-control-wpf_tags_all select').val().length < 1 && 84 | jQuery('.elementor-control-wpf_tags_not select').val().length < 1 85 | ) { 86 | has_value = false; 87 | } 88 | 89 | return has_value; 90 | }, 91 | 92 | getElementFromCid: function (cid) { 93 | var iFrameDOM = jQuery('iframe#elementor-preview-iframe').contents(); 94 | var eid = iFrameDOM.find('.elementor-element[data-model-cid=' + cid + ']').data('id'); 95 | return eid; 96 | }, 97 | 98 | visibilityIsHidden: function (cid) { 99 | if (cid && elementorFrontend.config.elements.data[cid]) { 100 | var settings = elementorFrontend.config.elements.data[cid].attributes; 101 | 102 | if ( 103 | settings['wpf_visibility'] == 'everyone' && 104 | (settings['wpf_tags'] != '' || settings['wpf_tags_all'] != '' || settings['wpf_tags_not'] != '') 105 | ) { 106 | return true; 107 | } 108 | 109 | if (settings['wpf_visibility'] != '' && settings['wpf_visibility'] != 'everyone') { 110 | return true; 111 | } 112 | } 113 | return false; 114 | }, 115 | }; 116 | wpfElementor.init(); 117 | -------------------------------------------------------------------------------- /includes/crms/activecampaign/includes/Contact.class.php: -------------------------------------------------------------------------------- 1 | version = $version; 12 | $this->url_base = $url_base; 13 | $this->url = $url; 14 | $this->api_key = $api_key; 15 | } 16 | 17 | function add( $params, $post_data ) { 18 | $request_url = "{$this->url}&api_action=contact_add&api_output={$this->output}"; 19 | if ( $params ) { 20 | $request_url .= "&{$params}"; 21 | } 22 | $response = $this->curl( $request_url, $post_data ); 23 | 24 | return $response; 25 | } 26 | 27 | function delete_list( $params ) { 28 | $request_url = "{$this->url}&api_action=contact_delete_list&api_output={$this->output}&{$params}"; 29 | $response = $this->curl( $request_url ); 30 | 31 | return $response; 32 | } 33 | 34 | function delete( $params ) { 35 | $request_url = "{$this->url}&api_action=contact_delete&api_output={$this->output}&{$params}"; 36 | $response = $this->curl( $request_url ); 37 | 38 | return $response; 39 | } 40 | 41 | function edit( $params, $post_data ) { 42 | $request_url = "{$this->url}&api_action=contact_edit&api_output={$this->output}&{$params}"; 43 | $response = $this->curl( $request_url, $post_data ); 44 | 45 | return $response; 46 | } 47 | 48 | function list_( $params ) { 49 | 50 | if ( $this->version == 1 ) { 51 | $request_url = "{$this->url}&api_action=contact_list&api_output={$this->output}&{$params}"; 52 | $response = $this->curl( $request_url ); 53 | } elseif ( $this->version == 2 ) { 54 | $request_url = "{$this->url_base}/contact/emails"; 55 | // $params example: offset=0&limit=1000&listid=4 56 | $response = $this->curl( $request_url, $params, 'GET', 'contact_list' ); 57 | } 58 | 59 | return $response; 60 | } 61 | 62 | function note_add( $params, $post_data ) { 63 | $request_url = "{$this->url}&api_action=contact_note_add&api_output={$this->output}&{$params}"; 64 | $response = $this->curl( $request_url, $post_data ); 65 | 66 | return $response; 67 | } 68 | 69 | function note_edit( $params, $post_data ) { 70 | $request_url = "{$this->url}&api_action=contact_note_edit&api_output={$this->output}&{$params}"; 71 | $response = $this->curl( $request_url, $post_data ); 72 | 73 | return $response; 74 | } 75 | 76 | function note_delete( $params ) { 77 | $request_url = "{$this->url}&api_action=contact_note_delete&api_output={$this->output}&{$params}"; 78 | $response = $this->curl( $request_url ); 79 | 80 | return $response; 81 | } 82 | 83 | function paginator( $params ) { 84 | $request_url = "{$this->url}&api_action=contact_paginator&api_output={$this->output}&{$params}"; 85 | $response = $this->curl( $request_url ); 86 | 87 | return $response; 88 | } 89 | 90 | function sync( $params, $post_data ) { 91 | $request_url = "{$this->url}&api_action=contact_sync&api_output={$this->output}"; 92 | if ( $params ) { 93 | $request_url .= "&{$params}"; 94 | } 95 | $response = $this->curl( $request_url, $post_data ); 96 | 97 | return $response; 98 | } 99 | 100 | function tag_add( $params, $post_data ) { 101 | $request_url = "{$this->url}&api_action=contact_tag_add&api_output={$this->output}"; 102 | if ( $params ) { 103 | $request_url .= "&{$params}"; 104 | } 105 | $response = $this->curl( $request_url, $post_data ); 106 | 107 | return $response; 108 | } 109 | 110 | function tag_remove( $params, $post_data ) { 111 | $request_url = "{$this->url}&api_action=contact_tag_remove&api_output={$this->output}"; 112 | if ( $params ) { 113 | $request_url .= "&{$params}"; 114 | } 115 | $response = $this->curl( $request_url, $post_data ); 116 | 117 | return $response; 118 | } 119 | 120 | function view( $params ) { 121 | 122 | // can be a contact ID, email, or hash 123 | if ( preg_match( '/^email=/', $params ) ) { 124 | $action = 'contact_view_email'; 125 | } elseif ( preg_match( '/^hash=/', $params ) ) { 126 | $action = 'contact_view_hash'; 127 | } elseif ( preg_match( '/^id=/', $params ) ) { 128 | $action = 'contact_view'; 129 | } else { 130 | // default 131 | $action = 'contact_view'; 132 | } 133 | $request_url = "{$this->url}&api_action={$action}&api_output={$this->output}&{$params}"; 134 | $response = $this->curl( $request_url ); 135 | 136 | return $response; 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /includes/crms/salesflare/admin/class-admin.php: -------------------------------------------------------------------------------- 1 | slug = $slug; 18 | $this->name = $name; 19 | $this->crm = $crm; 20 | 21 | add_filter( 'wpf_configure_settings', array( $this, 'register_connection_settings' ), 15, 2 ); 22 | add_action( 'show_field_salesflare_header_begin', array( $this, 'show_field_salesflare_header_begin' ), 10, 2 ); 23 | 24 | // AJAX 25 | add_action( 'wp_ajax_wpf_test_connection_' . $this->slug, array( $this, 'test_connection' ) ); 26 | 27 | if ( wpf_get_option( 'crm' ) == $this->slug ) { 28 | $this->init(); 29 | } 30 | } 31 | 32 | /** 33 | * Hooks to run when this CRM is selected as active 34 | * 35 | * @access public 36 | * @since 1.0 37 | */ 38 | public function init() { 39 | 40 | add_filter( 'wpf_initialize_options_contact_fields', array( $this, 'add_default_fields' ), 10 ); 41 | } 42 | 43 | 44 | /** 45 | * Loads salesflare connection information on settings page 46 | * 47 | * @access public 48 | * @since 1.0 49 | */ 50 | public function register_connection_settings( $settings, $options ) { 51 | 52 | $new_settings = array(); 53 | 54 | $new_settings['salesflare_header'] = array( 55 | // translators: %s is the name of the CRM. 56 | 'title' => sprintf( __( '%s Configuration', 'wp-fusion-lite' ), $this->name ), 57 | 'std' => 0, 58 | 'type' => 'heading', 59 | 'section' => 'setup', 60 | ); 61 | 62 | $new_settings['salesflare_key'] = array( 63 | 'title' => __( 'API Key', 'wp-fusion-lite' ), 64 | 'desc' => __( 'You can find your API key in the API Key settings of your Salesflare account.', 'wp-fusion-lite' ), 65 | 'type' => 'api_validate', 66 | 'section' => 'setup', 67 | 'class' => 'api_key', 68 | 'post_fields' => array( 'salesflare_key' ), 69 | ); 70 | 71 | $settings = wp_fusion()->settings->insert_setting_after( 'crm', $settings, $new_settings ); 72 | 73 | return $settings; 74 | } 75 | 76 | 77 | /** 78 | * Loads standard Salesflare field names and attempts to match them up with standard local ones 79 | * 80 | * @access public 81 | * @since 1.0 82 | */ 83 | public function add_default_fields( $options ) { 84 | 85 | if ( $options['connection_configured'] == true ) { 86 | 87 | require_once __DIR__ . '/salesflare-fields.php'; 88 | 89 | foreach ( $options['contact_fields'] as $field => $data ) { 90 | 91 | if ( isset( $salesflare_fields[ $field ] ) && empty( $options['contact_fields'][ $field ]['crm_field'] ) ) { 92 | $options['contact_fields'][ $field ] = array_merge( $options['contact_fields'][ $field ], $salesflare_fields[ $field ] ); 93 | 94 | } 95 | } 96 | } 97 | 98 | return $options; 99 | } 100 | 101 | 102 | /** 103 | * Puts a div around the salesflare configuration section so it can be toggled 104 | * 105 | * @access public 106 | * @since 1.0 107 | */ 108 | public function show_field_salesflare_header_begin( $id, $field ) { 109 | 110 | echo ''; 111 | $crm = wpf_get_option( 'crm' ); 112 | echo '
'; 113 | } 114 | 115 | 116 | /** 117 | * Verify connection credentials 118 | * 119 | * @access public 120 | * @return bool 121 | */ 122 | public function test_connection() { 123 | 124 | check_ajax_referer( 'wpf_settings_nonce' ); 125 | 126 | $api_key = sanitize_text_field( $_POST['salesflare_key'] ); 127 | 128 | $connection = $this->crm->connect( $api_key, true ); 129 | 130 | if ( is_wp_error( $connection ) ) { 131 | 132 | wp_send_json_error( $connection->get_error_message() ); 133 | 134 | } else { 135 | 136 | $options = array(); 137 | $options['salesflare_key'] = $api_key; 138 | $options['crm'] = $this->slug; 139 | $options['connection_configured'] = true; 140 | wp_fusion()->settings->set_multiple( $options ); 141 | 142 | wp_send_json_success(); 143 | 144 | } 145 | 146 | die(); 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /includes/crms/convertfox/admin/class-admin.php: -------------------------------------------------------------------------------- 1 | slug = $slug; 18 | $this->name = $name; 19 | $this->crm = $crm; 20 | 21 | add_filter( 'wpf_configure_settings', array( $this, 'register_connection_settings' ), 15, 2 ); 22 | add_action( 'show_field_convertfox_header_begin', array( $this, 'show_field_convertfox_header_begin' ), 10, 2 ); 23 | 24 | // AJAX 25 | add_action( 'wp_ajax_wpf_test_connection_' . $this->slug, array( $this, 'test_connection' ) ); 26 | 27 | if ( wpf_get_option( 'crm' ) == $this->slug ) { 28 | $this->init(); 29 | } 30 | } 31 | 32 | /** 33 | * Hooks to run when this CRM is selected as active 34 | * 35 | * @access public 36 | * @since 1.0 37 | */ 38 | public function init() { 39 | 40 | add_filter( 'wpf_initialize_options_contact_fields', array( $this, 'add_default_fields' ), 10 ); 41 | } 42 | 43 | 44 | /** 45 | * Loads Convertfox connection information on settings page 46 | * 47 | * @access public 48 | * @since 1.0 49 | */ 50 | public function register_connection_settings( $settings, $options ) { 51 | 52 | $new_settings = array(); 53 | 54 | $new_settings['convertfox_header'] = array( 55 | // translators: %s is the name of the CRM. 56 | 'title' => sprintf( __( '%s Configuration', 'wp-fusion-lite' ), $this->name ), 57 | 'std' => 0, 58 | 'type' => 'heading', 59 | 'section' => 'setup', 60 | ); 61 | 62 | $new_settings['convertfox_key'] = array( 63 | 'title' => __( 'Access Token', 'wp-fusion-lite' ), 64 | 'desc' => __( 'You can find your Access Token by going to Settings and clicking the menu option for Access Token in your Gist account.', 'wp-fusion-lite' ), 65 | 'type' => 'api_validate', 66 | 'section' => 'setup', 67 | 'class' => 'api_key', 68 | 'post_fields' => array( 'convertfox_key' ), 69 | ); 70 | 71 | $settings = wp_fusion()->settings->insert_setting_after( 'crm', $settings, $new_settings ); 72 | 73 | return $settings; 74 | } 75 | 76 | 77 | /** 78 | * Loads standard Convertfox field names and attempts to match them up with standard local ones 79 | * 80 | * @access public 81 | * @since 1.0 82 | */ 83 | public function add_default_fields( $options ) { 84 | 85 | if ( $options['connection_configured'] == true ) { 86 | 87 | require_once __DIR__ . '/convertfox-fields.php'; 88 | 89 | foreach ( $options['contact_fields'] as $field => $data ) { 90 | 91 | if ( isset( $convertfox_fields[ $field ] ) && empty( $options['contact_fields'][ $field ]['crm_field'] ) ) { 92 | $options['contact_fields'][ $field ] = array_merge( $options['contact_fields'][ $field ], $convertfox_fields[ $field ] ); 93 | } 94 | } 95 | } 96 | 97 | return $options; 98 | } 99 | 100 | 101 | /** 102 | * Puts a div around the Convertfox configuration section so it can be toggled 103 | * 104 | * @access public 105 | * @since 1.0 106 | */ 107 | public function show_field_convertfox_header_begin( $id, $field ) { 108 | 109 | echo ''; 110 | $crm = wpf_get_option( 'crm' ); 111 | echo '
'; 112 | } 113 | 114 | /** 115 | * Verify connection credentials 116 | * 117 | * @access public 118 | * @return bool 119 | */ 120 | public function test_connection() { 121 | 122 | check_ajax_referer( 'wpf_settings_nonce' ); 123 | 124 | $api_key = isset( $_POST['convertfox_key'] ) ? sanitize_text_field( wp_unslash( $_POST['convertfox_key'] ) ) : false; 125 | 126 | $connection = $this->crm->connect( $api_key, true ); 127 | 128 | if ( is_wp_error( $connection ) ) { 129 | 130 | wp_send_json_error( $connection->get_error_message() ); 131 | 132 | } else { 133 | 134 | $options = array(); 135 | $options['convertfox_key'] = $api_key; 136 | $options['crm'] = $this->slug; 137 | $options['connection_configured'] = true; 138 | wp_fusion()->settings->set_multiple( $options ); 139 | 140 | wp_send_json_success(); 141 | 142 | } 143 | 144 | die(); 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /includes/crms/capsule/admin/class-admin.php: -------------------------------------------------------------------------------- 1 | slug = $slug; 18 | $this->name = $name; 19 | $this->crm = $crm; 20 | 21 | add_filter( 'wpf_configure_settings', array( $this, 'register_connection_settings' ), 15, 2 ); 22 | add_action( 'show_field_capsule_header_begin', array( $this, 'show_field_capsule_header_begin' ), 10, 2 ); 23 | 24 | // AJAX 25 | add_action( 'wp_ajax_wpf_test_connection_' . $this->slug, array( $this, 'test_connection' ) ); 26 | 27 | if ( wpf_get_option( 'crm' ) == $this->slug ) { 28 | $this->init(); 29 | } 30 | } 31 | 32 | /** 33 | * Hooks to run when this CRM is selected as active 34 | * 35 | * @access public 36 | * @since 1.0 37 | */ 38 | public function init() { 39 | 40 | add_filter( 'wpf_initialize_options_contact_fields', array( $this, 'add_default_fields' ), 10 ); 41 | } 42 | 43 | /** 44 | * Loads Capsule connection information on settings page 45 | * 46 | * @access public 47 | * @since 1.0 48 | */ 49 | public function register_connection_settings( $settings, $options ) { 50 | 51 | $new_settings = array(); 52 | 53 | $new_settings['capsule_header'] = array( 54 | // translators: %s is the name of the CRM. 55 | 'title' => sprintf( __( '%s Configuration', 'wp-fusion-lite' ), $this->name ), 56 | 'std' => 0, 57 | 'type' => 'heading', 58 | 'section' => 'setup', 59 | ); 60 | 61 | $new_settings['capsule_key'] = array( 62 | 'title' => __( 'API Key', 'wp-fusion-lite' ), 63 | 'desc' => __( 'You can find your API key by going to My Preferences >> API Authentication Tokens in your Capsule account.
Click on Personal Access Tokens, and generate a new token for WP Fusion.', 'wp-fusion-lite' ), 64 | 'type' => 'api_validate', 65 | 'section' => 'setup', 66 | 'class' => 'api_key', 67 | 'post_fields' => array( 'capsule_key' ), 68 | ); 69 | 70 | $settings = wp_fusion()->settings->insert_setting_after( 'crm', $settings, $new_settings ); 71 | 72 | return $settings; 73 | } 74 | 75 | 76 | /** 77 | * Loads standard capsule field names and attempts to match them up with standard local ones 78 | * 79 | * @access public 80 | * @since 1.0 81 | */ 82 | public function add_default_fields( $options ) { 83 | 84 | if ( $options['connection_configured'] == true ) { 85 | 86 | require_once __DIR__ . '/capsule-fields.php'; 87 | 88 | foreach ( $options['contact_fields'] as $field => $data ) { 89 | 90 | if ( isset( $capsule_fields[ $field ] ) && empty( $options['contact_fields'][ $field ]['crm_field'] ) ) { 91 | $options['contact_fields'][ $field ] = array_merge( $options['contact_fields'][ $field ], $capsule_fields[ $field ] ); 92 | } 93 | } 94 | } 95 | 96 | return $options; 97 | } 98 | 99 | 100 | /** 101 | * Puts a div around the capsule configuration section so it can be toggled 102 | * 103 | * @access public 104 | * @since 1.0 105 | */ 106 | public function show_field_capsule_header_begin( $id, $field ) { 107 | 108 | echo ''; 109 | $crm = wpf_get_option( 'crm' ); 110 | echo '
'; 111 | } 112 | 113 | /** 114 | * Verify connection credentials 115 | * 116 | * @access public 117 | * @return bool 118 | */ 119 | public function test_connection() { 120 | 121 | check_ajax_referer( 'wpf_settings_nonce' ); 122 | 123 | $api_key = isset( $_POST['capsule_key'] ) ? sanitize_text_field( wp_unslash( $_POST['capsule_key'] ) ) : false; 124 | 125 | $connection = $this->crm->connect( $api_key, true ); 126 | 127 | if ( is_wp_error( $connection ) ) { 128 | 129 | wp_send_json_error( $connection->get_error_message() ); 130 | 131 | } else { 132 | 133 | $options = array(); 134 | $options['capsule_key'] = $api_key; 135 | $options['crm'] = $this->slug; 136 | $options['connection_configured'] = true; 137 | wp_fusion()->settings->set_multiple( $options ); 138 | 139 | wp_send_json_success(); 140 | 141 | } 142 | 143 | die(); 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /includes/crms/tubular/admin/class-admin.php: -------------------------------------------------------------------------------- 1 | slug = $slug; 18 | $this->name = $name; 19 | $this->crm = $crm; 20 | 21 | add_filter( 'wpf_configure_settings', array( $this, 'register_connection_settings' ), 15, 2 ); 22 | add_action( 'show_field_tubular_header_begin', array( $this, 'show_field_tubular_header_begin' ), 10, 2 ); 23 | 24 | // AJAX 25 | add_action( 'wp_ajax_wpf_test_connection_' . $this->slug, array( $this, 'test_connection' ) ); 26 | 27 | if ( wpf_get_option( 'crm' ) == $this->slug ) { 28 | $this->init(); 29 | } 30 | } 31 | 32 | /** 33 | * Hooks to run when this CRM is selected as active 34 | * 35 | * @access public 36 | * @since 1.0 37 | */ 38 | public function init() { 39 | 40 | add_filter( 'wpf_initialize_options_contact_fields', array( $this, 'add_default_fields' ), 10 ); 41 | // add_filter( 'wpf_configure_settings', array( $this, 'register_settings' ), 10, 2 ); 42 | } 43 | 44 | 45 | /** 46 | * Loads tubular connection information on settings page 47 | * 48 | * @access public 49 | * @since 1.0 50 | */ 51 | public function register_connection_settings( $settings, $options ) { 52 | 53 | $new_settings = array(); 54 | 55 | $new_settings['tubular_header'] = array( 56 | // translators: %s is the name of the CRM. 57 | 'title' => sprintf( __( '%s Configuration', 'wp-fusion-lite' ), $this->name ), 58 | 'std' => 0, 59 | 'type' => 'heading', 60 | 'section' => 'setup', 61 | ); 62 | 63 | $new_settings['tubular_key'] = array( 64 | 'title' => __( 'API Key', 'wp-fusion-lite' ), 65 | 'desc' => __( 'You can find your API key in Tubular\'s Settings page, at the bottom of the Integrations section.', 'wp-fusion-lite' ), 66 | 'type' => 'api_validate', 67 | 'section' => 'setup', 68 | 'class' => 'api_key', 69 | 'post_fields' => array( 'tubular_key' ), 70 | ); 71 | 72 | $settings = wp_fusion()->settings->insert_setting_after( 'crm', $settings, $new_settings ); 73 | 74 | return $settings; 75 | } 76 | 77 | 78 | /** 79 | * Loads standard tubular field names and attempts to match them up with standard local ones 80 | * 81 | * @access public 82 | * @since 1.0 83 | */ 84 | public function add_default_fields( $options ) { 85 | 86 | if ( $options['connection_configured'] == true ) { 87 | 88 | require_once __DIR__ . '/tubular-fields.php'; 89 | 90 | foreach ( $options['contact_fields'] as $field => $data ) { 91 | 92 | if ( isset( $tubular_fields[ $field ] ) && empty( $options['contact_fields'][ $field ]['crm_field'] ) ) { 93 | $options['contact_fields'][ $field ] = array_merge( $options['contact_fields'][ $field ], $tubular_fields[ $field ] ); 94 | } 95 | } 96 | } 97 | 98 | return $options; 99 | } 100 | 101 | 102 | /** 103 | * Puts a div around the tubular configuration section so it can be toggled 104 | * 105 | * @access public 106 | * @since 1.0 107 | */ 108 | public function show_field_tubular_header_begin( $id, $field ) { 109 | 110 | echo ''; 111 | $crm = wpf_get_option( 'crm' ); 112 | echo '
'; 113 | } 114 | 115 | 116 | /** 117 | * Verify connection credentials 118 | * 119 | * @access public 120 | * @return bool 121 | */ 122 | public function test_connection() { 123 | 124 | check_ajax_referer( 'wpf_settings_nonce' ); 125 | 126 | $api_key = sanitize_text_field( $_POST['tubular_key'] ); 127 | 128 | $connection = $this->crm->connect( $api_key, true ); 129 | 130 | if ( is_wp_error( $connection ) ) { 131 | 132 | wp_send_json_error( $connection->get_error_message() ); 133 | 134 | } else { 135 | 136 | $options = array(); 137 | $options['tubular_key'] = $api_key; 138 | $options['crm'] = $this->slug; 139 | $options['connection_configured'] = true; 140 | wp_fusion()->settings->set_multiple( $options ); 141 | 142 | wp_send_json_success(); 143 | 144 | } 145 | 146 | die(); 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /includes/admin/gutenberg/src/secure-block/php/class-secure-block.php: -------------------------------------------------------------------------------- 1 | register_dynamic_block(); 34 | 35 | // Load Classes 36 | $this->includes(); 37 | } 38 | 39 | /** 40 | * Register the dynamic block. 41 | * 42 | * @since 1.0.0 43 | * 44 | * @return void 45 | */ 46 | public function register_dynamic_block() { 47 | 48 | // Only load if Gutenberg is available. 49 | if ( ! function_exists( 'register_block_type' ) ) { 50 | return; 51 | } 52 | 53 | // Hook server side rendering into render callback 54 | register_block_type( 55 | 'wp-fusion/secure-block', 56 | array( 57 | 'render_callback' => 'wp_fusion\secure_blocks_for_gutenberg\wp_fusion_secure_blocks_for_gutenberg_render', 58 | ) 59 | ); 60 | } 61 | 62 | /** 63 | * Include Classes 64 | */ 65 | public function includes() { 66 | 67 | // Load Classes 68 | require_once 'class-api.php'; 69 | $api = new API(); 70 | $api->run(); 71 | } 72 | } 73 | 74 | function wp_fusion_secure_blocks_for_gutenberg_render( $attributes, $content ) { 75 | 76 | if ( is_admin() ) { 77 | return $content; 78 | } 79 | 80 | $can_access = false; 81 | 82 | $restricted_tags = array(); 83 | 84 | if ( wpf_admin_override() ) { 85 | 86 | $can_access = true; 87 | 88 | } elseif ( isset( $attributes['tag'] ) ) { 89 | 90 | $user_tags = wp_fusion()->user->get_tags(); 91 | 92 | $decoded_tags = json_decode( $attributes['tag'] ); 93 | 94 | if ( ! empty( $decoded_tags ) ) { 95 | 96 | foreach ( $decoded_tags as $tag ) { 97 | $restricted_tags[] = $tag->value; 98 | } 99 | 100 | $result = array_intersect( $restricted_tags, $user_tags ); 101 | 102 | if ( ! empty( $result ) ) { 103 | $can_access = true; 104 | } 105 | } 106 | } elseif ( wpf_is_user_logged_in() ) { 107 | 108 | $can_access = true; 109 | } 110 | 111 | $dom = new \DomDocument(); 112 | 113 | libxml_use_internal_errors( true ); // Suppress errors 114 | $dom->loadHTML( '' . $content ); // Encoding to fix foreign characters 115 | libxml_clear_errors(); 116 | 117 | $finder = new \DomXPath( $dom ); 118 | $secure_class = 'wp-block-wp-fusion-secure-block-inner-secure'; 119 | $secure_content = $finder->query( "//div[contains(@class, '$secure_class')]" ); 120 | $unsecure_class = 'wp-block-wp-fusion-secure-block-inner-unsecure'; 121 | $unsecure_content = $finder->query( "//div[contains(@class, '$unsecure_class')]" ); 122 | $secure_content_dom = new \DOMDocument(); 123 | $unsecure_content_dom = new \DOMDocument(); 124 | 125 | foreach ( $secure_content as $node ) { 126 | $secure_content_dom->appendChild( $secure_content_dom->importNode( $node, true ) ); 127 | break; // Only grab the first match? To prevent the inner nodes from getting duplicated with nested blocks? Makes no sense I know 128 | } 129 | 130 | foreach ( $unsecure_content as $node ) { 131 | $unsecure_content_dom->appendChild( $unsecure_content_dom->importNode( $node, true ) ); 132 | break; // Only grab the first match? 133 | } 134 | 135 | $secure_content = trim( $secure_content_dom->saveHTML() ); 136 | $unsecure_content = trim( $unsecure_content_dom->saveHTML() ); 137 | 138 | // Don't output HTML if there's nothing in it 139 | 140 | if ( empty( strip_tags( $secure_content ) ) ) { 141 | $secure_content = false; 142 | } 143 | 144 | if ( empty( strip_tags( $unsecure_content ) ) ) { 145 | $unsecure_content = false; 146 | } 147 | 148 | global $post; 149 | 150 | $can_access = apply_filters( 'wpf_user_can_access_gutenberg', $can_access, $attributes ); // deprecated 151 | 152 | $can_access = apply_filters( 'wpf_user_can_access_block', $can_access, $attributes ); 153 | 154 | $can_access = apply_filters( 'wpf_user_can_access', $can_access, wpf_get_current_user_id(), false ); 155 | 156 | if ( $can_access ) { 157 | return $secure_content; 158 | } else { 159 | return $unsecure_content; 160 | } 161 | } 162 | --------------------------------------------------------------------------------