403 Forbidden when Updating (I presume POST?) but not Creating (PUT?) an image

I’m using the WordPressPCL library for .NET alongside WooCommerce (although my problem is with the WordPress API, not the WooCommerce API), and trying to upload an image alongside my product

My current process is

  1. Upload the image using WordPressPCL, using the Media.Create() method which I presume PUTs the image
  2. Create the product using WooCommerceNET, with the image’s URL as the product URL
  3. Update the image, setting the Media’s "Post" ID to the WooCommerce product ID

Steps 1 and 2 work fine and I can upload dozens of products, but on 3 I get a 403 Forbidden response which doesn’t make sense to me since I was able to upload the image.

The above order is important to me, because I absolutely do not want to create a product without the image already being on the server – therefore I need to guarantee the process fails if there’s a problem with either the image upload or the product upload. Hence I update the image to attach to the post afterwards.

I know that you don’t strictly need to attach the image to a post, but it’s a requirement from the customer, who uses the attachment to manage deletion of images.

Simplified code below (I’ve removed the details of error handling, object creation etc)

// Create the image try {     uploadedImage = await wordPressClient.Media.Create(imagePath, fileName);     } catch {     // Image upload failed. Fail the process }              // Image uploaded successfully, now create the product try {     productImage = new ProductImage()     {         src = uploadedImage.SourceUrl;     };          product.images.Add(productImage);                      // Replace with the product recieved from the server so that      product = await wooCommerceClient.Product.Add(product);  } catch(Exception e) {     // Product creation failed, fail the process (and try to remove the image, but don't worry about it) }  // Now try to link the image to the post try {     uploadedImage.Post = (int)product.id;     await wordPressClient.Media.Update(uploadedImage); } catch {     // Problem here } 

Is there some kind of API permission I need to set to allow my API user to update the data for an existing media item? Or something else I’m missing?

MS SQL Creating Tables and Adding Values by a Trigger

I have a table for products. They have product name, id, and quantity. By using a trigger whenever I insert a product to this table for example id =145, quantity= 10 I want that existing table get updated and the quantity of the item with an existing id will be decreased by one and autmatically by the trigger we will create a new table only 2 columns, id and quantity, and it will be id=145, quantity =10. How can I do this?

Is there a good way ECS for creating variants of a behaviour like in Java interfaces?

In Java, there are interfaces – I’m not clear on the details (I don’t use Java) but from what I’ve learned, they seem to be "classes for classes": a way to effectively make individual classes "instances" of one overarching class. For example, a "Cup" interface could be implemented by a "Mug" class, a "Glass" class, a "Goblet" class etc. As long as they have the same I/O methods such as fill(), empty() or drink(), they can be used interchangeably.

In languages with duck typing, interfaces are not needed – the language allows for classes to be used interchangeably as long as no invalid properties of methods are referenced. This is another valid was of going about things in OOP. This is how I usually go about things.

My question: how can I create varied behaviour in an ECS if components are data-only? I like to think in terms of first-class functions, but that seems to be taboo since components are not supposed to hold behaviour.

Option 1, have a massive switch or if/else chain in my System:

For example, if I have an AI component with several different behaviours, I could use an integer to define which type of AI to use for that particular entity. It seems a bit convoluted and inelegant.

Option 2, have a separate Component and matching System for each behaviour:

This would be neater in each individual System but as a whole, the program would be a mess. This wouldn’t work because of the large amounts of variation such as hundreds of different guns in a shooter game.

Option 3, use a flyweight-like data structure independent of the Component:

This would mean storing all of the different behaviours elsewhere, and storing a key that a System can use to access the behaviour. This is basically a fancy version of the switch option above, but it seems neater as there wouldn’t be a massive dump of code in the System.

Option 4, creating a complex way of encoding a description of the desired behaviour which the System can interpret:

This seems to be the most overkill of the lot. Unless I have to, or there are significant advantages, I’m trying to stay away from this.

If there’s no other way, I’ll just adopt the methodology of first-class functions as I usually do and just ignore any guidelines about ECS I’ve heard, just for this one case. The problem is, it probably won’t just be one case in the future.

Have I missed any other good options? Is there an industry standard or recommendation? If not, what considerations should I make about which option to choose?

When creating undead, what abilities are retained?

When an undead is created through the animate dead spell and you apply either a zombie or skeleton template, what exactly is retained?

Both of these templates specify that

Special Attacks: A zombie retains none of the base creature’s special attacks.

Special Qualities: A zombie loses most special qualities of the base creature. It retains any extraordinary special qualities that improve its melee or ranged attacks.

I cant seem to find clear distinctions of what is a special quality. However special attacks seem clear enough. Any ability that provides an alternate to the full attack or standard attack seems to fit this.

Special qualities retained is less clear. Abilities like pounce, grab, and rake seem like they should stick around, however the Skeletal Megaraptor also seems to retain racial skill bonuses, as well as scent. A skeletal owlbear however, does not.

What about poisons? Poisons seem like special qualities that improve a melee or ranged attack. However it doesnt make as much sense for a skeleton to have poison. Zombie maybe. However they are magic, so anything could go.

So is there any clear definition as to what stays after the creature has been undead-ified? I can see arguments for various features, and some examples of certain things like racial skill bonuses. However it still seems uncertain to me and many forums and things I have read seem mixed on what stays and doesnt.

SEO Black Hat and distribution of malware by creating pages on lots of sites targeting the name of my site

My site made with WordPress is under SEO black hat attack. They’re creating many HTML pages using my site name such as following URLs with my site title & descriptions.

  • https://aaa.example111.it/my-site-name.html
  • https://bbb.example22222222.it/my-site-name.html
  • https://ccccc.example333.it/my-site-name.html

If you click the links of Google search results, first it displays ‘checking your browser before accessing’, then redirect to the malware site zvideo-live.com. Please see the attached list (although they are in Japanese).

What’s happening is very similar to ‘Japanese keyword hack’, but the difference is my site has not hacked and they are using another domains for this. (I thoroughly checked my site and Google tools.) Actually, the users don’t have any problems as far as they click my site domain on Google search results but my site and site domain are very new and most of the search results occupy these phishy sites and it’s annoying.

I made a abuse report to Google and OVHcloud, the domain company, but the malicious pages with new domains are being added every day and it’s very hard to keep doing this.

Following are the list of the domains that hackers are using. (As far as I detect.)

acquariobeb.it areaformativaliceomiranda.it brandoleseconsulenza.it byogastudio.it calabriamediterranea.it cmtservicesrl.it computerassistancesas.it domusvenetia.it fabioviglionephotography.it flanweb.it gabriellaricciocoach.it geniusdomus.it gpad.it granfondovalledelnisi.it lamonicaservizi.it macellerialimonenicola.it onmiccatania.it orsiinchianti.it pizzapadellino-slap-torino.it retedinapoli.it ristorantelafollia.it studiobaldin.it teatrokoine.it triede20.it xtecna.it zancleartecontemporanea.it 

enter image description here

Is creating a Dimensional Plane possible in 5e without DM fiat?

I’d like to create a dimensional pocket inside my armored wagon. Duration should be permanent, but if that’s not possible longer lasting is better. It would be fine if I have to refuel it every so often.

Can wizards go about doing this, or is it up to DM fiat now?

I’m used to being able to do this in older editions through magic item creation or the spell Genesis.

Downtime Activities – Crafting and Creating Capital

Context: I’m a Player, Arcanist level 7. I have 2 weeks downtime which I want to optimize to the fullest!

According to RAW, the maximum crafting time for magic items is 8 hours each day.

Another 8 hours is sleep (which I’m not 100% sure about, since penalties for being tired ain’t too bad for downtime).

This leaves 8 hours (or more, depending on the sleep part) for other activities. The question is: can I spend those remaining 8 hours on making Magic Points (earning capital activity)?

Creating a magic item [closed]

I am creating a campaign, and I want to have a relic which allows the user to turn into a dragon for a certain amount of time. I have some ideas for rules, but I want some other suggestions.

The item will:

  1. Require attunement after each use.
  2. Require being level 10 to use it.

The idea is that at level 10, you can become a young dragon for 1 hour; at level 15 you can be a adult dragon for 1 hour, and at level 20 you can be an adult dragon for 6 hours.

It is a platinum dragon which is worth a very large amount, and is carved with draconic lettering.

Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

Per the Font of Magic feature, sorcerer can use Flexible Casting to create 5th-level spell slots at level 7, even though they are not typically available until level 9.

You can transform unexpended sorcery points into one spell slot as a bonus action on your turn. The Creating Spell Slots table shows the cost of creating a spell slot of [5th level is 7]

If such a sorcerer levels up while still having this 5th-level spell slot, can they choose a 5th-level spell as the spell they gain upon levelling up?

The Spellcasting feature states:

Additionally, when you gain a level in this class, you can choose one of the sorcerer spells you know and replace it with another spell from the sorcerer spell list, which also must be of a level for which you have spell slots.