User reporting seeing old website, when new one has gone live - wordpress

I've recently put a new style live on: summerboardingcourses.co.uk
I've had report from one user that they are seeing the old website (with broken styles) on iPhone Safari browser from Poland (I am based in the UK). I can't replicate the issue, every VPN I use, or GeoLocation Screenshot tool I've used (e.g. localbrowser.com) the site is viewing correctly.
Has anyone ever had an issue like this before? I can't understand why they would be seeing the old site.
Any advice at all would be fantastic.
Thanks,
Meg

/* Return Last modified date or current date*/
function get_mod_time($file) {
if (file_exists($file)) {
return date("y.m.d-H", filemtime($file));
}
else {
return date('y.m.d-H');
}
}
/* Include style */
$css_file = get_template_directory_uri() . '/assets/css/style.css';
wp_enqueue_style( 'site-css', $css_file, array(), get_mod_time($css_file), 'all' );
Same think you can do for your custom JS files, you get last modified date as version name, that forces clear cache if file on server updated

Related

How to disable stylesheets in MS Edge without plugins

I tested a site for accessibility and I now have a QA validating that all of the changes were made. The QA needs to validate that the site is still readable with the stylesheets turned off. The QA can only use MS Edge and cannot install any plugins or browser extensions. Has anyone figured out how to turn off stylesheets? Googling this got me nowhere. When I evaluate the site, I use an extension in Chrome so I have never had this issue before.
Press F12 and copy this to console, hit enter
$('style,link[rel="stylesheet"]').remove()
Vanilla JS approach.
( [].slice.call( document.styleSheets ) ).map( function ( style ) {
var node = style.ownerNode;
node.parentNode.removeChild( node );
} );
ES6 Vanilla JS Version
[ ...document.styleSheets ].map( ( style ) => {
const node = style.ownerNode;
node.parentNode.removeChild( node );
} );

Wordpress upload media tool double iframe? How to fix?

I'm using the WordPress upload media tool within my plugin and there's unusual error that is going on, I get two iframes that overlap. I searched online and there's not much info out there, one that made most sense was that thickbox was included twice and that's causing the problem, but within my plugin code I have it included only once.
This is the code I'm using to open the window:
media-upload.php?type=image&TB_iframe=true&tab=library&width=640&height=640
and when I take of "TB_iframe=true" then I see the two iframes under each other, otherwise they overlap, only see double titles.
And this is the PHP code:
if (isset($_GET['page']) && ($_GET['page'] == 'add_images' || $_GET['page'] == 'add_slides')) {
add_action("admin_enqueue_scripts", "load_fixedly_media_upload_header");
}
function load_fixedly_media_upload_header() {
wp_enqueue_script('media-upload');
wp_enqueue_script('thickbox');
wp_register_script('my-fixedly-upload', WP_PLUGIN_URL . '/fixedly/scripts/admin.js', array('jquery','media-upload','thickbox'));
wp_enqueue_script('my-fixedly-upload');
wp_enqueue_style('thickbox');
}

Adding CSS stylesheet to pages based on route in OpenCart

I'm using opencart (version 1.5.1.3.1) for a client store, and am wondering what the best way to code it so I can have certain stylesheets added for certain routes.
For example, on my category page I'd like to have a different stylesheet to the default one, or one that will over ride the default styles with my custom sheet. I have use for this for more than one route obviously, and want to do this with as little edits required as possible, so as to reduce the amount of edits in the framework should I need to upgrade at any stage (and with opencart's well known random changes and bug fix releases this is quite probable)
Open catalog/controller/common/header.php
Right after the line protected function index() { on a new line put
$route = empty($this->request->get['route']) ? 'common/home' : $this->request->get['route'];
$css_file = str_replace('/', '_', $route) . '.css';
if(file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/stylesheet/' . $css_file)) {
$this->document->addStyle('catalog/view/theme/' . $this->config->get('config_template'). '/stylesheet/' . $css_file);
}
Then go to your current theme, and create a file in catalog/view/your-theme/stylesheet/ folder called product_category.css and put your styles in that. The stylesheets work off your route name except you replace the forward slash to an underscore followed by .css, ie common/home becomes common_home.css
Note that is is going to use the override method rather than replacing your default stylesheet

Wordpress - Images not showing up in the Media Library

I have a huge problem with my Wordpress. My uploaded images don't list in the Media Library.
It is weird tho, it says I have 75 images, but display none. Take a look yourself.
Even weirder, if I go into gallery (the images you uploaded in the page itself), the images list just fine.
I already tried deactivating all my plugins, didn't work. Cache can be easily put out of the question, because it happened on at least 4 different computers, with Macs, PCs, and navigating with Safari, Firefox and Chrome.
Another interesting fact is that if I upload the image directly trough the computer (with the "From Computer" tab), everything goes fine. Another website on the same server works just fine too. And just to add to the complexity, when I go to the media page in the Wordpress Admin, all images show up just fine.
Oh, and before I forget... applying any filters, or doing a research in the media will always come up with the same problem.
So there... that's where I'm at.
I had a same problem just now, with missing media library images for my blog. The images appeared to be right there in the media library and were definitely on the actual web server (checked via FTP).
As Allen Z advised I did "check Settings → Media and make sure that Uploading Files folder is set to wp-content/uploads"
Mine were set to the default blank. I altered this to an absolute path http://www.example.com/wp-content/uploads
THIS DIDNT SOLVE THE PROBLEM when I refreshed the site in browser. However, I immediately changed the path back to blank (the default setting again) and everything came back! Woop
Everyone having this problem might want to try this before getting into the more technical fixes!
it was your permalinks... you must have changed to labeled-name... switch back to default.
that worked for me.
Check Screen Options (dropdown tab in the upper right hand corner of the page), and make sure there are sane settings for what to show on screen. All the column settings should be checked, and there should be a positive number of media items being shown on screen.
If that is ok, then check Settings → Media and make sure that Uploading Files folder is set to wp-content/uploads.
I believe these are the only settings that can be changed from the administrative screens.
Here's something a guy on Wordpress forum showed us. Add the following to your functions.php file. (remember to create a backup of your functions.php first)
add_filter( 'wp_image_editors', 'change_graphic_lib' );
function change_graphic_lib($array) {
return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
}
...it was that simple.
Well, Seems like there was a bug when creating custom post types in the function.php file of the theme... which bugged that.
I had this problem with wordpress 3.8.1 and it turned out that my functions.php wasn't saved as utf-8. Re-saved it and it
I faced same issue on my wordpress site. After the lot of debugging i fixed my problem step by step like this.
First add given below code your db-config.php
define('SCRIPT_DEBUG', TRUE);
define('WP_DEBUG', TRUE);
define( 'WP_DEBUG_LOG', true );
Then goto /wp-includes/js/wp-util.js files and find the code $.ajax(
options ) on line number 100 insert given below code into your file
deferred.jqXHR = $.ajax( options ).done( function( response ) {
try {
response = JSON.parse(response);
} catch (Exception) {
response = response;
}
Please check your may be resolved.
if you Removed constant from db-config.php
define('SCRIPT_DEBUG', TRUE);
define('WP_DEBUG', TRUE);
define( 'WP_DEBUG_LOG', true );
Then compress your /wp-includes/js/wp-util.js file code and put your compressed code into /wp-includes/js/wp-util.min.js
*change your own risk if your update your wordpress version your changed may be lost.
Did you ever change the directory of your Wordpress install?
I had a problem with not finding my uploaded images after changing the Wordpress location on my server. In Wordpress, I went to Dashboard-> Settings -> Media and changed the uploads folder in the "Store uploads in this folder" field.
Considering the files were not uploaded via media uploader, they are present in the server but there's no reference to them in your database (in a little more detail).
In order to fix it, install the Media Sync plugin. Once it's active, under Media > Media Sync > Scan Files and select the files you want to import by click the checkbox next to them. Make sure also you untick the selectbox Dry Run (test without making database changes).
Then, when the time comes for you to be ready, just click "Import Selected" and you should see something like this
Once it is finished, you can visit Media > Library and you'll see all your imported files there.
How did you upload those images; via FTP or through WP uploader? You have to upload images THROUGH WP uploader in order to show them in the image library.
Ubuntu stores uploads in /var/lib/wordpress/wp-content/uploads . So what you need is to have this directory within your wordpress installation. Something like:
sudo ln -s /var/lib/wordpress/wp-content/uploads /var/www/www.mysite.com/wp-uploads
(replace mysite.com with your domain, the file should exist) should do the trick.
(Note that I've not tested this with multiple wordpress installations on one server.)
Further note that to make upload work at all (but this wasn't the question), you need to change Settings / Media / Store uploads in this folder to
wp-content/uploads
(no leading slash).
check .htaccess file in root of wordpress, maybe there is a rule for /uploads directory.
if so, remove it. but be careful and check which plugin did it, so disable the plugin, first.

WordPress + Easy FancyBox = d.onCleanup is not a function

Hi Guys I have a problem similar to this previous question but based on WordPress.
Everything was working fine, then the plugin has stopped to work! I am no more able to load my modal windows because the plugin is not able to load the CSS.
The fact is that I've tryed to unistall and install a brand new version of the plugin a coupple of times, but noting has changed, I still see this error:
d.onCleanup is not a function
from the file wp-content/plugins/easy-fancybox/fancybox/jquery.fancybox-1.3.4.pack.js?ver=1.3.4
Now I've seen that I sould check for the css file created by easy-fancybox.css.php and when I try what's is inside this file I've a 404 Nothing Found error, but the file is present inside my folder and I really don't understand why its behaving like that!
I've cheched permissions, copied a coupple of times but nothing solved my problem!
Someone has a clue on how to fix this issue?
If you wanna see the site follow this link and click on a thumbnail.
Thanks for the help!
Just add fancybox js and css like below.
add_action('init','jsregister');
function jsregister(){
wp_register_script( 'fb', WP_PLUGIN_URL.'/fancybox/fancy/jquery.fancybox-1.3.4.pack.js','jquery', false );
wp_enqueue_script( 'fb' );
wp_register_script( 'fbe', WP_PLUGIN_URL.'/fancybox/fancy/jquery.easing-1.3.pack.js','jquery', false );
wp_enqueue_script( 'fbe' );
wp_register_style('fbs', WP_PLUGIN_URL.'/fancybox/fancy/jquery.fancybox-1.3.4.css');
wp_enqueue_style( 'fbs');
}
I'm sure you're long past this, but as it came up for me, I'll present what worked for me, namely Turn off Super-cache or whatever cache type plugin you might have running (make sure the cache files are gone too.) Everything went back to normal for me after that.
It seems your WP installation in the site root catches the call to http://designonsale.info/wordpress/wp-content/plugins/easy-fancybox/easy-fancybox.css.php?ver=1.3.4 before it reaches the actual file.
Is there some .htaccess rule doing that maybe?

Resources