protect files from downloading on other than my site

I have a website Files apk I store these files on a separate server How do I make downloading these files only through my site? I mean, the person who clicks on the download link on my site starts the download And if he took the link and put it on another site, it doesn't work Or if you put it directly in the browser I hope someone can understand me
Category: Web

How to prevent users to view server files using WP File Manager plugin?

I'm developing some plugins to an website, but I don't want the users to see the code (or download it). If the user install the plugin WP File Manager, all files in the host will be revealed to him. Plugins are an essencial part in the WP ecossystem and I don't want to remove the ability of the users to install. I just don't want the users to access the core files. I tried this approach: Change the file owner, …
Category: Web

Fatal error: wp-settings.php on line 199

I'd love to know how to get back into wp-admin and get my site back online. I contacted GoDaddy tech support again today and the PHP is supposedly updating.. Wordpress has been complaining about the older version of PHP it had a while back, as of 5 months ago, a GoDaddy rep told me I had to wait for the devs to switch me over at their convenience... Sadly, now I can't access wordress admin at all, I can only …
Category: Web

Unable to check if image uploaded by wp_image_editor exists using file_exists function

I am developing a podcast theme where i have a form that allows the user to upload their podcast cover arts. The Podcast cover art’s dimension should fall under 1400×1400 and 3000×3000 since we are following iTune’s regulations. Since such big files will impact the page load speed of the site i wanna resize the uploaded image to a smaller size, say 250×250 so that we can use that to display on our web pages. I have used WP_Image_Editor::resize function …
Category: Web

Added support for .stl file but cannot download

I am trying to add a download link to an .stl file after I allowed it in the mime variable. I created a product with a download link and it does work but I want to give a direct access to the file in order to put it on one of my posts. I searched google and tried many things using the functions.php and the .htaccess file but none worked. When I'm trying to directly access the file I am …
Category: Web

How to list newly ftp added HTML webpage under Pages section of wp-admin?

I uploaded a custom page (html,css, and a few scripts) through the file manager, and want the customer to have access to this page through the admin "Pages" menu in the admin area. The page is accessible through www.site.com/{my_page} but admin area doesn't recognize it under Pages. How should I put it under Pages section of admin area?
Category: Web

How to know what page is calling admin-ajax.php?

The original goal is this: all users can add and remove images from the page on front end, but, they can only see their own images. When in the admin part of the website, administrators should see all images, from every user. (only administrators have access to the admin part of the website). So far, I have the following code: add_action( 'pre_get_posts','users_own_attachments' ); function users_own_attachments( $wp_query_obj ) { global $current_user, $pagenow; $is_attachment_request = ($wp_query_obj->get('post_type')=='attachment'); if( !$is_attachment_request ) return; if( !is_a( …
Category: Web

How to remove symlink from folder

I have a WordPress installation on a bad server that I want to migrate. I tried to make a backup via some WordPress plugins, but it was taking forever, generating an enormous zip file. I asked help from my host support but they haven't replied since. Looking for a solution I found a www symlink inside the www folder, which is causing the backup to run recursively, re-backing up the entire site again and again, never completing. I installed the …
Category: Web

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), where the file comes from the _FILES array - this works perfectly. The plugin then, however, should access that very same file (CSV) to extract data and present it on a page via a shortcode. I can not, however, find out how to access that file in …
Category: Web

HTTP Error when uploading mp4 video file

This is a repeat issue, but none of the other threads have had a solution that helps me. I am using WordPress 4.7.3 running the Dani theme from Envato. When I try to upload my mp4 video file, I get an HTTP error. I tried uploading images and it did not give me the same HTTP error. Here is a screenshot of the error: I have tried the following to fix this issue: Deactivating all plugins one by one and …
Category: Web

How to organize my js files

I'm working on a multisite instalation, that will have several subsites and i'm in doubt about how to organize my js files. The WP Theme Handbook says that js files should go inside the assets folder. So as each subsite will have different js scripts, i assume its correct to make a .js file for each site. My question is if its a good idea to make multiple js files per site, since there are some scripts that will run …
Category: Web

File sharing platform for user contributions?

I am looking for a way to allow my visitors to share content between each other in an organized fashion. Essentially the ability to upload files or browse/download files that others have contributed. These are just XML configuration files that contain a plethora of settings for a 3D printers, so at the core they are really nothing more than just text. Before I go reinventing the wheel though, is there anything like this already available for Wordpress? If not, what …
Category: Web

Can we reuse WordPress drag drop media upload in plugins?

I'm building a plugin in which I want to upload the media. I'm using <input type="file" /> which works as expected. But I'm thinking to reuse the WordPress drag drop media uploader. Note: I have a solution in which I upload the media from popup window. But, I'm looking for image dropable placeholder in which user upload the image.
Category: Web

Wordpress media manager multiple selection output

I'm trying to use media manager in metabox, and I need to use multiple select. I just have problem with doing output from that selection. I need element in metabox to hold all selected files urls. My code is here: jQuery(document).ready(function($){ var custom_uploader; $('#upload_image_button').click(function(e) { e.preventDefault(); //If the uploader object has already been created, reopen the dialog if (custom_uploader) { custom_uploader.open(); return; } //Extend the wp.media object custom_uploader = wp.media.frames.file_frame = wp.media({ title: 'Choose Image', button: { text: 'Choose Image' …
Category: Web

custom post type by author - wp job manager

Hy, I am working with wp job manager, and I would like to list job applications by user, under ultimate member tabs. I have tried using this code, but it shows me all applications function custom_shortcode() { $args = array( 'post_type' => 'job_application', 'author'=>$author_id, ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); the_title(); echo '<div class="entry-content">'; the_content(); echo '</div>'; endwhile; } add_shortcode( 'query_my_posts', 'custom_shortcode' ); Also i have tried this method https://suiteplugins.com/how-to-change-the-post-type-on-ultimate-member-posts-tab/ But no luck, …
Category: Web

Which Details Are Required For Style.css File Header?

Which theme details are absolutely required for your style.css file header? I'm developing my first theme for personal use, so do I really have to include things like a license, license uri, author, author uri, etc. WordPress Docs just give an example, but they don't reference what's required. Does anyone know? /* Theme Name: Twenty Thirteen Theme URI: http://wordpress.org/themes/twentythirteen Author: the WordPress team Author URI: http://wordpress.org/ Description: The 2013 theme for WordPress takes us back to the blog, featuring a …
Category: Web

WordPress file manager plugin

I would like to manage some files available for download from my WordPress page. Because the file should be attached to more pages I would like to define pages where file is avalable for file directly. I don't want define the same file for lot of pages in my application. Do you know some plugin which should help me with this?
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.