/** * Enqueue Admin Styles * * @since 1.0.0 */ public function enqueue_admin_styles() { global $base_class; $css_dir = SC_DIR_URL . 'assets/css/'; if (Stripe_Checkout_Admin::get_instance()->viewing_this_plugin()) { wp_register_style($base_class->plugin_slug . '-admin-lite', $css_dir . 'shared-admin-main' . $this->min . '.css', array(), $base_class->version); wp_enqueue_style($base_class->plugin_slug . '-admin-lite'); } }
/** * Enqueue admin-specific style sheets for this plugin's admin pages only. * * @since 1.0.0 */ public function enqueue_admin_styles() { global $base_class; if (Stripe_Checkout_Admin::get_instance()->viewing_this_plugin()) { wp_enqueue_style($base_class->plugin_slug . '-toggle-switch', SC_DIR_URL . 'assets/css/vendor/toggle-switch' . $this->min . '.css', array(), $base_class->version); wp_enqueue_style($base_class->plugin_slug . '-admin-styles', SC_DIR_URL . 'assets/css/admin-main' . $this->min . '.css', array($base_class->plugin_slug . '-toggle-switch'), $base_class->version); } wp_enqueue_script($base_class->plugin_slug . '-admin', SC_DIR_URL . 'assets/js/admin-main' . $this->min . '.js', array('jquery'), $base_class->version, true); }
/** * Show notice after plugin install/activate in admin dashboard. * Hide after first viewing. * * @since 1.0.0 */ public function admin_install_notice() { // Exit all of this is stored value is false/0 or not set. if (false == get_option('sc_show_admin_install_notice')) { return; } // Delete stored value if "hide" button click detected (custom querystring value set to 1). if (!empty($_REQUEST['sc-dismiss-install-nag']) || Stripe_Checkout_Admin::get_instance()->viewing_this_plugin()) { delete_option('sc_show_admin_install_notice'); return; } // At this point show install notice. Show it only on the plugin screen. if ('plugins' == get_current_screen()->id) { include_once SC_DIR_PATH . 'views/admin-shared-notice-install.php'; } }
public function init() { Stripe_Checkout_Pro_Licenses::get_instance(); Stripe_Checkout_Scripts::get_instance(); Stripe_Checkout_Shortcodes::get_instance(); if (is_admin()) { Stripe_Checkout_Admin::get_instance(); Stripe_Checkout_Pro_Admin::get_instance(); //Stripe_Checkout_Upgrade_Link::get_instance(); Stripe_Checkout_Notices::get_instance(); Stripe_Checkout_System_Status::get_instance(); } else { Stripe_Checkout_Misc::get_instance(); } // Need to leave outside of is_admin check or the AJAX will not work properly Stripe_Checkout_Pro_Functions::get_instance(); }
/** * Get the instance for all the included classes */ public function init() { Stripe_Checkout_Scripts::get_instance(); Stripe_Checkout_Shortcodes::get_instance(); if (is_admin()) { Stripe_Checkout_Admin::get_instance(); Stripe_Checkout_Upgrade_Link::get_instance(); Stripe_Checkout_Notices::get_instance(); Stripe_Checkout_System_Status::get_instance(); } else { Stripe_Checkout_Misc::get_instance(); Stripe_Checkout_Functions::get_instance(); } }
<?php /** * Represents the view for the Default Settings tab. */ global $sc_options; ?> <!-- Default Settings tab HTML --> <div class="sc-admin-hidden" id="default-settings-tab"> <div> <a href="<?php echo Stripe_Checkout_Admin::ga_campaign_url(SC_WEBSITE_BASE_URL . 'docs/shortcodes/stripe-checkout/', 'stripe-checkout', 'settings', 'docs'); ?> " target="_blank"> <?php _e('See shortcode options and examples', 'sc'); ?> </a> <?php $sc_options->description(__('Shortcode attributes take precedence and will always override site-wide default settings.', 'sc')); ?> </div> <div> <label for="<?php echo esc_attr($sc_options->get_setting_id('name')); ?> "><?php _e('Site Name', 'sc'); ?>
/** * Return an instance of this class. * * @since 1.0.0 * * @return object A single instance of this class. */ public static function get_instance() { // If the single instance hasn't been set, set it now. if (null == self::$instance) { self::$instance = new self(); } return self::$instance; }
?> </a> </li> <li> <div class="dashicons dashicons-arrow-right-alt2"></div> <a href="https://dashboard.stripe.com/" target="_blank"> <?php _e('Stripe Dashboard', 'sc'); ?> </a> </li> <li> <div class="dashicons dashicons-arrow-right-alt2"></div> <a href="<?php echo Stripe_Checkout_Admin::ga_campaign_url(SC_WEBSITE_BASE_URL . 'feature-requests/', 'stripe-checkout-pro', 'sidebar-link', 'feature-requests'); ?> " target="_blank"> <?php _e('Feature Requests', 'sc'); ?> </a> </li> </ul> </div> </div> </div> <div class="sidebar-container metabox-holder"> <div class="postbox-nobg"> <div class="inside centered">
/** * Represents the view for the Default Settings tab - Shared between SP Lite & Pro */ // Exit if accessed directly. if (!defined('ABSPATH')) { exit; } global $sc_options; ?> <!-- Default Settings tab HTML --> <div class="tab-content sc-admin-hidden" id="default-settings-tab"> <div> <a href="<?php echo Stripe_Checkout_Admin::ga_campaign_url(SC_WEBSITE_BASE_URL . 'docs/shortcodes/stripe-checkout/', 'help-link'); ?> " target="_blank"> <?php _e('See shortcode options and examples', 'stripe'); ?> </a> <?php $sc_options->description(__('Shortcode attributes take precedence and will always override site-wide default settings.', 'stripe')); ?> </div> <div> <label for="<?php echo esc_attr($sc_options->get_setting_id('name')); ?>
public function redirect() { wp_redirect(Stripe_Checkout_Admin::ga_campaign_url(SC_WEBSITE_BASE_URL, 'stripe-checkout', 'plugin-menu', 'pro-upgrade', true), 301); exit; }
public function enqueue_admin_scripts() { global $base_class; if (Stripe_Checkout_Admin::get_instance()->viewing_this_plugin()) { wp_enqueue_script($base_class->plugin_slug . '-admin', SC_DIR_URL . 'assets/js/admin-main' . $this->min . '.js', array('jquery'), $base_class->version, true); wp_enqueue_script($base_class->plugin_slug . '-admin-pro', SC_DIR_URL . 'assets/js/admin-pro' . $this->min . '.js', array('jquery'), $base_class->version, true); wp_localize_script($base_class->plugin_slug . '-admin-pro', 'sc_strings', array('activate' => __('Activate', 'sc'), 'deactivate' => __('Deactivate', 'sc'), 'valid_msg' => __('License is valid and active.', 'sc'), 'inactive_msg' => __('License is inactive.', 'sc'), 'invalid_msg' => __('Sorry, but this license key is invalid.', 'sc'), 'notfound_msg' => __('License service could not be found. Please contact support for assistance.', 'sc'), 'error_msg' => __('An error has occurred, please try again.', 'sc'))); } }
_e('Subscriptions integration', 'stripe'); ?> </li> <li><div class="dashicons dashicons-yes"></div> <?php _e('Stripe add-ons as they\'re released', 'stripe'); ?> </li> <li><div class="dashicons dashicons-yes"></div> <?php _e('Automatic updates & email support', 'stripe'); ?> </li> </ul> <div class="centered"> <a href="<?php echo Stripe_Checkout_Admin::ga_campaign_url(SC_WEBSITE_BASE_URL, 'sidebar-link'); ?> " class="button-primary button-large" target="_blank"> <?php _e('Upgrade to Pro Now', 'stripe'); ?> </a> </div> </div> </div> </div> </div> <div class="sidebar-container metabox-holder"> <div class="postbox-nobg">
/** * Display admin notice for invalid or missing license key. */ public function invalid_license_key_notice() { global $sc_options; $main_license_key = $sc_options->get_setting_value('main_license_key'); $main_license_status = get_option('simplepay_main_license_status'); $simplepay_admin = Stripe_Checkout_Admin::get_instance(); if ($simplepay_admin->viewing_this_plugin() && (empty($main_license_key) || 'valid' !== $main_license_status)) { ?> <div class="error notice"> <p> <?php _e('Your WP Simple Pay Pro license key is invalid, inactive or missing. Valid license keys are required for access to automatic upgrades and premium support.', 'stripe'); ?> <br /> <?php // Show "below" message unless on licenses tab. if (!(isset($_GET['tab']) && 'licenses' == $_GET['tab'])) { // Render link to Support tab on other plugin tabs. echo '<a class="simple-pay-licenses-tab-link" href="' . esc_url(add_query_arg(array('page' => Stripe_Checkout_Pro::get_plugin_slug()), admin_url('admin.php'))) . '#license-keys">' . __('Go to the licenses page.', 'stripe') . '</a>' . "\n"; } ?> </p> </div> <?php } }
_e('Review this Plugin Now', 'sc'); ?> </a> </div> </div> </div> </div> <div class="sidebar-container metabox-holder"> <div class="postbox"> <div class="inside"> <ul> <li> <div class="dashicons dashicons-arrow-right-alt2"></div> <a href="<?php echo Stripe_Checkout_Admin::ga_campaign_url(SC_WEBSITE_BASE_URL . 'docs/', 'stripe-checkout', 'sidebar-link', 'docs'); ?> " target="_blank"> <?php _e('Documentation', 'sc'); ?> </a> </li> <li> <div class="dashicons dashicons-arrow-right-alt2"></div> <a href="https://wordpress.org/support/plugin/stripe" target="_blank"> <?php _e('Community support forums', 'sc'); ?> </a>