$70 GRAYBYTE WORDPRESS FILE MANAGER $39

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.15.130 | ADMIN IP 216.73.217.88
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/bravetechrwanda/dantho.rw/wp-admin/includes/

HOME
Current File : /home/bravetechrwanda/dantho.rw/wp-admin/includes//class-wp-importer.php
<?php
/**
 * WP_Importer base class
 *
 * @package WordPress
 * @subpackage Importer
 * @since 3.0.0
 */

#[AllowDynamicProperties]
class WP_Importer {
	/**
	 * Class Constructor
	 */
	public function __construct() {}

	/**
	 * Returns array with imported permalinks from WordPress database.
	 *
	 * @global wpdb $wpdb WordPress database abstraction object.
	 *
	 * @param string $importer_name
	 * @param string $blog_id
	 * @return array
	 */
	public function get_imported_posts( $importer_name, $blog_id ) {
		global $wpdb;

		$hashtable = array();

		$limit  = 100;
		$offset = 0;

		// Grab all posts in chunks.
		do {
			$meta_key = $importer_name . '_' . $blog_id . '_permalink';
			$results  = $wpdb->get_results(
				$wpdb->prepare(
					"SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = %s LIMIT %d,%d",
					$meta_key,
					$offset,
					$limit
				)
			);

			// Increment offset.
			$offset = ( $limit + $offset );

			if ( ! empty( $results ) ) {
				foreach ( $results as $r ) {
					// Set permalinks into array.
					$hashtable[ $r->meta_value ] = (int) $r->post_id;
				}
			}
		} while ( count( $results ) === $limit );

		return $hashtable;
	}

	/**
	 * Returns count of imported permalinks from WordPress database.
	 *
	 * @global wpdb $wpdb WordPress database abstraction object.
	 *
	 * @param string $importer_name
	 * @param string $blog_id
	 * @return int
	 */
	public function count_imported_posts( $importer_name, $blog_id ) {
		global $wpdb;

		$count = 0;

		// Get count of permalinks.
		$meta_key = $importer_name . '_' . $blog_id . '_permalink';
		$result   = $wpdb->get_results(
			$wpdb->prepare(
				"SELECT COUNT( post_id ) AS cnt FROM $wpdb->postmeta WHERE meta_key = %s",
				$meta_key
			)
		);

		if ( ! empty( $result ) ) {
			$count = (int) $result[0]->cnt;
		}

		return $count;
	}

	/**
	 * Sets array with imported comments from WordPress database.
	 *
	 * @global wpdb $wpdb WordPress database abstraction object.
	 *
	 * @param string $blog_id
	 * @return array
	 */
	public function get_imported_comments( $blog_id ) {
		global $wpdb;

		$hashtable = array();

		$limit  = 100;
		$offset = 0;

		// Grab all comments in chunks.
		do {
			$results = $wpdb->get_results(
				$wpdb->prepare(
					"SELECT comment_ID, comment_agent FROM $wpdb->comments LIMIT %d,%d",
					$offset,
					$limit
				)
			);

			// Increment offset.
			$offset = ( $limit + $offset );

			if ( ! empty( $results ) ) {
				foreach ( $results as $r ) {
					// Explode comment_agent key.
					list ( $comment_agent_blog_id, $source_comment_id ) = explode( '-', $r->comment_agent );

					$source_comment_id = (int) $source_comment_id;

					// Check if this comment came from this blog.
					if ( (int) $blog_id === (int) $comment_agent_blog_id ) {
						$hashtable[ $source_comment_id ] = (int) $r->comment_ID;
					}
				}
			}
		} while ( count( $results ) === $limit );

		return $hashtable;
	}

	/**
	 * @param int $blog_id
	 * @return int|void
	 */
	public function set_blog( $blog_id ) {
		if ( is_numeric( $blog_id ) ) {
			$blog_id = (int) $blog_id;
		} else {
			$blog   = 'http://' . preg_replace( '#^https?://#', '', $blog_id );
			$parsed = parse_url( $blog );
			if ( ! $parsed || empty( $parsed['host'] ) ) {
				fwrite( STDERR, "Error: can not determine blog_id from $blog_id\n" );
				exit;
			}
			if ( empty( $parsed['path'] ) ) {
				$parsed['path'] = '/';
			}
			$blogs = get_sites(
				array(
					'domain' => $parsed['host'],
					'number' => 1,
					'path'   => $parsed['path'],
				)
			);
			if ( ! $blogs ) {
				fwrite( STDERR, "Error: Could not find blog\n" );
				exit;
			}
			$blog    = array_shift( $blogs );
			$blog_id = (int) $blog->blog_id;
		}

		if ( function_exists( 'is_multisite' ) ) {
			if ( is_multisite() ) {
				switch_to_blog( $blog_id );
			}
		}

		return $blog_id;
	}

	/**
	 * @param int $user_id
	 * @return int|void
	 */
	public function set_user( $user_id ) {
		if ( is_numeric( $user_id ) ) {
			$user_id = (int) $user_id;
		} else {
			$user_id = (int) username_exists( $user_id );
		}

		if ( ! $user_id || ! wp_set_current_user( $user_id ) ) {
			fwrite( STDERR, "Error: can not find user\n" );
			exit;
		}

		return $user_id;
	}

	/**
	 * Sorts by strlen, longest string first.
	 *
	 * @param string $a
	 * @param string $b
	 * @return int
	 */
	public function cmpr_strlen( $a, $b ) {
		return strlen( $b ) - strlen( $a );
	}

	/**
	 * Gets URL.
	 *
	 * @param string $url
	 * @param string $username
	 * @param string $password
	 * @param bool   $head
	 * @return array
	 */
	public function get_page(
		$url,
		$username = '',
		#[\SensitiveParameter]
		$password = '',
		$head = false
	) {
		// Increase the timeout.
		add_filter( 'http_request_timeout', array( $this, 'bump_request_timeout' ) );

		$headers = array();
		$args    = array();
		if ( true === $head ) {
			$args['method'] = 'HEAD';
		}
		if ( ! empty( $username ) && ! empty( $password ) ) {
			$headers['Authorization'] = 'Basic ' . base64_encode( "$username:$password" );
		}

		$args['headers'] = $headers;

		return wp_safe_remote_request( $url, $args );
	}

	/**
	 * Bumps up the request timeout for http requests.
	 *
	 * @param int $val
	 * @return int
	 */
	public function bump_request_timeout( $val ) {
		return 60;
	}

	/**
	 * Checks if user has exceeded disk quota.
	 *
	 * @return bool
	 */
	public function is_user_over_quota() {
		if ( function_exists( 'upload_is_user_over_quota' ) ) {
			if ( upload_is_user_over_quota() ) {
				return true;
			}
		}

		return false;
	}

	/**
	 * Replaces newlines, tabs, and multiple spaces with a single space.
	 *
	 * @param string $text
	 * @return string
	 */
	public function min_whitespace( $text ) {
		return preg_replace( '|[\r\n\t ]+|', ' ', $text );
	}

	/**
	 * Resets global variables that grow out of control during imports.
	 *
	 * @since 3.0.0
	 *
	 * @global wpdb  $wpdb       WordPress database abstraction object.
	 * @global int[] $wp_actions Stores the number of times each action was triggered.
	 */
	public function stop_the_insanity() {
		global $wpdb, $wp_actions;
		// Or define( 'WP_IMPORTING', true );
		$wpdb->queries = array();
		// Reset $wp_actions to keep it from growing out of control.
		$wp_actions = array();
	}
}

/**
 * Returns value of command line params.
 * Exits when a required param is not set.
 *
 * @param string $param    The parameter name to retrieve.
 * @param bool   $required Optional. Whether the parameter is required. Default false.
 * @return string|true|null|never The parameter value or true if found, null otherwise.
 *                                The function exits when a required parameter is missing.
 */
function get_cli_args( $param, $required = false ) {
	$args = $_SERVER['argv'];
	if ( ! is_array( $args ) ) {
		$args = array();
	}

	$out = array();

	$last_arg = null;
	$return   = null;

	$il = count( $args );

	for ( $i = 1, $il; $i < $il; $i++ ) {
		if ( (bool) preg_match( '/^--(.+)/', $args[ $i ], $match ) ) {
			$parts = explode( '=', $match[1] );
			$key   = preg_replace( '/[^a-z0-9]+/', '', $parts[0] );

			$out[ $key ] = $parts[1] ?? true;

			$last_arg = $key;
		} elseif ( (bool) preg_match( '/^-([a-zA-Z0-9]+)/', $args[ $i ], $match ) ) {
			for ( $j = 0, $jl = strlen( $match[1] ); $j < $jl; $j++ ) {
				$key         = $match[1][ $j ];
				$out[ $key ] = true;
			}

			$last_arg = $key;
		} elseif ( null !== $last_arg ) {
			$out[ $last_arg ] = $args[ $i ];
		}
	}

	// Check array for specified param.
	if ( isset( $out[ $param ] ) ) {
		// Set return value.
		$return = $out[ $param ];
	}

	// Check for missing required param.
	if ( ! isset( $out[ $param ] ) && $required ) {
		// Display message and exit.
		echo "\"$param\" parameter is required but was not specified\n";
		exit;
	}

	return $return;
}


Current_dir [ WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0755
wk
--
8 Feb 2026 11.06 PM
bravetechrwanda / bravetechrwanda
0755
wp-site
--
6 May 2026 1.33 AM
bravetechrwanda / bravetechrwanda
0755
admin-filters.php
7.846 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
admin.php
3.543 KB
11 Jul 2023 9.03 AM
bravetechrwanda / bravetechrwanda
0644
ajax-actions.php
149.194 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
bookmark.php
11.404 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-automatic-upgrader-skin.php
3.577 KB
22 Jun 2023 6.36 PM
bravetechrwanda / bravetechrwanda
0644
class-bulk-plugin-upgrader-skin.php
2.529 KB
2 May 2024 9.20 PM
bravetechrwanda / bravetechrwanda
0644
class-bulk-theme-upgrader-skin.php
2.598 KB
2 May 2024 9.20 PM
bravetechrwanda / bravetechrwanda
0644
class-bulk-upgrader-skin.php
6.505 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-core-upgrader.php
14.842 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-custom-background.php
21.197 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-custom-image-header.php
48.03 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-file-upload-upgrader.php
4.065 KB
7 Mar 2024 10.58 AM
bravetechrwanda / bravetechrwanda
0644
class-ftp-pure.php
5.299 KB
1 Nov 2019 6.57 PM
bravetechrwanda / bravetechrwanda
0644
class-ftp-sockets.php
8.28 KB
22 Mar 2022 8.25 PM
bravetechrwanda / bravetechrwanda
0644
class-ftp.php
26.702 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-language-pack-upgrader-skin.php
2.803 KB
2 May 2024 9.20 PM
bravetechrwanda / bravetechrwanda
0644
class-language-pack-upgrader.php
15.164 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-pclzip.php
192.085 KB
13 Dec 2024 3.23 AM
bravetechrwanda / bravetechrwanda
0644
class-plugin-installer-skin.php
11.667 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-plugin-upgrader-skin.php
3.201 KB
14 Jun 2023 10.34 AM
bravetechrwanda / bravetechrwanda
0644
class-plugin-upgrader.php
22.704 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-theme-installer-skin.php
12.67 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-theme-upgrader-skin.php
4.078 KB
27 Feb 2024 1.35 AM
bravetechrwanda / bravetechrwanda
0644
class-theme-upgrader.php
26.155 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-walker-category-checklist.php
4.973 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-walker-nav-menu-checklist.php
5.646 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-walker-nav-menu-edit.php
13.963 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-ajax-upgrader-skin.php
4.095 KB
22 Jun 2023 6.36 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-application-passwords-list-table.php
6.786 KB
17 Feb 2024 2.47 AM
bravetechrwanda / bravetechrwanda
0644
class-wp-automatic-updater.php
60.451 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-comments-list-table.php
33.802 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-community-events.php
18.21 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-debug-data.php
70.273 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-filesystem-base.php
23.838 KB
17 Feb 2024 2.47 AM
bravetechrwanda / bravetechrwanda
0644
class-wp-filesystem-direct.php
18.171 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-filesystem-ftpext.php
22.728 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-filesystem-ftpsockets.php
18.063 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-filesystem-ssh2.php
22.842 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-importer.php
7.64 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-internal-pointers.php
4.485 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-links-list-table.php
9.291 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-list-table-compat.php
1.462 KB
14 Nov 2020 9.54 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-list-table.php
51.836 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-media-list-table.php
26.402 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-ms-sites-list-table.php
22.231 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-ms-themes-list-table.php
29.519 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-ms-users-list-table.php
15.323 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-plugin-install-list-table.php
24.389 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-plugins-list-table.php
56.745 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-post-comments-list-table.php
1.419 KB
4 Oct 2022 7.47 AM
bravetechrwanda / bravetechrwanda
0644
class-wp-posts-list-table.php
63.46 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-privacy-data-export-requests-list-table.php
5.433 KB
11 Mar 2022 12.22 AM
bravetechrwanda / bravetechrwanda
0644
class-wp-privacy-data-removal-requests-list-table.php
5.581 KB
8 Sep 2023 1.32 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-privacy-policy-content.php
31.899 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-privacy-requests-table.php
14.444 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-screen.php
36.563 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-site-health-auto-updates.php
14.001 KB
4 Nov 2024 8.25 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-site-health.php
128.165 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-site-icon.php
6.264 KB
3 Mar 2024 1.15 AM
bravetechrwanda / bravetechrwanda
0644
class-wp-terms-list-table.php
20.577 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-theme-install-list-table.php
15.335 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-themes-list-table.php
10.097 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-upgrader-skin.php
6.898 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-upgrader-skins.php
1.442 KB
8 Oct 2019 9.19 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-upgrader.php
47.232 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-users-list-table.php
18.559 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
comment.php
6.085 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
continents-cities.php
20.059 KB
20 Sep 2022 3.24 AM
bravetechrwanda / bravetechrwanda
0644
credits.php
5.695 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
dashboard.php
68.733 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
deprecated.php
40.774 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
edit-tag-messages.php
1.443 KB
7 Dec 2021 5.20 PM
bravetechrwanda / bravetechrwanda
0644
error_log
1.58 KB
23 May 2026 8.00 AM
bravetechrwanda / bravetechrwanda
0644
export.php
25.367 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
file.php
95.618 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
image-edit.php
42.963 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
image.php
44.112 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
import.php
6.462 KB
27 Jul 2024 4.27 AM
bravetechrwanda / bravetechrwanda
0644
list-table.php
3.713 KB
4 Oct 2022 7.47 AM
bravetechrwanda / bravetechrwanda
0644
media.php
117.123 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
menu.php
9.414 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
meta-boxes.php
65.29 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
misc.php
45.354 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
ms-admin-filters.php
1.266 KB
20 Sep 2022 6.51 AM
bravetechrwanda / bravetechrwanda
0644
ms-deprecated.php
3.682 KB
20 Sep 2022 6.51 AM
bravetechrwanda / bravetechrwanda
0644
ms.php
33.449 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
nav-menu.php
47.976 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
network.php
26.404 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
noop.php
1.121 KB
21 Sep 2023 5.27 AM
bravetechrwanda / bravetechrwanda
0644
options.php
4.145 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
plugin-install.php
38.125 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
plugin.php
91.095 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
post.php
80.332 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
privacy-tools.php
32.657 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
revision.php
16.239 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
schema.php
44.515 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
screen.php
6.24 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
taxonomy.php
8.284 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
template.php
97.348 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
theme-install.php
6.826 KB
27 Feb 2024 1.35 AM
bravetechrwanda / bravetechrwanda
0644
theme.php
46.419 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
translation-install.php
10.815 KB
11 Sep 2024 4.08 PM
bravetechrwanda / bravetechrwanda
0644
update-core.php
71.065 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
update.php
34.027 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
upgrade.php
113.958 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
user.php
23.389 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
widgets.php
10.299 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF Static GIF