Preheat the oven to 350°F.
Grease a 9x13-inch baking pan thoroughly.
In a large mixing bowl, combine the all-purpose flour, granulated sugar, eggs, baking soda, vanilla extract, salt, undrained crushed pineapple, and chopped pecans, if using.
Stir the ingredients together until fully combined and no dry flour remains.
Pour the batter into the prepared 9x13-inch baking pan.
Spread the batter evenly into the pan and smooth the top with a spatula.
Bake for 35 to 40 minutes, or until the top is golden brown and the center is set.
Check for doneness by inserting a toothpick into the center of the cake. The toothpick should come out clean or with a few moist crumbs.
Remove the cake from the oven and keep it in the pan.