Changeset 2995091
- Timestamp:
- 11/13/2023 11:09:54 AM (2 years ago)
- Location:
- plerdy-heatmap/trunk
- Files:
-
- 2 edited
-
plerdy_heatmap_tracking.php (modified) (7 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
plerdy-heatmap/trunk/plerdy_heatmap_tracking.php
r2989934 r2995091 4 4 Plugin URI: https://www.plerdy.com 5 5 Description: The easiest way to add the Plerdy tracking script to your WordPress site! 6 Version: 1.3. 36 Version: 1.3.5 7 7 Author: Plerdy 8 8 Author URI: https://www.plerdy.com … … 25 25 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 26 26 */ 27 27 28 28 29 class Plerdy { … … 47 48 public function delete_option($order_id) { 48 49 delete_option('plerdy_tracking_script'); 49 delete_option('plerdy_abtracking_script');50 delete_option('plerdy_abtracking_script'); 50 51 } 51 52 … … 65 66 66 67 } 67 68 68 69 public function add_abtracking_script() { 69 echo get_option('plerdy_abtracking_script');70 }70 echo get_option('plerdy_abtracking_script'); 71 } 71 72 72 73 public function admin_menu_page() { … … 93 94 "\s*<script type=\"text\/javascript\" defer data-plerdy_code='1'>\s*" . 94 95 "var _protocol=\"https:\"==document\.location\.protocol\?\" https:\/\/\":\" http:\/\/\";\s*" . 95 "_site_hash_code = \"([ a-f0-9]{32})\",_suid=(\d+),\s*" .96 "_site_hash_code = \"([^\"]*)\",_suid=([^;\s<>]*),\s*" . 96 97 "plerdyScript=document\.createElement\(\"script\"\);\s*" . 97 98 "plerdyScript\.setAttribute\(\"defer\",\"\"\),plerdyScript\.dataset\.plerdymainscript=\"plerdymainscript\",\s*" . 98 "plerdyScript\.src=\"https:\/\/ test\.plerdy\.com\/public\/js\/click\/main\.js\?v=\"\+Math\.random\(\);\s*" .99 "plerdyScript\.src=\"https:\/\/[a-z]\.plerdy\.com\/public\/js\/click\/main\.js\?v=\"\+Math\.random\(\);\s*" . 99 100 "var plerdymainscript=document\.querySelector\(\"\\[data-plerdymainscript='plerdymainscript'\\]\"\);\s*" . 100 101 "plerdymainscript&&plerdymainscript\.parentNode\.removeChild\(plerdymainscript\);\s*" . … … 106 107 107 108 108 if (preg_match($pattern, $input) ) {109 if (preg_match($pattern, $input) || empty($input)) { 109 110 return $input; 110 111 } else { … … 118 119 // regular expression for validation 119 120 120 $pattern = "/^" . 121 preg_quote("<!-- BEGIN PLERDY A/B TESTING CODE -->", '/') . 122 "<script type=\"text\/javascript\">" . 123 "_suid=(\d+);" . 124 "<\/script>" . 125 "<script async type=\"text\/javascript\" src=\"https://test.plerdy.com/public/js/click/plerdy_ab-min.js?v=" . 126 "([a-zA-Z0-9]+)\"" . ">". 127 "<\/script>" . 128 preg_quote("<!-- END PLERDY A/B TESTING CODE -->", '/') . 129 "$/"; 121 $pattern = "/<!-- BEGIN PLERDY A\/B TESTING CODE -->\s*" . 122 "<script type=\"text\/javascript\">\s*" . 123 "var _suid=(\d+);\s*" . 124 "<\/script>\s*" . 125 "<script\s+async\s+type=\"text\/javascript\"\s+src=\"https:\/\/[a-zA-Z0-9.\/:_-]+\/plerdy_ab-min\.js\?v=([^\"\s]+)\"[^>]*>\s*" . 126 "<\/script>\s*" . 127 "<!-- END PLERDY A\/B TESTING CODE -->\s*$/i"; 130 128 131 if (preg_match($pattern, $input)) {132 129 133 return $input; 130 if (preg_match($pattern, $input) || empty($input)) { 131 132 return $input; 134 133 } else { 135 134 // If validation fails, return the default value -
plerdy-heatmap/trunk/readme.txt
r2989840 r2995091 4 4 Requires at least: 1.0 5 5 Tested up to: 6.3 6 Stable Tag: 1.3. 36 Stable Tag: 1.3.5 7 7 License: GPLv2 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset
for help on using the changeset viewer.