autotutorial
Forum Replies Created
-
we are discussing the return of the value if $gmt is true.
At the moment if $gmt is false, an offset is added that does not take into account I could use a time zone instead of an offset.function current_time( $type, $gmt = 0 ) { switch ( $type ) { case 'mysql': return ( $gmt ) ? gmdate( 'Y-m-d H:i:s' ) : gmdate( 'Y-m-d H:i:s', ( time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) ); case 'timestamp': return ( $gmt ) ? time() : time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ); default: return ( $gmt ) ? date( $type ) : date( $type, time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ); } }If $gmt is true, return
gmdate( 'Y-m-d H:i:s' );for mysql , return time() for timestamp, returndate($type); //PHP codefor all other cases
For debug create test.php<?php date_default_timezone_set('UTC'); $var = array(); $var[0] = time(); $var[1] = gmdate( 'Y-m-d H:i:s' ); $var[2] = date( 'Y-m-d H:i:s',$var[0] ); var_dump($var);From WordPress 5.3 change Datetime https://developer.wordpress.org/reference/functions/current_time/
function current_time( $type, $gmt = 0 ) { // Don't use non-GMT timestamp, unless you know the difference and really need to. if ( 'timestamp' === $type || 'U' === $type ) { return $gmt ? time() : time() + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ); } if ( 'mysql' === $type ) { $type = 'Y-m-d H:i:s'; } $timezone = $gmt ? new DateTimeZone( 'UTC' ) : wp_timezone(); $datetime = new DateTime( 'now', $timezone ); return $datetime->format( $type ); }the function
get_option( 'gmt_offset' )wrong does not consider and transform the string offset into an integer type.
get_option( 'timezone_string' )
means WordPress allows you to set the time zone from a string or an offeset, but if it is string it does not calculate the string offset.
Bad code:return $gmt ? time() : time() + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS );@umchal
If $gmt is set to either '1' or 'true', then both types will use GMT time.
Default to false or 0 apply get_option(‘gmt_offeset’) Dashboard setting.
If you useget_option('timezone_string') get_option('gmt_offset')is 0.Forum: Fixing WordPress
In reply to: Problem with WordPress updatesskip bundle themes and plugins
into wp-config.php
define('CORE_UPGRADE_SKIP_NEW_BUNDLED',false);
Defaul theme for your Local installaction of default-constants.php https://github.com/WordPress/WordPress/blob/5.3-branch/wp-includes/default-constants.php#L406it is practical to obfuscate the source code, but let’s see if we can recover this code.
Add into (end loop) functions.php your theme or create nameplugin.php extra code for plugin:<?php /** * Plugin Name: autodebug * Plugin URI: http://www.mywebsite.com/my-first-plugin * Description: The very first plugin that I have ever created. * Version: 1.0 * Author: Your Name * Author URI: http://www.mywebsite.com */It functions.php or nameplugin.php
if(strpos(__FILE__,'uploadExternalImages.php')) { error_log(file_get_contents('/var/www/wordpress/wp-content/plugins/alidswoo/includes/adsw/update/uploadExternalImages.php',3,'/var/www/wordpress/file.txt'); }- This reply was modified 6 years, 5 months ago by autotutorial.
- This reply was modified 6 years, 5 months ago by Steven Stern (sterndata).
You can share line 0 var/www/wordpress/wp-content/plugins/alidswoo/includes/adsw/update/uploadExternalImages.php on line 0 ?
option httpchk HEAD / HTTP/1.1\r\nHost:localhost – Set the health check HAProxy uses to test if the web servers are still responding. If these fail to respond without error, the server is removed from HAProxy as one to load balance between. This sends a HEAD request with the HTTP/1.1 and Host header set, which might be needed if your web server uses virtualhosts to detect which site to send traffic to
https://serversforhackers.com/c/load-balancing-with-haproxy
__() this function have two parameter (For WordPress core) https://developer.wordpress.org/reference/functions/__/ https://github.com/WordPress/WordPress/blob/5.3-branch/wp-includes/l10n.php#L254
For header host is a bug on wordpress, you can report here https://core.trac.wordpress.org/ .
You’re using a commercial plugin so I have no way to check the plugin code. can you search with google where to request support for your plugin?
I am documenting for your proxy if I have news I am writing here.Sorry, I updated the code and how to use it, you can repeat.
Even if you don’t repeat my code there is a problem with the host field, is a http_host header sent?
Can I provide you with the code to add the host field?if(!isset($_SERVER['HTTP_HOST'])) { $_SERVER['HTTP_HOST'] = 'shop.wwolf.us'; }https://github.com/WordPress/WordPress/blob/5.3-branch/wp-includes/canonical.php#L62 line 62
- This reply was modified 6 years, 5 months ago by autotutorial.
elima test.log, execute the new indications.
if you entered my code in wp-content/wp-includes/canonical.php (line 531 for missing host) create a file in wp-content/wp-includes/test.log
Please report the contentelse { if(!function_exists('var_x_error_log')) { function var_x_error_log( $objectauto=null){ ob_start(); // start buffer capture var_dump($objectauto); // dump the value $contentsauto = ob_get_contents(); // put the buffer into a variable ob_end_clean(); // end capture error_log( $contentsauto,3,dirname(__FILE__).'/test.log'); // log contents of the result of var_dump( $objectauto) } var_x_error_log($original); } }Sorry for this issue.
@acurran It has two options, backup your files and database and manually update your files without deleting the wp-content and wp-config.php Upgrading-extended or test Gutenberg 5.3 (WordPress 5.2).
Does it work for you?Forum: Fixing WordPress
In reply to: Some Images Broken Immediately After Publishing Post@jmart1987 Site Accelerator by Jetpack, https://jetpack.com/support/site-accelerator/
If the image takes more than 10 seconds to load to the jetpack server, it may look like an interrupted image.
https://wordpress.org/support/plugin/jetpack/
open a new topic, to see if the problem is in their part because they have tools to check the time when the file was created.
That’s why I asked the path of your interrupted image, otherwise if you don’t know the origin you can’t look for the cause.Forum: Fixing WordPress
In reply to: Some Images Broken Immediately After Publishing Postif the cache is not your problem, it is not possible to offer support if you do not know how to paste a broken image link on the forum. (just click on the gray minitura and it tells you the path or with the mouse you pass over the broken image and copy the path)
Forum: Fixing WordPress
In reply to: Gutenberg Controls Working But Show As Blankcan you try installing Gutenberg from version 6.6 to version 7.0 if you have solved the problem? https://wordpress.org/plugins/gutenberg/advanced/
Forum: Fixing WordPress
In reply to: Some Images Broken Immediately After Publishing Postyou can access the link, but probably the image is on a non-existent path.
Can you share broken image paths?
what should be the right path?
clear your CDN cache,
plugin, browser.