Changeset 1669720
- Timestamp:
- 06/02/2017 03:54:49 PM (9 years ago)
- Location:
- ph-publisher/trunk
- Files:
-
- 4 edited
-
assets/ph_publisher.js (modified) (1 diff)
-
functions.php (modified) (1 diff)
-
ph_publisher.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ph-publisher/trunk/assets/ph_publisher.js
r1669507 r1669720 81 81 longname : "PH Publisher Links", 82 82 author : "Performance Horizon", 83 version : "1 "83 version : "1.1.4" 84 84 }; 85 85 } -
ph-publisher/trunk/functions.php
r1669507 r1669720 2 2 3 3 defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); 4 5 function ph_publisher_update_db_check() 6 { 7 if ( ! current_user_can( 'update_plugins' ) ) 8 { 9 return; 10 } 11 12 $str_current_version = get_option( '_ph_publisher_version' ); 13 14 if ($str_current_version != PH_PUBLISHER_VERSION) 15 { 16 ph_publisher_upgrade_install( $str_current_version, PH_PUBLISHER_VERSION); 17 } 18 } 19 add_action( 'plugins_loaded', 'ph_publisher_update_db_check' ); 20 21 /** 22 * Will be used to manage the upgrades should any DB data need changing 23 * @param String $str_current_version The version last registered with this WP install 24 * @param String $str_release_version The current version of this plugin 25 */ 26 function ph_publisher_upgrade_install( $str_current_version, $str_release_version ) 27 { 28 update_option( '_ph_publisher_version', $str_release_version ); 29 } 4 30 5 31 /** -
ph-publisher/trunk/ph_publisher.php
r1669581 r1669720 5 5 Plugin URI: # 6 6 Description: Load your Performance Horizon publisher credentials for access to PH data. You will be able to quickly add your tracking links to any new post you create. 7 Version: 1.1. 37 Version: 1.1.4 8 8 Author: Performance Horizon 9 9 Author URI: http://www.performancehorizon.com/ … … 13 13 defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); 14 14 15 define( 'PH_PUBLISHER_VERSION', '1.1. 3' );15 define( 'PH_PUBLISHER_VERSION', '1.1.4' ); 16 16 17 17 require_once( plugin_dir_path( __FILE__ ) . "functions.php" ); … … 33 33 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 34 34 35 $sql = "CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}ph_publisher_participation` ( 36 ID int(11) AUTO_INCREMENT NOT NULL, 37 auth_id int(11) NOT NULL, 38 campaign_id varchar(100) NOT NULL, 39 campaign_title text NOT NULL, 40 camref varchar(100) NOT NULL UNIQUE, 41 tracking_link text NOT NULL, 42 is_cpc enum('y','n') NOT NULL DEFAULT 'n', 43 PRIMARY KEY (ID) 44 ) $charset_collate;"; 45 46 dbDelta( $sql ); 47 48 $sql = "CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}ph_publisher_auth` ( 49 ID int(11) AUTO_INCREMENT NOT NULL, 50 wp_user_id int(11) NOT NULL UNIQUE, 51 application_api_key varchar(100) NOT NULL, 52 user_api_key varchar(100) NOT NULL, 53 publisher_id varchar(100) NOT NULL, 54 PRIMARY KEY (ID) 55 ) $charset_collate;"; 56 57 dbDelta( $sql ); 58 59 add_option( '_ph_auth_table', 'ph_publisher_auth' ); 60 add_option( '_ph_participation_table', 'ph_publisher_participation' ); 61 add_option( '_ph_publisher_version', PH_PUBLISHER_VERSION ); 35 $str_table_name = $wpdb->prefix . 'ph_publisher_participation'; 36 if ($wpdb->get_var("SHOW TABLES LIKE '{$str_table_name}'") !== $str_table_name) 37 { 38 $sql = "CREATE TABLE IF NOT EXISTS `{$str_table_name}` ( 39 ID int(11) AUTO_INCREMENT NOT NULL, 40 auth_id int(11) NOT NULL, 41 campaign_id varchar(100) NOT NULL, 42 campaign_title text NOT NULL, 43 camref varchar(100) NOT NULL UNIQUE, 44 tracking_link text NOT NULL, 45 is_cpc enum('y','n') NOT NULL DEFAULT 'n', 46 PRIMARY KEY (ID) 47 ) $charset_collate;"; 48 dbDelta( $sql ); 49 } 50 51 $str_table_name = $wpdb->prefix . 'ph_publisher_auth'; 52 if ($wpdb->get_var("SHOW TABLES LIKE '{$str_table_name}'") !== $str_table_name) 53 { 54 $sql = "CREATE TABLE IF NOT EXISTS `{$str_table_name}` ( 55 ID int(11) AUTO_INCREMENT NOT NULL, 56 wp_user_id int(11) NOT NULL UNIQUE, 57 application_api_key varchar(100) NOT NULL, 58 user_api_key varchar(100) NOT NULL, 59 publisher_id varchar(100) NOT NULL, 60 PRIMARY KEY (ID) 61 ) $charset_collate;"; 62 dbDelta( $sql ); 63 } 64 65 if ( get_option( '_ph_auth_table' ) === FALSE) 66 { 67 add_option( '_ph_auth_table', 'ph_publisher_auth' ); 68 } 69 if ( get_option( '_ph_participation_table' ) === FALSE) 70 { 71 add_option( '_ph_participation_table', 'ph_publisher_participation' ); 72 } 73 if ( get_option( '_ph_publisher_version' ) === FALSE) 74 { 75 add_option( '_ph_publisher_version', PH_PUBLISHER_VERSION ); 76 } 62 77 } 63 78 register_activation_hook( __FILE__, 'ph_publisher_install' ); … … 69 84 function ph_publisher_uninstall() 70 85 { 86 if ( ! current_user_can( 'update_plugins' )) 87 { 88 return; 89 } 90 71 91 global $wpdb; 72 92 -
ph-publisher/trunk/readme.txt
r1669581 r1669720 12 12 13 13 == Description == 14 This will add a settings page to the Admin dashboard so you can provide dyour Performance Horizon (PH) API credentials. The plugin will then query the PH API to obtain all of your available, and approved, affiliate marketing campaigns. When you add a new post to the site there will be an option in Editor to select your tracking link and add any of the available parameters to the URL.14 This will add a settings page to the Admin dashboard so you can provide your Performance Horizon (PH) API credentials. The plugin will then query the PH API to obtain all of your available, and approved, affiliate marketing campaigns. When you add a new post to the site there will be an option in Editor to select your tracking link and add any of the available parameters to the URL. 15 15 16 16 == Installation == … … 24 24 25 25 == Changelog == 26 = 1.1.4 = 27 * Fix spelling mistake in description 28 * Add Plugin management authentication 29 * Add update checks and functionality 30 26 31 = 1.1.3 = 27 32 * Added admin menu icon
Note: See TracChangeset
for help on using the changeset viewer.