PluginProbe
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments / 1.1.4
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments v1.1.4
4.7.2 4.7.1 4.7.0 4.6.6 4.6.5 4.6.4 4.6.3 4.6.2 4.6.1 4.6.0 4.5.1 4.5.0 4.4.2 4.4.1 4.4.0 4.3.3 4.3.2 4.3.1 4.3.0 4.2.3 4.2.2 4.2.1 1.0.3 1.0.4 1.0.5 All 281 releases
surecart / app / src / WordPress / PluginService.php
PluginService.php
92 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package SureCartAppCore
4 * @author SureCart <support@surecart.com>
5 * @copyright SureCart
6 * @license https://www.gnu.org/licenses/gpl-2.0.html GPL-2.0
7 * @link https://surecart.com
8 */
9
10 namespace SureCart\WordPress;
11
12 use SureCartCore\Application\Application;
13
14 /**
15 * Main communication channel with the theme.
16 */
17 class PluginService {
18 /**
19 * Application instance.
20 *
21 * @var Application
22 */
23 protected $app = null;
24
25 /**
26 * Constructor.
27 *
28 * @param Application $app
29 */
30 public function __construct( $app ) {
31 $this->app = $app;
32 }
33
34 /**
35 * Get the plugin version
36 *
37 * @return string
38 */
39 public function version() {
40 // Load version from plugin data.
41 if ( ! \function_exists( 'get_plugin_data' ) ) {
42 require_once \ABSPATH . 'wp-admin/includes/plugin.php';
43 }
44
45 return \get_plugin_data( SURECART_PLUGIN_FILE, false, false )['Version'];
46 }
47
48 /**
49 * Shortcute to \SureCart\Account\AccountService
50 *
51 * @return \SureCart\Account\AccountService
52 */
53 public function account() {
54 return $this->app->reolve( 'surecart.account' );
55 }
56
57 /**
58 * Shortcut to \SureCart\Install\InstallService.
59 *
60 * @return \SureCart\Install\InstallService
61 */
62 public function install() {
63 return $this->app->resolve( 'surecart.install' );
64 }
65
66 /**
67 * Shortcut to \SureCart\WordPress\Pages\PageService.
68 *
69 * @return \SureCart\WordPress\Pages\PageService
70 */
71 public function pages() {
72 return $this->app->resolve( 'surecart.pages' );
73 }
74 /**
75 * Shortcut to \SureCart\WordPress\Pages\PageService.
76 *
77 * @return \SureCart\WordPress\Pages\PageService
78 */
79 public function activation() {
80 return $this->app->resolve( 'surecart.activation' );
81 }
82
83 /**
84 * Shortcut to \SureCart\WordPress\Pages\PageService.
85 *
86 * @return \SureCart\Permissions\RolesService;
87 */
88 public function roles() {
89 return $this->app->resolve( 'surecart.permissions.roles' );
90 }
91 }
92