Make the Cake Batter : Preheat your oven to 350°F (175°C) and grease a 9x13-inch (23x33 cm) baking pan or two 8-inch (20 cm) round pans. In a large mixing bowl, combine the flour, granulated sugar, baking soda, and salt. Add the eggs, crushed pineapple (with juice), vegetable oil, and vanilla extract to the dry ingredients. Mix until just combined; do not overmix.
Bake the Cake : Pour the batter into the prepared pan(s). Bake in the preheated oven for 35–40 minutes, or until a toothpick inserted into the center comes out clean. Allow the cake to cool completely in the pan(s) before frosting.
Prepare the Cream Cheese Frosting : In a medium mixing bowl, beat the cream cheese and butter together until smooth and creamy. Gradually add the powdered sugar, one cup at a time, beating well after each addition. Add the vanilla extract and milk (if needed) to reach the desired frosting consistency.
Assemble the Cake : If using two round cake layers, spread a layer of frosting on top of one cake layer, then stack the second layer on top and frost the entire cake. If using a single-layer cake, simply spread the frosting evenly over the top and sides of the cake.
Add the Topping : Sprinkle the chopped pecans over the frosted cake. If desired, garnish with drained crushed pineapple for an extra tropical touch.
Chill and Serve : Refrigerate the cake for at least 30 minutes to set the frosting. Slice and serve chilled or at room temperature.