This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
* This sometimes fixes the error "A valid URL was not provided." wen connecting to self | |
* hosted CRMs like Mautic, FluentCRM, or FunnelKit. | |
* | |
* @param array $args HTTP request arguments. | |
* @param string $url The request URL. | |
* @return array HTTP request arguments. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Put your intercom access token here | |
define( 'INTERCOM_ACCESS_TOKEN', 'aG9tOjyIyZmMxZDc2X2YxMzBfNDBhZV9hOTVjXzRhZDRlNzBiZWMyMzoxOjA=' ); | |
// We'll save the alternate CRM in a global so it can be re-used if multiple API calls need to be made in the same request | |
global $intercom; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Utility function for getting any FooEvents attendees from a WooCommerce order | |
* @param WC_Order $order | |
* @return array Attendees | |
*/ | |
function get_foo_attendees_from_order( $order ) { | |
$attendees = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wpf_allow_rss( $can_access, $user_id, $post_id ) { | |
if ( is_feed() ) { | |
$can_access = true; | |
} | |
return $can_access; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import openai | |
import requests | |
import re | |
import json | |
openai.api_key = "X" | |
# Define WooCommerce credentials. | |
site_url = "https://yoursite.com/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function store_additional_license_parameters( $response, $args, $license_id ) { | |
$data = array_map( 'sanitize_text_field', $_REQUEST ); | |
if ( $response['license'] == 'valid' ) { | |
$user = get_user_by( 'email', $response['customer_email'] ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This runs every day and imports any new users from the connected CRM who have the specified tag ID ("123" in this example) | |
// If contacts with that tag already have user accounts on the site they will be skipped and no data will be loaded | |
// i.e. this just imports *new* users | |
if ( ! wp_next_scheduled( 'wpf_daily_import' ) ) { | |
wp_schedule_event( time(), 'daily', 'wpf_daily_import' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Sends API calls non-blocking during login. | |
* | |
* This is useful if your CRM has a slow API, it will allow the user to log in | |
* without any noticable delay. However, if the API is offline or fails to process | |
* the request, no error will be logged and there will be no indication it failed. | |
* | |
* @param array $parsed_args The HTTP API request args. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: WPF All Sites | |
Plugin URI: verygoodplugins.com | |
Description: Stores log of all sites that call home looking for updates | |
Version: 1.0 | |
Author: vergoodplugins | |
Author URI: verygoodplugins.com | |
License: |
NewerOlder