First click to blog title does not open the blog article

I notice when visiting my blog https://www.datanumen.com/blogs/ via iPhone. Sometimes the first click to the blog title, such as "11 methods to fix...", will not open the blog article. I need to click for the 2nd time, to be able to bring out the blog article. I have used Lamdatest real devices to make the tests, and below are the results: In Canada, Australia. The click will always bring out the article body. In US. The problem will occur, but …
Category: Web

I have cloudflare flexible enabled, How to redirect to https for Nginx server

If I access directly to https it works, but the site is still accessible by HTTP. How do I force all http to https? I have used WordPress HTTPS plugin. But it is not redirect to https. I have configured the nginx with following: server { listen xxx.x.xxx.xxx:80; listen 127.0.0.1:80; server_name mydomain.com; root /var/www/html/mydomian.com/; index index.html index.htm index.php; charset utf-8; location / { try_files $uri $uri/ /index.php?$args; rewrite ^(.*)$ https://$http_host$request_uri redirect; } ... But this redirection will leads to infinite …
Category: Web

WP Multisite - Additional subdomain on the site for API purposes

We have WP multisite network with WooCoomerce shops. All the network is served through Cloudflare CDN. Our ERP is accessing WooCommerce API of each website in the WP network. Since there so many, calls we are getting 503 from Cloudflare. It's not a server problem. It's a problem of too many requests to Cloudflare. So what I would like to have is a separated subdomain (example: api.domain.com) for each domain in the network. That subdomain will not be proxied thru …
Category: Web

No Query String vs Ignore Query String in WordPress

I use Cloudflare and there is an option of choosing Cache level. The following are the level of Caches available [check image]- I have selected Standard. Which one should I be using for better page loading? I am not a developer, so don't expect me to understand coding language.
Category: Web

How to stop Facebook mobile in-app browser cache on WordPress

we needed to create briefed posts and publish, then in a few hours we update the post content. post content gets updates on web and the end user can see the updated content. but if a user opens up the post in facebook via its in-app browser, then come back later to see the updated content, they will see the same post as before. if another user first checks the post after it has been updated, they will see the …
Category: Web

WordPress does not show correct page

Lately, my WordPress web tends to show a random page when an internal link is clicked. It currently does not show the home page as the root page. I can't find any system in this behavior. Sometimes, all internal links show the same page, sometimes a random page. Even internally, when I edit a page and click preview, a different page than the one I'm editing is displayed. Apparently, with cloudflare in developer mode, things work. So how do I …
Category: Web

On a multisite environment, get the subdomain value as variable

I'm trying to setup a multisite where everytime a new site is added, a DNS record is also added in Cloudflare. So far, the code is working but I'm having troubles trying to parse the subdomain value onto a variable. This is the code so far: function create_cloudflare_dns_record() { //$current_site = ''.$get_blog_details->siteurl.''; //$current_site = ''.$substr( $current_site, -8).''; //$current_site = ''.explode('.', $current_site).''; /* Cloudflare.com | APİv4 | Api Ayarları */ $apikey = '778***************************c37'; // Cloudflare Global API $email = 'al******@***********.com'; // …
Category: Web

CSP nonces with Cloudflare Workers

Like this blog, I use Cloudflare Workers to inject CSP (Content Security Policy) nonce in headers : https://scotthelme.co.uk/csp-nonces-the-easy-way-with-cloudflare-workers/ This is functional. Next, I need to inject the nonce into all script tags. I use this script (in functions.php) : add_filter( 'script_loader_tag', 'add_nonce_to_script', 10, 3 ); function add_nonce_to_script( $tag, $handle, $source ) { $search = "type='text/javascript'"; $replace = "type='text/javascript' nonce='<?= html_escape($cspNonce); ?>'"; $subject = $tag; $output = str_replace($search, $replace, $subject); return $output; } The result is not the expected one, I …
Category: Web

XMLRPC won't connect?

I am using the latest version of Wordpress and trying to run a simple PHP script to create a wordpress post but unfortunately it isn't working. I am using Cloudflare plus have a webhost that is providing an SSL certificate if it matters. There are no errors in the PHP logs and nothing unusual in the Cloudflare logs... I am very confused where this is breaking :( PHP script: $usr = 'ABCXYZ'; $pwd = 'ABCXYZ'; $xmlrpc = 'https://www.ABCXYZ.com/xmlrpc.php'; $client = …
Category: Web

How to add a prefix to a WordPress post preview url?

I need to remove any query parameters from the WordPress post preview URL. I need to access https://www.domain.com/prefix/12345 and see the same post preview I would see on https://www.domain.com/?p=12345&preview=true It can not redirect, the URL in the browser must still be https://www.domain.com/prefix/12345 As an alternative, adding a prefix to the original WordPress post preview url would also be enough: https://www.domain.com/previx/?p=12345&preview=true How can I achieve one of these without changing the URLs of the published posts? The motivations is that I …
Category: Web

Wrong URL in admin pagination when using CloudFlare Workers for Subdirectory

We implemented a cloudflare worker to serve our subdomain blog blog.domain.com via a subdirectory www.domain.com/blog it's done as described here https://blog.cloudflare.com/subdomains-vs-subdirectories-improved-seo-part-2/ We updated the site settings in WP and all works fine but the pagination in admin is still pointing to the original host which is blog.domain.com I see similar issues and questions being posted when using a proxy to serve the blog from a special directory, it seems to be no real solution other than modifying the WP core …
Category: Web

How to know if I have activated Cloudfare successfully?

I am using Siteground hosting and Cloudfare free CDN. On cloudfare website I get this - and on Siteground I get this - I have updated the CNAME records as asked, several times. Please guide me: Is CDN active? Is it correctly done? How to remove the error and do it correctly?
Category: Web

Error trying to publish immediately. Post status = future (Missed schedule error)

We have moved a to new server and now we can’t publish. At least, we can’t publish instantly. Maybe can be useful: we are using Plesk & CloudFlare. When we publish a new post, the post_status value in wp_posts table is, automatically, future instead of publish We have already taken a look at this post with no lucky: https://wordpress.org/support/topic/publish-immediately-missing-and-scheduled-posts-fails/ What we have already done is: Checked server time Everything OK into site health info Disabled all plugins & changed to …
Category: Web

Time out opening second page in same browser with long running page load

Scenario: 1. A wordpress site backend. 2. Chrome Tab #1: Open a wordpress backend example: /wp-admin/run-long-php-script/ which runs a long php script which will continue to load for a long time. 3. Chrome Tab #2: While tab #1 is running open another tab #2 on same Google browser and access any page from the same wp backend example: /wp-admin/edit.php 4. Chrome Tab #2 cannot load and will time out. It can only load properly when Chrome tab #1 php execution …
Category: Web

Using Cloudflare caching on wordpress with front-end user logins

I use Cloudflare heavily on all my sites. On https://pokerdiy.com I use the MyListings Theme which uses an AJAX login and Woo Commerce. The user never sees the default wordpress dashboards and control panels. I now have caching issues with logged in users - My theory is that Cloudflare cannot determine when a user is logged in or not, so it is displaying the cached anonymous logged out view. When I disable cloudflare the site works fine. Reading on Cloudflare …
Category: Web

My elementor is not opening in WordPress because of "cloudflare-static/rocket-loader.min.js"

In my WordPress website, I am using the Cloudflare and Elementor editor also but when I am trying to edit the page using the Elementor, my Elementor is not opening. I think it is because of the Cloudflare in my WordPress. Cloudflare has added the script in the head and also in the footer: <script src="https://ajax.cloudflare.com/cdn-cgi/scripts/95c75768/cloudflare-static/rocket-loader.min.js" data-cf-settings="9838dd25b616f37c8176faa3-|49"></script> So, How to exclude the script from WordPress? Added this in my functions.php add_filter( 'script_loader_tag', function ( $tag, $handle ) { if ( …
Category: Web

Fully caching Wordpress site by CDN (eg. Cloudflare)

Because of random high traffic on our website, for which even total cache is not good enough (~ 1000 req/s) we would like to put CDN in front of the whole site. Cloudflare CDN caching seems to do the job with following issues: Once a page is cached without admin menu bar, admins don't see the menu bar. Once a page is cached with admin menu bar (by admins), regular users see menu bar even though they shouldn't. This could …
Category: Web

wp-admin and wp-login.php not Accessible after Cloudflare

I have the following .htaccess rule to limit access to wp-admin and wp-login.php locally via SSH dynamic forwarding: Order Deny,Allow Deny from all Allow from 127.0.0.1 However, after installing Cloudflare I cannot access /wp-admin and wp-login.php anymore. Previously, I have the following lines in my access.log: 127.0.0.1 - - [20/Jun/2019:06:30:12 +0000] "POST /wp-admin/admin-ajax.php HTTP/1.1" 200 But now the IP was changed to cloudflare's: 162.158.166.167 - - [20/Jun/2019:09:42:51 +0000] "GET /wp-admin/ HTTP/1.1" 403 How can I solve this problem? Do I …
Category: Web

WP-Stateless: Multi Regional Vs Regional Storage

if I upload all wp-content/uploads to google cloud storage and serve from there directly(stateless), is there any point to create multi regional google cloud storage? Other than increasing unnecessary cost? My understanding: My nginx+php+wordpress webserver is in US-West1. Then, wp-stateless (stateless mode) will store in X region. ???> No matter where the web visitors are, it will always be a US-West1 server requesting image/object from X region? So, it would make sense to only make X regions = US-West1 and …
Category: Web

Finding which plugin uses cloudflare (due to GDPR)

after creating a wordpress homepage using quite a few existing plugins, due to the european GDPR (General Data Protection Regulation) i now have to limit the calls of any external resource to a minimum. Is there a good way to find out which plugin uses cloudflare ? Looking at the homepage direclty, the relevant code snippets are: <link rel="dns-prefetch" href="//cdnjs.cloudflare.com"> <link rel="stylesheet" id="jquery-ui-timepicker-addon-css-css" href="//cdnjs.cloudflare.com/ajax/libs/jquery-ui-timepicker-addon/1.6.3/jquery-ui-timepicker-addon.min.css?ver=4.9.6" type="text/css" media="all"> <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery-ui-timepicker-addon/1.6.3/jquery-ui-timepicker-addon.min.js?ver=4.9.6"></script> So its probably a plugin using the jquery-ui-timepicker. But i wonder …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.