/*
Plugin Name: One Click Demo Import
Plugin URI: https://wordpress.org/plugins/one-click-demo-import/
Description: Import your content, widgets and theme settings with one click. Theme authors! Enable simple demo import for your theme demo data.
Version: 3.3.0
Requires at least: 5.5
Requires PHP: 5.6
Author: OCDI
Author URI: https://ocdi.com
License: GPL3
License URI: http://www.gnu.org/licenses/gpl.html
Text Domain: one-click-demo-import
Domain Path: /languages
*/
// Block direct access to the main plugin file.
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
/**
* Main plugin class with initialization tasks.
*/
class OCDI_Plugin {
/**
* Constructor for this class.
*/
public function __construct() {
/**
* Display admin error message if PHP version is older than 5.6.
* Otherwise execute the main plugin class.
*/
if ( version_compare( phpversion(), '5.6', '<' ) ) {
add_action( 'admin_notices', array( $this, 'old_php_admin_error_notice' ) );
}
else {
// Set plugin constants.
$this->set_plugin_constants();
// Composer autoloader.
require_once OCDI_PATH . 'vendor/autoload.php';
// Instantiate the main plugin class *Singleton*.
$one_click_demo_import = OCDI\OneClickDemoImport::get_instance();
// Register WP CLI commands
if ( defined( 'WP_CLI' ) && WP_CLI ) {
WP_CLI::add_command( 'ocdi list', array( 'OCDI\WPCLICommands', 'list_predefined' ) );
WP_CLI::add_command( 'ocdi import', array( 'OCDI\WPCLICommands', 'import' ) );
}
}
}
/**
* Display an admin error notice when PHP is older the version 5.6.
* Hook it to the 'admin_notices' action.
*/
public function old_php_admin_error_notice() { /* translators: %1$s - the PHP version, %2$s and %3$s - strong HTML tags, %4$s - br HTMl tag. */
$message = sprintf( esc_html__( 'The %2$sOne Click Demo Import%3$s plugin requires %2$sPHP 5.6+%3$s to run properly. Please contact your hosting company and ask them to update the PHP version of your site to at least PHP 7.4%4$s Your current version of PHP: %2$s%1$s%3$s', 'one-click-demo-import' ), phpversion(), '', '', '
' );
printf( '
', wp_kses_post( $message ) );
}
/**
* Set plugin constants.
*
* Path/URL to root of this plugin, with trailing slash and plugin version.
*/
private function set_plugin_constants() {
// Path/URL to root of this plugin, with trailing slash.
if ( ! defined( 'OCDI_PATH' ) ) {
define( 'OCDI_PATH', plugin_dir_path( __FILE__ ) );
}
if ( ! defined( 'OCDI_URL' ) ) {
define( 'OCDI_URL', plugin_dir_url( __FILE__ ) );
}
// Used for backward compatibility.
if ( ! defined( 'PT_OCDI_PATH' ) ) {
define( 'PT_OCDI_PATH', plugin_dir_path( __FILE__ ) );
}
if ( ! defined( 'PT_OCDI_URL' ) ) {
define( 'PT_OCDI_URL', plugin_dir_url( __FILE__ ) );
}
// Action hook to set the plugin version constant.
add_action( 'admin_init', array( $this, 'set_plugin_version_constant' ) );
}
/**
* Set plugin version constant -> OCDI_VERSION.
*/
public function set_plugin_version_constant() {
$plugin_data = get_plugin_data( __FILE__ );
if ( ! defined( 'OCDI_VERSION' ) ) {
define( 'OCDI_VERSION', $plugin_data['Version'] );
}
// Used for backward compatibility.
if ( ! defined( 'PT_OCDI_VERSION' ) ) {
define( 'PT_OCDI_VERSION', $plugin_data['Version'] );
}
}
}
// Instantiate the plugin class.
$ocdi_plugin = new OCDI_Plugin();
1.0Read Our Latest Blogs - Gain Infotechhttps://www.gaininfotech.com/blogadminhttps://www.gaininfotech.com/blog/author/admin/Read Our Latest Blogs - Gain Infotechrich600338<blockquote class="wp-embedded-content" data-secret="dQUEykeXNB"><a href="https://www.gaininfotech.com/blog/">Home</a></blockquote><iframe sandbox="allow-scripts" security="restricted" src="https://www.gaininfotech.com/blog/embed/#?secret=dQUEykeXNB" width="600" height="338" title="“Home” — Read Our Latest Blogs - Gain Infotech" data-secret="dQUEykeXNB" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" class="wp-embedded-content"></iframe><script>
/*! This file is auto-generated */
!function(d,l){"use strict";l.querySelector&&d.addEventListener&&"undefined"!=typeof URL&&(d.wp=d.wp||{},d.wp.receiveEmbedMessage||(d.wp.receiveEmbedMessage=function(e){var t=e.data;if((t||t.secret||t.message||t.value)&&!/[^a-zA-Z0-9]/.test(t.secret)){for(var s,r,n,a=l.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),o=l.querySelectorAll('blockquote[data-secret="'+t.secret+'"]'),c=new RegExp("^https?:$","i"),i=0;i<o.length;i++)o[i].style.display="none";for(i=0;i<a.length;i++)s=a[i],e.source===s.contentWindow&&(s.removeAttribute("style"),"height"===t.message?(1e3<(r=parseInt(t.value,10))?r=1e3:~~r<200&&(r=200),s.height=r):"link"===t.message&&(r=new URL(s.getAttribute("src")),n=new URL(t.value),c.test(n.protocol))&&n.host===r.host&&l.activeElement===s&&(d.top.location.href=t.value))}},d.addEventListener("message",d.wp.receiveEmbedMessage,!1),l.addEventListener("DOMContentLoaded",function(){for(var e,t,s=l.querySelectorAll("iframe.wp-embedded-content"),r=0;r<s.length;r++)(t=(e=s[r]).getAttribute("data-secret"))||(t=Math.random().toString(36).substring(2,12),e.src+="#?secret="+t,e.setAttribute("data-secret",t)),e.contentWindow.postMessage({message:"ready",secret:t},"*")},!1)))}(window,document);
//# sourceURL=https://www.gaininfotech.com/blog/wp-includes/js/wp-embed.min.js
</script>
Here you can read our latest blogs. We are sharing information about the business. To read our blog visit here today!