Frontity package for WP Job Openings plugin. This package enables the support for application form provided by the WP Job Openings plugin. All the default fields and the fields supported by Pro version are supported.
We have made this package for our company’s new website as we need to integrate the careers page with our own job listing WordPress plugin – WP Job Openings. There were some challenges during the development of the package. But, with the help of Frontity Team and Frontity Contact Form 7 package, this package was successfully created and published to NPM. Please suggest improvements or any issues(if any) and provide feedback on this package.
I love it! And this is something we could easily use in the future for our own careers section!
I’ve been reviewing the code. Congratulations, it looks amazing.
There are some things that are not obvious yet in Frontity. This is our fault because there are no docs yet on that. But let’s see what things can be improved
Package can add any state that they need, even for other namespaces, so you can avoid that installation step by adding that state yourself in your package:
This way, the package can be a zero-configuration package, except when people have changed the slug
4. Use low priority for your processors
I see right now you’re not using the priority field on the processors. That means that if other package, for example a theme, is trying to target the same nodes with processors to change their style, there’s no warranty that your processors will run the last ones.
I think it’s a good practice to set a priority of 20 for processors like yours that replace the HTML node with a React component.
That way, if someone is using processors for styles, they will be applied first (default priority is 10):
I see you are also duplicating the input props, like Imran and Smit did on the Frontity Contact Form 7 package:
I never find out what was the reason to do that, but I don’t think it’s needed. Those fields should be already preesnt in the node. For example, once you remove that, you can get the props like this:
The CORS issue is a shame, there’s not much we can do here. It will be solved once we release the Embedded Mode and the domain of Frontity matches the domain of WordPress though. More info on: Embedded mode
Wow! Lots of great suggestions here. I will go through these suggestions one by one and apply the same on the package. Thank you very much for the guidance @luisherranz
Awesome work! The package is now a “zero-config package”
Some other things/thoughts:
Mars theme
Have you modified mars-theme? If not, you can move it from /packages to /node_modules. Just delete the folder and add the version in the package.json file just like any other npm package. That way, the repository is cleaner and the only local package is your own package.
EDIT: Oh, I see you have because you added the job post type to the list. Don’t worry then.
I was thinking about the CORS issue. Maybe after we release the official Frontity WordPress plugin, which will contain a setting to set the URL of the site, you could do this in your PHP plugin:
Detect if the Frontity WordPress plugin is activated.