Initial commit: Atomaste website

This commit is contained in:
2025-12-10 12:17:30 -05:00
commit 0b9e5d1605
19260 changed files with 5206382 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden.

View File

@@ -0,0 +1,409 @@
<?php
defined( 'ABSPATH' ) or die( "you do not have access to this page!" );
global $burst_integrations_list;
/**
* List of integrations that Burst Statistics supports.
* Good to know for goals:
* - The goals should always be user trigger-able, otherwise the goal can not be tracked as it requires a UID at least for now.
* -
*/
$burst_integrations_list = apply_filters( 'burst_integrations', array(
// Consent plugins
'complianz' => array(
'constant_or_function' => 'cmplz_version',
'label' => 'Complianz GDPR/CCPA',
),
'duplicate-post' => array(
'constant_or_function' => 'DUPLICATE_POST_CURRENT_VERSION',
'label' => 'Yoast Duplicate Post',
'admin_only' => true,
),
// Pagebuilders
// @todo add goals
'elementor' => array(
'constant_or_function' => 'ELEMENTOR_VERSION',
'label' => 'Elementor Website Builder',
'goals' =>
[
[
'id' => 'elementor_pro_forms_form_submitted',
'type' => 'hook',
'status' => 'active',
'server_side' => true,
'url' => '*',
'hook' => 'elementor_pro/forms/form_submitted',
],
]
),
'beaver-builder' => [],
'thrive-architect' => [],
'divi-builder' => [],
// eCommerce plugins
'woocommerce' => array(
'constant_or_function' => 'WC_VERSION',
'label' => 'WooCommerce',
'goals' =>
[
[
'id' => 'woocommerce_add_to_cart',
'type' => 'hook',
'status' => 'active',
'server_side' => true,
'url' => '*',
'hook' => 'woocommerce_add_to_cart',
],
[
'id' => 'woocommerce_checkout_order_created',
'type' => 'hook',
'status' => 'active',
'server_side' => true,
'url' => '*',
'hook' => 'woocommerce_checkout_order_created',
],
[
'id' => 'woocommerce_payment_complete',
'type' => 'hook',
'status' => 'active',
'server_side' => true,
'url' => '*',
'hook' => 'woocommerce_payment_complete',
'conversion_metric' => 'visitors',
],
]
),
// @todo test and add goals
'easy-digital-downloads' => array(
'constant_or_function' => 'EDD_PLUGIN_FILE',
'label' => 'Easy Digital Downloads',
'goals' =>
[
[
'id' => 'edd_complete_purchase',
'type' => 'hook',
'status' => 'active',
'server_side' => true,
'url' => '*',
'hook' => 'edd_complete_purchase',
'conversion_metric' => 'visitors',
],
]
),
'easy-digital-downloads-recurring' => array(
'constant_or_function' => 'EDD_RECURRING_VERSION',
'label' => 'Easy Digital Downloads - Recurring Payments',
'goals' =>
[
'id' => 'edd_subscription_post_create',
'type' => 'hook',
'status' => 'active',
'server_side' => true,
'url' => '*',
'hook' => 'edd_subscription_post_create',
],
[
'id' => 'edd_subscription_cancelled',
'type' => 'hook',
'status' => 'active',
'server_side' => true,
'url' => '*',
'hook' => 'edd_subscription_cancelled',
],
),
'wp-simple-pay' => [],
'charitable' => [],
'sure-cart' => [],
// Contact from plugins
'contact-form-7' => [
'constant_or_function' => 'WPCF7_VERSION',
'label' => 'Contact Form 7',
'goals' =>
[
[
'id' => 'wpcf7_submit',
'type' => 'hook',
'status' => 'active',
'server_side' => true,
'url' => '*',
'hook' => 'wpcf7_submit',
],
]
],
'wpforms' => [
'constant_or_function' => 'WPFORMS_VERSION',
'label' => 'WPForms',
'goals' =>
[
[
'id' => 'wpforms_process_complete',
'type' => 'hook',
'status' => 'active',
'server_side' => true,
'url' => '*',
'hook' => 'wpforms_process_complete',
],
]
],
'gravity_forms' => [
'constant_or_function' => 'gravity_form',
'label' => 'Gravity Forms',
'goals' =>
[
[
'id' => 'gform_post_submission',
'type' => 'hook',
'status' => 'active',
'server_side' => true,
'url' => '*',
'hook' => 'gform_post_submission',
],
]
],
'formidable-forms' => [
'constant_or_function' => 'frm_forms_autoloader',
'label' => 'Formidable Forms',
'goals' =>
[
[
'id' => 'frm_submit_clicked',
'type' => 'clicks',
'status' => 'active',
'server_side' => false,
'url' => '*',
'attribute' => 'class',
'attribute_value' => 'frm_button_submit',
],
]
],
'ninja-forms' => [
'constant_or_function' => 'Ninja_Forms',
'label' => 'Ninja Forms',
'goals' =>
[
[
'id' => 'ninja_forms_after_submission',
'type' => 'hook',
'status' => 'active',
'server_side' => true,
'url' => '*',
'hook' => 'ninja_forms_after_submission',
],
]
],
'happy-forms' => [],
'forminator' => [],
'ws-form' => [],
'everest-forms' => [],
'kaliforms' => [],
'form-maker-web10' => [],
// Lead and CRM plugins
// @todo add goals
'mail-poet' => [],
'mailster' => [],
'optinmonster' => [], // No hooks to my knowledge
'thrive-leads' => [],
'fluentcrm' => [],
'groundhogg' => [],
'mailchimp-for-wp' => [],
// LMS plugins
'learndash' => [],
'lifterlms' => [],
'tutor-lms' => [],
// caching plugins
'wp-rocket' => array(
'constant_or_function' => 'WP_ROCKET_VERSION',
'label' => 'WP Rocket',
),
)
);
add_action('admin_init', 'burst_load_integrations_translations');
/**
* To prevent warnings, the translations only can be loaded after the plugins_loaded hook.
* @return void
*/
function burst_load_integrations_translations(){
global $burst_integrations_list;
$translations = [
'elementor' => array(
'goals' =>
[
[
'id' => 'elementor_pro_forms_form_submitted',
'title'=> "Elementor - " . __('Form Submission', 'burst-statistics'),
'description' => __('Runs after submitting a form', 'burst-statistics'),
],
]
),
'woocommerce' => array(
'goals' =>
[
[
'id' => 'woocommerce_add_to_cart',
'title'=> "WooCommerce - " . __('Add to Cart', 'burst-statistics'),
'description' => __("Runs after clicking 'Add to Cart' button ", 'burst-statistics'),
],
[
'id' => 'woocommerce_checkout_order_created',
'title'=> "WooCommerce - " . __('Order Created', 'burst-statistics'),
'description' => __('Runs before the payment', 'burst-statistics'),
],
[
'id' => 'woocommerce_payment_complete',
'title'=> "WooCommerce - " . __('Payment Completed', 'burst-statistics'),
'description' => __('Runs after completing a payment', 'burst-statistics'),
],
]
),
'easy-digital-downloads' => array(
'goals' =>
[
[
'id' => 'edd_complete_purchase',
'title'=> "Easy Digital Downloads -" . __('Purchase', 'burst-statistics'),
'description' => __('Runs after purchasing an item', 'burst-statistics'),
],
]
),
'easy-digital-downloads-recurring' => array(
'goals' =>
[
'id' => 'edd_subscription_post_create',
'title'=> "Easy Digital Downloads - " . __('Subscription Created', 'burst-statistics'),
'description' => __('Runs after creating a subscription', 'burst-statistics'),
],
[
'id' => 'edd_subscription_cancelled',
'title'=> "Easy Digital Downloads - " . __('Subscription Cancelled', 'burst-statistics'),
'description' => __('Runs after cancelling a subscription', 'burst-statistics'),
],
),
// Contact from plugins
'contact-form-7' => [
'goals' =>
[
[
'id' => 'wpcf7_submit',
'title'=> "Contact Form 7 - " . __('Submit form', 'burst-statistics'),
'description' => __('Runs after submitting a form', 'burst-statistics'),
],
]
],
'wpforms' => [
'goals' =>
[
[
'id' => 'wpforms_process_complete',
'title'=> "WPForms - " . __('Submit form', 'burst-statistics'),
'description' => __('Runs after submitting a form', 'burst-statistics'),
],
]
],
'gravity_forms' => [
'goals' =>
[
[
'id' => 'gform_post_submission',
'title'=> "Gravity Forms - " . __('Submit form', 'burst-statistics'),
'description' => __('Runs after submitting a form', 'burst-statistics'),
],
]
],
'formidable-forms' => [
'goals' =>
[
[
'id' => 'frm_submit_clicked',
'title'=> "Formidable Forms - " . __('Submit form', 'burst-statistics'),
'description' => __('Runs after submitting a form', 'burst-statistics'),
],
]
],
'ninja-forms' => [
'goals' =>
[
[
'id' => 'ninja_forms_after_submission',
'title'=> "Ninja Forms - " . __('Submit form', 'burst-statistics'),
'description' => __('Runs after submitting a form', 'burst-statistics'),
],
]
],
];
//for each item in $burst_integrations_list, loop through each goal, and add the title and description based on the matching id in $translations
foreach ($burst_integrations_list as $plugin => $details){
if (isset($translations[$plugin])){
foreach ($details['goals'] as $key => $goal){
if (isset($translations[$plugin]['goals'][$key])){
if (isset($translations[$plugin]['goals'][$key]['title'])) {
$burst_integrations_list[$plugin]['goals'][$key]['title'] = $translations[$plugin]['goals'][$key]['title'];
}
if (isset($translations[$plugin]['goals'][$key]['description'])) {
$burst_integrations_list[$plugin]['goals'][$key]['description'] = $translations[$plugin]['goals'][$key]['description'];
}
}
}
}
}
}
/**
* Check if a plugin from the integrations list is active
* @param string $plugin
*
* @return bool
*/
function burst_integration_plugin_is_active( $plugin ): bool {
global $burst_integrations_list;
if ( !isset($burst_integrations_list[ $plugin ]) ) {
return false;
}
$theme = wp_get_theme();
$details = $burst_integrations_list[ $plugin ];
if ( ! isset( $details['constant_or_function'] ) ) {
return false;
}
return defined( $details['constant_or_function'] )
|| function_exists( $details['constant_or_function'] )
|| class_exists( $details['constant_or_function'] )
|| ( $theme && ( $theme->name === $details['constant_or_function'] ) );
}
/**
* code loaded without privileges to allow integrations between plugins and services, when enabled.
*/
function burst_integrations() {
global $burst_integrations_list;
foreach ( $burst_integrations_list as $plugin => $details ) {
if ( burst_integration_plugin_is_active( $plugin ) ) {
$file = apply_filters( 'burst_integration_path', burst_path . "integrations/plugins/$plugin.php", $plugin );
$is_admin_only = $details['admin_only'] ?? false;
$admin_logged_in = burst_admin_logged_in();
$can_load = ( $is_admin_only && $admin_logged_in ) || !$is_admin_only;
if ( $can_load && file_exists( $file ) ) {
require_once( $file );
}
}
}
// add integration with consent api for this plugin
$plugin = plugin_basename( __FILE__ );
add_filter( "wp_consent_api_registered_{$plugin}", '__return_true' );
}
add_action( 'plugins_loaded', 'burst_integrations', 10 );

View File

@@ -0,0 +1,52 @@
<?php
defined( 'ABSPATH' ) or die( 'you do not have access to this page!' );
/**
* Add a script to the blocked list
*
* @param array $tags
*
* @return array
*/
function burst_cmplz_script( $tags ): array {
// if wp consent api is active, let it handle the integration
if ( function_exists( 'wp_has_consent' ) ) {
return $tags;
}
// if cookieless tracking enabled, do not block.
if ( burst_get_option( 'enable_cookieless_tracking' ) ) {
return $tags;
}
// if added by complianz, remove it
foreach ( $tags as $index => $tag ) {
if ( isset( $tag['name'] ) && $tag['name'] === 'burst' ) {
unset( $tags[ $index ] );
break;
}
}
$tags[] = array(
'name' => 'burst',
'category' => 'statistics',
'urls' => array(
'assets/js/build/burst.js',
'assets/js/build/burst.min.js',
),
'enable_placeholder' => '0',
'enable_dependency' => '0',
);
return $tags;
}
add_filter( 'cmplz_known_script_tags', 'burst_cmplz_script', 20 );
/**
* No need for complianz integration anymore
*
* @return void
*/
function burst_remove_complianz_integration() {
remove_action( 'wp_enqueue_scripts', 'cmplz_burst_statistics_activate_burst', PHP_INT_MAX );
}
add_action( 'init', 'burst_remove_complianz_integration' );

View File

@@ -0,0 +1,7 @@
<?php
function burst_exclude_post_meta($meta_keys) {
$meta_keys[] = 'burst_total_pageviews_count';
return $meta_keys;
}
add_filter('duplicate_post_excludelist_filter', 'burst_exclude_post_meta');

View File

@@ -0,0 +1,33 @@
<?php
defined( 'ABSPATH' ) or die();
use Elementor\Plugin;
// @todo Move to pro
/**
* If page is built with Elementor, get the Elementor content
*
* @param string $content [description]
* @param int $post_id [description]
* @return string [description]
*/
function burst_elementor_the_content( $content, $post_id ) {
$el_frontend = new Elementor\Frontend();
if ( Plugin::$instance->documents->get( $post_id )->is_built_with_elementor() ) {
$content = $el_frontend->get_builder_content_for_display( $post_id, false );
}
return $content;
}
add_filter( 'burst_the_content', 'burst_elementor_the_content', 10, 2 );
/**
* clear elementor cache when duplicating a page, so that a new elementor css file will be genrated
*
* @param boolean $post_id
* @param boolean $new_post_id
* @return void
*/
function burst_clear_elementor_cache( $post_id = false, $new_post_id = false ) {
Elementor\Plugin::$instance->files_manager->clear_cache();
}
add_action( 'burst_after_duplicate_post', 'burst_clear_elementor_cache' );

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden.

View File

@@ -0,0 +1,21 @@
<?php
defined( 'ABSPATH' ) or die( 'you do not have access to this page!' );
/**
* Delete burst_total_pageviews_count meta when duplicating a product
*
* @param $duplicate
*
* @return void
* @hooked woocommerce_product_duplicate
*/
function burst_delete_post_pageviews_on_duplicate_product( $duplicate = null ) {
if ( ! $duplicate ) {
return;
}
$id = $duplicate->get_id();
delete_post_meta( $id, 'burst_total_pageviews_count' );
}
add_action( 'woocommerce_product_duplicate', 'burst_delete_post_pageviews_on_duplicate_product' );

View File

@@ -0,0 +1,34 @@
<?php
defined( 'ABSPATH' ) or die();
/**
* Excludes some Uncode inline scripts from combine JS
*
* @since 3.1
* @author Remy Perona
*
* @param array $inline_js Array of patterns to match for exclusion.
* @return array
*/
function burst_exclude_inline_js( $inline_js ) {
$inline_js[] = 'burst';
return $inline_js;
}
add_filter( 'rocket_excluded_inline_js_content', 'burst_exclude_inline_js' );
/**
* Excludes Uncode init and ai-uncode JS files from minification/combine
*
* @since 3.1
* @author Remy Perona
*
* @param array $excluded_js Array of JS filepaths to be excluded.
* @return array
*/
function burst_exclude_js( $excluded_js ) {
$excluded_js[] = '(.*)timeme(.*)';
$excluded_js[] = '(.*)burst(.*)';
return $excluded_js;
}
add_filter( 'rocket_exclude_js', 'burst_exclude_js' );