Changeset 1793446
- Timestamp:
- 12/28/2017 05:43:28 AM (8 years ago)
- Location:
- payform/trunk
- Files:
-
- 2 edited
-
payform.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
payform/trunk/payform.php
r1791882 r1793446 2 2 /* 3 3 Plugin Name: PayForm 4 Version: 1.0. 74 Version: 1.0.8 5 5 Plugin URI: http://payform.me/ 6 6 Author: PayForm … … 12 12 } else { 13 13 $payform_for_wordpress[] = 'base'; 14 } 15 16 function payform_base_guidv4() { 17 if (function_exists('com_create_guid') === true) 18 return trim(com_create_guid(), '{}'); 19 20 $data = openssl_random_pseudo_bytes(16); 21 $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0100 22 $data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10 23 return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4)); 14 24 } 15 25 … … 30 40 31 41 function payform_embed_content_filter( $content ) { 32 $search = "(\[payform=([A-Za-z0-9]+)\])";33 $content = preg_replace($search,"<div class='payform_wp_container'><span class='payform_wp' payform_id='$1'></span></div>",$content);42 $search = "(\[payform=([A-Za-z0-9]+)\])"; 43 $content = preg_replace($search,"<div class='payform_wp_container'><span class='payform_wp' payform_id='$1'></span></div>",$content); 34 44 return $content; 35 45 } … … 54 64 55 65 } 66 67 function payform_base_activate() { 68 69 if (!get_option('payform_unique_id')) update_option('payform_unique_id',payform_base_guidv4()); 70 //add_action( 'admin_notices', 'payform_base_activation_notice' ); 71 set_transient( 'payform-base-admin-notice-activation', true, 5 ); 72 } 73 74 register_activation_hook( __FILE__, 'payform_base_activate' ); 75 76 /* Add admin notice */ 77 add_action( 'admin_notices', 'payform_base_admin_notice_example_notice' ); 78 79 function payform_base_admin_notice_example_notice(){ 80 81 /* Check transient, if available display notice */ 82 if( get_transient( 'payform-base-admin-notice-activation' ) ){ 83 ?> 84 <script> 85 (function(w,d,t,u,n,a,m){w['MauticTrackingObject']=n; 86 w[n]=w[n]||function(){(w[n].q=w[n].q||[]).push(arguments)},a=d.createElement(t), 87 m=d.getElementsByTagName(t)[0];a.async=1;a.src=u;m.parentNode.insertBefore(a,m) 88 })(window,document,'script','https://payform.mautic.net/mtc.js','mt'); 89 90 jQuery('body').prepend('<div id="payFormLoadingLocker" style="position:fixed;top:0px;left:0px;width:100%;height:100%;z-index:999999;cursor:wait;background:rgba(0,0,0,0.3)"></div>'); 91 92 mt('send', 'pageview', { 93 wordpress_unique_id: "<?php echo get_option('payform_unique_id');?>", 94 website: "<?php echo get_site_url();?>", 95 wordpress_status: "activated", 96 page_title: "Plugin activated - <?php echo get_bloginfo('name');?>", 97 page_url: "<?php echo get_site_url();?>", 98 }, { 99 onload: function() { 100 jQuery('#payFormLoadingLocker').remove(); 101 }, 102 onerror: function() { 103 jQuery('#payFormLoadingLocker').remove(); 104 } 105 }); 106 </script> 107 <div class="updated notice is-dismissible"> 108 <p>Thank you for downloading PayForm! <strong>Go to any post or page and give it a try!</strong>.</p> 109 </div> 110 <?php 111 /* Delete transient, only display this notice once. */ 112 delete_transient( 'payform-base-admin-notice-activation' ); 113 } 114 } 115 116 function payform_base_deactivation() { 117 118 $d = urlencode(base64_encode(serialize(array( 119 'page_url' => get_site_url(), 120 'page_title' => "Plugin deactivated - " . get_bloginfo('name'), 121 'wordpress_status' => "deactivated", 122 'wordpress_unique_id' => get_option('payform_unique_id') 123 )))); 124 125 wp_remote_get('https://payform.mautic.net/mtracking.gif?d=' . $d); 126 } 127 register_deactivation_hook( __FILE__, 'payform_base_deactivation' ); 128 129 130 function payform_base_uninstall() { 131 132 $d = urlencode(base64_encode(serialize(array( 133 'page_url' => get_site_url(), 134 'page_title' => "Plugin uninstalled - " . get_bloginfo('name'), 135 'wordpress_status' => "uninstalled", 136 'wordpress_unique_id' => get_option('payform_unique_id') 137 )))); 138 139 wp_remote_get('https://payform.mautic.net/mtracking.gif?d=' . $d); 140 } 141 register_uninstall_hook( __FILE__, 'payform_base_uninstall' ); 142 -
payform/trunk/readme.txt
r1791882 r1793446 4 4 Requires at least: 3.0.1 5 5 Tested up to: 4.9 6 Stable tag: 1.0. 76 Stable tag: 1.0.8 7 7 License: GPLv2 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 52 52 == Changelog == 53 53 54 = 1.0.8 = 55 * New advanced options 56 54 57 = 1.0.7 = 55 58 * Added support for Zapier
Note: See TracChangeset
for help on using the changeset viewer.