/var/www/p4ela.net/www/wp-admin
NameSizeModeActions
css/-0777rm
images/-0777rm
includes/-0777rm
js/-0777rm
maint/-0777rm
network/-0777rm
user/-0777rm
about.php197230666editdlrm
admin-ajax.php51460666editdlrm
admin-footer.php28340666editdlrm
admin-functions.php4060666editdlrm
admin-header.php90750666editdlrm
admin-post.php20700666editdlrm
admin.php125650666editdlrm
async-upload.php48560666editdlrm
authorize-application.php103350666editdlrm
comment.php116220666editdlrm
contribute.php57270666editdlrm
credits.php38410666editdlrm
custom-background.php4160666editdlrm
custom-header.php4260666editdlrm
customize.php111260666editdlrm
edit-comments.php147260666editdlrm
edit-form-advanced.php295500666editdlrm
edit-form-blocks.php132690666editdlrm
edit-form-comment.php85440666editdlrm
edit-link-form.php63620666editdlrm
edit-tag-form.php106950666editdlrm
edit-tags.php225330666editdlrm
edit.php199520666editdlrm
erase-personal-data.php75050666editdlrm
export-personal-data.php79410666editdlrm
export.php112880666editdlrm
freedoms.php46040666editdlrm
import.php76570666editdlrm
index.php78640666editdlrm
install-helper.php69610666editdlrm
install.php175090666editdlrm
link-add.php9380666editdlrm
link-manager.php43650666editdlrm
link-parse-opml.php26970666editdlrm
link.php29570666editdlrm
load-scripts.php20700666editdlrm
load-styles.php29950666editdlrm
media-new.php32610666editdlrm
media-upload.php35690666editdlrm
media.php8190666editdlrm
menu-header.php100690666editdlrm
menu.php170730666editdlrm
moderation.php3070666editdlrm
ms-admin.php1960666editdlrm
ms-delete-site.php42940666editdlrm
ms-edit.php2160666editdlrm
ms-options.php2290666editdlrm
ms-sites.php2150666editdlrm
ms-themes.php2170666editdlrm
ms-upgrade-network.php2190666editdlrm
ms-users.php2150666editdlrm
my-sites.php48580666editdlrm
nav-menus.php492750666editdlrm
network.php55220666editdlrm
options-discussion.php157660666editdlrm
options-general.php220300666editdlrm
options-head.php5480666editdlrm
options-media.php65050666editdlrm
options-permalink.php217180666editdlrm
options-privacy.php101900666editdlrm
options-reading.php102660666editdlrm
options-writing.php93170666editdlrm
options.php137680666editdlrm
plugin-editor.php137370666editdlrm
plugin-install.php71240666editdlrm
plugins.php307320666editdlrm
post-new.php27680666editdlrm
post.php102090666editdlrm
press-this.php23960666editdlrm
privacy-policy-guide.php37560666editdlrm
privacy.php25420666editdlrm
profile.php2830666editdlrm
revision.php58510666editdlrm
setup-config.php179030666editdlrm
site-editor.php72170666editdlrm
site-health-info.php40840666editdlrm
site-health.php104430666editdlrm
term.php22490666editdlrm
theme-editor.php157920666editdlrm
theme-install.php239300666editdlrm
themes.php480780666editdlrm
tools.php35140666editdlrm
update-core.php465190666editdlrm
update.php130920666editdlrm
upgrade-functions.php3410666editdlrm
upgrade.php57070666editdlrm
upload.php152070666editdlrm
user-edit.php405510666editdlrm
user-new.php245460666editdlrm
users.php238530666editdlrm
widgets-form-blocks.php50860666editdlrm
widgets-form.php196250666editdlrm
widgets.php11120666editdlrm
Edit: /var/www/p4ela.net/www/wp-admin/install-helper.php (6961B)
comments, 'comment_author', 'tinytext' ) ) { * echo "ok\n"; * } * * // Check the column. * if ( ! check_column( $wpdb->links, 'link_description', 'varchar( 255 )' ) ) { * $ddl = "ALTER TABLE $wpdb->links MODIFY COLUMN link_description varchar(255) NOT NULL DEFAULT '' "; * $q = $wpdb->query( $ddl ); * } * * $error_count = 0; * $tablename = $wpdb->links; * * if ( check_column( $wpdb->links, 'link_description', 'varchar( 255 )' ) ) { * $res .= $tablename . ' - ok
'; * } else { * $res .= 'There was a problem with ' . $tablename . '
'; * ++$error_count; * } * * @package WordPress * @subpackage Plugin */ /** Load WordPress Bootstrap */ require_once dirname( __DIR__ ) . '/wp-load.php'; if ( ! function_exists( 'maybe_create_table' ) ) : /** * Creates a table in the database if it doesn't already exist. * * @since 1.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $table_name Database table name. * @param string $create_ddl SQL statement to create table. * @return bool True on success or if the table already exists. False on failure. */ function maybe_create_table( $table_name, $create_ddl ) { global $wpdb; foreach ( $wpdb->get_col( 'SHOW TABLES', 0 ) as $table ) { if ( $table === $table_name ) { return true; } } // Didn't find it, so try to create it. // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query. $wpdb->query( $create_ddl ); // We cannot directly tell whether this succeeded! foreach ( $wpdb->get_col( 'SHOW TABLES', 0 ) as $table ) { if ( $table === $table_name ) { return true; } } return false; } endif; if ( ! function_exists( 'maybe_add_column' ) ) : /** * Adds column to database table, if it doesn't already exist. * * @since 1.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $table_name Database table name. * @param string $column_name Table column name. * @param string $create_ddl SQL statement to add column. * @return bool True on success or if the column already exists. False on failure. */ function maybe_add_column( $table_name, $column_name, $create_ddl ) { global $wpdb; // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Cannot be prepared. Fetches columns for table names. foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) { if ( $column === $column_name ) { return true; } } // Didn't find it, so try to create it. // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query. $wpdb->query( $create_ddl ); // We cannot directly tell whether this succeeded! // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Cannot be prepared. Fetches columns for table names. foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) { if ( $column === $column_name ) { return true; } } return false; } endif; /** * Drops column from database table, if it exists. * * @since 1.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $table_name Database table name. * @param string $column_name Table column name. * @param string $drop_ddl SQL statement to drop column. * @return bool True on success or if the column doesn't exist. False on failure. */ function maybe_drop_column( $table_name, $column_name, $drop_ddl ) { global $wpdb; // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Cannot be prepared. Fetches columns for table names. foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) { if ( $column === $column_name ) { // Found it, so try to drop it. // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query. $wpdb->query( $drop_ddl ); // We cannot directly tell whether this succeeded! // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Cannot be prepared. Fetches columns for table names. foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) { if ( $column === $column_name ) { return false; } } } } // Else didn't find it. return true; } /** * Checks that database table column matches the criteria. * * Uses the SQL DESC for retrieving the table info for the column. It will help * understand the parameters, if you do more research on what column information * is returned by the SQL statement. Pass in null to skip checking that criteria. * * Column names returned from DESC table are case sensitive and are as listed: * * - Field * - Type * - Null * - Key * - Default * - Extra * * @since 1.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $table_name Database table name. * @param string $col_name Table column name. * @param string $col_type Table column type. * @param bool $is_null Optional. Check is null. * @param mixed $key Optional. Key info. * @param mixed $default_value Optional. Default value. * @param mixed $extra Optional. Extra value. * @return bool True, if matches. False, if not matching. */ function check_column( $table_name, $col_name, $col_type, $is_null = null, $key = null, $default_value = null, $extra = null ) { global $wpdb; $diffs = 0; // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Cannot be prepared. Fetches columns for table names. $results = $wpdb->get_results( "DESC $table_name" ); foreach ( $results as $row ) { if ( $row->Field === $col_name ) { // Got our column, check the params. if ( ( null !== $col_type ) && ( $row->Type !== $col_type ) ) { ++$diffs; } if ( ( null !== $is_null ) && ( $row->Null !== $is_null ) ) { ++$diffs; } if ( ( null !== $key ) && ( $row->Key !== $key ) ) { ++$diffs; } if ( ( null !== $default_value ) && ( $row->Default !== $default_value ) ) { ++$diffs; } if ( ( null !== $extra ) && ( $row->Extra !== $extra ) ) { ++$diffs; } if ( $diffs > 0 ) { return false; } return true; } // End if found our column. } return false; }