' .
'
' .
sprintf(
wp_kses(
/* translators: %1$s - OptinMonster API plugin name; %2$s - optinmonster.com URL to a related doc. */
__( 'Your site is running an outdated version of PHP that is no longer supported and may cause issues with the %1$s plugin. Read more for additional information.', 'optin-monster-api' ),
array(
'a' => array(
'href' => array(),
'target' => array(),
'rel' => array(),
),
)
),
'OptinMonster API',
'https://optinmonster.com/docs/supported-php-version/'
) .
'
' .
wp_kses(
__( 'Please Note: Support for PHP 5.5 will be discontinued in 2020. After this, if no further action is taken, OptinMonster functionality will be disabled.', 'optin-monster-api' ),
array(
'strong' => array(),
'em' => array(),
)
) .
'
' .
'
';
}
/**
* Get the asset version for enqueued assets.
*
* @since 1.9.10
*
* @return mixed
*/
public function asset_version() {
if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
return time();
}
if ( defined( 'OPTINMONSTER_ENV' ) && 'dev' === strtolower( OPTINMONSTER_ENV ) ) {
return time();
}
$beta_version = $this->beta_version( 'U' );
return $beta_version ? $beta_version : $this->version;
}
/**
* Check if beta is enabled.
*
* @since 2.0.0
*
* @return bool
*/
public function beta_enabled() {
$option = $this->get_option();
return apply_filters( 'optin_monster_beta_enabled', ! empty( $option['beta'] ) );
}
/**
* Get beta version.
*
* @since 2.0.0
*
* @param string $format The php date format.
*
* @return bool
*/
public function beta_version( $format = 'd M Y H:i:s' ) {
static $timestamp = null;
$version = false;
if ( ! $this->beta_enabled() ) {
return $version;
}
if ( null === $timestamp ) {
$file = plugin_dir_path( __FILE__ ) . '.betaversion';
if ( file_exists( $file ) ) {
ob_start();
include plugin_dir_path( __FILE__ ) . '.betaversion';
$timestamp = ob_get_clean();
}
}
if ( ! empty( $timestamp ) ) {
$version = gmdate( $format, (int) $timestamp );
}
return $version;
}
/**
* The access capability required for access to OptinMonster pages/settings.
*
* @since 2.0.0
*
* @param string|null $slug The menu slug. Null by default.
*
* @return string The access capability.
*/
public function access_capability( $slug = null ) {
return apply_filters( 'optin_monster_api_menu_cap', 'manage_options', $slug );
}
/**
* Check if user has access capability required for access to OptinMonster pages/settings.
*
* @since 2.0.0
*
* @param string|null $slug The menu slug. Null by default.
*
* @return bool Whether user has access.
*/
public function can_access( $slug = null ) {
return current_user_can( $this->access_capability( $slug ) );
}
/**
* Get app url, with proper query args set to ensure going to correct account, and setting return
* query arg to come back (if relevant on the destination page).
*
* @since 2.0.0
*
* @param string $path The path on the app.
* @param string $return_url Url to return. Will default to wp_get_referer().
*
* @return string The app url.
*/
public function app_url( $path, $return_url = '' ) {
return OMAPI_Urls::om_app( $path, $return_url );
}
/**
* Returns the singleton instance of the class.
*
* @since 1.0.0
*
* @return OMAPI
*/
public static function get_instance() {
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof OMAPI ) ) {
self::$instance = new OMAPI();
}
return self::$instance;
}
/**
* Magic getter for our object.
*
* @since 2.11.2
*
* @param string $property The property to retrieve.
*
* @return mixed
*/
public function __get( $property ) {
if ( ! empty( self::$class_map[ $property ] ) ) {
$this->$property = new self::$class_map[ $property ]();
}
return $this->$property;
}
}
register_activation_hook( __FILE__, 'optin_monster_api_activation_hook' );
/**
* Fired when the plugin is activated.
*
* @since 1.0.0
*
* @global int $wp_version The version of WordPress for this install.
* @global object $wpdb The WordPress database object.
* @param boolean $network_wide True if WPMU superadmin uses "Network Activate" action, false otherwise.
*/
function optin_monster_api_activation_hook( $network_wide ) {
global $wp_version;
if ( version_compare( $wp_version, '4.7.0', '<' ) && ! defined( 'OPTINMONSTER_FORCE_ACTIVATION' ) ) {
deactivate_plugins( plugin_basename( __FILE__ ) );
wp_die(
wp_kses_post(
sprintf(
/* translators: %s) admin url */
__( 'Sorry, but your version of WordPress does not meet OptinMonster\'s required version of