Questions tagged [filesystem]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
25
votes
1answer
43k 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 ...
13
votes
6answers
7k views

Where to store PHP files created by plugin / themes

There are cases in which a plugin or theme needs to create a php file somewhere that can later include it. For example a captcha plugin, or some kind of a templating system like twig/smarty (In my ...
10
votes
3answers
7k views

Creating directory in uploads - wp_mkdir_p() or WP_Filesystem?

I don't think I ever had practical need to create folders/files in WP before, but for a plugin I need cache (for resized images) folder in wp-content/uploads. Which raises the question - do I really ...
5
votes
5answers
15k 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?
5
votes
1answer
83 views

Do WordPress Core Filenames Work as Hooks?

This is in reference to another answer here on wordpress.stackexchange. The answerer used the filename as the hook to enqueue scripts and styles to certain pages. add_action( 'admin_print_scripts-...
4
votes
4answers
14k 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. <...
4
votes
1answer
95 views

add/apend templates 'transparently' via plugin to currently active theme or child theme?

Cross posting my trac question here in the slim hopes that someone here has run into the same issue and has already come up with some proof of concept code I can try: In building a custom 'theme ...
3
votes
2answers
13k views

delete uploaded file

I have a function wp_handle_upload() for uploads files. $file = $_FILES['attachment_icon-' . $i]; $upload = wp_handle_upload($file, array('test_form' => false)); what is a function for delete a ...
3
votes
1answer
1k views

Convenient way to use wp_filesystem

I'd like to use $wp_filesystem which seems to be the recommended way to manipulate file system objects in WordPress but compare this: plain PHP code: mkdir('abc'); WP Filesystem API code: $url = ...
3
votes
2answers
727 views

Is there a WP Way of getting a filehandle?

I'm using an external CSV reading library that takes a filehandle (resource) as an argument. I'm using wp_handle_upload() to actually process and store the file in the Uploads directory, but that ...
3
votes
2answers
885 views

How to configure WP filesystem access in Linux (Ubuntu Server)?

Ubuntu Server, LAMP stack, freshly self-installed WordPress. Apparently I can't use direct filesystem access method because files are owned by different owners (WP core unpacked by me and files WP ...
3
votes
5answers
4k views

wp-config.php file permissions

I have installed Wordpress on my local Ubuntu machine, with standard LAMP configuration and phpMyAdmin. The installation directory is localhost:///var/www/blog. At the second step of the installation,...
2
votes
2answers
6k views

Moving wp-content outside of web root?

Is it possible to move the entire wp-content folder outside of the Web root? I need to prevent anyone to view any asset file (images, pdfs, movies etc) with a direct url to the file... Any ideas? Or ...
2
votes
2answers
5k views

Standard permissions for wordpress; Plugin installation asks for FTP credentials

I'm on a server that does not have FTP installed and will not have FTP installed. I have another website that I've been able to install plugins in before, including the one I'm trying to install now (...
2
votes
2answers
3k views

sanitize attachment filename

I'm looking for a way to sanitize the filename of user uploaded attachments. I thought that wordpress already did it but I faced preblems after an user uploaded an attachment containing a '°' . That ...
2
votes
1answer
150 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......
2
votes
2answers
514 views

How do I maintain static directories on multisite subdomains?

I'm trying to migrate from multiple subdomain blogs to WP multisite. The one stumbling block is that I'm pretty sure the static files and directories on my subdomains will not be found; each of my ...
2
votes
2answers
3k views

Uploading Media gives error “Missing a temporary folder.”

After we upgraded to Wordpress 3.0.1 (from Wordpress MU 2.9.2) we began getting an error message whenever we tried to upload media. "Missing a temporary folder" Various articles around the web ...
2
votes
1answer
44 views

What are the hierarchy of filenames while initialising a WordPress plugin?

WordPress has recommended to have the filename similar to the name of the plugin. There is no other information about the hierarchy of filenames of a WordPress Plugin. Also I don't find plugins ...
2
votes
1answer
739 views

What is the best way to move a plugin´s subdirectory+files to wp-content/uploads-directory?

I am developer of the plugin Leaflet Maps Marker (http://www.mapsmarker.com - "Pin, organize & show your favorite places through OpenStreetMap, OGD Vienna or any custom WMTS-map") and have one ...
2
votes
2answers
4k 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/...
2
votes
0answers
190 views

Change default uploads file using wp Skeleton

I am using Wordpress Skeleton (https://github.com/markjaquith/WordPress-Skeleton) which pulls the themes etc out of the wp directory. I am trying to set it up so uploads have a custom url (eg: site....
2
votes
0answers
77 views

Securing a multi-user permission structure

I'm currently working on a team that needs two distinct users from the same wpadmin group to be able to modify the wordpress files. Following the guide at Hardening WordPress (Codex), the following ...
1
vote
1answer
3k 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
2k views

Uploading non-media files?

I want to add files on WordPress that are non images, embedded video and the like. However when I try this using the upload media feature I get the following error. "File type does not meet ...
1
vote
1answer
95 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?
1
vote
2answers
4k views

Converting fopen/fwrite operations to WP_filesystem

In the function below, I'm trying to convert the fopen/fwrite/fclose methods to the preferred WP_filesystem methods. Everything works as expected using the commented out script block, however, the ...
1
vote
1answer
205 views

Placing assets for external use

I'm developing a plugin, that is meant to work on external requests to a wordpress site. The plugin will generate a .json file, and will come with 2 default .css style and 1 .css file that will ...
1
vote
1answer
3k views

$wp_filesystem returns NULL. What are the dependencies?

I need to obtain a reference to the $wp_filesystem object. In the test below, the var_dump($wp_filesystem) returns NULL. What additional files are required in order to properly set up $wp_filesystem? ...
1
vote
1answer
106 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 ...
1
vote
1answer
313 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
3answers
7k 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 ...
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?
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 ...
1
vote
1answer
1k views

Merging PHP download script into `functions.php`

I run a large mixtape download site on WordPress. I'm currently developing a new theme and I'd like to include as much site functionality into the theme's functions.php. For serving the downloads, I ...
1
vote
1answer
370 views

Is it bad to store many files in a single folder?

I upload thousands of images and it stored in a single folder. Is it bad if too many images are in a single folder? would that slow down the loading of the image even though you're viewing an ...
1
vote
2answers
80 views

What permissions should I give directories if I want to make WordPress more secure?

A follow up to a previous question found here How can I lock down an old wordpress install I don't intend to update? Same info still stands. WordPress install will (probably) not be updated. ...
1
vote
1answer
3k views

How to check if txt file exists inside template folder?

I have a folder inside my theme where I hold some txt files which I am including in a theme. The problem is that before including txt file I need to check if it does exist. I fail checking it the ...
1
vote
1answer
154 views

Where do I save widget code for wordpress?

Pretty simple, I've written a widget and I can't find out for the life of me where to save it?! Using the most recent version of wordpress. Thanks, John.
1
vote
1answer
19 views

External pages redirecting back to wordpress

So I've created a folder under my wordpress root directory containing simple vueJS html files and assets such that anyone can access them from a url like: Mywordpress.com/externalfolder My external ...
1
vote
1answer
16 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 ...
1
vote
1answer
212 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), ...
1
vote
1answer
246 views

How to implement filesystem cache in Wordpress

I'm currently using the Transients API to cache some product details from Amazon. Now I'm looking into adding a file system cache. But I have no idea how to implement it. The only thing that I can ...
1
vote
1answer
2k views

Interface for logged-in users to upload/download files

I am setting up a site for a non-profit that would like to have a 'members' area where certain users can swap files for meetings, events, etc. They essentially need a simple interface where they can ...
1
vote
2answers
4k views

Image URLs stopped working due to Permalinks?

I've been changing my Permalinks and changing my site the the "www" version (Which I think has broken my image and video links). All my images are "red x" now, both inside the library and the posts ...
1
vote
1answer
2k views

List of files/folders writable by the web server?

New to WP. I soon realized there are some files that need to be writable by the web server, otherwise various operations fail. Moreover, the lists seem to be different for different tasks. Not sure I'...
1
vote
1answer
35 views

“dashboard”-named PHP file doesn't get included

I've made a simple "test plugin" to demonstrate the issue: my-test-plugin/ ├─ includes/ │ └─ dashboard.php └─ main.php <?php // dashboard.php echo '<h1>Dashboard</h1>'; &...
1
vote
0answers
23 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 ...
1
vote
0answers
56 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->...
1
vote
4answers
11k 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… ...