PDF file randomly breaks upon upload on WordPress - php

The issue randomly started happening. When I upload a PDF file via the media library, it sometimes 'adds' random lines and graphics to the PDF file(or solid brown color), but sometimes it is okay.
WP core is updated to latest, plugins as well, php is running 7.3.
I wonder if it is ever Wordpress issue or a hosting issue.
What could be the reason?
here's the list of the plugins:
Abandoned Cart Lite for WooCommerce
Advanced Custom Fields PRO
Advanced Order Export For WooCommerce
Contact Form 7
LionScripts: IP Blocker Lite
Mouseflow for Wordpress
MultiLine files for Contact Form 7
NotificationX
Post SMTP
Really Simple SSL
SVG Support
WooCommerce
WooCommerce Order Status Control
WooCommerce Order Status Manager
WooCommerce Stripe Gateway
WP Cerber Security, Anti-spam & Malware Scan
WP-PageNavi
Yoast SEO Premium
Which one has a chance to be the problem?
here's what the broken PDF looks like(only one of the pages, other ones are fine actually:
Also, the XHR Request sometimes responds with JSON data, and sometimes the response is empty. This is all RANDOM, i.e. it happens on every 2nd or third upload(through the ACF File field), very weird bug.
EDIT: I have found it is not inserting _wp_attachment_metadata in the wp_postmeta table(it works only through media library, but not from the acf file field)
EDIT 2 : Just found out it breaks png and jpg images on upload too
EDIT 3 : It does the same thing on blank WP installation on the BASIC media upload

Related

Website not appearing as it is on mobile. How to solve this problem?

I am editing the home page of my website with the help of Elementor. On the home page, there is a headline in the left column and an image to==in the right column. The website is appearing correct on the desktop.
Dekstop view. Please see the image
But when I open the website on mobile, Tthe image should appear above the headline. But it is appearing beside the headline. Therefore the website looks ugly.
mobile view. Please see the image
I am using Astra Free Theme I am using the following plugins: A3 lazy load, wp asset cleanup, swift performance, Akismet, Elementor, essential addons for Elementor, GDPR consent, Ninja forms, Lite speed cache, user profile picture, My WordPress version is 5.6.1 My PHP version is 7.4
javascript
you should change the column width for text and the picture to 100%
if the picture went below the text.
in that case, select the whole section, then go to the "advanced" tab, in the responsive tab, select reverse columns for tablet and mobile.
let me know if there was any problem with that.

Modifying and Existing Drupal Theme

The theme I am using has a slider -- a panel of automatically changing images to display a topic that the user can choose -- but it only shows a few slides. I want to extend it to a dozen slides. I did simple text searches to determine which files in the theme are used code files to provide the functionality to the slider. That was the easy part. I was able to extend the code from the few slides to 12 slides.
Now comes the more difficult and hidden part. As I see it, each slide has two parts that are not hardcoded. First, each slide has a caption -- a text description. Secondly, each slide has a URL associated with it that is where the browser goes if the user clicks on the slide. These two things are not hardcoded in any of the PHP or other files, as far as I can tell. They can be edited by the admin in the Drupal backend admin settings.
So I assumed that these fields are somehow set and retained in the database. But I did a search on a downloaded copy of the database and I did not find this text.
Please advise. What additional work do I need to do to complete this task?
I suppose I could just forge ahead. Obviously, this data is being stored somewhere. Maybe they are stored in the database in an encrypted form for security reasons. I could do an FTP upload of the site theme files. But then what? Do I uninstall the theme and then reinstall it? Do I just deactivate it and then reactivate it? How do I make my code changes work?
The theme is called "impact_theme" and as far as I can tell all the code for it resides in
sites\all\themes\impact_theme
The README.txt file for the theme is:
About Impact Theme
====================
Impact Theme is a Drupal 7 theme. The theme is not dependent on any
core theme. Its very light weight for fast loading with modern look.
Simple and clean design
Drupal standards compliant
Implementation of a JS Slideshow
Multi-level drop-down menus
Footer with 4 regions
A total of 10 regions
Compatible and tested on IE7, IE8, IE9+, Opera, Firefox, Chrome browsers
Browser compatibility:
=====================
The theme has been tested on following browsers. IE7+, Firefox, Google Chrome, Opera.
Drupal compatibility:
=====================
This theme is compatible with Drupal 7.x.x
Developed by
============
www.devsaran.com
Slideshow photos by http://www.flickr.com/photos/68666702#N00/
Help and Support Us
=====================
Please consider a small donation
Paypal ID : donation#devsaran.com
============================================================================
I made a subtheme according to this page: https://www.drupal.org/docs/7/theming/creating-a-sub-theme.
I logged in to the Administrative Dashboard and I made the subtheme as the default theme.
And then the website immediately crashed and I am unable to see anything apart from "HTTP ERROR 500".
What do you think I should do now?
For completeness sake, I will list here the screenshots I made when I was comparing my modifications to the original theme.
I am thinking what I should do now is try to step back and see if I can narrow down the point where the website crashes. But in order to do that, I wonder if it will do any good to just modify the files. I mean, the subtheme is already set as the default theme. How can I undo that without being able to log into the Admin Dashboard?
First, slides are stored in theme settings, so you should go to Appearance -> Your Theme -> Settings to edit them. That's however not very good way to store the variables that shouldn't have definitive number of values. Also slides are more site content then theme settings.
I would define new content type called "Slide" or something, add all the values one slide needs (picture field, description, link...) and use the View to collect those values - loop over them. That way you can have any number of slides. You can also add some field for ordering slides etc.
Also, I wouldn't use picture field directly (to display image uploaded by admin), but I would add image style for slide, to scale that image to proper dimensions. That makes life much easier for admin - he doesn't have to use some image editing tool to scale each image manually.
That's my suggestion - what I would do.
Second, site is "made" of files and database, so any content it displays must be in one of those two parts.
And third, start from just inheriting the them and see will it work and then change it step by step, so you can notice easier what causes the problem. Also if base theme is not public one (it won't get updates and so) you can change it directly.
And about error 500 - error can be logged or displayed. Run phpinfo() to see where is php.ini file. Edit it and allow at least error login. Or for you development environment even better allow error displaying.

Website Images - Loss of quality

The images on my web page seem to "lose" quality / color in thumbnail sizing.
Link To Site
I have tried to insert the following to prevent Wordpress from compression the images - I then regenerated thumbnails, howver problem still exists.
The images display correctly upon opening - the error is with the thumbnails
add_filter('jpeg_quality', function($arg){return 100;});
I have also tried setting the plugin "imsanity" quality to 100 - and also tried deactiving the plugin and reuploading new files. So I am doubtful this is the problem.
I am using DIVI theme. have tried DIVI support who believe the problem is not with the theme.
any advice please? Thank you

Self generate Woocommerce Variable Products download links

I'm developing a Woocommerece shop in Wordpress with Themify and running this as a photo libary. The goal is that anyone with access can select the right file-sized images for there job.
I'm using variable products to "sell" downloadable content in 3 sizes, Digital/Print and Professional Print. My aim if possible is that when you upload a high-res image(professional print) the print/digital print sections are automatically filled by sourcing the large/medium file types generated by Wordpress on upload.
Does anyone have any suggestions how to tackle this? I'm a little out of my depth on this one.

Missing virtual downloads woocommerce

I am working on a live website for someone who sells his MP3s. I have noticed now that the virtual files have no download link, after being purchased and on the product page in the backend. Thing is, I know they existed before as people have purchased MP3s without issue. So they have been lost somewhere perhaps because of a Wordpress update or theme change.
I exported my current wordpress product and variable product database and can see that the link information is actually there. I don't have any experience working with databases so this is a bit out of my depth, but I can see this:
<wp:postmeta>
<wp:meta_key><![CDATA[_file_paths]]></wp:meta_key>
<wp:meta_value><![CDATA[a:1:{s:32:"a97427231bd5a0eb7c0763ee6444bcc0";s:65:"http://domainname.com/wp-content/fl_dl/Deep-Relaxation.zip";}]]></wp:meta_value>
Which is the correct url for the mp3. How do I get Wordpress to realise that the links are already there? I really do not want to have to go through every product and input the link again as there are hundreds!

Categories