| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: WP-PostRatings |
| 4 |
* Plugin URI: https://lesterchan.net/portfolio/programming/php/ |
| 5 |
* Description: Adds an AJAX rating system for your WordPress site's content. |
| 6 |
* Version: 2.0.0 |
| 7 |
* Requires at least: 6.8 |
| 8 |
* Requires PHP: 8.2 |
| 9 |
* Author: Lester 'GaMerZ' Chan |
| 10 |
* Author URI: https://lesterchan.net |
| 11 |
* License: GPLv2 or later |
| 12 |
* License URI: https://www.gnu.org/licenses/gpl-2.0.html |
| 13 |
* Text Domain: wp-postratings |
| 14 |
* Domain Path: /languages |
| 15 |
* |
| 16 |
* @package WP-PostRatings |
| 17 |
*/ |
| 18 |
|
| 19 |
/* |
| 20 |
Copyright 2026 Lester Chan (email : lesterchan@gmail.com) |
| 21 |
|
| 22 |
This program is free software; you can redistribute it and/or modify |
| 23 |
it under the terms of the GNU General Public License as published by |
| 24 |
the Free Software Foundation; either version 2 of the License, or |
| 25 |
(at your option) any later version. |
| 26 |
|
| 27 |
This program is distributed in the hope that it will be useful, |
| 28 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 29 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 30 |
GNU General Public License for more details. |
| 31 |
|
| 32 |
You should have received a copy of the GNU General Public License |
| 33 |
along with this program; if not, write to the Free Software |
| 34 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 35 |
*/ |
| 36 |
|
| 37 |
if ( ! defined( 'ABSPATH' ) ) { |
| 38 |
exit; |
| 39 |
} |
| 40 |
|
| 41 |
/** |
| 42 |
* WP-PostRatings version. Compared against the 'plugin' marker in wp_postratings_version. |
| 43 |
*/ |
| 44 |
define( 'WP_POSTRATINGS_VERSION', '2.0.0' ); |
| 45 |
|
| 46 |
/** |
| 47 |
* Schema counter. Compared against the 'db' marker in wp_postratings_version. |
| 48 |
* |
| 49 |
* Starts at 3 rather than 1 because it replaces two separate counters that |
| 50 |
* existed before 2.0.0 -- postratings_db_version, which had reached 2, and |
| 51 |
* postratings_options_version, which had reached 3. Taking the higher of the |
| 52 |
* two means no installed site is ever told its schema went backwards. |
| 53 |
*/ |
| 54 |
define( 'WP_POSTRATINGS_DB_VERSION', '3' ); |
| 55 |
|
| 56 |
/** |
| 57 |
* Plugin slug, text domain and menu slug. |
| 58 |
*/ |
| 59 |
define( 'WP_POSTRATINGS_SLUG', 'wp-postratings' ); |
| 60 |
|
| 61 |
/** |
| 62 |
* WP-PostRatings main file. |
| 63 |
*/ |
| 64 |
define( 'WP_POSTRATINGS_MAIN_FILE', __FILE__ ); |
| 65 |
|
| 66 |
/** |
| 67 |
* Filesystem path of the plugin directory, with a trailing slash. |
| 68 |
*/ |
| 69 |
define( 'WP_POSTRATINGS_DIR', plugin_dir_path( __FILE__ ) ); |
| 70 |
|
| 71 |
/** |
| 72 |
* URL of the plugin directory, with a trailing slash. |
| 73 |
*/ |
| 74 |
define( 'WP_POSTRATINGS_URL', plugin_dir_url( __FILE__ ) ); |
| 75 |
|
| 76 |
/** |
| 77 |
* Left over from the image sets, which 2.0.0 replaced with SVG shapes. |
| 78 |
* |
| 79 |
* Renamed from RATINGS_IMG_EXT, which carried no plugin prefix. There is no |
| 80 |
* file extension left to choose, so nothing in the plugin reads it; it is |
| 81 |
* defined only so a theme that still does gets an answer rather than a notice. |
| 82 |
*/ |
| 83 |
if ( ! defined( 'WP_POSTRATINGS_IMG_EXT' ) ) { |
| 84 |
define( 'WP_POSTRATINGS_IMG_EXT', 'svg' ); |
| 85 |
} |
| 86 |
|
| 87 |
require_once __DIR__ . '/includes/class-wp-postratings-shapes.php'; |
| 88 |
require_once __DIR__ . '/includes/class-wp-postratings-options.php'; |
| 89 |
require_once __DIR__ . '/includes/class-wp-postratings-data.php'; |
| 90 |
require_once __DIR__ . '/includes/class-wp-postratings-api.php'; |
| 91 |
require_once __DIR__ . '/includes/class-wp-postratings-install.php'; |
| 92 |
require_once __DIR__ . '/includes/class-wp-postratings-template.php'; |
| 93 |
require_once __DIR__ . '/includes/class-wp-postratings-rating.php'; |
| 94 |
require_once __DIR__ . '/includes/class-wp-postratings-blocks.php'; |
| 95 |
require_once __DIR__ . '/includes/class-wp-postratings-comments.php'; |
| 96 |
require_once __DIR__ . '/includes/class-wp-postratings-stats.php'; |
| 97 |
require_once __DIR__ . '/includes/class-wp-postratings-widget.php'; |
| 98 |
require_once __DIR__ . '/includes/class-wp-postratings-wpstats.php'; |
| 99 |
require_once __DIR__ . '/includes/class-wp-postratings-settings.php'; |
| 100 |
require_once __DIR__ . '/includes/class-wp-postratings-admin.php'; |
| 101 |
require_once __DIR__ . '/includes/class-wp-postratings.php'; |
| 102 |
require_once __DIR__ . '/includes/template-tags.php'; |
| 103 |
require_once __DIR__ . '/includes/deprecated.php'; |
| 104 |
|
| 105 |
// class-wp-postratings-logs-table.php is loaded on demand by the log screen: it |
| 106 |
// pulls in wp-admin/includes/class-wp-list-table.php, which has no business |
| 107 |
// being loaded on a front end request. The two classes above only *register* |
| 108 |
// hooks when is_admin(), so loading them costs a file read and nothing else -- |
| 109 |
// and it keeps them reachable from the test suite, which does not run as admin. |
| 110 |
|
| 111 |
WP_PostRatings::get_instance(); |
| 112 |
|