How to add hash file to Exploit Scanner plugin for WordPress - wordpress

While I have found the updated hash files to be added to WordPress, I have had a terrible time locating anything that gives specific direction as to where this file goes and exactly how to add it. Should it be added via a single file created with notepad, or should it be placed in a folder? I apologize if this sounds elementary, but this is a completely new adventure for me.

I found that the hash values for the files are provided but the file itself has to be created with the name of the file it says it is missing. Once that is created, move the file into the plugin itself and rerun the scan.

Related

WordPress: Deleted Media Files Don't Go Away

I'm building a web site with WordPress, and frequently need to replace a media file--specifically, a Java project exported from Eclipse to an archive, but the same happens with images. To retain the original file name, I "delete the file permanently" from the media library, then upload the revision.
Unfortunately, when I download the file via a link, I get the "deleted" version instead of the new one.
I have disabled the "Organize my uploads into month- and year-based folders" option, so I know the file name is consistent over time.
How is it the "permanently deleted" files don't disappear? And why do they supersede their replacements?
Right now, my choice is to upload the revision without deleting the original; WordPress assigns a sequence number to the revision. I need to change links to match, and the downloaded file will contain the sequence number when used (which isn't very tidy).
This is WordPress 6.1.1.
I've had the same problem quite a few times. What I do now is just use the plugin called Enable Media Replace: https://wordpress.org/plugins/enable-media-replace/ and I don't really have to think about that issue anymore. Maybe this could be an option for you?
Otherwise I think you will have to go in to the database and manually remove the images unfortunately.

Unable to delete uploaded XML file on Drupal 8.5

I have created a media type that accepts XML files and saves them to a custom publicly accessible location on the server.
Ideally I would like the file to be overwritten when the exact same file is uploaded. This does not happen, instead it creates a new file and adds a number on the end. I have "Create new Revision" turned off.
To get around this issue I thought I could just delete the file via the CMS. The uploaded file has status of "Permanent" and is used 0 places. I know the cron job cleans up files for you, but when I run the cron the file in question is still there. I figure it's because the file is set to permanent, but I don't see a way to flip this to temporary.
Any help is much appeciated.
There is a setting nested away in the file system settings, which lets you configure it to remove (or not removed) orphaned files. If drush isn't removing them despite having no usages recorded, I'd check this option isn't ticked.
The temporary and permanent status are used for storing temporary files during the upload/save process, so I wouldn't tinker with those too much.
If you fancy making the form yourself using the form API, then you can save the file programmatically using the FILE_EXISTS_REPLACE parameter.
https://api.drupal.org/api/drupal/core%21modules%21file%21file.module/function/file_save_data/8.5.x

Server.MapPath does not find the path on Azure

I have deployed my project to Azure. In my project I have "App_Data\Images" folder.
Now I'm trying to do the following:
String filename = GLOBAL_IMAGES_VALS.GET_FILE_PREFIX(imageType) + "-" + User.Identity.GetUserId<int>().ToString() + Path.GetExtension(image.FileName);
String origPath = Server.MapPath("~\\App_Data")+"\\Images\\" + filename;
But then upon trying:
image.SaveAs(origPath);
I get this error message:
Could not find a part of the path
'D:\home\site\wwwroot\App_Data\Images\logo-10003065.jpg'.
How can I save my file to "App_Data\Images\"?
The actual problem was that the sub-folder 'Images' did not exist. I can't remember why the publish process did not create this sub-folder, however I added it manually and then everything worked fine.
EDIT:
As others wrote here (#Spectarion). I'll put here the important remark that explain why the folder was not created:
Just for the future readers, folder won't be created if it's empty.
Folder is empty even if there are files that are not included in
project.
Just put some 'fake.txt' file into any folder you want to make sure that it will be created, and of course don't forget to add it to the project. Good luck.
Since you don't have any file in the particular folder, while publishing Web deploy ignores the empty folder.
Quick fix: Add any file to the folder before publishing will fix this issue.
if (!Directory.Exists(Server.MapPath("~/Images")))
{
Directory.CreateDirectory(Server.MapPath("~/Images"));
}
The directory might be missing in the folder. Create the directory and use it in file path
Maybe this :
System.Web.Hosting.HostingEnvironment.MapPath("~\\App_Data")+"\\Images\\" + filename )
Maybe the images folder doesn't exist and you need to create it first? Although I wouldn't recommend saving images in your app like this if it is designed for people uploading images. I would save them in Azure storage via blobs or the new Azure File storage. I would keep your app deployment files clean just related to your app and save any user generated content outside of it.
BTW, If you are using Azure Web Apps you can use the environment variable of "HOME" to always get the correct path (which should be D:\home)
string path = Environment.GetEnvironmentVariable("HOME") +
"\\site\\wwwroot\\App_Data\\images"
I assume your AppData folder is just under the wwwroot folder, which is usually the case.
Try this:
HttpContext.Current.Server.MapPath(Path.Combine("~/AppData/Images/", filename));
I just had this problem on VS15. I first followed the advice in this question in order to generate the error you've got. I'm guessing this follows in part dsb's answer, but dsb hasnt given any description of the actual process of fixing this.
I then went to https://<mywebsite>.scm.azurewebsites.net/DebugConsole to look through the directory and found that App_Data had not been published
Which was why the error was throwing. So, I then solved this by simply going to the solution explorer, right clicking App_Dataand selecting to "Publish App_Data".
However, my website was a short-term academic effort for a project - I think there is probably a lot to be said for considering Matt Watsons answer above about whether or not allowing users to upload to the deployment area is a good idea

CVS Update - move away file

I am updating files in CVS. I put files that I needed to update in my unix folder.
Using cvs add, cvs commit - I was able to add new files to directory.
I was also able to update some from 1.1 to 1.2 using cvs update.
However I am unable to update the version for one file, getting this error:
cvs update filename.scr
cvs server: move away filename.scr; it is in the way
Any ideas how to solve this?
Do exactly what it says - remove filename.scr. CVS update won't overwrite the existing non-controlled copy of filename.scr.
in the cvs hidden sub folder check if the folder of that file is on the list of entries, if so you have to add it
To be specific, this means there's a file in the repository, and a matching file in your tree, but the file CVS/Entries doesn't mention it. That can fail either for the CVS/Entries file at the same level as the file it's complaining about, or if you do a recursive update, it can fail due to the directory not being listed in CVS/Entries at a higher level.
This happens often to me, and I don't know why; a perfectly good checkout starts to get these errors. If it is a missing directory, the easiest fix is to directly edit CVS/Entries, e.g. to add
D/Foo////
to Bar/CVS/Entries so that CVS knows it already owns Bar/Foo.
If it's missing a file, it's hard to regenerate the CVS/Entries line, so it's easiest to do as it says and delete the file.

The ELGG Themes Pluigins show This plugin is invalid: The required file "start.php" is missing. error

Hi I'm new to Elgg framework i'm looking for change the themes of the my site, i have used sea themes,pab_theme,puritythree_theme, and i was open the pluigins in admin page, i can't activated the themes
seatheme
This plugin is invalid: The required file "start.php" is missing.
Check the Elgg documentation for troubleshooting tips
the above message was show, so how can i will change the themes
Every plugin (and themes are plugins) needs to have a start.php file in the root of the plugin's directory. So the path should look something like:
Elgg/mod/seatheme/start.php
The theme needs to reside in the mod dir, and it must have a start file. If, for some reason it doesn't, then you would get that error.
Are you really trying to load three themes? Generally people only load one. I don't think that this is the cause of the error though.
It would be good if you spent some time with the Elgg documentation, specifically: http://docs.elgg.org/wiki/Themes
I had the same problem but I found the solution. You have to download the zip file of the theme, unzip the file, open the file and if you find another file inside you must send that file to the mod file. Basically the directory would be Theme->Theme-> The rest of the files with start.php in it.
So you would have to send the second folder to the mod folder.

Resources