Articles of filesystem

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 have several PHP scripts. A download is called by a visitor by clicking on URL (example): The script sanitizes the parameters […]

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?

$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? I was expecting that since its called in file.php, loading that file would be sufficient to load the object. <?php require(‘../../../wp-blog-header.php’); require(‘../../../wp-admin/includes/file.php’); $mytest = somefunction(); […]

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 contain the common styling rules (I will combine them later). My concerns stands at, where should I place […]

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 WP_filesystem methods always return the error block. Any ideas what I’m doing wrong? function so_doHtaccess(){ if ( !current_user_can( ‘manage_options’ ) ) return; if ( file_exists( get_home_path() . […]

Adding Adobe files to a wordpress site

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?

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 could I do this safely with htaccess?

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?

Change default uploads file using wp Skeleton

I am using 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: instead of var_dump(wp_upload_dir()); Gives me: array ‘path’ > ‘/file/system/path/www/wp/core/assets/2014/08’ ‘url’ > ‘http://site.local:8888/wp/core/assets/2014/08’ ‘subdir’ > ‘/2014/08’ ‘basedir’ > ‘/file/system/path/www/wp/core/assets’ ‘baseurl’ > ‘http://site.local:8888/wp/core/assets’ ‘error’ > […]

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 ( – “Pin, organize & show your favorite places through OpenStreetMap, OGD Vienna or any custom WMTS-map”) and have one question: the plugin contains about 100 marker icons from Maps Icons Collection ( which can be used to mark your favorite places. These icons are stored […]