| 1 |
<?php |
| 2 |
/* |
| 3 |
* @copyright Copyright (C) 2015 - 2016 Marco Beierer. All rights reserved. |
| 4 |
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL |
| 5 |
*/ |
| 6 |
defined('ABSPATH') or die('Restricted access.'); |
| 7 |
|
| 8 |
if (!function_exists('tokenCheck')) { |
| 9 |
function tokenCheck($service, $url) { |
| 10 |
$token = get_option('link-checker-token'); |
| 11 |
if ($token == '') { ?> |
| 12 |
<div class="notice notice-error below-h2"> |
| 13 |
<p>The scheduler is only available if you have deposited a valid token for the <?php echo $service; ?> Professional in the settings. You could purchase the <a href="https://www.marcobeierer.com/wordpress-plugins/<?php echo $url; ?>-professional"><?php echo $service; ?> Professional</a> on my website</p> |
| 14 |
</div> |
| 15 |
|
| 16 |
|
| 17 |
<?php } |
| 18 |
} |
| 19 |
} |
| 20 |
|
| 21 |
if (!function_exists('localhostCheck')) { |
| 22 |
function localhostCheck() { |
| 23 |
|
| 24 |
if (preg_match('/^https?:\/\/(?:localhost|127\.0\.0\.1)/i', get_home_url()) === 1): // TODO implement a better localhost detection ?> |
| 25 |
|
| 26 |
<div class="notice notice-error below-h2"> |
| 27 |
<p>It is not possible to use this plugin in a local development environment. The backend service needs to crawl your website and this is just possible if your site is reachable from the internet.</p> |
| 28 |
</div> |
| 29 |
|
| 30 |
<?php endif; |
| 31 |
} |
| 32 |
} |
| 33 |
|
| 34 |
// do not comment this because it is still used by the Sitemap Generator |
| 35 |
if (!function_exists('cURLCheck')) { |
| 36 |
function cURLCheck() { |
| 37 |
|
| 38 |
if (!function_exists('curl_version')): ?> |
| 39 |
|
| 40 |
<div class="notice notice-error below-h2"> |
| 41 |
<p>cURL is not activated on your webspace. Please activate it in your web hosting control panel. This plugin will not work without cURL activated.</p> |
| 42 |
</div> |
| 43 |
|
| 44 |
<?php else: // curl is installed |
| 45 |
|
| 46 |
$curlVersion = curl_version(); // temp var necessary for PHP 5.3 |
| 47 |
if (version_compare($curlVersion['version'], '7.18.1', '<')): ?> |
| 48 |
|
| 49 |
<div class="notice notice-error below-h2"> |
| 50 |
<p>You have an outdated version of cURL installed. Please update to cURL 7.18.1 or higher in your web hosting control panel. A compatible version should be provided by default with PHP 5.4 or higher. This plugin will not work with the currently installed cURL version.</p> |
| 51 |
</div> |
| 52 |
|
| 53 |
<?php endif; |
| 54 |
endif; |
| 55 |
} |
| 56 |
} |
| 57 |
?> |
| 58 |
|