| Server IP : 188.114.96.2 / Your IP : 104.23.197.230 Web Server : Apache/2.4.59 (Debian) System : Linux EDL-STRETCH 4.19.0-27-amd64 #1 SMP Debian 4.19.316-1 (2024-06-25) x86_64 User : edlftp ( 1002) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/nicolasj/www/propulseasbl.be/wp-content/plugins/dueling/ |
Upload File : |
<?php
if (!class_exists('GFAddonCommon')) {
class GFAddonCommon {
//display admin warnings if GF is not the correct version or GF is not installed
public static function admin_warnings($plugin, $textdomain, $min_gf_version) {
if ( !self::is_gravityforms_installed() ) {
$message = __('requires Gravity Forms to be installed.', $textdomain);
} else if ( !self::is_gravityforms_supported($min_gf_version) ) {
$message = __('requires a minimum Gravity Forms version of ', $textdomain) . $min_gf_version;
}
if (empty($message)) {
return;
}
?>
<div class="error">
<p>
<?php _e('The plugin ', $textdomain); ?><strong><?php echo $plugin; ?></strong> <?php echo $message; ?><br />
<?php _e('Please ', $textdomain); ?><a href="http://bit.ly/getgravityforms"><?php _e(' download the latest version ',$textdomain); ?></a><?php _e(' of Gravity Forms and try again.',$textdomain) ?>
</p>
</div>
<?php
}
/*
* Check if GF is installed
*/
public static function is_gravityforms_installed(){
return class_exists( 'RGForms' );
}
/*
* Check if the installed version of GF is supported
*/
public static function is_gravityforms_supported($min_gf_version = '1.5'){
return self::check_gravityforms_version( $min_gf_version,'>=' );
}
/*
* Do a GF version compare
*/
public static function check_gravityforms_version($version, $operator){
if(class_exists('GFCommon')){
return version_compare( GFCommon::$version, $version, $operator );
}
return false;
}
/*
* Returns the url of the plugin's root folder
*/
public function get_base_url(){
return plugins_url(null, __FILE__);
}
/*
* Returns the physical path of the plugin's root folder
*/
public function get_base_path(){
$folder = basename(dirname(__FILE__));
return WP_PLUGIN_DIR . '/' . $folder;
}
/**
* starts_with
* Tests if a text starts with an given string.
*
* @param string
* @param string
* @return bool
*/
public static function starts_with($haystack, $needle){
return strpos($haystack, $needle) === 0;
}
/*
* returns true if a needle can be found in a haystack
*/
public static function str_contains($haystack, $needle) {
if (empty($haystack) || empty($needle))
return false;
$pos = strpos(strtolower($haystack), strtolower($needle));
if ($pos === false)
return false;
else
return true;
}
}
}
?>