[ SYSTEM ]: Linux wordpress 6.1.0-44-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
[ SERVER ]: Apache/2.4.66 (Debian) | PHP: 8.2.30
[ USER ]: www-data | IP: 172.19.30.54
GEFORCE FILE MANAGER
/
var
/
www
/
html
/
wordpress
/
wp-content
/
plugins
/
suretriggers
/
src
/
Integrations
/
peepso
/
actions
/
UPLOAD:
NAME
SIZE
QUICK PERMS
ACTIONS
📄 add-post-sitewide-activity-stream.php
4,028 B
SET
[ EDIT ]
|
[ DEL ]
📄 change-user-peepso-role.php
2,854 B
SET
[ EDIT ]
|
[ DEL ]
📄 follow-user.php
2,329 B
SET
[ EDIT ]
|
[ DEL ]
DELETE SELECTED
[ CLOSE ]
EDIT: follow-user.php
<?php /** * FollowUser. * php version 5.6 * * @category FollowUser * @package SureTriggers * @author BSF <username@example.com> * @license https://www.gnu.org/licenses/gpl-3.0.html GPLv3 * @link https://www.brainstormforce.com/ * @since 1.0.0 */ namespace SureTriggers\Integrations\PeepSo\Actions; use SureTriggers\Integrations\AutomateAction; use SureTriggers\Traits\SingletonLoader; use Exception; use SureTriggers\Integrations\WordPress\WordPress; use PeepSoUserFollower; /** * FollowUser * * @category FollowUser * @package SureTriggers * @author BSF <username@example.com> * @license https://www.gnu.org/licenses/gpl-3.0.html GPLv3 * @link https://www.brainstormforce.com/ * @since 1.0.0 */ class FollowUser extends AutomateAction { /** * Integration type. * * @var string */ public $integration = 'PeepSo'; /** * Action name. * * @var string */ public $action = 'peepso_follow_user'; use SingletonLoader; /** * Register a action. * * @param array $actions actions. * @return array */ public function register( $actions ) { $actions[ $this->integration ][ $this->action ] = [ 'label' => __( 'Follow User', 'suretriggers' ), 'action' => $this->action, 'function' => [ $this, 'action_listener' ], ]; return $actions; } /** * Action listener. * * @param int $user_id user_id. * @param int $automation_id automation_id. * @param array $fields fields. * @param array $selected_options selectedOptions. * * @return array * @throws Exception Exception. */ public function _action_listener( $user_id, $automation_id, $fields, $selected_options ) { if ( ! class_exists( 'PeepSoUserFollower' ) ) { return []; } $follow_user_id = $selected_options['follow_user_id']; $userdata = get_userdata( $follow_user_id ); if ( ! $userdata ) { return [ 'status' => 'error', 'message' => "The user doesn't exist", ]; } $follow = 1; $peepso_user_follower = new PeepSoUserFollower( $follow_user_id, $user_id, true ); $peepso_user_follower->set( 'follow', $follow ); $context['follower'] = WordPress::get_user_context( $user_id ); $context['following'] = WordPress::get_user_context( $follow_user_id ); return $context; } } FollowUser::get_instance();