Changeset 2117205
- Timestamp:
- 07/03/2019 09:39:15 PM (7 years ago)
- Location:
- power-abm/trunk
- Files:
-
- 2 edited
-
abm.php (modified) (5 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
power-abm/trunk/abm.php
r2117193 r2117205 26 26 27 27 $lines = array(); 28 insert_with_markers($htaccess, " ABM", $lines);28 insert_with_markers($htaccess, "PowerABM", $lines); 29 29 } 30 30 … … 83 83 $utm_campaign = get_option('power_abm_utm_campaign'); 84 84 85 $htaccess = get_home_path().".htaccess";85 $htaccess = power_abm_get_htaccess_path(); 86 86 87 87 $lines = array(); … … 89 89 $lines[1] = "RedirectMatch 301 ^/$abm_vanity_url/(.*)$ /index.php/$abm_landing_page?utm_source=$utm_source&utm_medium=$utm_medium&utm_campaign=$utm_campaign&utm_content=$1"; 90 90 91 insert_with_markers($htaccess, "ABM", $lines);91 return insert_with_markers($htaccess, "PowerABM", $lines); 92 92 } 93 93 … … 97 97 if (in_array($option, $options)) { 98 98 error_log("Regenerating htaccess since $option changed"); 99 power_abm_regenerate_htaccess(); 99 $res = power_abm_regenerate_htaccess(); 100 if(!$res) { 101 add_settings_error( 102 'powerAbmSaveError', 103 esc_attr( 'settings_not_updated' ), 104 __( 'Cannot save settings', 'power-abm-domain' ), 105 'error' 106 ); 107 } 100 108 } 101 109 } 102 110 111 function power_abm_get_htaccess_path() { 112 return get_home_path().".htaccess"; 113 } 114 115 function power_abm_is_htaccess_writable() { 116 $htaccess_path = power_abm_get_htaccess_path(); 117 118 return is_writable($htaccess_path); 119 } 120 103 121 function power_abm_admin_view() { 122 if (power_abm_is_htaccess_writable()) { 104 123 ?> 105 124 <div class="wrap"> … … 166 185 </div> 167 186 168 <?php } 187 <?php } else { 188 print_r("htaccess file isn't writable"); 189 } 190 } 169 191 ?> -
power-abm/trunk/readme.txt
r2117193 r2117205 34 34 == Changelog == 35 35 36 = 0.0.2 = 37 Added a few error checking (is .htaccess writable, did saving setting succeeded) 38 36 39 = 0.1 = 37 40 First release. Allows redirect functionality for one campaign.
Note: See TracChangeset
for help on using the changeset viewer.