/home/techb158/public_html/wp-admin
NameSizeModeActions
css/-0777rm
images/-0777rm
includes/-0777rm
js/-0777rm
maint/-0777rm
network/-0777rm
user/-0777rm
about.php164850666editdlrm
admin-ajax.php51460666editdlrm
admin-footer.php28040666editdlrm
admin-functions.php4720666editdlrm
admin-header.php92840666editdlrm
admin-post.php20210666editdlrm
admin.php129350666editdlrm
async-upload.php56040666editdlrm
authorize-application.php103350666editdlrm
comment.php116430666editdlrm
contribute.php56560666editdlrm
credits.php41410666editdlrm
custom-background.php4820666editdlrm
custom-header.php4920666editdlrm
customize.php115860666editdlrm
edit-comments.php144840666editdlrm
edit-form-advanced.php294810666editdlrm
edit-form-blocks.php155280666editdlrm
edit-form-comment.php139800666editdlrm
edit-link-form.php63470666editdlrm
edit-tag-form.php106580666editdlrm
edit-tags.php225100666editdlrm
edit.php199520666editdlrm
erase-personal-data.php75050666editdlrm
export-personal-data.php79400666editdlrm
export.php112650666editdlrm
font-library.php14800666editdlrm
freedoms.php45740666editdlrm
import.php77660666editdlrm
index.php10880444editdlrm
install-helper.php69610666editdlrm
install.php183750666editdlrm
kwa.txt10644editdlrm
link-add.php9340666editdlrm
link-manager.php43610666editdlrm
link-parse-opml.php27210666editdlrm
link.php29570666editdlrm
load-scripts.php20700666editdlrm
load-styles.php29950666editdlrm
media-new.php32490666editdlrm
media-upload.php36680666editdlrm
media.php8190666editdlrm
menu-header.php100520666editdlrm
menu.php181340666editdlrm
moderation.php3070666editdlrm
ms-admin.php1960666editdlrm
ms-delete-site.php46130666editdlrm
ms-edit.php2160666editdlrm
ms-options.php2290666editdlrm
ms-sites.php2150666editdlrm
ms-themes.php2170666editdlrm
ms-upgrade-network.php2190666editdlrm
ms-users.php2150666editdlrm
my-sites.php48310666editdlrm
nav-menus.php501990666editdlrm
network.php55230666editdlrm
options-connectors.php15430666editdlrm
options-discussion.php164030666editdlrm
options-general.php228550666editdlrm
options-head.php6140666editdlrm
options-media.php66400666editdlrm
options-permalink.php224910666editdlrm
options-privacy.php107040666editdlrm
options-reading.php101980666editdlrm
options-writing.php94040666editdlrm
options.php142660666editdlrm
plugin-editor.php140710666editdlrm
plugin-install.php74330666editdlrm
plugins.php307440666editdlrm
post-new.php27680666editdlrm
post.php108210666editdlrm
press-this.php24700666editdlrm
privacy-policy-guide.php37560666editdlrm
privacy.php25120666editdlrm
profile.php2830666editdlrm
revision.php58360666editdlrm
setup-config.php179280666editdlrm
site-editor.php124830666editdlrm
site-health-info.php41730666editdlrm
site-health.php104270666editdlrm
term.php22490666editdlrm
theme-editor.php172790666editdlrm
theme-install.php243150666editdlrm
themes.php497280666editdlrm
tools.php35140666editdlrm
update-core.php462020666editdlrm
update.php130620666editdlrm
upgrade-functions.php3410666editdlrm
upgrade.php63900666editdlrm
upload.php152920666editdlrm
user-edit.php418440666editdlrm
user-new.php246640666editdlrm
users.php256980666editdlrm
widgets-form-blocks.php52350666editdlrm
widgets-form.php195880666editdlrm
widgets.php11120666editdlrm
Edit: /home/techb158/public_html/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; }