Lana Codes
Forum Replies Created
-
It’s weird, but I’m glad that solved the problem.
Thank you for sharing your experience and taking the time to help with the bugfix.
Due to the new security settings, it was necessary to restrict access to local files by default.
But we have created an addon that allows local files:
lana-downloads-manager-abspath-local-file-addon.zip
If you have any questions or need further help, feel free to contact me.
I released a version 1.7.1, which has a minor bugfix. This error, which I fixed in it, should not actually cause an error, but it might solve the problem.
Install version 1.7.1, then click “Save Changes” in the settings, so update the settings. It is important to update the settings.
Hmmm, then there might be a problem with the “administrator” role capability, which is really wierd because it has both capabilities and it has to be “OR”, so one would be enough.
Unfortunately, it is very difficult to tell from a distance. Query Monitor can help with the analysis.
I’ll try to write an analysis addon plugin so maybe we can see what’s causing the problem.
I made some screenshots to show how it works in my website: https://imgur.com/a/aPFWn7R
The Query Monitor plugin has a Capability Checks module that can help: https://www.ads-software.com/plugins/query-monitor/
For example, if you give the Author role permission to edit files, does an author user have permission, and can edit files in lana download?
I believe that you have a problem with this, but I also tried it on two different websites (both localhost and public website) and it works on both.
And even if the administrator doesn’t have “edit_files” permission for some reason, according to the settings, the administrator should have “edit_lana_download_files” capability. That’s why it’s so weird.
One more question: is this a multisite?
Are you absolutely sure you are logged in as an administrator?
In the settings, do you see that “Administrator” is checked and disabled?
Two capabilities define edit file permission: “edit_files” or “edit_lana_download_files” capability. The administrator role has the “edit_files” capability by default.
First, you need to log in as an administrator and go to the “Settings”.
There you will see a field in the “General” section called “Role Edit Files”. If you want to give permissions to “Editor” role users, check and then save the setting.
“Administrator” role always has permission to change settings and edit files.
If you have any questions or need help, feel free to contact me.
You could download it, but since there are security patches in this version, it is not recommended to download the previous version.
We have uploaded version 1.7.0, which has the option of role edit files in Settings.
Yes, due to the new security settings, we had to change the plugin so that only administrators can edit the files.
In the next version, there will be a permission editor in the settings. I would like to ask for your patience for a few days while we upload the new version.
Forum: Plugins
In reply to: [Lana Downloads Manager] External file linkThere is a separate post type permalink (which leads to a description of the post if this is enabled in the settings) and there is a separate download permalink.
But I see the download is now working on your website. So you are using the right link.
Forum: Plugins
In reply to: [Lana Downloads Manager] External file linkThe problem is that you’re trying to use the “view” Google Drive link. However, the download manager needs the “direct download” Google Drive link.
Google Drive “view” link structure:
https://drive.google.com/file/d/{FILE_ID}/view
Google Drive “direct download” link structure:
https://drive.google.com/uc?export=download&id={FILE_ID}
So you use this link in the download manager:
https://drive.google.com/uc?export=download&id=1rl511GWZNg8SvzgCcRoKvg-UXq7MP8NK
If you need more help, feel free to contact me.
Forum: Plugins
In reply to: [Lana Downloads Manager] Improvements regarding the download countThere is a function that you can use to get the download url:
$download_ url = esc_url( lana_downloads_manager_get_download_url( $post_id ) );
In the same way, you can use it even without
$post_id
if the global post is set.You can get the direct url of the file, but you cannot use it because it is a protected file (if you upload it from the plugin download post tpye and not from an external service provider like Dropbox). Due to security and normal operation (counter, log operation), the file is protected and cannot be downloaded bypassing the download manager.
$file_url = get_post_meta( $post->ID, 'lana_download_file_url', true );
Note: as I said, you cannot use this direct file url. It will not work.
Forum: Plugins
In reply to: [Lana Downloads Manager] Improvements regarding the download countAnd a small problem I see is that I can’t insert custom fields in the back-end.
You can add custom field support with the following code:
/** * Add custom fields to lana download post type * * @param $args * * @return array */ function lana_downloads_manager_add_custom_fields_to_lana_download_post_type( $args ) { $args['supports'][] = 'custom-fields'; return $args; } add_filter( 'lana_downloads_manager_lana_download_post_type_args', 'lana_downloads_manager_add_custom_fields_to_lana_download_post_type' );
Most people use the ACF plugin for this purpose.
Otherwise, it is possible to modify the counter if you enable custom fields.
Custom fields metabox is not enabled by default because file selection has more functions in the background, for example inserting the file id, which helps in user-friendly operation. Therefore, it would only be confusing for the average user. Advanced users, on the other hand, can add it with the code snippet above.