WordPress DROP tables with prefix

Hi I am trying to drop some tables in bulk before creating them again for testing purposes.

I am trying to run this statement

dbDelta(       "SET GROUP_CONCAT_MAX_LEN=10000;       SET @tbls = (SELECT GROUP_CONCAT(TABLE_NAME)       FROM information_schema.TABLES       WHERE TABLE_SCHEMA = 'wp_test'       AND TABLE_NAME LIKE 'mch_%');       SET @delStmt = CONCAT('DROP TABLE ',  @tbls);       PREPARE stmt FROM @delStmt;       EXECUTE stmt;       DEALLOCATE PREPARE stmt;",       $  wpdb->prefix ) 

But nothing happens, my plugin gets activated with no errors, but the tables are still there.

I am new to this stuff, so I would like to understand the proper way to do this.

6 random character prefix automatically added to entire DB tables, how / why?

I’m working on a site, live on server. I’m using Navicat for working with the DB. I have the WP DB opened and am 100% sure the tables were just standard tables, using standard wp_ prefix.

While I’m working on another screen in admin area, I needed some user-meta info, I refresh the already opened DB.. and suddenly ALL tables have 6 random character prefix automatically added to entire DB tables!

So now instead of having one table.. wp_usermeta
I now have.. aojsfj_wp_usermeta

Now, opening for example aojsfj_wp_usermeta is not a list of users, it’s just ONE user’s meta. So now the DB has created all separate tables per the few (7) test user accounts, prefixing them with 6 random characters.

Can someone enlighten me on why / how this has happened? So far everything still seems to be working, but the DB + all these new tables can’t be good!

Pre-Fix Order Numbers by User Role

I currently have orders set with the pre-fix "W" for Wholesale orders to differentiate them from Retail orders. However, we have a few different wholesale roles and I would like to be able to differentiate those orders with a pre-fix as well. Is there a way to code a special pre-fix based on user role? The role in particular would be for a wholesale role labeled as employee. Since Employee falls under the Wholesale Role, it is getting the W prefix to their orders. I would like all other wholesale orders to have the W prefix, Employee orders to have an E prefix, and all retail orders to have no prefix (remain as-is).

Here is the snippet that works for wholesale orders to have the W prefix:

add_filter( 'woocommerce_order_number', 'change_woocommerce_order_number' ); function change_woocommerce_order_number( $  order_id ) {       $  prefix = 'W'; //The Prefix      $  order_type = get_post_meta( $  order_id, '_wwpp_order_type',true); //get Wholesale Order Type           if ($  order_type == 'wholesale') {         $  new_order_id = $  prefix . $  order_id;         return $  new_order_id;     }           return $  order_id; } 

How to add a prefix to a WordPress post preview url?

I need to remove any query parameters from the WordPress post preview URL.

I need to access https://www.domain.com/prefix/12345 and see the same post preview I would see on https://www.domain.com/?p=12345&preview=true

It can not redirect, the URL in the browser must still be https://www.domain.com/prefix/12345

As an alternative, adding a prefix to the original WordPress post preview url would also be enough: https://www.domain.com/previx/?p=12345&preview=true

How can I achieve one of these without changing the URLs of the published posts?

The motivations is that I need a URL with a prefix to create a bypass rule on CloudFlare Workers.

Is there a way to determine whether a list of integers can be a prefix function?

Say you had

(0,0,0,1,2,3,4,5,6,7,8,9,10)

or

(0,1,0,1,0,1,2,3,0,1,0,0,1)

Could you use, for example, the KMP algorithm to deduce the validity of the above lists as prefix functions? I know there is a way to find whether a substring exists in a string using KMP, but is there a way to do it the other way around, starting at the apparent prefix function and ascertaining that it is indeed a possible prefix function, without knowing the string/substring itself at the start?

Is grammar that describes an equation in prefix (Polish) notation always unambiguous?

I recently completed a problem in which I was asked to generate a parse tree for the expression $ + \, 5 \, * \, 4 \, 3$ using the following grammar and rightmost derivation:

$ $ Expr \rightarrow + \, Expr \, Expr \, | \, * \, Expr \, Expr \, | \, 0 \, | \, \dots \, | \, 9 \,$ $

While I have no trouble taking the derivation and creating its parse tree, the question also asks whether the grammar is ambiguous. In the scope of what I’ve been taught, my only tool for proving ambiguity has been to find a different parse tree for whatever leftmost or rightmost derivation I have, thus proving multiple valid parses and ambiguity. However, I have not been told how to prove unambiguity. I am fairly confident that the grammar described above is unambiguous based partially on intuition, and partially because it’s designed for prefix notation. I tried to generate new trees for a given string to prove ambiguity, but since the operator is always leftmost, I could not find any string in which multiple parse trees could be created. If I am mistaken, please let me know.

My question is this: Is it possible for grammar that describes strings using prefix (Polish) notation such as the one above to ever be ambiguous? My intuition tells me that it will always be unambiguous, but I was wondering why this might be the case.

Exploiting LFI with prefix

I have a scenario as the following:

<?php  include("resource/" + $  _GET['vuln']); ?> 

And I’m trying to get RCE from this, or atleast acquire some interesting information.

I already looked at /etc/passwd and other important files, are there things I can do to bypass the resource/ prefix? (since it disables me from using php:// filters)