Changeset 3288874
- Timestamp:
- 05/07/2025 06:54:27 AM (11 months ago)
- Location:
- leadinfo/trunk
- Files:
-
- 2 edited
-
leadinfo.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
leadinfo/trunk/leadinfo.php
r3150142 r3288874 4 4 * Plugin URI: https://wordpress.org/plugins/leadinfo/ 5 5 * Description: Leadinfo Plugin 6 * Version: 1.16 * Version: 2.1 7 7 * Author: Leadinfo 8 * Author URI: https://www.leadinfo.com/8 * Author URI: https://www.leadinfo.com/ 9 9 * Copyright 2018 10 10 * … … 23 23 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 24 24 */ 25 if (!defined('WPINC')) { 25 26 27 // Deny direct access to plugin files!! 28 if (!defined('WPINC') || !defined('ABSPATH')) { 26 29 exit; 27 30 } 28 require_once plugin_dir_path(__FILE__) . 'leadinfo.class.php';29 31 30 re gister_activation_hook(__FILE__, 'leadinfo_activate');31 re gister_deactivation_hook(__FILE__, 'leadinfo_deactivate');32 re gister_uninstall_hook(__FILE__, 'leadinfo_uninstall');32 require_once plugin_dir_path(__FILE__) . 'class/leadinfo.php'; 33 require_once plugin_dir_path(__FILE__) . 'includes/functions.php'; 34 require_once plugin_dir_path(__FILE__) . 'includes/api/rest.php'; 33 35 34 add_action('rest_api_init', function () {35 register_rest_route('/leadinfo/v1', '/tracker_code', array(36 'methods' => 'POST',37 'callback' => 'add_leadinfo_tracker_code',38 ));39 });40 36 41 function add_leadinfo_tracker_code($data) { 42 if(empty($data['tracker_code'])){ 43 return; 44 } 37 $pluginName = plugin_basename(__FILE__); 45 38 46 update_option('leadinfo_id', $data['tracker_code']);47 }48 39 49 40 $leadinfo = new Leadinfo(); 50 41 $leadinfo->run(); 51 42 52 function leadinfo_activate() 43 44 // Register plugin activation hook 45 register_activation_hook(__FILE__, 'leadinfo_activate'); 46 function leadinfo_activate(): void 53 47 { 54 48 add_option('leadinfo_id', '', '', 'yes'); 55 49 } 56 //test 57 function leadinfo_deactivate() 50 51 // Register plugin deactivation hook 52 register_deactivation_hook(__FILE__, 'leadinfo_deactivate'); 53 function leadinfo_deactivate(): void 58 54 { 59 55 delete_option('leadinfo_id'); 60 56 } 61 57 62 function leadinfo_uninstall() 58 // Register plugin uninstall hook 59 register_uninstall_hook(__FILE__, 'leadinfo_uninstall'); 60 function leadinfo_uninstall(): void 63 61 { 64 62 delete_option('leadinfo_id'); 65 63 } 66 64 65 66 // Generate settings link in menu 67 add_filter("plugin_action_links_" . $pluginName, 'leadinfo_settings_link'); 67 68 function leadinfo_settings_link($links) 68 69 { … … 71 72 return $links; 72 73 } 73 74 $plugin = plugin_basename(__FILE__);75 add_filter("plugin_action_links_" . $plugin, 'leadinfo_settings_link'); -
leadinfo/trunk/readme.txt
r3150142 r3288874 4 4 Requires at least: 3.0.1 5 5 Tested up to: 6.4.3 6 Stable tag: 1.06 Stable tag: 2.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 29 29 Yes, if you don't have an account yet get one free at [Leadinfo.com](https://www.leadinfo.com) 30 30 == Changelog == 31 = 2.1 = 32 * Rewrite plugin 33 * Organized file structure 34 * Only update SiteID if allowed 31 35 = 1.0 = 32 36 * Initial release
Note: See TracChangeset
for help on using the changeset viewer.