Formidable WP AJAX
This plugin helps fetch the data in table format from the endpoint with time intervals of one hour. Also, use WP-CLI command to override time intervals and refresh new API Data.
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/upeshv/formidable-wp-ajax/archive/refs/heads/master.zipThis plugin helps fetch the data in table format from endpoint with time intervals of one hour.
Have also added an option to override the one-hour limit and manually fetch the new data by clicking on a single button in the backend.
One can also override the hour limit using the WP CLI command since have also integrated WP CLI as well.
Have also created the facility to add table data in the frontend using shortcode inside any page.
Also added PHPunit test cases to validate the AJAX data.
Installation
- Upload the
formidable-wp-ajaxfolder to your/wp-content/plugins/directory - Activate the plugin via the Plugins menu in WordPress
- Please make sure you'r setup are on or above WP version 4.9 and PHP version 5.6.0
- Upon activation it will fetch the data in table format under admin menu Formidable WP AJAX.
Screenshots
- Backend Data Listing page.

- Settings page (Shortcode info).

- Frontend page.

CLI command to refresh data
Using Below command you can override the one-hour limit and manually fetch the new data. Setps to install WPCLi
wp frm-wp-ajax-reset
WP-CLI Success message.

PHPunit Test Cases
Have created to two test cases where in test-ajax-hook it check whether the ajax action is hooked properly or not.
phpunit // It will run all test cases together
And in second test case test-ajax-get-data check the expected results and also checking whether the ajax request runs once per hour or multiple times.
phpunit --group ajax // For running ajax specific test cases
PHPunit Success message.

Shortcode
Below shortcode is used to display table data in frontend.
[frmwpajax]
Compatibility and security
- Have followed the defined WordPress coding standards
- All the Data is been Sanitized, Escaped, and Validated.
- The plugin is compatible with WordPress version 4.9 and latest and PHP versions 5.6.0 and latest.
- WCAG 2.0 Compatibility.
- The plugin is translation-ready.
- The plugin is licensed as GPL v2 or later.
- It is not accessible directly by browsing the plugin's directory.
License
Happy Coding :smiley: