. */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } define( 'AWOOC_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); define( 'AWOOC_PLUGIN_URI', plugin_dir_url( __FILE__ ) ); $awooc_data = get_file_data( __FILE__, array( 'ver' => 'Version', 'name' => 'Plugin Name', 'text_domain' => 'Text Domain', ) ); define( 'AWOOC_PLUGIN_VER', $awooc_data['ver'] ); define( 'AWOOC_PLUGIN_NAME', $awooc_data['name'] ); define( 'AWOOC_TEXTDOMAIN', $awooc_data['text_domain'] ); register_uninstall_hook( __FILE__, array( 'ArtWoo_Order_One_Click', 'uninstall' ) ); /** * Class ArtWoo_Order_One_Click * * Main AWOOC class, initialized the plugin * * @class ArtWoo_Order_One_Click * @version 1.8.0 * @author Artem Abramovich */ class ArtWoo_Order_One_Click { /** * Instance of ArtWoo_Order_One_Click. * * @since 1.8.0 * @access private * @var object $instance The instance of AWOOS_Custom_Sale. */ private static $instance; /** * Plugin version. * * @since 1.8.0 * @var string $version Plugin version number. */ public $version; /** * Plugin name. * * @since 1.8.0 * @var string $name Plugin name. */ public $name; /** * Plugin name. * * @since 1.8.0 * @var string $name Plugin name. */ public $text_domain; /** * Construct. * * @since 1.8.0 */ public function __construct() { $this->init(); } /** * Init. * * Initialize plugin parts. * * * @since 1.8.0 */ public function init() { if ( version_compare( PHP_VERSION, '5.6', 'lt' ) ) { return add_action( 'admin_notices', array( $this, 'php_version_notice' ) ); } if ( ! in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ), true ) ) { if ( ! function_exists( 'get_plugin_data' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) { return add_action( 'admin_notices', array( $this, 'wc_active_notice' ) ); } } if ( ! in_array( 'contact-form-7/wp-contact-form-7.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ), true ) ) { if ( ! function_exists( 'get_plugin_data' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } if ( ! is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) { return add_action( 'admin_notices', array( $this, 'cf7_active_notice' ) ); } } /** * Hiding field to CF7 */ require_once AWOOC_PLUGIN_DIR . 'includes/admin/added-cf7-field.php'; /** * Front end */ require_once AWOOC_PLUGIN_DIR . 'includes/class-awooc-frontend.php'; $this->front_end = new AWOOC_Front_End(); /** * Ajax */ require_once AWOOC_PLUGIN_DIR . 'includes/class-awooc-ajax.php'; $this->ajax = new AWOOC_Ajax(); /** * Создание заказов */ require_once AWOOC_PLUGIN_DIR . 'includes/class-awooc-orders.php'; $this->orders = new AWOOC_Orders(); /** * Template functions */ require_once AWOOC_PLUGIN_DIR . 'includes/awooc-template-functions.php'; // Load hooks $this->hooks(); global $pagenow; if ( 'plugins.php' === $pagenow ) { // Plugins page add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'add_plugin_action_links' ), 10, 2 ); } } /** * Hooks. * * Initialize all class hooks. * * @since 1.8.0 */ public function hooks() { add_filter( 'woocommerce_get_settings_pages', array( $this, 'add_awooc_admin_settings' ), 15 ); } /** * Instance. * * An global instance of the class. Used to retrieve the instance * to use on other files/plugins/themes. * * @since 1.8.0 * @return object Instance of the class. */ public static function instance() { if ( is_null( self::$instance ) ) : self::$instance = new self(); endif; return self::$instance; } /** * Settings. * * Include the WooCommerce settings class. * * @since 1.8.0 * @since 1.8.5 */ public function add_awooc_admin_settings( $settings ) { $settings[] = require_once AWOOC_PLUGIN_DIR . 'includes/admin/class-awooc-admin-settings.php'; return $settings; } /** * Plugin action links. * * Add links to the plugins.php page below the plugin name * and besides the 'activate', 'edit', 'delete' action links. * * @since 1.8.0 * * @param array $links List of existing links. * @param string $file Name of the current plugin being looped. * * @return array List of modified links. */ public function add_plugin_action_links( $links, $file ) { if ( plugin_basename( __FILE__ ) === $file ) { $links = array_merge( array( 'Настройки', ), $links ); } return $links; } /** * Display PHP 5.6 required notice. * * Display a notice when the required PHP version is not met. * * @since 1.8.0 */ public function php_version_notice() { ?>
%s.', esc_attr( AWOOC_PLUGIN_NAME ), 'Contact Form 7' ); ?>
%s %s или выше.', esc_attr( AWOOC_PLUGIN_NAME ), 'WooCommerce', '3.0' ); ?>