• Resolved jasonbear

    (@jasonbear)


    Wow, I am totally stumped and frustrated, guys! OK, so here’s what happened . . . .

    I was trying to figure out how to make the WordPress admin bar/toolbar display on the “Theme Customizer” page/view. Someone suggested that I could try adding the following line of code to my “/wp-admin/customize.php” file, so I did:

    add_filter('show_admin_bar', '__return_true');

    Well, not only did it not work, it has seemingly irreparably broken the Theme Customizer functionality altogether. Now, when I try to load a Theme Customizer page (for example, /wp-admin/customize.php?et_customizer_option_set=theme), the page is entirely blank/white, except for this entirely unhelpful error message:

    [an error occurred while processing this directive]

    I have tried all of the following “fixes” (in order), to no avail:

    1. reverted the “/wp-admin/customize.php” file to its previous state;
    2. restored the theme from backup;
    3. restored the database from backup;
    4. restored all uploads from backup;
    5. disabled all plugins;
    6. re-installed WordPress core (4.1.8);
    7. checked on the .htaccess file, which was not modified.

    Nothing works. How could one line of code in “/wp-admin/customize.php” — a line that has since been 100% reverted — cause this sort of damage? What am I missing? (I noticed that no files in the /wp-admin/ or /wp-includes/ folders were modified when I reinstalled WordPress core.)

    Thank you very much in advance!

    Jason

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator t-p

    (@t-p)

    – As the adage goes, don’t modify core files (unless you know what you are doing in there and are aware of the limitations and drawbacks this imposes). Modifications can cause security risks, performance degradation, broken plugins/themes, you will lose all changes when you next update the WordPress, etc.
    – Therefore, if there are no hook present in a function you want to modify, it’s better to copy the function you need and change it in your Child Theme or plugin, rather than modifying the core files directly.

    Back to your issue at hand, download a fresh copy of the WordPress, unzip it, and use that to copy up this file.

    If that does not work, try:
    Flushing any caching plugins you might be running, as well as server and/or browser caches. Not just your browser, but any op cache or content network cache as well such as Cloudflare. If you are using SiteLock, manage your caching there.
    Flushing Managed host caches. Managed WP hosting often has special caches. If your host has a “Purge Varnish” or “Flush Memcache” tool, try that. You can ask your provider to flush memcache and Varnish for you if necessary.

    Thread Starter jasonbear

    (@jasonbear)

    Thanks for the tips. I can’t believe that I forgot to mention my caching situation. Here’s what I did, in order:

    1. cleared and disabled my caching plugin (Comet Cache Pro);
    2. cleared and disabled my browser’s cache;
    3. cleared and disabled my browser’s cookies;
    4. restarted my browser (Safari 9.1.3 for Mac).

    Also, the site is running on a shared server at BlueHost (not any sort of managed WP hosting), so there is no server caching of which I am aware. The site is not using CloudFlare or SiteLock.

    As you suggested, I downloaded WordPress 4.8.1, unzipped it, and replaced the “/wp-admin/customize.php” file. Still no luck.

    I have been using WordPress for many years on many sites, and never experienced this problem. I know all about the limitations and drawbacks of altering core files, which is why I had not modified a single core file in the site prior to today’s little experiment. I added a single line of code and then immediately reverted the change once I saw the error message on the Web page. Once I reverted the change, that should have fixed the problem. Under no circumstances should that result in the situation that I am experiencing. Something is very different about this problem.

    • This reply was modified 7 years, 6 months ago by jasonbear.
    • This reply was modified 7 years, 6 months ago by jasonbear.

    @jasonbear,

    I’m right there with you in finding it hard to believe this problem would persist like this after reverting your changes. I’m thinking there’s got to be some more caching somewhere. BlueHost packages SiteLock’s technology into some hosting plans, so you may be using SiteLock without paying for it. I also believe that BlueHost utilizes additional caching mechanisms on many shared hosting platforms. Your best next steps here would probably be to just reach out to the BlueHost folks with the goal of dumping any and all current caches. If you continue to have the issue, I’ve got some tricks up my sleeve but I’d need to know the domain name in order to explore the issue. If you’d like me to take a look at this through the lens of SiteLock, my email is just my first name at SiteLock.

    Moderator t-p

    (@t-p)

    As @logankipp suggested above, try discussing this issue with the host.

    I have also added “BlueHost” to the tags below.

    Thread Starter jasonbear

    (@jasonbear)

    OK, guys, problem solved.

    I contacted BlueHost. I gave the technician the URL to this page. After trying a few fruitless fixes about which he provided no detail, he reset all file permissions. THAT fixed the problem.

    Unfortunately, he was not able to pinpoint which file somehow came to have incorrect permissions, but I’m going to assume that it was the “/wp-admin/customize.php” file and/or the “/wp-admin/” folder. He was not able to explain why or how file permissions would/could change by me simply adding and then reverting a single line of code to the “/wp-admin/customize.php” file (since I neither edited the permissions settings nor replaced/overwrote the file), but at least the problem is solved and I now know that it was a permissions issue.

    Thanks for your help, guys, and I hope that this information helps others in the future.

    Jason

    Moderator t-p

    (@t-p)

    Glad to know it ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Help, I broke the “Theme Customizer” (/wp-admin/customize.php)!’ is closed to new replies.