Support » Fixing WordPress » ?action=” URLS

  • Looking for a page listing ALL the “Default” “?action=” url’s.
    Like:
    /wp-login.php?action=register
    /wp-login.php?action=login

    Im sure there are a lot more.

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    I’ve never seen such a page anywhere. Look through the source code of the page you are interested in. In most cases every possible action is a case option in the page’s overall switch/case structure. If you search for all occurrences of “case” on the page, you can compile all the possible action parameters.

    Or maybe even better, pages often include a validation function that lists all possible action parameters in a single array declaration. For example, on wp-login.php, the actions are validated on line 391 (v4.8.1). I’m not sure such validation occurs on all such pages, but if you can find it it’s your easiest option. Overall, searching for “case” is more reliable but more tedious. I’ve not seen any action selection code that does not involve switch/case, but the possibility exists.

    Maybe the biggest challenge is determining all the files that take action parameters. Try grepping the WP folders for “switch”. You’ll get some false positives, but at least it narrows down the possibilities.

    If you do manage to compile all of these, perhaps you should post your findings online somewhere 🙂

    Well Thank you BcWorkZ. I understood nothing you said, probably should of posted in a more new-comer-ish forum.

    Im only aware of a few of these Urls from seeing them (/?action=) surfing WordPress pages. I’m referring to default WordPress Urls, not specific to some Theme or Framework.

    /wp-login.php?action=register
    /wp-login.php?action=login
    /?action=category
    /?action=author

    And Im not completely sure I have the syntax correct.

    Thanks

    Moderator bcworkz

    (@bcworkz)

    The action parameters that do not involve a file name ( example.com/?action=author ) would relate to a theme or plugin. WP core parameters are WP_Query arguments like /?page_id=1234. WP core only uses ?action= in the back end AFAIK, so always associated with a particular PHP file. For back end action parameters, look at the file that is being requested, like wp-login.php.

    It’s all PHP code, but it won’t bite 🙂 You don’t need to know PHP coding, only what to look for. Just don’t change anything! Hard to find, but all action info is in a line that’s something like this. It’s basically saying “If the action parameter is not one of these in an array, assume it’s ?action=login“. Thus you get all possible parameters for this file in one spot.

    It may be such a line does not exist or cannot be found. Then search for all occurrences of “case”. You’ll find lines like this. This very likely means a valid action parameter is “logout”. Keep collecting all such data through out the file. You will find other non-applicable occurrences of “case” (maybe like “lowercase”), only ones that start the line (maybe after some whitespace) and end in a colon are valid for action parameters. It may be there are other switch/case structures that do not apply to actions. Verify by searching backwards from “case” for “switch”, you’ll find something like this. The switch argument $action should be a good indication of what all the cases are for.

    Try searching /wp-admin/edit.php for action parameters. It’s not exactly like wp-login.php, but it’s the same concept. You need to be prepared for minor variations. See if you can find the validation line 🙂 Don’t feel bad if you cannot, finding occurrences of “case” is the most reliable approach.

    I hope the example references helps this all make more sense, I don’t know how to make this any simpler. I realize it sounds hopelessly complicated, but I think once you work through a couple examples you’ll find it really isn’t so complicated, just tedious.

    • This reply was modified 11 months, 2 weeks ago by  bcworkz. Reason: add ref highlights
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘?action=” URLS’ is closed to new replies.