-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from simplereach/p7
give force http option to publishers
- Loading branch information
Showing
3 changed files
with
27 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
Author URI: https://www.simplereach.com | ||
*/ | ||
|
||
define('SRANALYTICS_PLUGIN_VERSION', '0.0.6'); | ||
define('SRANALYTICS_PLUGIN_VERSION', '0.0.7'); | ||
define('SRANALYTICS_PLUGIN_URL', PLugin_dir_url(__FILE__)); | ||
define('SRANALYTICS_PLUGIN_SUPPORT_EMAIL', '[email protected]'); | ||
|
||
|
@@ -36,6 +36,9 @@ function sranalytics_insert_js() | |
$sranalytics_show_everywhere_string = get_option('sranalytics_show_everywhere'); | ||
$sranalytics_show_everywhere = ($sranalytics_show_everywhere_string === 'true'); | ||
|
||
$sranalytics_force_http_string = get_option('sranalytics_force_http'); | ||
$sranalytics_force_http = ($sranalytics_force_http_string === 'true'); | ||
|
||
$sranalytics_disable_iframe_loading_string = get_option('sranalytics_disable_iframe_loading'); | ||
$sranalytics_disable_iframe_loading = ($sranalytics_disable_iframe_loading_string === 'true'); | ||
|
||
|
@@ -82,6 +85,12 @@ function sranalytics_insert_js() | |
$published_date = $post->post_date_gmt; | ||
$canonical_url = addslashes(get_permalink($post->ID)); | ||
|
||
//force https to http if option is checked | ||
if($sranalytics_force_http){ | ||
$pattern = '/^https:\/\//'; | ||
$canonical_url = preg_replace( $pattern , "http://" , $canonical_url); | ||
} | ||
|
||
// Show the tags if we are on a tag/author/category page and we are supposed to | ||
if ((is_category() or is_author() or is_tag()) and ($sranalytics_show_on_tac_pages or $sranalytics_show_everywhere)) { | ||
$sranalytics_show_beacon = true; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters