Debugging raw php code from a WordPress site after updates

  • Unknown's avatar

    I need to debug some errors and formatting within a professional wordpress site. I need to do the debugging from the raw code. It is mostly php and JS. I have ended up with more than 2million lines of code after the most recent update. There are some empty box space on the home page and a list of bugs from the WP_DEBUG log.

    This is my first time working with WordPress at all. I am overwhelmed by the amount of code, and can’t figure out where any of the bugs and issues are. I have worked with Angular Typescript in the past.

    I would assume, to an extent, that some of these issues would be able to be fixed within the ‘drag and drop’ API of wordpress, but I have no idea how to use that either, when there is an already several million lined website code, and like I said, I was given the raw php code of over 2 mil lines to debug with.

    I have been using VS code for the editor and MAMP as a live server.

    I have no idea where to start, and I have not been able to find any useful tutorials online. Any help is greatly appreciated. I could really just use some guidance on how this process might work. Or if it even is something that people do, ever. It looks like according to the internet, this may not be the way to go about debugging. Feel free to ask questions I’ll try to answer anything I can without giving away any confidential info.

    Here are the bugs that show up on the site from WP_Debug:

    Warning: preg_match(): No ending delimiter ‘*’ found in C:reposwebsitewp-contentmu-pluginsno-cache.php on line 8
    Warning: preg_match(): Empty regular expression in C:reposwebsitewp-contentmu-pluginsno-cache.php on line 8
    Notice: Trying to get property ‘Location’ of non-object in C:reposwebsitewp-contentthemesChild-Themefunctions.php on line 45
    Notice: Trying to get property ‘Subrole’ of non-object in C:reposwebsitewp-contentthemesChild-Themefunctions.php on line 46

    Update: I am still having issues with these same errors. I am looking for assistance on how the process of debugging raw WP php code works, and if I am trying the right things. I can provide the code that a few errors are pointing to, but I do have to adjust the variables to maintain confidentiality.

    Child-Themefunctions.php (35-50):

    if(class_exists(RoleListRoleList::class)) {
    wp_localize_script(‘site-name’, ‘SiteName’, [
    ‘RoleList’ => [
    ‘categories’ => $role_categories,
    ‘locations’ => RoleListCategories::getLocations(),
    ‘category_counts’ => RoleListListings::getCategoryCounts(),
    ],
    ‘CurrentRole’ => [
    ‘is_role_page’ => ($listing ? true : false),
    ‘current_category’ => ($current_category ? $current_category : null),
    ‘current_location’ => ($listing->Location ? $listing->Location : null),
    ‘current_subrole’ => ($listing->Subrole ? $listing->Subrole : null),
    ‘home_url’ => home_url(),
    ]
    ]);
    }

  • Hi there,

    You should be posting this in the WordPress.org forums:

    https://wordpress.org/support/forums/

    The forum you have posted is for the WordPress.com hosting platform which is different than the WordPress software that your site is using. You can learn more about these differences here:

    WordPress.com vs. WordPress.org

  • The topic ‘Debugging raw php code from a WordPress site after updates’ is closed to new replies.