PluginProbe
Leaky Paywall / 5.1.2
Leaky Paywall v5.1.2
5.1.9 5.1.8 5.1.7 5.1.6 5.1.5 5.1.4 5.1.3 5.1.2 5.1.1 5.1.0 5.0.9 4.16.17 4.16.2 4.16.3 4.16.4 4.16.5 4.16.6 4.16.7 4.16.8 4.16.9 4.17.0 4.17.1 4.17.2 4.18.0 4.18.1 All 180 releases
leaky-paywall / leaky-paywall.php

leaky-paywall.php in Leaky Paywall 5.1.2, at leaky-paywall.php

178 lines 7.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Main PHP file used to for initial calls to Leaky Paywall classes and functions.
4 *
5 * @package Leaky Paywall
6 * @since 1.0.0
7 */
8
9 /*
10 Plugin Name: Leaky Paywall
11 Plugin URI: https://leakypaywall.com/
12 Description: The first and most flexible metered paywall for WordPress. Sell subscriptions without sacrificing search and social visibility.
13 Author: Leaky Paywall
14 Version: 5.1.2
15 Author URI: https://leakypaywall.com/
16 Tags: paywall, subscriptions, metered, membership, pay wall, content monetization, metered access, metered pay wall, paid content
17 Text Domain: leaky-paywall
18 Domain Path: /i18n
19 Requires at least: 5.6
20 Requires PHP: 7.4
21 */
22
23 // Define global variables...
24 if ( ! defined( 'ZEEN101_STORE_URL' ) ) {
25 define( 'ZEEN101_STORE_URL', 'https://zeen101.com' );
26 }
27
28 define( 'LEAKY_PAYWALL_NAME', 'Leaky Paywall for WordPress' );
29 define( 'LEAKY_PAYWALL_SLUG', 'leaky-paywall' );
30 define( 'LEAKY_PAYWALL_VERSION', '5.1.2' );
31 define( 'LEAKY_PAYWALL_DB_VERSION', '1.0.5' );
32 define( 'LEAKY_PAYWALL_URL', plugin_dir_url( __FILE__ ) );
33 define( 'LEAKY_PAYWALL_PATH', plugin_dir_path( __FILE__ ) );
34 define( 'LEAKY_PAYWALL_BASENAME', plugin_basename( __FILE__ ) );
35 define( 'LEAKY_PAYWALL_REL_DIR', dirname( LEAKY_PAYWALL_BASENAME ) );
36
37 define( 'LEAKY_PAYWALL_STRIPE_API_VERSION', '2020-03-02' );
38 define( 'LEAKY_PAYWALL_STRIPE_PARTNER_ID', 'pp_partner_IDILs8UMcYIw41' );
39
40 if ( ! defined( 'PAYPAL_LIVE_URL' ) ) {
41 define( 'PAYPAL_LIVE_URL', 'https://www.paypal.com/' );
42 }
43 if ( ! defined( 'PAYPAL_SANDBOX_URL' ) ) {
44 define( 'PAYPAL_SANDBOX_URL', 'https://www.sandbox.paypal.com/' );
45 }
46 if ( ! defined( 'PAYPAL_PAYMENT_SANDBOX_URL' ) ) {
47 define( 'PAYPAL_PAYMENT_SANDBOX_URL', 'https://www.sandbox.paypal.com/cgi-bin/webscr' );
48 }
49 if ( ! defined( 'PAYPAL_PAYMENT_LIVE_URL' ) ) {
50 define( 'PAYPAL_PAYMENT_LIVE_URL', 'https://www.paypal.com/cgi-bin/webscr' );
51 }
52 if ( ! defined( 'PAYPAL_NVP_API_SANDBOX_URL' ) ) {
53 define( 'PAYPAL_NVP_API_SANDBOX_URL', 'https://api-3t.sandbox.paypal.com/nvp' );
54 }
55 if ( ! defined( 'PAYPAL_NVP_API_LIVE_URL' ) ) {
56 define( 'PAYPAL_NVP_API_LIVE_URL', 'https://api-3t.paypal.com/nvp' );
57 }
58
59 // Load Action Scheduler for background processing.
60 require_once LEAKY_PAYWALL_PATH . 'vendor/woocommerce/action-scheduler/action-scheduler.php';
61
62 /**
63 * Instantiate Pigeon Pack class, require helper files
64 *
65 * @since 1.0.0
66 */
67 function leaky_paywall_plugins_loaded() {
68 include_once ABSPATH . 'wp-admin/includes/plugin.php';
69 if ( is_plugin_active( 'issuem/issuem.php' ) ) {
70 define( 'ACTIVE_ISSUEM', true );
71 } else {
72 define( 'ACTIVE_ISSUEM', false );
73 }
74
75 require_once 'class.php';
76
77 // Load license key class early so extension plugins can always use it.
78 include LEAKY_PAYWALL_PATH . 'include/license-key.php';
79
80 // Instantiate the Pigeon Pack class.
81 if ( class_exists( 'Leaky_Paywall' ) ) {
82
83 global $leaky_paywall;
84 $leaky_paywall = new Leaky_Paywall();
85
86 require_once LEAKY_PAYWALL_PATH . 'functions.php';
87 require_once LEAKY_PAYWALL_PATH . 'shortcodes.php';
88 require_once LEAKY_PAYWALL_PATH . 'subscriber-table.php';
89 require_once LEAKY_PAYWALL_PATH . 'metaboxes.php';
90 require_once LEAKY_PAYWALL_PATH . 'include/template-functions.php';
91 require_once LEAKY_PAYWALL_PATH . 'include/admin/dashboard-widgets.php';
92 require_once LEAKY_PAYWALL_PATH . 'include/admin/lp-transaction.php';
93 require_once LEAKY_PAYWALL_PATH . 'include/admin/lp-incomplete-user.php';
94 require_once LEAKY_PAYWALL_PATH . 'include/admin/tools.php';
95 require_once LEAKY_PAYWALL_PATH . 'include/admin/tools/tools.php';
96 require_once LEAKY_PAYWALL_PATH . 'include/admin/tools/export.php';
97 require_once LEAKY_PAYWALL_PATH . 'include/admin/tools/import.php';
98 require_once LEAKY_PAYWALL_PATH . 'include/admin/insights/functions.php';
99 require_once LEAKY_PAYWALL_PATH . 'include/admin/subscribers/class-lp-subscriber-list-table.php';
100 require_once LEAKY_PAYWALL_PATH . 'include/admin/subscribers/subscriber.php';
101 require_once LEAKY_PAYWALL_PATH . 'include/admin/subscribers/functions.php';
102
103 // Email classes.
104 require_once LEAKY_PAYWALL_PATH . 'include/emails/class-lp-email.php';
105 require_once LEAKY_PAYWALL_PATH . 'include/emails/class-lp-email-new-subscriber.php';
106 require_once LEAKY_PAYWALL_PATH . 'include/emails/class-lp-email-admin-new-subscriber.php';
107 require_once LEAKY_PAYWALL_PATH . 'include/emails/class-lp-email-renewal-reminder.php';
108 require_once LEAKY_PAYWALL_PATH . 'include/emails/class-lp-emails.php';
109
110 require_once LEAKY_PAYWALL_PATH . 'include/admin/settings/settings.php';
111 require_once LEAKY_PAYWALL_PATH . 'include/admin/insights/insights.php';
112 require_once LEAKY_PAYWALL_PATH . 'include/admin/dashboard/dashboard.php';
113 require_once LEAKY_PAYWALL_PATH . 'include/admin/onboarding/class-onboarding.php';
114 require_once LEAKY_PAYWALL_PATH . 'include/admin/onboarding/tracking.php';
115 require_once LEAKY_PAYWALL_PATH . 'include/list-builder/class-lp-list-builder.php';
116 require_once LEAKY_PAYWALL_PATH . 'include/class-lp-event-tracking.php';
117 require_once LEAKY_PAYWALL_PATH . 'include/class-lp-store-client.php';
118 require_once LEAKY_PAYWALL_PATH . 'include/pro-license.php';
119 require_once LEAKY_PAYWALL_PATH . 'include/pro-license-migration.php';
120 require_once LEAKY_PAYWALL_PATH . 'include/admin/license-page.php';
121 require_once LEAKY_PAYWALL_PATH . 'include/admin/extensions-page.php';
122 require_once LEAKY_PAYWALL_PATH . 'include/admin/pro-prompts.php';
123
124 include LEAKY_PAYWALL_PATH . 'include/error-tracking.php';
125 include LEAKY_PAYWALL_PATH . 'include/registration-functions.php';
126 include LEAKY_PAYWALL_PATH . 'include/rest-functions.php';
127 include LEAKY_PAYWALL_PATH . 'include/class-restrictions.php';
128 include LEAKY_PAYWALL_PATH . 'include/class-rest-restrictions.php';
129 include LEAKY_PAYWALL_PATH . 'include/class-rest-subscribers.php';
130 include LEAKY_PAYWALL_PATH . 'include/class-lp-transaction.php';
131 include LEAKY_PAYWALL_PATH . 'include/class-lp-logging.php';
132 include LEAKY_PAYWALL_PATH . 'include/class-lp-nag-impressions.php';
133 include LEAKY_PAYWALL_PATH . 'include/incomplete-user-cleanup.php';
134
135
136 // gateways.
137 include LEAKY_PAYWALL_PATH . 'include/gateways/gateway-functions.php';
138 include LEAKY_PAYWALL_PATH . 'include/gateways/stripe/functions.php';
139 include LEAKY_PAYWALL_PATH . 'include/gateways/paypal/functions.php';
140 include LEAKY_PAYWALL_PATH . 'include/gateways/class-leaky-paywall-payment-gateway.php';
141 include LEAKY_PAYWALL_PATH . 'include/gateways/class-leaky-paywall-payment-gateway-stripe.php';
142 include LEAKY_PAYWALL_PATH . 'include/gateways/class-leaky-paywall-payment-gateway-stripe-checkout.php';
143 include LEAKY_PAYWALL_PATH . 'include/gateways/class-leaky-paywall-payment-gateway-paypal.php';
144 include LEAKY_PAYWALL_PATH . 'include/gateways/class-leaky-paywall-payment-gateway-manual.php';
145 include LEAKY_PAYWALL_PATH . 'include/gateways/class-leaky-paywall-payment-gateways.php';
146
147 if ( ! class_exists( 'Stripe\Stripe' ) ) {
148 require_once LEAKY_PAYWALL_PATH . 'include/stripe/init.php';
149 }
150
151 do_action( 'leaky_paywall_plugins_loaded' );
152 }
153 }
154 add_action( 'plugins_loaded', 'leaky_paywall_plugins_loaded', 4815162342 ); // wait for the plugins to be loaded before init.
155
156 /**
157 * Runs on plugin activation.
158 *
159 * Sets onboarding redirect flag and schedules tracking cron.
160 *
161 * @since 4.23.0
162 */
163 function leaky_paywall_activate() {
164 update_option( 'leaky_paywall_onboarding_redirect', 1 );
165
166 update_option( 'leaky_paywall_onboarding_install_time', time() );
167
168 if ( get_option( 'leaky_paywall_tracking_allow' ) && ! wp_next_scheduled( 'leaky_paywall_tracking_send' ) ) {
169 wp_schedule_event( time(), 'weekly', 'leaky_paywall_tracking_send' );
170 }
171 }
172 register_activation_hook( __FILE__, 'leaky_paywall_activate' );
173
174 function leaky_paywall_deactivate() {
175 wp_clear_scheduled_hook( 'leaky_paywall_tracking_send' );
176 }
177 register_deactivation_hook( __FILE__, 'leaky_paywall_deactivate' );
178