Salsox: the API key, the connection test, defaults * includes/class-salsox-form.php the form a visitor sees (shortcode and block) and its submission * includes/class-salsox-limits.php the form's rate-limit counters, safe under simultaneous requests * includes/class-salsox-rest.php the plugin's own REST routes, for the form and the block editor * * Every call to Salsox is made from the server with the site owner's API key; * the key never reaches a visitor's browser. * * The header has no plugin URI on purpose. It was https://salsox.com, the * same as the author URI, and WordPress.org refuses a plugin whose two are * equal. There is no separate plugin page to point it at, and the field is * optional. It cannot be kept here commented out: WordPress reads that * header from any comment in this file, so the old line would still count. * * Salsox for WordPress is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published * by the Free Software Foundation, either version 2 of the License, or (at * your option) any later version. It is distributed in the hope that it will * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * Public License for more details. */ if ( ! defined( 'ABSPATH' ) ) { exit; } define( 'SALSOX_VERSION', '1.0.1' ); define( 'SALSOX_FILE', __FILE__ ); define( 'SALSOX_DIR', plugin_dir_path( __FILE__ ) ); define( 'SALSOX_URL', plugin_dir_url( __FILE__ ) ); /* * Where Salsox is. Every outgoing request goes to this origin and nowhere * else. A developer testing against their own Salsox server can define it * first, in wp-config.php. */ if ( ! defined( 'SALSOX_SERVER' ) ) { define( 'SALSOX_SERVER', 'https://salsox.com' ); } require_once SALSOX_DIR . 'includes/class-salsox-api.php'; require_once SALSOX_DIR . 'includes/class-salsox-settings.php'; require_once SALSOX_DIR . 'includes/class-salsox-limits.php'; require_once SALSOX_DIR . 'includes/class-salsox-form.php'; require_once SALSOX_DIR . 'includes/class-salsox-rest.php'; Salsox_Limits::init(); Salsox_Settings::init(); Salsox_Form::init(); Salsox_Rest::init(); /* * The limit counters' table. Updates and new sites in a network are covered * by Salsox_Limits::maybe_install() on every request; activation creates it * at once, and is the fix the form suggests if the table ever goes missing. */ register_activation_hook( __FILE__, array( 'Salsox_Limits', 'install' ) ); /** A "Settings" link beside Deactivate on the Plugins screen. */ add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), static function ( $links ) { $url = admin_url( 'options-general.php?page=salsox' ); array_unshift( $links, '' . esc_html__( 'Settings', 'salsox' ) . '' ); return $links; } );