PluginProbe
Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More / 0.0.7
Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More v0.0.7
2.4.1 2.4.0 2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.2 2.2.1 2.2.0 2.1.2 2.1.1 trunk 0.0.1 0.0.2 0.0.3 0.0.4 0.0.5 0.0.6 0.0.7 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 All 68 releases
better-payment / includes / Admin.php

Admin.php in Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More 0.0.7, at includes/Admin.php

101 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Better_Payment\Lite;
4
5 use Better_Payment\Lite\Admin\Better_Payment_Settings;
6 use Better_Payment\Lite\Admin\Elementor\Better_Payment_Widget;
7 use Better_Payment\Lite\Admin\Elementor\Widget;
8 use Better_Payment\Lite\Admin\Menu;
9 use Better_Payment\Lite\Classes\Better_Payment_Helper;
10 use Better_Payment\Lite\Classes\Export;
11
12 /**
13 * Exit if accessed directly
14 */
15 if (!defined('ABSPATH')) {
16 exit;
17 }
18
19 /**
20 * The admin class
21 *
22 * @since 0.0.1
23 */
24 class Admin extends Controller{
25
26 /**
27 * Initialize the class
28 *
29 * @since 0.0.1
30 */
31 public function __construct() {
32
33 }
34
35 public function init(){
36 if ( defined( 'ELEMENTOR_VERSION' ) ) {
37 new Better_Payment_Settings();
38 }
39
40 if (!did_action('elementor/loaded')) {
41 $notice = new Better_Payment_Helper();
42 $notice->elementor_not_loaded();
43 }
44
45 if (did_action('elementor/loaded')) {
46 add_filter('plugin_action_links', array($this, 'plugin_actions_links'), 10, 2);
47 }
48 }
49
50 /**
51 * Add settings page link on plugins page
52 *
53 * @param array $links
54 * @param string $file
55 *
56 * @return array
57 * @since 0.0.1
58 */
59 public function plugin_actions_links($links, $file) {
60 $better_payment_plugin = plugin_basename(BETTER_PAYMENT_FILE);
61
62 if ($file == $better_payment_plugin && current_user_can('manage_options')) {
63 $links[] = sprintf('<a href="%s">%s</a>', admin_url("admin.php?page=better-payment-settings"), __('Settings', 'better-payment'));
64
65 if ( ! class_exists('\Better_Payment_Pro') ) {
66 $links[] = sprintf('<a href="https://wpdeveloper.com/in/upgrade-better-payment-pro" target="_blank" style="color: #524cff; font-weight: bold;">' . __('Go Pro', 'better-payment') . '</a>');
67 }
68 }
69
70 return $links;
71 }
72
73 /**
74 * Dispatch and bind actions
75 *
76 * @return void
77 * @since 0.0.1
78 */
79 public static function dispatch_actions( ) {
80 $menuObj = new Menu();
81 $menuObj->init();
82
83 $bpElementorWidgetObj = new Widget();
84
85 $bpExportObj = new Export();
86
87 // Handle select2 ajax search
88 add_action('wp_ajax_better_payment_select2_search_post', [$bpElementorWidgetObj, 'select2_ajax_posts_filter_autocomplete']);
89 add_action('wp_ajax_nopriv_better_payment_select2_search_post', [$bpElementorWidgetObj, 'select2_ajax_posts_filter_autocomplete']);
90
91 add_action('wp_ajax_better_payment_select2_get_title', [$bpElementorWidgetObj, 'select2_ajax_get_posts_value_titles']);
92 add_action('wp_ajax_nopriv_better_payment_select2_get_title', [$bpElementorWidgetObj, 'select2_ajax_get_posts_value_titles']);
93
94 // Elements
95 add_action('elementor/controls/controls_registered',[$bpElementorWidgetObj, 'register_controls']);
96
97 //Page: Transactions
98 add_action('wp_ajax_better-payment-transactions-export',[$bpExportObj, 'export_transactions']);
99 }
100 }
101