/
home
/
techb158
/
public_html
/
wp-content
/
plugins
/
optinmonster
/
OMAPI
/
/home/techb158/public_html/wp-content/plugins/optinmonster/OMAPI
mkdir
upload
Name
Size
Mode
Actions
EasyDigitalDownloads/
-
0755
rm
Elementor/
-
0755
rm
Integrations/
-
0755
rm
MemberPress/
-
0755
rm
Plugins/
-
0755
rm
Promos/
-
0755
rm
Rules/
-
0755
rm
Shortcodes/
-
0755
rm
WooCommerce/
-
0755
rm
WPForms/
-
0755
rm
Actions.php
7970
0666
edit
dl
rm
Ajax.php
1494
0666
edit
dl
rm
Api.php
14507
0666
edit
dl
rm
ApiAuth.php
2463
0666
edit
dl
rm
ApiKey.php
5203
0666
edit
dl
rm
AssetLoader.php
5489
0666
edit
dl
rm
BaseRestApi.php
6889
0666
edit
dl
rm
Blocks.php
13105
0666
edit
dl
rm
ClassicEditor.php
7084
0666
edit
dl
rm
ConstantContact.php
7591
0666
edit
dl
rm
Debug.php
4592
0666
edit
dl
rm
EasyDigitalDownloads.php
9553
0666
edit
dl
rm
Elementor.php
5493
0666
edit
dl
rm
Inserter.php
11571
0666
edit
dl
rm
InstallSkin.php
1386
0666
edit
dl
rm
InstallSkinCompat.php
1395
0666
edit
dl
rm
MailPoet.php
13974
0666
edit
dl
rm
MemberPress.php
4216
0666
edit
dl
rm
Menu.php
17301
0666
edit
dl
rm
Notifications.php
18910
0666
edit
dl
rm
OmuApi.php
4122
0666
edit
dl
rm
Output.php
25848
0666
edit
dl
rm
Pages.php
18019
0666
edit
dl
rm
Partners.php
5557
0666
edit
dl
rm
Plugins.php
24923
0666
edit
dl
rm
Promos.php
1131
0666
edit
dl
rm
Refresh.php
6553
0666
edit
dl
rm
RestApi.php
44190
0666
edit
dl
rm
RevenueAttribution.php
3037
0666
edit
dl
rm
Review.php
1482
0666
edit
dl
rm
Rules.php
24000
0666
edit
dl
rm
Save.php
11999
0666
edit
dl
rm
Shortcode.php
3667
0666
edit
dl
rm
Sites.php
8553
0666
edit
dl
rm
Support.php
9192
0666
edit
dl
rm
Type.php
3722
0666
edit
dl
rm
Urls.php
8951
0666
edit
dl
rm
Utils.php
7589
0666
edit
dl
rm
Validate.php
9266
0666
edit
dl
rm
Welcome.php
4929
0666
edit
dl
rm
Widget.php
6662
0666
edit
dl
rm
WooCommerce.php
20045
0666
edit
dl
rm
WpErrorException.php
714
0666
edit
dl
rm
WPForms.php
2665
0666
edit
dl
rm
Edit:
/home/techb158/public_html/wp-content/plugins/optinmonster/OMAPI/MemberPress.php
(4216B)
<?php /** * MemberPress class. * * @since 2.13.0 * * @package OMAPI * @author Eduardo Nakatsuka */ // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } /** * The MemberPress class. * * @since 2.13.0 */ class OMAPI_MemberPress extends OMAPI_Integrations_Base { /** * Holds the OMAPI_MemberPress_Courses class instance. * * @since 2.13.0 * * @var OMAPI_MemberPress_Courses */ public $courses; /** * Holds the OMAPI_MemberPress_ProductEducation class instance. * * @since 2.13.5 * * @var OMAPI_MemberPress_ProductEducation */ public $education; /** * The minimum MemberPress version required. * * @since 2.13.0 * * @var string */ const MINIMUM_VERSION = '1.9.39'; /** * Primary class constructor. * * @since 2.13.0 */ public function __construct() { parent::__construct(); // Set our object. $this->courses = new OMAPI_MemberPress_Courses( $this ); $this->education = new OMAPI_MemberPress_ProductEducation(); if ( self::is_active() && self::is_minimum_version() ) { add_filter( 'optin_monster_campaigns_js_api_args', array( $this, 'add_args' ) ); add_filter( 'optin_monster_api_setting_ui_data', array( $this, 'add_args' ) ); wp_enqueue_style( $this->base->plugin_slug . '-memberpress', $this->base->url . 'assets/dist/css/memberpress.min.css', array(), $this->base->asset_version() ); $this->education->add_meta_box(); } } /** * Check if the MemberPress plugin is active. * * @since 2.13.0 * * @return boolean */ public static function is_active() { return defined( 'MEPR_PLUGIN_SLUG' ) && class_exists( 'MeprCptModel', true ); } /** * Return the MemberPress Plugin version string. * * @since 2.13.0 * * @return string */ public static function version() { return defined( 'MEPR_VERSION' ) ? MEPR_VERSION : '0.0.0'; } /** * Adds the `memberpress` object to payload, which is passed to the JS frontend. * * @since 2.13.0 * * @param array $args This is the array of parameters that will be passed to the JS file. * @return array $args The array with the `memberpress` payload. */ public function add_args( $args ) { $args['memberpress'] = array( 'groups' => self::format_data( $this->retrieve_mp_data( 'MeprGroup' ) ), 'memberships' => self::format_data( $this->retrieve_mp_data( 'MeprProduct' ) ), 'isActive' => self::is_active(), 'isCoursesActive' => OMAPI_MemberPress_Courses::is_active(), 'checkoutTemplateEnabled' => self::isProTemplateEnabled( 'checkout' ), ); $args['memberpress'] = array_merge( $args['memberpress'], $this->courses->get_args() ); return $args; } /** * Format data to be consumed by the front-end admin output settings. * * @since 2.13.0 * * @param array $payload The data to be formatted. * @return array The formatted data */ public static function format_data( $payload ) { $data = array(); if ( empty( $payload ) || ! is_array( $payload ) ) { return $data; } foreach ( $payload as $entity ) { $data[] = array( 'value' => $entity->ID, 'label' => $entity->post_title, 'name' => $entity->post_title, ); } return $data; } /** * Retrieve MemberPress model data. * * @since 2.13.0 * * @param string $model The entity model name. * @return array The array model data. */ private function retrieve_mp_data( $model ) { // Bail if MemberPress isn't currently active. if ( ! self::is_active() || ! self::is_minimum_version() ) { return array(); } $data = MeprCptModel::all( $model ); if ( empty( $data ) ) { return array(); } return $data; } /** * Determine if a "pro" template is enabled. * * @param string $name The template name. * @return boolean True if enabled. */ public static function isProTemplateEnabled( $name ) { if ( ! class_exists( 'MeprOptions', true ) ) { return false; } $options = MeprOptions::fetch(); $attribute = 'design_enable_' . $name . '_template'; return ! empty( $options->$attribute ) && filter_var( $options->$attribute, FILTER_VALIDATE_BOOLEAN ); } }
Save
cmd:
run