GRAYBYTE WORDPRESS FILE MANAGER7759

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/giriqfky/trustyourlawyer.com/wp-content/plugins/fluent-smtp/includes/Core/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/trustyourlawyer.com/wp-content/plugins/fluent-smtp/includes/Core//CoreTrait.php
<?php

namespace FluentMail\Includes\Core;

use FluentMail\Includes\Support\ForbiddenException;

trait CoreTrait
{
    public function get($action, $handler, $isAdmin = true)
    {
        $action = $this->getAjaxAction($action, 'get', $isAdmin);

        return add_action($action, $this->parseAjaxHandler($handler));        
    }

    public function getPublic($action, $handler)
    {
        $this->get($action, $handler, false);
    }

    public function post($action, $handler, $isAdmin = true)
    {
        $action = $this->getAjaxAction($action, 'post', $isAdmin);

        return add_action($action, function() use ($handler) {
            try {
                $slug = FLUENTMAIL;

                if (check_ajax_referer($slug, 'nonce', false)) {
                    $method = $this->parseAjaxHandler($handler);
                    return $method();
                }

                throw new ForbiddenException('Forbidden!', 401);
                
            } catch (ForbiddenException $e) {
                return $this->docustomAction('handle_exception', $e);
            }
        });
    }

    public function postPublic($action, $handler)
    {
        $this->post($action, $handler, false);
    }

    public function getAjaxAction($action, $method, $isAdmin)
    {
        $context = $isAdmin ? 'wp_ajax_' : 'wp_ajax_nopriv_';
        $action = $action == '/' ? $action : ltrim($action, '/');
        return $context.$this->hook($method.'-'.$action);
    }

    public function hook($hook)
    {
        return FLUENTMAIL . '-' . $hook;
    }

    public function parseAjaxHandler($handler)
    {
        if (!$handler) return;

        if (is_string($handler)) {
            $handler = $this->controllerNamespace . '\\' . $handler;
        } else if (is_array($handler)) {
            list($class, $method) = $handler;
            if (is_string($class)) {
                $handler = $this->controllerNamespace . '\\' . $class . '::' . $method;
            }
        }

        return function() use ($handler) {
            return $this->call($handler);
        };
    }

    public function addAction($action, $handler, $priority = 10, $numOfArgs = 1)
    {
        return add_action(
            $action,
            $this->parseHookHandler($handler),
            $priority,
            $numOfArgs
        );
    }

    public function addCustomAction($action, $handler, $priority = 10, $numOfArgs = 1)
    {
        return $this->addAction($this->hook($action), $handler, $priority, $numOfArgs);
    }

    public function doAction()
    {
        return call_user_func_array('do_action', func_get_args());
    }

    public function doCustomAction()
    {
        $args = func_get_args();
        $args[0] = $this->hook($args[0]);
        return call_user_func_array('do_action', $args);
    }

    public function addFilter($action, $handler, $priority = 10, $numOfArgs = 1)
    {
        return add_filter(
            $action,
            $this->parseHookHandler($handler),
            $priority,
            $numOfArgs
        );
    }

    public function addCustomFilter($action, $handler, $priority = 10, $numOfArgs = 1)
    {
        return $this->addFilter($this->hook($action), $handler, $priority, $numOfArgs);
    }

    public function applyFilters()
    {
        return call_user_func_array('apply_filters', func_get_args());
    }

    public function applyCustomFilters()
    {
        $args = func_get_args();
        $args[0] = $this->hook($args[0]);
        return call_user_func_array('apply_filters', $args);
    }

    public function parseHookHandler($handler)
    {
        if (is_string($handler)) {
            list($class, $method) = preg_split('/::|@/', $handler);

            if ($this->hasNamespace($handler)) {
                $class = $this->make($class);
            } else {
                $class = $this->make($this->handlerNamespace . '\\' . $class);
            }
            return [$class, $method];

        } else if (is_array($handler)) {
            list($class, $method) = $handler;
            if (is_string($class)) {
                if ($this->hasNamespace($handler)) {
                    $class = $this->make($class);
                } else {
                    $class = $this->make($this->handlerNamespace . '\\' . $class);
                }
            }

            return [$class, $method];
        }

        return $handler;
    }

    public function hasNamespace($handler)
    {
        $parts = explode('\\', $handler);
        return count($parts) > 1;
    }
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 10 2025 04:32:20
giriqfky / giriqfky
0755
.htaccess
0.41 KB
July 10 2025 04:32:20
giriqfky / giriqfky
0644
Application.php
5.461 KB
October 20 2024 18:25:46
giriqfky / giriqfky
0644
BindingResolutionException.php
0.097 KB
January 18 2021 20:25:02
giriqfky / giriqfky
0644
Container.php
33.817 KB
October 20 2024 18:25:46
giriqfky / giriqfky
0644
ContainerContract.php
3.403 KB
January 18 2021 20:25:02
giriqfky / giriqfky
0644
ContextualBindingBuilder.php
1.297 KB
January 18 2021 20:25:02
giriqfky / giriqfky
0644
CoreTrait.php
4.449 KB
April 15 2021 19:28:10
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF