Forum Replies Created

Viewing 15 replies - 1 through 15 (of 79 total)
  • Thread Starter Valentin Bora

    (@valentinbora)

    Hello, Ahmed.

    Thank you for getting back to me. As a developer, I typically keep WP_DEBUG true, WP_DEBUG_DISPLAY false, and WP_DEBUG_LOG true.

    However, I understand the reasoning behind your approach, but was wondering if you could use a different constant at some point in the future, such as SCRIPT_DEBUG or maybe an option in your plugin settings.

    Have a lovely day ahead!

    Kind regards,
    Valentin

    @wrknight you can create a folder under wp-content called mu-plugins and add a file like wp-content/mu-plugins/my-custom-functions.php

    Within the file, add a header docblock to tell WordPress about the plugin and your code afterwards:

    <?php
    /*
    Plugin Name: My Custom Functions
    Description: Some description
    Version: 1.0.0
    */
    
    add_shortcode( 'custom_mailto_title', 'custom_mailto_title' );
    
    function custom_mailto_title( $atts ) {
        return esc_attr( get_the_title( get_the_ID() ) );
    }

    Make sure to avoid duplicating this code within theme functions.php and the plugin, or your site will fail with an error due to a duplicate function.

    These are called Must-Use Plugins and cannot be disabled within WordPress admin, so you can rely on them to always be available irrespective of the theme in use.

    Forum: Fixing WordPress
    In reply to: Admin Login issue

    @ukdigit could you take a look at the Error Logs on your cPanel and see if there’s anything interesting there?

    If not, I would consider trying to re-upload WordPress core files as follows:

    1. Download ZIP from https://downloads.www.ads-software.com/release/wordpress-5.3.2-no-content.zip and unzip on your local computer
    2. Connect to your site via FTP
    3. Upload and overwrite the folders wp-admin, wp-includes as well as the PHP files in the root of your public_html folder with files from the ZIP

    @pullenja you don’t seem to have the extension installed based on your grep output.

    So you’ve tried to set up the same domain on your cPanel, which is fine. I’m wondering why the live site went offline though. Do you have the same hosting provider as your client?

    Normally, if you add the same domain to your cPanel and the DNS servers configured at the registrar of the domain do not point to your server, the live site shouldn’t be affected.

    Do you intend to offer hosting to your client? It sounds like they already have their own hosting, so why not host it there?

    My personal approach would be the following:

    1. Set up a new database in the client’s cPanel (section MySQL Databases), then upload the database dump of your new development to the new database you’ve just created via phpMyAdmin
    2. Go to (s)FTP or File Manager, create a new folder next to the public_html folder (not inside it) called wordpress-new. Upload your new site’s files to the newly created folder
    3. Make sure the wp-config.php of your new site is properly set up with the new database username, password etc.
    4. Rename public_html to wordpress-old and wordpress-new to public_html
    5. The new site should be live now. Check functionality. If anything is broken and can’t be easily fixed, you can do the folder renaming backwards and restore the old site

    So basically don’t replace, but add next to the old and then switch.

    Please try setting up verbose logging on Apache’s side, maybe you’ll find out what actually determines the redirect.

    See https://stackoverflow.com/a/9632952

    I’ve taken a look at the HAR, thanks for that.

    So it looks like the upgrade from HTTP to HTTPS is initiated server-side, as the response of the initial request returns a 301 Moved Permanently which instructs the browser to re-fetch the resource via HTTPS.

    I don’t yet know what causes the redirect though.

    Let’s make sure this is a server-side thing.

    Open a new tab in Chrome, then open DevTools > Network. Toggle “Preserve Log” on. Then access your CSS resource URL and see the Network requests that happen, and their Response Headers. See if the Response Headers contain any Location header with a redirect, as well as the HTTP response code other than 200 OK (so a 301 or 302 maybe).

    Sorry, my previous comment doesn’t make sense given that you’ve tried to access a CSS resource directly, so that doesn’t run JS.

    How about if you go to view-source:https://localhost/devproject directly in Chrome?

    Just trying to rule out any weird idea, such as some JS code doing the SSL switch.

    I am pretty much out of ideas now, and I can’t think of anything that a Windows Update could’ve done to your setup.

    Could you maybe try checking with another browser?

    Are you able to access your server’s Error Log to see if you can learn anything?

    Your .htaccess looks “business as usual”, although your Permalinks are not “pretty URLs” so it’s essentially not going to do much until you change your settings in Settings > Permalinks in the Admin.

    So https://lrshull.com/wp-login.php works for me, but /wp-admin doesn’t. I am obviously not logged in.

    Please see if you can retrieve any logs.

    @jnashhawkins the listener I’ve mentioned is part of WP Core, in wp-embed.js and wp-embed-template.js. So they catch link clicks in the iframe and bubble it up to the parent frame via messaging, and then there’s the following that runs it:

    /* Only continue if link hostname matches iframe's hostname. */
    if ( targetURL.host === sourceURL.host ) {
    	if ( document.activeElement === source ) {
    		window.top.location.href = data.value;
    	}
    }

    That’s why I am suspicious of Cloudflare’s loader, although am not sure as I haven’t tested this specific scenario.

    Please edit your wp-config.php file in the root of your WordPress directory and turn on WP_DEBUG (see https://www.ads-software.com/support/article/debugging-in-wordpress/#wp_debug)

    Then try to access wp-admin and see what it says.

Viewing 15 replies - 1 through 15 (of 79 total)