The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
1answer
12 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
30 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
27 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
36 views

How do you clean 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. ...
0
votes
1answer
20 views

FS method direct on NGINX

WordPress is a great CMS but when it comes to debugging and error reporting it becomes pretty annoying. I've been searching a solution for my problem for quiet a while now. Unfortunately without any ...
0
votes
1answer
30 views

Correct file permissions for in-browser updates using WP-CLI

I installed WP using WP-CLI (i.e. on the command line on the remote server). I'd like to give another person the ability to change the theme, plugins, etc. using the standard WP admin browser ...
0
votes
0answers
36 views

Avoid 'uploads' 777 permissions: Potential threat or clean solution?

Recently changed hosting of a website and found the upload directory of WordPress wasn't "available". I have been reading that setting folder permissions to 777 would allow everything to work fine, ...
0
votes
1answer
23 views

Should I use Filesystem API for reading files or listing directories?

I know that i should use Filesystem API to write files and I understand why but is there any difference if I read file with wp_filesystem or plain PHP? And what about listing directories? Consider ...
0
votes
1answer
37 views

Running rmdir function on post save

How can I make wordpress call this function when a post is saved? $folder = "/temp/files/"; //path of the folder to be removed function delFolder($folder) { foreach(glob($folder . '/*') as ...
0
votes
0answers
23 views

Delete directories on post

I'm trying to figure out some simple php code that would allow me to delete the contents of a directory when I create or update a post/page. Any tips on how to get the conditional aspect working?
0
votes
1answer
96 views

Generating and downloading files with WP API

Lately I was challenged to implement functionality that would allow users, editing specific custom post, to download json file based on meta of that post. I finally managed to complete the task (well, ...
0
votes
0answers
113 views

Why is my upgrade folder's files & folders chmoded like this?

I'm unable to update/upgrade anything at the moment and this probably causes the problem. If I try to update the core the following happens (using wp-cli, same happens via the panel): Updating to ...
0
votes
0answers
78 views

Using external file with WP_USE_THEMES set to false causing 404

I have a file in my template I want to use for a Twitter authentication callback named oauth.php that I'd like to be accessible through htp://mydomain.com/oauth.php: <?php define('WP_USE_THEMES', ...
1
vote
1answer
307 views

Necessary user, group and permissions for core updates

What user, group and permissions of files and folders I need for core updates? Test setups I tried everything the manual recommended me to. Here are some test setups I used, the setup was ...
0
votes
1answer
219 views

Accessing a file saved outside webroot in a wordpress post

I have some files saved outside the webroot and need to allow posts in WordPress to be able to access the files. Following is the location of one of the files: ...
0
votes
1answer
37 views

Page to show a link to every file in an directory

I have a file on my server with a large number of PDF files in it (more than 100) and I wish to have a page on WordPress that shows a link to each of these files (say sorted alphabetically by the name ...
0
votes
1answer
41 views

Private file system for attachments

Is there a way to make an attachment private? This also includes moving the files to a separate folder for private attachments, even if it's a sub-folder of uploads, to restrict anonymous access ...
-1
votes
1answer
55 views

Does WordPress create a new Linux user when creating a new WordPress blog?

I wonder if WordPress creates a new Linux user when creating a new WordPress blog? I am a NodeJS developer, but from what I know PHP scripts can also have access to entire file system. That's why I ...
2
votes
0answers
138 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: ...
3
votes
1answer
209 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 = ...
2
votes
1answer
28 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 ...
0
votes
0answers
33 views

Folder Permissions + Security Concerns

I messed up bad guys. I while working on another part of my website I accidentally nuked my WordPress folder permissions. I was able to find/fix some problems and I got my site up and running but some ...
1
vote
0answers
45 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 ...
0
votes
1answer
48 views

Get original path of user's filesystem of an uploaded media

Is it possible within wordpress to retrieve the original upload path of a media? For example, the user uploaded from C:\pictures\holidays2014\image1.jpg. I want this path, not the created path after ...
0
votes
0answers
128 views

Making a custom upload form and page in the admin section

so I've built this standalone php script which allows my users to upload a CSV which updates JSON data for a feature on our site, but I want to put the script inside of the wordpress admin section for ...
1
vote
2answers
1k views

Running WordPress as FTP user?

I've been doing some research on file permissions as of late, as my WordPress installation on my VPS doesn't have write access. From what I've heard it's very dangerous to make the apache user the ...
0
votes
0answers
53 views

saving file to external server vip

I have a handwritten script that writes a text file locally in one of my Wordpress pages, but now I need it to read and write to a remote server that is password protected and accessible only through ...
0
votes
0answers
33 views

Page Not Found when file does exist

We are having an issue where although files are listed in File Manager they will not pull up when we link to them. We are on the current version of WordPress and all plug-ins. Here is a link to a ...
0
votes
0answers
33 views

Which actions can update/change .php files?

As a followup to my question "How to find out if an wp-admin action edited a file?" I now could use a list of actions and files that can actually cause an update or change to .php-files in a default ...
1
vote
2answers
2k 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
399 views

Alternative to file_get_contents() for theme operations

My theme options page needs to write to the style.css file in order to store updated theme settings. To do that, I'm using file_get_contents() and file_put_contents() However, theme-check plugin ...
1
vote
1answer
72 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 ...
0
votes
1answer
124 views

Displaying $_FILES data (simlar to $_POST)

I'm trying to display $_FILES in wp-admin, and I've been using add_filter and apply_filter, but it does not seem to show the $_FILES array values. My goal is to show the values in $_FILES so I can ...
1
vote
1answer
89 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 ...
0
votes
1answer
281 views

Why do I get undefined function export_wp()?

I'm trying to create a function in functions.php or a plugin to generate an export via a cronjob, similar to how Chris_O did this question. However it seems that I can't call export_wp(), I keep ...
0
votes
1answer
1k views

How to edit php code in WordPress Post file?

I have a wordpress page. In that wordpress page, user will have access to the following Window to Publish their Post in to the webpage. If the user enters an URL in any of the three filed I have ...
0
votes
2answers
1k 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 ...
1
vote
1answer
730 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 ...
3
votes
2answers
414 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 ...
5
votes
1answer
77 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( ...
1
vote
1answer
261 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
1answer
847 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 ...
0
votes
2answers
163 views

Why does WP load so many files in the head of source code? How do I optimize it?

I have noticed that wordpress loads a bunch of files into the head of a site. This looks really sloppy and discloses vital information about the file structure of a website. Depending how many ...
0
votes
1answer
2k 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
2answers
5k 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 ...
1
vote
2answers
70 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. ...
2
votes
1answer
504 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 ...
4
votes
1answer
83 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 ...
0
votes
1answer
472 views

wp_redirect to file:// location results in blank page/cannot be displayed page

I have a CPT that is justed used for linking to resources on a local drive. I have this code in single-resource.php: <?php global $post; the_post(); $location = get_post_meta($post->ID, ...
2
votes
2answers
5k 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 ...