main.php
<?php //Main PHP file of the plugin //Load or create the needed variables global $wpdb; $pluginurl = parse_url(plugin_dir_url(__FILE__))['path']; $plugindir =plugin_dir_url( dirname( __FILE__ ) ); $tablename = $wpdb->prefix.'shortcode_plugin_template'; //Execute the backend //Here you can handle all database connections, calculations and processing of requests include 'backend/counter.php'; //Output the frontend //Here you can define the HTML code that will be output in the shortcode include 'frontend/counter.php'; ?>