WordPress installation on digitalocean eating the server storage
WordPress installation on digitalocean eating the server storage
WordPress installation on digitalocean eating the server storage
Uploaded images result in a file url with full path on disk appended
You may use this plugins else you can even create a page with all pdf link to download it. Google Sitemap Generator Sitetree
Plugins that load the WordPress environment this way get rejected from the repository, as they are prone to failure in non-standard configurations. For something like this I would use the admin-post-$action to receive requests. The WordPress API will be available where you can check if users are authorized to perform specific actions.
WordPress can’t write files directly most probably because user which runs PHP interpreter don’t have permission to write. Correct answer depends on what is your environment – if you are on shared hosting probably you can’t do anything about it and the only option is to set FTP credentials on wp-config.php so you won’t need … Read more
rawurldecode fixes the issue. $src = media_sideload_image(rawurldecode($url), $post_id, $desc, $return);
You can read data on your server with file_get_contents(). If you want to make sure the file exists and is readable then use is_readable(). You don’t really need to use trailingslashit() in this case because you’re constructing the URI yourself. // path to file under current theme $json_file = get_template_directory() . ‘/inc/includes/acf-fonticonpicker/icons/selection.json’; // make sure … Read more
There is no need to use the WP filesystem API if you are trying to access directories to which the web server has full access. It is needed mainly only when you want to write to directories which have limited access like the plugin directory. From that point of view the two snippets are the … Read more
It is definitely bad practice to try to move themes (or uploads or plugins) outside of the wp-content folder. WP’s structure ensures that WP can find all the necessary resources. Anytime you move things outside of its structure, odd quirks and broken bits tend to appear. So, stick with /wp-content/themes/your-theme-slug/ and make things more dynamic. … Read more
Woocommerce use locate_template for checking if file exists in theme or not