GRAYBYTE WORDPRESS FILE MANAGER7139

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/backwpup/inc/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/trustyourlawyer.com/wp-content/plugins/backwpup/inc//class-page-logs.php
<?php

/**
 * Class for BackWPup logs display page.
 */
class BackWPup_Page_Logs extends WP_List_Table
{
    /**
     * Log Folder.
     *
     * @var string The log folder
     */
    public $log_folder = '';

    /**
     * BackWPup_Page_Logs.
     *
     * @var \BackWPup_Page_Logs The instance
     */
    private static $listtable;

    /**
     * Job Types.
     *
     * @var array A list of job types
     */
    private $job_types;

    /**
     * BackWPup_Page_Logs constructor.
     */
    public function __construct()
    {
        parent::__construct([
            'plural' => 'logs',
            'singular' => 'log',
            'ajax' => true,
        ]);

        $this->log_folder = get_site_option('backwpup_cfg_logfolder');
        $this->log_folder = BackWPup_File::get_absolute_path($this->log_folder);
        $this->log_folder = untrailingslashit($this->log_folder);
    }

	/**
	 * Retrieves the table classes for the job page.
	 *
	 * This method constructs an array of CSS classes to be applied to the table
	 * on the job page. The 'fixed' class is intentionally omitted from the default
	 * classes.
	 *
	 * @return array An array of CSS classes for the table.
	 */
	protected function get_table_classes() {
		// Remove 'fixed' from the default classes.
		$classes = [ 'widefat', 'striped', $this->_args['plural'] ];
		return $classes;
	}

    /**
     * User can.
     *
     * @return bool True if user has the right capabilities, false otherwise
     */
    public function ajax_user_can()
    {
        return current_user_can('backwpup_logs');
    }

    /**
     * Prepare Items.
     */
    public function prepare_items()
    {
        $this->job_types = BackWPup::get_job_types();

        $per_page = $this->get_items_per_page('backwpuplogs_per_page');
        if (empty($per_page) || $per_page < 1) {
            $per_page = 20;
        }

        // Load logs.
        $logfiles = [];

        if (is_readable($this->log_folder)) {
            $dir = new BackWPup_Directory($this->log_folder);

            foreach ($dir as $file) {
                if ($file->isFile() && $file->isReadable() && strpos($file->getFilename(), 'backwpup_log_') !== false && strpos($file->getFilename(), '.html') !== false) {
                    $logfiles[$file->getMTime()] = $file->getFilename();
                }
            }
        }

        // Ordering.
        $order = $_GET['order'] ?? 'desc';
        $orderby = $_GET['orderby'] ?? 'time';

        if ($orderby == 'time') {
            if ($order == 'asc') {
                ksort($logfiles);
            } else {
                krsort($logfiles);
            }
        }

        // By page.
        $start = intval(($this->get_pagenum() - 1) * $per_page);
        $end = $start + $per_page;
        if ($end > count($logfiles)) {
            $end = count($logfiles);
        }

        $this->items = [];
        $i = -1;

        foreach ($logfiles as $mtime => $logfile) {
            ++$i;
            if ($i < $start) {
                continue;
            }
            if ($i >= $end) {
                break;
            }
            $this->items[$mtime] = BackWPup_Job::read_logheader($this->log_folder . '/' . $logfile);
            $this->items[$mtime]['file'] = $logfile;
        }

        $this->set_pagination_args([
            'total_items' => count($logfiles),
            'per_page' => $per_page,
            'orderby' => $orderby,
            'order' => $order,
        ]);
    }

    /**
     * {@inheritdoc}
     */
    public function get_sortable_columns()
    {
        return [
            'time' => ['time', false],
        ];
    }

    public function no_items()
    {
        _e('No Logs.', 'backwpup');
    }

    /**
     * {@inheritdoc}
     */
    public function get_bulk_actions()
    {
        if (!$this->has_items()) {
            return [];
        }

        $actions = [];
        $actions['delete'] = __('Delete', 'backwpup');

        return $actions;
    }

    /**
     * {@inheritdoc}
     */
    public function get_columns()
    {
        $posts_columns = [];
        $posts_columns['cb'] = '<input type="checkbox" />';
        $posts_columns['time'] = __('Time', 'backwpup');
        $posts_columns['job'] = __('Job', 'backwpup');
        $posts_columns['status'] = __('Status', 'backwpup');
        $posts_columns['type'] = __('Type', 'backwpup');
        $posts_columns['size'] = __('Size', 'backwpup');
        $posts_columns['runtime'] = __('Runtime', 'backwpup');

        return $posts_columns;
    }

    /**
     * {@inheritdoc}
     */
    public function column_cb($item)
    {
        return '<input type="checkbox" name="logfiles[]" value="' . esc_attr($item['file']) . '" />';
    }

    /**
     * The job id Column.
     *
     * @param $item
     *
     * @return string
	 */
	public function column_time( $item ) {
		// translators: %1$s: date, %2$s: time.
		return sprintf( __( '%1$s at %2$s', 'backwpup' ), wp_date( get_option( 'date_format' ), $item['logtime'] ), wp_date( get_option( 'time_format' ), $item['logtime'] ) );
	}

    /**
     * The type Column.
     *
     * @param $item
     *
     * @return string
     */
    public function column_type($item)
    {
        $r = '';
        if ($types = explode('+', (string) $item['type'])) {
            foreach ($types as $type) {
                if (isset($this->job_types[$type])) {
                    $r .= $this->job_types[$type]->info['name'] . '<br />';
                } else {
                    $r .= $type . '<br />';
                }
            }
        }

        return $r;
    }

    /**
     * The log Column.
     *
     * @param $item
     *
     * @return string
     */
    public function column_job($item)
    {
        $log_name = str_replace(['.html', '.gz'], '', basename((string) $item['file']));
        $r = '<strong><a class="thickbox" href="' . admin_url('admin-ajax.php') . '?&action=backwpup_view_log&log=' . $log_name . '&_ajax_nonce=' . wp_create_nonce('view-log_' . $log_name) . '&amp;TB_iframe=true&amp;width=640&amp;height=440" title="' . esc_attr($item['file']) . "\n" . sprintf(__('Job ID: %d', 'backwpup'), $item['jobid']) . '">' . esc_html(!empty($item['name']) ? $item['name'] : $item['file']) . '</a></strong>';
        $actions = [];
        $actions['view'] = '<a class="thickbox" href="' . admin_url('admin-ajax.php') . '?&action=backwpup_view_log&log=' . $log_name . '&_ajax_nonce=' . wp_create_nonce('view-log_' . $log_name) . '&amp;TB_iframe=true&amp;width=640&amp;height=440" title="' . $item['file'] . '">' . __('View', 'backwpup') . '</a>';
        if (current_user_can('backwpup_logs_delete')) {
            $actions['delete'] = '<a class="submitdelete" href="' . wp_nonce_url(network_admin_url('admin.php') . '?page=backwpuplogs&action=delete&paged=' . $this->get_pagenum() . '&logfiles[]=' . $item['file'], 'bulk-logs') . '" onclick="return showNotice.warn();">' . __('Delete', 'backwpup') . '</a>';
        }
        $actions['download'] = '<a href="' . wp_nonce_url(network_admin_url('admin.php') . '?page=backwpuplogs&action=download&file=' . $item['file'], 'download_backwpup_logs', 'download_backwpup_logs') . '">' . __('Download', 'backwpup') . '</a>';
        $r .= $this->row_actions($actions);

        return $r;
    }

    /**
     * The status Column.
     *
     * @param $item
     *
     * @return string
     */
    public function column_status($item)
    {
        $r = '';
        if ($item['errors']) {
            $r .= sprintf('<span style="color:red;font-weight:bold;">' . _n('1 ERROR', '%d ERRORS', $item['errors'], 'backwpup') . '</span><br />', $item['errors']);
        }
        if ($item['warnings']) {
            $r .= sprintf('<span style="color:#e66f00;font-weight:bold;">' . _n('1 WARNING', '%d WARNINGS', $item['warnings'], 'backwpup') . '</span><br />', $item['warnings']);
        }
        if (!$item['errors'] && !$item['warnings']) {
            $r .= '<span style="color:green;font-weight:bold;">' . __('O.K.', 'backwpup') . '</span>';
        }

        return $r;
    }

    /**
     * The size Column.
     *
     * @param $item
     *
     * @return string
     */
    public function column_size($item)
    {
        if (!empty($item['backupfilesize'])) {
            return size_format($item['backupfilesize'], 2);
        }

        return __('Log only', 'backwpup');
    }

    /**
     * The runtime Column.
     *
     * @param $item
     *
     * @return string
     */
    public function column_runtime($item)
    {
        return $item['runtime'] . ' ' . __('seconds', 'backwpup');
    }

    /**
     * Load.
     */
    public static function load()
    {
        global $current_user;

        //Create Table
        self::$listtable = new BackWPup_Page_Logs();

        switch (self::$listtable->current_action()) {
            // Delete Log
            case 'delete':
                if (!current_user_can('backwpup_logs_delete')) {
                    break;
                }
                if (is_array($_GET['logfiles'])) {
                    check_admin_referer('bulk-logs');

                    foreach ($_GET['logfiles'] as $logfile) {
                        $logfile = basename((string) $logfile);
                        if (is_writeable(self::$listtable->log_folder . '/' . $logfile) && !is_dir(self::$listtable->log_folder . '/' . $logfile) && !is_link(self::$listtable->log_folder . '/' . $logfile)) {
                            unlink(self::$listtable->log_folder . '/' . $logfile);
                        }
                    }
                }
                break;
            // Download Log
            case 'download':
                $log_file = trailingslashit(self::$listtable->log_folder) . basename(trim((string) $_GET['file']));
                $log_file = realpath(BackWPup_Sanitize_Path::sanitize_path($log_file));

                if (!$log_file
                     || !is_readable($log_file)
                     || is_dir($log_file)
                     || is_link($log_file)
                ) {
                    header('HTTP/1.0 404 Not Found');

                    exit();
                }

                $capability = 'backwpup_logs';

                $download_handler = new BackWpup_Download_Handler(
                    new BackWPup_Download_File(
                        $log_file,
                        function (BackWPup_Download_File_Interface $obj) {
                            $obj->clean_ob()
                                ->headers()
                            ;

                            // phpcs:ignore
                            echo backwpup_wpfilesystem()->get_contents($obj->filepath());

                            exit();
                        },
                        $capability
                    ),
                    'download_backwpup_logs',
                    $capability,
                    'download'
                );

                $download_handler->handle();
                break;
        }

        //Save per page
        if (isset($_POST['screen-options-apply'], $_POST['wp_screen_options']['option'], $_POST['wp_screen_options']['value'])
             && $_POST['wp_screen_options']['option'] == 'backwpuplogs_per_page'
        ) {
            check_admin_referer('screen-options-nonce', 'screenoptionnonce');

            if ($_POST['wp_screen_options']['value'] > 0 && $_POST['wp_screen_options']['value'] < 1000) {
                update_user_option($current_user->ID, 'backwpuplogs_per_page', (int) $_POST['wp_screen_options']['value']);
                wp_redirect(remove_query_arg(['pagenum', 'apage', 'paged'], wp_get_referer()));

                exit;
            }
        }

        add_screen_option('per_page', [
            'label' => __('Logs', 'backwpup'),
            'default' => 20,
            'option' => 'backwpuplogs_per_page',
        ]);

        self::$listtable->prepare_items();
    }

    /**
     * Output css.
     */
    public static function admin_print_styles()
    {
        ?>
		<style type="text/css" media="screen">
			.column-time {
				text-align: center;
			}

			.column-runtime, .column-time, .column-size {
				width: 8%;
			}

			.column-status {
				width: 10%;
			}

			.column-type {
				width: 15%;
			}

			@media screen and (max-width: 782px) {
				.column-type, .column-runtime, .column-size {
					display: none;
				}

				.column-time, .column-status {
					width: 18%;
				}
			}
		</style>
		<?php
    }

    /**
     * Output js.
     */
    public static function admin_print_scripts()
    {
        wp_enqueue_script('backwpupgeneral');
    }

    /**
     * Display the page content.
     */
    public static function page()
    {
        ?>
		<div class="wrap" id="backwpup-page">
			<h1><?php echo esc_html(sprintf(__('%s &rsaquo; Logs', 'backwpup'), BackWPup::get_plugin_data('name'))); ?></h1>
			<?php BackWPup_Admin::display_messages(); ?>
			<form id="posts-filter" action="" method="get">
				<input type="hidden" name="page" value="backwpuplogs"/>
				<?php self::$listtable->display(); ?>
				<div id="ajax-response"></div>
			</form>
		</div>
		<?php
    }

    /**
     * For displaying log files with ajax.
     */
    public static function ajax_view_log()
    {
        if (!current_user_can('backwpup_logs') || !isset($_GET['log']) || strstr((string) $_GET['log'], 'backwpup_log_') === false) {
            exit('-1');
        }

        check_ajax_referer('view-log_' . $_GET['log']);

        $log_folder = get_site_option('backwpup_cfg_logfolder');
        $log_folder = BackWPup_File::get_absolute_path($log_folder);
        $log_file = $log_folder . basename(trim((string) $_GET['log']));

        if (file_exists($log_file . '.html') && is_readable($log_file . '.html')) {
            echo file_get_contents($log_file . '.html', false);
        } elseif (file_exists($log_file . '.html.gz') && is_readable($log_file . '.html.gz')) {
            echo file_get_contents('compress.zlib://' . $log_file . '.html.gz', false);
        } else {
            exit(__('Logfile not found!', 'backwpup'));
        }

        exit();
    }
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 10 2025 04:32:29
giriqfky / giriqfky
0755
Notice
--
July 10 2025 04:32:37
giriqfky / giriqfky
0755
Settings
--
July 10 2025 04:32:37
giriqfky / giriqfky
0755
ThirdParty
--
July 10 2025 04:32:37
giriqfky / giriqfky
0755
Utils
--
July 10 2025 04:32:37
giriqfky / giriqfky
0755
dependencies
--
July 10 2025 04:32:37
giriqfky / giriqfky
0755
.htaccess
0.41 KB
July 10 2025 04:32:37
giriqfky / giriqfky
0644
BackWPup.php
11.618 KB
May 20 2025 11:41:24
giriqfky / giriqfky
0644
class-admin.php
44.521 KB
May 20 2025 11:41:24
giriqfky / giriqfky
0644
class-adminbar.php
2.676 KB
May 20 2025 11:41:24
giriqfky / giriqfky
0644
class-create-archive-exception.php
0.148 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-create-archive.php
27.247 KB
March 10 2025 14:47:06
giriqfky / giriqfky
0644
class-cron.php
18.585 KB
April 29 2025 17:34:12
giriqfky / giriqfky
0644
class-destination-connect-exception.php
0.218 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-destination-connect-interface.php
0.647 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-destination-download-exception.php
0.202 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-destination-downloader-data.php
1.223 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-destination-downloader-factory.php
1.629 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-destination-downloader-interface.php
0.52 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-destination-downloader.php
5.126 KB
June 04 2024 10:51:14
giriqfky / giriqfky
0644
class-destination-dropbox-api-exception.php
0.129 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-destination-dropbox-api-request-exception.php
0.595 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-destination-dropbox-api.php
40.892 KB
February 13 2025 20:02:44
giriqfky / giriqfky
0644
class-destination-dropbox-downloader.php
2.907 KB
October 18 2023 17:06:40
giriqfky / giriqfky
0644
class-destination-dropbox.php
21.399 KB
May 20 2025 11:41:24
giriqfky / giriqfky
0644
class-destination-email.php
19.876 KB
April 23 2025 14:14:02
giriqfky / giriqfky
0644
class-destination-folder-downloader.php
3.488 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-destination-folder.php
10.113 KB
April 07 2025 18:31:08
giriqfky / giriqfky
0644
class-destination-ftp-connect.php
5.373 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-destination-ftp-downloader.php
3.351 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-destination-ftp.php
29.519 KB
April 07 2025 18:31:08
giriqfky / giriqfky
0644
class-destination-msazure-downloader.php
3.369 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-destination-msazure.php
26.319 KB
February 04 2025 14:50:44
giriqfky / giriqfky
0644
class-destination-rsc.php
22.318 KB
March 21 2025 15:27:30
giriqfky / giriqfky
0644
class-destination-s3-downloader.php
3.298 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-destination-s3.php
48.635 KB
April 07 2025 18:31:08
giriqfky / giriqfky
0644
class-destination-sugarsync.php
38.054 KB
February 04 2025 14:50:44
giriqfky / giriqfky
0644
class-destinations.php
6.154 KB
April 07 2025 18:31:08
giriqfky / giriqfky
0644
class-directory.php
6.025 KB
April 23 2025 14:14:02
giriqfky / giriqfky
0644
class-download-file-interface.php
0.609 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-download-file.php
3.406 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-download-handler.php
1.956 KB
October 18 2023 17:06:40
giriqfky / giriqfky
0644
class-easycron.php
8.057 KB
October 01 2024 16:10:48
giriqfky / giriqfky
0644
class-encryption-fallback.php
2.875 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-encryption-mcrypt.php
4.014 KB
March 03 2025 19:19:24
giriqfky / giriqfky
0644
class-encryption-openssl.php
3.925 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-encryption.php
6.265 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-factory-exception.php
0.191 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-file.php
10.787 KB
March 13 2025 16:05:40
giriqfky / giriqfky
0644
class-help.php
1.745 KB
October 18 2023 17:06:40
giriqfky / giriqfky
0644
class-install.php
18.464 KB
April 23 2025 14:14:02
giriqfky / giriqfky
0644
class-job.php
105.758 KB
May 20 2025 11:41:24
giriqfky / giriqfky
0644
class-jobtype-dbcheck.php
6.386 KB
October 18 2023 17:06:40
giriqfky / giriqfky
0644
class-jobtype-dbdump.php
11.304 KB
April 07 2025 18:31:08
giriqfky / giriqfky
0644
class-jobtype-file.php
24.155 KB
April 07 2025 18:31:08
giriqfky / giriqfky
0644
class-jobtype-wpexp.php
34.94 KB
March 13 2025 16:05:40
giriqfky / giriqfky
0644
class-jobtype-wpplugin.php
6.864 KB
March 03 2025 19:19:24
giriqfky / giriqfky
0644
class-jobtypes.php
2.25 KB
April 07 2025 18:31:08
giriqfky / giriqfky
0644
class-message-box.php
3.464 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-migrate.php
10.691 KB
April 23 2025 14:14:02
giriqfky / giriqfky
0644
class-msazure-destination-configuration.php
1.597 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-mysqldump.php
34.067 KB
June 19 2024 12:40:40
giriqfky / giriqfky
0644
class-option.php
18.498 KB
April 23 2025 14:14:02
giriqfky / giriqfky
0644
class-page-about.php
27.481 KB
June 19 2024 12:40:40
giriqfky / giriqfky
0644
class-page-backups.php
20.81 KB
April 23 2025 14:14:02
giriqfky / giriqfky
0644
class-page-backwpup.php
21.946 KB
October 18 2023 17:06:40
giriqfky / giriqfky
0644
class-page-editjob.php
47.442 KB
April 23 2025 14:14:02
giriqfky / giriqfky
0644
class-page-firstbackup.php
0.556 KB
February 04 2025 14:50:44
giriqfky / giriqfky
0644
class-page-jobs.php
44.727 KB
April 23 2025 14:14:02
giriqfky / giriqfky
0644
class-page-logs.php
13.824 KB
April 23 2025 14:14:02
giriqfky / giriqfky
0644
class-page-onboarding.php
6.948 KB
May 20 2025 11:41:24
giriqfky / giriqfky
0644
class-page-restore.php
5.368 KB
April 07 2025 18:31:08
giriqfky / giriqfky
0644
class-page-settings.php
45.41 KB
April 07 2025 18:31:08
giriqfky / giriqfky
0644
class-path-fixer.php
0.815 KB
October 18 2023 17:06:40
giriqfky / giriqfky
0644
class-recursive-directory.php
0.573 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-s3-destination.php
11.986 KB
March 13 2025 16:05:40
giriqfky / giriqfky
0644
class-sanitize-path.php
1.547 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-system-requirements.php
1.231 KB
October 01 2024 16:10:48
giriqfky / giriqfky
0644
class-system-tests-runner.php
9.5 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-system-tests.php
3.469 KB
November 16 2022 17:55:50
giriqfky / giriqfky
0644
class-thirdparties.php
1.023 KB
June 19 2024 12:40:40
giriqfky / giriqfky
0644
class-wp-api.php
43.999 KB
April 29 2025 17:34:12
giriqfky / giriqfky
0644
class-wp-cli.php
11.83 KB
April 23 2025 14:14:02
giriqfky / giriqfky
0644
functions.php
5.883 KB
April 30 2025 17:12:56
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF