Questions tagged [filesystem]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
14 views

Serve contents from Nextcloud / WebDAV

I am looking for a solution to show the contents of a folder in a Wordpress site with the folder being hosted on Nextcloud. Since Nextcloud and Wordpress both support WebDAV I thought it would be ...
0
votes
1answer
11 views

temphangle variable missing when using wp_filesystem copy

I get the following error when using $wp_filesystem->copy(); to copy a file from one destination to another. Undefined variable: temphangle in <b>../htdocs/wp-admin/includes/class-wp-...
0
votes
1answer
26 views

What dependencies should I load and to use the WP_Filesystem?

I'm building a Wordpress theme which has a WP_Filesystem call in it: <?php $wp_filesystem = new WP_Filesystem_Direct(null); echo $wp_filesystem->get_contents(get_stylesheet_directory() . ...
1
vote
1answer
20 views

Can I delete `wp-config-sample.php` after installing and configuring Wordpress?

Can I remove wp-config-sample.php after installing and configuring Wordpress? Could this have any consequences in the future? Is this file restored after updating? At first glance, it just seems ...
0
votes
1answer
19 views

File ownership for file tree php user ID - Folder permission 775

I have the same issue as the below topic, where all my folder are set to 755 but I am unable to run updates or upload new media due to folder permissions. Once I set it to 775, the problem is resolved....
0
votes
2answers
155 views

How to replace file_get_contents() with a Wordpress Filesystem call

I'm using the PHP file_get_contents() function to retrieve and echo the contents of an SVG-file. <?php echo file_get_contents( get_stylesheet_directory_uri() . '/assets/images/Search_Glyph.svg' ); ?...
0
votes
0answers
10 views

How to write a file from a theme to the “Site Address” directory?

I recently came across a theme which creates a sitemap and attempts to add it to the Site Address directory/root, so https://example.com/sitemap.xml. I believe the way this theme does it makes some ...
1
vote
0answers
20 views

How to first edit in local Wordpress editor on page and the add code?

I started a local WordPress site using DesktopServer. (Atom for coding). And I want to start creating the new website by first creating a "page" in local WordPress and creating a basic layout, and ...
0
votes
1answer
32 views

How to write to a text file and save it in a folder for later download?

I've a template file in the 'templates' folder that performs a function based on the JSON input it receives from an external source. I want to write that JSON input in a text file and save it ...
1
vote
0answers
44 views

Save PDF File From Plugin to Filesystem /wp_upload

i would like to call a function from another plugin, that returns a pdf. Is there a possibility to save this pdf in the Wordpress Filesystem - wp-upload for example? I just found $wp_filesystem->...
0
votes
0answers
11 views

Is it possible to display the contents of a host system folder in a page or post in Wordpress?

I use Wordpress as a way to manage our home documentation. Our document scanner drops files directly into a SAMBA share on the Ubuntu box that is also running our Wordpress site. Rather than ...
1
vote
1answer
15 views

Wordpress Login doesnt respond after using Filezilla to upload my files on the server

Last week, the most recent update of Wordpress 5.3 came out and I updated it. As many other people, my website had a lot of problems after the update, due to the fact that my plugins such as openwp ...
0
votes
2answers
66 views

How can I get blog content from SFTP?

I inherited a site that was compromised (I'm not sure what version of wordpress, the crash happened last summer). I have CLI access, and can SFTP into the server. The only thing I want to get is the ...
0
votes
2answers
42 views

Adding regular php file to site

How do I create a page(in wordpress theme folder) so that it can be accessed on my site as examplepage.com/somepost.php? I can see it as examplepage.com/wp-content/themes/mytheme/somepost.php but is ...
1
vote
1answer
74 views

Plugin writing: access file that was just uploaded

I am having trouble finding a solution for following problem: The user should upload a file in the menu of my plugin; the file is uploaded to the media folder by using media_handle_upload(file), ...
0
votes
1answer
369 views

Failed opening required

I am new in wordpress development. Tried include a selfwritten php-file into htdocs/wp-content/plugins/abc/abc.php IDE sugesting me to use: require_once '../WPNonce/WPNonce.php'; but WordPress ...
1
vote
4answers
6k views

WordPress and plugins can't update (“inconsistent file permissions” error)?

I have a problem - when I click on "Wordpress update", I receive this message: Downloading update from https://downloads.wordpress.org/release/wordpress-5.1-new-bundled.zip… Unpacking the update… ...
0
votes
1answer
32 views

Where to store sensitive uploaded file?

I'm developing a plugin. Where is the best place to store a user uploaded file that is sensitive in nature? It should not be web accessible. Given the encoding of the file, it's necessary that it be ...
0
votes
1answer
75 views

Should I store critical css in the database or in my theme's filesystem?

I have a method for detecting a post's critical css when the page is requested and in-lining it to optimize page speed. I would like to cache this css to avoid having to compile it for every page ...
1
vote
0answers
35 views

accessing files in custom folder in wordpress

after uploading files in a custom folder "myuploads" using PHP code, I want to show these files in admin. This folder resides in the root directory along with wp-admin,wp-content,wp-includes folder. I ...
0
votes
0answers
23 views

403 Error on “/”

I am working on deploying wordpress on my personal server just to learn a little bit more about it. I have made it all the way to the admin page but when I try to customize a theme I get a 403 error ...
0
votes
1answer
294 views

What files are safe to delete after a security breach in WP content folder?

My site has been hacked and I want to start with a clean slate, but when I delete some of the folders, the site stops working. So how do I know what I can delete safely or not? Here is the list of ...
1
vote
1answer
181 views

How do I edit the php/html for a particular post?

I am new to Wordpress but I am comfortable coding in html/php and want to create custom forms on some of my posts. My site is currently running on localhost. I feel very silly because I have been ...
1
vote
0answers
73 views

How to block access to files without modifying .htaccess or ngnix config? [closed]

I'm trying to prevent access to readme.txt files on a WP site. Normally, this would be easy by just modifying the .htaccess file or the ngnix configuration. However, the host runs ngnix, which ...
0
votes
1answer
2k views

Installation failed: Could not create directory - CentOS 7

I have spent over 6 hours trying to do the 5-minute installation. I've searched Google over and over, and have yet to find anything that will actually fix my problem, so hopefully someone here can be ...
1
vote
3answers
5k views

Relative file paths in CSS when linking directly (not enqueuing)

I am creating a single-page child theme, in which (apologies to the Wordpress community) I am basically trying to stay out of using PHP or the Wordpress API as much as possible, because I really just ...
2
votes
2answers
3k views

Can't write pdf file to upload directory using FPDF

PHP Warning: file_put_contents(http://lendersmatch.ca/wp-content/uploads/deals/deal1.pdf): failed to open stream: HTTP wrapper does not support writeable connections in /home/t21jv08zz60b/public_html/...
0
votes
1answer
34 views

Look for a file in a theme before loading from plugin

I am developing a plugin and I would like users to be able to override specific files from their theme. For example: I am including the file people.php, located in: /plugins/my_plugin/view/people....
0
votes
0answers
105 views

How to handle a lot of media files in the uploads folder? (+10.000)

I recently found out that FileZilla only displays 9998 files in a single folder, but our WordPress Media archive has over 58.000 pictures in three folders. So the standard sorting option by date (...
1
vote
1answer
74 views

Adding Adobe files to a wordpress site [closed]

I need to give members access to Adobe files, Illustrator, InDesign, and Photoshop on my website. Is there a plugin or someway I can put those on my site for people to access and download?
2
votes
1answer
124 views

How to move Wordpress theme files into a subfolder without breaking the theme?

I've been coding a Wordpress theme using OOP PHP, node.js and Webpack, and between classes, node_modules, configuration files and Wordpress template files my theme's directory has become a bit messy......
1
vote
1answer
99 views

Why is server preventing admin styles? (Was: Where are WordPress sessions saved?)

[Note: I'm keeping the following opening paragraph here for posterity, but this is no longer a session issue - something wrong on the server is preventing CSS from displaying.] I asked this question ...
0
votes
1answer
92 views

Get names and paths from unzip_file()

I Need Some help for unzip_file, this code working fine but i want to add extracted files to wp media library, But i don't know how to get unzip files name and path one by one https://codex.wordpress....
0
votes
0answers
16 views

Downloadable content file structure

I have a bunch of files that will be used as downloadable content. Do I have to upload it as media or can I just upload to a folder through FTP? If yes, which folder?
0
votes
1answer
72 views

Creating an .ics calendar subscription service with wordpress

At the moment I just have a static page with a link that when clicked will download all the events I have on my .ics file to a phone's calendar. Ideally what I would like is for people to be able to ...
0
votes
1answer
1k views

How to include all files within a folder & its sub folders to functions.php?

I try to include multiple php files under one category inside my Wordpress theme and the file/directory structure look like this: -Theme Folder --Functions_Folder ---Folder_1 ----File1.php ----...
0
votes
3answers
60 views

Is it better to store images and other files in the root directory or the theme directory

I'm wondering what the best practice is for storing images, css, js etc in my file manager. I've come up with these 2 possible options as my preferred options. Create folders (images/, css/, js/) in ...
0
votes
1answer
124 views

Removing the references to the wp-content folder

I downloaded an HTML template and did the necessary conversions to create a wordpress theme. The location of the template files is in /wp-content/themes. When I look at my template and I go to my ...
1
vote
0answers
63 views

How to know which ajax file or function is called for action

I want to know which ajax file or function is called for action. For example, if i enter some keyword in filtering, it performs some ajax action. When i searched for ajax file chrome developer tools ...
4
votes
4answers
12k views

How to give image source in wordpress page editor?

I have image file stored inside theme directory called site. Now in my home page using wordpress page editor I have put the following code but it didn't display image, seems location is wrong. <...
0
votes
1answer
102 views

How to Call Function From Separate WordPress Install on Same Server?

Is there a way to call functions from a default location for multiple installed sites on the same server? For example: \public_html\functions\global_functions.php has the shared functions for all ...
0
votes
1answer
599 views

Right way to download file from source to destination

I'm trying to download a file from one location to another. The code is working perfect. Here is the code snippet: Helper Function - Create directory in /uploads/{$dir_name}/ and return paths. /** * ...
-1
votes
1answer
175 views

Plugin installation works only with FTP - how to debug?

When I install new plugins in the Admin, Wordpress asks for FTP access although the file permissions should be correct. I want to enable plugin installation without ftp access. How should I debug ...
1
vote
1answer
2k views

Files automatically added

Today I was warned by iTheme Security that were added 2 files: wp -content / uploads / GeoIP.dat wp / content / uploads / GeoIPv6.dat Where did these come from and what is their purpose?
23
votes
1answer
38k views

What is the difference between the .po .mo and .pot localization files?

I'm translating a wordpress site and need more clarity around these terms. Can anyone please lend a hand with some definitions and differences between .po .mo and .pot files with wordpress ...
1
vote
2answers
2k views

WordPress HTTP Error on File upload

I have increased the max_file_upload_size from 20 MB to 100 MB in WordPress, but I've been facing a problem since then. Whenever I try to upload a file of any type, it says "HTTP Error" when I use ...
4
votes
5answers
13k views

How to convert the file path to a URL of the same file?

How do I convert file system path to URL? I have found some general PHP solutions that can be error prone. Is there some WordPress specific way to do it?
0
votes
1answer
319 views

get_template_directory() returns wrong address on VPS

I'm having the following problem with a Wordpress installation on a VPS server. I'm trying to read from a JSON file but the returned address from get_template_directory() is wrong: $url = ...
0
votes
0answers
1k views

Can't Install WordPress (local) Failed to open file wp-includes/wp-db.php

Title kinda says it all. Trying to install WP locally and I get the following error when trying to use the wp-config.php generator UI: Warning: mysqli_real_connect(): (HY000/2002): No such file or ...
0
votes
1answer
272 views

Cleaning a filename after image sideloading a url that contains `%20`

Right now I'm creating a plugin to sideload images from an external source. The UI allows me to select files on the external server then downloads them via AJAX & media_sideload_image. ...