@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | * License: GNU General Public License v3.0 |
18 | 18 | * License URI: http://www.gnu.org/licenses/gpl-3.0.html |
19 | 19 | */ |
20 | -if ( ! defined('ABSPATH') ) exit; // Exit if accessed directly. |
|
20 | +if ( ! defined('ABSPATH')) exit; // Exit if accessed directly. |
|
21 | 21 | |
22 | -if ( ! class_exists( 'WCSS' ) ) { |
|
22 | +if ( ! class_exists('WCSS')) { |
|
23 | 23 | |
24 | 24 | class WCSS { |
25 | 25 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * @since 1.0.0 |
51 | 51 | */ |
52 | 52 | public static function instance() { |
53 | - if ( is_null( self::$_instance ) ) { |
|
53 | + if (is_null(self::$_instance)) { |
|
54 | 54 | self::$_instance = new self(); |
55 | 55 | } |
56 | 56 | return self::$_instance; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * @since 1.0.0 |
63 | 63 | */ |
64 | 64 | public function __clone() { |
65 | - _doing_it_wrong( __FUNCTION__, __( 'Foul!' ), '1.0.0' ); |
|
65 | + _doing_it_wrong(__FUNCTION__, __('Foul!'), '1.0.0'); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -71,42 +71,42 @@ discard block |
||
71 | 71 | * @since 1.0.0 |
72 | 72 | */ |
73 | 73 | public function __wakeup() { |
74 | - _doing_it_wrong( __FUNCTION__, __( 'Foul!' ), '1.0.0' ); |
|
74 | + _doing_it_wrong(__FUNCTION__, __('Foul!'), '1.0.0'); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
78 | 78 | * Do some work. |
79 | 79 | */ |
80 | 80 | public function __construct() { |
81 | - add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ) ); |
|
82 | - add_action( 'init', array( $this, 'init_textdomain' ) ); |
|
83 | - add_filter( 'plugin_row_meta', array( $this, 'plugin_meta_links' ), 10, 4 ); |
|
81 | + add_action('plugins_loaded', array($this, 'plugins_loaded')); |
|
82 | + add_action('init', array($this, 'init_textdomain')); |
|
83 | + add_filter('plugin_row_meta', array($this, 'plugin_meta_links'), 10, 4); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | public function plugin_url() { |
87 | - return plugins_url( basename( plugin_dir_path(__FILE__) ), basename( __FILE__ ) ); |
|
87 | + return plugins_url(basename(plugin_dir_path(__FILE__)), basename(__FILE__)); |
|
88 | 88 | } // END plugin_url() |
89 | 89 | |
90 | 90 | public function plugin_path() { |
91 | - return untrailingslashit( plugin_dir_path( __FILE__ ) ); |
|
91 | + return untrailingslashit(plugin_dir_path(__FILE__)); |
|
92 | 92 | } // END plugin_path() |
93 | 93 | |
94 | 94 | public function plugins_loaded() { |
95 | 95 | global $woocommerce; |
96 | 96 | |
97 | 97 | // Subs 2 check |
98 | - if ( ! function_exists( 'wcs_is_subscription' ) ) { |
|
99 | - add_action( 'admin_notices', array( $this, 'wcs_admin_notice' ) ); |
|
98 | + if ( ! function_exists('wcs_is_subscription')) { |
|
99 | + add_action('admin_notices', array($this, 'wcs_admin_notice')); |
|
100 | 100 | return false; |
101 | 101 | } |
102 | 102 | |
103 | 103 | // WC 2 check |
104 | - if ( version_compare( $woocommerce->version, self::REQ_WC_VERSION ) < 0 ) { |
|
105 | - add_action( 'admin_notices', array( $this, 'wc_admin_notice' ) ); |
|
104 | + if (version_compare($woocommerce->version, self::REQ_WC_VERSION) < 0) { |
|
105 | + add_action('admin_notices', array($this, 'wc_admin_notice')); |
|
106 | 106 | return false; |
107 | 107 | } |
108 | 108 | |
109 | - require_once( 'includes/class-wcs-shortcodes.php' ); |
|
109 | + require_once('includes/class-wcs-shortcodes.php'); |
|
110 | 110 | } // END plugins_loaded() |
111 | 111 | |
112 | 112 | /** |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * @return void |
116 | 116 | */ |
117 | 117 | public function wc_admin_notice() { |
118 | - echo '<div class="error"><p>' . sprintf( __( 'WooCommerce Subscription Shortcodes requires at least WooCommerce %s in order to function. Please upgrade WooCommerce.', self::TEXT_DOMAIN ), self::REQ_WC_VERSION ) . '</p></div>'; |
|
118 | + echo '<div class="error"><p>' . sprintf(__('WooCommerce Subscription Shortcodes requires at least WooCommerce %s in order to function. Please upgrade WooCommerce.', self::TEXT_DOMAIN), self::REQ_WC_VERSION) . '</p></div>'; |
|
119 | 119 | } // END wc_admin_notice() |
120 | 120 | |
121 | 121 | /** |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | * @return void |
125 | 125 | */ |
126 | 126 | public function wcs_admin_notice() { |
127 | - echo '<div class="error"><p>' . sprintf( __( 'WooCommerce Subscription Shortcodes requires WooCommerce Subscriptions version 2.0+.', self::TEXT_DOMAIN ), self::REQ_WC_VERSION ) . '</p></div>'; |
|
127 | + echo '<div class="error"><p>' . sprintf(__('WooCommerce Subscription Shortcodes requires WooCommerce Subscriptions version 2.0+.', self::TEXT_DOMAIN), self::REQ_WC_VERSION) . '</p></div>'; |
|
128 | 128 | } // END wcs_admin_notice() |
129 | 129 | |
130 | 130 | /** |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | * @return void |
134 | 134 | */ |
135 | 135 | public function init_textdomain() { |
136 | - load_plugin_textdomain( 'woocommerce-subscription-shortcodes', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); |
|
136 | + load_plugin_textdomain('woocommerce-subscription-shortcodes', false, dirname(plugin_basename(__FILE__)) . '/languages/'); |
|
137 | 137 | } // END init_text_domain() |
138 | 138 | |
139 | 139 | /** |
@@ -143,11 +143,11 @@ discard block |
||
143 | 143 | * @param mixed $file Plugin Base file |
144 | 144 | * @return array |
145 | 145 | */ |
146 | - public function plugin_meta_links( $links, $file, $data, $status ) { |
|
147 | - if ( $file == plugin_basename( __FILE__ ) ) { |
|
146 | + public function plugin_meta_links($links, $file, $data, $status) { |
|
147 | + if ($file == plugin_basename(__FILE__)) { |
|
148 | 148 | $author1 = '<a href="' . $data[ 'AuthorURI' ] . '">' . $data[ 'Author' ] . '</a>'; |
149 | 149 | $author2 = '<a href="http://www.subscriptiongroup.co.uk/">Subscription Group Limited</a>'; |
150 | - $links[ 1 ] = sprintf( __( 'By %s', self::TEXT_DOMAIN ), sprintf( __( '%s and %s', self::TEXT_DOMAIN ), $author1, $author2 ) ); |
|
150 | + $links[ 1 ] = sprintf(__('By %s', self::TEXT_DOMAIN), sprintf(__('%s and %s', self::TEXT_DOMAIN), $author1, $author2)); |
|
151 | 151 | |
152 | 152 | } |
153 | 153 |
@@ -17,7 +17,10 @@ |
||
17 | 17 | * License: GNU General Public License v3.0 |
18 | 18 | * License URI: http://www.gnu.org/licenses/gpl-3.0.html |
19 | 19 | */ |
20 | -if ( ! defined('ABSPATH') ) exit; // Exit if accessed directly. |
|
20 | +if ( ! defined('ABSPATH') ) { |
|
21 | + exit; |
|
22 | +} |
|
23 | +// Exit if accessed directly. |
|
21 | 24 | |
22 | 25 | if ( ! class_exists( 'WCSS' ) ) { |
23 | 26 |